Saturday, August 29, 2009

Rectangle text in Ubuntu

Recently I have downloaded the latest source code of Open Office 3.10. Few days ago, there was an update from Ubuntu Update manager. As usual I'll briefly browser through what is going to be install in my Linux. But this time I did not browse through it, and I just install. Then in my next login, all the text or whatever text can be read in English are change into rectangle. I was in the situation where there is no English text at all.

In order to solve this problem, I have to un-install the pango v1.24 through runlevel 2 because that is the only place I can see English text. Restart after un-install process has been done to take immediate effect.

I guess there must be some dependency library having some conflict with pango library during the update. Need to find out more on this.

[Reference]
  1. http://ubuntuforums.org/showthread.php?t=1251089
  2. http://ubuntuforums.org/showthread.php?t=455987

Wednesday, August 26, 2009

How to execute install.sh?

Few days ago, my friend was having a problem on setting Tomcat in his Linux box, and he got no clue on how this file is going to execute?

The file actually is using bash command, to execute it, that file must be granted an execute permission by doing this:

chmod +x install.sh

By granting the execute permission on a file, now the file can be executed just like below:

./install-sh

Without granting the permission, the file has to be execute in following method:

sh install.sh
bash install.sh

But base on my working experience, that file will be granted an executable permission if the source is dedicated for linux. Unless it is dedicated for Windows.

[Reference]
  1. http://www.cyberciti.biz/faq/run-execute-sh-shell-script/

Monday, August 24, 2009

OpenOffice 3.1.0 kick start

Few weeks ago, I have downloaded open office latest source code from this link. There are six major packages in total, which there are:

  1. core source package.
  2. system source package.
  3. binfilter source package.
  4. l10n source package.
  5. extension source package.
  6. testautomation package.

I have extracted those package and ready to install. Unfortunately the installation process not going so well. There are so many missing components in my Linux, and I have to install it one by one. Currently I was stuck at installing the GTK+ because this component requires me to install the dependency components such as Glib, Pango, ATL, and Cairo. Installing those components is not as easy as I think, and it could spend up a lot of time to search the Internet how those components should install. Like one example, when installing Glib, it prompting an error complaining that gettext module was not installed. By doing manual installation doesn't fix the problem, and thus I have to issue the command below to solve the problem.

sudo apt-get install gettext

Although Glib installation has been resolved, but installation for Cairo is a different issue. Because it doesn't have a Makefile, how could I continue my work?

Resource:

  1. http://wiki.services.openoffice.org/wiki/I_want_to_be_an_OpenOffice.org_developer
  2. http://wiki.services.openoffice.org/wiki/Setting_up_Subversion_Access

Friday, August 14, 2009

Finding on developing XBOX game

For so long I want to get myself started in game development. Due to the limited funding and resources, I have joined the local game house to get my dream come true. This could be a great chance for me to learn PS2 and Nintendo technology in game development. Unfortunately, the company doesn't go very well due to the financial crisis, and I am force leave that company to develop the boring software (again!).

I have been heard about Microsoft XNA for a long time, but I never get a chance to use it in developing any game. This technology open up the gateway for everyone to sell their final product to the public, it could be a very good chance to self funding and bring up a new career to myself – The indie game developer. Few days ago I was doing some study on how I can get myself started in commercial game in XBOX, below are my finding.

Requirement for developing XBOX game:

  • Xbox 360 console with hard drive. (RM1800)
  • Xbox LIVE Gold or Silver account. (Free of charge)
  • XNA Creators Club Online Premium membership. (around RM350 per year)
  • XNA Game studio. (Free of charge)

Requirement for deploying XBOX game:

  • XNA Game Studio Connect in XBOX.
  • Add a device in through XNA Game Studio Device Center in XNA Game Studio.

The pricing is range from 200 to 800 point, which is equivalent USD2.50 to USD10.00. 70% of the revenue will be received by you from the total sales. There is one bad news, which is, even I'm debugging a game on XBOX, and I still need to have a premium account for this to work [7].

Related link:

  1. http://roecode.wordpress.com/xna-gameengine-development-series/
  2. http://www.fiercedeveloper.com/story/xbox-make-your-own-games-xna-10-steps-diy
  3. http://msdn.microsoft.com/en-us/xna/default.aspx
  4. http://creators.xna.com/en-US/create_detail
  5. http://msdn.microsoft.com/en-us/library/bb975643.aspx
  6. http://majornelson.com/archive/2008/07/22/use-xna-to-create-games-and-then-sell-then-on-xbox-live-and-make.aspx
  7. http://forums.xna.com/forums/p/27613/213799.aspx#213799

Monday, July 27, 2009

Transition from C to C++

I have been working as a software developer for five years since year 2003. I have been spent four years at the beginning of my career on C language and one year on C++ language since I am working as a game developer on last year.

From my perspective, C and C++ are pretty much the same. What I mean is in terms of programming syntax and semantic. C programming syntax is still compatible under C++ environment where the file extension was saving under CPP file. But if C++ syntax was saving under C extension and try to compile it with C compiler, it will prompt a syntax error.

I have compiled a list of key note for C programmer making transition from C to C++:
  • C++ has smart pointer whereas C is pointer.
  • C++ adopted functor whereas C is using function pointer.
  • Memory allocation should adopt RAII technique.
  • Should not rely much on structure whereas should focus more on object design.
  • Should familiar with template design as this will utilize the code reuse concept.
  • Error handling should be done on one side by using exception. Return code only indicate the status of the execution of a process, not to instruct what should be done next.
C++ is a powerful language, programmer should aware of what they coding so that this language is not overuse. For example:
  • Multiple inheritance should use carefully because this will increase the risk of code maintenance as the hierarchy level was increase.
  • goto keyword should use extensively in the code as this will lead the program flow much more complicated.
Here are some good books that worth to read:
  • Accelerate C++: Practical Programming by example
  • Effective C++
  • Exceptional C++ and More Exceptional C++

Sunday, July 26, 2009

Information overload

What is Information overload?

This happen when you have collect too much information on hand but you don’t need all of them.


Below is the list of symptoms of Information overload

Stress You have done a lot of search, but it seems to be that you have not enough time to read it or there are still missing part.
Poor memory No matter how hard you have read and how hard you force yourself to memorize something, you still not able to recall it.
Inattentive You are not able to concentrate on one thing and get distracted easily.


Here are some tips that may help you out
  1. Plan your purpose of acquiring the information.
  2. Organise your work and get rid of clutter on your table.
  3. Put aside the information that is not relevant to you.
  4. Try to focus, ignore those chat lines, idle gossip, and surfing the Internet aimlessly.
  5. Focus on one task at a time and complete it before starting a new task.

Improve your memory
  • Listen to Baroque music. This type of music has tempo ranges from 55 to 65 beats per minute. It has a frequency of 500 hertz that can harmonies your brain waves, causing our bodies become relaxed and minds alert. One example is Pachelbel.
  • Use music as a memory aid. Music could be a powerful memory trigger.
  • Speed up your reading. An average person can have a reading speed of 200 to 250 words per minute (wpm). There are three attributes showing that you are a slow reading person. First, read word by word. This will cause your eye strain, and boring. Second, sub-vocalise when reading. This will reduce the reading rate because muscular activity tires you out. Third, re-read earlier section waste time and slow down your reading rate.

Speeding up your reading

  • Read groups of word. This is to reduce pausing as you read.
  • Minimise sub-vocalise. Reading either aloud or silently was a bad habit.
  • Reduce regression. Don’t go backwards when you read and force yourself to finishing your reading. Try stop at a section if not whole chapter.
  • Focus and avoid any temptation. Choose the most productive time for your reading. E.g. early in the morning.

Saturday, July 25, 2009

The benefit of using __declspec

  • Only applied to pure interface class
  • Compiler stop initializing the vfptr in constructor and destructor.
  • Only references to the vtable that are associated with the class will be remove.
  • Can reduce code size.
I don't know where did I get the above mention notes but I did jot it in my notebook. I think it should be use with novtable storage-class attribute. It suppose to be use with other Microsoft specific storage class attribute and shouldn't be standalone.

I found an article which describe how this keyword can help in code optimization, how the code will improve when disabling vtable initialzation, and how to indicate a function not to throw an exception.