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

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
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


Function MSGBOX_DATA()
SQL = "select * from my_txt_db.txt"
rs.Open SQL, conn
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
end if
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()
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

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"
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="refresh" content="10" />
<h2>Auto-Refresh in <span id="CDTimer">???</span> secs.</h2>
<script language="JavaScript" type="text/javascript">
var TimerVal = 10;
var TimerSPan = document.getElementById("CDTimer");
function CountDown(){
   setTimeout( "CountDown()", 1000 );
   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;


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


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











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


%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.