Refine your data

Hello all,

For one of my two remaining releases for my open source class, I decided (based on my professor’s suggestion) to contribute to a project called OpenRefine. This is a brilliant project started by Google which allows you to clean up your data. It has some pretty neat features like fixing inconsistencies in data, extracting out unnecessary fields of data, augmenting your data set with data collected from online sources, etc. It has a pretty slick UI that will make interaction with data more user-friendly. Gone are the days of using MS Excel.

For this release I worked on a pretty simple optimization bug that dealt with reducing the number of events triggered for each keystroke in an input field. With the project combining languages like Java, JavaScript, and HTML, I was not sure what I was in for.

I did have a little trouble navigating the project itself (it is a very big project) and was struggling a bit to figure out a starting point. I thought I would give it a fair shot before knocking on the doors of their IRC channel. Simply put – Global Search FTW. In the bug itself, the place where the event was captured was mentioned, so I global searched for that. Once I found it, I experimented a little with what an appropriate solution to ignoring certain keystrokes would be. Within about half an hour, voila, I had a good tested solution, and a PR up.

Unfortunately, I am not sure how to fix the failing AppVeyor thing – will wait for some comments from the devs.

Stay tuned for my final release soon…

Apparently the AppVeyor thing was not relevant atm so the devs merged it in 🙂 / April 19, 2015 / Open Source / 0 Comments

Adapting to browserify

Over the past few days I have been working on fixing a small issue on Filer for release 0.5 for my open source class. I decided to take something tiny due to other course commitments and so that I can work on more fun issues for subsequent releases.

The issue I was working on was related a to an incomplete code port we did for Filer when we switched from using RequireJS to Browserify. With browserify, we should be able to use simple node.js syntax and it will convert the code to work appropriately in the browser. Most of this was done a while ago. However, some remnants of RequireJS remained.

When we run tests for Filer, a feature that was implemented in the RequireJS days was the ability to provide via the query string, the Storage Provider to use for the tests. Obviously this is only possible in the browser. I wrote the code which does this so that we can use node’s URL module to extract the needed info. Unfortunately it did not work. After some deep investigation, I found that browserify was not changing `global` to `window` for the browser build. That seemed strange and I spent hours going through browserify documentation to figure out why.

Turns out I was being silly. I didn’t look carefully enough at the file. Turns out, it was still using RequireJS syntax and the module was being passed `global` as a parameter which referenced the module itself so browserify considered each reference to the global inside that module, as a reference to the parameter that was passed in.

In short, to fix my main problem, I had to change:

(function(global) {
  // code

to just

// code / March 30, 2015 / Open Source / 0 Comments

1 2 3 6