Monday, January 31, 2011

Where to install Eclipse on Ubuntu

I don't know. I'm not an expert on Linux system at all.
However, I found a nice post and decided to install under /opt folder.

sudo mv eclipse /opt/eclipse cd /opt sudo chown -R root:root eclipse
sudo mv eclipse /opt/eclipse cd /opt sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x `sudo find eclipse -type d`
Then create an eclipse executable in your path
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudoedit /usr/bin/eclipse
With these contents:
#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclipse $*

http://informationideas.com/news/2008/11/16/where-to-install-eclipse-on-ubuntu/
http://flurdy.com/docs/eclipse/install.html

VirtualBox Screen Size too small: Windows Host OS + Ubuntu Guest OS

I've been using VirtualBox to run Ubuntu on my PC.
The screen size is too small.
So here's what you have to do to install GuestAdditions.


1. Start the virtual machine
2. Select "Mount CD/DVD-ROM" from the "Devices" menu in the virtual machine's menu bar and then "CD/DVD-ROM image".
3. Before installing the Guest Additions, you will have to prepare your guest system for building external kernel modules. This works similarly as described in Section 2.3.2, “The VirtualBox kernel module”, except that this step must now be performed in your Linux guest instead of on a Linux host system, as described there.

Again, as with Linux hosts, we recommend using DKMS for Linux guests as well. If it is not installed, use this command for Ubuntu/Debian systems:

sudo apt-get install dkms

4. Mount the VBoxGuestAdditions.iso file as your Linux guest's virtual CD-ROM drive.

5. Change to the directory where your CD-ROM drive is mounted and execute as root:

sudo ./VBoxLinuxAdditions-x86.run
In a 64-bit Linux guest, use VBoxLinuxAdditions-amd64.run instead.

6. Restart the system

7. After the system starts, Host Key + F (Default setting is Right CTL + F) to try out Full Screen mode.
This worked for me, and hopefully this will work for you too.

After all of this, I found a very useful post.
http://www.nerdgrind.com/how-to-increase-screen-size-or-resolution-in-virtualbox-for-ubuntu-or-linux/

YUI Theater

Here's a great source for JavaScript developers!!!
http://developer.yahoo.com/yui/theater/

Great source of links to html, css, javascript materials
http://home.comcast.net/~richarduie/


http://www.webdeveloper.com/javascript/javascript_js_tutorial.html
http://www.sitepoint.com/forums/forumdisplay.php?f=15
http://articles.sitepoint.com/category/javascript
http://www.ozzu.com/javascript-tutorials/tutorial-javascript-introductory-t86155.html
http://w3schools.com/js/default.asp

Installing OpenCV on Mac OS

Here is the official installation guide.

I'll show you how to build opencv from source using the CMake build system.

1.  Open Terminal. Move to a folder where you want to download opencv source code.

2. Type in the following commands.

$ svn co https://code.ros.org/svn/opencv/trunk/opencv
(This will download source code from repository)

$ cd opencv
(moving into the opencv folder just downloaded)

$ mkdir build
$ cd build
$ cmake ..

If you want to configure the make
$ ccmake .
(This will give you an opportunity to choose to build samples and install examples)

3. Build and install opencv
$ make -j8
$ sudo make install

Ubuntu Linux PATH problem

I was trying to build Android from source code.
http://source.android.com/source/download.html

I had to install Repo and set it to PATH.
I've been used to MacOS now but Ubuntu is not my cup of tea yet....well MacOS neither...but anyhow...
The problem was, that in ~/ directory, I find .profile and .bashrc files.
In .profile, I find the following line.
     if [ -d ~/bin ] ; then
          PATH=~/bin:"${PATH}"
     fi



So it seems this should work, however when I type "repo", the terminal doesn't recognize this command.
I went through quite a number of posts online.
And finally I found a solution.
Here, I quote
The .bash_profile file is read and executed when bash is invoked as a login shell, otherwise the .bashrc file will be read and executed.
That's why this code:
if [ -d ~/bin ] ; then
    PATH=~/bin:"${PATH}"
fi
which is located in .bash_profile, doesn't seem to work...it's not being read. But, if you enter this into your terminal:
bash --login
then all your scripts in ~/bin will execute properly for your current terminal session.
A good solution is to cut those 3 lines of code out of .bash_profile and put them in your .bashrc file. If you don't cut (or comment out) the code in .bash_profile it will be read twice since .bash_profile includes the .bashrc file.

So I followed this suggestion and it worked perfectly.
Here's the reference to the post.
It's frustrating to be a beginner....isn't it?



Thursday, January 27, 2011

Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.

So as the title says, this is the error I got when compiling a project I build for about a year ago.

Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.

Cause:
In strings.xml I had the following format arguments "%s/%s"
ex. <string name="template_user_agent">"%s/%s (Linux; Android)"</string>

Now, format arguments had to be changed to "%1$s/%2$s"

Then, the error should dissapear.

I found the solution from the following pages.


http://stackoverflow.com/questions/4437023/resources-ap-does-not-exist-when-compile-my-android-project

http://developer.android.com/guide/topics/resources/string-resource.html

http://mobile.tutsplus.com/tutorials/android/android-sdk-format-strings/