Why not store numbers as diff of previous number?

This morning had a thought. We store numbers in a fixed sized memory space. So if we use four bytes to store numbers we would need eight bytes to store the numbers 5 and 6. But, what if we store 5 in four bytes and then 6 in two bit, as a delta? The bits can indicate +1, 0, -1., here an increment of the 5 by one. Larger increments would use more bits of course. Thus, we naturally get compression.

Subject areas: mobile computing, Internet of Things.

True, this wouldn’t work as a ‘live’ memory storage, the I/O would be complex. Or would it? In constrained devices such as Wearable Computing, for example, a smart watch, or in an Internet Of Things remote device, memory limitations may require compressed storage.

As usual, this is not a new idea. It is related to “Delta Encoding” or “Data differencing”. An interesting article on how delta coding could be used for compression is “Effective compression using frame-of-reference and delta coding”.

I have not seen this delta encoding memory approach mentioned anywhere yet.


Mobile music briefcase using BitTorrent Sync

Streaming, cloud, social, …. Nice stuff! But, what if your behind a firewall and have to rely on the local storage on your mobile device? I was thinking on how to solve this situation, a listen later briefcase.

Use Case

  • You want to select music files to listen to on a device.
  • Costs, Security, and bandwidth limitations preclude streaming.
  • Security will not allow use of thumb drives and other ‘attachable’ devices.
  • You should be able to delete these files.
  • Removing them should not delete the original files.
  • These files should be quickly and securely transferred.

This approach is just a modern version of the “CD storage case” we used in the old days to store some tunes for the long drives.

One way of implementing this is using BitTorrent Sync (BTSync). Basically we create a “briefcase” folder where we will drop copies of what we want to listen to later. To make this easier to follow, I’ll use the origin as being a Desktop PC. We also create a folder on our mobile devices that will be synchronized with the other folder. BTSync will handle the process of keeping these folders in sync. And, since BTSync is so fast, the sync will happen as the files are dropped on the briefcase folder.

    PC                          Device
+--------+     +---------+     +-----+
| Music  | === |Briefcase| ~~~ |Music|
+--------+     +---------+     +-----+

Though mobile example is used here, the device could be anything, even an automobile with advanced music system. While it is parked in front of home, it could be “charging” on some tunes.

How to setup
1. Of course, you have to first have BTSync installed on both the PC and the mobile devices.
2. Then on your PC run BTSync and choose “Add folder”.
3. Click ‘Generate’ button to generate a secret key.
4. Click ‘Browse’ to navigate to the folder to use as the Briefcase. (I used “Music-BTSync” as the name).
5. On mobile devices create a folder that you want to use as the listen later storage. (I created a “Music-BTSync” on my external SDCard).
5a This folder must be accessible to your mobile music player application.
6. On your mobile device run BitTorrent Sync and choose ‘Add Sync folder’.
7. Use the folder created above.
8. Now we have to get the secret read only key from the PC to the mobile device.
8a. On the PC, share the “Briefcase” folder. By using the mobile option, you can generate a QRcode.
8b. On mobile device, scan or enter that key.
9. On the mobile device, on BTSync’s list “MY SYNC”, the new folder should be listed (mine was music-BTSync).
10. Click the settings sprocket to the right of it.
11. Check on “Automatic sync”

Loading: Just copy an mp3 into the Briefcase folder on the PC. It should immediately be copied to the mobile device. With a File app on the device you should be able to see it in the sync folder.
Deleting on PC: Delete the file from the Briefcase folder on PC. It should be deleted automatically on the device.
Deleting on Mobile: Load another file on PC, it gets copied. Now delete that file on the mobile device only. It should remain on the PC. This is because of the use of the ‘Read only’ secret key. To change this behavior, do the sharing using a regular secret key.

This where the problems start. The ability to access and automatically refresh a changed folder varies among portable music player apps. Some like Google Music Player, for example, doesn’t even expose the concept of file folders and other nice to know configuration settings. Poweramp is better in this regard, with some prodding it recognized the new synced files. Still looking for a player that will behave with this sync process.

Various music apps have ways of using caching to store music. They also have various sync capabilities. However, these could be difficult to use in this scenario. Plus, the various parties are trying to monetize content, so optimizing the use of your private music collection is not a great concern.

Does it work?
This morning I put gigabytes of music on a folder on my PC, BTSync synced it to my phone. Now I’m listening to Black Sabbath and Barry White at work. How cool and eclectic is that?

Microsoft Windows used to have a Briefcase feature. It was removed in Windows 8. This was a limited two-way file synchronization process. With BTSync, there can be many folders in sync. For example, multiple mobile devices can sync to the same PC or home folder.

Tested on
Galaxy Note version 1
Android 4.1.2
BitTorrent Sync v1.3.21.0

Windows 7 64bit
BitTorrent Sync 1.3.94

Related links

Speed up Android home screen display

I followed the suggestions in “Speeding up the Samsung Galaxy Note” which worked, but now a new problem: after pressing the Home button, the ‘desktop’ takes very long to show the icons. This is on my Samsung Note (original) i717 with Android 4.1.2, on AT&T network.

Searching I found that many were blaming the lack of memory.

What I did
Using the SystemPanel Lite app, I saw that there were a bunch of apps in the Inactive (Cached) Applications list. I closed these. Now the home screen pops up a little quicker.

I don’t think it is just a memory issue. Something is wrong with this OS version on my phone. More likely the caching system needs a major revisit. Are the latest versions of Android any better?

SystemPanel Lite version 1.3.1

So What” by Miles Davis from “Kind of Blue

Double tap to widen a column for reading mobile text

Instead of resizing the screen in order to read a column of text, just double tap on a paragraph of that column. The column will then widen to full horizontal width of screen.

Most web pages are composed of vertical columns with ads and other features on the side columns; the main text is on the center line. Thus, the double tap works most of the time. Even when it works, there still may be a need to drag the page to reposition the newly expanded column.

I don’t know how common this ‘gesture’ UI feature is. Do all browsers running on Android or iOS phones have this capability? They probably have some version of a “smart zoom”.

Tested on Samsung Galaxy Note and Galaxy S3.

The tricorder gets approved

The F.D.A. will now regulate mobile medical devices. However, only devices that can cause potential risks to patients.

This is an important step as industry moves toward the creation of the Medical Tricorder. One concern I have is that “harm” could be misjudged here. Sure a mobile electrocardiogram device should be regulated, but what about the data that this device generates? Is that up for grabs by social-economic machine, i.e., Google, Facebook, Twitter? Should medical devices conform to HIPAA and other regulations?


Will first generation Samsung Galaxy Note get Android 4.4 KitKat?

Consensus from scanning news and web search is: NO!

Latest news: According to this article, Samsung has officially said that 1 GB RAM is not enough to run the Android KitKat version. The article further theorizes: “we will point out that KitKat runs fine with that amount of memory only on stock Android, which does not have any of the added features or bloat that Samsung (and other non-Nexus phones come with.)”. Ah, bloatware.

What if could have meant
If it does though, this coming Android version, KitKat, is good news. KitKat is supposed to bring some welcome capabilities for older devices. There is already something from Cyanomod, “Note 4.4 Rom review of CyanogenMod 11.0“.

The Aging original Samsung Galaxy Note is a very good high tech device. This thing has enough compute power that could have guided businesses, spacecraft, and whole cities in the past. There is no reason why it can’t be upgraded to be useful for another few years.

Would it really have made a difference?
Will Android 4.4 really allow Samsung to improve performance, as reported here, Android 4.4 KitKat Top 5 Optimisation for Samsung Galaxy S4, S3, Note 3, Note 2 and other Galaxy Devices? Or will that performance, if any, will be gobbled up by the Bloatware already installed?

Jelly Bean upgrade mess
However the recent upgrade of the original Note device to Jelly Bean has apparently had many negative results. “AT&T Galaxy Note Jelly Bean Problems Continue: Lag & Battery Life.” It made the Galaxy Note unusable! Since this is an official upgrade I’m surprised there isn’t a class action lawsuit or some negative press about it.

According to “Samsung Galaxy Note First Gen Won’t Have Android 4.2, 4.3; Android 4.4 Will Grant New Life Cycle“, KitKat will support older devices that have hardware or memory issues. A list of devices is given here, “Android 4.4 KitKat OS: 13 Samsung Galaxy Phones, Tablets Getting New and Fresh Life Cycle“. Another article confirms that Galaxy Note 1 will not get the update.

Android 5?
Is Android 4.4 just 5.0 re-branded, or another release added to the pipeline? Whatever happened to the concept of the using “Google Play Services” to update the OS, as mentioned in “Balky carriers and slow OEMs step aside: Google is defragging Android“?


BitTorrent Sync on mobile

Just tested the new free file share and sync software from BitTorrent Labs, BitTorrent Sync. I shared files between my home PC and my mobile phone, Samsung Note. It works and was easy to set up and use.

Installed on Windows 7 PC. Copied some files onto the shared folder. Installed BTS on Android phone. Added a new folder to share. On PC copied the secret code (a very long alphanumeric string) to the BTS running on the mobile phone. Saw the files from the PC. On PC copied a new file into shared folder. Saw that file on mobile device. Sweet.

One thing I noticed is that if you turn off WiFi you lose connectivity. I saw no settings on the mobile device for turning on 4G use.

You can read all about BTS on their official site or search web. In a nutshell it allows you to share your own files among your computer and devices without using a central server. What that gives you is security, privacy, speed, and no size limits. No cloud. Note that this is still in beta mode.

Corporate issues
Of course, this gives another avenue for corporate information to be compromised, by Bring Your Own Device (BYOD) initiatives, or just careless use.

The number one alternative is DropBox, of course. One of many advantages of DropBox is that it doesn’t require that both devices sharing files are turned on and connected. But in “Roll your own Dropbox with BitTorrent Sync on Amazon EC2” Sam Glover shows how to use your own server to do this. He shows how to use the Amazon EC2 system. If you run own home based server, it of course would be much easier.

Further reading

The new mobile device?

More people use a smartphone and now depend on it. Mobile computing is now phenomenal growth industry with many companies trying to define and control the market.

Human factors
However, smartphone screen size and other human factors are now becoming limitations. I was reading “10 worries IT won’t have in 2013” and the author wrote: “Apple could release an iTurd and the faithful would still line up for it. Personally, I need a bigger iPhone screen ….” This captures the issue in a nutshell. I see this “need” expressed when someone jokes about my “brick”, yet they have to go back to those tiny little itty bitty screens and squint just to read even the headlines of a news page.

Larger Screen size
One of the ways the market is trying to address this problem is with slightly larger form factors. One of the first successful larger phones is the Samsung Galaxy Note and the forthcoming Note 2. This phone defined the “phablet” form factor. Is a 140.9mm (5.5″) screen the answer?

There are now three main hand set sizes:

Model inches metric
Apple iPhone 5 4.87 x 2.31 123.8 x 58.6
Samsung Galaxy S III 5.38 x 2.78 136.6 x 70.6
Samsung Galaxy Note II 5.94 x 3.17 151 x 80.5

A visual representation is available at many sites; search for “mobile phone visual size comparison”. There is an inverse relationship between usability and mobility, the smaller the more mobile, the larger the more usable. So, is there no perfect size? No. But, there are other ways to implement mobile computing.

Alternative Mobile Computing

1. The separation of interaction from the mobile device. The main role of the mobile device is as a server for other task specific devices. In future, head up displays (HUD) will be the dynamic mobile interface. This is not a new idea; it has been in the science fiction literature for decades. The tremendous power in modern devices makes this possible. But, when not moving, and more precise interaction is required, the mobile server can use a built-in projector to display larger interfaces. And, when secure and private interaction is desired, the mobile device unfolds into a larger screen size, the phablet form factor.

In this model, the ‘mobile device’ is the expensive “server”. The other devices are lower cost and purchased and carried when needed. Yet this is still ‘stone age’, it is like carrying around a giant wooden club while hunting for food.

2. Ubiquitous computing. This concept by Mark D. Weiser while at Xerox Palo Alto Research Center (PARC), the same ones who ushered in the modern GUI phenomenon. Instead of carrying a computing device, one interacts with an “internet of things”. The surfaces and devices we use in our lives are virtual extensions of our network aspect. Our operating system and profile will be securely available wherever we need it. This is a direct rejection of hardware ‘silos’ and how they attempt to monetize that lock in.

This new form of computing will rise as the proprietary mobile platforms start becoming low-cost commodities, and are seen as dumbphones.


  1. Despite a Slowdown, Smartphone Advances Are Still Ahead
  2. What comes next after smartphones?
  3. Smartphone of the future will be in your brain
  4. Ubiquitous computing
  5. Mobile computing
  6. Note 2
  7. Samsung Galaxy Note II, With Android Jelly Bean, Demands Attention
  8. 10 things you needn’t worry about in 2013

How to Measure User Interface Efficiency

My frustration level reached a peak while using a mobile phone.  So, again, I’m thinking about GUI design.  Why are the interfaces so bad and how to fix them?

First step is just figuring out how to measure the badness.  There are plenty of UI measures out there and many papers on the subject.  BTW, I’m just a developer grunt, coding eight hours a day, so this is out of my league.  Yet, the thoughts are in my head so ….

To get to a goal takes work.  In physics, W = Fd.  Work equals force times distance.  No direct correlation to user interface.  But, what if W is equal to user interface element activated times number of possible objects to act upon, i.e., W = U x O.  Work equals UI force times number of options.  This ‘force’ is not a physical force or pressure, of course.  It is a constant mathematical value.

Example, you click on a button and then you are confronted with a choice of five options.  Lets say you are reading a web page and you want to share it with someone.  This takes too much work, way too much.  Even getting to the sharing choice is monstrous; click the menu button, click share, find which method of sharing, get to contacts app, blah blah.

So, here is what we have.  Activating a user interface element is a force; each type of element is given a constant value, a button is 10, a scroll bar is 100, and so forth.   The number of options that results and is relevant toward the end goal is the ‘distance’.

Now you divide this resulting value by how much time it took you to get there and you have Power.   P = (U x O)/T. (Update 7/26/2013: Probably a better dimension is actual distance of pointer movement or manipulations).

Add these up for each step in completing the goal and you have a metric for an interface user story.

Why use the number of options for distance?  The number of options presented to the user is stress. Kind of related to Hick’s Law, “The time to make a decision is a function of the possible choices he or she has”. If computers and software were not in the 1960s (face it modern stuff is just fancy screens) they would know what the hell I want to do.

A follow up post will give the solution to this User Experience Design (UXD) or Interaction Design (IxD) problem, and the solution is actually pretty easy.


Created the follow up:  Proactive Interface

Related Posts


Samsung Note and Android 4 upgrade worth it?

Finally Android 4 Ice Cream Sandwich (ICS) is available for the AT&T version of the Samsung Galaxy Note i717 and Galaxy S II. Is it worth the upgrade? I was hesitant to run the upgrade. What if it didn’t work? What if it lost my stuff?

I followed the instructions at: AT&T Cell Phones: How do I update my Samsung Galaxy Note to Android 4.0 Ice Cream Sandwich? Essentially you have to download the Kies application to your PC or Mac and connect your phone to the PC and follow the process. Of course, you should back up your data using the Kies backup system.

My first download of Kies was damaged. So, I downloaded it at a different time period. Then the first use of the backup was extremely slow. I cancelled it. The next day the backup attempt was extremely fast. Hmmm. The Kies app has a lot of critics on the web. Oh well, its free.

But, then you have to update the Kies app on the PC/Mac. Then when you restart Kies, connect the Note to the PC with USB cable (wifi works for upgrade?), you can select the update option for the phone. Of course, this takes long if you watch it. On Windows 7, you have to stick around to respond to the security prompts. Eventually, after very confusing messages on the Kies, your phone will do its thing and be ready.

Of course, some things will change and certain settings will be gone. The above link gives you the list of what changes, for example:
“Application Menu: The application menu sorting, folders and home keys will be reset. Downloaded applications will be preserved.” Fortunately, ICS makes setting the screens so much easier.

Why upgrade?

  • Faster
  • Smoother
  • S Pen lag is gone!
  • Hard to tell, but when playing music, the sound seems better

Yeah, there some productivity suites enhancements and all that. And Android 4 has UI improvements and new features. What I noticed though is the speed. I can scroll web pages so fast it is a a blur. Also, the S Pen is now usable. Well, you could use it before, but on my phone the lag was annoying. Maybe I’m imagining it, but even the Swype keyboard is faster too.

Wikipedia’s list of features in Android 4.0.x Ice Cream Sandwich.

PC: Windows 7, AMD quad-core
Phone: Model SAMSUNG-SGH-I717
Android: version 4.0.4