Home
About
Color Tool
 

Share Wonders is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
11 queries. 0.393 seconds.
Valid XHTML

Archive for the 'webdev' Category

Failed to update database because the database is read-only

Sunday, January 28th, 2007

Did you get that error while working with ASP.NET 2.0? Something about aspnetdb.mdf or something? Here’s the solution:

(I’m assuming you’re on Windows XP)

1) Open up My Computer or any folder in Windows Explorer.
2) Go Tools -> Folder Options
3) Select the View Tab
4) Scroll down to the bottom and un-check the box that says ‘Use simple file sharing (Recommended)’ - it’s recommended to be checked for your grandma, not a ASP.NET developer like yourself.
5) Go to your website in Windows Explorer, probably C:/Inetpub/wwwroot/yourVirtualDirectory
6) Copy all the files and directories there to some other place, like your desktop.
7) Delete all the files in that directory/website. If it says not allowed, it’s because some process is accessing the file. Try shutting down the website, closing any windows you have open, and as a last resort restart your computer.
9) Delete the virtual directory/website in IIS, and then recreate it, giving it the same permissions - read, write, script, whatever.
8) Cut all the files you copied before you deleted them, and put them back in that directory.
9) View the physical directory in windows explorer, probably in C:/Inetpub/wwwroot/
10) Right click on it, select ‘properties’ and then select the security tab. Add the IUSR and ASPNET users and give them write access. If you don’t know what those users look like, check one of your other applications/virtual directories/websites, by selecting the properties window and clicking on the security tab and seeing what users have access.
11) Rebuild and view site. It should work now.

If you’re like me you probably just copy and paste the error in Google Search and now you’ve found this site and you’re pissed and maybe you’ve spent an hour or two searching and you still haven’t figured it out.

You’re probably ready to never use ASP.NET again.

You’ve probably already been to this site, and this one, and they didn’t help. Maybe you also hit up some forums like this one.

They probably said something like ‘change security settings’ and you’re running around the properties window for your files and directories finding nothing.

Hopefully my steps have helped. If not, good luck with your search.

Stay Away from Microsoft Press’s ASP.NET 2.0 Step By Step

Saturday, January 20th, 2007

ASP.NET 2.0 Step By Step I have ever encountered. It is written terribly, there are tons of spelling mistakes in the example code.

The official list of corrections names only seven errors, but I have found that many in just one example. Every chapter is populated with them. Some of them are just really sloppy like extra quotes in strings and who knows what. If you type the code in examples as is, often it wont compile. I have spent hours debugging code in the book. The CD comes with example code (first of all, it doesn’t even install to where the book says it will install), but that code is the finished code, and yes it works, but you don’t get the step by step from it.

It’s just very poorly done, and the writer should really never write another programming book again. Had I been smart and read it got on Amazon.com, maybe I would have bought a Wrox book instead.

A new version of Chris Pedrick’s Web Developer is Out - Get it.

Wednesday, January 10th, 2007

If you opened up Firefox 2 today and already have Web Developer installed, you will probably have been greeted with a pop up saying an update is available. Chris Pedrick’s tool is a must have for any serious web developer.

My favorite new change:

Chris Pedricks Web Developer 1.1

You can remove the text and have icons only! Yay! Maybe it isn’t new, I honestly haven’t played with the options much, but this update has inspired me to try it out. You can also move buttons from the Web Developer toolbar and move them onto other places on Firefox’s chrome using the ‘customize’ feature in Firefox. That is you can modify and move the icons and buttons for Web Developer like you can standard Firefox icons and buttons that come with the browser such as ‘home’ and ‘print’. This is a great feature. If you take a look at that screenshot up there (click on it) you’ll see that I use the Google Toolbar but that I don’t have the toolbar enabled. Instead I have moved the features I use the most often from the toolbar to the browser’s menu bar and I get to save valuable screen real estate. I can do this with Web Developer too! More space for content! Yay! Let’s celebrate. Parteeh. I like to give a shout out to all my peeps at code4lib and netlamers who supported me through the writing of this article. And also pour some of your 40 on the ground for all those dogs who can’t be here this night because they’re busy chasing bad pointers, troubleshooting errand non-blocking error states, or busy making sure some student can find obscure documents ten institutions away that they’ll never need. kkggkthxbi

Beginning Python Links and Tutorials

Monday, January 1st, 2007

I have been learning Python for a few weeks now and here is a list of some essential links and tutorials for beginners. You would probably find these just by poking around Python’s site and Googling, but I thought they were helpful so some linkage is in order.

Dive Into Python
Python Tutorial
How to Think Like a Computer Scientist
Learn to Program
Python Types and Objects
Python 2.4 Quick Reference (latest version is 2.5, but in Ubuntu the default in the repositories is 2.4 - you can get it by looking for python2.5 - there’s a big difference between the two).
Python Frequently Asked Questions
Python Library Reference
Python Reference Manual
Python SOAP Libraries
Python Style Guide
Python Unicode Tutorial
Python Regular Expression HOWTO
Selected Python Articles
Python Database Topic Guide
Python Cookbook

I hope these links will help you as much as they helped me.

XSLT: tAsc 1.0 - An AJAX Powered JavaScript XSL Transformation Script

Wednesday, May 17th, 2006

I made tAsc 1.0 today. It is an AJAX powered JavaScript XSL Transformation (XSLT) script for Gecko browsers and Internet Explorer (6 & 7). I have made it very easy to use. Just follow the instructions in the beginning comments. All you need is a blank HTML page, and a preexisting XML file and its accompanying XSL stylesheet. There may be something like this out there already, probably better, but I wanted to learn how to do this and so I made this script and it works well.

Here is an example of tAsc 1.0. It works well in recent Gecko browsers (FireFox 1.5, Camino, Epiphany, etc) and IE6. It should also work in IE 7, but I haven’t tested it there yet. Let me know if you see any bugs or have any concerns. This script does not require any other libraries of any sort. It comes with an MIT License.

Here is the code:

/***********************************************
************************************************
NAME: tAsc v 1.0

DESCRIPTION:
An AJAX powered JavaScript XSL Transformation script
for Gecko browsers and Internet Explorer (6 & 7).

AUTHOR: Bjorn Tipling

EMAIL: bjorn (at) ambientchill (dot) com
Please use this email for bugs.

WEBSITE: https://sharewonders.com

LICENSE: MIT
http://www.opensource.org/licenses/mit-license.php

USAGE:
Create a basic HTML page with nothing within
the body tags. Link to this javascript file by
placing this in the header:

The tag should look like this:
with the same
id and and onload values.
Give xslFile and xmlFile the names of the xsl file
and the xml file respectively.

NOT ALL BROWSERS ARE CAPABLE OF JAVASCRIPT XSL
TRANSFORMATIONS. WILL ONLY WORK WITH LOCAL FILES.

************************************************
************************************************/

//Change these to the correct values:
var xslFile = ‘test.xsl’;
var xmlFile = ‘test.xml’;

var xmlGlobal;
var xslGlobal;
var xsltProcessorGlobal = new XSLTProcessor();

function start(){

var IE = document.all?true:false;

if(IE){
// Load XML
ieGetXML(’test.xml’);
}else{
// load the xslt file, test.xsl
ffGetXSL(xslFile);
}
}

function ffGetXSL(filename){
var httpRequest = new XMLHttpRequest();
httpRequest.open(”GET”, filename, true);
httpRequest.send(null);
httpRequest.onreadystatechange = function(){
if (httpRequest.readyState==4) {
xslGlobal = httpRequest.responseXML;
xsltProcessorGlobal.importStylesheet(xslGlobal);
// load the xml file, test.xml
ffGetXML(xmlFile);
}
}
}

function ffGetXML(filename){
var httpRequest = new XMLHttpRequest();
var fragment;
httpRequest.open(”GET”, filename, true);
httpRequest.send(null);
httpRequest.onreadystatechange = function(){
if (httpRequest.readyState==4) {
xmlGlobal = httpRequest.responseXML;
//do the transformation:
fragment = xsltProcessorGlobal.transformToFragment(xmlGlobal, document);
document.getElementById(”myBody”).innerHTML = “”;
document.getElementById(”myBody”).appendChild(fragment);
}
}
}

function ieGetXML(filename){
if (window.XMLHttpRequest)
{
var httpRequest = new XMLHttpRequest;
httpRequest.open(”GET”, filename, true);
httpRequest.send(null);
}else{
try {
httpRequest = new ActiveXObject(”Msxml2.XMLHTTP”);
} catch (e) {
try {
httpRequest = new ActiveXObject(”Microsoft.XMLHTTP”);
} catch (e) {}
}
}
httpRequest.onreadystatechange = function(){
var string;
if (httpRequest.readyState==4) {
xmlGlobal = httpRequest.responseXML;
ieGetXSL(xslFile);
}
}
httpRequest.open(”GET”, filename, true);
httpRequest.send(null);
}

function ieGetXSL(filename){
if (window.XMLHttpRequest)
{
var httpRequest = new XMLHttpRequest;
httpRequest.open(”GET”, filename);
httpRequest.send();
return httpRequest.responseXML.xml;
}else{
try {
httpRequest = new ActiveXObject(”Msxml2.XMLHTTP”);
} catch (e) {
try {
httpRequest = new ActiveXObject(”Microsoft.XMLHTTP”);
} catch (e) {}
}
httpRequest.onreadystatechange = function(){
var piece;
var string;
if (httpRequest.readyState==4) {
xslGlobal = httpRequest.responseXML;
piece = xmlGlobal.transformNode(xslGlobal);
document.getElementById(”myBody”).innerHTML = piece;
}
}
httpRequest.open(”GET”, filename, true);
httpRequest.send(null);
}
}

JavaScript: Easing Animation Formula

Thursday, May 11th, 2006

This page is an example of easing with JavaScript. Easing is slowing the transition of a moving object as it nears its intended destination. It looks much nicer than just a consistent rate of movement and a sudden and hard stop. When you put the breaks to your car as you near a red light, you slow down gradually. Imagine just going all the way to the stopline at the same speed you were driving and then just suddenly halting. Easing with JavaScript is more subtle than not slamming your breaks, but it is noticable.

The formula for easing is somewhat simple in Javascript, but you may have to tweak it a bit. With ActionScript in Flash it is much more straightforward: the speed of movement is half the distance. So if you’re 500 pixels away from your destination, you’re moving at 250 pixels per transition, at 499 you’re moving at (499/2):
rate = (distance - currentPosition)/2
currentPosition += rate

I still haven’t gotten it to look just the way I want it to, and I’m still using setTimout, and I am only experimenting, but here is my code:

distancePerInterval = Math.ceil((destination - parseInt($('mover').style.left))/32);

Not quite the same thing. It also does not move at the same speed in all browsers. In Firefox it is too fast, in IE it is too slow.
I will keep playing with it to see if I can get it to be just the way I want it.

 

Share Wonders

Look out honey, because I’m using Technology