Latest events and life changes

Perduta [Lost]

The last two months have been full of unexpected changes in my life. I no longer have a steady job, nor a personal relationship (I’m back to single status). Its been hard as the two changes came quite close to each other, so these last two months have been emotionally conflicting. But, as my grandfather used to say (translated from spanish): “to bad weather, good attitude”…it’s an awful translation, but what it tries to say is that whenever you are in bad situation, the only thing you should do is to have a positive attitude and move forward.

So that’s what I’ve been doing and turns out I’ve been enjoying life quite a lot, since I’m no longer stressed out with frustrations or pressures. Of course, there’s been some days of feeling scared of changes, and still are, but little by little things are coming up well, sometimes even better than I expected. Dealing with change, even though I decided to push things to change, has not been an easy task to handle.

I finally had time to finish and push live my first Django based project, a rewrite of the silly website http://www.sabesquemecaga.com (translation: what pisses me off): A 140 character website in the style of Fuck my life where you annoymously publish what pisses you off. Its a fun pet project that serves me as a learning tool for Django development and deployment.

I’ve also been working more on Emacs Identica-mode merging latest development changes into the main branch. Development has been more active than before and we have now more contributors sending patches and ideas. A new release will be published soon with lots of fixes and features, catching up with some of the Status.net 1.0 release changes as well (like highlighting “nameless” replies) . If you don’t want to wait for the “official” release, the master branch is what you’ll want to use.

Since I have more “free” time, I’ll try to update this blog more often. I guess my mind was not ready to open up and set my thoughts in text, but as I’m writing this (I actually forced myself to write today) it feels like a good exercise to organize my thought and put it in writing. So I’ll be experimenting with some blogging ideas I’ve been reading on Sacha Chua’s blog about Discovering Yourself Through Blogging making this space a reference for thoughts and events in my life additionally to the usual tech posting I enjoy doing.

Its funny to realize what you end up doing when you’re taken out of your life routine and start exploring different edges in life. These past two months I’ve ended up at a NASCAR race, an Off-road mud race, a bikini fashion show (as an expectator, not on the runway), and doing an audition for a beer’s nation wide TV commercial.

Let’s see what new events life brings in the next days. I’ve been meeting with a lot of old friends with whom I had lost contact and interesting plans are brewing up ahead. Meanwhile I’ll be working on some new web projects I’ve had stalled for years, hopefully one might become a profitable startup; also drinking more tea, meeting new people and hopefully ending up in more randomly, unexpected and weird but fun situations.

I’ll leave you with some videos I took from those events:

Photo Perduta [Lost] is Creative Commons by ecatoncheires on Flickr
Posted in personal | Tagged , | Leave a comment

New media reading habits on tablets and ebook readers

eBook reading

With the latest releases of ebook readers and tablet devices (iPad, xoom, galaxy tab, etc) reading habits are changing from paper based to digital in a faster pace than before.

I’ve been using my Samsung Galaxy Tab for reading a lot more. I enjoy more reading my social media updates (Twitter, Google+, Facebook) on this device than using my laptop. Sometimes I even prefer to use that device even when having my laptop in front of me. Maybe touch scrolling feels nicer than wheel or trackpad scrolling. I still don’t know what exactly it is that makes it feel better.

Broken Kindle

I once borrowed a Kindle from work and one day, right before a 6hr long flight, the screen got damaged. On that trip I wanted to try out travelling with only the Kindle and no paper books, so I was left without any reading material. It was a frustrating waste of time. The advantage of travelling light is no longer very attractive to me over the advantage of reliable reading material.

On the other hand, I’m also very concerned about DRM in ebooks and the volatility of digital goods. Being in a “third” world country, I’m not used to buying digital goods, since there hasn’t been much services available and many US based services are blocked or restricted. The good side of it is that with free software like Calibre, I can convert any PDFs I find into Kindle format easily.

Google Books

I am yet to try out the Google Books app in the tablet. I found a lot of excellent classic reading material for free so I can try before spending any buck like books from Jules Verne and Sir Arthur Conan Doyle.

The advantage I see on reading on the Kindle over reading on my Android tablet is that the Kindle is a distractions free gadget. On my tab I’ll get easily distracted with new email notifications, app updates, status updates, etc.

Some friends claim to be reading more now that they have a Kindle than when having paper books. While other friends who own an android tablet or iPad device tend to use their laptops less at home after work is done.

So I still wonder why is ebook reading on these devices more and more attractive lately. Is it because of the novelty of the gadget? Is there a real advantage or commodity over paper books or is it just techie fashion?

Posted in GNU/Linux Free Software & Open Source, personal | Tagged , , , , , , , , , , | 4 Comments

Samsung Galaxy Tab 10.1 review

Samsung Galaxy Tab 10.1 Limited Edition at Google I/O 2011

I got the Samsung Galaxy Tab 10.1 Limited Edition at Google I/O in May. Its now mid September and I’ve been wanting to give it some use before giving an opinion about it and review it.

The technical aspects

  • Big display of 10.1 inches.
  • Its got a fast processor, applications and games run very well.
  • Honeycomb is a nice operating system.
    I couldn’t imagine this device with the Samsung Touchwiz that comes in the Galaxy S phones and the previous tablet. Its horrible! This one came originally with 3.0, which crashed applications frequently and had some bugs like not being able to change the clock’s timezone after setup. Now I understand they come with 3.1 by default. I’ve done the upgrade and its a lot more stable and smooth.
  • 32GB internal memory, but no expansion slots.

One feature that I haven’t heard much talking about is that Honeycomb has a very nice security feature: it allows you to encrypt the whole tablet. I hope this feature makes it into Ice Cream Sandwich because its a lot more needed on the phone. I guess loosing the phone is more common that loosing a tablet.

The uses

So far I’ve used it to watch videos on Youtube, playing Angry Birds and trying out some other games since the screen size is a lot more comfortable for gaming. I’ve been using it a lot for reading links from social networks, blogs and generally all my RSS feeds. It has become my casual browsing and social media device. With its big screen size and low weight its ideal for “couch computing”.

I bought a small generic base for it and some cheap desktop logitech speakers to put it in the kitchen counter to listen to music or watch and hear conferences, videos and South Park episodes while cooking or washing dishes.

Apps

Although there are still many apps that haven’t upgraded their interfaces for tablet display using the latest Android toolkit, the ones that do look great. Here are the apps I’ve been frequently using on my tablet:

  • Plume for Twitter updates
  • Pulse for news and RSS feeds
  • Gmail, this app has been optimized to look beautiful in the tablet
  • Google+ is not optimized for tablets but its UI layout is okay
  • Mustard for my Identi.ca microblogging updates is not optimized for tablets
  • Google Music in combination with external speakers or my home theater its a great music listening device
  • Google Talk, video chatting from the tablet is very comfortable and handy
  • Youtube
  • Google Reader with its recent tablet layout version is now much more enjoyable to use

The downsides

  • Known factory defect of the corner glue. Haven’t heard of the issue on the new retail models.
  • Lack of apps optimized for Honeycomb and general tablet layout
  • Low sound I don’t know if this is true to all android devices or just Samsung ones, but when I use external speakers with the Galaxy Tab 10.1 or my Samsung Galaxy S phone, the max volume is still low (even more with Flash videos) compared to when I plug in an iPhone or iPod device (even with Rockbox) on the same speakers.

Final thoughts

I’m glad to have it. I like playing with it and having it around, its a handy device, but it is not a computer. I wouldn’t spend that much money for a gadget like this, but my mexican economy is not the same as the one from a “developed” country. But even then, gadgets here in Mexico cost twice as much (the first galaxy tab is $800 USD plus a two year contract).

I hope in the future prices will drop to netbook level prices (~$300 USD) and more interesting apps emerge optimized or made specifically for tablets on the android platform.

Do you have an android tablet device? I’d like to know how other people are using their tablets and what apps they recommend to get the most out of it.

Posted in GNU/Linux Free Software & Open Source, personal | Tagged , , , , , , , , , , | 1 Comment

Easy PHP code test development with SimpleTest unit testing framework

Simpletest, Unit Testing for PHP

Testing is a task every developer has to do eventually on any programming project. You can do it manually after writing all your code to see if it works as you intended, or better yet, before writing your code, using test driven development techniques that will save you time and frustrations down the road. One of those techniques is called Unit Testing.

Ideally, unit testing takes place before writing any code. Its a way to plan out how your functions, classes and objects will behave. The basic idea is that you plan the outcomes of each part of your program, then you write those parts to provide that outcome. So think of it as a black box that you will give some input and expect some output. This way you know how objects will be organized, what methods to write in each class, what needs to be their input and how are they going to output the results. Having all your code in tests will help you add new features, change or refactor parts of your code faster without the fear of breaking something else in your software. If you changed something and all your tests still pass, you’re good to go, if not, you can easily track down where the error is and what got affected.

PHP is famous for having spaghetti code and being too flexible that you can mess things out pretty fast, specially when you’re not an experienced programmer, or you have a team of developers with different programming styles and experience working on several components of the same project.

Although there are several unit testing frameworks for PHP, I’ll talk about SimpleTest since its very light, easy to install and easy to learn. Also, if you’re a Drupal developer, its the testing framework of choice.

Setup

To install it, go to the Simpletest download page and get the latest version. Extract the files to your PHP path, or use require_once() calls to the autorun file:

<?php 
require_once('simpletest/autorun.php');

Usage

Here’s an example of a class’ tests (testfile.php):

<?php
/* SimpleTest framework 
 set the path to where your simpletest folder is located.
 in this case, its in the same directory as the test file */
require_once('simpletest/autorun.php');

/* The class file I want to test */
require_once('myclass.php');

class MyclassTest extends UnitTestCase {

    function testGetList() {
       /* Create instance of class */
       $obj = new MyClass();

       /* call method to test */
       $result = $obj->getList(5);

       /* test result is an array */
       $this->assertTrue(is_array($result));

       /* test correct number of output elements */
       $this->assertEqual(count($result), 5);

       /* make a different call with different parameter */
       $result = $obj->getList();

       /* confirm that output is always an array, even with 0 elements */
       $this->assertTrue(is_array($result));
    }
}

Now you have a basic skeleton of you methods and their behaviors, now you can go ahead and write the real code (myclass.php).

<?php   
class MyClass {
   /**
   * Create a list of numbers
   * @param integer $size The number of elements of the list
   * @return array The list of numbers
   */
   public function getList($size = Null) {
       $list = array();
       if(!$size) {
           return $list;
       } 
       else {
           for($i=0;$i<$size;$i++) {
              $list[] = $i;
           }
       }
       return $list;
   }
}

Run it

Once we’ve written the class, we can test out its methods by running our tests script. You can do that by using the command line, or by viewing the php script in a browser window.

Personally, I prefer to use the command line for convenience and faster testing without needing even to setup any web server. Running it will look like this:

$ php testfile.php 
testfile.php
OK
Test cases run: 1/1, Passes: 3, Failures: 0, Exceptions: 0

Do more

This is a very small and simple test, but you can also test out the interface of your project. SimpleTest has a browser class that can perform some events like simulating browser visits, doing clicks on your interface’s links and checking the HTML structure of the web server responses.

Check out the full documentation, which is very easily laid out as a big tutorial, and start testing all your code!

Posted in GNU/Linux Free Software & Open Source, Programming & Web Development | Tagged , , , , , , , , | Leave a comment

Upgrading Samsung Galaxy S from Telcel to Darky’s Rom v10.1 with Android Gingerbread

This upgrade took my whole Saturday so this post might save you a lot of time searching through forums to get the Darky ROM 10.1 on the Samsung Galaxy S. My phone came originally with a ripped off version of Samsung’s official 2.1 Eclair Android release, since Telcel, the main carrier in Mexico, removed all the google apps and replaced them with Yahoo! and Bing alternatives. So I’ve been using Darky Rom which is based on the 2.2.1 Froyo release. Now that Darky has recently released its 10.1 version, based on the 2.3 Android release, Gingerbread, I wanted to give it a try and do my upgrade.

So to install this version of Darky ROM, you need to have Ficeto’s JVH base ROM installed first. If you already have that, you can then follow the simple step by step guide. If not, like me, you’ll need to flash Ficeto’s JVH using Odin (MS Windows only) or Heimdall.

In the case of my phone, turns out that my carrier Telcel has modified the Sbl.bin file (secondary boot loader) and I cannot install this as easily since Odin will stop flashing at Sbl.bin and will not continue any progress. If this is your case, the way I solved it was using Darky’s ROM Resurrection edition. Flash it using Odin or Heimdall, then flash Ficeto’s JVH base ROM, finally follow the step by step guide to install Darky’s ROM 10.1 using ClockworkMod’s Rom Manager or the Darky ROM Configurator app.

Another tip: Even the guide says you don’t need to wipe the cache or data, I always find it better to do so. When I don’t, I get either lots of apps crashing upon booting the phone, or I can’t make any calls; they get cut off (hang up) before I get the first ring. So backup your apps and data with apps like Titanum Backup and do a wipe of both data and cache. Also remember to do wipe battery stats and flash the new rom with a full charge for better battery life.

Posted in GNU/Linux Free Software & Open Source, Tutorials & Tips | 4 Comments

Change your default browser to Chromium in Debian and Emacs

Chromium Logo

The web browser is nowadays the most important and frequently used tool in a computer. Recently I’ve been using more the Chromium browser than Firefox, on in Debian’s case, Iceweasel. This is for several reasons:

  • Better memory management (doesn’t eat up all my RAM)
  • Extensions are also available for Chromium
  • Faster browser startup
  • Faster page loads
  • Full HTML5 support, which is lacking in Debian Wheezy’s Firefox (err… Iceweasel) which is still on version 3.5.19 at the time of this writing.

So I decided to change my default browser to open in Chromium for all applications. To do the change, at the terminal, type:

sudo update-alternatives --set x-www-browser /usr/bin/chromium

and

sudo update-alternatives --set www-browser /usr/bin/chromium

If you’re using KDE 4 you also need to open the System Settings, click on Default Applications, Select Web Browser and choose the second radio button option so it reads: “Open http and https URLs in the following browser” and type “chromium” in the text box. Click the Apply button and close the window.

Since I do almost everything with Emacs, I also needed to configure it to use Chromium as its default browser. To set that, you just need to add the following to your .emacs file:

(setq browse-url-browser-function 'browse-url-generic
      browse-url-generic-program "chromium-browser")

I still love Firefox, but it has staled away from the cool minimalistic and fast browser it was when it started. Chromium is now filling that gap, so I hope that in future versions (maybe the new Firefox 5?) memory handling gets better as well as loading times.

Posted in Emacs, GNU/Linux Free Software & Open Source, Tutorials & Tips | Tagged , | 6 Comments