Translate

Archive for September, 2010

Bitbucket or Github?

Tuesday, September 28th, 2010

This week we have to make a final choice of what technology will be used to replace our somewhat big subversion repository (2 Gigs). Huge imports are beginning to be a pain and we’re tired of the .svn folders and not being able to commit if the central server is down. 

As time passed we become more paranoid and started making automated backups of the repo using good old rsync, so we’ve organically saw the need for a distributed option that can let us commit our work even if we’re online. 

The obvious choices are Mercurial on BitBucket or Git on GitHub. 

I’ve tried GitHub with the free account on open repositories, and I’ve tried Mercurial on my own since it feels a lot more home (command wise) if you are an old subversion user. 

If you’ve tried both of these services, I’d love to hear your opinion. 

http://bitbucket.org 
http://github.com

Posted via email from Angel’s posterous

Update: Bitbucket. During the week that I wrote this article Atlassian bought Bitbucket and offered free hosting. Also the tool is a lot more friendly to svn-brainwashed users like myself and our team. Couldn’t be more happy after switching to a distributed version control system.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Android: How to obtain the WiFi’s corresponding NetworkInterface

Sunday, September 19th, 2010

Let’s say for some odd reason in the world you do need to get the corresponding NetworkInterface object of the Wifi on your android, in my case I needed to have my WiFi device send multicast packets, and I wanted my MulticastSocket to only send packets through the WiFi device (not 3g, or maybe even ethernet). The android API does not provide functionality to know what “NetworkInterface” your WiFi is using.

Here’s a solution proven in tens of different android phones, seems to work 100%.

public static NetworkInterface getWifiNetworkInterface(WifiManager manager) {

    Enumeration<NetworkInterface> interfaces = null;
    try {
        //the WiFi network interface will be one of these.
        interfaces = NetworkInterface.getNetworkInterfaces();
    } catch (SocketException e) {
        return null;
    }

    //We'll use the WiFiManager's ConnectionInfo IP address and compare it with
    //the ips of the enumerated NetworkInterfaces to find the WiFi NetworkInterface.

    //Wifi manager gets a ConnectionInfo object that has the ipAdress as an int
    //It's endianness could be different as the one on java.net.InetAddress
    //maybe this varies from device to device, the android API has no documentation on this method.
    int wifiIP = manager.getConnectionInfo().getIpAddress();

    //so I keep the same IP number with the reverse endianness
    int reverseWifiIP = Integer.reverseBytes(wifiIP); 		

    while (interfaces.hasMoreElements()) {

        NetworkInterface iface = interfaces.nextElement();

        //since each interface could have many InetAddresses...
        Enumeration<InetAddress> inetAddresses = iface.getInetAddresses();
        while (inetAddresses.hasMoreElements()) {
            InetAddress nextElement = inetAddresses.nextElement();
            int byteArrayToInt = byteArrayToInt(nextElement.getAddress(),0);

            //grab that IP in byte[] form and convert it to int, then compare it
            //to the IP given by the WifiManager's ConnectionInfo. We compare
            //in both endianness to make sure we get it.
            if (byteArrayToInt == wifiIP || byteArrayToInt == reverseWifiIP) {
                return iface;
            }
        }
    }

    return null;
}

public static final int byteArrayToInt(byte[] arr, int offset) {
    if (arr == null || arr.length - offset < 4)
        return -1;

    int r0 = (arr[offset] & 0xFF) << 24;
    int r1 = (arr[offset + 1] & 0xFF) << 16;
    int r2 = (arr[offset + 2] & 0xFF) << 8;
    int r3 = arr[offset + 3] & 0xFF;
    return r0 + r1 + r2 + r3;
}
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Visions of the Future, No more screens.

Thursday, September 16th, 2010

Recent conversations about completely unrelated technologies with my friend Alden had me coming back to the blog so I can share with you some of my visions of what I really expect the future to bring one day in terms of technology. Some of these ideas will seem far fetched, but hey, dreaming is free.

I’ll be writing about these visions in posts to come, some of them I think I could even be part of right now to start changing the lives of millions, others I know are completely out of my reach. VCs and Entrepreneurs start taking notes and steal the ideas.

The End of Computer and TV Screens

I want to live in a world where I don’t need a computer screen to use an operating system or watch tv or movies.
I want to live in a world where there’s no limit in screen resolution, where I’ll be only limited by the capacity of my brain to process images.

I think the solutions will be implemented somehow (we’re thinking very high level here) in the following stages:

The Visual Stream will be “projected” first onto my retina, it’ll be part of a pair of sun glasses, or glasses. In the same device there’s also a camera and microphone that exists to read my arms/hands gestures and to interpret voice commands.

Months later they’ll come up with smaller, better technology that can be embedded in contact lenses.

You could achieve this stages, at first using an external device for processing the data, namely your smartphone connects to the Retina Projector Wirelessly. As technology gets better (maybe truly powerful nano-computing happens) all the processing could be done in the the glasses or contact lenses themselves.

Years go by and then it happens the way it should. The user interface and video streams are projected directly into our Brain’s Visual Cortex, all input from you (arms, fingers, facial gestures and maybe even thoughts) is read directly from different sections of the brain.

The applications would be amazing, content could be delivered directly to us, no need for computers or even a workplace. This would kill huge part of the electronics industry and would create a replacing technological field (brain processing units -> BPUs) so we get a better experience year after year.

If you’re currently working with a computer in an office 24/7, you could be doing that laying by a pool with your eyes closed not moving an inch of your body, yet being extremely productive or entertained. How many times I’m extremely busy but I feel bad that I haven’t gone to the gym or for a walk to get a little workout, I wouldn’t have to hold my smartphone and read that tiny ass screen, I could be walking and reading news, a book, or watching tv in a translucent screen the size of the sky if I wanted to.

There is be no IMAX theater screen that can match the size of a screen that’s as big as your imagination.

Stay tuned for more tangible visions on Brain Computer Interaction, and ideas for Smartphone software that we could be building today (had I the resources to do so)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


  • Categories

  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004