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, and I read it here:

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, 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.


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.]

Thursday, April 10, 2008

Happy Birthday from JustLinux Forums‏

Happy Birthday from JustLinux Forums‏
From: JustLinux Forums (
Sent: Fri 4/11/08 12:02 AM

Hello addicted, We at JustLinux Forums would like to wish you a happy birthday today!
even the bots care for me :p

Monday, April 07, 2008

Why Virtualization: A List of Reasons

Following are some (possibly overlapping) representative reasons for and benefits of virtualization:

Virtual machines can be used to consolidate the workloads of several under-utilized servers to fewer machines, perhaps a single machine (server consolidation). Related benefits (perceived or real, but often cited by vendors) are savings on hardware, environmental costs, management, and administration of the server infrastructure.

The need to run legacy applications is served well by virtual machines. A legacy application might simply not run on newer hardware and/or operating systems. Even if it does, if may under-utilize the server, so as above, it makes sense to consolidate several applications. This may be difficult without virtualization as such applications are usually not written to co-exist within a single execution environment (consider applications with hard-coded System V IPC keys, as a trivial example).

Virtual machines can be used to provide secure, isolated sandboxes for running untrusted applications. You could even create such an execution environment dynamically - on the fly - as you download something from the Internet and run it.

You can think of creative schemes, such as those involving address obfuscation.

Virtualization is an important concept in building secure computing platforms.

Virtual machines can be used to create operating systems, or execution environments with resource limits, and given the right schedulers, resource guarantees. Partitioning usually goes hand-in-hand with quality of service in the creation of QoS-enabled operating systems.

Virtual machines can provide the illusion of hardware, or hardware configuration that you do not have (such as SCSI devices, multiple processors, ...) Virtualization can also be used to simulate networks of independent computers.

Virtual machines can be used to run multiple operating systems simultaneously: different versions, or even entirely different systems, which can be on hot standby. Some such systems may be hard or impossible to run on newer real hardware.

Virtual machines allow for powerful debugging and performance monitoring. You can put such tools in the virtual machine monitor, for example. Operating systems can be debugged without losing productivity, or setting up more complicated debugging scenarios.

Virtual machines can isolate what they run, so they provide fault and error containment. You can inject faults proactively into software to study its subsequent behavior.

Virtual machines make software easier to migrate, thus aiding application and system mobility.

You can treat application suites as appliances by "packaging" and running each in a virtual machine.

Virtual machines are great tools for research and academic experiments. Since they provide isolation, they are safer to work with. They encapsulate the entire state of a running system: you can save the state, examine it, modify it, reload it, and so on. The state also provides an abstraction of the workload being run.

Virtualization can enable existing operating systems to run on shared memory multiprocessors.

Virtual machines can be used to create arbitrary test scenarios, and can lead to some very imaginative, effective quality assurance.

Virtualization can be used to retrofit new features in existing operating systems without "too much" work.

Virtualization can make tasks such as system migration, backup, and recovery easier and more manageable.

Virtualization can be an effective means of providing binary compatibility.

Virtualization on commodity hardware has been popular in co-located hosting. Many of the above benefits make such hosting secure, cost-effective, and appealing in general.

Virtualization is fun.

Plenty of other reasons ...


Microsoft's $40 Billion Question

Here are a few suggestions for what else Microsoft could get for $40 billion:

--Hire 40,000 engineers, at $100,000 apiece, for a decade

--Acquire Facebook (estimated to have a market value of $15 billion), along with just about any other meaningful social networking site, including MySpace, Bebo, Hi5 and LinkedIn. There would still be enough money left over to pay some consultants to help with integration.

--Spend eight times more than Google did last year to acquire traffic--and presumably make traffic more pricey for Google, to boot.

--Hire 80 million workers in China to do nothing but click on Microsoft properties and related ads for 10 years.

--Promise a free Big Mac to everyone who clicks on a Microsoft ad--and give away 14 trillion of 'em.


Wednesday, April 02, 2008

Growth of Programming Languages (TIOBE index)


50 who matter now

1 You! The consumer as creator
Sergey Brin and Larry Page Co-founders, Google
Paul Jacobs CEO, Qualcomm
Rupert Murdoch CEO, News Corp.
Steve Jobs CEO, Apple Computer
Susan Desmond-Hellmann President of product development, Genentech
The Emerging Global Middle Class China, India, Russia, Brazil, and elsewhere
Fujio Cho Chairman, Toyota
The New Oil Despots King Abdullah bin Abdul aziz al Saud (Saudi Arabia), Mahmoud Ahmadinejad (Iran), Hugo Chavez (Venezuela), and Vladimir Putin (Russia)
Ray Ozzie Chief technical officer, Microsoft
Marc Benioff CEO,
Robert Iger CEO, Walt Disney Co.
Stewart Butterfield and Caterina Fake Co-founders, Flickr
Brian McAndrews CEO, aQuantive
Jack Ma CEO,
Barry Diller CEO, InterActiveCorp
Ed Zander CEO, Motorola
John Thompson CEO, Symantec
Mark Hurd CEO, Hewlett-Packard
Ben Bernanke Chairman, Federal Reserve Board
Bill Gates Benefactor, Bill and Melinda Gates Foundation
Reid Hoffman Angel investor and CEO, LinkedIn
The New New Media Kevin Rose (Digg) and Jimmy Wales (Wikipedia)
Patricia Woertz CEO, Archer Daniels Midland
Kevin Martin Chairman, Federal Communications Commission
Ed Whitacre Chairman and CEO, AT&T
Jeremy Allaire CEO, Brightcove
Chad Hurley and Steven Chen Co-founders, YouTube
Danny Rimer General partner, Index Ventures
Muhammad Yunus Founder, Grameen Bank
Greg Isaacs Director of developer relations, eBay
Alex Bogusky Creative director, Crispin Porter & Bogusky
Vinod Khosla Founder, Khosla Ventures
David Heinemeier Hansson Partner, 37signals
Tim O'Reilly Founder and CEO, O'Reilly Media
Janus Friis and Niklas Zennström Co-founders, Skype
Patricia Russo CEO, Lucent Technologies
Oprah Winfrey Entertainment mogul
Electronic Frontier Foundation
Jeff Valdez Founder, SiTV
Stephen Maurer and Andrej Sali Adjunct associate professor, University of California at Berkeley, and professor, University of California at San Francisco
Jeff Bezos CEO,
The Pre-Internet Dinosaurs Larry Ellison (Oracle), Paul Otellini (Intel), and Michael Dell (Dell)
William McDonough Architect, William McDonough & Partners
Richard Branson Chairman, Virgin Group
Mike Morhaime Co-founder and president, Blizzard Entertainment
Nick Denton Publisher, Gawker Media
Naguib Sawiris CEO, Orascom Telecom
David Allen Author, Getting Things Done
Blake Krikorian Co-founder and CEO, Sling Media

[source :]