Project Findbar update: learning Firefox extensions

I asked about how to code for Firefox on the Mozilla subreddit. A Mozilla developer kindly replied to me and provided some useful advice. He (she?) informed me that developing my findbar update as a Firefox extension would likely be more successful. Apparently, the people who control the UI for Firefox are rather particular about making changes to the interface. Therefore, my modifications to the UI, even though they are small, may not be accepted into the main code.

So I decided to investigate writing an extension instead. I found a great tutorial on the Mozilla webpage. After some initial frustrations, I was able to write, package, and install successful extension code. The tutorial is written in an easy to understand manner (useful for a rusty software developer like me) and seems to work properly (I have a big issue with discovering and following tutorials for older versions of code/software/hardware that are no longer compatible).

My first extension was a basic Hello World-esque application (which is the appropriate first project for newbie developers). I wrote it using TextWrangler and packaged it using the zip command line tool. Now, I am learning how to use more advanced IDE and packaging tools. Check out my post to learn more.

Setting up BOINC on a Raspberry Pi

Update 2016-01-29

Replaced Seti@Home project with Asteroids@Home.
Added solution for Authorization failure error.

Install the BOINC package.

$ sudo apt-get update
$ sudo apt-get install boinc

Start the BOINC daemon

$ sudo /etc/init.d/boinc-client start

Acquire your account key

$ boinccmd --lookup_account http://asteroidsathome.net/boinc/ your-email your-password

Attach the project

$ boinccmd --project_attach http://asteroidsathome.net/boinc/ your-account-key

Shortly, your Pi should start downloading and computing a work unit. To verify, run $ boinccmd --get_tasks. The active task list will be displayed on your terminal. You should see the Asteroids@Home task listed under project_url and the current action of the project under active_task_state.

Other Handy Commands

To stop the BOINC daemon: $ sudo /etc/init.d/boinc-client stop

To restart/bounce the BOINC daemon: $ sudo /etc/init.d/boinc-client restart

To check the status of the daemon: $ sudo /etc/init.d/boinc-client status

To view diagnostic and error messages: $ boinccmd --get_messages

Troubleshooting

Receive error Authorization failure: -155 when executing boinccmd

boinccmd is a command line management tool for managing the boinc client, which actually computes the work units. boinccmd communicates via boinc using GUI RPC (Graphical User Interface Remote Procedure Call). A single boinccmd tool can manage multiple boinc clients on multple machines, both local and remote. A password is used to authenticate requests between a tool/manager and the boinc client. More details available here.

The password is stored in a file called gui_rpc_auth.cfg. Copies of this file are stored in three locations:
1. /var/lib/boinc-client/gui_rpc_auth.cfg
2. /etc/boinc-client/gui_rpc_auth.cfg
3. /~/gui_rpc_auth.cfg

The password in the file in the user’s home directory is compared to the copy in the /var and /etc directories. Assuming you aren’t interested in securing this program, or only plan on running and administering boinc locally, the simplest resolution to this issue is just the delete all three copies. Once I did this, I no longer received this error message.

A workaround is to execute all boinccmd commands from the BOINC data directory (/var/lib/boinc-client).

Connecting my Raspberry Pi… FINALLY!

I purchased a Raspberry Pi kit from Canakits several months ago. Since that time, it was sitting on my bookshelf collecting dust, with all of the parts still in their original packaging. The package came with (almost) everything one needs to conveniently use their Pi. I say “conveniently” because the package includes a USB wifi adapter and a copy of the Raspberry Pi’s default Linux version Wheezy pre-installed on an SD card. The only thing that was missing was a case.

I’ve been tinkering enough with electronics and computers for long enough to know that having exposed electronics powered on is not a good idea. Many hazards in a normal household environment are deadly to electronics. Static discharge can fry the circuits. Dust or other particles can accumulate on the chips and start a fire/melt/corrode components. The safe thing to do is make sure the electronics are enclosed in a proper case.

To keep my Pi nice and safe, I ordered a transparent plastic case from Canakits (through Amazon). I picked it up from the loading dock at work last week and today finally put all the components together.

Assembling the kit was pretty each. The Pi did not come with any printed instructions (although copies are available on the internet). However, being a man, the right thing to do is to act first, and read instructions later. The Pi fit securely into the case, and the cover snapped on easily. I put the case inside my TV stand and connected the remaining components. The kit came with a HDMI cable and a power cord, which connected to my television and power bar respectively. I inserted the wifi adapter and keyboard into the two USB ports on the back. There is no power button on the Pi, so the device fires up as soon as the power flows.

Success! I could see the standard Linux boot gobbledegook text scroll up my screen. I was presented with a config menu in classic terminal-style. Anyone who’s worked with MS-DOS would squeel with nostalgia. I figured this was a first-time boot config, and after a quick read, determined that none of the options applied. So I selected the Exit option and was dumped to the terminal.

My plan was to configure the wifi and get the Pi on my network with access to the internet. From there, I would install a VNC server so I can access the Pi from any of my other computers. I figured that this would be the best way to work with the Pi, since I don’t want to buy a wireless keyboard (although I probably will because I’m a nerd who will use any reason to purchase electronics) and mouse exclusively for the Pi.

I’ll be the first to confess that I know the absolute basics of Linux console/terminal commands. I had to hunt the internet for what commands I needed to run next. I used the command startx to launch the GUI.

That’s all I care to write for now. Next I will post about configuring the wifi and downloading VNC.

Working with Suppliers

Every project manager will inevitably deal with suppliers. Here are a few tips from my personal experience to help you manage them.

The squeaky wheel really does get the grease

This is a piece of advice that I received from a colleague of mine. For many years, he worked closely with IT infrastructure companies that serviced our company’s mine.

Sales people have an awful habit of over-committing their delivery resources. By delivery resources, I am referring to the resources at the supplier that are actually responsible for performing the service or delivering the product that was purchased. Most of the time, the delivery team is very busy satisfying the needs of multiple customers simultaneously. Unfortunately, the team has limited resources and cannot work for every customer at the same time. The result is that projects and customers are prioritized over each other.

If everything was logical, customers with the closest deadlines would be served first. Or, all customers would be served in the order that they signed their contracts. However, very little in business is logical. My personal findings show that suppliers prioritize customers by who is complaining the loudest and most often. The customer that is more demanding and vocal gets their work done first. On the other hand, more passive customers are served last.

The solution to this problem is to keep in frequent contact with the supplier’s delivery team. As long as they are meeting their commitments, then communication does not need to happen on a frequent basis. However, if deadlines are missed, or if there is a risk thereof, increase communication frequency immediately. The supplier will see that you are serious about delivery and will ratchet up their service level.

Once the delivery schedule or supplier performance is back on track, ease up on the communication frequency. Revert back to your previously agreed communication frequency. This will demonstrate to the supplier that you trust them, and will give them space to perform their jobs provided that things run smooth.

Delivery team not listening? Talk to the salesperson!

Those employed by suppliers (and more corporations) have an interesting mental mindset. Delivery teams think only about the current deal; sales people think about the next one. Sales people are motivated to sell, which means they have a strong incentive to maintain positive relations with a client. They know that a product that is poorly delivered may cause a client to look elsewhere for future business.

Delivery teams, on the other hand, are motivated to work on projects handed to them by the sales people. The clients are immaterial; once one project for one client is finished, there is always another project from another client in the pipeline. They are not interested in whether the client is happy as long as some client somewhere has a project to work on.

Therefore, talk to the sales person when they are issues, especially if the issue is the performance of the delivery team. Explain to the sales person how important the project is, and that you are not happy. Lead them to believe that you may not be interested in a future deal if they supplier cannot deliver what was already agreed. If a sales person fears that they may not receive future deals with a client, they will take action to guard the relationship.


What does everyone else think? Does anyone have another good tip for working with suppliers?

Project Findbar: setting up a Mozilla dev environment (Windows XP, MSVC++ 2010 Express)

I’ve renamed my Mozilla findbar project to Project Findbar. Clever hey?

I wanted to have a dedicated development environment for doing this work. I have some good reasons for doing this. Firstly, I didn’t want to fill my host system with a bunch of SDKs and source & binary folders. Who knows what some of those SDKs do to my registry or other system configuration. I was especially concerned about what installing the DirectX SDK would do to the version of DirectX that I use for gaming. Keeping the dev environment separate keeps everything nice and clean. No cross over between my stable host system and my “experimental” dev environment.

Secondly, I want to be able to tear down and archive the environment once it is set up. I do not plan on doing any additional Mozilla development after I get the findbar improvement completed. However, as new versions of Firefox are published in the future, I may need to reapply and re-test my modifcations. That is assuming that the Mozilla gods do not accept my submission into the main distro, which I think is what is going to happen. Since the environment will be virtual, I can shut it down, move it to a different computer or drive, and restore it without issue.

Mozilla publishes some great instructions on setting up the software required for building Mozilla.

So here are the instructions that I followed to set up a basic Mozilla development environment:

Materials:

  1. Windows XP
    I used Windows XP, so all the instructions below will be for that version. Newer versions of Windows (7&8) can use the 2012 version of Visual Studio.
  2. VirtualBox
  3. Visual Studio 2010 Express
  4. Mozilla Build
  5. Mozilla source (you will acquire this as part of the steps below)

Steps:

  1. Install VirtualBox.
  2. Launch VirtualBox. Create a new virtual machine. The default options should suffice.
  3. Insert the Windows CD. Start the virtual machine. Set the CD drive to be the startup disk in the virtual machine.
  4. Switch to Scale Mode (optional)
    This is personal preference. Scale mode will allow you to increase the size of the virtual machine window and its contents. The virtual machine screen will be much easier to read.
  5. Install Windows as normal. The default options should suffice.
  6. After Windows installs and launches, run Windows Update at least once. The system will download a whole bunch of updates that will make your life a heck of a lot easier (such as a newer version of Internet Explorer).
  7. Set up shared folders and clipboard in the virtual machine (optional)
    Shared folders will allow you to easily move files and folders between your host system and the virtual machine. Sharing the clipboard (from host to virtual machine/guest) will allow you to copy text (such as a URL) from a web browser on your host to your guest.
  8. Install Visual Studio C++ 2010 Express. The default options should suffice.
  9. Install Mozilla Build. The default options should suffice.
  10. Launch the Mozilla build command prompt.
    Open a console windows and execute:

    start-msvc10.bat
  11. Create the source folders:
    cd /c; mkdir mozilla-source; cd mozilla-source
  12. Download the Mozilla source:
    hg clone https://hg.mozilla.org/mozilla-central
  13. Start the build process:
    cd mozilla-central
    ./mach build

    You may be asked to confirm the build

That is as far as I am now. I will update more when I complete it.

Todo:

  • Installing guest additions
  • Installing Windows XP SP3
  • Building the source

The joys of coming home (and Windows 8)

Although I always enjoy taking a vacation, I really like coming home. Maybe it’s the familiarity of my house and city. Maybe it’s the slower (lazy?) pace of not spending all your time exploring an unfamiliar city. No matter, it’s nice to sleep in ones own bed.

Now that I have completed my graduate studies, I treated myself to a new gaming laptop. My 3+ year old iMac just couldn’t handle the performance needs of modern PC video games. Upon a recommendation from a friend, I picked up an Asus laptop from Memory Express. I forget the model, but I’ll post that tomorrow.

I won’t talk much of the specs at the moment. I will share my plan, which was to sell my iMac (and fund a future computer purchase) and transform my new Asus laptop into my primary computer. This made sense because my only other option was to use my MacBook air that only has 128 gb of disk space. The Asus has 750 gb; more than enough space for my music, movies, and tv shows.

I won’t talk of the horrors of windows 8, or my issues in migrating from OSX. That will take too long and I am tired. I can say that the process, including learning Windows 8, was a complete disaster. I just can’t get comfortable using windows 8. I don’t care for the Metro UI. File History is a poor cousin to Time Machine. I can’t find where any of the settings or configuration options are. There is no useful software available, like iPhoto (which I became very comfortable using) or Super Duper.

Perhaps I drank too much of Apples kool-aid. Perhaps I am just too old to openly accept change. Either way, I ultimately decided to maintain my sanity by going back to OSX, even if it meant using the MacBook as a primary computer. I think that I have found a way around this, which shall be a topic of a future post. I guess that now I am a true Apple man (*nix is pretty nifty too).

Travels to New York City

Kelly and I recently returned from our trip to the Big Apple. In fact, I am writing this on the flight back to Calgary. Our trip was amazing. I wanted to make a few notes and recommendations, not only for our future reference when we return to New York (one day), but also for anyone else planning to visit there. I will include some of our favorite experiences, along with stuff to avoid.

  1. Learn the difference between downtown and uptown, and the approximate direction of all the burroughs

  2. Subways run in two directions (duh). You need to make sure that you hop on the train heading in the right direction, or you will end up at the Apollo Theatre in Harlem instead of a gelato shop in Little Italy.

    It’s pretty easy. Manhattan island runs northeast to southwest (north and south on the subway map. Downtown is the south part of the island (financial district, statue of liberty). Uptown is the north part of the island. I don’t know what goes on in uptown because we never explored north of central park, I’m guessing houses?

    All the subway stations will have signs explaining where to go to catch either an uptown or downtown train. The trains will also show which burrough they end at. Bronx is uptown, queens is uptown and east. Brooklyn is just below queens, and pretty much just across from the financial district.

  3. Don’t stay or eat near Times Square

  4. Times Square is one big tourist trap. Don’t get me wrong; the lights and crowd at night is electrifying. The location is pretty central in the Theatre District. However, it is not what I would consider a “true” New York experience. All the shops in Times Square are what you would find at any local mall (Gap, H&M). The area is also filled with divey tourist shops that all sell the same coffee mugs, tshirts, and refrigerator magnets.

    Also, all the restaurants here suck. You didn’t come all the way to NYC to eat at an all you can eat Sbarro buffet (did you, fatty)? We at twice around the Theatre District and both times we were disappointed.

    I recommend sleeping and eating in places like TriBeCa, Soho, or the Village.

  5. Definitely rent bikes in Central Park

  6. Cycling Central Park was probably the most fun we both had in New York. Pack a picnic lunch, grab some bikes, and find yourself a scenic place to eat. We rented two bikes for 2 hours on 57th street and 9th avenue for $40 (we got a discount for booking online). You probably don’t need to worry about a lock; it seemed like everyone in the park left their bikes unlocked.

  7. Go to the rooftop lounge at 230 Fifth

  8. This was the second coolest thing that we did in in NYC. I’ll admit that the thought of going to a bar in New York intimidated me at first. I was worried about $50 cover charge, $15 drinks, and a crowd of college kids grinding against me. I could not have been more wrong.

    The lounge is on the 20th floor of the building on 230 5th avenue. There is an enclosed lounge with a heated open garden on top. There was no cover charge, and the drinks were no more expensive than in Calgary. The crowd was completely mixed; tourists and locals of all age groups chatting and having a good time. The dj was spinning some fantastic downtempo loungey beats. And, oh my god, the view.

    The view was phenomenal. As soon as you climb the stairs and walk onto the open garden, you are staring directly at the Empire State Building, all lit up in the dark. You can even see the Chrysler Building about 20 degrees to the right. Many folks pay $25 to go to the top of 30 Rock. Save your cash and come to 230 Fifth instead (and spend it on drinks).

  9. Bring a subway map, and a tourist map

  10. My dad picked me up a motorist map of the city from AMA. Unfortunately, it was way too big for our needs. We were only interested in manhattan, so it was overkill. Also, it did not show all the subway stops. Had we based our subway travel on this map, we would have been walking many extra blocks.

    Get yourself a good size map of manhattan, and any other burrough that you plan on visiting. A detailed subway map is also important. If you don’t get one before you arrive, pretty much every convenience store and tourist store sells them.

  11. Download the Ulmon City Guide to NYC app

  12. This app saved our bacon countless times. Firstly, it has a very detailed offlinemap of all five Burroughs. You can zoom and scroll over the entire city. Secondly, it has a massive database of locations. Everything from hotels, restaurants, buildings, and tourist points of interest. It will even show you the nearest subway station to your selected destination. Lastly, it has a built in compass which shows you (roughly) which direction you are facing. Extremely handy when you climb out of a subway platform onto a street that you have never been on and have no damn idea if you go left, right, straight.

    Oh, and did I mention this app is free on the App Store? God bless these navigational wizards!

  13. Hu Kitchen is amazing if you like healthy eating

  14. On 5th avenue north of Washington Square, is the Hu Kitchen. It’s run by a bunch of hippies who live by a very strict creed for food. Organic, local produce, low carb bread, and free range meat. Because of their focus on quality ingredients, the food here is fantastic. The restaurant is also a little market & cafe where you can buy take-away food and espresso/coffee.

  15. Come to Brooklyn for dinner, stay for the view at night

  16. We wandered into Brooklyn after a disappointing dinner in Little Italy that was only redeemed by some kick ass gelato. We were very impressed with Brooklyn Heights and Dumbo (which must be the dumbest name for a neighborhood ever). Both were cool neighborhoods with restaurants, stores, and little bars in brownstone brick buildings. The townhouses here were also very trendy.

    The coolest thing was walking down to Brooklyn Bridge Park. You will get a great view of the bridge, the manhattan skyline at night, and even the statue of liberty (although pretty far away). From here, follow the signs to the Brooklyn Bridge stairs. They will take you up to the bridge deck where cyclists and pedestrians can safely walk across the bridge.

  17. New York Penn Station is chaos

  18. We got totally twisted around in Penn station as we connected from the subway to the NJ Transit train to Newark airport. Signs marking the track locations are not very clear. The signs indicate where tracks 1-12 are, but fail to clearly point out where tracks 13-24 are (down the stairs below tracks 1-6). Also, there is a lack of signage indicating which trains stop where. But don’t sweat; most NJ Transit trains stop at the airport. Check the signboard next to the entrance to each individual track. It will list each stop that the train makes.

  19. Newark Liberty International Airport is even more chaos

  20. You know when the airline recommends that you arrive at the airport at least 3 hours before your flight? Well, come 4 hours early at Newark. Nothing there runs smooth. The staff don’t know much and give you confusing information (maybe that’s just United). Worst of all, there is only one place to buy booze at past security in terminal A, and it reeks of mass produced roast beef.

    Ya, first world problems…

That’s all I can think of for now. Will post more if something comes to me.

Project 1: Mozilla Find Bar Enhancement

One piece of coding work that I would like to accomplish is an enhancement to Mozilla Firefox. As most people probably already know, Firefox is an open-source web browser from the Mozilla corporation. I have used Firefox for many years now, and have generally been pleased with its user interface and performance (although I do believe many people consider it to be bloated).

A frustration that I have with the browser is a lack of a “match whole word only” in the find function (you know, the little toolbar that appears when you press CTRL-F that you can use to highlight words and phrases on a web page). I do not know how to best articulate this outside of an example. Say you wanted to search for the word cat on a web page. When you perform the search, the search results will return any occurrence of cat on the web page. Words such as catapult, catatonic, catalyst, caterpillar, scat, concatenate will also be found. The poor user must then iterate through each of these words, even though he or she simply wanted to find cat all by itself.

One may read this and question, “why not try putting quotes (“”) around your search criteria?” My response would be that while that technique may work in Google searches, Firefox page search does not work the same way.  I tested this myself, but was unsuccessful. If anyone else out there knows how this works, please let me know. I am open to admitting that I did not do it correctly.

I’ll post more on this project, and my current progress, at a later time.

Ermahgerd! It’s a blerg!

I decided that I should finally get this website going. I had the idea to start a blog/personal website for several years now. However, due to anxiety/laziness/school I never fully committed to doing so. Now that school is over, and I feel rejuvenated and energized, I commit to launching this site!

I have some specific goals for this site. Firstly, I want to learn more about WordPress admin (since it is growing in popularity as a Content Management System). Secondly, I plan to use my school-free time to reconnect with many of my geeky hobbies, such as electronics and software development. I expect to use this site to share my creations and progress. By making regular posts, I hope to keep the momentum on my personal projects. Thirdly, from time to time, I come across interesting information and tips that I want to retain. Furthermore, many of this information may not be easily available to others with the same struggles, so I want to share it with the world.

How many people will read this site? Probably very few. But Sun Tzu said, “The journey of a thousand miles starts with a single step.”