XP-rience

Something that I'd like to share with you!

Wednesday, January 30, 2008

JDK vs JRE vs J2SE vs J2EE vs J2ME ?

1 comment :
Which Java should I download? Can I just download the minimum small file size Java? Well, it depend on what are you need it for. Below explains;

JDK = Java Development Kit
Contains all of the software needed to compile Java source files (.java) into bytecode (.class)

JRE = Java Runtime Environment
Software needed to run the bytecode.

The JRE does come with the JDK. So, if you just want to run Java program, downloading JRE will do. The JRE installer is about 15MB while the JDK installer is about 55MB.

Quick introduction about Java? Read here.

J2SE = Java 2 Standard Edition
JDK + JRE, Java development package.

J2EE = Java 2 Enterprise Edition
JDK + JRE, advance Java development package.

J2ME = Java 2 Micro Edition
JDK + JRE, for handheld devices (cellular phones, palmtops etc.)

Quick way to know your Java version? Type java –version on your dos or shell prompt.

Java version example on WinXP command prompt



Java version example on Solaris 10 shell through PuTTY



More Java version checking methods can be found here

Tuesday, January 29, 2008

NetMeeting on Windows XP

No comments :
Wondering on how to install NetMeeting on Windows XP? Actually, you don’t have to. Just type conf on the command prompt or Start > Run > conf and hit enter.



Thursday, January 24, 2008

Removing and disabling the thumb.db file in Windows

No comments :
When displaying files as thumbnails in explorer, a file called thumbs.db will be created automatically by Windows. It help user to view folders and pictures in the thumbnail view much faster since it stores the images. Although the file is small, it may take up a large amount of space soon. It is safe to delete this file but if you would like to stop Windows from creating them again, you can disable it by doing;

Folder Options Window

From explorer toolbar, Tools > Folder Options, go to the View tab, tick Do not cache thumbnails.

Wednesday, January 16, 2008

Reading Text File Using 'schema.ini' & OLEDB

No comments :
Reading data structured text file can be tedious. Maybe some splitting ,array creation, filtering or trimming involved. Example, if you have a dataset like below...

File my_txt_db.txt content
WORD|LENGTH|DATE
LOREM|5|03/07/08
IPSUM|5|02/16/08
DOLOR|5|04/19/08
SIT|3|04/16/08
AMET|4|04/01/08
CONSECTETUER|12|04/01/08
ADIPISCING|10|04/17/08
ELIT|4|02/02/08
DONEC|5|01/23/08
ID|2|03/19/08
PEDE|4|03/15/08
FUSCE|5|03/11/08
QUIS|4|04/10/08
MI|2|04/02/08
VESTIBULUM|10|02/20/08
ALIQUET|7|03/28/08
ALIQUAM|7|04/09/08
ERAT|4|01/31/08
VOLUTPAT|8|01/22/08
SED|3|04/23/08


The easiest way is to use OLEDB + Text driver named schema.ini.
By doing this, the data can be pulled using SQL statement which is easy to manipulate. The format of the text file is being determined by schema.ini.

schema.ini content
[my_txt_db.txt]
ColNameHeader=True
Format=Delimited(|)
MaxScanRows=0
CharacterSet=OEM
Col1=WORD Char
Col2=LENGTH Integer
Col3=DATE Date


The schema file name is fixed to schema.ini and it must be in the same directory as the text data source. Detail on this can be found here. You may use VBS example below to test the scripting.

vbs_test.vbs content
Option Explicit
Dim conn, rs

Call INIT_CONN()
Call MSGBOX_DATA()
Call END_CONN()

Function MSGBOX_DATA()
Dim SQL, MSG_BOX_STR
SQL = "select * from my_txt_db.txt"
rs.Open SQL, conn
rs.movefirst
if not (rs.eof and rs.bof) then
while not rs.eof
MSG_BOX_STR = "Word = "& rs("WORD") & chr(13)
MSG_BOX_STR = MSG_BOX_STR & "Length = "& rs("LENGTH") & chr(13)
MSG_BOX_STR = MSG_BOX_STR & "Date = "& rs("DATE")
msgbox MSG_BOX_STR
rs.movenext
wend
end if
rs.Close
End Function

Function INIT_CONN()
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=.;" & _
"Extended Properties=""text;HDR=YES;FMT=Delimited"""
End Function

Function END_CONN()
conn.close
Set rs = Nothing
Set conn = Nothing
End Function


Just create these 3 files, place it in the same directory and run the VBS for testing.

Tuesday, January 15, 2008

Simple Javascript + Meta Refresh Auto-Refresh with Countdown

2 comments :
Below are the example of a simple auto-refresh webpage using meta refresh and javascript. Meta refresh is a method of instructing a browser to automatically refresh the web page with a given time (second). While javascript is used to make the counter running.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello!</title>
<meta http-equiv="refresh" content="10" />
</head>
<body>
<h2>Auto-Refresh in <span id="CDTimer">???</span> secs.</h2>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
var TimerVal = 10;
var TimerSPan = document.getElementById("CDTimer");
function CountDown(){
   setTimeout( "CountDown()", 1000 );
   TimerSPan.innerHTML=TimerVal;
   TimerVal=TimerVal-1;
   if (TimerVal<0) { TimerVal=0 } //improvement by vivalibre, tq } CountDown() /*]]>*/ </script> </body> </html>

Just make sure both bold value is same, 10 for example.

Monday, January 14, 2008

Windows 98 / ME / 2000 Thumbnail View Fix

No comments :
If you are still using Windows 98 / ME / 2000 and found out that explorer image thumbnails is not working, this is probably because of a third party image program changing file type association. To fix this, type regedit at the command prompt and hit enter. Click here to learn more about REGEDIT. Enter this value;



[HKEY_CLASSES_ROOT\.png\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

This is to enable thumbnail view for .png extension. How about other file types? Repeat adding it like below, like jpg for example;

[HKEY_CLASSES_ROOT\.jpg\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

If you want to do it all file types with, copy code below to a file and name it as my_thumbnail_view_fix.reg (extension must be .reg). Then right click > Merge the file.
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.jpe\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.jpeg\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.jpg\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.gif\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.bmp\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.png\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.tif\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.tiff\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.htm\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

[HKEY_CLASSES_ROOT\.html\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{7376D660-C583-11D0-A3A5-00C04FD706EC}"

This will fix most of the thumbnail viewable file types.

Sunday, January 13, 2008

Copy FLV file from Firefox cache

No comments :
After watching a video from Youtube, you may want to save the video file into your local for future offline playing. To download them, you can use many available softwares / add-ons from the net. The thing is, the software will reinitiate the download procedure and you need to wait again for it to complete. If you are using Firefox, you could by pass this by copy the FLV directly from Firefox cache. Firefox cache located at;

C:\Documents and Settings\YourLogin\Local Settings\Application Data\Mozilla\Firefox\Profiles\cdvfbg12.default\Cache

Or

%AppData%\..\Local Settings\Application Data\Mozilla\Firefox\Profiles\ cdvfbg12.default\Cache

The method is to open explorer and go to cache folder like mentioned above. Note that ‘YourLogin’ is your windows local login name and ‘cdvfbg12’ is randomized folder name. It may not be the same like your PC. Look, nothing much here.



Now watch full Youtube video in Firefox browser. Do not close your browser yet after that. Back to the cache folder, refresh it using F5 key and now you can see some new large file created in the folder. Sort by date modified for better visibility.



Copy it somewhere and rename it to *.flv . Now you may play the FLV using a favorite player.



Friday, January 11, 2008

Active Directory in Windows XP

No comments :


Windows 2000 users can easily browse Active Directory by opening My Network Places > Entire Network. But this active directory browsing is disabled by design under Windows XP. To have this feature in Windows XP, simply copy "dsfolder.dll" from Windows 2000 (sp2 or higher) "%WINDIR%\system32" to Windows XP "%WINDIR%\system32". After that, use "regsvr32" command-line tool to register the dll by entering "regsvr32 dsfolder.dll" at the command prompt. Now you will be able to see the Active Directory icon whenever you go to My Network Places > Entire Network. Hard to find Windows 2000? Read here.

Wednesday, January 09, 2008

Microsoft Office 2007 - Office Open XML

No comments :


When somebody came to you and ask "I cannot seem to open files with .pptx extensions. Can you?"

.pptx is the new Microsoft Office 2007 - Office Open XML format for PowerPoint presentations. Microsoft Office 2007 uses a new Office Open XML format that is not understood by previous versions of the software. For Microsoft Office XP and 2003 users, you may overcome this incompatibility by installing the Microsoft Office Compatibility Pack. After updating,
you may test your software with sample Open XML documents provided by openxmldeveloper.org. Anyway, it is recommended for users to install all High-Priority updates from Microsoft Update before downloading the Compatibility Pack.

If you don't really like this new format, you might consider to sign a petition of "NO to the Microsoft Office format as an ISO standard", please visit http://www.noooxml.org/petition.