Saturday, November 29, 2008

New plan for 2009

I have make a decision not to developing the UML tool as I found out that this is worth nothing and does not bring any benefit to me. Why do I need to create the thing again when it is already in the market? What for? Just for my own fun. This is true. I am really have great passion in programming. It seems so stupid to me because no matter how hard I do and how much effort I put on it, it just for my glory. From now on, I will never wasting my time to create such thing anymore. I want to have an objective and result. Not a never ending task in coding a program, I will never finish in creating those program as there are many many more program I have to do.

Do it when it need... Don't waste time... I should spend more time in personal development...

Sunday, July 20, 2008

The Script Manager

I have created a Script manager for managing the script command for my UML tool. It is a Singleton as there is only 1 script manager in the application. The responsibility for this manager is to manage the script command enters from input and then digest the command to know what it suppose to do. After that it’ll instruct Paint manager to draw out the diagram. For now this manager is able to accept command from input but it doesn’t know which diagram to be draw on the board as the communication between Script manager and Paint manager haven setup yet.

Saturday, July 12, 2008

UML Tool -> Diagram Manager

This project supposes to be short and fun, but it end up hard and sophisticate. Creating a UML Tool is not that easy actually. There are many design issue like the tedious one – UML syntax need to be determined carefully. Besides that I was choosing Win32 as my development platform. I wonder whether I have chosen the right technology to do it. This should be a rapid development and I suppose to use .Net or MFC to speed up my development. Since I already know MFC, thus I can concentrate on researching.Net.

My first view on .Net was not that hard actually. There (Microsoft) have new changes on syntax or probably the whole C++ was change. I also notice that I am not using MFC in the UI development. Is that Win32 programming II? And also it is a problematic to dealing with native code in .Net. Microsoft has changed the development style. Finally I have given up using the wizard to generate the GUI code for me instead I do it manually.

Now I have done with technical issue. Here is the new plan for the project. I will change the title to Diagram Manager because the objective of this program only focuses on class diagram instead of the entire UML diagram. The reason is I use UML class diagram most often. The reason to name it as ‘diagram’ is it is not just only draw class diagram. May be it will draw other diagram in the future, such as data flow.

Since I have narrow down my design, I can concentrate on 1 part and do it well.

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);
}
}