Server Error in '/' Application.
Cannot open database "
" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
http://www.codetoday.net/default.aspx?g=posts&t=1595
Wednesday, October 5, 2011
Server Error in '/' Application.
Tuesday, April 12, 2011
HOW TO FIX : Airport has a self-assigned IP address.
HowTo fix: Airport has a self-assigned IP address and may not be able to connect to the internet.
My girlfriend could not connect to our network, and Airport told her: Airport has a self-assigned IP address and may not be able to connect to the internet.
The problem was that her mac would self-assign a IP address, 169.x.x.x and Subnet Mask: 255.255.0.0. It seemed to be connected to our Time Capsule, though it did not get a IP address by the DHCP server. I tried renewing the DHCP but that did not work. I also tried accessing a ip address, as it could be an DNS error, this was not the case either.
Problem solving
I fixed the problem by manually setting up the network settings, to make sure they matched my own in, DNS Server, Router, Subnet Mask, and IP address +1. That worked but this could only be a temporarily solution as she uses her mac multiple places.
So I adventured out into the great indexed space of google to find a solution to the problem. As it turned out quite a few people was addressing the problem, and it seems to be a problem that Apple have had this problem for quite a while. In my search I found the problem has occured in an update to Apple OS X Leopard somewhere between update version 10.5.2 and 10.5.6. While the mac in question is at OS X 10.5.8 the problem still seems unsolved by Apple.
To fix the problem with Airport self-assigned IP it tried the following.
1. Booting into SAFE BOOT by restarting the mac and pressing the shift key.
2. In safe boot deleted the SystemConfiguration folder in this location:
Macintosh HD>Library> Preferences
This folder contains information from the System Preferences, and will be reconstructed if it is not found in the path. In my case it contains the following files, that I found should be deleted if I could not remove the entire folder:
- com.apple.airport.preferences.plist
- com.apple.network.identification.plist
- NetworkInterfaces.plist
3. I opened Keychain Access and found all the information about the network I was trying to access, and removed the login information by deleting the key. It appeared both in login and system. You can access Keychain Access, by opening Spotlight and type Keychain Access (this even works if your system is configured for another language than English).
4. Restarted the mac and voilár it worked…..but only shortly after a test restart the problem was back on again.
Solution
I finally found the solution which was very simple. The solution in this case was to:
- Turn off Airport
- Switch off the built-in firewall (found in: System Preferences>Security>Firewall), I set it to allow all incoming connections.
- Turn Airport back on again….and it worked
I tested this solution to work, and it worked after a restart as well. I have no clue to what caused the problem, however, I hope that this information will be of value to others as well.
Tagged: Airport, IP, network, self-assigned
Sunday, January 16, 2011
Android ProgressBar source code sample
The HowTo
To implement a ProgressBar, a Runnable Thread is used transmitt a message to a Handle to move the progress forward in the ProgressBar.
To do it we'll have to modify the XML layout file main.xml (under res/layout) to add those two ProgressBar.
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressbar_default"
/>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal"
android:id="@+id/progressbar_Horizontal"
android:max="100"
/>
Once finished with the layout file, we modify the main java file (MainActivity here) like this:
package com.wikinut.android;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.ProgressBar;
public class MainActivity extends Activity {
ProgressBar myProgressBar;
int myProgress = 0;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myProgressBar=(ProgressBar)findViewById(R.id.progressbar_Horizontal);
new Thread(myThread).start();
}
private Runnable myThread = new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
while (myProgress<100){
try{
myHandle.sendMessage(myHandle.obtainMessage());
Thread.sleep(1000);
}
catch(Throwable t){
}
}
}
Handler myHandle = new Handler(){
@Override
public void handleMessage(Message msg) {
// TODO Auto-generated method stub
myProgress++;
myProgressBar.setProgress(myProgress);
}
};
};
}
Run that as usual and you should have something similar to this:
Monday, January 3, 2011
iPhone Sample code
Logging
Display Images
Application Frame
Web view
Display the Network Activity Status Indicator
Animation: Series of images
Animation: Move an object
NSString and int
Regular Expressions (RegEx)
Draggable items
1. Create a new class that inherits from UIImageView
Vibration and Sound
Threading
Reading crash logs
Testing
2. Be sure to test your app in Airplane Mode.
Access properties/methods in other classes
Random Numbers
Timers
1. First create the Timer