Stunned by DownloadThemAll

Another nifty Firefox plugin. Considered a download manager, allows you to download stuff. Stunned me the first time with an amazing mp3 download speed of 177 KB/s…

At first I was looking for something that can do pauses and resumes – unlike Firefox’s built-in download manager. Kinda sucks anyway. Known as DTA, it is supposed to do some other stuff like grab more than links. Will try it over time.

Password Hasher

The Password Hasher is a Firefox extension that lets you create and remember complicated passwords easily.

The motivation comes from combining the need for strong passwords and the preference for easy-to-remember passwords. By hashing your simple password into a complicated one, you are able to secure your password since it’s difficult for hackers to guess. Yet you can use it with ease since you’re “generating” the actual password based on a simple keyphrase that you know.

I’ve not tried it myself so I do not know the actual benefits or quirks, but the idea is great. One of the first negative thoughts I have was is the hash based on a key? What if you lose the key, such as during a PC crash/reformat? You lose ALL your passwords?!

https://addons.mozilla.org/firefox/3282/

Useless Fact

On your Screen Saver dialog, there’s a check option beside the number of minutes to wait before activating your screen saver. Sometimes its “On resume, password-protect”. Sometimes its “On Resume, show welcome screen”.

The difference is when the “Fast User Switching” service is enabled. When enabled, the welcome option will be shown, otherwise password-protect will be shown.

Slow Explorer

If you’re browsing in Windows Explorer and particular folders load just so much slower than the others, check if those folder contains zip files.

This is because Windows Explorer takes effort to “help” read those zip files so that you can access them as if they’re another sub-folder. If you’re accessing that folder often, you might want to shift those zips somewhere else to prevent Windows from trying to read them.

For those keen on removing this “feature” permanantly, run:

regsvr32 /u %systemroot%\system32\zipfldr.dll

System Variables: PATH vs CLASSPATH

Still a lot of people don’t understand the purpose of these system variables. They don’t know when to set it, what it really does and therefore cannot determine that this IS or IS NOT a path or classpath problem.

The PATH variable is a Windows system variable that Windows uses to find executable files. When you type a command in the cmd window, e.g. “javac”, Windows will search in your PATH to find the program to execute. The search sequence is as follows:

Current Dir > PATH Variable > Command Interpreter

In the example, the interpreter will first look in the Current Dir for a javac.com, javac.exe or javac.bat respectively. If found, it will be executed. If not it continues its search through the PATH variable in definition sequence and extension sequence. This means for PATH=C:\Temp;C:\Windows, C:\Temp\javac.com will be searched 1st, followed by C:\Temp\javac.exe, C:\Temp\javac.bat, C:\Windows\javac.com, and so on.

Once the PATH is exhausted, the interpreter will be checked if it is a interpreter command (such as “copy”). If so it will be invoked. Finally the interpreter will return a “Bad command or file name” if the command is not found.

All these means that if you’re getting a “Bad command or file name”, it is likely a PATH problem. It also means if you’re somehow running the wrong program, it may be a program of the same name in a path earlier than yours (useful for java version conflicts).

The CLASSPATH variable is a Java runtime system variable that Java uses to find class files. When Java tries to load a class, it will lookup its ClassLoader. If the class is not yet loaded, Java tries to find the class in the CLASSPATH variable. Sometimes the CLASSPATH may be appended from the runtime command line directly.

This means that if you’re getting a ClassNotFoundException during runtime, or “Unable to resolve symbol” during compile, you may have a CLASSPATH problem. (NOTE: Typos and other errors may also raise same compile error). If the classes are in the current directory and still cannot be found try adding “.” (current dir) to the classpath or check if the sources are in java packages.

To check the current PATH on cmd, type “PATH” or “set PATH”. To check the CLASSPATH, type “set CLASSPATH”.

To fix the PATH or CLASSPATH, you can either set it on the command line directly or set it through System Environment Variables. To set it from cmd, type “set CLASSPATH=someClassPath”. To append to the existing PATH or CLASSPATH, use %xxx%. E.g. “set CLASSPATH=%CLASSPATH%;.” to append the current directory into the classpath without affecting the existing classpath. Setting the variables on cmd only persists for that session. If you start another cmd or close this cmd the variables will be reset.

To persist the variables permanantly, you can set it through System Environment Variables. For XP Pro, go to the “System Properties” first. You can get there by

  1. Start > Control Panel > System
  2. Start, right-click “My Computer”, select “Properties”
  3. Press [WindowsKey]+[Break] simultaneously

with option 3 being the fastest. From there, click the “Advanced” tab and click “Environment Variables” at the bottom. Set either the User variables or System variables. The User variables only affect your Windows Login, and System variables will affect everyone. User variables will overwrite any System variable settings.

Sun Solaris Installation

Had a chance to install Sun Solaris 10 on a Solaris machine today with a 64-bit AMD Opteron processor. The machine came installed with Windows XP 64 bit (first time seeing it too) but we didn’t have the password to access the system.

The installation was quite straightforward with its auto-boot GUI installation wizard, although it asked damn lots of questions from network settings to locale BEFORE asking the user to assign disk space for the installation. (imagine the situation when you configured everything but did not have enough disk space for it.

The end result of it is a unix system (with /etc /var /bin), and two GUI apps (CDE – Common Desktop Environment & Java Desktop) which are Windows-like GUI systems. The CDE resembles more like X-Win while Java Desktop mimics Windows closer (with a “Start” button and taskbar). Configuration is still as weird as normal Unix, since I’m not that Unixy.

The weirdest part was before installation we used a “self-burnt” DVD to try install Solaris 10 x86 Update 2. The CD-ROM boots and stucks at “Loading stage2…”. Google say its a known bug when installing from SCSI DVD-ROM drives but ours is IDE (I think). Popping the CD out throws us into GRUB (GRand Unified Bootloader), but we can’t start the install wizard despite trying those “boot” and “kernel” commands.

In the end we resorted to using an “older” original version of Sun Solaris 10 x86, also DVD.

Tidbits:
– ifconfig = ipconfig
– DNS nameservers is set in etc/resolv.conf

UltraVNC

UltraVNC is a flavour of VNC — its an open source project in SourceForge. It provides all basic VNC features: connecting to remote machine, perform mouse/keyboard tasks on remote machine, transfer files, etc. It even allows connection via HTTP using a Java Viewer, possibly allowing it to cross firewalls.

Configuration is straightforward with a single password, but I’ve yet to see if it can integrate into the Windows Authentication.

So far UltraVNC has served me well and hasn’t given me serious problems. Server installs cleanly, and the client is light and doesn’t even need installation. A simple unzip and the viewer can be run.

VMWare

VMWare allows you run an OS inside your OS, eg. Run Linux in your Windows machine, or Windows in Linux. A very useful program I think.

I installed my WinXP Pro in an WinXP Pro machine, and used the VM as a test platform to try out software without corrupting my actual system. Can be also used to test if some software is spyware-like. Once I made a complete installation, I made a “copy” of the OS so I have a clean WinXP installation anytime.

Working within the VM is exactly like having another machine, much like what VNC provides, except the VM is not any physical machine anywhere else. The VM has its own BIOS, hard disk space and IP address… I could ping from my host to VM and VM to host, very real.

The only annoyance was trying to transfer files between my host OS and the VM. This is especially necessary when I want to copy installation files over. Shared folders didn’t really work out, so I had to use another machine’s shared folder. Perhaps there exists an easier way for file transfer from host to VM.

I give VMWare 10 out of 10.

So you know how to code…

Most entry programmers learn how to program procedurally first, understanding that program instructions run one after another. Subsequently they learn control flow (if/else/for/while) and functions to modularize their code.

With these, one can almost write amazing programs. So where should we go from here?

For OO langauges like Java/.Net, I think there are two directions from here. One is to go lower level, to understand the foundation of the language, syntax, types, basic classes, including OO concepts like encapsulation, inheritance and polymorphism. This can be translated towards the Java Programmer certification. The other is to go higher level, to understand software architecture, data structures and design patterns. This will allow for better software that may be more efficient, maintainable and/or scalable.

The two directions are not XOR (one but not the other). Instead they are both as important. Looking at how other people write may also help in grasping style and technique, even identifying anti-patterns (style/design that should be AVOIDED).