Tuesday, April 16, 2019

Google Summer of Code - page behavior fix

Currently on https://summerofcode.withgoogle.com/organizations clicking one of the organization boxes makes a larger box with more information expand in the space below the organization box.  When that large box is dismissed, the user gets sent back to the top of the page.  I think the box should collapse, but position on the page should stay the same.

I tracked down the cause down to a line in the app.js.  As far as I could find, the original source was not publicly available, so I worked off of the minified version.  For clarity, I will prettify the code here:

OrganizationsListCtrl.prototype.deselectOrganization = function() {
    var orgList = this;
    orgList.selectedOrg = null,
    orgList.selectedOrgElement = null,
    orgList.selectedOrgIndex = -1,
    orgList.location_.hash(null)
}

Removing the highlighted line fixes the problem.

I am not really familiar with Angular, which is the framework the site uses, but from what I can tell, calling location_.hash() will cause an automatic scroll to an element marked with the provided value.  If that value is null, the automatic scroll is to the top of the page.

I will be attempting to pass this information on to someone involved with this page and see what happens.

Friday, November 17, 2017

Fixing 'VOC' testing on Windows

Over the Veteran's Day weekend, I was looking at the issue tracker for VOC and noticed several similar issues relating to testing on Windows. So I brought out a Windows (XP) machine, and set to work installing dependencies. Because it was XP, some of the components were not the most up-to-date.
  • Python 3.4.4 is the latest version build for XP.
  • Java 1.8 (u152) works, but warns loudly that it is not really supported on XP.
  • Apache Ant 1.10.1 is the latest, and seems to work fine.
  • Git 2.10.0 is this is the latest available for XP.
After getting these all configured, and the environment variables set up...
  1. The shlex module from ouroboros was failing to build. This was because of UTF-8 characters that were not being accounted for in voc\transpiler.py. I have submitted a PR for this, and it has been merged.
  2. I ran into an issue that appears to be a problem with the flush() in runAsJava. Once I dug down far enough to find the actual error, I found a StackOverflow question that pointed me in the right direction. Popen(['java'], ...) was picking up java.exe from C:\Windows\System32 instead of the one in the %PATH%, so I had to rename the former.
  3. Due to performing this work on an under-powered machine, I had to increase the timeout for calling 'ant java' from tests\utils.py from 30 seconds to a minute.
After this, I finally got to the issue that was being experienced by so many others. For test_str tests, Python was emitting a UnicodeEncodeError because it was trying to use the encoding 'cp437' and some of the characters in the test do not map. The Java version was emitting UTF-8 characters, and while the console doesn't understand that encoding and displays them incorrectly, it does not throw an exception. It is this difference which causes the tests to fail.

While Python 3.6 apparently gets UTF-8 working correctly, a work-around for this issue on earlier versions of Python is done by setting the environment variable PYTHONIOENCODING to 'UTF-8'. I have had a fix ready for several days but have only had a little time here and there to test it. I have submitted a PR and will just see where it goes.

Friday, October 13, 2017

Bitten by cdrkit bug

At work, I recently ran into a problem that I eventually tracked down to a bug in cdrkit.  This glosses over a few steps, but should capture the essentials.

A computer that, among other things, is used for burning DVD's recently made the move from RHEL (Red Hat Enterprise Linux) version 5 to version 7.  We realized shortly there-after that it was failing to burn DVD's successfully.  After some testing, we found that the same problem occurred on another box with the exact same model of DVD drive.

After confirming that the model of DVD drive would still write using RHEL5, I took the cdrecord binary from RHEL5, ran it under RHEL7, and it worked.  Clearly the difference was between cdrecord (from cdrtools, used on RHEL5) and wodim (from cdrkit, which is aliased to cdrecord on RHEL7).

I ran both through strace, and found that for fixating (finalizing) the disc, cdrecord was using a timeout of 1000 seconds, while wodim was using 200 seconds.  On the drive in question, fixating the drive takes about 240 seconds.  So with wodim, the timeout is hit, some diagnostic codes are dumped, and wodim reports that the fixate process failed.

Digging into source code, I found that one of Red Hat's patches for cdrtools was injecting a function (fixate_mdvd) that extends the timeout to 1000 seconds, calls the original cdrecord fixate function (fixate_mmc), and restores the 200-second timeout.

That Red Hat patch became part of the cdrkit fork, but additional changes 1 made in 1.1.6 interfere with it.  In cdrtools, the time-consuming part of the operation is happening inside of scsi_flush_cache, which is called by fixate_mmc.  The change in 1.1.6 makes an additional call to scsi_flush_cache from fixate_mdvd, before it extends the timeout.  This essentially negates the effect of the timeout change for Disk-At-Once sessions.  This 1.1.6 change appears to have been made to solve a Debian bug 2, but I don't see the evidence that it helped anything. Even if it did appear to help, it may have just been hiding the real cause.

I believe the 1.1.6 change to fixate_mdvd should be reverted to fix the present bug.  If the bug in the Debian report is encountered again, more rigor needs to go into determining the root cause.


1 It's hard to find code history for cdrkit, but the change can be seen here: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/gutsy/cdrkit/gutsy/revision/8/wodim/drv_mmc.c
2 Debian Bug #411362: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411362

Thursday, October 12, 2017

Book Summary: Do Over by Jon Acuff


While I'm only commuting 4-5 hours in total most weeks, I want to make better use of that time, and I am getting a bit tired of just music on the radio.  Last week, I decided to start with listening to Do Over by Jon Acuff, and because I'm no quitter, I just reached the finish line with it.  As indicated by the title, this is not so much a review, as just a summary to help me remember some key points.


The core of the book is about making investments into your CSA.  That would be your Career Savings Account.  The components of the CSA are skills, relationships, character, and hustle.  Any time you encounter a career transition, voluntary or not, a healthy CSA will be a valuable asset.

That old phrase "it's not what you know, it's who you know" speaks to the importance of relationships to your career.  There is a lot of truth to this.  You may think you can pull yourself up by your own bootstraps, but the world was not designed that way.  We all need each other.


The skills that you know are still important though.  Relationships may help you get your foot in the door, but without skills, you'll still have a hard time getting to the next one.  In addition to the technical skills we may think of, soft skills like showing up reliably, diplomacy, and flexibility are valuable.

Character is who you are.  It will bleed into everything you do and touch everyone you know.  Jon likens it to an orchard, as it takes time and constant tending to develop it.  You won't see the fruit for a while, but it will come.

Hustle will have an amplifying effect on the other investments.  Frequency is key to strong relationships.  Time and effort are essential to sharpen and build new skills.  Constancy is required to grow character.  Hustle is about putting in the time, and time is key.

With a healthy, diversified CSA, you will be ready for any career transition, whether that be breaking through a ceiling, making a jump, recovering from a bump, or taking advantage of an opportunity.

Monday, June 2, 2014

Google Play Books 3.1.49

I saw a Google Play Books update was available and decided to do a quick teardown.  The most interesting thing I saw was a new Offers activity.  I'm not sure exactly where it will show up, but here is roughly what it will look like:

Friday, November 22, 2013

Every. Single. Time.

The Play Store app is somewhat special among Android apps, in that it is updated silently.  Google recently updated their Play Store app to use the new drawer layout.  It has been rolling out over a several-week span.

When I got it a couple of weeks ago, I realized it only because the menu went from around six items, down to just two.  Fortunately, I had read that this update was coming, so I figured out pretty quickly that the other menu items had been moved to a drawer and all was well.

A few days later, my son couldn't find the 'installed apps' section.  I showed him the new drawer and all was well.

More recently, my elder daughter couldn't find the 'my wishlist' section.  I showed her the new drawer and all was well.

I know other cases of people encountering this little bump in the road.  On Google's Android development site, there is discussion about the relatively-new drawer pattern.  There is even discussion of how to introduce users to your app's drawer, so they won't be confused.  Too bad the Google Play Store app developers couldn't have paid a little closer attention to Google's developer suggestions.

Sunday, November 17, 2013

I'll Get Started, After My MTE...

C'mon Jon, I'm just starting chapter three and you're really pulling the rug out from under one of my stand-by excuses.  What do you mean I can start living with purpose today, without having 'found my purpose'?  See here's the deal as I've figured it to this point...

First you're supposed to plan out an extended weekend where you can get away by yourself.  Preferably it should be some rustic cabin in the middle of nowhere, so there are no distractions and you can be alone with God and His creation.  While you're there you spend a ton of time resting and praying.  You have a Mountain-Top Experience (MTE1) with Him, and somewhere in there he gives you a vision revealing your One True Purpose (OTP2) in this life.  Then you can start living life to its fullest.

I'm running out of excuses here Mr. Acuff.  Give me a break, will you?


1. MTE - I don't plan to actually use that acronym again, but the term is thrown around so much in Christian circles that it seemed to deserve an acronym.
2. OTP - Alright, you caught me. I just like acronyms.

Tuesday, November 12, 2013

Improving Android App Tear-downs

Every now and then, I've done app tear-downs a la Ron Amadeo (unpublished though).  My primary tools have been apktool and meld.  I noticed that sometimes there was a lot of noise in the smali folder from changing 0x7f...... literals.  I determined that this was happening because of changes in the resource ID mapping.  For instance R.string.xyz might map to 0x7f010001 in one version of an app, but map to 0x7f010003 in the next version.

So a few months ago, I wrote a small Java program that parsed the ID's in res/values/public.xml and inserted comments in the smali files where matches were found.  I could then add rules in meld to filter this noise out.  I wrote the program in Java with the thought of eventually merging it with apktool.  However, it has just set there.

A few days ago I decided to push it forward.  I contacted the apktool developers on IRC and decided that it should really be integrated with baksmali.  By putting it there, the comments could be generated as the smali files are generated, rather than inserted in a post-process.

Making the changes to baksmali was harder than I expected, but I finally got it working.  It is still a bit rough, but this morning I made a pull request via github.  If it makes it in, there will still be some work to do on apktool, but I believe the hardest part of the coding is past.  Hopefully app tear-down will soon be just a tiny bit easier for everyone.

Saturday, October 13, 2012

Wishlists in Google Play getting close?

A few days ago, a new version of the Google Play store app (3.9.16) started being pushed to Android devices.

I decided to dig into the APK, and discovered that work on the wishlist feature appears to be pretty far along.  I dug deeper and found a setting that could be modified to enable the feature.  I did so and here is what it looks like now:


Bringing up the menu/actions now includes a "My Wishlist" entry. Which is pretty sparse initially.


When you go to the page of an app (or movie, or music album, ...) that you don't own, a bookmark-like icon now appears in the action bar. Clicking that action bar icon changes the icon and pops up a toast message.


Now when you go to "My Wishlist", there is something to see there.

Update: After a little more testing I did find that upon clicking the app from "My Wishlist", de-wishlisting it, then hitting back, the app still appears.  Exiting and re-entering "My Wishlist" does update the list.

As far as the app goes, the feature looks nearly ready to go.  I have no insight into any back-end server or web site pieces that may be in the works.

Wednesday, May 4, 2011

Day Against DRM

While I don't have the desire to rant at length about DRM right now, I do feel compelled to make some mention of it on this "Day Against DRM". Others have explained very well the reasons to avoid DRM. This post, however, is a call to the big book-sellers to ditch the DRM.

Once upon a time, all songs in the iTunes store were clad in DRM. So I continued buying CDs. Eventually, Amazon started becoming a major player in digital music, providing DRM-free MP3's. While I would have preferred something other than MP3, I have purchased digital music from them. Around the time Amazon finally arranged deals with most of major labels, Apple started taking steps toward making the iTunes store DRM-free.

I recently purchased a NookColor eReader from Barnes & Noble. I am running a full version of Android on my NC, so I have access to the OverDrive app (for borrowing eBooks from the local library), the Nook app, the Borders eBooks app, and the Kindle app. However, I have yet to buy/borrow a single eBook from any of these. Make no mistake, I have bought eBooks, but only ones that are DRM-free. For now, it must be DRM-free or I will just look for a used dead-tree version.

Barnes&Noble, Amazon, and Borders: treat me like a responsible adult by offering the books I want DRM-free and I will buy them.

BTW, I have not yet bought any books from Christianbook.com, but I intend to. They have a good selection of books, both DRM-free and DRM-clad. You can refine your search to only show those that are DRM-free, which is what I do.

Friday, February 18, 2011

Linchpin

In reading Seth Godin's Linchpin I ran across several thoughts that really resonated with me.

In the chapter "The Resistance" Seth discusses many of the ways we sabotage our own success. In the section "This Might Work" he points out that often our problem is not fear of failure, but rather success. "Consider the argument that it's just as likely you hold back out of fear that something might work." As bizarre as this may sound to some, I admit that I have sometimes found myself captive to this very fear. Change is uncomfortable, even if it is for the better.

In the chapter "The Powerful Culture of Gifts" Seth compares giving gifts without v. with the expectation of getting. One statement really hit home with me, because I have thought much the same thing myself: "Consider the the family that exchanges cash at Christmas. If everyone is giving and getting the same amount, there's not much happening, is there?" I am getting more and more uncomfortable with the "I got you something so you owe me"/"You got me something so I owe you" way of doing things.

After finishing the book, I was considering how to summarize the book. My first thought was something along the lines of 'how to be a valuable commodity to whoever your employer may be.' Then I had to laugh at myself at how totally wrong that summary was. The very fact that I would use the word 'commodity' in the description bears witness to Seth's premise that we have marginalized employees to mere cogs in a factory. Perhaps it would be more accurate to say the point is to be 'invaluable' and NOT just another 'valuable commodity.'

Friday, January 15, 2010

Is Linux a Good Choice, Part 1


I recently read this response to someone advocating Linux in the comments for an article about Microsoft adding a rental option for Office and Windows:

"Linux is good for SOME PEOPLE (mainly extremely literate techies). For everyone else however, which is 90% of the people using computers, Windows is the best choice for them."

I realize many people probably think this, so I felt it a good opportunity to articulate some of my thoughts on this.

First, I am what some may call an 'extremely literate techie', and Linux is very good for me. But what about for those 'other 90%'? Am I being naive to believe that it would work well for many of them as well? Hear me out and let me know what you think.

What many of the arguments I have seen come down to is this: "What is the 'technically illiterate' Linux user going to do when they encounter roadblocks? They will encounter them." Yes, all systems are going to confound their users from time to time, so let's consider what the Windows user does when tackling issues.

1) Google it. They must be somewhat computer and/or Windows literate to perform a good search and wade through the results. There is not that much more to learn to perform similar good searches and wade through the results for Linux. Note that many 'extremely literate techies' do this, they have just gotten really good at it.

2) Ask a friend considered more technically literate. As long as they know one or two that are Linux literate, they should be good-to-go. Without this support, I can appreciate that getting started with Linux could be a little nerve-racking for some people.

3) Contact tech support. First, there are some companies that provide paid tech support for Linux. There are also many message boards that provide very helpful volunteer tech support, many of which are frequented by true Linux experts. Probably the biggest hurdle here is identifying the good message boards (refer to 1-2 for help with that).

4) Contact IT (if this is a computer used for work). Sometimes IT policy will not allow Linux, ergo Linux is not an option. Sometimes policy allows Linux, but the IT folks will not support it. In this case, refer to options 1-3. While there is almost always a way to make it work, sometimes the difficulty in making Linux work in these settings really can make it not worth the effort. You do still have a job to perform.

So the major issues we arrive at with this train of thought are social. They boil down to having an adequate support system, whether it be friends and/or an IT department. Soon I plan to post about some of the more technical issues that a Linux user may encounter.

Friday, January 1, 2010

Books 2009


At the beginning of 2009, I set a goal to finish reading 24 books in the year. Well, the 'deadline' has passed, and I am in the middle of what was to be #23.

While I didn't hit the goal, I am not discouraged, as I still read more than I would have if I had not set the goal. Also, I read a dozen non-fiction books, which is the same number I had read in the previous five years put together.

Though I have not set a specific goal for 2010, I believe I have really got the ball rolling with reading. I am currently working on Lee Strobel's Case for Faith. I also have a few books in mind already, such as Ted Dekker's Green, possibly one of John Eldredge's books, and a couple of books relating to software development. If you have any suggestions, feel free to share.

Monday, December 21, 2009

King of the Hill: Firefox 3.5

According to one web-stat site, Firefox 3.5 has surpassed Microsoft Internet Explorer (IE) 7 and IE 8 as the most widely-used browser by version. However, Firefox use as a whole still has a long way to go versus IE use as a whole. So why all the fuss?

Some web apps and such have long been developed and maintained for IE exclusively. However, supporting IE at this point really means supporting three browsers: IE 8, IE 7, and IE 6. They are different enough to need individual tweaking and testing. If Firefox 3.5 has surpassed all three, even briefly, it has become very hard to argue that anyone involved in web development in any capacity can reasonably ignore Firefox any longer.

Tuesday, June 30, 2009

First Things First

The primary author of First Things First is Stephen Covey, author of The 7 Habits of Highly Effective People, which I completed earlier in the year. The book is co-authored by husband and wife A. Roger Merrill and Rebecca R. Merrill.

This book does have a lot in common with 7 Habits, but it focuses and elaborates on different points. One focus is on four human needs: to live, to love, to learn, to leave a legacy. Another major focus is how we can use our four special human endowments: self-awareness, creative imagination, conscience, and independent will. Also elaborated on is weekly planning with a "Quadrant II" mentality, that is making sure we make time for the things that are not pressing and urgent, but are important none-the-less.

The four interdependent needs are required for continuing growth. "To live" is about the needs of our body, exercise, eating right and all that. "To love" is about our need for relationships with friends and family. "To learn" is about our need for keeping our mind active. "To leave a legacy" is about our need to connect with a higher power, and the deeper meaning of life.

The four endowments differentiate us as human. Self-awareness is the ability to step back and look at what we're doing. Creative imagination allows us to see many possibilities, other courses of action. Conscience is our connection to the deep principles and truths of this world. Independent will gives us the ability to act on the course of action we choose.

Quadrant II activities are those that are important, but not urgent. Consider preventative maintenance on a vehicle, so that it doesn't break down catastrophically later (requiring important AND urgent repairs). The same concept applies to all our life roles (spouse, parent, employee, etc.). A major aspect of Quadrant II planning is looking at the week ahead a setting aside times for quadrant II activities in each of our roles within that week. As an aside, someone has recreated the weekly planning form described in the book, in the form of a zip'd PDF.

While many of the pieces of this book are similar to those in 7 Habits, they have been put together into a rather different book. This is a worthwhile book, either by itself, or in addition to 7 Habits. Applying even a portion of this material could greatly increase one's effectiveness.

Tuesday, March 10, 2009

"Who Moved My Cheese?"

I was getting behind on my book-reading goal, so I decided to read a shorter book a few days ago. I read all of Spencer Johnson's "Who Moved My Cheese?" in a single day. A lot better than the last book I finished, that I had been reading on and off since 2006!

SPOILER ALERT
It is essentially a parable about two mice and two 'little people' in a big maze looking for cheese. The people became too accustomed to finding cheese in one place, until it disappeared. While the mice head off immediately in search of new cheese, the little people just sulk. One finally gets over it and starts looking for new cheese, and makes several important revelations along the way. This parable is couched within the story of a class reunion where the parable is discussed.

I would say the main moral of the story is 'change happens, go with it.' There are some other related lessons, though some of them feel a little 'psych-up', that attitude is everything. It emphasizes that change is good, but only gives lip service to the thought that some things really should not change. For instance, change away from a foundation of sound principles is something that should be resisted. I admit, the intended audience of this book is someone paralysed by the fear of change in employment or job description, not someone looking for their moral compass. For the intended audience, it is probably a good read, and is short enough to not be too intimidating.

While the author is no Aesop, it is fairly well written. Thankfully this book only cost me $1 at a book sale. The list price of $20 seems a little much, but the market price of $12 is perhaps fair.

Saturday, March 7, 2009

Finding & Keeping Good Friends

I have often lamented at how hard it is to find and keep lasting friends. A few months ago, I read one book in hopes that it would help. But Dale Carnegie's "How to Win Friends & Influence People" was really not what I was searching for. It was more a manual of tools and tactics, which could be used "for good or for evil." While I did learn a few things from it, I was looking for something deeper.

I believe I have found what I wanted in the book I just completed. Stephen R. Covey's "The 7 Habits of Highly Effective People" really hits to the heart of the matter. The section between habits 3 & 4 especially hit home with me:
We can often live for years with the chronic pain of our lack of vision, leadership or management in our personal lives.
Covey also speaks to those who would rely solely on tools such as Dale Carnegie's book:
That's when we try to treat the symptoms with quick fixes and techniques — the band-aids of the Personality Ethic.
While it is something far easier said than done, I will work on implementing the seven habits in my own life, to be come better independent and interdependent.

Thursday, January 8, 2009

Wacom Tablet

A co-worker was getting rid of some older computer items. I picked up a Wacom tablet. Plugged it in and it immediately started acting like another mouse input. That's nice but I at least want to get pressure sensitivity.

[BEGIN TECHNICAL STUFF]

In GIMP I found out that Edit -> Preferences -> Input Devices -> Configure Extended Input Devices showed me a "Wacom Graphire2 4x5" device. I switched the Mode for the device from Disabled to Screen. That got pressure sensitivity working, and the stylus can select drawing options distinct from the mouse.

In getting to this point, I discovered some people had the 'eraser' end working, so more work. I added to my xorg.conf, most of the code from comment #15 on http://ubuntuforums.org/showthread.php?t=61993&page=2. Restarted X, configured the additional devices in GIMP, and things work as expected.

[END TECHNICAL STUFF]

So I am now using a Wacom tablet with presure sensitivity, and an 'eraser'. It would be nice if I hadn't needed to edit the Xorg config file to get the latter. But as far as I can tell, this device is now fully functional in Linux. Oh, and the kids all approve.

Saturday, December 20, 2008

Another LiveCD Use

One Christmas present for one of our kids is a particular device that connects via USB. When I connected it to my (Fedora 10) computer, I expected it to bring up a file browser showing the files on the devices. No joy.

I try plugging it into Melissa's (Fedora 8) computer. The file browser comes right up. So I think I may have found a regression in Fedora 10. Well, not so fast.

Here's where the LiveCD comes in. I bring up both computers with a Fedora 9 LiveCD I had hanging around. Still, the file browser comes up on Missy's computer, but not mine. So it seems it must be something other than a difference in the OS. The LiveCD served to eliminate an unknown factor in my problem.

Now I just have to figure out more precisely what the cause is. Both machines use the same model motherboard, and other USB devices do work on mine.

Sunday, December 14, 2008

When 3V is not 3V

I thought the battery in my parents' new motherboard was fine. It said 3V on the battery. It read a hair over 3 volts on my multimeter.

Then I did a little research on lithium batteries, and discovered that even though the 'nominal voltage' is 3V, the 'open-circuit voltage' (what my multi-meter was reading) is supposed to be 3.7, on a full charge that is.

In case anyone is wondering, nominal roughly means 'in name only'. In other words, 'we'll call it one thing when it's really another'. For more examples of nominal, see pipe sizes in plumbing, which can be a little mind-boggling for a novice.