Tuesday, August 5, 2014

Some Bits on Binary Packing and Holding Broken Packages

The first part of my day was spent on binary packing in Python. When using this feature to share objects between languages, you pack the structure/object into binary and deliver it with instructions for how to parse or unpack it. The format of the instructions will look something resembling this:

self.fields = "5i41sxxx"

where the structure is comprised of 5 integers followed by a 41 bit string followed by 3 null bits added for padding to make the structure add up to a total of 64 bits. My current task on the OHM was to add the {t} variable to this binary structure. Misunderstanding, I added the length of the 5 bit string to the existing 41 bit string. However, I learned that, unlike for the 5 integers, 46s would be treated as a single 46-bit string (logical but not obvious to me at the time). Instead, we opted to insert a second 5-bit string before the padding (which was increased to a total of 61 to increase the size of the binary structure to a nice, even 128 bits.)

Later that day, I spent a lot of time searching for solutions to an installation problem I was having. My updater was howling about need to update the firmware. My initial attempts were met with a strange error about having "help broken packages" (which drew up a most disturbing mental image). After lots of searching, I finally found a helpful post on AskUbuntu which described in detail the steps needed to clear this error. After typing:

sudo apt-get install xserver-xorg-lts-precise
hwe-support-status --verbose 
sudo apt-get install linux-generic-lts-trusty \
xserver-xorg-lts-trusty libgl1-mesa-glx-lts-trusty \ 
linux-image-generic-lts-trusty

TBH, though, I kind of wish that I hadn't updated because now Spotify won't run in my browser and the delete key fails on a long press. Google's suggested search when searching straight out of the address bar is malfunctioning as well. Something good will come of it, though. I'll have some fresh learning to write about tomorrow night!

No comments:

Post a Comment

Comments? Questions? Complaints? Coladas?