JS Ext

Friday, November 9, 2012

Mele Fly Sky Air Mouse

The Mele Fly Sky Air Mouse is a really nice device.  I have been using the remote for a few days on the MK802.  Being part mouse, part remote and part keyboard can get a little confusing for users.  One side of the Air Mouse is a full querty keyboard.  The other side is 1/2 mouse and 1/2 remote control.  When holding the device as a remote control, it is the perfect size.  It contains up/down/left/right buttons that you would find on a remote control.  The center button inside of the D-buttons is the mouse left click however.  Above the D-buttons are Enter and Back keys.  If you are using the D-buttons and want to select something, you have to use the Enter button, not the left mouse button.  I find it very counter intuitive, but you learn.

The Home button does not take you to the home screen.  The Settings button does open the settings menu, however.  The Volume up and down buttons to adjust the volume, but the Mute button does not Mute.  It is worth noting that almost every button that DOESN'T have a default action does get sent to the app.  In a future post, I will give out all the integer codes for the Air Mouse.  I was pleasantly surprised to find that the arrow keys worked in far more Android interfaces than I thought it would.  It is almost like the Android developers has some foresight that someone would want to use a D-pad to navigate.  This was nice since using the mouse took a little effort.

The mouse kind of acts like a WiiMote in the sense that waving the Air Mouse moves the mouse pointer.  It is not a pointer, though.  Just pointing to the icon you want to click won't work like it does on the WiiMote.  If I had to guess, I think the Air Mouse contains a gyroscope.  The gyroscope measures changes in pitch and yaw.  Yaw changes move the mouse left and right.  Pitch changes move the mouse up and down.  The hard part to get used to is the fact that the mouse moves based on the change of pitch and yaw, not the absolute value like a WiiMote.  For example, point a WiiMote toward the ground.  The tilt it up 45 degrees. Since you only tilted up 45 degrees, you are still mostly pointing toward the ground.  The Wii's mouse pointer won't move.  Now do the same thing with the Air Mouse.  The mouse pointer moves up!  It doesn't matter what direction the Air Mouse is pointing; the mouse will move based on the pitch and yaw changes.  It takes some getting used to, but I adapted pretty quick.  Another thing to note is altitude, roll and side-to-side changes do not impact the mouse pointer.

There are some pluses and minuses of this setup versus the WiiMote pointer style.  WiiMotes can get shaky when trying to select something.  The pointer drifts because most people can't keep their arms perfectly still.  For the Air Mouse, you will find that the mouse pointer doesn't have this shakiness.  If you are currently pointing at what you want to point at, it doesn't move away from it that often.  The Air Mouse only moves the mouse if you have changed the pitch or yaw enough.  This threshold is set frustratingly high, but I have a feeling it is set that way to prevent some of the jitters that the WiiMote suffers.  It does make it hard to select small buttons on the screen, however.

The keys on the keyboard were large enough to hit very easily, but the keyboard was a little too wide to type at a fast rate.  I think this was a design trade off with being a remote and a keyboard.  If they made the keyboard width smaller, then the remote wouldn't be as long and it might be a little awkward to hold as a remote control.  Because of that, I can't fault the designers for this.  I found the Shift and FN keys a little counter intuitive.  The Shift key acts as a standard Shift key.  It only makes things upper case if you hold down the Shift key while typing a letter key.  The FN key is a mode, however.  Every time you hit the FN key, it switches between the white and the orange keys.  This gets difficult when you are typing something that requires you to go back and forth between white and orange.  The FN key doesn't always work so you don't know which mode you are in until you type.  This can be deomonstrated by typing in a url.  You start with H, T, T, P in white, then Colon in orange, then Slash and Slash in white.

Overall, I am very happy with the device.  The one mouse has had slight problems that required a reboot (there is a small button to press on the side), but it hasn't happened often.  I have been able to navigate throughout most interfaces with ease.  I can switch between using it as a remote, a mouse and a keyboard to navigate, configure and use my Android TV.

Thursday, November 8, 2012

MK802: Accelerated MX Player

Update: The new MK802 III supports H/W decoding for all files

In a previous post, I mentioned how MX Player wouldn't use the H/W decoder in the MK802.  The Play store lists codec packs for MX Player but I didn't know which one to use.  On top of that, the codecs say not to install them unless MX Player specifically tells you to install it.  MX Player wasn't telling me which one.  Instead of trial and error, I decided to just try different players.  One of the  I tried was called aVia.  aVia Wouldn't use the hardware decoder, but a popup came up telling me to install the Arm V7 Neon codec.  I installed it and aVia started to use the hardware decoder!  A quick check revealed that MX Player had a codec with the same name.  MX Player started to use the hardware decoder.  The hardware decoder wasn't used for xvid files, but the software decoder was now fast enough to play the files perfectly fine on my 720P TV.  MX Player still won't play video well enough on my 1080 TV.

Wednesday, November 7, 2012

Reference Counting Garbage Collection

Reference Counting is a mechanism for garbage collection.  Every object gets a counter.  When you create the object, the counter starts at zero.  When the object is no longer in scope, the counter gets decremented.  When another object or scope gets a reference to the object, it increments the counter by one.  During the decrement phase, if the counter gets set to zero, then the object gets destroyed.  Because the object is getting destroyed, it decrements the counter for all the objects that it uses.  If any of those objects' counters reaches zero, then they are destroyed.  This chain reaction destroys all objects that are no longer used....or so you think.

Advantages:
  1. Objects are destroyed as soon as they fall out of scope.  This means the program does not consume more memory than the program needs
    • Heap sizes grow and shrink based on the programs need
  2. Garbage Collection runs in constant time, since you don't have to search for objects to destroy
    • No stop-the-world garbage collection cycles


Disadvantages
  1. Cyclic pointers are not supported.  Imaging the scenario where you have object A that points to object B.  Then, imaging object B points back to object A.  The counters for both objects will never reach zero since they will always have someone pointing to them (each other).  This is called a memory leak
    • History Note: This is why older versions of Internet Explorer had a tendency to consume all of your memory.  The DOM tree and the javascript object tree were managed with reference counting
  2. The counters require synchronization, so there is a performance penalty for all counter changes in a multi-threaded environment
  3. Allocating memory still requires searching for an empty spot large enough to hold your object, so allocating memory takes longer
  4. Because of reason #3, sequentially created objects tend to not be local to each other
    • Commonly referred as Swiss Cheese Memory!
    • Due to non-locality, there is an increase in cache misses



Tuesday, November 6, 2012

MK802: BubbleUPnP

Although BubbleUPnp seemed like a good DLNA app when I launched it, I quickly learned it was not for me.  The biggest problem I found right off the bad was the in-effectiveness of the Enter and Back buttons on my remote control.  I was able to use the Up and Down buttons to pick a folder, but when I hit the Enter button to go into the folder, it did not work.  The folder glowed for a second, and I was stuck there. I had to put the remote control into mouse mode and left click the folder.  Since this is critical for me, I decided to keep hitting the Back button until I was back into the Play store so that I could uninstall it.  Surprise number two was that the Back button would not let me exit the program.  It took me to the parent folder, but once I was on the app's home screen, I had to use the mouse to pull up the settings menu and select "Exit".  I have uninstalled the app.

Monday, November 5, 2012

USB Crash

One of the USB buses has crashed on my computer!  Devices can still get power, but nothing I plug in gets recognized by the computer.  I had 8 devices plugged in, but most of them were only for charging.  Only 3 devices were transmitting data.  Luckily two USB ports still work.

Friday, November 2, 2012

Missing a Terabyte

I'm a bit old school.  I am sad to say that I have been using fdisk for half of my life.  I can count on one hand how many times I have used a graphical program to partition a hard disk.  Imagine my surprise when I realized my 3TB hard disk only had 2TB free!  It turns out MBR partition tables don't support hard disks larger than 2TB.  To partition a bigger hard disk, you have to use a GUID Partition Table (GPT).  According to the Wikipedia article, fdisk doesn't support GPT.  I guess I have to learn a new partition tool.

Thursday, November 1, 2012

What is garbage collection?

When the iPhone 5 came out, there was a resurgence of the iOS vs Android debate.  In one of the comment sections of an article (I really have to stop reading the comments), an iPhone user argued that iOS is better because the Objective-C programs written use Automatic Reference Counting (ARC) instead of the "Garbage Collection" that Android uses.  As a Computer Scientist, my head almost blew up.

I know what the person was talking about, but it irritates me when it is used in arguments.  It may be nitpicking, but ARC is GC.  Garbage Collection means the developer doesn't have to explicitly delete any memory that they create.  It does not imply anything more than that.  Reference Counting is one implementation of Garbage Collection.  Mark-and-Sweep is another implementation.  The person was trying to argue ARC vs Mark-and-Sweep, but didn't know the term Mark-and-Sweep, or Generational Garbage Collection.  It was obvious the person didn't understand the changes in Java's Garbage Collection implementation since Java 1.1.  That is not unreasonable.  When teaching Garbage Collection algorithms, many courses stop at basic stop-the-world Mark-and-Sweep.  All the advances in Java's GC implementation are variations of Mark-and-Sweep.

My main problem with the comments in this thread was the person claimed ARC had no negatives while "Garbage Collection" had no positives.  The comments sounded like they came from a person that never had any formal Computer Science training and has never programmed for anything other an iOS.  In future posts, I will talk about some of the misconceptions around Garbage Collection and go over the long lists of pros and cons for each implementation.