All about embedded systems engineering.

Main menu

Post navigation

Lately, I’ve been getting a lot of notification messages about new users joining this blog. I just checked the numbers and WordPress tells me that there are 7,264 of you out there in cyber-space. Wow! Hard to believe, over seven thousand.

Then I think: That’s a huge number for a blog with so little current activity. In last three days, this blog received only 19 visits. In the same period, 58 subscribers were added. How can that be a thing? How is it even possible? What’s up?

So this post is all about you, the readers and subscribers to this blog. That is the real yous out there. This is your chance to show that you are not web hack or a digital hallucination. How? Write a comment! I’d like very much to hear from you. What do you like about the blog? What would you like to see covered? What’s on your mind? Say anything you like within the bounds of good taste. Still, if you think the blog sucks, say so! 😉

The opinions of real people matter!

Best regards;

Peter Camilleri

Please note that comments with promotions, spam, or links will NOT be accepted.

Share this:

Like this:

In April of this year, I completed gathering the raw data for my survey of gem downloads from my postings at the RubyGems web site. In the past, I have published progress reports at the 12 week and 24 week progress points. I am glad that the data collection is finally done. I admit, that it was only about an hour a week, but after several months it began to take on a level of tedium and boredom.

To be clear, data was collected for all 52 weeks, however, the data for week, 41, was lost in system crash. The data for that week is interpolated from the data of weeks 40 and 42.

The $65,536 question is WHY? Data collections and studies are are a lot of work and normally only undertaken with a goal in mind. My goal was simply to understand who was downloading the Ruby code I was writing and giving to the world. Unlike really popular authors, I did not have the luxury of looking to see thousands of downloads a day. My numbers were quite meager. My hypothesis was that by gathering detailed data, over a reasonably long span of time, some truths could be gleaned from that data that would reveal the nature of the user base. That is, assuming such a user base even existed.

You see, my fear is that I am just a crazy lunatic, working away in complete isolation, writing code that nobody will ever read. Just thinking about this scenario makes breathing difficult and causes my gut to twist and contort painfully.

The data itself reveals a brighter side. While subtle, there are some signs that there real are people out there at least looking at this code, and maybe incorporating it into their own projects.

There is a lot of data, too much for this blog or any single posting. In the coming days, I plan a number of articles looking at the data and coming to some concrete conclusions about Ruby Gem downloads and how to gage the success of a code release and maybe some tips for success in the world of software components.

Best regards

Peter Camilleri

ps: My library of gems can be found at Ruby Gems and the source code is at GitHub.

Share this:

Like this:

Well, it’s a smallish milestone, but I’ve finally made it to the six digit club! Here take a look at this ego gratifying selfie:

I must say that my download study has been given a boost last week as weekly downloads hit an all time high of 3,335. I suspect this may have something to do with my increased level of activity on the stackoverflow web site, but that is largely speculation, It could just as easily be one of those volume blips that occur from time-to-time. I know however that it is not driven be release activity as only one gem was updated that week.

Well onward and upward.

Best regards

Peter Camilleri

Share this:

Like this:

Now, we’ve all seen code that at least appears to work, but is very poorly written. You might even say the code “stinks”. Now, it can be really hard to detect code smells in your own code. A major air freshener company speaks of people going “noseblind” to smells. The old solution to this problem was to have code reviews. This never works. People gloss over problems, the reviews take forever, and feelings can be hurt or axes can be ground. What is needed is an objective, easy-to-perform, review of the code. What is needed is an automated tool!

Now you may think: “Why do I need a tool to complain about my working code?” I must admit, I sometimes think that too. The answer to that question is that whenever I dig into the code and clean up the smells, the result is almost always much better code. Now, I know that’s a serious claim, so I am going to back it up with a real example from my own code. The following bit of code is used to process snippets of ruby code embedded in strings and surrounded by {{ }} structures. They generally go by the name “handlebars”. Here is our starting point:

This is a lot better, but now my new method is too long! What to do? I could ignore the problem; I could tell reek to just ignore the problem; or I could mashup the code and use sneaky tricks to make it use fewer lines. None of these are good choices here. Instead, let’s really look at what the code is doing. We see a loop, processing a string by repeatedly looking for a regular expression and then performing a substitution of the found text with new text. Wow! Did I really write that code? What we have here is a kludgy reinvention of the gsub method! The very same method already used to perform the backslash quoting. Zounds!

OK; so let’s see what happens when we replace the kludge of gsub with that actual gsub method:

Share this:

Like this:

One of the most pernicious and damaging mistakes, injurious to world progress, has to have been the decision to allow the patenting of software. These patents have served to obstruct progress, destroy innovation, and fatten the wallets of lawyers and greedy patent trolls.

Now, to some, software patents are an awesome idea. If your goal is to provide more work for legal departments at large companies or you need to attack a competitor with the gaul of being better than you, then software patents are for you! They’re also great at destroying small, upstart companies with all of their “new ideas” stuff. Heck, even if the patent does NOT apply, prolonged legal proceedings can serve just as well.

Seriously, software patents are of dubious virtue at the best of times. Now finally, after many years of suffering under the lawyer’s savage yoke, there may be some hope:

This a great article with a video for the tl;dr; crowd. Still, I’d like to focus on a little excerpt from the article that is, I think, the heart of the matter:

Pointing out that intellectual property monopolies can limit free speech, Mayer notes that copyright law has built-in First Amendment protections such as “fair use” and that patent law must include similar safeguards. He suggests that the safeguard comes in the form of a part of the Patent Act, known as “Section 101,” which says some things—including abstract ideas—simply can’t be patented in the first place.

I really hope that this is the beginning of the end for software patents! I really do! I look forward to the day when they and the profits of the trolls are all dead and buried. Just don’t expect me to bring flowers to the grave site.

Best regards;

Peter Camilleri (aka Squidly Jones)

Share this:

Like this:

Well 12 more weeks has passed and it is time for the next installment of the Ruby Gems Download study. The goal of this study was to see if it was possible to observe patterns in the download rates that might lead to useful conclusions about the mix of entities doing the downloading. The gems repository makes this download data readily available. For my gems, you can see that data here.

For the 24 week report there are two main data findings. A graph of individual, cumulative downloads for each gem for 24 weeks and a graph of the weekly downloads for all gems for the same period.

I have collected 24 weeks of data, so here is the graph showing the rate of downloads.

If you look, you will see that the slopes of the lines vary. Some lines are very flat, while others are sloped upward at a much sharper angle. This means that the rate of downloads is also different.

The weekly, combined results show that the rate of downloads is anything but constant. The valleys seem to correspond to periods this summer when large numbers of people would be on vacation (Not me of course; I’m never/always on vacation)

The spiky peaks do tend to correspond to times when large numbers of gems were mass updated. This is especially the case for the last and fourth from last points where a code of conduct and changes to the mini_readline gem were propagated to most of the gems. This is clearly indicative of automated downloading.

This study shall continue. I estimate that the next posting on this matter will be one to study an entire year’s worth of data.

The big sticking point, now under study, is the issue of defining instance variables in a procedure. This will likely require changes to the method mapping of instance variables, assuming this change is actually made.

In the mean time, best regards;

Peter Camilleri (aka Squidly Jones)

Share this:

Like this:

Well it has been some time since I began working in Ruby and creating little gems of code for my page in the the RubyGems.org repository. When I looked at my stats this morning I realised that I had reached a milestone of sorts. The total downloads counter showed a value of 65,881 downloads!

Now, it is a well known fact that a sixteen bit, unsigned integer can count up to 65,536. This means that my download total no longer fits into that data type. While this is not nearly as impressive as the video Gangnam Style blowing through the YouTube signed 32 bit integer view count limit of 2,147,483,647, it is my accomplishment! 😉

One more bit please! That’s right, I’d like a seventeen bit integer, Thank You Very Much!

Best regards;

Peter Camilleri (aka Squidly Jones)

Share this:

Like this:

In this series of posts, we shall take a look at some unconventional tools that help solving various programming (and other) problems that often come up. For this first article, I want to tackle a problem that actually made the list of the two hardest problems in computers science. Here’s that list:

Selecting meaningful names.

Cache coherency and invalidation.

One off errors.

Ignoring the one-off error in the list, the first issue is selecting meaningful names. Way back in the bad old days, it was considered acceptable to have a program full of entities like i, j, k, and pmz21. Variable names that were meaningless, supported by a mountain of comments that were often completely out of data and/or misleading.

Slowly, computers improved and space was no longer so violently cramping the writers style anymore. This however lead to the opposite problem of names like:

What we really need is names that are meaningful and not verbose. It boils down to a matter of selecting the right words. Regardless of what programming language I use, I program in the english language. There are over a million words defined for that language and I can assure you the I do NOT know them all. For those where english is not their native tongue, the problem is even worse.

What to do? Use a tool to help navigate the possible words for the job: Thesaurus.com!

Let’s try a real example I encountered just this morning. I was looking to update the description of my mini_readline ruby gem. I wanted to describe the fact that it came with four sample auto-completing thing-a-ma-bobs. The only word that came to mind was “engine” that sort of worked but sounded to mechanical. I wanted a word that would express the idea of work done on the user’s behalf. So of to the thesaurus web site and punched in engine… A large page of results including the word I sought for: agent!

So the next time you struggle with one of the most difficult tasks in programming (and writing too) consider using a free tool to ease the burden of picking that one in a million perfect word for the job!

Best regards;

Peter Camilleri (aka Squidly Jones)

Share this:

Like this:

Just a really quick note that on our fOOrth programming web site, version 0.6.4 of fOOrth has been released. This is an interim maintenance release that fixes some bugs and improves documentation. For more details click here.