Monday, December 24, 2012

How Good is Your Time Management?


Discover time management tools that can help you


© iStockphoto
How often do you find yourself running out of time? Weekly, daily, hourly? For many, it seems that there's just never enough time in the day to get everything done.
When you know how to manage your time you gain control. Rather than busily working here, there, and everywhere (and not getting much done anywhere), effective time management helps you to choose what to work on and when. This is essential if you're to achieve anything of any real worth.
We've put together an interactive Time Management Quiz to help you identify the aspects of time management that you need most help with. The results will point you to the specific tools you need to use to gain control of your time, and start working efficiently.

How Good is Your Time Management?

Instructions:
For each statement, click the button in the column that best describes you. Please answer questions as you actually are (rather than how you think you should be), and don't worry if some questions seem to score in the 'wrong direction'. When you are finished, please click the 'Calculate My Total' button at the bottom of the test.
QuestionNot
at all
RarelySome
times
OftenVery
Often
1
Are the tasks you work on during the day the ones with the highest priority?
2
Do you find yourself completing tasks at the last minute, or asking for extensions?
3
Do you set aside time for planning and scheduling?
4
Do you know how much time you are spending on the various jobs you do?
5
How often do you find yourself dealing with interruptions?
6
Do you use goal setting to decide what tasks and activities you should work on?
7
Do you leave contingency time in your schedule to deal with "the unexpected"?
8
Do you know whether the tasks you are working on are high, medium, or low value?
9
When you are given a new assignment, do you analyze it for importance and prioritize it accordingly?
10
Are you stressed about deadlines and commitments?
11
Do distractions often keep you from working on critical tasks?
12
Do you find you have to take work home, in order to get it done?
13
Do you prioritize your "To Do" list or Action Program?
14
Do you regularly confirm your priorities with your boss?
15
Before you take on a task, do you check that the results will be worth the time put in?
 Total = 
0

Score Interpretation

ScoreComment
46-75You're managing your time very effectively! Still, check the sectionsbelow to see if there's anything you can tweak to make this even better.
31-45You're good at some things, but there's room for improvement elsewhere. Focus on the serious issues below, and you'll most likely find that work becomes much less stressful.
15-30Ouch. The good news is that you've got a great opportunity to improve your effectiveness at work, and your long term success! However, to realize this, you've got to fundamentally improve your time management skills. Start below!
As you answered the questions, you probably had some insight into areas where your time management could use a pick-me-up. The following is a quick summary of the main areas of time management that were explored in the quiz, and a guide to the specific tools you can use for each.

Goal Setting

(Questions 6, 10, 14, 15)
To start managing time effectively, you need to set goals. When you know where you're going, you can then figure out what exactly needs to be done, in what order. Without proper goal setting, you'll fritter your time away on a confusion of conflicting priorities.
People tend to neglect goal setting because it requires time and effort. What they fail to consider is that a little time and effort put in now saves an enormous amount of time, effort and frustration in the future. Mind Tools has two great articles on goal setting that are must-reads for everyone. If you are serious about time management, we suggest you start with Personal Goal Setting and The Golden Rules of Goal Setting . We also recommend Treasure Mapping .

Prioritization

(Questions 1, 4, 8, 9, 13, 14, 15)
Prioritizing what needs to be done is especially important. Without it, you may work very hard, but you won't be achieving the results you desire because what you are working on is not of strategic importance.
Most people have a "to-do" list of some sort. The problem with many of these lists is they are just a collection of things that need to get done. There is no rhyme or reason to the list and, because of this, the work they do is just as unstructured. So how do you work on To Do List tasks – top down, bottom up, easiest to hardest?
To work efficiently you need to work on the most important, highest value tasks. This way you won't get caught scrambling to get something critical done as the deadline approaches. For information on how to start prioritizing your tasks, see our articles on Activity Logs , Prioritized To Do Lists , Prioritization , The Action Priority Matrix, and The Urgent/Important Matrix .

Managing Interruptions

(Questions 5, 9, 11, 12)
Having a plan and knowing how to prioritize it is one thing. The next issue is knowing what to do to minimize the interruptions you face during your day. It is widely recognized that managers get very little uninterrupted time to work on their priority tasks. There are phone calls, information requests, questions from employees, and a whole host of events that crop up unexpectedly. Some do need to be dealt with immediately, but others need to be managed. Two excellent tools that discuss how to minimize your interrupted time are The Urgent/Important Matrix and Managing Interruptions .
However, some jobs need you to be available for people when they need help – interruption is a natural and necessary part of life. Here, do what you sensibly can to minimize it, but make sure you don't scare people away from interrupting you when they should.

Procrastination

(Questions 2, 10, 12)
"I'll get to it later" has led to the downfall of many a good employee. After too many "laters" the work piles up so high that any task seems insurmountable. Procrastination is as tempting as it is deadly. The best way to beat it is to recognize that you do indeed procrastinate. Then you need to figure out why. Perhaps you are afraid of failing? (And some people are actually afraid of success!)
Once you know why you procrastinate then you can plan to get out of the habit. Reward yourself for getting jobs done, and remind yourself regularly of the horrible consequences of not doing those boring tasks! For more help on recognizing and overcoming procrastination see our guide to Beating Procrastination .

Scheduling

(Questions 3, 7, 12)
Much of time management comes down to effective scheduling of your time. When you know what your goals and priorities are, you then need to know how to go about creating a schedule that keeps you on track, and protects you from stress.
This means understanding the factors that affect the time you have available for work. You not only have to schedule priority tasks, you have to leave room for interruptions, and contingency time for those unexpected events that otherwise wreak chaos with your schedule. By creating a robust schedule that reflects your priorities and well as supports your personal goals, you have a winning combination: One that will allow you to control your time and keep your life in balance. To learn specific scheduling skills, see Pickle Jar Theory and Scheduling Skills .


Regards...

Wednesday, June 27, 2012

Improve the quality of your java applications


When implementing and debugging a class, it is sometimes useful to state conditions that should be true at a particular point in a method. These conditions, called assertions, help ensure a program’s validity by catching potential bugs and identifying possible logic errors during development. Preconditions and postconditions are two types of assertions. Preconditions are assertions about a program’s state when a method is invoked, and postconditions are assertions about a program’s state after a method finishes. While assertions can be stated as comments to guide the programmer during development, Java includes two versions of the assertstatement for validating assertions programatically. The assert statement evaluates a boolean expression and determines whether it is true or false. The first form of the assert statement is assert expression; This statement evaluates expression and throws anAssertionError if the expression is false. The second form is assert expression1 : expression2; This statement evaluatesexpression1 and throws an AssertionError with expression2 as the error message if expression1 is false. You can use assertions to programmatically implement preconditions and postconditions or to verify any other intermediate states that help you ensure your code is working correctly. The example in Fig. 13.9 demonstrates the functionality of the assert statement. Line 11 prompts the user to enter a number between 0 and 10, then line 12 reads the number from the command line. The assert statement on line 15 determines whether the user entered a number within the valid range. If the user entered a number that is out of range, then the program reports an error. Otherwise, the program proceeds normally.

Fig. 13.9 Checking with assert that a value is within range.
   1  // Fig. 13.9: AssertTest.java
   2  // Demonstrates the assert statement
   3  import java.util.Scanner;
   4  
   5  public class AssertTest
   6  {
   7     public static void main( String args[] )
   8     {
   9        Scanner input = new Scanner( System.in );
  10        
  11        System.out.print( "Enter a number between 0 and 10: " );
  12        int number = input.nextInt();
  13        
  14        // assert that the absolute value is >= 0
  15        assert ( number >= 0 && number <= 10 ) : "bad number: " + number;
  16        
  17        System.out.printf( "You entered %d\n", number );
  18     } // end main
  19  } // end class AssertTest

 Enter a number between 0 and 10: 5You entered 5 
 Enter a number between 0 and 10: 50Exception in thread "main" java.lang.AssertionError: bad number: 50        at AssertTest.main(AssertTest.java:15) 

Assertions are primarily used by the programmer for debugging and identifying logic errors in a application. By default, assertions are disabled when executing a program because they reduce performance and are unnecessary for the program’s user. To enable assertions at runtime, use the -ea command-line option when to the java command. To execute the program in Fig. 13.9 with assertions enabled, type
java -ea AssertTest

SQL Tuning/SQL Optimization Techniques


1) The sql query becomes faster if you use the actual columns names in SELECT statement instead of than '*'.

For Example: Write the query as
SELECT id, first_name, last_name, age, subject FROM student_details;
Instead of:
SELECT * FROM student_details;

2) HAVING clause is used to filter the rows after all the rows are selected. It is just like a filter. Do not use HAVING clause for any other purposes. 
For Example: Write the query as
SELECT subject, count(subject) 
FROM student_details 
WHERE subject != 'Science' 
AND subject != 'Maths' 
GROUP BY subject;
Instead of:
SELECT subject, count(subject) 
FROM student_details 
GROUP BY subject 
HAVING subject!= 'Vancouver' AND subject!= 'Toronto';

3) Sometimes you may have more than one subqueries in your main query. Try to minimize the number of subquery block in your query. 
For Example: Write the query as
SELECT name 
FROM employee 
WHERE (salary, age ) = (SELECT MAX (salary), MAX (age) 
FROM employee_details) 
AND dept = 'Electronics'; 
Instead of:
SELECT name 
FROM employee
WHERE salary = (SELECT MAX(salary) FROM employee_details) 
AND age = (SELECT MAX(age) FROM employee_details) 
AND emp_dept = 'Electronics';

4) Use operator EXISTS, IN and table joins appropriately in your query. 
a) Usually IN has the slowest performance. 
b) IN is efficient when most of the filter criteria is in the sub-query. 
c) EXISTS is efficient when most of the filter criteria is in the main query.
For Example: Write the query as
Select * from product p 
where EXISTS (select * from order_items o 
where o.product_id = p.product_id)
Instead of:
Select * from product p 
where product_id IN 
(select product_id from order_items

5) Use EXISTS instead of DISTINCT when using joins which involves tables having one-to-many relationship. 
For Example: Write the query as
SELECT d.dept_id, d.dept 
FROM dept d 
WHERE EXISTS ( SELECT 'X' FROM employee e WHERE e.dept = d.dept);
Instead of:
SELECT DISTINCT d.dept_id, d.dept 
FROM dept d,employee e 
WHERE e.dept = e.dept;

6) Try to use UNION ALL in place of UNION. 
For Example: Write the query as
SELECT id, first_name 
FROM student_details_class10 
UNION ALL 
SELECT id, first_name 
FROM sports_team;
Instead of:
SELECT id, first_name, subject 
FROM student_details_class10 
UNION 
SELECT id, first_name 
FROM sports_team;

7) Be careful while using conditions in WHERE clause. 
For Example: Write the query as
SELECT id, first_name, age FROM student_details WHERE age > 10;
Instead of:
SELECT id, first_name, age FROM student_details WHERE age != 10;
Write the query as
SELECT id, first_name, age 
FROM student_details 
WHERE first_name LIKE 'Chan%';
Instead of:
SELECT id, first_name, age 
FROM student_details 
WHERE SUBSTR(first_name,1,3) = 'Cha';
Write the query as
SELECT id, first_name, age 
FROM student_details 
WHERE first_name LIKE NVL ( :name, '%');
Instead of:
SELECT id, first_name, age 
FROM student_details 
WHERE first_name = NVL ( :name, first_name);
Write the query as
SELECT product_id, product_name 
FROM product 
WHERE unit_price BETWEEN MAX(unit_price) and MIN(unit_price)
Instead of:
SELECT product_id, product_name 
FROM product 
WHERE unit_price >= MAX(unit_price) 
and unit_price <= MIN(unit_price)
Write the query as
SELECT id, name, salary 
FROM employee 
WHERE dept = 'Electronics' 
AND location = 'Bangalore';
Instead of:
SELECT id, name, salary 
FROM employee 
WHERE dept || location= 'ElectronicsBangalore';
Use non-column expression on one side of the query because it will be processed earlier.
Write the query as
SELECT id, name, salary 
FROM employee 
WHERE salary < 25000;
Instead of:
SELECT id, name, salary 
FROM employee 
WHERE salary + 10000 < 35000;
Write the query as
SELECT id, first_name, age 
FROM student_details 
WHERE age > 10;
Instead of:
SELECT id, first_name, age 
FROM student_details 
WHERE age NOT = 10;
8) Use DECODE to avoid the scanning of same rows or joining the same table repetitively. DECODE can also be made used in place of GROUP BY or ORDER BY clause. 
For Example: Write the query as
SELECT id FROM employee 
WHERE name LIKE 'Ramesh%' 
and location = 'Bangalore';
Instead of:
SELECT DECODE(location,'Bangalore',id,NULL) id FROM employee 
WHERE name LIKE 'Ramesh%';
9) To store large binary objects, first place them in the file system and add the file path in the database.
10) To write queries which provide efficient performance follow the general SQL standard rules.
a) Use single case for all SQL verbs
b) Begin all SQL verbs on a new line
c) Separate all words with a single space 
d) Right or left aligning verbs within the initial SQL verb

Showing Execution Plan details for a Query


Use these commands one by one the you will get the execution plan for a query:
set auto on;
set autotrace on;
select * from employee;



select * from employee;




       ENO ENAME                                 MID
---------- ------------------------------ ----------
         1 syam                                    2
         2 ram                                     2
         3 raj                                     2
         4 rajgopal                                3
         5 satish                                  3
         6 sundar                                  3


6 rows selected.




Execution Plan
----------------------------------------------------------
Plan hash value: 2119105728


------------------------------------------------------------------------------
| Id  | Operation         | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |          |     6 |   258 |     3   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| EMPLOYEE |     6 |   258 |     3   (0)| 00:00:01 |
------------------------------------------------------------------------------


Note
-----

Hadoop



Hadoop is a large-scale distributed batch processing infrastructure. While it can be used on a single machine, its true power lies in its ability to scale to hundreds or thousands of computers, each with several processor cores. Hadoop is also designed to efficiently distribute large amounts of work across a set of machines.
How large an amount of work? Orders of magnitude larger than many existing systems work with. Hundreds of gigabytes of data constitute the low end of Hadoop-scale. Actually Hadoop is built to process "web-scale" data on the order of hundreds of gigabytes to terabytes or petabytes. At this scale, it is likely that the input data set will not even fit on a single computer's hard drive, much less in memory. So Hadoop includes a distributed file system which breaks up input data and sends fractions of the original data to several machines in your cluster to hold. This results in the problem being processed in parallel using all of the machines in the cluster and computes output results as efficiently as possible.

Tuesday, May 8, 2012

Updating Android 1.5 to 2.2 on HTC G1 Mobile

Really, It works very nice, but have to spend more than 3 hrs. to update and Install.  This is completely your personal risk, If anything goes wrong your mobile OS will be corrupted.


Please make sure your phone is completely charged before doing this.



Software Requirements:
Before starting up-gradation process you have to download everything into your PC.

  1. DREAIMG.nbh
  2. Tmo Cupcake 1.5.zip
  3. FlashRec.apk
  4. recovery-RA-dream-v1.7.0-cyan.img
  5. dream_magic.radio-2.22.19.26i-signed.zip
  6. Latest G1 SPL.zip
  7. generic g1 rooted rom.zip
  8. update-cm-6.1.0-DS-signed.zip
  9. gapps-mdpi-tiny-20101020-signed.zip
(Here I'm giving any external downloadable links, just search in google by your own)

Let's Start the Up-gradation Process:

I) Formatting the SD Card and Downgrading to RC29(YOU WILL DELETE EVERYTHING OFF YOUR SD CARD!)

  1. Plug your USB cable into your computer and then plug your phone in.
  2. Mount your SD card by sliding down the notification bar and selecting mount.
  3. Go to My Computer and access your SD card.
  4. BACKUP ANY FILES THAT YOU WANT ONTO YOUR COMPUTER. VERY IMPORTANT!
  5. Go back to my computer and right click on the drive that is your sd card. Click format. Choose FAT32 from the drop down and hit the format button. This removes all data from your memory card.
  6. Once the format is complete: drag and drop "DREAIMG.nbh & Update.zip files that you downloaded into the sd card. (DO NOT create a folder or anything, just put it right in the SD card)
  7. Remembers that you have rename “Tmo Cupcake 1.5” as update.zip
  8. Unmount your phone by going through the notification bar and then unplug your phone from your computer. Them turn off your phone.
  9. Press and hold the camera+end key until until you see a screen with colored bars, then let go. This is the bootloader. The screen will turn gray with blue writing on it.
  10. Hit the end key to start the update. DON'T DO ANYTHING UNTIL THIS IS DONE!
  11. Once it is finished press the trackball to reboot. (If it goes back the the colored bar screen and doesn't reboot try holding the home+menu+end key, if this doesn't work, just remove the batter and put it back in and turn the phone on)
  12. Once the phone is on, just turn it back off.
  13. Now press the Home+End keys until you see a triangle with an exclamation point in it (this is recovery mode). Once you see this let go of the buttons.
  14. Open the keyboard and press the ALT and L buttons, and then Press ALT and S buttons. Now wait until the phone reboots (it will do this automatically once the update is applied) (Don't worry if you see picture of a box and a g1 or a chip with an arrow)
  15. Once the phone reboots, go ahead and and go through the welcome guide and get to the home screen.

II) Flashing a Recovery Image
  1. Now with your phone at the home screen, go to settings>applications> an turn on unknown sources.
  2. Now go to settings>SD card and Phone Storage>Unmount SD Card
  3. Now Click format sd card and go ahead and format your sd card. It will automatically remount after.
  4. Go back to the home screen and plug and mount the phone to the computer again as you did earlier.
  5. Place the following files you downloaded earlier right into the sd card: FlashRec.apk, and Amon Ra's Recovery Image (Again not in any folder or anything, just on the sd card)
  6. Once they are transferred go ahead and unmount and unplug your phone from the computer
  7. Go and download a file manager from the android market (I suggest LINDA FILE MANAGER)
  8. Once downloaded, open the file manager and go to SD card, and click the FlashRec.apk file and then click install. If it asks -> Tell it to use package installer to open it (it probably wont ask but if it does)
  9. Once installed click open (it will be on bottom left of screen)
  10. Then click the button that says "backup recovery image"
  11. Once it says "backup complete" open the keyboard and type the following: /sdcard/recovery.img
  12. The click "flash custom recovery image" and wit until it says "Flash complete"
  13. Go back to the home screen and then turn off the phone.
  14. Turn the phone back on into recovery mode by holding down the home and power buttons. You will see a bunch of text on top of a black background with an HTC logo in the middle.
III) Partitioning and Loading the latest rad
  1. Scroll down to "Partition SD Card"
  2. Click "Partition SD"
  3. Press the Home key to confirm
  4. Use the trackball to increase the "swap size" to 96MB then press Home key
  5. Make sure "EXT2" is set to 512 MB then Click the Home Key
  6. Make sure "Fat32 size" is set to remainder and then press the Home Key and then the phone will begin partitioning.
  7. Once partitioning is complete scroll down and select to "SD: ext2 to ext3" and press track-ball and then press the Home key. Wait for it to upgrade.
  8. Once the Upgrade is complete hit the "back" button to get back to the main menu. Then scroll down and select "USB-MS Toggle" and wait for it to enable.
  9. Now plug the phone into the computer again. Now transfer the files downloaded earlier: G1 Radio, G1 HardSPL, Generic G1 Rom w/ root, to the phone. (AGAIN KEEP THE FILES JUST IN THE SD CARD AND NOT IN A FOLDER OR SOMETHING)
  10. Once the transfer is complete hit the Home key to disable the USB-MS toggle and return back to the main menu of recovery mode. Unplug your phone.
  11. Scroll down and select "Flash .zip from SDcard"
  12. Select the G1 Radio file (named OTA Radio or something like that) and hit the Home key to confirm. DO NOT SELECT ANY OTHER FILE, THE RADIO MUST BE DONE FIRST.
  13. Once the Radio Flash is complete Press Home+Back to reboot the phone. It will then say "writing radio image" and then reboot back into recover mode (this will take some time)
  14. Once back into recovery mode, scroll and select "Flash zip from SDcard" again.
  15. This time choose the SPL file (named somthing like "Latest G1 SPL.zip") and then click the HOME KEY to confirm.
  16. Once it finishes, hit HOME+Back to reboot once again. It will say "writing boot image" and then reboot back to recovery mode.
  17. Once again scroll to "Flash zip from SDCard" and choose the Generic G1 Rom file (Named something like Generic G1 Root Rom.zip) and click Home to confirm and wait for it to finish.
  18. Once finished it should go back to the main menu and say"Install from SD card complete"
  19. Now click on the "Reboot System Now" choice. (Home+Back)
  20. Wait for the phone to reboot back into Android.

IV)Installing CYANOGENMOD 6 (Android 2.2 Froyo for HTC DREAM)

  1. Once back into Android, turn the phone back off.
  2. Hold the Home+End keys to turn the phone on and get it back into recovery mode
  3. Select "USB-MS Toggle" and wait for it to enable
  4. Once enabled, plug your phone in and transfer the CYANOGENMOD6 and GAPPS file ito your SD card/phone. (again not in any folder, just in the sd card)
  5. Once the files are transferred, press the Home key to disable USB-MS Toggle and return to the main menu, and then unplug your phone.
  6. Scroll down and select "wipe" and then select "wipe data / factory reset" and then hit the Home key to confirm. Wait for it to finish the wipe. It will say "Data wipe complete"
  7. Hit the back key to return to the main menu.
  8. Scroll and select "Flash Zip from SDCard"
  9. Select the CYANOGENMOD 6 ROM Named something like "update-cm-6.0.0-DS-RC1-signed.zip" and hit Home to confirm and wait for it to finish.
  10. Once finished it will go back to the main menu and say "Install from SD Card Complete"
  11. Go back to "Flash Zip from SDCard"
  12. Select the Gapps File Named something like "gapps-mdpi-FRF91-3-signed.zip" and click home to confirm.
  13. Once it is finished you should be back at the main menu. Select "Reboot System Now" and wait for the phone to reboot.
The reboot will take some time, (roughly 5-10 minutes) so don't freak out. Just put your phone down and go do something =)

CONGRATS! YOU have successfully rooted your G1 and installed