How to setup Mercurial on Windows for use with bitbucket over SSH

I enjoy making software. I also enjoy playing with the systems that support making software: for example source control, unit testing, continuous integration, issue tracking. As a result, I have wanted to set up my very own build server to manage personal projects for a while now.  As an intermediate step to building my own server, which looks to be a rather large undertaking, I have elected to use bitbucket. Using bitbucket not only provides me with these services while I work on developing my own, it should help to inform the choices I make regarding my own system.

For those who are new to bitbucket, as I am, it is an online service that provides, among other things, Mercurial hosting for your source code.  Its use of Mercurial, which is my current source control tool of choice, and its use of ssh keys for simple and secure communication are the two main reasons I have chosen it. Speaking of ssh keys for communication, there are two different ways to access your code once it is on bitbucket: via https using a username and password, or via SSH using public/private keys.  I’ve elected to use SSH because using https requires that you enter a password whenever you commit, and I’m too lazy for that. My personal philosophy is to automate as much as possible, and make things as easy as possible long term; even if that requires additional effort up front.

Continue reading

x11vnc and the Shift Key

For anyone out there who has read my previous posts on building your own OpenSolaris file server, I have another addition to make. In my second post regarding, among other things, setting up a VNC server, I included a script to start x11vnc. This setup has always worked fine for me with one exception: the shift key. Whenever I want to type a capital letter, or use the shift key for any reason, it doesn’t work. Tonight, after a cursory google search, I found someone with an answer. I rushed off and added the option to my script before running it to apply the changes. Lo and behold, the shift key was working. “Great, that was too easy” I thought to myself. However, I quickly discovered that the arrow keys were doing weird things. The most problematic of these things being the lack of repeating the previous command entered at the command line when pressing the up arrow. This was not a sacrifice I was willing to make. Luckily, the ever informative serverfault came to the party with an even better solution.

I’ll leave it as an exercise for the reader to apply these changes to the original script. If you have problems, don’t hesitate to contact me or comment. Finally, a comment on the page with the first solution mentioned that this issue has been fixed in a more recent version of x11vnc, however I am yet to check this out.

New Language Instead of Autocomplete in IDE

While messing around with a personal project in Eclipse, I attempted to use the Visual Studio keyboard shortcut for autocomplete (ctrl + space). Rather than completing the variable name I had started typing, it began trying to convert my keyboard input into Chinese characters. At first I thought this might have been some idiosyncrasy of Eclipse. After a little research I discovered that Eclipse does in fact use ctrl + space for autocomplete, but Windows (bless its soul for trying to help) was hijacking the shortcut and using it to change languages. For anyone in a similar situation, here’s how you fix it in Windows 7:

  1. Open Control Panel -> Region and Language
  2. Select the “Keyboards and Languages” tab
  3. Click the “Change keyboards…” button
  4. Select the “Advanced Key Settings”

You should now see a list of actions and keyboard shortcuts. For each action that has a conflicting keyboard action, select it and click the “Change Key Sequence…” button. Here you can either change the action to have no shortcut at all, or give it an alternate shortcut. Keep clicking OK until you’re out of the menus. Immediately the keyboard shortcut stopped switching my language, and after a restart of Eclipse, started autocompleting. Simple!

References:
social.answers.microsoft.com

ASUS PL30JT First Impressions

I’m very excited to be typing this on my brand new ASUS PL30JT. When I was looking for user reviews of this machine over the last couple of days I didn’t find many, so I thought I’d take the opportunity to help others interested in this machine, as well as test out the keyboard a little more extensively. Please keep in mind that my last laptop is an Apple Macbook Pro circa 2005, so a lot of the standard features on new laptops are possibly novel and exciting to me.
Continue reading

memcpy and memset

Now that I am back in the world of full-time work, I have begun to think more seriously about my goals. One of my life goals, which I have recently decided are a superset of career goals, is to learn as much as possible. I have also decided that learning as much as possible is also a member of my set of career goals. To alleviate any confusion, I drew a Venn diagram summarising the situation.

terrible Venn diagram of my life goals

As part of my new job, I am programming in C++ for a good part of each day. A consequence of this is that I am constantly learning new methods for writing and debugging C++ code, and programming in general. In an effort to document and share this knowledge, I’m going to start by telling you about memcpy and memset. memcpy and memset are two functions included in the C standard libraries.  memcpy is used to copy a block of memory from a source to a destination, and memset is similarly used to set a block of memory to a particular value.  While quite low level functions, these can both be very useful if speed is critical and you’re not working with higher level containers for whatever reason (yes, I know everyone says to use vectors if you’re not using straight C).

Continue reading