Wednesday, June 26, 2013

Download and Install AndroidSDK in Ubuntu 12.04 (Precise Pangolin)

Android SDK is a development environment for the Android mobile operating system which allows you to write applications for Android devices or gain elevated privileges on android devices with the help of third party software.
This brief tutorial is going to show you how to download and install it in Ubuntu 12.04 if you haven’t already done so. To install it, you first need to install Java JDK package or use the openJDK Java alternative that comes with Ubuntu.
In this tutorial, I’m going to be using the openJDK version of Java. To install Oracle Java version, then read this post first.
Objectives:
  • Install AndroidSDK in Ubuntu 12.04 (Precise Pangolin)
  • Enjoy!

To get started, press Ctrl – Alt – T on your keyboard to open the terminal. When it opens, run the commands below to install OpenJDK.
sudo apt-get install openjdk-6-jre openjdk-6-jdk icedtea6-plugin

Next, download AndroidSDK package by running the commands below. At the time of this writing, the current version was r20. Or click this link to download the .tgz archive file.
wget http://dl.google.com/android/android-sdk_r20-linux.tgz

After downloading, run the commands below to extract the downloaded file.
tar -xvzf android-sdk_r20-linux.tgz

After extracting the package, run the command below to change into the tools directory.
cd ~/android-sdk-linux/tools

Finally, run the commands below to begin the installation.
./android
 Install Android updates if there are any available.

android_precise_5

After updating, run the commands below to include AndroidSDK in your path environment.
gedit ~/.bashrc

Then add these lines at the very top of the file and save it.
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

android_precise_6


Log out and log back in, then type android on the command line to launch the software.
android avd

Build your own phone.

android_precise_7

Tuesday, June 25, 2013

SHORTCUT FOR OPENING THE SYSTEM MONITOR IN UBUNTU

It’s pretty easy to get the familiar key combo Ctrl+Alt+Del to open the System Monitor in Ubuntu, like what you’d be used to in a version or two of Windows. And it’s well worth doing, as it can come in really handy at times, especially if a crashing app is freezing the system, and the only way to stop it is to kill the process in the System Monitor.
But some people have had trouble getting this key combo to work, and others found it no longer worked after an upgrade. There is plenty mention online of it not working with Compiz-Fusion enabled, as it can usurp those key bindings, but I haven’t found this to be the case (even though I’ve been assured that Compiz-Fusion developers assert it shouldn’t work, and it’s strange that it does for me!).
Besides those poor souls who can’t get this combo to stick while desktop effects are on, invariably it seems a setting had been altered during an upgrade, preventing this combo from working as desired. So here’s what to do if you find yourself in this situation:
Go to System > Preferences > Keyboard Shortcuts, and under Action search for “Log out“. Under Shortcut you will see that Ctrl+Alt+Del is assigned to this action (though it probably doesn’t work); click on that shortcut and press Backspace if you want to disable it, or choose another combination (though I recommend disabling it).
Close it and open the Configuration Editor (found in Applications > System Tools). In the left pane navigate to apps > metacity > global_keybindings, and in the right-hand pane search for a “run_command_X” value under Name (where X is between 1 and 12 and it is not used – I just used run_command_1). Double-click its Value and add <Control><Alt>Delete.
Now select keybinding_commands in the left pane, and locate “command_X” (where X is the same number selected in run_command_X option, eg: command_1), and for its Valueenter gnome-system-monitorNote that, at least on my system, this value can be blank without affecting the keybinding, so if you choose you can leave it out and apply it if needed, though it shouldn’t hurt to do so while you’re in the Configuration Editor.
If you don’t have Configuration Editor, open a terminal and paste these two commands:
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 '<Ctrl><Alt>Delete'
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 'gnome-system-monitor'
Ctrl+Alt+Delete should now open the System Monitor, and you will see your custom keybinding if you go back into Keyboard Shortcuts. If the key combo still doesn’t work, you’ll probably find there is no custom keybinding defined in Keyboard Shortcuts, but you can easily create a Custom Shortcut by clicking the Add button; to define the key combo, click in the Shortcut field (it should say Disabled) and press the actual key combination to record it.

Monday, June 24, 2013

DEADLOCK

We say that a set of processes or threads is deadlocked when each thread is waiting for an event that only another process in the set can cause. Another way to illustrate a deadlock is to build a directed graph whose vertices are threads or processes and whose edges represent the "is-waiting-for" relation. If this graph contains a cycle, the system is deadlocked. Unless the system is designed to recover from deadlocks, a deadlock causes the program or system to hang.

Synchronization deadlocks in Java programs

Deadlocks can occur in Java because the synchronized keyword causes the executing thread to block while waiting for the lock, or monitor, associated with the specified object. Since the thread might already hold locks associated with other objects, two threads could each be waiting for the other to release a lock; in such a case, they will end up waiting forever. The following example shows a set of methods that have the potential for deadlock. Both methods acquire locks on two lock objects, cacheLock and tableLock, before they proceed. In this example, the objects acting as locks are global (static) variables, a common technique for simplifying application-locking behavior by performing locking at a coarser level of granularity:

An example for a deadlock

 public static Object cacheLock = new Object();
  public static Object tableLock = new Object();
  ...
  public void oneMethod() {
    synchronized (cacheLock) {
      synchronized (tableLock) { 
        doSomething();
      }
    }
  }
  public void anotherMethod() {
    synchronized (tableLock) {
      synchronized (cacheLock) { 
        doSomethingElse();
      }
    }
  }

Now, imagine that thread A calls oneMethod() while thread B simultaneously calls anotherMethod(). Imagine further that thread A acquires the lock on cacheLock, and, at the same time, thread B acquires the lock on tableLock. Now the threads are deadlocked: neither thread will give up its lock until it acquires the other lock, but neither will be able to acquire the other lock until the other thread gives it up. When a Java program deadlocks, the deadlocking threads simply wait forever. While other threads might continue running, you will eventually have to kill the program, restart it, and hope that it doesn't deadlock again.

Tuesday, March 19, 2013

Hierarchical Task Analysis

What Is Hierarchical Task Analysis?


A structured, objective approach to describing users’ performance of tasks, hierarchical task analysis originated in human factors. In its most basic form, a hierarchical task analysis provides an understanding of the tasks users need to perform to achieve certain goals. You can break down these tasks into multiple levels of subtasks. In user experience, you can use hierarchical task analysis to describe the interactions between a user and a software system. When designing a new system, hierarchical task analysis lets you explore various possible approaches to completing the same task. When analyzing an existing system, it can help you to optimize particular interactions.
Once you’ve created a hierarchical task analysis, it can serve as an effective form of system documentation, enabling developers to rapidly understand how users interact with a system. As software engineers are all too aware, the intimate familiarity you may have gained with why users do something in a certain way can quickly fade in just a few days or weeks. A hierarchical task analysis is an effective means of capturing this information.

Applying Hierarchical Task Analysis to User Experience


Hierarchical task analysis requires a detailed understanding of users’ tasks. You can achieve this understanding by
  • identifying users’ primary goals
  • detailing the steps users must perform to accomplish their goals
  • optimizing these procedures
Let’s look at an example of a hierarchical task analysis. Our example is from a hierarchical task analysis I performed to better understand an existing system. We’ll consider a common task: ordering a book. Figure 1 shows a high-level hierarchical task analysis for this task.
Figure 1—Hierarchical task analysis for ordering a book
In this hierarchical task analysis, I’ve broken this task down into subtasks, expressing the relationships between the parent task and its subtasks through a numbering scheme. This hierarchical task analysis is very coarse from a user experience standpoint. It does not communicate anything about what is happening at the level of a user’s interaction with the system. However, it does give a clear understanding of the task’s high-level steps. A more complete task analysis would ultimately get down to the level of user interactions. To illustrate, Subtask 1.4, “Complete address,” would break down as follows:
  1. Locate the Full Name field.
  2. Move the insertion point to the field.
  3. Type the full name.
  4. Locate the Address Line 1 field.
  5. Move the insertion point to the field.
  6. Type the address.
  7. Optional: Locate the Address Line 2 field.
  8. Move the insertion point to the field.
  9. Type the address.
  10. Locate the Town/City field.
  11. Move the insertion point to the field.
  12. Type the town or city.
  13. Locate the County field.
  14. Move the insertion point to the field.
  15. Type the county.
  16. Locate the Postcode field.
  17. Move the insertion point to the field.
  18. Type the postal code.
  19. Locate the Country field.
  20. Move the insertion point to the field.
  21. Select the country from the drop-down list.
  22. Locate the Phone Number field.
  23. Move the insertion point to the field.
  24. Type the phone number.
Optionally, you can provide an illustration of the screen on which a user performs this task, helping to put this interaction in context. Figure 2 shows the screen for the “Complete address” task.
Figure 2—“Complete address” task
Complete address on AmazonCombining different approaches to describing user interactions provides an understanding of tasks that is both broad and deep. The diagram shows how the high?level steps of a task relate to one another. The structured breakdown of the task into its subtasks describes each interaction in detail. The screenshot puts the interaction in context.
It is advisable to create a plan that describes the way in which a hierarchical task analysis assembles the subtasks that let users achieve a particular goal and any conditions the subtasks must fulfill. In many cases, users can simply work through the subtasks in a hierarchical task analysis, so keeping the plan separate from the tasks provides an additional degree of flexibility. For the example hierarchical task analysis, there could be two different plans, as follows:
  1. If a user is new to the system, complete Task 1.
  2. If a user has registered and is signed in, complete Tasks 1.1, 1.2, and 1.5.

The Benefits of Hierarchical Task Analysis

Understanding user interactions at multiple levels of abstraction provides several benefits.
  • It lets you objectively compare different approaches to the supporting same task—in terms of the numbers and types of steps the approaches require. For instance, reducing the number of steps in a task would probably enable a user to complete the task more rapidly, so replacing multiple fields with a single field would speed up the task. However, this would also make the address less easy to verify. The hierarchical task analysis provides a framework in which you can capture such a design rationale and refer to any related documentation.
  • There may be several competing approaches to the same problem, so ensuring your team uses common language and a consistent approach to hierarchical task analysis can help you to compare them fairly.
  • It enables effective UX design, because designers can understand how a system works, at whatever level of abstraction is most appropriate for what they are currently trying to accomplish.
  • It supports UX design reuse. UX design patterns are a useful step toward UX design reuse, but they describe only the high?level principles of interactions. Hierarchical task analysis lets you capture multiple implementations of a design pattern—expressing interactions in a common structured format—and identify new design patterns.
You can use established user research techniques to collect the information for a hierarchical task analysis. Observational methods can inform a hierarchical task analysis for an existing system, while interviews and similar qualitative approaches can help you to understand how users think about tasks when you are designing new systems, ensuring that the proposed approach follows users’ existing mental schemas.
While creating a detailed hierarchical task analysis is time consuming, making each step explicit makes it less likely that you’ll ignore any of the knowledge a user requires. Plus, it may let you identify further opportunities for improving the user experience. For example, knowing that a user is likely to have restricted movement can influence the design and implementation of a form. Because a hierarchical task analysis makes the required steps explicit, it is less likely that a designer would overlook such issues.
Any hierarchical task analysis must have a clear stopping point that you’ve defined in advance: the point at which the analysis stops. For most UX applications, this can be the most atomic level of user interaction—for instance, a mouse movement. A hierarchical task analysis is not restricted to describing a single process. You can associate multiple plans with a single hierarchical task analysis to illustrate how users can accomplish multiple tasks, using reference numbers to illustrate the different flows through the hierarchical task analysis. You can also associate different plans with different personas whose needs you intend a system to supportor with different options, depending on the type of system.
A hierarchical task analysis can provide the basis for creating user journeys. While user journeys may include a lot of information about particular users—their perceptions, backgrounds, and levels of understanding—a hierarchical task analysis objectively describes users’ interactions with a system. User journeys are a more specialized application of the information a hierarchical task analysis describes, putting user interactions in the context of specific users. Once you have created a hierarchical task analysis, the development of other design tools such as user journeys becomes much simpler.


Friday, February 15, 2013

World Hunger: The Problem Left Behind Since Past


The drought-induced run-up in corn prices is a reminder that we’re nowhere near solving the problem of feeding the world. The price surge, the third major international food price spike in the last five years, casts more doubt on the assumption that widespread economic development leads to corresponding gains in agriculture.

For all its importance to human well-being, agriculture seems to be one of the lagging economic sectors of the last two decades. That means the problem of hunger is flaring up again, as the World Bank and several United Nations agencies have recently warned.
Consider Africa, which is often considered to have turned a corner and to be headed toward steady growth. The expansion of the African middle class and the decline in child mortality rates are both quite real, but the advances have not been balanced — and agriculture lags behind.
In a recent address, Michael Lipton, an economist in Britain, offered a sobering look at Africa’s agricultural productivity. He suggests that Rwanda and Ghana are gaining, but that most of the continent is not. 

One huge problem is that the price of fertilizer in Africa is often two to four times the world price. Yet African soil and rainfall make much of the continent for growing food. In other words, the region that probably needs fertilizer the most also has to pay the most for it, and much of Africa doesn’t have the prosperity to make this an easy stretch. The high prices result in large part from infrastructure and trade networks that aren’t developed enough to create a low-cost and competitive market.
 
In contrast, much of Africa’s growth has come from resource wealth — such as oil, diamonds, gold and strategic minerals — and, unfortunately, resource prices are notoriously volatile. Resource wealth is less well-suited to supporting sustainable democracies, because it tends to be connected with state-backed privileges and other legally entrenched entities. The Norwegian government manages its oil wealth just fine, for example, but autocracies and fledgling democracies are more likely to be corrupted. 

WHAT to do? First, put food problems higher on the agenda. In the United States, there is no general consciousness of the precarious state of global agriculture. Even in the economics profession, the field of agricultural economics is often viewed as secondary in status.Second, the United States government should stop subsidizing its own corn-based biofuels, mainly ethanol. Today, about 40 percent of America’s field corn goes into bio fuels, thanks to a subsidy and regulatory policy dating from 2005.

The world is not yet in that happy situation where “what’s for dinner?” is a boring question.

Wednesday, January 2, 2013

Tony Greig - Sri Lanka’s biggest overseas fan


At a time when SriLankan Cricket was no body in the mid-90s, Tony Greig was a dear friend. During that tour of Australia in 1995 and the World Cup that followed, Greig came up with several gems supporting Sri Lanka. Here are some of those.

"They have come such a long way in such a short period of time and here they are taking away the ultimate cricket trophy."

It was only fitting that Greig was doing commentaries with Sri Lanka on the brink of winning the World Cup. As Arjuna Ranatunga scored the winning runs, Greig said, ‘This is a little fairytale. The thing that I like about these guys is that they not only win, but they win in style. It's just a small country with millions of cricket hearts and what a moment this would be for the SriLankan people.’

Greig first caught the imagination of Sri Lankan fans during the tour of Australia in 1995. In a very pro Australian commentary team, Greig’s role was crucial as whatever he said helped form public opinion and won Sri Lanka admirers among Australian public. One such Greig comment during the chucking controversy was, ‘I have got to say that I have sympathy with the Sri Lankans here. They had enough,’ he said as Arjuna Rantunga took the team off in the match against the Aussies'.

There are some commentators who you love to listen to. Benaud, Chappell, David Lloyd,Danny Morrison and Greig fed us with so much of information, both technical stuff and some terrific moments in the past. But what made Greig such a popular and a memorable personality was his love for Sri Lanka. Greig not only kept our cricketers in a high pedestal but told everyone that our pineapple was the tastiest in the world and that our crab is the best in the world.

Greig is known for his banter as a player and a commentator. Once in the late 1970s during a game at the P. Sara Oval when Greig called Sri Lankan cheerleader Percy Abeysekara ‘a black b——-‘, Percy sledged him. ‘Hey Greigy, you’ve got your height, I have got my might. I will send you up like a kite if the air is right and I will have you for bite especially if I am tight’. Since that day Percy and Greig have been great pals. This part was taken from another article as it touched ma heart.

Greig hosted Sri Lankan cricketers for dinner when they were playing in Sydney, his adopted home. And when he comes to Sri Lanka he usually goes out with current and ex-cricketers, and Galle seemed to be his preferred destination.

His last commentary stint happened to be in Sri Lanka during the World T-20 finals which was held last October. He was struggling with bronchitis and when he underwent tests it was revealed that he had damaged his right lung. Upon returning to Australia he was diagnosed with cancer.

The Sri Lankan fans were shaken by the news and conducted Bodhi Poojas hoping for his speedy recovery. Star cricketers Kumar Sangakkara, Mahela Jayawardene and several others attended the religious ceremony which were held here.It was a heart attack that claimed him at about 1:45 pm, the day after the Sri Lankans had suffered a massive innings and 201-run defeat inside three days at MCG. 

Born in South Africa, Greig came to England and went on to play 58 Tests, some of them as captain. Since abandoning England captaincy and joining Kerry Packer’s World Series Cricket, he remained loyal to Packer’s Nine Network.He was hoping to return to work for the Sydney Test involving Sri Lanka that gets underway on the 3rd of January.

Greig was the ultimate Sri Lankan fan and he loved Sri Lankan cricket more than some of our own cricketers do. We just miss you sir :(