Pages

Wednesday, May 30, 2007

The new Microsoft Surface

Surface is the first in a new category of surface computing products from Microsoft that will “break down traditional barriers between people and technology”. A Surface computer is able to recognize physical objects from a paintbrush to a cell phone and allows hands-on, direct control of content such as photos, music and maps. how cool is that? Surface turns an ordinary tabletop into a dynamic surface that provides interaction with all forms of digital content through natural gestures, touch and physical objects.

It took them 6 years to materialize this from the concepts and ideas. Perhaps the best way to visualize this is by video below.



Check out Microsoft Surface's Virtual Pressroom for more information. Looks like we're already in the future. I personally would like to have this as my home coffee table.

Byte Order Mark (BOM) Tales

Recently I encountered a problem that I never seen before. There is no error display on the system except this weird character ÿþ. I remember searching for the log files looking for clues but nothing could be relate to this character. Later I found out this ÿþ character is an encoding signature called byte order mark or BOM for a file, in this case it's a XSL transformation file. Generally, it's a particular sequence of bytes at the beginning of the file that indicates the encoding and the byte order. For example any file with this particular encoding will have a different BOM:

UTF-8 - EF BB BF - 

UTF-16LE - FF FE - ÿþ

UTF-16BE - FE FF - þÿ

The W3C specify that all XML processor must read the UTF-8 and UTF-16 encoding. This text explain that to differentiate between UTF-8 and UTF-16 a BOM must be present, and that the BOM must be used by the parser as encoding signature. Other encoding may be supported, but no parser is required to have support for all of them, or one in particular, besides the UTF-8 and UTF-16.

This encoding signature is not to be displayed, any tool that support Unicode will understand this and will not show this to you nor consider it to be part of the text file. By checking the Hexadecimal of the file or opening the file in a non-unicode text editor will give you those characters presented in the above.

Now I know what the meaning of the character, but now how could I relate this information to the current problem? Read on...

With IE and MSXML, there are two really common errors that happen when something is not correct with the steps defined below.

An invalid character was found in text content

A parser found a character on your file that is not according the encoding declaration or the BOM specified for that file. If you have character encoded with ISO-8859-1 and then speficy the UTF-8 on the encoding declaration, this will issue the error.

Switch from current encoding to specified encoding not supported

In a basic thinking this error is almost identical to the previous, the only thing is that the parser understands that the real encoding on the file is different from the one in the encoding declaration. What the error is trying to tell you is that it can’t make the switch from the file encoding to the one you specify on the encoding declaration.

Let say if a file encoded as UTF-8 and a text encoding of UTF-16, since UTF-16 must always be two bytes, the parser known forehand that something is wrong with the encoding.

So in my case, it was the first one, character encoded with ISO-8859-1 and then speficy the UTF-8 on the encoding declaration. Case close.

Note: If none works, maybe you should consider re-install the MSXML parser according to your code, because each version has different coding requirement.

Monday, May 21, 2007

Restoring MS SQL Database From .mdf File

Imagine this scenario, you are planning to reformat your SQL server which has 50 databases and all data and log files stored in SAN system. What is the faster way to restore all the databases once you had finish installed the OS and SQL server? I used to backup one by one using the backup and restore database tool. But recently I found a faster way which could save lot of time.

The method is simple enough that I feel stupid not to know this. All you have to do is attach the .mdf file to the SQL Server. How? Open the SQL Server Enterprise Manager, open the tree (Console Root > Microsoft SQL Servers > SQL Server Group > (Your SQL Server) > Database) right-click on the database and select All Tasks > Attach Database. And then, just select the .mdf file, click OK and you are done. The process is almost instantaneous. So for 50 databases you could finish it less than 2 minutes.


If you're not sure what I'm talking about, you could always start with the default database ship with SQL Server. Right cilck on the Northwind database and select All Task > Detach Database
. After that follow the step above.

Good luck.

Friday, May 11, 2007

Snap-in failed to initialize in SQL 2000 MMC

I had this problem recently and this problem causing the Microsoft Management Console (MMC) for SQL 2000 fail to load all database. This is all caused by uninstalling MSSQL 2005 server which was at the same time has another version of MSSQL 2000 server installed. At first I thought the MSSQL is corrupted, however the database remain intact and accessible through SQL service or ODBC. So this must be something to do with MMC alone, and it was. Luckily the solution is simple enough.

All I have to do is reregistering the sqlmmc.dll located in the C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

Just run this command

regsvr32 C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqlmmc.dll


That did the trick for me. There are lot of trouble related to MSSQL that I have not discovered yet, maybe I should take the MSSQL professional course.

Monday, May 07, 2007

Useful Windows Tools from Sysinternals

I discover this utilities by accident, well someone told me about it. Sysinternals web site was created in 1996 by Mark Russinovich and Bryce Cogswell to host their advanced system utilities and technical information. Eventually Microsoft acquired Sysinternals in July, 2006. Sysinternals utilities helps you manage, troubleshoot and diagnose your Windows systems and applications. I haven't tried it all but I think I want to share it here. Check it out.

File & Disk Utilities

AccessChk
This tool shows you the accesses the user or group you specify has to files, Registry keys or Windows services.

AccessEnum
This simple yet powerful security tool shows you who has what access to directories, files and Registry keys on your systems. Use it to find holes in your permissions.

CacheSet
CacheSet is a program that allows you to control the Cache Manager's working set size using functions provided by NT. It's compatible with all versions of NT.

Contig
Wish you could quickly defragment your frequently used files? Use Contig to optimize individual files, or to create new files that are contiguous.

DiskExt
Display volume disk-mappings

Diskmon
This utility captures all hard disk activity or acts like a software disk activity light in your system tray.

DiskView
Graphical disk sector utility

Du
View disk usage by directory

EFSDump

View information for encrypted files

Filemon
This monitoring tool lets you see all file system activity in real-time.

Junction
Create Win2K NTFS symbolic links

LDMDump
Dump the contents of the Logical Disk Manager's on-disk database, which describes the partitioning of Windows 2000 Dynamic disks.

MoveFile
Schedule file rename and delete commands for the next reboot. This can be useful for cleaning stubborn or in-use malware files.

NTFSInfo
Use NTFSInfo to see detailed information about NTFS volumes, including the size and location of the Master File Table (MFT) and MFT-zone, as well as the sizes of the NTFS meta-data files.

PageDefrag
Defragment your paging files and Registry hives!

PendMoves
See what files are scheduled for delete or rename the next time the system boots.

Process Monitor
Monitor file system, Registry, process, thread and DLL activity in real-time.

PsFile
See what files are opened remotely

PsTools
The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

SDelete
Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.

ShareEnum
Scan file shares on your network and view their security settings to close security holes.

Sigcheck
Dump file version information and verify that images on your system are digitally signed.

Streams
Reveal NTFS alternate streams

Sync
Flush cached data to disk

VolumeId
Set Volume ID of FAT or NTFS drives

Networking Utilities

AdRestore
Undelete Server 2003 Active Directory objects

PsFile
See what files are opened remotely

PsTools

The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

ShareEnum
Scan file shares on your network and view their security settings to close security holes.

TCPView
Active socket command-line viewer.

Whois
See who owns an Internet address.

Process Utilities

Autoruns
See what programs are configured to startup automatically when your system boots and you login. Autoruns also shows you the full list of Registry and file locations where applications can configure auto-start settings.

Filemon
This monitoring tool lets you see all file system activity in real-time.

Handle
This handy command-line utility will show you what files are open by which processes, and much more.

ListDLLs
List all the DLLs that are currently loaded, including where they are loaded and their version numbers. Version 2.0 prints the full path names of loaded modules.

Portmon
Monitor serial and parallel port activity with this advanced monitoring tool. It knows about all standard serial and parallel IOCTLs and even shows you a portion of the data being sent and received. Version 3.x has powerful new UI enhancements and advanced filtering capabilities.

Process Explorer

Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This uniquely powerful utility will even show you who owns each process.

Process Monitor
Monitor file system, Registry, process, thread and DLL activity in real-time.

PsExec
Execute processes remotely.

PsKill
Terminate local or remote processes.

PsList
Show information about processes and threads.

PsService
View and control services.

PsSuspend
Suspend and resume processes.

PsTools
The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

Regmon
This monitoring tool lets you see all Registry activity in real-time.

Security Utilities

AccessChk
This tool shows you the accesses the user or group you specify has to files, Registry keys or Windows services.

AccessEnum
This simple yet powerful security tool shows you who has what access to directories, files and Registry keys on your systems. Use it to find holes in your permissions.

Autologon
Bypass password screen during logon.

Autoruns
See what programs are configured to startup automatically when your system boots and you login. Autoruns also shows you the full list of Registry and file locations where applications can configure auto-start settings.

LogonSessions
List active logon sessions

NewSID
Learn about the computer SID problem everybody has been talking about and get a free computer SID changer, NewSID.

Process Explorer
Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This uniquely powerful utility will even show you who owns each process.

PsExec
Execute processes with limited-user rights.

PsLoggedOn
Show users logged on to a system

PsLogList
Dump event log records.

PsTools
The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

RootkitRevealer
Scan your system for rootkit-based malware

SDelete
Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.

ShareEnum
Scan file shares on your network and view their security settings to close security holes.

Sigcheck
Dump file version information and verify that images on your system are digitally signed.

System Information

Autoruns
See what programs are configured to startup automatically when your system boots and you login. Autoruns also shows you the full list of Registry and file locations where applications can configure auto-start settings.

ClockRes
View the resolution of the system clock, which is also the maximum timer resolution

Filemon
This monitoring tool lets you see all file system activity in real-time.

Handle
This handy command-line utility will show you what files are open by which processes, and much more

LiveKd
Use Microsoft kernel debuggers to examine a live system.

LoadOrder
See the order in which devices are loaded on your WinNT/2K system

LogonSessions
List the active logon sessions on a system

PendMoves

Enumerate the list of file rename and delete commands that will be executed the next boot

Process Explorer
Find out what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. This uniquely powerful utility will even show you who owns each process.

Process Monitor
Monitor file system, Registry, process, thread and DLL activity in real-time.

ProcFeatures
This applet reports processor and Windows support for Physical Address Extensions and No Execute buffer overflow protection.

PsInfo

Obtain information about a system

PsLoggedOn
Show users logged on to a system

PsTools
The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

Regmon
This monitoring tool lets you see all Registry activity in real-time.

Winobj
The ultimate Object Manager namespace viewer is here.

Miscellaneous Utilities

AdRestore
Restore tombstoned Active Directory objects in Server 2003 domains.

Autologon
Bypass password screen during logon.

BgInfo
This fully-configurable program automatically generates desktop backgrounds that include important information about the system including IP addresses, computer name, network adapters, and more.

BlueScreen
This screen saver not only accurately simulates Blue Screens, but simulated reboots as well (complete with CHKDSK), and works on Windows NT 4, Windows 2000, Windows XP, Server 2003 and Windows 9x.

Ctrl2cap
This is a kernel-mode driver that demonstrates keyboard input filtering just above the keyboard class driver in order to turn caps-locks into control keys. Filtering at this level allows conversion and hiding of keys before NT even "sees" them. Ctrl2cap also shows how to use NtDisplayString() to print messages to the initialization blue-screen.

DebugView
Another first from Sysinternals: This program intercepts calls made to DbgPrint by device drivers and OutputDebugString made by Win32 programs. It allows for viewing and recording of debug session output on your local machine or across the Internet without an active debugger.

Hex2dec
Convert hex numbers to decimal and vice versa.

PsTools
The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

PsLogList
Dump event log records.

RegDelNull
Scan for and delete Registry keys that contain embedded null-characters that are otherwise undeleteable by standard Registry-editing tools.

Regjump
Jump to the registry path you specify in Regedit.

Strings
Search for ANSI and UNICODE strings in binary images.

ZoomIt
Presentation utility for zooming and drawing on the screen.

You may find some redundancy but some tools has multiple capabilities.

Thursday, May 03, 2007

Establish Database Connection with Perl

It's been a while since I use Perl to connect to a database and my memory about it has faded long ago. But now since I'm no longer purely involve in web development so I thought this method could be useful. Let see how it goes.

To cut the chase, here is the sample code

use strict;

use DBI;

# Connect to the database
# See footnote 1
my $dbh = DBI->connect('DBI:mysql:my_database', 'my_username', 'my_password')
or die "Couldn't open database: $DBI::errstr; stopped";

# Prepare the SQL query for execution
my $sth = $dbh->prepare(<execute() or die "Couldn't execute statement: $DBI::errstr; stopped";

# Fetch each row and print it
while ( my ($field1, $field2, $field3) = $sth->fetchrow_array() ) {
print STDOUT "Field 1: $field1 Field 2: $field2 Field 3: $field3\n";
}

# Disconnect from the database
$dbh->disconnect();


DBI is Perl's DataBase Interface. There are many different databases: Oracle, mSQL, MySQL, Ingres... even files containing data separated by columns could be considered databases. DBI works with practically all of them. DBI requires a database driver module to talk to the database. The driver module handles all of the details about connecting to and communicating with the database. DBI sits on top of the driver; its job is to make reading from (and writing to) all databases as similar as possible. That way, if your project grows from something that could be handled with mSQL to something needing Oracle, you can make that change without altering the code very much.

Database driver modules are Perl modules like any other, and often they contain documentation. They are all inside the root package DBD. So, to get information on an Oracle driver you've installed, you can type:

perldoc DBD::Oracle


Other than installing the module, and possibly reading the documentation, you rarely need to deal directly with the database driver module. DBI handles all of that.

Friday, April 06, 2007

Chat with my twin

I found this widget from MyCyberTwin. So I thought to give it a try. Have a chat with mini me.

Top 20 Most Downtime Sites


I got this report from Pingdom for 2007. The sites is ranked by Alexa. Now I have another excuse for not updating my blog.

Monday, March 26, 2007

There Are Heroes Among Us


Can you imagine spending 18 hours watching a TV series just because you want to see how the story would end? I don't have to and it's not the first time either. I spent the entire weekend watching Heroes on my notebook starting from right after I sent my kids to bed until the next afternoon.It's fantastic story but to my disappointments, the story is far from end. I'm forever haunted by the Heroes ending episode.

My buddy is responsible for my restless mind because he's the one who recommend this series. It's like a plague, one started I just couldn't stop. I guess all I have to do is wait and by the meantime, checkout this YouTube version of heroes called Zeroes. Some say it was produced by NBC itself.


Wednesday, March 21, 2007

VISTA Compatibility Issues Driver on Dell Notebook: Sonic Solutions DLA

If you buy a new Dell Notebook recently, perhaps this annoying pop-up message from VISTA's Program Compatibility Assistant is haunting you each time you start your Vista...



I've kept pressing 'Check for solutions online' for weeks but there is no solutions suggested by Microsoft. So much of "ASISTANT". I guess if you want to get thing right and fast you must get it your own. So today, the pop-message really pissed me off and I found the solution for this problem with just a query from Google.

So if you have the same problem like mine, all you have to do is go straight to this link http://kb.roxio.com/content/kb/Creator/000131CR and read their instruction. It's a patch for Roxio Drag-Drop program. Run the program, restart and my problem solved.

Saturday, March 17, 2007

Two Weeks Training Completed

It was a full 2 weeks training course held here in Kuala Lumpur. For me this course is a must before venturing further on Tera GN3 system. Some how, the system documentation didn't cover all aspect or perhaps the best way to learn is to have a real teacher. In this case our trainer is specially flew from Italy. I wish it's the other way round but I guess it's not a cost effective.

TeraDP send Marco Migliavada to train all 9 of us. With thick Italian accent, we finally complete the training today. With most part the system covered, I think the real job is awaiting.

Tuesday, February 27, 2007

osCommerce, CRE Loaded or Zen Cart

If you're looking for a free shopping cart, you might be wondering which of these cart is the best suit your needs; osCommerce, CRE Loaded or Zen Cart? Below is a quote from a forum that relates this three applications.

You have the Open Source Community which made osCommerce as a shopping cart. Then more features and installs were provided by the community which made later versions of osCommerce. Then still more features are added at the .org site. Next, some groups realized that people kept wanting some core set of modules and features installed on their oscommerce sites. So you have CRE Loaded. (the Chain Reaction Edition of osCommerce "loaded" with many of the features and modules). Then the CRE project has a split and Zen Cart is born. From there, Zen Cart goes on its own path and CRE Loaded goes on its path (not totally different, but both are great and have their own style). You also have VirtueMart which is osCommerce cart combined with CMS like Joomla/Mambo.


I've installed osCommerce and CRE Loaded before but Zen Cart is still new to me. I like some of the Zen Cart's powered shopping cart and I just can't wait to play with it.

Monday, February 26, 2007

My First Windows Vista

When I had to buy a notebook for my wife last week, it's clear that this is my chance to test out the new OS from Microsoft, Windows Vista. Yeah it's a risky move but I believe eventually we all have to face it sooner or later. Remember the moment when you had to change to Windows XP? This is exatcly the same situation. Read on.

We decided to buy the Dell Inspiron 640m. I like XPS better but my missus reminded me about the budget so I had to stick with the budget range. Next step is the OS selection. This is where I had my first confusion, to choose which version of Vista is suitable for us. They have 5 version of Vista (official Microsoft page), but I believe Dell offered 6 type of Vista. Since this is my first Vista experience, so I simply pick Vista Home Premium. It said something to do with AERO experience (what the heck is that?) Later I found out that it's a redesigned user interface and visual style developed by the Microsoft.

The moment I get my hand on this OS, I start installing all my usual stuff; WampServer, Yahoo IM, Firefox, Opera, SQLyog, Photoshop CS, SPSS and Zend Develeopment Environment. The WampServer 5 had no big issue with Vista however I can't figure out how to install their services. Now SPSS is a different story. I just can't figure how to to install it. I tried to install SPSS from edition 10 to 14 but Vista just rejected it all.

As for the Photoshop CS2, when I first launch the program, it terminate itself right after launching the software activation program. Simply run the program as administrator by right clicking the program icon and select 'run as administrator' to overcome this problem.

Oh well, it's all as I expected. There is always a glitch every time when you want to migrate from one system to another. As for the Windows Vista, if your programs aren't working, I mean almost all of them, perhaps Vista is the last options on your list.

I read lots of negative comment about Vista, some are being cynical but for the rest of us, we just don't care.





Monday, February 19, 2007

Piping With Yahoo

I almost forgot about this, but recently Yahoo launched a new service called Pipes. It's a drag and drop interface which allows you to combine several feeds into one. Remember how much time you'd spent to read every single feed subcriptions. With pipes you can actually combine your favorite feed and categorized it as a theme (News, Tech, Gizmo, etc) you just name it.

If you look inside the pipes you must agree with me that to build a pipes it is not for a faint heart. But once mastered, you can build as many pipes that you want with different purposes. For example, did you ever wish to monitor eBay price that match your budget? Pipes allows you to build query from a base feed url and set rules or filter before streaming it out to the pipe output. Take a look on my simple pipes. It translates a feed into a different language.

I thought saw one or two blogs refering Yahoo pipes as a web 3.0. Looking at pipes capability it's definitely a next generation of web application. In this new era, manipulating a web 2.0 application is the next challenge and Yahoo! pipes succeded.

Wednesday, February 14, 2007

Replace Pop-up with Modal Dialogs

Early this year, Microsoft has change their website interface and I notice that they are now using modal dialogs. What the heck is that? Modal dialog is an alternative way to load any detail information without changing the main page, just like the pop-up does. But the problem with pop-up is that currently there so many pop-up blocker tools out there. So your pop-up might be trapped in one of the tools. My boss had at least 5 pop-up blocker and he just don't have a clue which one is in active.

Today, Arjoule is kind enough to show me how it can be done. To experience it first hand, point your browser to this page and click the "show modal window button". Another good example is Widgetbox. I never use it before but someday this snippet will definitely come handy.