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:
LOAD DATA
  INFILE filename.dat
  APPEND
  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.

infile:[filename.dat]
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:
OPTIONS (SKIP=1, LOAD=10, ERRORS=5)
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! :)