Monday, January 05, 2009

My car buying experience

First of all, I still couldn't buy one.. but anyways, I had 3 close encounters of actually wasting up my super duper budget of 3500$ on the following cars (after analyzing 25+ cars):

1 - 1997 civic ex coupe automatic
2 - 1999 civic ex sedan automatic
3 - 2000 civic ex coupe automatic

For 1, we settled for a done deal happily. Later, the carfax tells me that the car has a rollbacked odometer. Amazingly, we couldn't guess it from the extremely humble speech of the seller that he's perhaps being untruthful and that the rollback amounts to 45000 miles!

Exhausted, as well as excited.. I went for 2, perfect history, affordable, I am all ready.. and there you go.. sold-out! [yehh and didn't care to take off the advertisement from the list!]

The biggest blow, number 3. Not affordable, but for the price a great deal. So, I thought I'll drag my budget a little more. I did that. After a bunch of email ins and outs, we decided on a meeting time. I was desperate to just get it for whatever it had, for any extra cost. And once again, I receive an email: "Sorry, sold out!" Perhaps, what’s most disappointing about this one was that the seller listed it for ~4000$ and I wanted to get it for $3600 and he sold it for $3400 !!! Yeh, i know something's wrong.. :(

So, I've 20 days more days to stay patient.. then my carfax account will expire.. and I am not going to think about a car anymore..

Recommendation for craigslist: as soon as an item is sold-out, something should force the seller to close his advertisement.

Recommendation for buyers: as soon as you find out a good deal, don't wait for another good deal, don't push your luck :p

Recommendation for sellers: if you can't negotiate, don't face the buyers ;)

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.