Pages

Wednesday, May 4, 2011

Ubuntu for my mom


My mom does not know anything about computer. She often asks me to copy traditional songs that she liked to her very old-fashion phone. Everyday, she loves to hear news on TV and keep track any things related to health. These tools (phone and TV) are  "most hi-tech" things that she can use currently. 

I am beside her just 2-3 hours per day (not count the sleeping time). So, I know that she feels very lonely and sad when I am not there. I decide to help her know more about computer. It's a good tool for her to discover favorite things to relax at home. Anyway, helping an old person without knowledge about computer is not an easy task. 

All of my computers at home installed with Ubuntu. It's good for any tech guys liked me, but not too easy for my mom if she wants to learn.  
My mom and I


During my life, I develop software projects for many clients, many bosses - but never for my mom (the most important person of my life). This is the time I need to do that. So, I decide to setup the first IT project for my family. I call it "Ubuntu for my mom". The target is: helping my mom can use my Ubuntu computers in some days.

I will update these steps on the same post when I finish on each day. So, please comment if you have any good ideas to help me simplify/improve the "project".

Day 1: Setup a simple screen and help my mom to use the mouse for reading news

Step 1: Setting up

+ Create an account for my mom on Ubuntu. Setup for automatically login for that account. She does not get acquainted with the keyboard/mouse at the beginning. I did that to prevent confusion to her.
+ Install the Vietnamese locale for my Ubuntu. My mom does not know English. So, localization is suitable for her.
+ Changing the theme of my Ubuntu. Using big icons, theme with big contrast color. My mother's eyes are not good. This way helps her to know where to click on the screen.
+ Clean up all unnecessary icons on the screen.
+ Install Prism. Prism helps to create shortcut/application based on web URLs. I created some shortcuts for my mom for reading big magazines in VietNam (TuoiTre, ThanhNien, PhuNu, ...) on the desktop.

My screen after setting up:


Step 2: Help my mom know how to turn on/off the computer:

This step is easy for me, but not memorizable for my mom. So, I decide to put a big note on the "button to turn on the computer". Now, she knows how to turn on.

So, how to shutdown the computer? I added a single RED shortcut on the top menu. She just need to remember the "RED" color button to click. Now, it's totally easy for my mom.

Step 2: Help my mom to use the mouse

+ I guide my mom to use the mouse with very basic concepts: left button click, left button double click and scroll. She does not remember too much about when to use which actions. So, I take a big note and stick on my desk. After 1 hour, now she knows how to use the mouse for reading news with shortcuts I created for her.
+ I also guide her how to "minimize, maximize and close" windows on the screen.
+ Another important point: I guide my mom for navigate and click into link of the online magazine to see detail content for each articles, categories.

Result: day 1 is in very good progress. My mom can read news online and turn off the computer when I am not at home.

Wednesday, August 18, 2010

Knowledgeroot - installation and backup/restore

Knowledgeroot is an open source knowledgebase system. It helps you to create a central place for organizing information/knowledge for your team. 

Below is a screenshot from our current knowledgeroot system:


Anyway, the installation guide for this open source is not clear enough for you to install easily. I've just found a great guideline on below link:

http://www.debian-administration.org/users/ericrox/weblog/1


I already tried to install it on my Ubuntu desktop for the team to use currently. After some days, I need to move this system to another server because if I shutdown my computer, noone can use it anymore :)

Fortunately, backup & restore knowledge root is easy. You just need to backup/restore the database only. All attached files are stored inside the MySQL DB.


MySQL v.5.0 supports some nice commands for you to backup data:
http://dev.mysql.com/doc/refman/5.0/en/mysqlhotcopy.html


In this case, I prefer to copy the whole folder of my knowledgeroot database (because it contains also binary data files). So, I did below steps:


Step 1: using mysqlhotcopy to create backup database in raw


Below is the command I use to backup my knowledgeroot database to current directory:

sudo mysqlhotcopy -u my_db_account -p password_of_my_db_account  knowledgeroot . 


Step 2: copy this folder into USB, and copy it to the data directory of mysql (default mysql data directory is located at: /var/lib/mysql


However, I need to do a quick trick to copy this folder because /var/lib/mysql folder is not owned by my account by default
(a) sudo chown -R myaccount /var/lib/mysql
(b) copy the backup data folder into /var/lib/mysql
(c) return the owner for mysql account by this command:  sudo chown -R mysql:mysql /var/lib/mysql




Saturday, June 5, 2010

Smartphone market

Some useful information for all mobile developers

Mobile market share (2009)

(The graph below presents for general mobile market share)
Source: Gartner

Smartphone market share


Source: Nielsen

Worldwide Mobile Terminal Sales to End Users in 1Q10

(Thousands of Units)
Company
1Q10
 Units
1Q10 Market Share (%)
1Q09
 Units
1Q09 Market Share (%)
Nokia
110,105.6
35.0
97,398.2
36.2
Samsung
64,897.1
20.6
51,385.4
19.1
LG
27,190.1
8.6
26,546.9
9.9
RIM
10,552.5
3.4
7,233.5
2.7
Sony Ericsson
9,865.6
3.1
14,470.3
5.4
Motorola
9,574.5
3.0
16,587.3
6.2
Apple
8,359.7
2.7
3,938.8
1.5
ZTE
5,375.4
1.7
3,369.6
1.3
G-Five
4,345.0
1.4


Huawei
3,970.0
1.3
3,217.9
1.2
Others
60,418.1
19.2
44,972.2
16.5
Total
314,653.50
100.0
269,120.10
100.0
Source: Gartner (May 2010)

Worldwide Smartphone Sales to End Users by Operating System in 1Q10

(Thousands of Units)
Company
1Q10
 Units
1Q10 Market Share (%)
1Q09
 Units
1Q09 Market Share (%)
Symbian
24,069.8
44.3
17,825.3
48.8
Research In Motion
10,552.6
19.4
7,533.6
20.6
iPhone OS
8,359.7
15.4
3,848.1
10.5
Android
5,214.7
9.6
575.3
1.6
Microsoft Windows Mobile
3,706.0
6.8
3,738.7
10.2
Linux
1,993.9
3.7
2,540.5
7.0
Other OSs
404.8
0.7
445.9
1.2
Total
54,301.4
100.0
36,507.4
100.0
Source: Gartner (May 2010)

Refs:
http://blog.nielsen.com/nielsenwire/online_mobile/iphone-vs-android/

Comparision of smartphones

A useful link from wikipedia for comparison os smartphones
http://en.wikipedia.org/wiki/Comparison_of_smartphones

Wednesday, April 14, 2010

Gesture recoginization in iPhone SDK

For many magazine applications running on iPad, you easily see that the application detect your gestures for interactions on the content: rotate, swipe right to left (or left to right), tap. If we have to handle these gestures manually by code, it is not efficient.

So, Apple tries to make our developer life easier to breath by providing us a built-in mechanism to detect these common gestures on the latest iPhone SDK version.


You can find these APIs from UIGestureRecognizer class.
"A gesture-recognizer object (or, simply, a gesture recognizer) decouples the logic for recognizing a gesture and acting on that recognition. When one of these objects recognizes a common gesture or, in some cases, a change in the gesture, it sends an action message to each designated target object" - from Apple API documentation.


This class derives to:
1. UITapGestureRecognizer: presents the gesture that p fingers tapped the screen q times consecutively.
  • Input properties: numberOfTaps (q), numberOfFingers (p)
  • Output properties: location, touches
2. UISwipeGestureRecognizer: represents the gesture that p fingers tapped the screen q times consecutively.

3. UIRotationGestureRecognizer: looks for rotation gestures involving two touches. When the user moves the fingers opposite each other in a circular motion, the underlying view should rotate in a corresponding direction and speed.

4. UIPinchGestureRecognizer: represents the gesture that 2 fingers moving towards or away from a center point. This gesture is usually used for scaling a view.
  • Input properties: scaleThreshold
  • Output properties: scale, velocity, anchorPoint, transform
scaleThreshold is the critical scale the fingers must first move apart/together before this recognizer could fire.

5. UILongPressGestureRecognizer: represents the gesture that p fingers moved/stayed on the screen continuously for T seconds.
  • Input properties: numberOfFingers (p), delay (T), allowableMovement
  • Output properties: touches, centroid, startPoint
6. UIDragRecognizer: represents the gesture that 1 or more fingers moving on the screen for a distance of d. Optionally it may also be constrained to moving only within an angle of θ ± Δθ.
  • Input properties: minimumDistance (d), angle (θ), maximumDeviation (Δθ), restrictsToAngle
  • Output properties: touch, startPosition, startAngle
Note that the angles are in radians.
7. UIPanGestureRecognizer: represents the gesture that 1 or more fingers moving on the screen for a relatively large distance. This gesture is usually used for scrolling, and is used by UIScroller and UIScrollView.
  • Input properties: directionalLockEnabled
  • Output properties: offset, velocity, transform
8. UITapAndAHalfRecognizer: represents the gesture that 1 finger tapped the screen q times consecutively, and then moved/stayed on the screen.
  • Input properties: numberOfFullTaps (q), allowableMovement
  • Output properties: touch


An example for how to use these API:
UISwipeGestureRecognizer *swipeRecognizer = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(DidSwipe:)] autorelease];

By default this line of code detect the swipes from left to right.

If you want to detect a swipe from right to left add the below line after the above line:
swipeRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;

On 1 view, you can add many gesture recognizers to handle different interactions by using below function
[self.view addGestureRecognizer:swipeRecognizer];

After that, just implement the [DidSwipe] method we already registered above:
- (void) DidSwipe:(UISwipeGestureRecognizer*)sender{
   Do something...
}


Refs:
+ http://iphonedevwiki.net/index.php/UIGestureRecognizer
+ iPhone SDK 3.2 API document

Happy coding!