Friday, June 25, 2010

Exploring MeeGo Part 1: Installing and starting MeeGo

MeeGo is an ambitious operating system that resulted after Intel and Nokia joined hands and attempted to unify Moblin and Maemo operating systems. Both these companies have significant market share in their respective domains and hence the future of MeeGo looks bright. MeeGo is Linux based, open source, and targets a broad set of devices.

Let’s start our journey of exploring MeeGo. In this multipart tutorial, we will gradually inhabit this new ecosystem and master the tricks and tips for programming day-to-day needs and ground breaking applications.

In this first part, we will setup a MeeGo box for our experimentation and learning purpose. Gone are the days when “Hello, World!” was the first thing you attempted on an alluring technology. Using a new platform requires careful planning for installation, steps for configuration, and scripts and utilities for starting and executing it. Equally important is that you should be able to do this without disturbing your production machines.

Step 1: Create a virtual machine

Before you seriously consider a new product, try it well on a virtual machine. This saves you time, effort and any problems that might be caused by installing anything new.

As of now, MeeGo is supported only on Linux. If you have a Linux box or Linux virtual machine already setup, please jump to “Step 3: Installing MeeGo”. If you are precautious like me, use the following steps to configure a virtual environment for installing MeeGo.

There are quite a few different classes of virtualization software in the market, for experimentation purpose I like “Virtual Box” from Sun (now from Oracle) – it is free and supports multiple operating systems. You can download it from http://www.virtualbox.org/

Follow these steps to quickly configure your new virtual machine:

1. Start the Virtual Box software
2. Select Machine > New Machine. This starts new virtual machine wizard.



3. Give your virtual machine a name and select the operating system and its version


4. Select the amount of RAM. For now you can keep it to 1024MB, if required you can increase it later.

5. Specify hard disk to be used for booting. For a new OS it is recommended that you create a new virtual hard disk. Selecting the option to create a new hard disk will start another wizard. I have created a 40GB virtual hard-disk on one for my portable disk. You get an option to create a “Dynamically expanding storage” or “Fixed-size storage”. For starters, and especially when you have not calculated the amount of space required, use the former.

This completes the creation of a virtual machine.

Before you move to the next step you must have Linux CD/DVD. If you have downloaded an ISO, you can add it to Virtual Box’s Media Manager. This allows you to mount the ISOs without burning the image on a CD/DVD. To do this, Select File > Virtual Media Manager



In the screen that opens next, select the “CD/DVD images” tab and click “Add”. Now, simply select the ISO file.



When you start you virtual machine by clicking on “Start”, a first time load mechanism in Virtual Box gives you an option to choose the installation disk. Select the ISO when prompted to do so.

Step 2: Installing Linux

Insert Ubuntu CD (or select the installation disk, if using Virtual Box) and boot the machine. Select your language preference and click “Install Ubuntu”. Now follow the wizard and enter the required information.


 
When asked where you want to install Ubuntu, make sure that you select the virtual hard drive created earlier (otherwise you will override another disk partition or virtual drive, risking your data)



Installation of Ubuntu will start, meanwhile locate the nearest coffee machine and get a cup of coffee. If you have it right on your desk, pretend to be away for some time. If nothing else, just watch the slides the installer takes you through (the slides are quite informative)



Once the installation is completed, Ubuntu will start.


Step 3: Installing MeeGo SDK

To install MeeGo SDK follow these steps:
1. Download the MeeGo SDK from
http://download3.meego.com/meego-sdk-0524.tar.bz2

2. Extract it by running the following command as root:
sudo tar jxvf meego-sdk-0524.tar.bz2

3. Download the MeeGo SDK chroot script from
http://download3.meego.com/meego-sdk-chroot

chroot is used to change the disk root directory. Commands executed within the new root directory will not be able to access anything outside the new root directory. All the processes (and their child processes) executed within the new root directory will take the new root directory as the root directory. This enables running a new system within an existing Linux box. You use chroot for creating your new environment, testing it and ensuring that you use only those files, libraries and applications that you have explicitly created or copied into the new root directory.

4. MeeGo SDK chroot script (meego-sdk-chroot) configures MeeGo chroot environment. Make the script executable, move it to /usr/bin so that you can execute it and access it without complete path
chmod +x meego-sdk-chroot
mv meego-sdk-chroot /usr/bin

Step 4: Starting MeeGo

To successfully start a MeeGo simulator, follow these steps:
1. For the X server to display MeeGo screen, run this command:
xhost +local:

2. Now run the MeeFo chroot script
sudo meego-sdk-chroot /locationOfExtractedMeeGo
You have now entered the MeeGo root environment

3. Set the DISPLAY environment variable to 0
export DISPLAY=:0

4. Start MeeGo simulator
startmeego &



It's now time to have fun with the new desktop, once you are done, type “exit” in the terminal window from where you started the MeeGo simulator.

In the next part, we will write a "Hello, World!" application.

Tuesday, March 16, 2010

The forgotten partner – Innovation

We have great ideas, sharp minds, will and energy to make it happen – the basic ingredients that lead to innovation. We continuously acquire knowledge by understanding the primitives and mastering the advanced concepts. We live and breathe technology with the dream of making a difference. Young, dynamic, adventurous, daring, flexible are some of the words that define us. What we need is financial security, social status, experience and networks. We are about to enter the IT industry.

Move 5 years forward into the present – 2010. Job is priority #1 and we follow our roles and duties judiciously and religiously. We are travelling to US, Europe and Australia. Living the dreams and enjoying life. We have been tagged successful. All secondary objectives are met. However, innovation has taken backstage. A small group of us is still finding this weird. Why I call it weird is because there certainly is an expectation mismatch. People who always banked on innovation find the mundane and clerical nature of the IT industry unacceptable. An innovator's mind needs freedom, and creativity comes from thoughts. The current state of the industry does not permit these. Some of us have adapted, while some are still analyzing. Adaption is not difficult, actually, it is the easy way out – it’s just changing oneself and behaving like others to live an easy life. In fact some of us have already accepted this.

Industry needs innovation and a small group is working on this. But what fun is it if you are not in the driver’s seat and are not leading the initiative? This means following and living the ideas of others, some of which could have been done in a totally different way. Does this require a dedicated effort, or can it be squeezed into the routine operations? The answer to this depends, but innovation needs focus. How important is it for an individual? If one has already tasted the pleasure of innovation, it becomes an integral flavor …

This is not a submission, this is a new beginning.

Sunday, August 30, 2009

SpeechLogger – output log messages in speech form

Last week in our team outing we saw the movie “Transformers: Revenge Of The Fallen”. I loved “Transformers” which was released in 2007, and automatically became a fan of this one too. For those of you who have missed the action, here is the link Transformers movie. Although not unique to this movie, the computer generated audio updates and notifications caught my attention. I was planning something similar for my ‘computer-agents’ (a dream I am working on in my free time), but the application of audio for debugging looked exciting. More importantly, it will make debugging fun.

Now with the Microsoft’s Speech synthesizer in its version 3.0, things are a lot simpler and faster to accomplish. Moreover, .NET is like a song, even if you don’t know the complete lyrics you can manage just by humming. You can find more information on Microsoft's speech technologies and R&D at Microsoft speech, or look for "SpeechSynthesizer” class in MSDN.

Audio deserves a special treatment, the following screencast will add the audio dimension:

Now let us have a look at the design of SpeechLogger: The base over which SpeechLogger sits is Microsoft Speech Synthesizer. Currently, the speech API is in version 3.0.

To develop custom functionality, I have written SpeechGenerator and SpeechQueue classes.

SpeechGenerator is the one that interacts with Microsoft’s Speech Synthesizer. It plays speech and the background sound (if there is any) in separate threads, and also away from your worker or UI threads. This ensures that using speech in your application won’t interfere with application’s core functionality.

Ok, SpeechGenerator is the core, so why do we need SpeechQueue? The reason for this is if you log many messages all might play at once. So to provide synchronous nature over asynchronous mode, we have SpeechQueue class. SpeechQueue maintains a queue of all the speeches to be played and enqueues items as and when SpeechGenerator notifies it.

You can use the SpeechLogger class to log speech messages. So, lets have a look at the code you will have to write to use SpeechLogger:

// set background sound for critical level
SpeechLogger.AttachBackgroundSound(LogLevel.CRITICAL, @"d:\warning.wav");

// log message
SpeechLogger.Log("Preparing to copy file.", LogLevel.INFORMATION);

Here is the code used for the demo-application:

(click the image if it is not clearly visible)

You will soon see a packaged version of SpeechLogger in both in-process and out-process form. The in-process version will be a simple dll that you can add as a reference to your project. Out-process will be a Windows service for speech logging. So till then, happy speech logging.

Sunday, August 02, 2009

A case of knowledge corruption and its remedies

Information these days is flowing from all directions. Traditional sources like books, magazines, newspapers and articles have provided information for centuries. New forms like websites, blogs, emails and sms have emerged and newer ones are breeding. The delivery mechanism in itself has seen a tremendous technological enhancement ranging from text to on-demand services. Whether it is communicated officially or casually, is structured or unstructured, documented or loose, information is found in abundance these days.
Abundance is good and welcomed by all. Unlike commodities, information does not perish with consumption. It combines with the existing knowledge and gives new dimensions to think and work with. Hence, authenticity and correctness of information is of paramount importance for its recipients. Incorrect data cumulated over a period of time leads to knowledge corruption. This is a disaster in a world where knowledge is considered power.
Consider, for example, you receive an email containing statistics about the bandwidth consumption and the behavior pattern of an average Internet user. You find it interesting, believe it, and forward it to your friends and colleague. What you have just done is the beginning of knowledge corruption cycle, unless you were vigilant enough and verified the text you received.

This is a very trivial case with a low impact. Imagine the state of an organization or a team that is working on building a product and follows similar practices for its knowledge management.
In this connected world, the rate at which information can spread is exponential. The process of publishing is also very easy and quick. No certification or authenticity check, not even a simple sanity check is done or is in place. Anyone can publish and circulate anything and there is no accountability. There are no filters that can save you.
How can one ensure that he is not contributing in knowledge corruption? Here are a few simple points to keep in mind:
  • Always quote the source: This helps in building confidence. That’s how scientific journals work. Referencing is an important parameter used in Google’s PageRank algorithm.
  • Control excitement: Excitement leads you to skim information and this leads to half baked knowledge. Emotions make thinking bias. Don’t get carried away and don’t start cooking your own stories.
  • Verify before communicating any dubious information: If you are unsure about the things you are communicating, verify them. Use any search engine and keep searching unless you are convinced.
  • Do not make assumptions: If you are unsure about something, then tell that you don't know. Don't speak just for the sake of speaking.
  • Establish pattern once you have understood the information correctly, whenever feasible try to stay away from patterns during learning phase.
Role of technology and policies
Technology acts as an instrument for enforcing policies. Policies provide rules and filters for publishing information. Technology can also be used to check the authenticity. Here is how we can use a combination of technology and policies to ensure correctness:
  • Information publishing policy: Enforce policies that permit publishing only after authenticity is established. This might be difficult and time consuming for the world information, but is suited for use within organizations. How can this be done when we are not yet very close to machine learning and understanding? Till then, people will have to substitute for machines. This will enable a selected group of people to first validate that the information they are providing (existing information) is correct. Everything above it will be based on and will refer this verified information. How will we add a totally new knowledge base? And how do we add contradicting information (for example, people have different theories and beliefs which are completely opposite to each other)? What about thoughts and vague ideas? These can be categorized as personal opinions and best left to the readers’ perception. If followers increase beyond a certain number, a new religion is formed. This article should hence be categorized as personal beliefs.
  • Rating and collective intelligence: Fix ownership and build a rating system. People will have complete ownership of what they are publishing, circulating, or promoting. Trust-levels can be established by cashing on social networks. People can associate trust-levels to different entities. Say, for example, a person can set that he trusts an entity A (person, source, or information) 100% and trusts another entity B just 75%. The chain continues and the trust-levels are calculated for each entity by using the cumulative ratings. Two types of trust-levels can be established for each entity:
    • Global: This is the trust-level computed using the ratings provided by all the people who have rated the entity.
    • My circle: Trust-level computed using the ratings provided by only the people who are part of the reader’s circle.
    This is similar to other applications of collective intelligence that are already in use for features like “Find similar items” or “You might also like these”.

Sunday, May 03, 2009

Down the memory lane (Family of students)

This was my BIT final semester project. I am happy to say that it used a REST like mechanism for transferring data between cooperating universities (well, this was back in the year 2001). I invented MAD-XML (Mayank’s Academic Data Exchange Markup Language) for transfering information between different parties. I was heavily inspired by W3C Web Service standards and was closely following Web service draft reports being published by W3C. This project also exposed an API (similar to the ones now exposed by Facebook, Cozi, etc) to allow universities to query each other’s servers. Here’s the text from the project report:

"The project aims at developing a unified academic data exchange framework. The idea is to allow students to access the vast pool of academic talent from a single point. It will also enable a registered student to access his academic records, notes, assignments, calendar, etc. irrespective of which university/institute he is enrolled with. The project allows a university to register with it. Once a university is registered, it gets access to a tremendous amount of data shared by all other universities. In response, the university promises to share its data pool. This allows a student sitting in any corner of the world to access resources and knowledge shared by, possibly, all the universities of the world. This framework will also make use of the existing infrastructure so that a minimal amount of rework is required from the university. Once the system is up and running, there are variant possibilities. A registered student will be able to manage his records, as well as share experiences and knowledge, and get guidance from others. The system is also extensible as it can be easily extended to provide new services.

I hope this academic revolution will strengthen concrescence amongst students as we move forward in developing this little planet (our beloved Earth), and making it a better place to live in."

Here is a screenshot of the opening page:



Introduction

With the rapid development of science and technology, the advancement in communication, and elimination of distance, it is now possible to instantly share our knowledge, talent and resources with anyone connected to this vast and ever expanding network. This network of computers should now be transformed into the network of people. A network that will bring a feeling of togetherness, a network that will allow people to communicate for social development, a network that lets people share their expertise. And what better place could it be to sow the seed directly into the people who will collaborate in the future for an ignited and a prosperous world.

"The Family of Students" is an endeavor in this direction. This effort when successful will lead to an ambience of cooperation and goodwill. Everyone will be benefited with the knowledge, talent, and resource pool provided in this harmonizing environment. This will lead to the cultivation of team sprit among the people. A culture, which should be the way of life. "The Family of Students", as the name suggests, tries to instill this culture into the students.

The project aims at serving all academic needs of a student. A student can register himself with the site only if he is enrolled with a university that is a member of the site. Once a student is registered with us, he has the following worlds open to him:

  1. ODD Service: The Online Dictionary Database Service. This service allows the user to upload words and meanings to the server, or share from the existing pool. In the process student improves his vocabulary. Currently the system will provide support of English language only. The ODD Service is intelligent and hence aware of human's learning process. So it follows the iterative process of leaning and revising.
  2. University Notes Service: This comprises of all the notes released by a university. All the students have access to the notes provided by a university.

  3. myNotes: This allows the user to upload his notes to the server. The notes are embedded within the "MAD-XML's Notes language" and hence are available for exchange with other servers and services. A student may share his notes, or decide not to share. However, students are encouraged to share their notes.

  4. Academic Calendar Service: This service is meant to be provided by the universities to its student. It contains complete information about the events, holidays, exams dates, etc.

  5. myCalendar: It is a student calendar information holder, which among other things will also reflect and complement Academic Calendar Service.

  6. Assignment Service: This contains the assignment given by a university for various courses it offers. A student has access to all the assignments provided by a university.

  7. myAssignments: A student can store his assignments using this service. Various features will enable him to submit his assignments to the university, and possibly, in future, a software will check and award marks.

  8. Academic Directory Service: This gives information about all the universities registered with the site. Also provide a search engine to search universities by their rank and location.

  9. Marks Announcement Service: This service provides the marks announced by the university for any of its courses.

  10. Admission Announcement Service: This gives a vast amount of information to the students about any admission notification released by the university. It also provides a search engine wherein a student can get a list of universities offering his desired course.

  11. myBookmarks: This facility allows the user to bookmark important information like URL address, books, places, universities, etc.

  12. myReminders: This service works in coordination with the myCalendar and Calendar Service to remind students of any upcoming event.

Framework

"The Family of Students" provides a framework that consists of a request-response cycle in the form of question and answer session. The "The Family of Students" server acts as a middleman between the student and the vast number of universities. A student submits his query to this server that it processes and a request is sent to various universities for information. Universities are required to comply with the interface, so that the two servers can understand each other and communicate in harmony.


All the files and services provided are prefixed with either a 'g' or 'l' to indicate their respective locations. 'g' stands for 'global' and specifies that the page is located at "The Family of Students" server. 'l' stands for 'local' and specifies that the page is located at a local server, i.e. a university server.

For example Authenticator.html is an HMTL page provided to the users to enter their credentials, which are submitted to the gAuthenticator.pl. gAuthenticator.pl in turn request the university server for a page names lAutheticator.pl to perform authentication.

MAD-XML: In order to accomplish all the services and features listed above, the project makes extensive use of the MAD-XML (Mayank's Academic Data Exchange Markup Language). This is a question and answer type language.

This is then transferred to the university server in a secure mode. The university server is expected to read the data, and provide an answer to our server.

Similarly various document type definitions (doctypes) have been developed for each service after extensive thought and with a view to allow further expansion. Doctypes are either prefixed with either a 'q' or an 'a' to mean a 'question' or an 'answer' respectively.

Design

The project makes extensive use of the object-oriented paradigm. This enables organized structure of the program along with high possibilities of code reuse. Following modules are provides:

  1. Authenticator: to perform authentication
  2. Validator: to validate the user-data for its integrity, and to block any attempt for hacking.
  3. Odd: top level module to provide ODD Service
  4. UniversityNotesService: top level module to provide university notes service
  5. myNotes: top level module to allow management of student's personal notes
  6. AcademicCalenderService: top level module to provide Academic Calender Service
  7. myCalender: top level module to allow management of student's personal calender
  8. AssignementService: top level module to provide Assignement Service
  9. myAssignment: top level module to allow management of student's assignment
  10. AcademicDirectoryService: top level module to provide Academic Directory Service
  11. MarksAnnouncementService: top level module to provide Marks Announcement Service
  12. AdmissionAnnouncementService: top level module to provide Admission Announcement Service
  13. myBookMarks: top level module to allow management of student's bookmarks
  14. myReminders: top level module to allow management of student's reminders

In addition to these modules, the tfs also provides two more modules. These are:

  1. MjSession: This module is responsible for the managing client's state and is used extensively throughout the project.
  2. MjCommunicator: This module is the back-bone of "tfs". This module is used to establish connection with the remote university server, fetch data, parse data, and then feed it to the local programs.

Down the memory lane (AutoArranger)

This was my first ActiveX control that I sold in 2001. The product saw an immediate death when Microsoft launched Visual Studio 2002/2003 which provided similar functionality built right into the IDE. Now I can proudly say that I was competing with Microsoft back in 2001-2002 ;)

AutoArranger aims at delivering accurate object alignment and placement. BTW, I also designed the product logo. Here is the description of the product with About screen:

AutoArranger is a programmer's utility ActiveX Control. It is a powerful tool that can control height, width and font size of an object and aims at delivering accurate object alignment to suite different screen resolutions and size. AutoArranger is a programmer friendly tool that allows the programmer to set properties by the click of the mouse using the intelligent property pages. When placed on a form, it automatically aligns controls to adjust under different screen resolutions and sizes. The object has been designed in Visual Basic 6.0 and can run on Windows environment (including Windows 95/98/NT/2000) or other platforms that support OLE automation.

Monday, November 24, 2008

Why not to use search engines

During my college days I was not aware of search engine clientele. Consequently, the area/domain where Google search was being used was an unfamiliar territory. For me, it was a new search engine that was continuously crawling net and used the PageRank algorithm to bring better search results as compared to other technologies. I believed it was being used by casual surfers. I was still betting more on Semantic web (studying OWL was something new that I did at that time), but I do believe that the ultimate search engine will be based on algorithms that use Artificial Intelligence to understand text available on the Internet and provide accurate, meaningful, and context-sensitive results.

Few years back, I was shocked to find how widely search engines were being exploited by the developer community. I saw many people depending on search engines for code snippets. Personally, I started hating search engines for corrupting developers’ mindset and mounting reliance. Hate is no solution, so I embarked on a new project. The aim was straight “Get rid of developers”. Initially, the task looked simple -- write a program that fetches the correct code snippet from the net, filter the results based on the task at hand, and customize it depending on user’s input.

The results were not convincing, following were the primary causes:

  1. Authenticity was not guaranteed
  2. Incomplete results
  3. Addressed either the simplest (the most common) or a single scenario
  4. Incorrect
  5. Not ready for direct consumption

Solution to this exists: trust services, semantic web, investment in organizing and building appropriate code snippets, ETL. But the scope is limited. Some IT firms maintain a database that can be queried for commonly used code, but the process is not fully automated. It is an aid, not a replacement.

Although, priorities changed and I completely forgot about this project, looks like I need to restart the engine :)
Intent was much bigger – give software creation directly in the hands of its user. The idea was to develop an application that given the requirements will break these down into atomic tasks, maintain a set of domain specific components, integrate components by guiding the flow of data and control from one component to other (glue), map task to functionality, and relies on net (shared repository) for missing code.
In short build an ecosystem that helps user build what he wants.

I believe in a continuous knowledge acquisition process. A business expands by investing in the development of new product lines, expanding the service areas and acquiring other companies. A developer grows by reading more and more (on a regular basis) and venturing into new domains. This is a slow process, but results in fewer hurdles, timely completion of tasks, confidence of going in the right direction and doing it right.

Search engine provides a quick solution, is addictive, but hollows the intellect. Areas worst hit are product quality and developer's confidence.

When to use search engines:

  • for awareness on what’s already there, so that you don't reinvent the wheel
  • to look what others are doing, so that you don't do a parallel development (did someone mention competition ;))
  • to find online projects, so that you can contribute your expertise
  • for new and upcoming technologies -- this is the right time to search for parallelism and cloud computing
  • find recipe of paw bhaji :)
  • to check whether your internet connection is working :)

Don’t hit the search engines to find answers within a domain where you are supposed to be an expert, use it to find knowledge banks that provide comprehensive theory coverage. Use it to find authentic source of information. There are plenty of these on the net. Here are some of the sites that I visit:

Look for magazines and journals that are published (some are given out for free)

  • MSDN
  • Dr. Dobb
  • Architecture Journal
  • CIO
  • PCQuest

Subscribe to feeds and newsletters published by infosites. At times, you will be bogged down by the number of emails in your inbox, so choose judiciously.

And most importantly, never forget your textbooks.

So surf well, surf wise.