Jun 28, 2010

Segmentation fault

I am tired of getting segmentation fault.
Causes:
1. Accessing unallocated memory using indexing.
2. using delete operator on an unallocated memory.

Jun 27, 2010

Prince William and I

Sometime I feel myself akin to Prince William. We were born on the same year 1982. On top of that Prince William is the son of King(supposedly in the future) Charles. I am the son of King (not adhering to any kingdom rather than by the name 'RAJA', which means in bengali 'the king') Eklimur Reza Raja. May be there are some other resemblance between us (who knows). Forget about it. I am just kidding.

This is a story of my childhood when I was first introduced to the British Kingdom through the marriage of Prince Charles and Princess Diana. We used to live in my aunt's(paternal) house at Dhanmondi, Dhaka. My aunt had a trip to the Europe during that time( around early 80s). They brought a box from England. The box had a printed picture of Prince Charles and Princess Diana on their wedding around it. May be I used to ask my father about that picture and my father replied me back about Charles and Diana. Or may be my father used talk about them since Prince William, first son of Charles and Diana, was born on the same year I was born. Or may be he always wanted me to know about the world, about the history like my grandfather who always encouraged the historical discussion.

As I was gazing through the internet, I felt to explore about the the British Kingdom.
Specifically how Prince William endowed with the right to such veneration from the world since his childhood. Here is the story I gathered:

1. Prince William <-------- Prince Charles


2. Prince Charles <-------- Queen Elizabeth II


3. Queen Elizabeth II <-------- George VI
(Second child of George V)

4. George VI <-------- Edward VIII
(First child of George V)

Edward VIII <-------- George V

5. George V <-------- Edward VII

6. Edward VII <-------- Queen Victoria

7. Queen Victoria <-------- William IV(Children Charlotte and Elizabeth died)
(Grandchild of
George III through
his fifth child
Prince Edward)

King William IV <--------- King George IV
(third child
of George III)

8. King George IV <--------- King George III
(first child of
George III)

(9. King George III son of Prince Friedrich who died before adhering to the throne)
10. King George III <--------- King George II
(Grandchild of
George II through
his first child
Friedrich died
before George II)

11. George II <--------- George I (1660-1727)

Reference :
Kingdom of Great Britain

Jun 23, 2010

Installing Mac OSX 10.6 :Snow Leopard

I needed to run an XCode program that uses the features of GCD.
Grand Central Dispatch (GCD) is a technology developed by Apple Inc. to optimize application support for systems with multi-core processors and other symmetric multiprocessing systems.[1] It is an implementation of task parallelism based on the thread pool pattern. It was first released with Mac OS X 10.6. [from wiki]

This event led me to upgrade my system to Snow Leopard. Because GCD is available on Mac OSX 10.6.x. And I was using OSX 10.5.8.

The upgrading job seemed simple as I started.

1. Insert the Snow Leopard into the DVD drive.
2. Double click the install Mac OSX icon.
3. Select the disk where OSX will be installed.
4. Install.

And the happy ride ends :D.

But there is a difference between knowing the path and walking through it. Midway through the installation I was comfounded with an ERROR SCREEN saying that installation could not be done. Most of the possible escape around were tried but gradually situation was becoming grave.

1. Tried to restart computer and started the re-installation.

2. Tried to revert back to my old OSX from the OSX 10.6 DVD. Machine reported that installation not possible.

3. Tried to see what happens if DVD was ejected. Machine shuts down after trying for a while.

4. Inserted OSX 10.5.5 ROM and tried to recover the old OSX.

5. Tried to save the disk content using the disk utility. Machine found that the node structure of the disk has been collapsed. Alas am I going to lose all the files I have!

6. Finally the Terminal window was summoned upon (POPPPOPOOOOOOOOOO). Flash Drive, Portable HD were mustered for transferring data from the Disk. Rigorous usage of UNIX cp command transferred my data to the Portable HD.

7. Old disk was formatted. Then the machine agreed to install the new OSX 10.6.

Sigh of relief.


Lessons:
--------
1. Always back up the important files from the disk.
Option 1: Use Time Machine to create a disk image of the current state of the Machine so that the saved dmg can be used to revert back if unusual event occurs during installation.
Option 2: Manually save the important files to separate disk.
Option 3: Upload the important file on the web.

2. Think the possible mishaps before committing something new.

Macport on Mac OSX 10.6

What is MacPorts?

MacPorts provides an infrastructure for building, installing, and packaging open source software. It is designed to match the functionality of the FreeBSD Ports system and to be extensible for future enhancements.


System Requirements:

This disk image contains a Universal installer for Mac OS X 10.6.x and requires valid TCL, curl and OpenSSL installations to function - all present by default on Mac OS X. Also required is the installation of Apple's Xcode programing suite, available as a separate installation from your OS X CDs or DVD, or preferably the latest version from Apple's Developer site: http://developer.apple.com/tools/xcode/index.html.


Install Location:

The MacPorts installer copies MacPorts to the target directory /opt/local. If you wish to install to any path other than that, you must install MacPorts via its source code. See Installing MacPorts on the MacPorts webpage for instructions on installation alternatives.


What is Installed:

Aside from a few MacPorts executable commands in /opt/local/bin, most MacPorts files are installed in /opt/local/var/macports. Within these directories you will find a "sources" directory containing the Portfiles that hold the necessary instructions to install individual ports, and also the source code for MacPorts itself. Both are kept up to date by using the port selfupdate command as shown below. Please read the port(1) man page for more information.


Shell Environment:

A file named ~/.profile is created for the "bash" shell (default on Mac OS X 10.3 and newer) during the MacPorts installation. It contains the necessary statements to append MacPorts' binary paths within /opt/local/ to your shell environment, so MacPorts is available to you on subsequent terminal sessions. You may have to quit and restart your terminal application for this change to take effect.


Basic Usage:

The main user interface to MacPorts is the port command and the various facilities it provides for installing ports. The first thing you should do after you install MacPorts is to make sure it is fully up to date by pulling the latest revisions to the Portfiles and any updated MacPorts base code from our rsync server, all accomplished simply by running the port selfupdate command as the Unix superuser:

sudo port selfupdate

Running this command on a regular basis is recommended -- it ensures your MacPorts installation is always up to date. Afterwards, you may search for ports to install:

port search

where is the name of the port you are searching for, or a partial name. To install a port you've chosen, you need to run the port install command as the Unix superuser:

sudo port install

where now maps to an exact port name in the ports tree, such as those returned by the port search command. Please consult the port(1) man page for complete documentation for this command and the software installation process.


Documentation:

The MacPorts Wiki is available at: http://trac.macports.org and should be consulted for further documentation and support. Also provided are man pages for port, macports.conf, portfile, portgroup, portstyle, and porthier. These can be invoked by typing: "man" followed by the name of the command or file (e.g. "man port" or "man macports.conf").


Creating New Ports:

If you are interested in developing your own ports for private usage, or would like to submit your ports for inclusion within the MacPorts software repository, please consult the documentation provided on our website. The MacPorts project depends on a community of active participants and we are always open to welcoming new volunteers and their contributions!

Thank you for your interest in MacPorts!

Jun 22, 2010

Fink for Mac OSX 10.6

I upgraded my system to snow leopard. As usual the utilities needs to be upgraded too.
Here is the link for the fink source installation:Fink 0.29.10 (Unfortunately there is no binary installer for fink now).

1. Download
2. Unpack the file
3. hit on terminal ./bootstrap
This is install basic fink.
4. hit on terminal /sw/bin/pathsetup.sh
and it will install the updates.

Good luck Alimoor.

Carlo Cipolla's Laws of Stupidity

    "By creating a graph of Cipolla's two factors, we obtain four groups of people. Helpless people contribute to society but are...