Saturday, March 28, 2009

What the fucking XML is?

In year 2005, before I got the offer from MYOB, and on the same time, I got several interview invitation, there was a very interesting interview session held at Nxxxxxxxx limited company. The interviewer is very familiar with Web base development (I guess), since all the question he ask are related to the Web Technology. He has throw out a very interesting question said "Do you know XML?" Immediately there are two question generated from my brain:
  1. What the fuck he asking me this question?
  2. Does it really matter if I don't know?
Let's 1st focus on the 1st question. This question is to test whether I have take the initiative to learn new language beside my work. During that time I know XML language (and many others), but I don't really know the objective of this language being designed because I am a C developer, it seems no point for me to adopt this "new thing" in my application development. To me, I will rather choose INI instead of XML since I don't see any problem on using INI so far. And the objective of INI is clear and set:
"To configure your application setting and behavior."
Thus I have answer NO to this question. Once I have said no, then he ask why. So this is something related to my 2nd question.

Do I really need it? Yes, I need it because I am applying for the Web Developer position. This is a must and very important. I am applying this position because I was looking for career advancement into Web Development.

The interview has failed at last. But lucky I did not get the offer. If I have accept the offer, then I wouldn't have my goal:
"To be a C Software Architect."
And also I wouldn't develop Linux application now if I have move to Web. Thank god not giving me this offer. I love you.

Now I was giving a task on redesign the software architecture design for future enhancement. The objective is target on the future. No one able to see from now. My fellow teammate and I are working so hard on this problem and we strike to create a better architecture design for future. One colleague show up his new idea:
"To use XML to mapped all the different logic on the same screen for different model, so that we can achieve robustness without being need to recompile the whole program."
This is too bad. This will gonna burden up the developers who going to support on the XML. Imaging you are working on the XML without knowing the problem domain. XML is a language to do the configuration stuff, it is not a language to mapped the business/presentation logic for different model.

But at last we all agreed not to use XML in the logic mapping. Lesson learned here, don't be over ambitious on programming language, think carefully why this language is being designed and what is the objective/purpose in choosing a programming language in the development.

Happy programming !!

Sunday, March 15, 2009

Error in mounting FAT32 USB in Linux

Problem background:

When I mount an FAT32 USB drive in Linux, it will prompt an error something like below:

mount: you must specify the filesystem type.

I don't know what is that means, I usually will ignore it. Once I ignore this message, and continue with my task, I notice that some of the files with capital letters in it will gone after transfering from Linux to Windows through the USB drive. All the files/directory name are truncate into small capital font. I am so curious on this issue and I start to think of whether this is because of the different file format in between the two devices. Is this due to some missing bits during the write process to the device with different file format?

Solution:

mount -t vfat dev/sdb/ mnt/<mount_point>

This command will mount a FAT32 drive in Linux.

How to write file into Fat32 USB?

Problem background:

I have a USB drive with Fat32 format, but I could not write any files into that drive.

The solution:

1. ls /media/disk -l

This to verified that whether my USB have write access on it. When I use this command, it show me something like below:

drwx------ 2 root root

2. chown -R root:root

This command is to give the ownership to the root user too.

[Reference]
1. CHMOD Help.
2 chmod by the Numbers.

Saturday, March 14, 2009

How to format USB drive into Fat32 format?

Problem Background:

Some of the files created in Linux will not be able to format in Windows, it keep prompting you error said that the device was on use by some other else. When bringing back the USB drive to Linux, the files was locked. there is no way for you to delete it. Thus I am force to format the USB drive under Linux.

Solution:
  1. umount the USB drive.
  2. log in as root.
  3. delete the existing partition using fdisk.
  4. mkfs.vfat /dev/sdb1
But when I was trying to format it (in step 3), it prompt an error:

Could not stat /dev/sdb1 --- no such file or directory.
The device apparently does not exist; did you specify it correctly?

To solve that problem, here is the solution:
  1. cat /proc/partitions. (this will show the minor and major number of each partitions drive)
  2. mknod /dev/sdb1 b <major> <minor> .
  3. retry the format again.
  4. type fdisk -l to verify the partition again. (optional step)
[Reference]
1. Ubuntu Linux format USB pen drive.
2. Could not stat /dev/sdb1, although partition exists.
3. Partitioning with fdisk.

Saturday, March 7, 2009

Career Advancement into Linux Development

I have been dreaming to be a Linux developer for a long time. Now my dream have come true and it is so real. Now I am a Linux developer, developing Linux software using the Linux Operating System. I am using VIM as my editor, GDB as my debugger, G++/GCC as my compiler and MAKE as my script to issue a batch of command into compiler. I can't believe it I can do that. That was great and it is so cool.

Currently I am experiencing the threading in my development. By looking back when I was in Windows development, I though I have been doing the most advance application in my life. The most complicate software I ever never been develop for. Now I have break the limit, beside using those UNIX specific library in my development, I am also experiencing linux threading development, forcing me to study more on the Operating System matter. To be frank, I never touch any Operating System before in my study syllabus. I am not a Computer Science guy but doing Computer Science work. So challenging me in this year.

As well as VIM and GDB, the most command like tools I been dreaming for. This is so great I can learn so much of great development tools in my career, and also my development. Not there yet, I need more challenge to come to me. I am waiting here. Be ware !!

Sunday, March 1, 2009

Setting up QT on Ubuntu Linux

I have been used and played around on Linux for about 2 years. My main activity are basically typing documents, surfing Internet, troubleshooting and administration work. But in this year, I have to move on to do some development work on Linux. Due to the limitation on my technical knowledge on Dell E5400, and also the number of Linux distribution choices available on my desk, I have chosen Ubuntu 7.10 as my primary OS for the QT development.

First of all, I am using Dell E5400. I am failed to install Ubuntu through the start up menu. My laptop hangs during the middle of startup when I was trying to install. But anyhow, I was able to install through the “Live” startup. (There will be an “install” icon on desktop after the OS boot up.) But it comes into trouble when setting up QT open source version, there were some package was not properly install in the OS. This is due to the limited size of the CD. It is impossible to get everything squeeze into the CD with the just 700MB. Thus I have to manually install the require package through Synaptic Package Manager.

Nothing was missing in the QT INSTALL manual, it just that I didn’t read properly on the output during the compilation process. That’s why I failed to install QT. INSTALL manual have given a deep clear installation instruction. But it didn’t mention which kernel package are require for the compilation. Because it is varies depends on which distribution that everyone will be installed. Thus I need to pay close attention on the output during the compilation process. Once found a require package is not there, then only install that particular kernel package in order to get QT compile and install properly. The last step is “make install”. This step is important because it will install QT into root directory so that everyone is accessible. If not, an error “command not found” will be shown when qmake command is being issue.

Last thing to remember, QT installation must be perform under root user because it will require write access to the system directory. Otherwise installation will fail.

swprintf() in Cygwin

I was installing Cygwin in my home's PC. When I try to compile a simple program, it giving me an error arguing that swprintf() was not declared. I have been compile this program using LINUX, but now it is giving me this error seems so weired to me. I though Cygwin will make the porting from LINUX to Windows go easier? Or it should be hassle free?

Just curious to know whether this is my fault? Am I downloading the wrong package version? Instead of downloading the package, how can I update the package?