Saturday, November 5, 2011

Configure X11VNC in Ubuntu 11.10 a.k.a Oneiric Ocelot

As you should know the new Ubuntu version is out almost one month already but I just got time to play with it. The upgrade  process as usual was easy. It took some hours but it was smooth. The first thing I did was to remove Ubuntu Unity. I might write an entire post about it but right now I am just going to say that I hate it!

When everything finished I noticed I could not remote desktop it using VNC as I always do then the problems started. Searching  in Google I found that this is a known issue in this version and a lot of users keep complaining about it ( myself among them ).

Looking for another options to access my server remotely I found that X11VNC was my best option. The best thing about it is its great options it has for command line control and the best thing is that even if there is no user log in into the terminal you can still start the server, this was a huge limitation about Vino-VNC (the default VNC server Ubuntu ships). First a user has to log in so the server could start, there was no way to start it from command line or ssh. It demands to have a monitor attached.

Anyways after the usual "sudo-apt install X1vnc" to install the required x11vnc packages these are the commands you need to run in order to make it work:

if there is user a user already logged in:
x11vnc -display :0
if nobody is logged in:
sudo x11vnc -auth /var/run/lightdm/root/:0 - display :0
If you notice, you will need to run it as super user since that path needs super user privileges.

The -auth parameter needs the path to the display manger if no one is logged into, but there is a greeter login program like gdm ( Ubuntu ), kdm ( Kubuntu ), xdm ( Xubuntu) , etc running so it might vary on different platforms. You can try 2 things:

This will try to guess the path
x11vnc -auth guess -display :0
Sometimes executing:
ps wwwaux | grep auth
can show you the path to that file, in my case it did.

This tool has tons of options but one I really found  useful is the geometry option, which lets scale the screen to fit your needs or if you are connecting from slow internet bandwidth :
x11vnc -display :0 -geometry 1024x764
Once the server is up and running you should something like this:
The VNC desktop is [YOUR SERVER NAME]:0

And you are all set and ready to connect using your favorite client.

Connecting to the login screen

You can find all the documentation and all the options you can use in this page and here

Hopes it helps while we wait for the bug to be fixed.

Happy coding :)

Monday, October 17, 2011

Google I/O 2012

We are not even done with 2011 and Google has already announced the dates for Google I/O 2012. Mark your calendars because next year this event will take place in San Francisco 24 and 25 of April in the Moscone Center. They haven't published the registration details yet, they said they will do it soon though :)
Me and Sundar Pichai :)
This year's Google I/O was amazing and even when they sold out in less than a hour I was able to make it :) and It was one of the most exiting experiences of this year. I met a lot of Googlers, very interesting people and I learned a lot! thanks to that I was able to published my Android app :)

You can watch the videos from the all the sessions here and read the official post here.

Who is going next year? :)

Thursday, October 6, 2011

Good Bye Steve

It was just few weeks ago when we were talking about Steve Job's resignation and it was pretty clear it had something to do with his health I just thought he had more time :(

Steve was one of the best CEO's of this era. His passion for perfection lead Apple to its brightest years  and even when they said that working with was insane it was all because he really cared about details and excellence. Apple won't be able to replace him that is for sure. They knew this day was coming and they are prepared but they won't get another Steve there would a lot of replacements but never some one like him. They can teach his ideology and try their employees to follow it but that level of excellence needs to come from deep inside.

There are tons and tons of articles about this all over the web even James Gosling wrote about him and Google has a tribute honoring him on his home page and this is because Steve was AMAZING and he will be remembered that is for sure!

I still remember the first time I watched The Pirates of Silicon Valley which is basically a movie of Apple and Microsoft early days. It is a very good movie if you want to learn more about Steve and how he started everything.

And finally here is the famous speech he gave at Stanford back in 2005, really inspiring.

Good bye Steve we will miss you, thanks for everything!

More on Steve here:
TechCruch 1, 2 and 3
Engadget 1 and 2

Saturday, October 1, 2011

200 Downloads and Posts

Today is a great day :) My Android application passed 200 downloads :) from all 200 40.8% are on Froyo, 30.6% on GingerBread and the rest Honeycomb so that means I need to work on the Tablet optimized version more which is something I am working on among other things. I can only tell it is going to be amazing :)

Besides that this is the 200 post :) what a coincidence isn't it? With almost 5000 page views  I started this blog just to share all the things I like and learn. I know the comments are under moderation but that is something I will try to remove in the future, please believe me :). I know I am not posting as much as before, but that is because of all the work trips, work projects and all that, I will get more time to keep sharing my hacking nights :)

So thanks for all the support, comments and all that I will keeping sharing as usual.

Happy coding :)

Tuesday, September 27, 2011

Happy Birthday Google

Today Google is turning 13 and as far as I know it is old enough to have a Facebook account, although not enough to have a Google+. Ironic isn't it?

Whoever knows me also knows that I love Google :) I use almost all its products if not all them. My first email from GMail is from 2004! when it was invite only and since then it is my primary email :)

I was able to go to Google IO this year which was one of my dreams and I finally could make it real :) I was selected to test their first Chrome OS Notebook a.k.a CR-48 :) I also developed my first Chrome extension and Android App and of course I got my N1 which I believe is one of the best cellphones ever :)

So it is safe to say that I am a Google fan :) and even though I haven't accomplished my dream to work there yet I am sure one day I will,

So, happy birthday Google :) and I am sure there are a lot more to come.

Here is a video which shows Google's history and I must say I have been there for most of its accomplishments :)

Monday, September 19, 2011

Google Wallet is here

I still remember the first the time Google announced Google Wallet . I said to myself this is amazing! This is going another huge step in the way people make transactions, a new experience for customers and obviously for sellers.

Technology is  moving faster really really faster. My cellphone has already replaced lots of things, Notepad, Watch, Alarm Clock, GPS, Dictionary, and now It is going to replace my wallet. How many times have you forgot your wallet? and how many times have you forgot your cellphone? These days cellphone is the primary thing everyone keeps in theirs pockets all the time! It is more personal than anything else. It makes perfect sense to handle your wallet now. If you think, it is more secure. If you loose your wallet, you need to call all your credit and debit card companies to cancel all of them and of course ask for new ones again and without mentioning that you need to update all the online stores you usually shop. On the other hand if you loose your cellphone, this information is totally encrypted and it needs an extra PIN number to have access to it. So you just need to get a new cellphone ;)

The bad news is that as technology moves, you also need to get hardware  if you want to take advantage of it. In this case the technology behind all this magic is called NFC ( Near Field Communication). Right now not so many devices have this, but as usual it is just a matter of time.

You can read the official post here to find out more about this. Meanwhile I will consider updating my N1, probably I will wait for the next Nexus device and IceCream Sandwich ;)

Enjoy the video :)

Sunday, September 4, 2011

Prototyping vs Engineering

Whenever I have time I like to watch talks from people I admire and consider inspiring, you know Larry Page, Sergey Brin, Steve Jobs, Eric Schmidt, Linus Torvalds and well lots of them. This time I was watching a QA session with James Gosling a.k.a "The father of Java".  I started my university years with Java and since then, well has been my favorite programming language :)

Anyways, one of the questions he answered [1:08:25]was: "Common mistakes software developers make" he said  "Confusing Prototyping with Engineering tends to be a big one..", "A prototype is a learning experience you hit the delete button and then you re-write it..."

That answer hit me right away and I wished some people i know could watched it and specially this specific question. Sometimes you do not have control over your projects and that is frustrating because you know when something is wrong, something could be done better and that in the future if you do not do it right, it will cause lots of problems. And when you try to say it, nobody listens to you, believe me, it feels really really bad when you have to fix all the things you had predicted but no body wanted to listen to you.

You learn about these kind of mistakes the hard way and when you do it you do learn because of these huge mistakes is that projects fail or get delayed or even worse. The best thing though is next time hopefully you won't make the same mistake.

The very first time that happened to me was years ago and I thought we have learned about it, well at least i did, but it seems some people have not and that is just sad. I see one of those situations coming soon and I do not know what should I do. I guess it is not in my hands, isn't it?

The video is worth watching so If you have some spare time, watch it you won't regret it.

Thursday, September 1, 2011

Happy 3rd Birthday Chrome

I can't believe Chrome is turning 3 years!. I have been using Chrome since the very first version :) I followed all the new features one after another. I was also there when they launch ChromeOS I even still have it in a Virtual Machine and I was also one of the lucky developers who got a CR-48 from Google to test it and be part of the Pilot program and finally I was there when they sent me the Samsung ChromeBook series 5 one of the first ChromeBooks in the market. I also wrote my first extension :) it is not in the Chrome Web Store yet, it will be soon though.

My CR-48 and S5 side by side :)
So, I think I can say I live in the cloud and Chrome is a big part of it. I won't lie, I still use FF, Opera, Safari and even IE sometimes for work sometimes to test the new versions and also to have a better opinion but always go back to Chrome :)

Commemorating this day Google  put together an interactive infographic, built in HTML5 where you can see the evolution of all Web Browsers and technologies. I must say that it is amazing I have used all of this web browsers since the beginning, Am I that old? :( Anyways, there you can see how the UI has changed between them, Safari and Chrome have barely changed but Opera, FF and EI have change a lot since the first days. Also, you can see how MS took more than 5 years to update EI 6 and it is understandable it was a monopoly back then.

I am sure there will more years to come and so many cool things but so has been a great ride :)


Monday, August 22, 2011

Android Emulator is not starting showing " invalid command-line parameter"

I was updating my Android/Google Eclipse environment because I wanted to try the new GPE beta which comes with lots of cool new things. I also took the opportunity to update my Eclipse to Indigo. In summary I updated everything, I like to be up to date on these things :)

Anyways, after installing a configuring everything I was ready to launch the emulator but it wouldn't start at all. It was giving me always the same error:

As it turns out Android SDK R12 has this bug that if the path has spaces, it won't locate it. As I have to work in Windows I placed my SDK inside C:/Program Files/Android . So that was causing my emulator to fail every time I was trying.

They are fixing this issue but you can work around it by using C:/PROGRA~1/Android. If you are using 64 bit, you can use C:/PROGRA~2/Android . Or you can just simple install the SDK in a location without spaces.

These are some tricks you get to learn when you work and try new things. Most of the times we think it is a miss-configuration or something wrong with the installation and we spend a lot of time installing and configuring everything again, but sometimes you just need to do some research. I like to find and document these kind of issues because that way you help others and also yourself since the next time you need to upgrade your development environment you just can look at your notes.

Hope it helps someone, happy coding :)

Sunday, August 14, 2011

How to Configure VLC Remote

I quit cable almost 2 years ago and to be honest I have not regretted it at all but that is another history. Today I am going to talk about how to install and configure VLC remote so you can control VLC from your Android device like a remote control.

I use VLC a lot to watch series and I mean it a lot!!!! and I like to do it from the comfort of my sofa, desktop chair or bed.

So, the first thing you need to do is to install VLC remote in your android device. It woks on cellphones and tablets just the same, I use it in my tablet though  :)

In your computer you need to  install VLC and  do the next steps to configure to work with your device:

1.- Open the preferences window.

2.- Select the show all radio button.

3.- The go to Interface->Main Interfaces and check the enable the built in web server.

If you want to configure more options like port, ssl, etc, you can select HTTP node under Main Interfaces.

4.- Edit the host files and add your IP address to the file. One advice, configure your router to assign the IP to your computer otherwise you will need to edit this file every time your computer changes IP.

5.- You can test the configuration by opening a web browser and write http://server_ip_address:8080/ and you should see something like this

Finally, start the VLC Remote in your device and you should see your server running, connect to it and you are ready to do control your VLC as if you were in your computer. You can add videos to your queue, remove, clear playlist, access computer folders, pretty much everything.

One bug I found and I also reported is that if the you are trying to play has a ' , the player won't play it. It seems it is a character encoding issue but the developer was really fast to answer to it and the only workaround now is to edit the file and remove the ' . The project is hosted in googlecode and you can find more information about this configuration in its wiki.. It also shows how to start VLC server from command line.

You can find a lot more VLC configurations here. I did not know it was so powerful.

Now to time to watch some The Big Bang Theory and That 70's Show episodes :)

Tuesday, August 9, 2011

Importing length fixed data in Oracle

These days I have been working a lot with Oracle, usually I have to deal with MS SQL Server, Oracle, MySQL and PostgreSQL so sometimes I get confused and sometimes I missed functionality from other DB engines. Anyways, this time I want to show how to import huge amount of data using sqlldr.

Explain sqlldr in one post is impossible so I will just focus in one part. When you import data usually you get a nice formatted csv file, you know, coma separated or something like that, but what do you do when you just get a huge amount of text?, no comma, tab, quotes separated, nothing! well, if you have the table structure information (the size of each column), you can use sqlldr and specify the size of each column in the control file and sqlldr will load each column based on that.

This is how you need to write in your control file:
  INFILE filename.dat
  INTO TABLE coredata
Column1    POSITION(1:12) CHAR,
Column2    POSITION(13:204) CHAR

Couple of things to remark:
position[start pont:end point]
I made the mistake to think that the second value was the length of the column, which is wrong is the end of the column which I do not like since it woukd be better to just give the start point and the length. You need to calculate that for each column. I know it is just adding all the time but still I would rather put the length instead of the end point.

You can add multiple lines like this to import multiple files in one execution instead of changing the name for every file and execution.

For example, if you add:
at the beginning it will skip 1 row, load just 10 rows and limit to 5 errors.

Once you have that you only need to execute it using sqlldr like this:
sqlldr username/password loader=loader.ctl
Sqlldr is an amazing tool if you need to import huge amounts of data. I really recommend it. It has the best performance comparing other options and it supports tons of configurations like, importing multiple files at once, or import to a different tables, you can manipulate the data while it inserts, parallel processing, append or replace data, skip rows, limit the rows inserted. It is a huge list so you should really look into it.

Hope it helps someone, happy coding :)

Wednesday, August 3, 2011

I am back!!

More than 2 months!!! but I have a really good excuse. My son was born last June 9th and that changed my life incredible :) I am so happy that is difficult to describe this feeling, it is amazing. I can't believe I am a daddy :)

My kid replaced my programming nights and computer addiction, but I will try to make time to keep writing here and also in my personal blog which is not as geek as this one ;) although it is in Spanish :)

Meanwhile, I left this cute video which gave a great idea which I am doing it with my little baby :)

Enjoy it! :)

Wednesday, June 1, 2011

Be the First to get a ChromeBook

It seems this morning some of the CR-48 pilot members got an email from the Chrome Team announcing the Samsung Chromebook and offering us one of them before the official launch day which is going to be June 15th.

This limited offer comes with a limited edition custom fit Chrome sleeve designed by Rickshaw. They partnered with Gilt to sell these Chromebooks before they go to the market. This is an invite only offer and I am willing to share with whoever wants a Chromebook :) I already have a CR-48 and I can't afford another gadget, at least for now ;)

Samsung Chromebook invite :)

So who wants these new Samsung Chromebook :)

Saturday, May 28, 2011

How to run Chrome OS in a Virtul Machine

I was one of the few ones who got chosen by Google to test their Chrome Notebook a.k.a CR-48 since then I have been using it everyday to read news, checking my email, writing posts and almost everything I can sometimes I even use ssh to connect to my Ubuntu server and write some code.
my CR-48 :)
Also, since I got it a lot of friends keep asking me how is the experience and if there is a way to install it on a PC or running it on a Virtual Machine. Unfortunately the only way to installing is by compiling the source code and building it by yourself. All the instructions are in the Chromium OS developer page which is the open source project for Chrome. Even worse you will need a 64 bit Linux system better if it is Ubuntu 10.04 flavor in order to do it .

Searching around I found this page which provides  Chrome OS images for VMWare, Virtual Box and USB. According to author, every day around 6 pm GTM it automatically downloads the code and compiles it into images so everyone can try them. These are Canary images so for sure they are going to be very unstable and with a lot of bugs and crashes but if you wan to play around with Chrome OS, this is will fit your needs just fine.
Starting the VM :)
The performance is not the same as the real Chrome OS and mainly it is because of 2 things:
First, Chrome OS is optimized for Solid State Drives (SSD).
Second, You won't be able to have graphical acceleration since you are running on a virtual machine.

Signing into my account
Besides these 2 points the experience is pretty much the same. I am running my CR-48 on dev mode and it is also unstable and it crashes depending on the update, some are pretty stable while others are really really buggy and with a lot of crashes and sometimes applications and extensions won't work properly but that is the price if you want to test and use the latest version.
Running Chrome OS :)
Either way, Chrome OS powered notebooks are coming this June so if you have some extra bucks yo can get a brand new one pretty soon :)
Chrome OS powered NoteBooks
So as a weekend project you can download the image you like the best and play around with Chrome OS :)

Monday, May 23, 2011

Some Tips to Publish your app in the Android Market

Today is a great day, I finally published my application in the Android Market :) :) even though it is not even version 1 it is pretty stable and has some really cool things. I tried to follow all their best practices in code, UI and resources.

The Android documentation has some links on how to prepare your app for the Android Market, things like a checklist, UI tests, how the versioning works, how to design your application icons and a lot more, but I wanted to add my personal touch :)

If you have everything on those links above, you are almost done. In order to publish an application you need to sign up as a developer and pay a one time only fee of 25$ which is cheap compared to Apple Store and Amazon. Once you sign up and make the payment you can upload as many apps as you want but for each app you need to have  some mandatory images and screenshots. Believe me when I say that it took me more time getting this icons and images right than developing my application. Sadly, I am not a graphics guy, I did what I could though ;)

Once you upload your apk the developer console gives you a summary of the permissions and features your app needs to run properly; this list is based on your Manifest File, minimum API version and code.

Permissions summary
You can save a lot of time by using the aapt (Android Asset Packaging Tool)tool, you just execute this:
$ aapt dump badging <path_to_exported_.apk>
It will dump all the permissions, features, supported screen sizes and everything! really nice tool. Really useful instead of using the Developer console and find out that you missed something and start the whole process again.

Also, I would recommend paying a lot of attention to the <uses-feature> part. Spend sometime reading the documentation and you will understand why this is so important if you wan to get your application in as many devices as you can. Also you can read this blog post about hardware support and this one about future-proofing your app. This is really an important part. The first time I uploaded my app the console told me it was going to available to 13 devices! just 13! I was shocked since my app could run an any device with Froyo or more and according to this that was more than 65% of the current market. Then I did some research and I added these 3 lines to my Android Manifest:
<uses-feature android:name="android.hardware.faketouch" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<uses-feature android:name="android.hardware.telephony" android:required="false"/>

and now my app is available to 355 devices! Basically this is saying that my application requires this hardware but it can work just fine with out it. For example the last line says that my app can work on any device not only cellphones. It would be better to have telephony features but it can work with out it. So pay attention to this part because it does make a huge difference.
Supported Devices
Finally, it gives you the option to advertise your app. I did not enable this, yet but I am thinking about it. My app is really simple right now and I will add more things before starting that.
Advertise using AdMob
Testing your application in the emulator and your own device is easy. Right now my app could be in 355 different devices and that is the real test. I was afraid to publish it because now it is alive so anyone can install it and use it and that scared me for a lot of time. Sometimes users are mean! and they lie, but at the end I wanted to see my end result and see if I reached that point where I can develop real applications and not just personal projects for my own use.
My App :)
So if you have time you can download my app from here and make a comment and review it :)

Friday, May 20, 2011

More on Git

I wrote about Git in my latest post and I thought I needed to add more information on why I like Git so much! and also some starting information is always good and better if they are videos.

I found these 2 videos which are a great if you want to start using Git. The first one is from O'really which gives you a fresh start on Git and GitHub, really good for starters.

The second one, comes from Google Tech Talks where Linus Torvalds explains why you should use Git. It is worth mentioning that he created Git and The Linux Kernel uses it to maintain it.

A couple of notes abut this Video:

I loved when he said "I do open source because I think is the only right way to make software, but at the same time I also use the best tool for the job" I completely agree with him on this. I also love open source but you also need the right tools to make it work and sometimes that means to use commercial tools at least until you find a open source/free replacement, which does the same work or better.

We share the same feeling about CVS and SubVersion although he really really hates them with strong passion :) he started showing WWCVSND which means "What Would CVS Not Do". He also gave an example on merging and how easy is on Git compared to CVS and SubVersion and he is right merging and branching in SubVersion is a pain. First, everyone can see your branches and second when the time comes to merge it is a master pain and sometimes you just don't do it, you just left the branch there.

These are some comments he has about a good SCM Source Code management:
  • If you are not distributed, if you perform bad, you are not worth using it is that simple.
  • Being distributed means you do not have one central place that keeps track of your data as the opposite of SubVersion ( I totally agree on this one. Having just one central place sucks!).
  • Offline, collaborative, distributed, as many branches as you want are some of the benefits you have when you use Git which are not supported in most other tools. ( Try working offline in SubVersion or CVS, it is just not possible!).
  • Bitkeeper is worth using, it is commercial, but it is also distributed.
At the of the day everyone uses what is the best for the job or what the company you work for tells you to use but sometimes we do not think outside the box. We do not look for better ways to accomplish our job and we get stuck with something old, that sucks but it "works" for us, apparently.

I love learning and trying new things but not everyone is like me. Old fashion guys prefer to stay with something they know and understand instead of exploring new horizons. Hope I never get to that point.

Enjoy the videos, listening to Linus is really fun. I like the way he thinks and expresses himself.

Branching and Merging in Git/GitHub

I little bit of introduction, I have been using Git for my personal projects for quite a bit now and I love it! I used CVS and Subversion and to be honest Git is the best for the job. I tried to implement it in my work but I guess they did not like it anyways that is another history. I also use GitHub as a repository which is really good you can set up an account and repository really fast and as long as your project is open source the storage is free, you a limit though, it is more than enough for a project that is for sure. I also used Google Code and to be honest I prefer GitHub just because Google Code uses Subversion.

You can't explain Git in one post because it is so big and there are tons of ways to do the same thing, that is why I like it so much, among others though. If you want a complete guide to learn Git, I would suggest Pro Git which is free and really really complete.

Now, to the point. I just published my first Android Application to the Android Market (more on this later) :) it is not really that big. It is something I built in my free time and to learn Android. It is nice I like it a lot and I am planning more things. Anyways, I had to create a branch to separate the stable version which is published right now, from the dev version since I am still adding more things. Branching in Git is so easy! really I wish Subversion was that easy. Although, I had to create a remote branch since I am using GitHub either way was easier than anything else so these are the steps to accomplish this:

git pull origin master                 -- to get everything from your repository
git branch <name of your branch>       -- creating the branch
git checkout <name of your branch>     -- changing to the new branch
-- make all the changes you need
git push origin <name of your branch>  -- pushing the new branch to your github repository

If you are done with your branch and all your tests have been completed it is time to merge. Merging is also really easy just one command and that is all:

git merge <name of your branch>  -- will merge <name of your branch> on top of the current branch you are working on

More useful commands are:
git status         -- to check the status and what has changed
git branch         -- will list all your branches
git add .          -- will add all the files modified to a commit ready state

There are a lot of commands and a lot of ways to accomplish the same thing so I strongly recommend to read the documentation to get familiar with all the possibilities.

Happy coding :)

Sunday, May 15, 2011

Eastern egg in Google IO T-shirt

Everyone at Google IO got a nice T-shirt and with a puzzle to solve, Google loves puzzles and this time was in Morse code. If you decode each line, you will get something like this: http://GOO.GL/A4C639

if you follow the link, you will be directed to a page where can download the official Google IO 2011 live wallpaper which is awesome and also you can download Androidify yourself which is a small application for your android device in where you can personalize the Android robot the way you like. It is really fun :)

One more thing, the code A4C639 is the RGB code for the Android green they use on every Android you see around the web. I love these puzzles :)

Friday, May 13, 2011

Google IO 2011 Summary

Google IO has been the greatest experience I've had so far :). Those were 3 days full of fun, meeting new people, learning new stuff and getting to hang out with developers who enjoy working with tools I like as well.

Lucky me I was able to get into BootCamp as well which it was sold out, do not ask me how I did it ;) :) It was great I did a couple of questions and I got to talk with Paul Irish which is one of the Chrome Developers, he was really nice and I even got to take a picture with him :)
Paul Irish and Me :)
The second day was insane, 5,000 geeks all of us in one place it was weird but at the same time amazing. I have not seen so many robots in my life! so many cool gadgets, tools, and people. I had the opportunity to talk with Tim Bray, a developer advocate for Android, He is really really cool! He encouraged me to apply for Android and believe is one of my dreams to work for Google en special in the Android team.
Tim Bray and Me :)
Working time ;)
The after party was like a dream, lights, geeks, good music, full of toys and gadgets and beer :) really the best way to finish and excellent day :) oh! I almost forgot, they gave us a limited edition Samsung Galaxy Tab 10.1 which I already added to my gadget collection :)
Toys ;)
The third and last day was another great day, the Keynote was focused on Chrome and well they told us that we are going to get a new Chrome laptop courtesy of Samsung again :) I already have a CR-48, it does not hurt having another one though ;) and I was able to take a picture with Sundar Pichai, the person in charge of Chrome :)
Sundar and Me :)
At the end I was completely tired! so many sessions, I wish I could have attended all of them, but it was impossible at least i tried and did my best. I got to play with some of Google's toys, take a lot of pictures and met really cool people who also share my passion about Google and its technologies :)

A big plus is that I had to meet Peter Vesterbacka the creator of Angry Birds :) such a nice guy always smiling.
Peter and Me :)
I must say it was a wonderful time, it is sad now it is over but at least I can say I was part of it. Now i am back into my reality and well I have to keep pushing my goal to get better and apply everything I have learned these last 3 days.

According to the official Google Code Blog, all the videos from the sessions and keynotes are already uploaded :) and can be found in the official YouTube channel :) enjoy them because they are worth every second :)

Pics, and highlights are posted here, all the videos can be found in the Google Developers Channel in YouTube.

Happy Coding and until next year Google IO :)

Monday, May 9, 2011

Google IO!!! :)

At the end I made it!!! I am in San Francisco with one of friends from university back in Bolivia. It was difficult to get the days off. I do not know why since it is my personal time off ( one of the things I hate about my job) anyways, I am here now :)

This is my first time in San Francisco and so far it has been amazing!! I wish, I could stay more time though there are so many things to do so many things to see and I am only going to stay for the conference and I do not think I will have time to walk around, I will do my best though.

I will try to post during these days but I am not sure I could. You can see the full schedule here and this year Google will stream the keynotes, android and chrome sessions online and in real time! So if you couldn't get a ticket at least you can watch these ones from anywhere.

Sunset in San Francisco :)

Friday, May 6, 2011

Solution for ORA-01033 caused by ORA-01157 and ORA-01110

Today I was asked to do some work with some data. Basically I have to import the raw data into something more usable, easy to manipulate and run queries. My first option as usual was to use Oracle.

I started my server and listener and try to connect my SQL Developer. I like this front end because is easy to use and what's more it is supported by Oracle which makes the integration easier. Anyways, I tried to connect it and I couldn't so my next try was to use command line and use sqlplus which is the default command interaction you have when you install Oracle DB Server. I executed:
sqlplus <username>/<password>
and I got an ORA-01033: ORACLE initialization or shutdown in progress. I had this issue before and I just used to wait or even re-start my computer but this time it did not work so I had to try another things. I tried running:

C:\> sqlplus / as sysdba
SQL*Plus: Release Production on Thu May 5 17:22:38 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> startup;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> alter database open;
alter database open
ERROR at line 1:
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '\PATH\TO\FILE\CMS2.DAT'

This last command gave me the real reason it seems the server was looking for a DAT file that was no longer in the system which was true, I removed some files but it seems the Oracle DB server was still looking for them. So the solution was to tell the server to stop looking for these files. In order to do that I executed:

SQL> alter database datafile '\PATH\TO\FILE\CMS2.DAT' offline drop;
Database altered.

Now that the file has been deleted we restart the server:

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  778387456 bytes
Fixed Size                  1374808 bytes
Variable Size             385877416 bytes
Database Buffers          385875968 bytes
Redo Buffers                5259264 bytes
Database mounted.
Database opened.

And now everything should be working just fine. Oracle can give us errors when using it but sometimes they are not really the root cause of them this is something I hate about it. We need to be careful and find the real cause before start trying to solve the problem. In this case ORA-01033  was not the real issue, ORA-01157 and ORA-01110 were the root cause and usually because of these kind of issues we have to re-install or try crazy things when the solutions is something different, something simpler.

Hope this helps someone :)

Monday, May 2, 2011

Random Thoughts

Sometimes when I go through my feeds I see some posts that I want share but they do not usually require an entire post. Most of the times I just share them in my Google Reader and Google Buzz but I thought I would share some of them here as well.

Learn sorting algorithms dancing
There are lots of sorting algorithms out there, some of them easy to learn and some of them really difficult. I still remember the first time I implemented the Bubble one. Anyways here is video which shows you the Shell-sort algorithm using Hungarian folk dance really cool ;) you can also watch bubble and Selection

I saw a lot of editors in my life from the most basic ones to the mos complete and sophisticated IDE's. I saw guys writing code using notepad, jcreator, Eclipse, VIM and lot more, but I couldn't believe some would be able to use MS Paint to write. Technically this is not a video it is an animated GIF which shows how the developer used MS Paint to write a simple program.

Who never played this game before? Even Google had as its Doodle for this game's 30th anniversary once and it caused a lot of economical controversy although  you can still play it :) Here is the world's biggest pac-man game I have seen far. It even has a navigator so you can see the game closely AMAZING dp not blame if you waste too much time here ;)

More Games
Since we are talking about games here is a nice post from lifehacker about learning games. It has everything from simple games to improve your typing to learn new languages or even play the guitar :) or prepare for your SAT test. I like the way they adapted Mario Bross to improve your typing. I've always liked that game :)

Saturday, April 30, 2011

Ubuntu 11.04 a.k.a. Natty Narwhal

This week  I got time to upgrade my personal server which was running Ubuntu 10.10 to the new version 11.04 a.k.a. Natty Narwhal. The process wasn't really difficult as many years ago when it used to take hours! and a lot of CD's.

This time I just launched the Update Manager and the notification for the new version was already there and asking if I wanted to install it. You just need to run this command:
sudo update-manager -d

New Upgrade :)

Rlease Notes

Preparing upgrade

I pressed upgrade and after asking for the root user it started the whole process. It removed a lot of old packages and replace others with the new version. One think I really like it is that I made some modifications to some config files and the upgrade tool asked me if I wanted to preserve the old ones or replace them with the new ones. This was great because I was afraid I had to re-do that work again.
Summary of things to do
The whole process might have taken around 2 hours mostly because the Ubuntu servers were so busy with all the installations that sometimes it was really slow to download the packages needed. The traffic must have been really heavy.
Installing new version
Some Clean up
At the end everything was fine but since it is a server I couldn't run the new UI Unity it seems I have to configure my graphics card and makes sense since Unity uses Compiz to run so I might need to take some more time to fix it, either way I like the classic UI.
New Scroll UI
Another new things are the new Ubuntu Software Center , Ubuntu One which lets you synchronize everything between computers and everyone gets 2GB for free, it also lets you stream your music. I need to try this one although 2GB is not too much.
Ubuntu Control Center
Ubuntu One
Talking about software it comes with Nautilus 2.32.2, GNOME 2.32.1, Firefox 4.0, Shotwell 0.9.2, Empathy 2.34.0, Banshee 2.0, LibreOffice 3.3.2, Evolution 2.32.2, Gwibber, Xorg Server 1.10.1, X.Org 7.6, Totem 2.32.2, Compiz 0.9.4, GDM 2.32.1, GRUB 1.99 RC1, Mesa 7.10, New artwork, Linux kernel, Compiz Fusion 0.9.4 and many more. They did replace OpenOffice with LibnreOffice.
You can read the complete set of new features in its official page. I like Ubuntu and I would like it more once I am able to configure and run Unity.

Enjoy the new version :)

Monday, April 25, 2011

A Century with IBM

This year IBM celebrates its 100th birthday! pretty impressive indeed. IBM is one of the biggest and oldest tech companies in the world and this commemorative video shows some of their achievements during this time.

I was born in 1981 and the very first time I touched a computer wasn't until I turned 7 I think. It was a old 386 running DOS 5 and the mouse was just introduced to personal computers. I was the younger student I remember that :) since then I moved to Logo, Turbo Pascal, C++, Java and long list of technologies and I love it Computers have been my addiction since that day :)

You can fin more information about IBM's 100 birthday in its web page where they show a lot more information about all this years.

Enjoy the Video :)

Saturday, April 23, 2011

Building Android Projects from Command Line

I have been spending a lot of time with Android and I am making really good advantages with my app :) even though it is taking a lot of weekends and nights. It is difficult to make progress when you have a full time job that sometimes looks like a 2 full time jobs.

I think I noticed that sometimes using eclipse to build your project and deploy it into the emulator takes a lot of time and I already talk about how slow the Android Emulator is and some ways to it make less slow. One of them is to use command line to create your apk and then install it into the emulator or device.

First, you need to create the build.xml file so you can use ant. To do this you might need to update your root directory project to do that you can execute:

@chambras:~/AndroidWorkSpace/my-app$ android update project -p .
Added file ./build.xml

Once the build file is added you can build your app in debug mode. Just open the command line and write:
ant debug
This will create your debug apk inside your project bin/ folder and looks like [your_project_name]-debug.apk
The next step is to install the apk in the emulator and to do that you just need to do this:

adb install [path_to_your_apk].apk

or if you have multiple emulators or devices running you can execute adb devices so you will see all the devices connected and emulators running and then you can execute:

adb -s emulator [emulatorid] install [path_to_your_apk].apk
If you want to install it in your device:

adb -d install [path_to_your_apk].apk
In order to make this process fast I would recommend adding the platform-tools/ and tools/ folders to your PATH if you are using windows. If you are using Ubuntu or Mac you can do this:

sudo ln -s /path/to/android/tools/android /usr/bin/android
sudo ln -s /path/to/android/platform-tools/adb /usr/bin/adb
These will create symbolic links to those tools so you can execute them form anywhere. Here is more information about building android projects and here on how to use your device.

Happy coding :)

Thursday, April 21, 2011

How to test Google Analytics for Android

Time ago I wrote how to integrate Google Analytics into your Android application. The integration and usage it is pretty simple but the testing part is really terrible. I said that time that you can see the data in your Google Analytics account only after almost a day you posted the events. This was ridiculous, waiting one day to see your results and data just to check it is fine was just a waste of time so started digging and fingig out where these data is stored because it must have some kind of storage so later when you dispatch the data the framework looks for this data and posts it online.

Indeed, my supposition was true. As it turns out when you configure you Google Analytics account in your android application, it creates a new DB in your package folder. Inside this Data Base there are a bunch of tables but the one that stores your page views and events is named events. If you want to test the data you are collecting, these are the steps you need to do:

adb shell
cd data/data/<>/databases
sqlite3 google_analytics.db
This last command will open the Google Analytics data base and once there you can see all the tables by executing .schema. So every time you record a page view or event a new row will be inserted in the events table. This table has a lot of columns but you can execute .schema events to see all of them and its data types so you can query the ones that you care about to test your application.

Happy coding.

Friday, April 15, 2011

Page Speed

Do you want to know how good and fast is our web site? Well this tool is for you Google Page Speed is a tool that fetches your site's contents ( HTML, JavaScript, CSS, images, etc) live, using a webkit-based renderer and gives the analysis it found and also recommendations split in high, medium and low. It also gives you a score where 100 is the best.

It is really good and it gives you detailed recommendations on how to improve and what to change to make your web site faster. One more thing that I like it is that gives recommendations for desktop and mobile which is good if you want to optimize your web site for your mobile users.

You can also use Page Speed in Chrome and FireFox and if you want to try new things you can configure mod_pagespeed in your Apache web server ( currently only working with version 2 ).

It is still in labs but really a good tool if you want to polish your web site and make it faster :)

Wednesday, April 13, 2011

Happy 20th birthday Linux

On April 10th Linux turned 20 and the Linux foundation created a video explaining its origins and how Linux has impacted us and the open source community around the world.

I started using Linux like 10 years ago. My first distribution was Mandrake 8.0 when installing used to take hours and depending on your hardware compatibility most of the things might work or not specially your graphics card, sound system and modem. It was a pain and at least 3 to 5 CD's depending on what you wanted but at the end used to felt good! :)

Now Linux is heading the server space. Most of the web uses Linux as primary servers and you can see it everywhere, mobile ( android ), in your TV ( TiVo, Google TV) , etc. I like Linux a lot I have a Ubuntu server in my apartment which let's me have access to my home network from everywhere. I wish i could use it more in my daily work but i do not see that coming :( at least I am trying to have it for my personal hobbies.

Here is the video i really recommended it it is really good. Enjoy it!

Sunday, April 10, 2011

How to enable fast scrolling in Android

Fast Scrolling in Android happens when you have a lot of items in your screen and you need to scroll fast. When it is activated you well see an small box coming from the right of the screen and when you drag it up or down it goes really fast. You can see this in your contact list, email or any application that has a lot of data and is sorted alphabetically.

There are 2 ways to enable this functionality in your application:
By adding the property in your XML layout file:

        android:fastScrollEnabled="true" />

or by adding it in your java code:


Both of them work the same the only trick is that you need to have at least 35 items in your ListView in order to see the fast scrolling box. You can see the end result in the image.

Hope it helps some one, happy coding :)