Breaking Bad Habits – Stop Using The Mouse!

January 25, 2010 by Jim · 1 Comment 

Lately I’ve been really trying to avoid using the mouse while coding.  You may not realize it but it’s a huge distraction to:

  1. Stop typing
  2. Find your mouse
  3. Find your cursor
  4. Hunt for the icon you need
  5. Click the icon
  6. Release mouse
  7. Resume typing

That is a lot of work! And you probably do that quite a bit during a typical day.

Lately I’ve been using Mousefeed (http://www.mousefeed.com/) to help me break this habit.  Mousefeed is an Eclipse plugin which will encourage you to use the keyboard.  If you click on a menu item with the mouse it will display in a small popup the appropriate keyboard shortcut:

Mousefeed popup showing keyboard shortcut

Mousefeed popup showing keyboard shortcut

Unfortunately the author has stopped development on the plugin. The site mentions it works in Eclipse 3.3 but I downloaded the Mousefeed jar file and dropped it into my Eclipse ‘dropins’ folder (C:\eclipse\dropins\com.mousefeed_1.0.0.jar) and it seems to work fine with Eclipse 3.5 and the latest CFEclipse.

By using the keyboard I can eliminate the steps above required by the mouse and dramitically speed up my coding!

FYI – I’ll be presenting on more time saving tips like this at cf.Objective and CFUnited!

Quix – A Super Bookmarklet

January 19, 2010 by Jim · Leave a Comment 

I’ve been tinkering around with Quix, a ’super’ bookmarklet that can easily replace several Firefox addins and overall reduce your dependency on your mouse.

Installing Quix is a simple matter of visiting the Quix site and dragging the bookmarklet to your toolbar. Since I didn’t want to click on the bookmarklet to activate I used Firefox’s keyword to it:

Firefox Keyword Shortcut

Firefox Keyword Shortcut

So now I can do a ALT+D to take me to the address bar and type qq+Enter to pull up the Quix dialog.

Quix Dialog

Quix Dialog

There are quite a few commands and shortcuts available on the Quix site (enter ‘Help’ in the Quix dialog to get a complete list).

While I have a few shortcuts like this setup in Find and Run Robot (my launcher) having this bookmarklet running inside the browser adds a lot more power to what can be done.

I’ll probably only use a small percentage of these but even then I can already see it being a timesaver.

Getting Filename with AutoHotkey

January 8, 2010 by Jim · Leave a Comment 

So in my previous post (Authotkey and Eclipse Autocomplete) I was trying to replace a snippet with an AutoHotkey script.  One thing I was lacking was automatically inserting the file name which you can easily do in a snippet by inserting $${CURRENTFILE} into your snippet.

Doing this in AutoHotkey was a bit more involved…

There didn’t seem to be a way to directly get the file name. After another post on the forum someone suggested I look at WinGetTitle which will get the title of the active window.  Looking at CFEclipse the title does show the file name:

Screenshot: Eclipse Titlebar with Path

Eclipse Titlebar with Path

The path was there but also some extraneous text I didn’t want.  There is probably an easier way to do this with RegEx but I went for a quick and dirty replace:

WinGetTitle, Title
StringReplace, Title, Title, % " - Eclipse"
StringReplace, Title, Title, % "CFEclipse - "

So now I had a cleaned up path but I really just wanted the file name. Turns out AutoHotkey has a SplitPath command which you can use to return various bits of the path: drive, path, filename.

My initial attempts trying this didn’t work. Then I realized since AutoHotkey was a Windows program it was confused by the path returned by Eclipse.  I did another replace to flip the backslashes:

StringReplace, Title, Title, /, \, All
SplitPath, Title, Title

And this time I got just the file name!

Authotkey and Eclipse Autocomplete

January 8, 2010 by Jim · Leave a Comment 

Yesterday I was trying to write up a quick AutoHotkey script to quickly dump in a Fusedoc snippet into my files.

I was tearing my hair out (I don’t have much left!) because I kept getting extraneous characters printing out after the script ran.  After quite a bit of trial and error it finally dawned on me what was happening.

I was using SendInput in AutoHotkey to print out characters and when running this in Eclipse the autocomplete was kicking in!  So if I entered “<”  it would throw in “>”.   I tested this by running the same script in Notepad and it printed out fine.

I was a bit stumped but someone on the AutoHotkey forum suggested using the clipboard instead!!  This morning I tinkered a bit and rewrote my script to instead append everything to the clipboard and then paste it.

First we need to setup our clipboard:

clipboard =

That was easy :)   Now we can simply append items to it.  The `r`n is a line break.

clipboard = %clipboard% <!--- `r`n
clipboard = %clipboard% <fusedoc fuse="%currentFile%" language="ColdFusion" specification="2.0">`r`n
clipboard = %clipboard%    <responsibilities>%fuseDocResponsibility%</responsibilities>`r`n
...

Then finally we can dump it back to the screen by doing a CTRL+V:

...
clipboard = %clipboard% ---> `r`n
send ^v

By using the clipboard this pastes as one item into Eclipse and bypasses the autocomplete!  The full script is below:


:*:;fd::
FormatTime, TimeString, ShortDate
SetKeyDelay, 20 ;in millisceonds
InputBox, fuseDocResponsibility, Attribute Prompt, Responsibility..., , 300, 150
If ErrorLevel = 1 ; They clicked cancel
return
Sleep, 100

clipboard =
clipboard = %clipboard% <!--- `r`n
clipboard = %clipboard% <fusedoc fuse="" language="ColdFusion" specification="2.0">`r`n
clipboard = %clipboard%    <responsibilities>%fuseDocResponsibility%</responsibilities>`r`n
clipboard = %clipboard% <properties>`r`n
clipboard = %clipboard%    <history type="Create" author="Jim Priest" comments="" date="%TimeString%" role="Developer" email="priestj@my.work.email"></history>`r`n
clipboard = %clipboard% </properties>`r`n
clipboard = %clipboard% <io>`r`n
clipboard = %clipboard%    <in></in>`r`n
clipboard = %clipboard%    <out></out>`r`n
clipboard = %clipboard% </io>`r`n
clipboard = %clipboard% `r`n
clipboard = %clipboard% ---> `r`n
send ^v
return

Looking Back (and Forward)

January 6, 2010 by Jim · 3 Comments 

Where did 2009 go? Looking back on my 2009 blog posts I can’t believe 2009 is over. I started off in January talking about VirtualBox and was still posting about it in December. Cron, Ant, Selenium, Autohotkey and CFEclipse also occupied my time this year. As always I didn’t blog as much as I would have liked. I can make the excuse I was busy most of the fall planning CFinNC which was a smashing success (if I do say so myself).

The other big event for 2009 was of course CFUnited! I inquired at work about attending CFUnited and was surprised when management said yes! CFUnited was my first ColdFusion conference and I was blown away – the speakers, the venue, the content was all beyond my expectations!

2010

This year is shaping up to be a good one as well. Instead of attending conferences I’ll be speaking at two: CFUnited and cf.Objective!  I’m still a bit freaked about that but hopefully I can put together something worthwhile. :)

Dan, myself and the CFinNC crew are also talking about putting together another CFinNC type event this year if all goes well.

It’s only January and 2010 is shaping up to be a winner!

Saying Something Nice About Adobe

December 10, 2009 by Jim · 4 Comments 

adobeIn the past I’ve bashed on Adobe about costly software, broken extensions and lack of Linux support but today I have something nice to say!

Recently on the CFEclipse mailing list we were discussing the ColdFusion 9 dictionary file and someone mentioned it would be nice if we could simply use the one from ColdFusion Builder. I shot off an email to Adam Lehman from Adobe and honestly expected either a) no reply or b) a firm ‘No’.

But instead Adam did reply and indicated he’d “look into it”.

So I waited a few weeks knowing Adam is a busy person and emailed him again. And again he replied! He said it seemed like sharing the dictionary file was possible but he still had to ‘run it by legal’.

OK. Now we’re doomed I thought.

So I waited another week or so and bugged him again. And low and behold this comes across Twitter:

@thecrumb btw. I got Adobe VP approval to share the #ColdFusion Builder dictionary w/ CFEclipse!

So I’d just like to publicly thank Adam for following through on my inquiry, and thanks to Adobe for sharing their toys with the other kids!

Now about that Linux version of ColdFusion Builder…

Exporting A VirtualBox Image (To Reduce It’s Size)

December 9, 2009 by Jim · Leave a Comment 

I needed to move one of my VirtualBox setups to another computer but the disk image was huge and wouldn’t fit on my thumbdrive. Digging around in the VirtualBox settings I noticed an import/export function.

VirtualBox Export/Import

VirtualBox Export/Import

The original disk image was 4.13GB. Exporting it resulted in two files that totalled 1.75GB! That will easily fit on my 2GB thumbdrive (or Dropbox).

Exporting (and importing) is a straighforward process. Select export – you will be given the opportunity to define some configuration values for your machine, then simply define the export filename. Import is the reverse – select import – location you exported file and proceed. Exporting my 4GB disk took about 25-30 minutes.

Alternate VirtualBox Port Forwarding Method

December 8, 2009 by Jim · Leave a Comment 

In my Review Board installation on Virtual Box I gave an example of how you could access your guest OS from the host system using port forwarding. In that example you could access an application (Review Board) running on Apache.

In those instructions you had to enter a series of commands in at the command line. I’ve since discovered an easier way to do this.
Read more

« Previous PageNext Page »