Tuesday, May 25, 2010

Beware of Webex fine prints

When you signup for a new service, you should pay extra attention to the following in your receipt.

Your monthly subscription will renew automatically with the same terms, beginning on month 2.

I don't have a problem with above, but, they don't send you the invoice for the second (or subsequent) month until after they have charged the payment to your credit card, by that time it's too late to cancel (you already have paid for the month you may not need).

Worst still, it will take you some effort to get your service cancelled.
Needless to say I'm going to look elsewhere for similar service from now on.

Tuesday, August 25, 2009

Backing up and Restoring Windows Installation using Open-source/free tools

The other day, I was hit with some virus that took over my Primary Machine (DELL XPS M1330) with Windows XP SP3 on it.

Tried restoring the Machine using a Full Windows Backup that I took just the previous day, without any success. Tried all kinds of tools to remove the virus, but, the damn thing will just not go away.

Tried Malwarebytes' Anti-Malware, Avira AntiVir Rescue System and several others, needless to say nothing worked.

Finally, I ended up re-intalling the OS, applied all the windows updates, Hardware Drivers and all, took me hours to get my machine working again.

There is an "Advanced Mode" in Windows Accessories->System Tools->Backup which will help you choose what files you want to restore from your backup set. Using that, I was fortunate enough to recover all my data.



Anyway, this whole fiasco prompted me to seriously start looking at the "Ghosting" solutions that will minimize the effort to restore the whole system without much pain.

This is what I ended up doing, I was able to Restore the whole OS (with all the programs and settings) to a new hard disk also, so it worked.

1. Download and Install DriveImage XML free edition.

2. Create a BKUP_DRIVE_C.BAT command file in notepad with the following tex in it.

del E:\Images\DriveC.dat
del E:\Images\DriveC.xml
"C:\Program Files\Runtime Software\DriveImage XML\dixml.exe" /bc /tE:\Images\DriveC /r- /s- /c /v

where E: is a USB drive with large enough free space to store all data on your C: drive.

3. Run the command file (should run for 20-30 minutes depending on the size of your data on C:). Took 19 minutes for me to backup 35GB

4. Download and Install Ultimate Boot CD for Windows, you will need your Windows XP installation CD to create a Bootable disk with Ultimate Boot CD.

Needless to say, you should do steps 1-4 before your OS/Disk gets screwed:D

5. When ready to recover your OS (or trying to create a clone of the existing good OS installation, or replace a bad hard drive), just pop in your bootable UBCD4WIN that you created in step 4 and run DriveImage XML once your machine boots into Windows. Use the "RESTORE" option. You should be able to restore the whole system in 40-50 minutes.

Few things to keep in mind:
i. DriveImage XML free edition will not restore to a Hard Disk with smaller overall size than the original one,e.g., if your Backup was created with on a 250GB Disk, you will not be able to RESTORE that to a 120GB Disk, even if you actual data size (to restore) is only 30GB.
ii. After you are done running the restore, don't forget to mark you disk "Active" using "Windows Disk Management" tool that is included in DriveImage.
iii. If you get the following error trying to boot with the restored disk:

"Windows could not start because of disk hardware configuration problem. Could not read the selected boot disk. Check the boot path and disk hardware."

Do the following:
1.Boot you computer with Windows XP CD
2.When given the option to Install OS, press "R" to enter Windows Recovery Console
3.Select the windows installation and enter the Admin password when prompted
4.Once logged in, type bootcfg /rebuild at C:\WINDOWS prompt.
5. Follow the direction on the following Microsoft KB article


You OS should boot without any problem now, mine did!

Saturday, July 25, 2009

School Finder




Actual site

Currently works for a GA, FL, KS, KY, NY, NJ, NC, MA and CA.



I've used Public schools data from schooldatadirect.org site. Data is a couple of years old, but, still useful.


Comments and suggestions welcome!

Sunday, July 12, 2009

Amfphp and "Client.Error.DeliveryInDoubt" error

While working on a recent Flex application that uses amfphp remoting to get data back from the database, I came across the following error:

[RPC Fault faultString="Channel disconnected" faultCode="Client.Error.DeliveryInDoubt" faultDetail="Channel disconnected before an acknowledgement was received"]

After several hours of googling for the solution, couldn't find anything.
So, I just started changing the method signatures on my PHP functions and finally, I was able to get this thing to work.

The key is to change the php function to accept a parameter of "Object" type, i.e., an array of name-value pairs.

Intially my method signature looked like the following:

public function getSchools($districId, $zipCode) {
....
}

Then, I changed it to the following and every thing worked like a charm.
public function getSchools($args) {
$districId = $args['districId'];
$zipCode = $args['zipCode'];
....
}


It was tha simple.

I also had to change the Remote Object method call inside my Flex application from :

srv.getSchools(districId, zipCode);


To, the following:
var params:Object = new Object();
params.districId = String(districId);
params.zipCode = String(zipCode);
srv.getSchools(params);



I think you can fix similar errors in Zend Framework or WebOrb remoting also, although, I have tested those myself.

That was all. Happy Flexing.

Friday, May 29, 2009

Size of a BLOB value in MySQL

Use the following query to get the Size of Image column for each row. "Image" is a column defined as MEDIUMBLOB in a MySQL database

Select ID, name, OCTET_LENGTH(Image) from catalog


Was very useful in making sure my PHP script to upload Images to the database was working okay or not!

Friday, March 6, 2009

SASIxp and SQL Server express

SASIxp is a widely used and one of the most popular Student Information System by Pearson School Systems.

I have been working with SASI for the last 10+ years. It's very good at what it is supposed to do, but, there are inherent limitations because of SASI using dBase files for data storage and not a real RDBMS.

We are always in need of getting the Data out of SASI and use it for input of other applications that need SASI data, or for running various customized reports.

One way to maximize your data usability is to extract the required pieces of information from SASI and load it up to a real RDBMS database. Thereafter, the data can be used in any way we want.

I will show the basics of getting SASI data loaded to Sql Server database.

I prefer to use Microsoft Sql Server in my example. There is a freely available SQL Server Express version available for download from Microsoft. This version has some limitations, like maximum database size limit of 4GB, but, it's perfect for our purposes as 4 gigs is more than what a 15-20K student population school system will need.

So, let's get started ...

First, download and install the Sql Server Express. Also, install the SQL Server Management studio express.

Next, login to the SQL Server in Management studio, create a database called SASI locally, you can use the system defaults for the purpose of creating the database.

Next step is to create a Linked Server to access SASI dBase files directly as normal database tables. Use the following script to create a Linked server:

EXEC sp_addlinkedserver
'sasifiles',
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'D:\SASIxp\Datafiles',
NULL,
'dBase IV'
GO

exec sp_addlinkedsrvlogin
@rmtsrvname = 'sasifiles',
@useself = false,
@locallogin = NULL,
@rmtuser = NULL,
@rmtpassword = NULL
GO

Once you have the Linked Server created, you can run simple queries against your dBase files direcly from Managemnet Studio's query window.

For example, if you want to query the ASTU (student) table for School year 2008-2009 and for school code 101, you would run the following query:

select * from openquery(sasifiles, 'select * from ASTU8101')

As you can see, you SASI data just got much more accessible.

In the next post, I will show you how to get basic demographic and attendance data from SASI to SQL Server tables and run some Enrollment/Attendance reports right in your query window in Management Studio.