Sunday, June 15, 2008

New Plan – UML TOOL

I got a new plan. After the Search Program, UML tool will be my next project. This project was started since two weeks ago. My initial plan was using C# to create it, but due to the limitation of my C# skill (as I don’t know C#), thus I will use C++ and will be make use of GDI+ in this project.

The idea was this. The program will be a command base program where it wouldn’t accept any mouse input. There will be a main screen locate at top of the window which is going to renders the object on the screen. This screen will gonna occupied 90% of the window. Whereas at the bottom of the screen will be a place for me to type the command. And those commands will instruct how the object should be render in main screen.

The estimate time for this project will be 12 days. 1st draft for this project is to have some rectangle drawing on the screen and some line that link them together. Beside that there will be some AI for the line where it will change direction if there are some rectangles blocking the line in between the link. Cool huh?

In this week, I have done some research study on the GDI+ and I feel OK with it. Next week will start to working on the 1st draft.

Saturday, June 7, 2008

Alternate Solution To My Search Program

Found an alternative way that will do the same thing that my program do. By using find command in Linux, U still can print out a list of search result into a file. If U are using Windows, try to get a copy of Cygwin, U will get the Linux command too.

Usage:
find My_Path >> Desired_output

eg:
find C:\Test >> test.txt

Output:
c:\test
c:\test\a.txt
c:\test\b.cpp

Disadvantage:
print out unwanted directory name, like c:\test.

Conclusion:
Need to figure it out how can I make a filter on the unwanted 'thing'.

Sunday, May 18, 2008

Trick to track the argument in console

On last week, I was working so hard to put in three features for the search program.

FEATURE LIST:

- Search path. This feature allows dynamically to search the desired path
- List. This is to show out the search result.
- Output. Export search result to text file.

The first two already done. Third feature still in progress.

During this experience project, I found a very interesting issue. How to track the input passing in through the command line? Lets take a look:

void main(int argc, char *argv[], char *envp[])

Initially I was using argc to track how many command was passing in. This is not really a good method of doing this because when passing in more and more options, it duplicate the same task. Refer to the code below:

switch(argc)
{
case 1: // no option was pass in
break;

case 2: // 1st option was pass in
break;

case 3: // 1st and 2nd option was pass in
break;

...
...

case n: // until n number of option was pass in
break;
}

Anyhow I have overcome this issue by tracking down the number of command passing in by using the argv pointer array. If argv[1] is empty, definitely I know that option number 1 is not there. Otherwise there must be an option passing in. For doing that, I just need a while loop to track every element in argv. But how do I know how many option was passing in? By using NULL checker? Actually I was using argc to get the total element in argv. I get this inspiration from MSDN.

Sunday, May 4, 2008

My first day in C++ .Net.

The first application that adopts this technology is my search file console program. The objective of this program is to retrieve all the files by searching through the particular location (including the remote media and network media).

I am having trouble at the first run. I mean every time I start something new, I’ll create a simple “Hello World” program to make sure everything are in place. “Something new” means this my first time in .Net development. The compiler that I am using is Express Edition 2005. At first I create an empty project from the general category. When I build the program by choosing “Start without Debugging” option, everything went fine. But it will prompt a message if I build using “Start Debugging” option.

The contents of the message are as below:

Debugging information for 'XXX.exe' cannot be found or does not match. Binary was not build with debug information.

This is not an error I guess, it just unable to retrieve the debug information. I do not know how to solve this problem, if you read this post and have any suggestion on this, do let me know. Thus I have to recreate the project by choosing “Win32 Console Application” under the Win32 category.

Now, the primary keys to deal with Files are DirectoryInfo, FileSystemInfo, and FileAttributes. The sample below will show all the files (not directory) in C drive.

DirectoryInfo ^di = gcnew DirectoryInfo("C:\\");

for each(FileSystemInfo ^fsi in di->GetFileSystemInfos())
{

if(fsi->Attributes != FileAttributes::Directory)
{
Console::WriteLine(fsi->Name);
}
}

Sunday, September 23, 2007

My modem is working now

The modem is alive. It is working now. I am posting this from my Linux box. I feel so happy now as I have spent quite a number of days to configure my modem. To search for the latest modem driver is not a hard job but configure it to make work is a hard job. Right until now, the modem still haven't correctly configure. Every time I turn on my Linux I still need to configure it in order to get online. By the time I configure the modem, it fails for the first time when I try to connect to the Internet.

An error message prompt timeout expired while waiting for the PPP interface to come up. This is so annoying for me to click on the OK button every time I connect to the Internet. This is annoying too every time I need to configure my modem after Linux was bootup.

Things going to solve soon. I need some configuration setting to make my modem “permanently” stay in my Linux.

Sunday, September 16, 2007

Tools to detect my modem

I have downloaded a tool called Scanmodem from linmodem support page while I get into this HOWTO slmodem for Gentoo. I know this site is definitely for Gentoo Linux, but I was running out of hope to install my modem. There are so limited resources out there. I must give try on whatever I found.

This tool can help you to detect your modem device, the files needed to compile your modem and many more. It was a very good tool. To use it, follow this simple steps:

gunzip Scanmodem.gz
chmod U+X Scanmodem
./scanModem

- gentoo-wiki.com/HOWTO_slmodem

This will create a ModemData.txt under a Modem directory (there are many more files generated). So I open up the file and I see a lot of info which I couldn’t understand. The very interesting part to me is this:

PCI ID: 2000:2800
Subsystem ID: 122d:2800




Candidate modem in PCI bus: 00:0c.0
Class 0703: 200:2800
Primary PCI_id: 2000:2800
Type needed: slamr


After reading this, so called spec, I become blur and struggle. It seems helpless on Internet after a few weeks of searching and googling. The only hope is to go back read carefully the README from the package. This is the only hope I think.

One thing for sure is my modem chipset is SL2800.

Saturday, September 15, 2007

First try on installing a modem on Mandriva 2007

Few months ago, when starting to setup my Linux box on my machine, the primary installation before development tools is the modem driver and display driver. The first driver I was trying to install is the modem driver. This driver is come together with the hardware. Unlike the display driver, this free me some hassle work in searching for the driver.

I am surprising that I am able to see the driver source code after I have extract the zip file. (I am new to the Linux world.) There is no exe file. I go through the instruction from the README file and following every step to in the setup process. It gives me an error. This is so interesting that the console showing which line is having trouble in which file. Just like a debugger. I follow what have been told by the compiler to see what is inside the code.

Open it. I have no idea on how to fix the code although I am a C++ developer. (Frankly my core skills are UI only.) This is so funny that I can read the C++ code but I have no idea on how this code is work. I put this aside for a few weeks until I manage to find a latest driver. I get the package from here.

It compiled and installed but I have no way to configure it. Did some Google search and I got this thread. This thread did mention about on how to setting up and configuring the modem. It works exactly. Unfortunately the modem is not able to query. Is it my false?