Tuesday, 7 August 2012

Android - Install Apps To SD By Default & Move unmoveable Apps to SD

Reference:
http://www.howtogeek.com/114667/how-to-install-android-apps-to-the-sd-card-by-default-move-almost-any-app-to-the-sd-card/

My beloved Nexus One ran out of space the other day - it wasn't the first time that it happened to me, but this time, I couldn't find any apps that I want to remove, so the "low storage" error message kept flashing on my face...

Here, I will be listing the steps on how-to install apps on your android to the SD card by default and also moving the previously unmoveable apps to SD.

Please only take the steps below when the normal, conventional way of freeing storage does not help anymore.

1 - Enable USB Debugging

Settings > Applications > Development > USB debugging


2 - Download & Install the Android SDK here.

There are pre-requisites skipped in this step here, they are basically:

  • Download the Java SDK
  • Change your environment variable, path, to include the directory of the java sdk and the android sdk.
  • run adb on command prompt to make sure it works

3 - Open command prompt and type in (with the device plugged-in)

adb devices


4 - Make sure your device shows up under "List of devices attached"

The most common problem is that the adb doesn't return any attached device despite your computer detects your device. This usually meant that the google usb driver haven't install.

a) Download the Google USB Driver via the SDK Manager.


5 - Run the following command to set the default install location to the SD card

adb shell pm setInstallLocation 2

To revert this change, set the 2 to 0 in the above command line.

0 represents your device internal storage
1 represents auto
2 represents external storage - in this case, the SD card



Thats it! Almost all apps that you install now will automatically install to the SD card. You can also move some of the existing apps (that cannot be move previously) to the SD card.

Note: Some apps are probably better leave it in the internal storage, this are:
  • Launcher app
  • Widgets
  • Animated Wallpapers
  • Apps that you might still use when your SD card is mounted to the computer



Cheers!





Tuesday, 3 July 2012

VirtualBox + Lubuntu - proxies, guest additions and customization

Recently, I got to use Linux at work but because all the machines were Windows and I couldn't be bothered to wipe the drive and put linux on, I decided to use VirtualBox to run it in parallel.

I chose a lightweight version of Ubuntu, called Lubuntu. There is another lightweight one called Xubuntu as well, however, from what I have read when comparing those 2, lubuntu seems to use less system resource and maintain its usability.

I'm just going to list all the steps I took to setup proxies, install vbox guest additions and command prompt customizing. This post can serve as a reminder for myself if I ever going to do the same thing again.

My settings in vbox is as follow:

  • Linux | Other
  • 512 MB RAM
  • fixed 12GB VHD


1. Create a file called "95proxies" into /etc/apt/apt.conf.d - for updates in Lubuntu

vi /etc/apt/apt.conf.d/95proxies
Acquire::http::proxy "http://<user>:<password>@<proxy-url>:<port>/";

2. Update packages

sudo apt-get update
sudo apt-get upgrade


3. Install guest additions - copy & paste between Windows and scrolling enabled


sudo /media/[VBOXADDITIONS]/VBoxLinuxAdditions.run


4. Create a share folder between Windows and Lubuntu

Vbox Manager -> Settings -> Shared Folders -> Add



5. Mount the share folder

mount -t vboxsf [share] [mount-point]


6. Auto-mount of the share folder when start-up

vi /etc/fstab
[share]   [mount-point]   vboxsf

OR if it doesn't work, since there was a bug in my version of Lubuntu (12.04):

vi /etc/init.d/rc.local
mount.vboxsf -w [share] [mount-point]

7. Customizing command prompt - editing the bash file
vi ~/.bashrc
## Set the PS1 prompt#

colorsblue='\[\e[0;34m\]'

BLUE='\[\e[1;34m\]'

brown='\[\e[0;33m\]'

cyan='\[\e[0;36m\]'

CYAN='\[\e[1;36m\]'

GREEN_BR='\[\e[1\;32m\]'

green='\[\e[0;32m\]'

GREEN='\[\e[1;32m\]'

magenta='\[\e[0;35m\]'

MAGENTA='\[\e[1;35m\]'

RED_BR='\[\e[1\;31m\]'

red='\[\e[0;31m\]'

RED='\[\e[1;31m\]'

yellow='\[\e[1;33m\]'

NC='\[\e[m\]'

PATH=$PATH:/sbin

GPG_TTY=`tty`

PS1="${red}\t-${cyan}\w${NC}\n${BLUE}\u${NC}@${RED}\h${NC}\` if [[ \$? = 0 ]] ; then echo ${GREEN_BR}\\\>\\\:\\\)${NC}; else echo ${RED_BR}\\\<\\\:\\\(${NC}; fi \`"




alias ls='ls -p'


8. Set up proxy for Internet connections

Right click on Desktop -> Create New... -> Shortcut.
Set up shortcut as follow:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Chromium Browser
Name[en_AU]=Chromium Browser
Icon=chromium-browser
Exec=/usr/bin/chromium-browser --proxy-pac-url="<proxy-pac-url>"
Comment[en_AU]=Web Browser
vi ~/.bashrc
## Set proxy

function proxy(){

 echo -n "username:"

 read -e username

 echo -n "password:"

 read -es password

 export http_proxy="http://$username:$password@<host>:<port>/"

 export HTTP_PROXY="http://$username:$password@<host>:<port>/"

 export https_proxy="http://$username:$password@<host>:<port>/"

 export HTTPS_PROXY="http://$username:$password@<host>:<port>/"

 export ftp_proxy="http://$username:$password@<host>:<port>/"

 export FTP_PROXY="http://$username:$password@<host>:<port>/"

 echo -e "\nProxy environment variable set.\n"

}

function proxyoff(){

 unset username

 unset password

 unset HTTP_PROXY

 unset http_proxy

 unset HTTPS_PROXY

 unset https_proxy

 unset FTP_PROXY

 unset ftp_proxy

 echo -e "\nProxy environment variable removed.\n"

}
To start the proxy, just run "proxy" in the command prompt.
To turn it off, just run "proxyoff"
This way, I don't have to manage the password in 2 locations.



That's it! all done =)

Tuesday, 24 April 2012

Oracle UCM Operators (Idoc Script)

http://docs.oracle.com/cd/E28389_01/doc.1111/e10726/c02_application.htm#i1027623


2.5 Operators

Idoc Script supports several operators.

Section 2.5.1, "Comparison Operators"

Section 2.5.2, "Special String Operators"

Section 2.5.3, "Numeric Operators"

Section 2.5.4, "Boolean Operators"


2.5.1 Comparison Operators

Use the following comparison operators compare the value of two operands and return a true or false value based on the result of the comparison. These operators can be used to compare integers and Boolean values in Idoc Script.

If you are using Idoc Script in an HCSP or HCSF page, you must use special comparison operators. For more information, see Oracle WebCenter Content Developer's Guide for Content Server.


OperatorDescriptionExample
==equality<$if 2 == 3$> evaluates to false
!=inequality<$if 2 != 3$> evaluates to true
<less than<$if 2 < 2$> evaluates to false
<=less than or equal<$if 2 <= 2$> evaluates to true
>greater than<$if 3 > 2$> evaluates to true
>=greater than or equal<$if 3 >= 2$> evaluates to true


These are numeric operators that are useful with strings only in special cases where the string data has some valid numeric meaning, such as dates (which convert to milliseconds when used with the standard comparison operators).

For string concatenation, string inclusion, and simple string comparison, use the Special String Operators.

To perform advanced string operations, use  strEquals, strReplace,  or other string-related global functions.

2.5.2 Special String Operators

Use the following special string operators to concatenate and compare strings:


OperatorDescriptionExample
&The string join operator performs string concatenation. Use this operator to create script that produces Idoc Script for a resource include.
<$"<$include " & VariableInclude & "$>"$>
evaluates to:
<$include VariableName$>
likeThe string comparison operator compares two strings.
  • The first string is compared against the pattern of the second string. (The second string can use asterisk and question mark characters as wildcards.)
  • This operator is not case sensitive.
  • Evaluates to FALSE:
    <$if "cart" like "car"$>
    
  • Evaluates to TRUE:
    <$if "cart" like "car?"$>
    
  • Evaluates to TRUE:
    <$if "carton" like "car*"$>
    
  • Evaluates to TRUE:
    <$if "Carton" like "car*"$>
    
|The string inclusion operator separates multiple options, performing a logical OR function.Evaluates to TRUE:
<$if "car" like "car|truck|van"$>



For example, to determine whether the variable a has the prefix car or contains the substring truck, this expression could be used:



<$if a like "car*|*truck*"$>
Important:
To perform advanced string operations, use strEquals, strReplace, or other string-related global functions. For a list, see "Strings".
The like operator recognizes the following wildcard symbols:



WildcardDescriptionExample
*Matches 0 or more characters.
  • grow* matches growgrowsgrowth, and growing
  • *car matches carscar, and motorcar
  • s*o matches sosolo, and soprano
?Matches exactly one character.
  • grow? matches grows and growl but not growth
  • grow?? matches growth but not grows or growing
  • b?d matches badbedbid, and bud



2.5.3 Numeric Operators

Use the following numeric operators to perform arithmetic operations. These operators are for use on integers evaluating to integers or on floats evaluating to floats.


OperatorDescriptionExample
+Addition operator.
<$a=(b+2)$>
-Subtraction operator.
<$a=(b-2)$>
*Multiplication operator.
<$a=(b*2)$>
/Division operator.
<$a=(b/2)$>
%Modulus operator. Provides the remainder of two values divided into each other.
<$a=(b%2)$>



2.5.4 Boolean Operators

Use the following Boolean operators to perform logical evaluations.


OperatorDescriptionExample
and
  • If both operands have nonzero values or are true, the result is 1.
  • If either operand equals 0 or is false, the result is 0.
<$if 3>2 and 4>3$>
evaluates to 1
or
  • If either operand has a nonzero value or is true, the result is 1.
  • If both operands equal 0 or are false, the result is 0.
<$if 3>2 or 3>4$>
evaluates to 1
not
  • If the operand equals 0 or is false, the result is 1.
  • If the operand has a nonzero value or is true, the result is 0.
<$if not 3=4$>
evaluates to 1


Boolean operators evaluate from left to right. If the value of the first operand is sufficient to determine the result of the operation, the second operand is not evaluated.

Tuesday, 27 March 2012

How to choose a camera?

I have been challenged by this question recently. So, how did I choose a camera?

There is always a simple option: head down to your local electronic store, pick one that is the cheapest and there you go. What's the fuss?

Well, the thing is, the camera you get in this way will be one that will become obsolete very soon.

The reason why I would want to get a new camera is because I am going to a South America trip and I have lost the charger of the batteries for my current camera.

Obviously, I don't want to buy a camera just for this trip. I'm looking to make good use of it maybe for a few years. That's why I have took my time to choose and learnt a few things along the way (theory only of course, I'm pretty sure my shooting skills is just on a par as a tourist).

Where did I start? Honestly, I didn't know. Googling best compact camera didn't get me anywhere. And at that time, I was pretty hooked on buying stuff through Amazon, so I did a search on it and sort it by users review. Note that all these searches was done in March 2012, so it could have been out-dated by the time you search it again.

Anyway, I still wasn't going anywhere. It just made my decision starting to get more complicated (yes, it hasn't reach the complicated part yet). I started to ask around. I went on different sites. Geez, I just hope that buying a decent camera was that easy!

To make it clear, I wanted a reasonably priced compact size camera that I could carry around and would take decent quality pictures. DSLR is out of the picture as it is way too big. Micro 4/3 are too expensive. That leaves me with point & shoot (P&S) cameras - the usual touristy ones.

I came across a site that was marketing the Fuji Film cameras on sale. So instead of confusing myself even more, I was going to pick the best one from them.

Let's just say it didn't went too well. I started to compare different models and came across snapsort.com. They have a pretty cool comparison system in place to tell you the pros and cons of each camera. The more I compare the Fuji cameras, the more I drifted away from them. They are a good and well-known brand, but it doesn't seem to suit my needs.

I managed to get a short listed of cameras base on searches on Amazon and from Snapsort. The Canon ELPH 310 HS was top of that list. I started to ask around again for people's opinion. A friend of mine who is into photography also gave me this site where I can list all the cameras at once and compare them.

The feedback I get from people is to get NONE of the cameras in the list. The recommendation was to get the best-of-the-best P&S (at the time), the Canon S100.  Another feedback I've got was to choose the editor's choice Canon SX230 HS (epic zooooooooom!). Too bad, they were all too expensive for my liking.

Based on the result that the 2 recommendations were from Canon, I decided to choose from them instead. I removed a few Samsung (well, they aren't that good except for the price), Nikon, Sony and Panasonic in my list. I was so closed at getting the ELPH 310 when I then came across an online site that offers the SX230 within my budget.

Phew! I can finally end the search, I thought. How wrong was I. The reviews I read in Amazon about my choices shows that they are all prone to a "Lens Error" issue...! I could have bite the bullet, but I didn't stop there.

After the disappointment, I looked deep at my requirements for a camera: A reasonably priced sturdy camera that can take good photos (in good or low lights with a few manual controls), HD movies and can do panorama stitching. Why panorama? I figured that I would mostly be taking landscape photos when I'm travelling and it seems like a really cool feature.

My search for the best suitable camera continued. This is when things starts to get complicated. I was learning about what those different specs mean for a camera and here is basically what I have come up with (all in my own words, so please read it with a grain of salt):
  • Sensor Size - obviously the bigger it is the better the quality of the picture
  • Sensor Type - There are 2 main sensors, CCD and CMOS. CMOS should be better.
  • More mega-pixels does not mean better photo, instead it could meant more noise
  • Higher ISO enables lower light shooting
  • Optical zoom means real zoom; Digital zoom just meant cropping the image
  • Focal Length (e.g. 24mm) - the lower it is the wider the view of the picture will be
  • Viewfinder - the little hole that allows photographers to look at what they are shooting. This feature has become obsolete in all P&S
  • Aperture - the lower it is the more light it is able to take in for lower light shots
  • Exposure speed - the longer it is, the more time it allows light to travels through. Tripod required to reduce shaky hands in long exposure shots.
  • Shutter speed (e.g. 1/2000sec) - how fast the shutter can take a picture
  • Microphone - Stereo is better than Mono
  • FPS - Frame per second. 
For more details on what each item meant, please Google or Wiki them.

Anyway, towards the end of my search, I have singled out 2 cameras: Sony DSC-WX10 or Nikon Coolpix P300.

There was also a brief moment where I was considering getting a rugged camera, like Nikon AW100 and the Olympus Tough TG820. However, I was going to take care of the camera anyway and the premium is a little too much to handle, their time on the list was short-lived (I don't think in the near future I'm going to take pictures while diving!?).

There was also a time that I was worried about a camera phone could make my purchase obsolete sooner than I thought - camera phones are getting better and better and the picture quality is good enough for my liking (especially Nokia 808 has introduced a 41MP camera with a sensor that is even larger than a S100!!). But the thing is, my phone has too much precious in it that I do not want to risk of losing it and also I've already bought a 16GB Class10 SD card, so I have decided to get a camera.

In the end, after looking at a few sample shots from the P300 and WX10, I've concluded my search to get the P300. Its manual controls which are quite semi-SLR (Me Gusta! I could learn a thing or two in photography with those controls) and the size (WX10 is really a tad bit too small) seals the deal for me. Even though the 3D images are quite innovative in the WX10, the end result when you pixel pick are quite tacky with too much processing - it looks like a painting.

So there you have it, the P300 will be my brand new toy for years to come, hopefully! ...Maybe till the next Nexus phone comes out, which I suspect it should be from Motarola next. 

Monday, 26 March 2012

Hello World!

My first blog post. The reason why I chose blogger.com is mostly due to Google uses it and I found out about it on their Gmail home page.

I am looking to use this blog to write about all the geeky, techy and gadgety stuff that I would encounter. This could serve as a place to put all the things that I have learnt or read just so that I could remember, instead of relying of my memory (which acts more like a RAM that could only stores short term information and would be empty once it shuts down).

Hopefully I will update this regularly... Happy Blogging!