Saturday, December 27, 2008

Tan Le Brings the Force to Life with Mind Control Device

The Entertainment Gathering 2008
Monterey, CA
Dec 12th, 2008

Tan Le, co-founder and president of Emotiv Systems, gives a live demo of a mind control device that uses a person's thoughts to input computer commands.

See demo video here!

PHP - tutorials and resources for all levels of expertise!

I had been planning to revise the things I did in my mere 4 months professional/commerical work experience with PHP & MYSQL (and Apache) over Windows platform. I did a lot.. solved numerous complications, disiciplined my interpreted programming language skills, and incorporated my ideas into the couple of projects..

What helped me the most? the experience and skills of my extraordinarily talented team lead;
What bored me the most? coding the next .php without thinking to innovate more durable and appealing solutions to reccurent problems..
What did I like? Scrum + Agility + Web Development .. exponential success!

But after 1.5 years, all I can recall are some echos and the nightmares of being lost in some opensource OO php code.If I had the mountains of php code and mysql stuff that I wrote in those 4 months, I would have been proud again of my skills in mere 4 days..

Without it, I needed some resources for quick overviews that I could walk through while doing brainstorming for my thesis study 80% of my daily time.. So I found this digg.com entry:

25 Resources to Get You Started with PHP from Scratch
Dec 23rd in Web Roundups by Drew Douglass

I liked the smooth transition from overly simple walkthroughs to "Advanced and OOP techniques" stuff. Thanks Drew! This article can definitely forward anyone interested in almost any of PHP related things to the finest resources on the web.. give it a try!

over and out.

Thursday, November 13, 2008

If you can't look him straight in the eye

Following is the poem that Chuck Hagel, Nebraska's senior U.S. Senator read out in his Farewell to the U.S. Senate on 2nd October, 2008. The poem's actual author for some is unknown, but this site claims that it's Peter "Dale" Wimbrow Sr. Anyways, it's so perfectly written that none can just ignore it; yet, we can only wish..

When you get what you want in your struggle for self

And the world makes you king for a day,

Just go to the mirror and look at yourself

And see what that man has to say.

For it isn't your father or mother or wife

Whose judgment upon you must pass.

The fellow whose verdict counts most in your life

Is the one staring back from the glass.

You may be like Jack Horner and chisel a plum

And think you're a wonderful guy.

But the man in the glass says you're only a bum

If you can't look him straight in the eye.

He's the fellow to please--never mind all the rest,

For he's with you clear to the end.

And you've passed your most dangerous, difficult test

If the man in the glass is your friend.

You may fool the whole world down the pathway of years

And get pats on the back as you pass.

But your final reward will be heartache and tears

If you've cheated the man in the glass.

[source: http://hagel.senate.gov/public/index.cfm?FuseAction=Home.FarewellSpeech]

Friday, November 07, 2008

Subversion – Introduction

I have been working with Subversion for a while now, but I started right out of an immediate need, and hence without any conceptual background. This time however, a lack of some basic understanding hindered my learning, so, I took out some time to skim through the most reliable source of information. I found this Subversion book titled as "Version Control with Subversion", which can be downloaded here. It's time consuming to go through a 400 pages book to learn about something secondary in importance to my (or any developer's) work, so, I thought it might be useful to summarize things I'll read right away.

Following is the summarized selection I have extracted from the first chapter of the book..

A version control system tries to enable collaborative editing and sharing of data. Subversion is one such system. Different systems use different technique to implement this collaborative environment; even Subversion supports a couple of different methods. It can manage any sort of file collections (not limited to source-code only). At its core, just like any other version control system, there is a repository; it stores information in the form of a file-system tree of files and directories (just like a typical file server). Clients connect to the repository, to read and write files. The operations are synchronized, and each client sees the latest version of the files stored on the repository.

What distinguishes it from a file server, however, is its ability to remember all the changes ever made to any of the files or directories, as well changes in the directory structure and addition and deletion of files. The fundamental problem faced by all version control systems is as questioned: how will the system allow users to share information, but prevent them from accidentally stepping on each other's feet? It's all too easy for users to accidentally overwrite each other's changes in the repository.

In sum, the problem reduces to the following questions: How the latest version of a file should represent all the changes made by some writers, when some reader is reading it? Anyways, two solutions have been proposed to this problem:

The Lock-Modify-Unlock Solution

Three problems:

  1. Locking may cause administrative problems – you lock a file and go on vacation
  2. Locking may cause unnecessary serialization – both need to modify different portions
  3. Locking may create a false sense of security – lock A, then ask for B; lock B, then ask for A

The Copy-Modify-Merge Solution (Used by Subversion and many other systems)

In the fourth action, Harry failed to write the file back to repository because he had an older version (which he was modifying) as compared to the one currently on the latest repository. This is where the concept of “merge” needs to be introduced. So, once Harry downloads the latest repository version, he merges his changes done in the older version into this downloaded latest version, and, writes this merged file back to the repository (A* above). Finally, Sally can now read this updated file that has her modifications as well as that of Harry’s. This solution is much preferred over The Lock-Modify-Unlock Solution in many cases except when the files are sound files or binary files where it will become almost impossible to ensure consistency of the changes made by multiple clients at the same time.

SUBVERSION - IN ACTION

Repository URLs You can access Subversion repositories through many different methods—on local disk or through various network protocols, depending on how your administrator has set things up for you. A repository location, however, is always a URL. Table 1.1, “Repository access URLs” describes how different URL schemes map to the available access methods. Working Copies Subversion has this concept of a working copy, which is essentially an up to date copy of the project source-code that you’ll download (or checkout) from the underlying repository. If the repository has multiple projects, then you’ll need to specifically mention the exact URL of the project subdirectory while issuing a check-out command to SVN, say something like this:

svn checkout http://svn.example.com/repository/my_project

Now, there are two possibilities:

  1. You can checkout/download the source-code of my_project in some ordinary directory; you’ll need to get some typical SVN client to do so. I use TortoiseSVN, which can be downloaded here.
  2. Alternatively, you can checkout/download the source-code into some workspace project’s source folder of the IDE you use for development. I use Eclipse Ganymede these days, and the Subclipse v1.4 plugin does the job for me; it can be downloaded here.

It’s easy to get used to the synchronization mechanisms adopted by Subversion. Most of the times, the only operations one shall use as a developer are Commit, Update, Merge, Compare, Restore, etc. I won’t get into details of each command here (respecting the order of knowledge in the book). Once you’ve checked out the source-code, it’s time for you to play around with it just like you can with any of your local projects. Important thing to note here is that whatever you’ll modify will not have an effect on the original source-code in the repository, and hence the name ‘working copy’. But, at some point in time, you’ll need to incorporate (or commit) your changes into the original files in the project repository. This operation is known as COMMIT, and to do this commit, you’ll execute a command like this:

svn commit MyMainClass.java -m "Fixed a bug in main class"

If all goes good, you’ll be shown a confirmation that your changes have been committed and the repository is now updated. So, the next time you’ll check-out the same my_project code from the repository, you can witness your updated MyMainClass.java code. There is just one last thing that needs to be understood. Consider the following case:

  1. You and some other developer checkout my_project at the same time (hence the same version).
  2. You make changes to MyMainClass.java’s methodX, and, you commit the code.
  3. Then, the other developer makes his/her changes to the same class’s methodY, and tries to commit. This commit however, will fail.

Reason: he/she is trying to commit a modified yet NOT up to date version of the file to the repository. It’s no more up to date, because the latest on repository is YOUR’S MyMainClass.java.

To get over this problem, the other developer will issue an update command, like this:

svn update

The svn will then automatically TRY to update the working copy of this developer by incorporating the changes made by you (or any other changes in the latest version) . The developer, however, is required to do some manual modifications, if he was also updating the same method (i.e. method) or section of code.

Switching to Carrot2.. for now, over & out.

Sunday, November 02, 2008

Stage set - Hillary, Incominggg..

Venue: George Mason University, Fairfax, VA
Date: 2nd November, 2008

Saturday, November 01, 2008

Introduction to Carrot2 Clustering Engine/API


I was pretty much impressed by the easily comprehensible yet powerful facilities provided by this component based clustering engine; thanks to it's devleopers for releasing it's source code. Unlike this opensource engine, there is another clustering engine by Vivisimo, called Vivisimo Velocity, which is commerical and hence helps us in no way. Anyways, to see the best that can be done with VV, try Clusty, which efficiently clusters search results using the Vivisimo clustering technology. However, clusty isn't state of the art in coming up with semantically near-perfection cluster label names, as discussed here.

Anyways, let's appreciate opensource - back to Carrot2.

So, Carrot2 is an Open Source Search Results Clustering Engine. It can automatically organize (cluster) search results into thematic categories, called clusters.

Carrot2 provides an architecture for acquiring search results from various sources (YahooAPI, GoogleAPI(deprecated), MSN Search API, eTools Meta Search, Alexa Web Search, PubMed, OpenSearch, Lucene index, SOLR), clustering the results and visualising the clusters. Currently, 5 clustering algorithms are available that are suitable for different kinds of document clustering tasks.










The architecture of Carrot2 is based on a pipeline of components of three types: input components, filter components and visualization components. The task of input components is to provide search results for clustering based on a user query. Filter components transform the results in some way (e.g. apply clustering, case normalization), and the visualisation components render the transformed results for the user.



I have successfully walked through the most basic example application of this api. It simply uses yahoo api and the lingo clustering algorithm to cluster the results of a certain query. The best way to understand the mechanics of carrot2 and to make the most out of it's abilites, one needs to follow the code while studying the comprehensively written javadoc documentation.

So, I did so.. but for now it's about time for me to shutdown my brain for next 4-5 hours.. I'll continue this post and will try to put forward a precise text extracted out of those comments in the next part, explaining in detail things one needs to know to get started with carrot2!

for now, over and out!

Friday, October 31, 2008

Poke my name!

SALMAN is the most popular 1565th name in USA. One in every 12,107 Americans are named as SALMAN and popularity of name SALMAN is 82.6 people per million.

If we compare the popularity statistics of SALMAN to USA's population statistics, we can estimate that as of October.31.2008 01:04 there are 25,216 people named as SALMAN in the United States and the number of SALMAN's are increasing by 217 people every year.

Usage of salman as a first name is 75.86% and its usage as a middle name is 24.14%. The sum of alphabetical order of letters in SALMAN is 60 and this makes SALMAN arithmetic buddies with words like Pure, Active, Dapper, Holy.






















Yes :p
You get all this information about your name here

By the way, I was experimenting (building from source in eclipse ide) Carrot2's opensource clustering search engine demo browser, I was frustated and tired; [so,] the first thing I search for was my name, and some cluster pointed me to this interesting junk :D

Wednesday, October 22, 2008

UnChrome your Chrome

Regarding to Google, "Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier". Unfortunately, each Google Chrome installation contains a unique ID that allowing identifying its user. Google doesn't make it an easy job to remove this ID.

The UnChrome application was designed to help you with this task. It replaces your unique ID with Null values so that your browser cannot be identified any longer. The functionality of Google Chrome is not influenced by this. You only need to apply UnChrome once.

If Google Chrome is started now then please close it. Afterwards, please click on the link below to anonymize your Chrome installation.


Article Link
Download Link

Sunday, October 12, 2008

Messing around Facebook..

What's the quickest way to findout answers to following questions about facebook users:

1- How many male computer science graduates from my *university* aged between 18 and 25 are registered on facebook?

2- How many male computer science graduates from my *country* aged between 18 and 25 are registered on facebook?

3- How many *female* graduates from my university aged between 18 and 25 are registered on facebook?

4- How many graduates from my university are registered on facebook?

The quickest thing that came to my mind was to use the API somehow, however there is something else that facebook wants advertisers to use to answer such questions!! But hey, anyone can turn out to be an advertiser on facebook :D

So, yeh! it's pretty easy and thanks to Alec Saunder for innovating this trick!

To answer countably infinite such questions, follow the steps that he has neatly outlined on his blog here.

Summarizing it, there is no big trick here. Each advertiser is facilitated by facebook with a query builder that immediately returns *ONLY* the number of results of a specific input query. With a little investigative approach and excessive show of curiousity, you can use this tool to build a strong data set of facebook statistics, which by all means, can be called a representative sample of all the world wide web users!

Following is a depiction of my lack of creativity to use this tool, :p

There are 2440 18 year old males from China registered on Facebook.
There are 1,143,180 18 year old males from USA registered on Facebook.
There are 31,020 18 year old males from India registered on Facebook.
There are 11,400 18 year old males from Pakistan registered on Facebook.
There are 267,760 18 year old males from UK registered on Facebook.

Data Mining in Social Networks

With huge social networks around, I felt like it might be easier to apply some typical data mining algorithm on any dataset that I will extract from these networks, using their released APIs.

So, it turned out that it isn't a child's play for two reasons:

1- the data from social networks is relational, and hence data objects are linked in one way or other. Contrary to this, in typical propositional data, for e.g. patient records, data objects are independent of one other. So, a different breed of mining algorithms are required (e.g. Bayesian classifiers).

2- the process of extraction of data, keeping in consideration the legality of the technique, and other limitations.

Anyways, we've got to find something for our data mining class project. I jumped into Web Mining from typical and *boring* UCI data sets' based projects. Then, I started noticing interesting approaches to mining social networks.

So, I was looking for an introductory paper on mining social networks and I found this paper hosted by the Knowledge Discovery Laboratory of the Computer Science department at Purdue University, here. It really serves the purpose and the title "Data Mining in Social Networks" makes it more interesting for newbies. The authors are David Jensen and Jennifer Neville. I would recommend anyone interested in having a decent introduction to the subject matter, to go through this paper once!

~over and out

Tuesday, September 30, 2008

Underwater astonishments - Camouflaging Octopus Footage

I have always felt proud of my inquisitiveness and investigative approach to dig deeper into almost anything that amazes me (yeh anyhting!). I have been following very aggressively things people share on Digg, Dzone, and Youtube; and, I usually get to know more about them, beyond the content that's shared..

But, something, I don't know how, but I missed it. It was shared by a very good brother, and literally, this was beyond most of the great thing I have ever seen or heard about. For me, as being a computer freak, this was beyond calculations, or algorithms.. and I am sure it's a jaw-dropping footage of the beauty of nature, mashallah for everyone out there associated with any sort of engineering and non-engineering field of study. The only comment I can bring to words is that it's not out there without a purpose, it's not a coincidence, and it's not a yet-another illusion; but, it's a real-world miracle of Allah, a fascination that carries numerous signs with it (atleast for me).

Anyways, so it's an Octopus (Vulgaris) that for various reasons use its ability to match its pattern, color, brightness, and texture of apparently anyhting that it's resting upon. Above all, this is the first time it's caught on camera.
See the following video:



Following is the complete talk given by David Gallo. "David Gallo works to push the bounds of oceanic discovery. Active in undersea exploration (sometimes in partnership with legendary Titanic-hunter Robert Ballard), he was one of the first oceanographers to use a combination of manned submersibles and robots to map the ocean world with unprecedented clarity and detail.
He was a co-expedition leader during an exploration of the RMS Titanic and the German battleship Bismarck, using Russian Mir subs. On behalf of the Woods Hole labs, he appears around the country speaking on ocean and water issues, and leading tours of the deep-ocean submersible Alvin."


Tuesday, September 16, 2008

Hurricane IKA

This link has the best pictorial depiction of the devastation caused by hurricane IKA! do check them out. Let's wish the best for the affected people..

Monday, September 01, 2008

What is AI Winter?

An AI Winter is a collapse in the perception of artificial intelligence research. The term was coined by analogy with the relentless spiral of a nuclear winter: a chain reaction of pessimism in the AI community, followed by pessimism in the press, followed by a severe cutback in funding, followed by the end of serious research.

It first appeared in 1984 as the topic of a public debate at the annual meeting of AAAI (then called the "American Association of Artificial Intelligence"). Two leading AI researchers, Roger Schank and Marvin Minsky, warned the business community that enthusiasm for AI had spiraled out of control and that disappointment would certainly follow. They were right. Just three years later, the billion-dollar AI industry began to collapse.

The process of hype, disappointment and funding cuts are common in many emerging technologies (consider the railway mania or the dot-com bubble), but the problem has been particularly acute for AI. The pattern has occurred many times:

1966: the failure of machine translation,
1970: the abandonment of connectionism,
1971−75: DARPA's frustration with the Speech Understanding Research program at Carnegie Mellon University,
1973: the large decrease in AI research in the United Kingdom in response to the Lighthill Report,
1973−74: DARPA's cutbacks to academic AI research in general,
1987: the collapse of the Lisp machine market,
1993: expert systems slowly reaching the bottom,
1990 or so: the quiet disappearance of the fifth-generation computer project's original goals
and the generally bad reputation AI has had since.
The worst times for AI have been 1974−80 and 1987 to the present. Sometimes one or the other of these periods (or some part of them) is referred to as the AI winter.

The historical episodes known as AI winters are collapses only in the perception of AI by government bureacrats and venture capitalists. Despite the rise and fall of AI's reputation, it has continued to develop new and successful technologies. AI researcher Rodney Brooks would complain in 2002 that "there's this stupid myth out there that AI has failed, but AI is around you every second of the day." Ray Kurzweil agrees: "Many observers still think that the AI winter was the end of the story and that nothing since come of the AI field. Yet today many thousands of AI applications are deeply embedded in the infrastructure of every industry." He adds unequivocally: "the AI winter is long since over."

[source: wikipedia]

back to school

Hi, I was doing good, but the school started last week :I
So, I got myself registered for 2 classes:

justification - Expert Systems:

  • Attending explanatory and detailed lectures about disciple architecture,
  • To work towards certificate in Intelligent Agents,
  • To listen to the critical questions posed by students at disciple approach,
  • Trying to get implicit answers ciritcal to my thesis study, and
  • To become able to write some journal paper related to what I’ll be taught in class and what I am studying for my thesis.

jjustification - Data Mining:

  • Dr. Carlotta Domeniconi was teaching it (no more, but new prof. is good),
  • To learn atleast the definition of mining!,
  • to diversify my know-how of cs topics,
  • to find out a way to take time out to use google maps api to crawl google maps data and use it somehow (how intelligent :p)
  • ...

Sunday, August 24, 2008

Mason Tops U.S. News List of Schools to Watch

August 22, 2008
By Dave Andrews and Tara Laskowski

Mason was named the nation’s number one university to watch on U.S. News and World Report's new list of “Up-and-Coming Schools” published on Friday, Aug. 22.

The list, comprising 70 colleges and universities across the country, identifies “schools that have recently made the most promising and innovative changes in academics, faculty, students, campus or facilities.”

In its annual peer assessment survey, U.S. News asked education experts to identify schools that met those criteria. This is the first time a list of up-and-coming schools has been created.

"Being recognized by U.S. News & World Report for this is both an honor and validation of our efforts,” says Mason President Alan Merten. “This acknowledgment is something that every one of our faculty, staff, students and alumni should be proud of.”

Celebrating its 37th anniversary in 2009, Mason has strong academic and research programs, which concentrate on producing successful students and accomplished alumni with a global focus.

In the past three years, Mason has added 27 degree programs, including undergraduate degrees in global and environmental change, and film and video studies.

The university also partnered with the Smithsonian Institution in fall 2007 to create the Smithsonian Semester, which allows students to live on-site at the Conservation and Research Center of the Smithsonian's National Zoo and study global-scale conservation issues and civic concerns.

The university has a reputation for forward-thinking academic offerings. In the 1980s, Mason established the first engineering school in the country to focus on information technology to meet the workforce needs of an emerging high-tech economy.

The university also boasts some of the most cutting-edge research in the biosciences, from cancer research to thwarting biological weapons.

Its new biomedical research laboratory is one of 13 nationwide being built with the help of a $25 million grant from the National Institute of Allergy and Infectious Diseases, part of the National Institutes of Health.

The university's students are innovators as well. From discovering new galaxies to lobbying legislators on policy issues, Mason students have success in all areas.

Mason has one of the strongest undergraduate research programs, and students regularly publish research that contributes to the knowledge of their field. The school has produced acclaimed authors, popular television personalities, celebrated Olympic athletes and renowned scientists.

Mason is a young university that continues to grow. The school is in the midst of its largest structural transformation ever, investing more than $500 million in construction between 2002 and 2013.

Highlights include multiple new academic buildings, an on-campus hotel and conference center and what will soon be one of the largest academic, residential communities in Virginia.

“For universities or colleges to achieve and maintain excellence, it is imperative that they continually seek ways to be innovative, enhance their academic programs and upgrade their facilities,” says Provost Peter Stearns.

“This strategy has allowed our faculty to pursue their research, and students to achieve their educational goals.”

Sunday, August 17, 2008

Comparison of Enum Types - Java vs C# vs C++

Enumerated Lists in Java

Each item in the list is called an enum. Each enum is of the type under which it is declared. It is no way a string, or any integer. The simplest declaration of an enumerated list in java is as follows:

enum BookType { HARDCOPY , EBOOK }; //where the semicolon is optional

Note here that HARDCOPY and EBOOK are not strings, there type is BookType. Anyways, once declared, we can use an instance of BookType as,

BookType bt1 = BookType.HARDCOPY;
BookType bt2 = BookType.EBOOK;


Beyond this, any other assignment to BookType would result in a compilation error.
Java’s coding conventions want you to capitalize all the constants in an enum type declaration. Having any other case combination is legal.

An enum in Java is just like a separate class. So, they can be declared independent of any class, like a different class. However, the only access modifier applicable to an independent enum declaration is public (and default i.e. no modifier). It can never be private or protected (obviously!).

They can also be declared as a class member; however, they can never be declared as a local type i.e. within a method! Any access modifier can be used with an enum type which is declared inside a class - It can be public, private, default (no modifier), or protected.

If an enum type is declared in classOne and it is being used in classTwo, then the assignment of values to this enum type’s instance is changed as follows:

public classOne {
enum BookType { HARDCOPY , EBOOK }
BookType bt;
}

public classTwo {
public classTwo(){
classOne instanceOne = new classOne();
instanceOne.bt = classOne.BookType.EBOOK;
// instanceOne.bt = BookType.EBOOK;
// this is wrong, compilation error.
}
}


As I said earlier, an enum type declaration is simply a kind of a class declaration and hence it can incorporate constructors, and member variables and methods. Why do you need all this? Because sometimes you really need to know more about a particular enum constant then just a weird looking capitalize word.

Consider following:

enum BookType{

HARDCOPY("expensive"), EBOOK("cheap");

public String bookPriceIdea; //bad practice: use getter/setter.

private BookType(String priceIdea) {
this.bookPriceIdea = priceIdea;
}
}


In the above example, each enum type is associated with a string that tells more about the price of the type of book. Think of anything else, and you can associate it to any enum type in a similar way. Notice that I have declared a member variable within the enum type declaration, this is allowed. Also note that the access modifier of the constructor is private, which is again strange; however, it cannot be public or protected because apparently it’s for internal use (invoked automatically), and not for any external invocation.

Optionally, you can just ignore the access modifier here to give it a default behavior. Accessing this additional attribute associated with an enum constant is easy and is as follows:


BookType bt = BookType.HARDCOPY;
String btPriceIdea = bt.bookPriceIdea;


Finally, there is something called “constant specific class body”. Within the declaration of the enum type, such a class body (that looks like an inner class) can be associated with any enum constant. Within this code section/body, you override a member function of the enum type declaration. The following example will hopefully clarify this:

enum BookType {

AMAZONKINDLEBOOK,
EBOOK,
HARDCOPY{
public boolean getBookDependencyOnElectronics(){
return false;
}
};

public boolean getBookDependencyOnElectronics(){
return true;
}
}


-------------------------------------------------------------------------------------
Enumerated Lists in C#

Simple declaration:

Enum enum-type-name { enumConstant1, enumConstant2 … }

Consider following example:
Enum FamilyMembers
{
Father,
Mother,
Daughter,
Son
}


The first constant has a default value of 0 (i.e. father = 0). Each of the following constants are given increasing integers from 0 onwards like 1, 2, 3 and so on. Note that the default type of the constants is the primitive type int. If you don’t want the integer assignments for constants to start from zero, you can manually initialize the first one from the intended starting int as follows:

Enum FamilyMembers
{
Father=1,
Mother,
Daughter,
Son
}


So, Father=1, Mother=2, Daughter=3 and Son=4. You can do the following in C#:

System.Console.WriteLine(“Order of mother is “ + (int) FamilyMembers.Mother);

However, the following is not allowed in Java:

System.out.println(“Order of mother is “ + (int) FamilyMembers.Mother);

Instead, you can associate the attribute “order” with FamilyMembers type as discussed earlier.

Coming back to C#, one can also do the following to associate average ages of members of a typical family:

Enum FamilyMembers
{
Father=50,
Mother=45,
Daughter=20,
Son=15
}


And,

System.Console.WriteLine(“Average age of a mother is “ + (int) FamilyMembers.Mother);

The base type of an enumeration, which is by default int, can infact be changed to any of the integer types. Following is the syntax to do so:

Enum FamilyMembers: short
{
Father=50,
Mother=45,
Daughter=20,
Son=15
}


Even though the base type is short, but an explicit cast is still required when using these as shown here:

short averageAge = (short) FamilyMembers.Father;

-------------------------------------------------------------------------------------
Enumerated Lists in C++

Enumerators in C++ are less complicated then structures, and they are not class-like declarations as they are in Java. Each constant in the enum type declaration is called enumerator (called enum in Java). Consider the following famous enumeration of days of the week:

enum week_days {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
};

void main (){
week_days dayOne;
dayOne = Wednesday;
cout<<dayone<<endl;
}


Note that the declaration of enumeration is nothing different to what we have seen previously except for the face that the semicolon is a must in C++. Consider the following code:

enum week_days {
Sunday,
Monday=1,
Tuesday,
Wednesday=1,
Thursday,
Friday=9,
Saturday
};


In C++, enumerations are treated internally as integers which is again unlike Java, where the type of enum constant (enumerator) is its owner enum type, and nothing else. The thing to note here is that Sunday=0, Monday=1, Tuesday=2, Wednesday=1, Thursday=2, Friday=9, and Saturday=10. And so, same integer can be associated with multiple enumerators.

Since enumerators are internally treated as integers, apparently all integer arithmetic can be performed on them. Hence, the following is legal:

int i = Sunday; // i becomes 0
int j = 3 + MOnday; // j becomes 4


However, the reverse ain't possible - no implicit conversion from int to enum:

week_days dayOne = 2; // compilation error, such a type conversion is illegal.

Sunday, August 03, 2008

I baked fudge brownies; all alone!!!

Yes I did it.. except for a few seconds of confusion in the process, it went fine and the outcome was delicious!.. more importantly, it's good to eat it all alone.. err, or is it :p

















Friday, August 01, 2008

Instantaneous updates on feelings..

So, don't even dare to pass by if 'enraged' is the update! Anyways, I sneaked into someone's private space to get this snapshot.. I would love to have one such I dont know what to call it, let's say may be 'feeling manager' :D

Wednesday, July 16, 2008

VisualVM 1.0

VisualVM is a visual tool integrating several commandline JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it further enhances the capability of monitoring and performance analysis for the Java SE platform. Using it,

Application Developer can monitor, profile, take thread dumps, browse heap dumps.
System Administrator can monitor and control Java applications across the entire network.
Java Application User can create bug reports containing all the necessary information,












[source: https://visualvm.dev.java.net/]

Monday, July 14, 2008

I am a 'little' part of AAAI

Today, I became a part of apparently the most active Artificial Intelligence group i.e. Association for the Advancement of Artificial Intelligence (AAAI). I was eligible for the Student Membership costing 35$ per year for students in US/Canada. Following are the officially listed benefits associated with a typical membership:
  • AI Magazine: Included in your basic membership
  • The AAAI Conference on Artificial Intelligence: Members receive substantial discounts on registration fees
  • The Conference on Innovative Applications of Artificial Intelligence: Members receive substantial discounts on registration fees
  • The online AI Directory: Included in your basic membership
  • Sponsored Journals: Members receive substantial discounts on subscription fees
  • The Spring Symposium Series
  • AAAI Technical Reports: Members receive discounts on technical reports
  • AAAI Press
  • Access to expanded world wide web services: Members receive password access to controlled portions of AAAI's web, where they can find full-text versions of the latest AI Magazine, along with other members-only materials.
  • AAAI Workshops
  • AAAI Affiliates

Sunday, July 13, 2008

A Proper Push-Up!

  1. Lie chest-down with your hands at shoulder level, palms flat on the floor and slightly more than shoulder-width apart, your feet together and parallel to each other.
  2. Look forward rather than down at the floor. The first contact you make with the floor with any part of the face should be your chin, not your nose.
  3. Keep your legs straight and your toes tucked under your feet.
  4. Straighten your arms as you push your body up off the floor. Keep your palms fixed at the same position and keep your body straight. Try not to bend or arch your upper or lower back as you push up.
  5. Exhale as your arms straighten out.
  6. Pause for a moment.
  7. Lower your body slowly towards the floor. Bend your arms and keep your palms in fixed position. Keep body straight and feet together.
  8. Lower body until chest touches the floor. Try not to bend your back. Keep your knees off the floor, and inhale as you bend your arms.
  9. Pause for a moment. Begin straightening your arms for a second push-up. Exhale as you raise your body.
[source: eHow]

Wednesday, July 02, 2008

Is the OntologyWorks Knowledge Server a Database?

I was looking for companies that are working with technologies related to Semantic Web. I noticed that a few members in the RIF (Rule Interchange Format) workgroup at w3c are from OntologyWorks.

They
define themselves as,
".. a product company offering a broad suite of semantic technologies including deductive information repositories (our Ontology Works Knowledge Servers), semantic information fusion and cost effective semantic federation of legacy databases, ontology-based domain modeling, and management of the distributed enterprise."

It wasn't unusual for them to justify their existence, considering the fact that there are a number of disbelievers as far as the ability of Semantic Web concerned. One question that they answered was the thing that whether their capabilities were any different from companies offering typical database management system based services. Following is their
justification:
"Our information repositories are called Ontology Works Knowledge Servers to distinguish them from traditional database management systems or “databases” as these are usually called. Our Knowledge Server Family of ontology-based deductive systems do all that a database does but also do so much more that. They are a change of state in database technology, as from water to steam. We also apply our semantic technology capabilities to other information management systems, e.g. semantic legacy database federation, semantic enterprise mission management, semantic enhancement of existing databases and other applications.

In essence, traditional databases contain models of the world that are truncated and mute on many issues. They do not do inference over the model and cannot handle 3-place and higher relationships as our systems can. The emphasis in traditional databases is on storing lots of data and getting some of it out fast when needed. They were built so that users could ask for something, not about something. Traditional systems are brittle, expensive to maintain, and can't provide the answers the modern enterprise needs.

At our end of the semantic technologies spectrum we can describe the knowledge domain you care about with full descriptive power - with temporal understanding, n-place relationships and a powerfully descriptive controlling logic that allows complex inference over the model.

The genius of Ontology Works is that we can instantiate this complex, expressive model (ontology + controlling logic) of a knowledge domain in a deductive system - the eXtensible Knowledge Server (XKS) that gives excellent query performance for complex query whose answers have very high value to the enterprise. Our Knowledge Servers give the user real knowledge discovery, not just data retrieval.

The question then is not, “Is it better to have these highly expressive information systems or go back to mute data models?” The question is, “Yes, this expressiveness is an undoubted good, but is it efficiently computable.” With Ontology Works the answer is “Yes, it is efficiently computable.” Consequently, the economics of implementing our systems is very favorable."

Tuesday, June 24, 2008

Perfect Rainbow!
















I took these snapshots near the newly built dorms at George Mason University's Fairfax Campus. On closely observing these, one can see the second lighter rainbow just above the first. Honestly speaking, this is the first time ever that I saw such a perfect beauty of nature! Anyways, I wouldn't have experienced it if there were no thunderstorm warning, which made us to leave earlier..

Monday, June 23, 2008

IQ Game



To start press the BIG BLUE button.
The RULES are as follows:
1, Only two people can travel at once
2, Daddy (with short brown hair) can not stay with the girls (long hair) without the presence of the mother
3, Mum (with long bluish hair) cant stay with the boys (short hair) without the presence of the father
4, The arrested red-hair girl in stipy outfit cannot stay with any of the family members
5, Only the Police officer and the parents can drive the boat across the river

Click on the people you want to transport
To use the boat click on the red dots next to the boat

Following is some unauthentic info about it:
This test was developed and used in Japan for job and university IQ tests
Mainly used in the IT sector
This test is solved in around 15mins (in Japan)

If you succeed in:
  • 4 minutes: you are a Genius
  • 6 minutes: You are exceptionally intelligent
  • 10 minutes:You are very intelligent
  • 20 minutes:You are average
  • 25 minutes: You are a bit slow
  • 30 minutes or more: You are terrible
Finally, I did it in 6 minutes. But, I am sure that I am missing the atoms of an exceptionally intelligent human being. :D

Wednesday, June 18, 2008

CodeIDE: An Online IDE

Online apps are the way of the future they say, and if you needed more proof there’s now an online IDE for programmers called CodeIDE. CodeIDE is an in-browser development environment that mixes a text field for writing code, a debug panel, a command line input and other tools.
So far CodeIDE supports Basic, Pascal, C++, Perl, Javascript, HTML, MATH and LISP. Registered users get chat tools which can be used to solicit help and advice from other users. If you sign up for an account you’ll also get access to organizational tool like projects and files.
While the text field-based text editor has some impressive features like syntax highlighting, line numbering and search and replace capabilities, I doubt it’s going to replace emacs or Vi for the serious coder.
But aside from the limited text editor feature, CodeIDE is an impressive setup and when used in conjunction with a real text editor the debug features are just a cut-and-paste away. Where applicable (HTML mainly) the debug window auto updates so you can see your markup as you enter it.
While it isn’t all that useful, there’s a nice little AJAXy widget that show live debug results from other users which is kind of fun to watch. There’s also a forum and wiki, though both are a bit short on content since the site just went live a couple of days ago.


Tuesday, June 17, 2008

Where do you sit in class!







Ha, ha, haaa!













ISLAMABAD - June 16: A sergeant of the
Islamabad Traffic Police issuing a ticket to a city policeman for jumping the ‘red light’ at Radio Pakistan crossing on Monday.—Photo by G.A. Zaidi

Tuesday, June 10, 2008

Yes, he said Insect :|

A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. - Robert A. Heinlein, "Lazarus Long"

Sunday, June 08, 2008

My MS Thesis

On 2nd June, 2008, I started my M.S. Thesis study in a sort of official manner. I requested my advisor Dr. Tecuci and supervisor Dr. Boicu to suggest me a thesis topic. I did it deliberately as I had a bad experience in working on one of my own research topic as part of my undegraduation final year project, where all the responsibility and planning lied with me and all that a supervisor asks you is 'watsp' or 'howz it goin'. So, my understandings lead me to have supervision in the sense of transfer of knowledge, experience, and planning ability.

Also, I added one single condition in regard to my research topic that they might propose: Some how, I want to work in parallel to the Semantic Web Activity. Fortunately, they already had a broad vision about such a project in relation to Disciple System. Eventually, in the next meeting, I was introduced to the vision, direction, timeline, opportunities, and expectations. And, I loved it!

The Disciple System, which is a brainchild of Dr. Tecuci, was not developed since its inception, while keeping in mind a compliance with the artifacts of the semantic web. In the recent years, however, a lot work was done to get the most out of OWL, while extending it where it was required. Now, the related standards have all matured, and at the same time new standards are being developed. To achieve a strong compliance b/w Disciple and those standards, I am required to study, observe, and participate in development of a couple (or may be single) standards, which provide the same (or more) facilities that Disciple is providing in a non-standard way. This would be achieved by identifying relevant W3C working groups (RIF etc), and seeking memberships. Following this, we would rebuild certain components of Disciple to conform to norms of semantic web standards and would come up with some sort of association b/w non-conventional expert systems and semantic web.

Yes, it's all very much abstract as of now and it remains like this traditionally. The more I'll study, the narrower the vision will be, till the moment when I'll be able to say it all in a couple of statements, known as the Thesis Statement.

That's it!

Monday, May 19, 2008

The 4 Core Principles of Agile Programming

Author: Joe Winchester, JDJ's Desktop Technologies Editor, is a software developer working on development tools for IBM in Hursley, UK.

One of the things I really enjoy at the moment is the recognition and adoption of agile programming as a fully fledged powerful way to deliver quality software projects. As its figurehead is a group of very talented individuals who have created the agile manifesto http://agilemanifesto.org/. At its core are four simple principles that, when followed and applied to software projects, generally will ensure a great flexibility and hence higher agility.

Leaving aside how great agile projects are, what worries me at the moment is that more and more people seem to be buying into this idea that agile programming is a noun rather than a verb, and that to do it correctly you have to follow a certain process to the letter.

Point 1: the manifesto for agile developemt states that it puts "Individuals and interactions" over process and tools. In other words, you adapt the process and tools to the team and not vice-versa.

A colleague of mine recently attended a lecture on how their company was going to roll out a company wide agile methodology. They'd given it a silly in-house acronym and appointed a team of people to help projects adopt this new methodology. At the lecture attendees were given a 97 page ring bound handout explaining agile programming that, on page 85, warned people to "beware of powerpoint architects". Forget having a black fly in your chardonnay folks, this is like having a herd of dinosaurs squash your PC and replace it with a punch card mailbox.

Point 2: the manifesto for agile development states that it puts: "Working software over comprehensive documentation".

In the same week a friend of mine e-mailed me to complain that at her company they'd decided to become agile and renamed all of their meetings to scrums. Folks, if it smells like a pointless meeting, if it looks like a pointless meeting, if it tastes like a pointless meeting, then it probably is a pointless meeting. Calling it a scrum isn't going to change that. What was even more ironic was that at said meeting my friend, who was the only person there who'd written any code in the last ten years, yet had to suffer watching six colleagues stare at PowerPoint charts of dates and endlessly argue about which documents had to be signed off at which points in the next few months to obtain the right sizing to get the right approval to go ahead with the project that had the right marketing messages, blah blah, and so forth. The thought of actually coding something and showing it to customers to see what they thought and repeating this process to create an iterative feedback loop was clearly beyond their comprehension. Forget having ten thousand spoons when all you need is a fork; it's like having ten thousand planners when all you need is a developer.

Point 3: the manifesto for agile development state that it puts: "Responding to change over following a plan."

Legal departments can be a huge obstacle to agile development. I've heard so many stories of projects that want to reach customers early to get feedback yet find immovable hurdles thrown up by lawyers who insist that documents must be signed by the customer that their legal departments refuse to do so, creating a deadlock that keeps both sets of lawyers happily engaged, yet drives a massive wedge between the developer and their potential future user ,thereby destroying the whole feedback loop that is essential to the "perpetual beta" concept. When pressed most of the arguments given by lawyers, often pseudo lawyers because they don't actually have law degrees, are usually ridiculous and involve extrapolating things ad absurdum; "What if Foo does Boo and Moo sues us and we all get crushed by a falling comet ?", or recounting quondam horror stories, "Remember when Foo messed up and we all got sued and had to save the day and you're just about to do the same, etc...". Unfortunately legal departments hold a huge amount of power at corporations and love nothing more than to remind other groups of just how big and important they are.

Point 4: the manifesto for agile development state that it puts "Customer collaboration over contract negotiation".

If companies refuse to actually change themselves, even if means changing the core and fabric of all that prevents the projects from becoming agile, then they'll just end up about as flexible as an elephant with two left feet. Being agile is not a buzzword; it is not a religion; it is not a methodology; it is about taking a few core principles and applying them to everything related to the entire development process. It is about taking risks, getting customers more involved with the development cycles, and reaping the rewards at the end when higher quality, better functioning, and more thoroughly tested code is delivered.

[source: http://xml.sys-con.com/read/522904_1.htm]

Sunday, May 18, 2008

Metacrap

Metacrap is a portmanteau drawn from metadata and crap. The origin of the word is unknown, but it was popularized by Cory Doctorow in a 2001 essay titled "Metacrap: Putting the torch to seven straw-men of the meta-utopia."

In the essay, Doctorow illustrates problems in relying on metadata for knowledge representation in online records or files by drawing humorous parallels to real-world systems, as well as showing examples of metadata collapse in online, web-based systems. The fragility of metadata is an important concern because much planning for improving the web (such as the semantic web) is predicated upon certain flavors of metadata becoming widely adopted and used with care -- something which, according to Doctorow's essay, will not and cannot happen.

Doctorow's seven insurmountable obstacles to reliable metadata are:

  • People lie
  • People are lazy
  • People are stupid
  • Mission Impossible: know thyself
  • Schemas aren't neutral
  • Metrics influence results
  • There's more than one way to describe something

The complete article can be read here.

[source: http://en.wikipedia.org/wiki/Metacrap]

Friday, May 09, 2008

Dua' to help you with your studying

Dua Before Studying

Allahumma infa’nii bimaa ‘allamtanii wa’allimnii maa yanfa’ unii.
O Allah! Make useful for me what You taught me and teach me knowledge that will be useful to me.

Allahumma inii as’aluka fahmal-nabiyyen wa hifthal mursaleen al-muqarrabeen.
O Allah! I ask You for the understanding of the prophets and the memory of the messengers, and those nearest to You.

Allahumma ijal leesanee ‘amiran bi thikrika wa qalbi bi khashyatika.
O Allah! Make my tongue full of Your remembrance, and my heart with consciousness of You.

Innaka ‘ala ma-tasha’-u qadeer wa anta hasbun-allahu wa na’mal wakeel.
(Oh Allah!) You do whatever You wish, and You are my Availer and best if aid. Protector and the best of aid.

Dua After Studying

Allahhumma inni astaodeeuka ma qara’tu wama hafaz-tu. Faradduhu ‘allaya inda hagati elayhi. Innaka ‘ala ma-tasha’-u qadeer wa anta hasbeeya wa na’mal wakeel.
Oh Allah! I entrust You with what I have read and I have studied. (Oh Allah!) Bring it back to me when I am in need of it. (Oh Allah!) You do whatever You wish, and You are my Availer and Protector and the best of aid.

Dua While Studying Something Difficult

Allahumma la sahla illama ja-’altahu sahla wa anta taj ‘alu al hazana etha shi’ta sahla.
O Allah! Nothing is easy except what You have made easy. If You wish, You can make the difficult easy.

Dua For Anxiety

Allahumma inni a’oodhoo bika minal-hammi-walhazan. Wa’a oodhoo bika minal-ghammi-wal-kasal. Wa’a oodhoo bika minal jubni wal bukhl. Wa’a oodhoo bikal min ghalabatid-dayni-waqarir rijal.
Oh Allah, I seek refuge in You from worry and grief, from helplessness and laziness, from cowardice and stinginess, and from overpowering of debt and from oppression of men.

Dua For Distress

Allahumma rahmataka arjoo falaa takilnee ilaa nafsee tarfata ‘aynin wa aslih-lee sha’nee kullahu, laa ilaha illa anta.
O Allah! It is Your mercy that I hope for so do not leave me in charge of my affairs even for a blink of an eye and rectify for me all of my affairs. None has the right to be worshipped except You.

Dua For Distress and Grief (Taken from USC-MSA website)

This is based on the following saheeh hadeeth reported by Imaam Ahmad (translation adapted from www.islam-qa.com; see question 1392):
The Messenger of Allaah (peace and blessings of Allaah be upon him) said: ‘There is nobody who is afflicted with distress or grief and who says: “Allaahumma inni ‘abduka wa ibn ‘abdika wa ibn amatika, naasiyati bi yadika maadin fiyya hukmuka ‘adlun fiyya qadaa’uka, as’aluka bi kulli ismin huwa laka sammayta bihi nafsaka aw ‘allamtahu ahadan min khalqika aw anzaltahu fi kitaabika aw asta’tharta bihi fi ‘ilmi al-ghaybi ‘indaka an taj’al al-Qur’aana rabee’a qalbi wa noor sadri wa jilaa’a huzni wa dhihaaba hammi.’

‘O Allaah, I am Your slave, son of Your slave, son of Your maidservant, my forelock is in Your hand, Your command over me is ever executed and Your decree over me is just. I ask You by every name belonging to You which You have named Yourself with, or which you revealed in Your Book, or which You taught to any of Your creation, or which You have preserved in the knowledge of the Unseen with You, that You make the Qur’aan the life of my heart and the light of my breast, and a departure for my sorrow and a release for my anxiety,” - but Allaah will take away his distress and grief, and replace it with ease.’ He was asked, ‘O Messenger of Allaah, should we not learn it?’ He said, ‘Of course, whoever hears it should learn it.’

[source: George Mason University - Muslim Students Association, http://gmu.edu/org/msa/]

Thursday, May 08, 2008

Tornado Warning

TORNADO WARNING NATIONAL WEATHER SERVICE BALTIMORE MD/WASHINGTON DC 1133 PM EDT THU MAY 8 2008

THE NATIONAL WEATHER SERVICE IN STERLING VIRGINIA HAS ISSUED A TORNADO WARNING FOR... PRINCE GEORGES COUNTY IN CENTRAL MARYLAND FAIRFAX COUNTY IN NORTHERN VIRGINIA PRINCE WILLIAM COUNTY IN NORTHERN VIRGINIA STAFFORD COUNTY IN NORTHERN VIRGINIA CHARLES COUNTY IN SOUTHERN MARYLAND UNTIL 1215 AM EDT

* AT 1132 PM EDT...NATIONAL WEATHER SERVICE DOPPLER RADAR INDICATED A DEVELOPING TORNADO NEAR TRIANGLE... MOVING NORTHEAST AT 27 MPH.

* LOCATIONS IMPACTED INCLUDE... WOODBRIDGE... INDIAN HEAD... LORTON... FORT BELVOIR...

IF YOU ARE IN OR NEAR THE PATH OF THIS STORM...TAKE COVER NOW! IF NO UNDERGROUND SHELTER IS AVAILABLE MOVE TO AN INTERIOR ROOM ON THE LOWEST FLOOR. MOBILE HOMES AND VEHICLES SHOULD BE ABANDONED FOR MORE SUBSTANTIAL SHELTER. AVOID WINDOWS!

[source: http://www.weather.com/weather/newscenter/alerts/USVA0262?alertId=579280]

Monday, May 05, 2008

Jabber: agsXMPP SDK

agsXMPP is a SDK / library for the eXtensible Messaging and Presence Protocol (XMPP) protocol written in managed C# dedicated to .NET and Mono technologies. The SDK is released as open source under a dual license.
Our SDK could be used for XMPP client, server and component development.

----------- FAQS -----------

Will you add feature xyz?
We work continuous on new features and XMPP extensions. Feel free to contact us if you want to sponsor certain functionality.

Does the agsXMPP SDK run on Mono/Linux?
Yes it does.

Is the agsXMPP SDK API stable?
Yes, agsXMPP is used in many open source and commercial projects today. The version is still below 1.0 because there are still some features on our roadmap which we want to add before increasing the version to 1.0.

Can I use the agsXMPP SDK in a commercial application?
Contact us by Email if you are interested in a commercial license.

Can you release a LGPL or BSD licensed version?
No we can't

Can I build a XMPP server with agsXMPP?
Yes you can. But writing a XMPP server is a very compex task.The idea of XMPP is: simple client, complex server.Even if agsXMPP does lots of work for you, you have to study the XMPP RFC's in detail.

The examples don't support feature xyz and are crashing sometimes
the examples are not meant to be a usable client or server. Just to show off particular features of the API and get started with agsXMPP development.

I can't authenticate to my server, I'm sure that the password is correct
In the most cases this is a problem with your server configuration and the XMPP domain.Never use IP addresses in your Jid or XMPP domain for testing.The XMPP domain is part of the SASL authentication and must match.

Sunday, April 27, 2008

My machine's current configuration

These days, I am working on a virtualization project and trying out a few things while anticipating definite abnormal behaviors/outcomes; and, it's working since I have slept only 4 hours in last 42 hours and still alive enough to live without water, the vitamin water :p
Anyways, a few secs back I lost my mind while switching amongst a number of OS instances, thanks to VirtualBox. So, I drew this to clarify things to myself:











Looks good :D

Friday, April 25, 2008

Python Streamlines Space Shuttle Mission Design

This article was published on Builder.com, and I read it here: http://www.python.org/about/success/usa/

Introduction
Software engineers have long told their bosses and clients that they can have software "fast, cheap, or right," as long as they pick any two of those factors. Getting all three? Forget about it!
But United Space Alliance (USA), NASA's main shuttle support contractor, had a mandate to provide software that meets all three criteria. Their experience with Python told them NASA's demands were within reach. Less than a year later, USA is nearing deployment of a Workflow Automation System (WAS) that meets or exceeds all of NASA's specifications.

"Python allows us to tackle the complexity of programs like the WAS without getting bogged down in the language," says Robin Friedrich, USA's Senior Project Engineer. Friedrich conceived of the WAS project in response to a significant gap in the way shuttle mission planning was handling data management. "Historically," Friedrich says, "this data has been communicated using paper and, more recently, data file exchange. But both of these approaches are error-prone. Catching and fixing errors as well as responding to frequent change requests can bog such a system down." Complicating the issue was the challenge of finding money to improve the flight design process in an era of declining budgets for space activities.

"Just in time" provides a solution--and more problems
USA decided they needed a way to "minimize data changes and the resulting rework." The shortest route to that goal would be to shift the design work to the end of the process so that flight characteristics would have a good chance of already being finalized. In other words, as Friedrich says, "We decided we needed to do this data management work 'just in time'."
A just-in-time solution, however, generally puts more stress on both people and systems to get things right the first time because postponing these activities to the end of the process means a loss of scheduling elasticity.

"The obvious answer," according to Friedrich, "was to create a central database repository to help guarantee consistency and to provide historical tracking of data changes." An Oracle database was designed to store the information, but a graphical front end to manage the process of workflow automation was clearly an essential component of an effective solution. "We knew from experience--we do a good bit of Java coding in our group--that using C++ or Java would have added to the problem, not the solution," Friedrich maintains.

Python a mainstay since 1994

Enter Python. "We'd been using Python since 1994," says Friedrich, "when I literally stumbled across Python as I was searching the pre-Web Gopher FTP space for some help with a C++ project we were doing." Being an inveterate systems engineer, Friedrich "just had to investigate it." He was stunned by what he discovered.

"Twenty minutes after my first encounter with Python, I had downloaded it, compiled it, and installed it on my SPARCstation. It actually worked out of the box!"

As if that weren't enough, further investigation revealed that Python has a number of strengths, not the least of which is the fact that "things just work the first time. No other language exhibits that trait like Python," says Friedrich.

He attributes this characteristic to three primary language features:

  • Dynamic typing
  • Pseudocode-like syntax
  • The Python interpreter

The result? "We achieve immediate functioning code so much faster in Python than in any other language that it's staggering," says Friedrich. "Java and C++, for example, have much more baggage you have to understand just to get a functioning piece of software.

"Python also shines when it comes to code maintenance," according to Friedrich. "Without a lot of documentation, it is hard to grasp what is going on in Java and C++ programs and even with a lot of documentation, Perl is just hard to read and maintain." Before adopting Python, Friedrich's team was doing a good bit of Perl scripting and C++ coding. "Python's ease of maintenance is a huge deal for any company that has any significant amount of staff turnover at all," says Friedrich.

The team had already developed a moderately large number of C++ libraries. Because of Python's easy interface to the outside world, USA was able to retain these libraries. "We wrote a grammar-based tool that automatically interfaced all of our C++ libraries," says Friedrich.
Another aspect of Python that Friedrich found eminently significant is its shallow learning curve.

"We are always under the gun on software projects, like everyone else," he says. "But for any programmer, picking up Python is a one-week deal because things just behave as you expect them to, so there's less chasing your tail and far more productivity." He contrasts that with C++ and Java, which he says takes a good programmer weeks to grasp and months to become proficient.

Friedrich says that even the non-programming engineers at USA learned to do Python coding quickly. "We wanted to draft the coding energy of the engineering staff, but we didn't want them to have to learn C++. Python made the perfect 4GL programming layer for the existing C++ classes."

One coder and 17,000 lines of code later
The WAS project, which has required somewhat less than a man-year of effort, has been coded by a single Senior Software Engineer, Charlie Fly, who has cranked out some 17,000 source lines of code (SLOC). Python plays the central role, managing data interactions and the task network, as shown in Figure A.

Figure A: Python plays a central role in data interaction.

In the system, user tasks communicate with a Python data server, which in turn connects to an Oracle server via DCOracle. Using Oracle's built-in trigger mechanism to send a message to WAS as data records are updated, the WAS calculates which tasks are now data-ready and notifies the appropriate user.

At the core of the design is the Task object, which stores all information relevant to a single task in the workflow network. The end user can view the network in a PERT-style chart layout (Figure B), where color coding reveals at a glance which tasks are finished, which are in process, and which have not yet been started.

Figure B: PERT-style layout

Two other graphical interface windows allow the user to manage the dependencies among data items in the network (Figure C) and to view and edit individual task details (Figure D).

Figure C: Interface 1


Figure D: Interface 2

All of the code for the UIs was also done in Python, using the popular Tkinter library along with an open source package of supporting modules. Tkinter is included in all standard Python installations.

"USA is pleasantly surprised by how much quality software we can deliver," Friedrich says. "And each time we demonstrate success with Python, we add a few more believers to my growing list!"

About the Author

Dan Shafer is a freelance author and sometime Python coder who hangs out on California's central coast. He is a member of the PythonCard Open Source development team creating a GUI-building framework for Python applications. He makes his living as a writer and a product development consultant. A founder and former editorial director of Builder.com, Shafer has been part of the Web development community almost from its inception.

Sunday, April 20, 2008

Compiled versus interpreted languages

During the design of an application, you might need to decide whether to use a compiled language or an interpreted language for the application source code.

Both types of languages have their strengths and weaknesses. Usually, the decision to use an interpreted language is based on time restrictions on development or for ease of future changes to the program. A trade-off is made when using an interpreted language. You trade speed of development for higher execution costs. Because each line of an interpreted program must be translated each time it is executed, there is a higher overhead. Thus, an interpreted language is generally more suited to ad hoc requests than predefined requests.

Advantages of compiled languages
Assembler, COBOL, PL/I, C/C++ are all translated by running the source code through a compiler. This results in very efficient code that can be executed any number of times. The overhead for the translation is incurred just once, when the source is compiled; thereafter, it need only be loaded and executed.

Interpreted languages, in contrast, must be parsed, interpreted, and executed each time the program is run, thereby greatly adding to the cost of running the program. For this reason, interpreted programs are usually less efficient than compiled programs.
Some programming languages, such as REXX™ and Java™, can be either interpreted or compiled.

Advantages of interpreted languages
There are reasons for using languages that are compiled and reasons for using interpreted languages. There is no simple answer as to which language is "better"—it depends on the application. Even within an application we could end up using many different languages. For example, one of the strengths of a language like CLIST is that it is easy to code, test, and change.

However, it is not very efficient. The trade-off is machine resources for programmer time.
Keeping this in mind, we can see that it would make sense to use a compiled language for the intensive parts of an application (heavy resource usage), whereas interfaces (invoking the application) and less-intensive parts could be written in an interpreted language. An interpreted language might also be suited for ad hoc requests or even for prototyping an application.

One of the jobs of a designer is to weigh the strengths and weaknesses of each language and then decide which part of an application is best served by a particular language.

[source: http://publib.boulder.ibm.com/infocenter/zoslnctr/v1r7/index.jsp?topic=/com.ibm.zappldev.doc/zappldev_85.html]

Recovering OpenSolaris/Solairs/Linux after Windows Installation

I was running a dual boot configuration with two OSes: Windows XP and Solaris XDE 01/08. I upgraded my system memory but I couldn't visualize the performance difference. This, and a few other reasons made me to opt for a fresh Windows XP installation.

As usual, Windows wiped out the MBR and set it's own partition as active. Following this, I lost my GRUB bootloader and hence the option to boot into Solaris. I played and searched around a little bit and found a couple of good tweaks to recover a Solaris/OpenSolaris boot option, or a Linux boot option by actually recovering the GRUB bootloader.

Recovering GRUB for Linux is different then doing the same for Solaris. Generally Linux installation updates the MBR to load the GRUB, but a Windows installation cleans this MBR. To recover it follow this:
  • Get a live CD of your Linux Distribution,
  • Boot the Linux from this CD,
  • Open a Terminal,
  • Get into GRUB by typing this: sudo grub
  • Then you need to know abou the sequence number of your previous Linux partition (if you don't remember this, you can get an idea from Windows disk management utility).
  • Once you are sure about it, type this if it was the first partiton: root (hd0,0)
    or this if it was second partition on the second harddisk: root (hd0,1)
  • Finally type this: setup (hd0)

You're done!

For Solaris/OpenSolaris, Follow this procedure:
  • Get a OpenSolaris Installation Disk,
  • Boot from CD,
  • type 'c' at boot menu to get the GRUB command line,
  • Type this: rootnoverify (hdX,Y)
    replace X by hdd number, and Y by the sequence number of partition where Solaris is installed. e.g. rootnoverify (hd0,0) for first harddisk and first partition.
  • Now make the Solaris partition active. Type this: makeactive
  • Now chainload the bootsect, which implies that the GRUB bootloader, which is installed through your Solaris will be loaded when you'll startup your system.
  • To do this, type the following: chainloader +1
  • Finally type: boot

You're done!

Friday, April 18, 2008

Got ticketed!!

[1:15 AM 18th Aril, 2008, Cavalier Court, Fairfax, VA, USA - 0.2 miles from my home]

Waqas: Hello officer, I am sorry this guy (me) is sick, dying, (me: laffing, waqas: shutup) and in emergency I missed the left turn, so had to reverse on the main road.
Officer: Your documents Sir.
Waqas: (punjabi) saaala *** .. mar diya, shit, my points, my first ever.., damn *** ****
Officer: Sir, do u know y I pulled u over?
(Waqas thinking): thinking of giving him a topi after realizing that reversing the car might not be the reason for the devil to appear from nowhere; while playing confident that rest all was ok.
Waqas: No, I don't know, you tell me please.
(Salman whispering): abay stay true, he is playing with us.
Officer: Ohkk.
Officer: Do you know the max. speed of this highway?
Waqas: (innocent liar) No.
Officer: 30 mph, and u were on 47 mph, as of my speed gun. Secondly, this is the highway and you reversed your car on it while there was a car on your back (cop's car).
Waqas: Oh I am sorry, we were in emergency this guy.., these tablets.., his face.., we are students.., (Allah teray bachay..)
Officer: Please wait Sir, and went back with all docs.
Waqas: (punjabi) *** saaala **** .. mar diya, shit, my points, my first ever.., damn *** ****
(after 5-10 minutes)
Officer: there you go, you may prepay, or njoy the court.
Officer: thank you Sir.
Salman: good experience yar :D
Waqas: (punjabi) *** saaala **** .. mar diya, shit, my points, my first ever.., damn *** ****

[time 1:31 AM 18th Aril, 2008, Cavalier Court, Fairfax VA, USA - home.]