Monday, October 26, 2009

Limit the number of selected checkboxes in javascript

If you have multiple checkboxes:

Html Code




Mac OS X
Linux
Windows





You can get the count using this:

JavaScript Code:



var cnt=0

function check(obj,maxs){
if(obj.checked){
cnt=cnt+1
}else{
cnt=cnt-1
}

if (cnt>maxs){
obj.checked=false
cnt=cnt-1
alert('Can only select up to '+maxs)
}
}

Limit the number of selected checkboxes in javascript

Html Code


Mac OS X
Linux
Windows




JavaScript Code:

Change Ubuntu Server from DHCP to a Static IP Address

If the Ubuntu Server installer has set your server to use DHCP, you will want to change it to a static IP address so that people can actually use it.

Changing this setting without a GUI will require some text editing, but that’s classic linux, right?

Let’s open up the /etc/network/interfaces file. I’m going to use vi, but you can choose a different editor

sudo vi /etc/network/interfaces

For the primary interface, which is usually eth0, you will see these lines:

auto eth0
iface eth0 inet dhcp


As you can see, it’s using DHCP right now. We are going to change dhcp to static, and then there are a number of options that should be added below it. Obviously you’d customize this to your network.

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1


Now we’ll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

On the line ‘name server xxx.xxx.xxx.xxx’ replace the x with the IP of your name server. (You can do ifconfig /all to find out what they are)

You need to also remove the dhcp client for this to stick (thanks to Peter for noticing). You might need to remove dhcp-client3 instead.

sudo apt-get remove dhcp-client

Now we’ll just need to restart the networking components:

sudo /etc/init.d/networking restart

Ping www.google.com. If you get a response, name resolution is working(unless of course if google is in your hosts file).

Source

Friday, October 23, 2009

Ubuntu 8.04 (Hardy Heron) LAMP Server Setup

Please visit this link for the full documentation:

http://www.scribd.com/doc/21499447/Installing-Ubuntu-8?secret_password=14l3jve0xyocuoimryor

Class does not support aggregation in SQL Server Studio

TITLE: Microsoft SQL Server Management Studio
------------------------------

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)

------------------------------

Solution:

Remove Workstation componenents, then do a repair on Net Framework 2.0 then Re-Install workstation components.

Steps to Remove Workstation componenents and repair the .NET Framework installation

1. Click Start, click Control Panel, select Add or Remove Programs:
Find Microsoft SQL Server 2005 and click remove.
On the window check Workstation Components, click Next..etc
(Don't worry it wont delete the whole installation only this component)

2. Before repairing .Net Framework 2.3,You must 1st obtain the original installation source. For example, if you installed the .NET Framework from a CD-ROM or from a DVD, insert that disc. If you downloaded the .NET Framework , download the .NET Framework again. Make sure that you click save to disk. If you installed the .NET Framework from a network share, reconnect to that share.

3. Back to Add or Remove Programs select Microsoft .Net Framework 2.0
and click change/remove button, and select repair.

The Microsoft Windows Installer will verify and repair the .NET Framework installation.

4. Reinstall Workstation Components by obtaining the original installation source. You can select all available components or just the Workstation Components in the installation process.