09.12.07

Seeking professional Java programmers!

Posted in Hacking, University life at 10:54 am by ducky

Help improve software tools by participating in a user study!

I am looking for Java/Eclipse programmers to participate in a study on how developers navigate through code. If you are interested in participating, or know someone who might be, please contact me at duckys at cs.ubc.ca . (Do not use my ducky at webfoot address.)

I have assembled some tools that I think can make navigating through code easier, and want to see how actual developers navigate with and without those tools. I need pairs of professional developers who who have programed regularly in the Java using an Eclipse-based integrated development environment (like Rational Application Developer for WebSphere or JBuilder) for at least the past six months. You need to be over 19 and proficient in English.

If you have a buddy that you could team with, fantastic! If you are solo, not to worry – I can find someone for you to pair with. People in the Vancouver, BC area are easiest for me to work with, but I can travel to Vancouver Island or Washington State if that’s what it takes.

Participating in this study will take approximately 3 hours of your time. It involves meeting me and one other participant at a mutually-agreeable location to perform four coding tasks on a hw/sw system that I will provide.

You and the other participant will pair-program for four coding tasks: two with a pretty “normal” Eclipse and one with enhanced navigation tools. Both versions of Eclipse will log your interactions; I’ll also do screen capture, and record the conversations you have with your partner. Afterwards, I’ll ask you to fill out a brief questionnaire, and briefly interview you about your experience.

We might also offer you the option of continuing to use the tool in your normal day-today work. If you choose to do so, we’d appreciate getting feedback from you afterwards.

In exchange, I can offer a $20 Amazon.ca gift certificate (w00t!). If you’re interested, I’d also be delighted to tell you what I’ve learned about programmer productivity.

I am conducting this study as a part of my MS Thesis, supervised by Dr. Gail Murphy. This study is being funded by the National Sciences and Engineering Research Council of Canada.
I hope to hear from you!

Kaitlin Duck Sherwood

09.06.07

difficult choices

Posted in Hacking at 5:03 pm by ducky

I’m working on making a version of Eclipse that has different tabbing behaviour. If someone does the following in the PackageExplorer, I want the following to happen:

  • double click on file – open file in the same tab
  • single click on file – deselect (dehighlight) previously selected files, select (highlight) that file
  • shift-control-click – deselect previously selected files, select the file, and open it in a new tab
  • control-click – add file to selected files

Right now, I can’t get both control-click and shift-control click working this way. Either I don’t get control-click at all, or shift-control-click adds the clicked-upon file to the selection list. The latter is not only visually wrong, but causes problems — when I try to open the selection, it opens ALL the selected (highlighted) files.

I can instead tell Eclipse that the PackageExplorer doesn’t support multi-select, in which case control-click will act just like a single click.

I went looking for where the control+click is examined, to put in a line that says “if shift is down, do a single selection and not a multi-selection”. Unfortunately, I had to go all the way down into the bowels of GTK. It looks like the place I want is in gtktreeview.c, in gtk_tree_view_button_press(), in the vicinity of line 2573 in GTK+-2.10 (which is probably not the exact same version as is in the Eclipse I’m running).

Now I have a dilemma. Do I go through the pain and agony of building my own GTK, then building my own Eclipse, in order to get the “right” behaviour? Or do I bail and give up the control-click multiple-selection functionality?

Neither. I go home and think about it.

08.28.07

idea for programming tool

Posted in Hacking, programmer productivity, Technology trends at 10:36 am by ducky

As I work, I find myself asking a question over and over “how do I get information from point A to point B?”. For example, “How do I get the position of the active editor from EditorSashContainer into TabBehaviourAutoPin?”

It seems like there is probably room for a tool that figures out a path from point A to point B.

This might also make the code more maintainable — instead of me going and making new methods in the chain from A to B through six intermediate methods, maybe the tool can find a path that goes through only two classes.

I can imagine the tool giving me the shortest path through public methods, and (if it exists) the shortest path that requires private variables or methods. Maybe it would find that there is a private variable that, if I made a public getter, I could use.

UPDATE: my supervisor (“advisor” in the US) pointed me at a paper describing a system (Prospector) to do just that. Alas, I haven’t been able to find any code for it. The code is at here, and there is also a web interface (which knows about J2SE 1.4, Eclipse 3.0, and Eclipse GEF source). The plugin also unfortunately seems to be too downrev for me. 🙁

There is also a tool called Strathcona which does something sort of similar — it finds examples of existing code that goes from A to B. I don’t think that would have helped me with the specific things I was looking for, because I don’t think there was any existing code anywhere that did all of what I wanted to do. It might have helped me get from A to C and then from C to A, however.

08.21.07

meme: non-Indo-European programming languages

Posted in Hacking, Random thoughts at 1:30 pm by ducky

I had a very interesting lunch yesterday with Dan Delorey, who is a PhD student at Brigham Young University and interning at Google Kirkland.  While we covered a wide range of topics, there was one meme of his that stuck with me through most of the (four-hour) drive home:  Almost all of the programming languages today were developed by men whose native tongues were Indo-European languages.  (Obvious exception:  Ruby, by Yukihiro Matsumoto.)

What would a language developed by someone with a non-Indo-European background look like?

What would a language developed by someone whose mother “tongue” was sign language?

I was reminded of something I saw ten years ago: a woman commented that if a woman had invented the WIMP interface,  there would have been two cursors.

08.17.07

robobait: difficulties setting up Eclipse for plug-in development

Posted in Eclipse, Hacking, robobait at 10:40 am by ducky

It took me way longer than it should have to get setup for my current project. I need to change some very fundamental behaviours of Eclipse. There is a plugin that does 80% of what I want, so I need to modify it.

I checked the plugin out of Eclipse’s CVS, but I couldn’t get at the Eclipse source (e.g. when I tried to do F3 or control-click on a class or method). I tried downloading the entire Eclipse source, but

  • I got tons of errors because the projects weren’t set up right to refer to each other, and setting them up by hand would have been a nightmare.
  • Everything got dog-slow.

SOLUTION

It turns out that I needed to first download the plugin from CVS, then convert it to a plug-in project. (Right-click on the project, then select PDE Tools, then select Convert Projects to Plug-in Projects.)

That gave me access to a lot of source, but not all of what I needed. To get other source, I needed to do

File -> Import -> Plugin&Fragments -> Project with source folder

then select the packages that I wanted the source for, Add, and then Finish.

Keywords: eclipse development, all eclipse source, attach source eclipse

08.14.07

semi-robobait: macros in Eclipse

Posted in Eclipse, Hacking, programmer productivity, robobait at 3:26 pm by ducky

Cool! Eclipse has keyboard macros! Eclipse calls them “Editor Templates”, and has a bunch of them predefined. For example, if you type

sysout Cntl-SPACE

it converts that into

System.out.println();

with the cursor in the middle of the parens. Similarly, if you type

for Cntl-SPACE

you’ll get a short menu of options; selecting the first one (“iterate over array”) magically converts into

for (int i = 0; i < array.length; i++) {

}

with the first “i” selected If you type in “fooIndex”, then all the “i”s in the line change to “fooIndex”. Pressing tab takes you to the “array”, where you can then type in the name of the array. Press return, and then you are sent to the middle of the curly braces.

Whoa!

My old housemate, Chris Beekhuis, once set up macros like this and said that it made his coding significantly faster. I’m very much looking forward to using Editor Templates, and am a little puzzled as to why their existence isn’t being shouted from the rooftops. (Or was it? Did I have my headphones in at the time?)

(To see all of the pre-defined macros — or to define your own — go to Window->Preferences->Java->Editor->Templates. Or press Control-3, type “template”, and Editor Templates will be one of the options.)

08.13.07

semi-robobait: way cool Eclipse keyboard shortcuts

Posted in Eclipse, Hacking, programmer productivity, robobait at 12:07 pm by ducky

I found two really cool Eclipse keyboard shortcuts today.

  • Quick Access (Control-3): This brings up a dialog box. Start typing, and it will present a selection list of windows whose title contains the text you just typed. Thus, if you type “expl”, it will present “Package Explorer”, “CVS Package Explorer”, “Project Explorer”, and so on. You can also type the names of the files that you have open, e.g. “foo” to get “Foo.java” as a selection option. (It does not take you to method names or classes, just window names.) Way cool. I think I’m never touching the mouse again. Ever.
  • Word Completion (Alt-/), aka “hippy completion”: When you are editingcode, you can type a few letters, then Alt-/, and Eclipse will fill in the rest of the word with a guess as to what you meant. For example, if I type “Fo”+Alt-/, it might present “FooFactory” first, then “FooTemplate”, then “ForeignFilmDatabase”, etc. When it reaches imagination failure, goes back to the first one. It is case-aware, so it would not present “for” or “format” or “foo”. It seems to be pretty clever about its guesses, too.

08.12.07

robobait: gd library bug – horizontal lines

Posted in Hacking, Maps, robobait at 11:12 pm by ducky

I had had a problem with horizontal lines in my census maps mashups for a long time.  Note the line at the bottom left.

Horizontal line bug

I was sure it was a bug in my code because the graphics library that I used, gd, was extremely mature and heavily-used.  (Way back in 1994 or 1995, my then-office partner Carlos Pero was using gd for Carlos’ Coloring Book!)

It turned out to be a bug in the gd polygon fill code. The fix turned out to be a very small number of lines of code, so if you are having problems with horizontal lines occasionally appearing in your images, look there.

More keywords: libgd, gdlib gd lib, flat, fill polygon, colored polygon, horizontal line, missing line, extra line, flat line, sideways line

census maps mapplets

Posted in Hacking, Maps at 10:53 pm by ducky

James Macgill prodded me to turn my census maps into a mapplet, and so I finally made a census mapplet.

Most of you are probably wondering what a mapplet is. A mapplet is a Google map that has been encapsulated in a way that makes it easy to combine with other mashups. To see them, go to maps.google.com and select the My Maps tab. You’ll see a list of mapplets next to checkboxes.

I’ve been enjoying playing with combining my demographics maps with other mapplets, like

  • population density + sea level rise
  • various demographics + real estate listings
  • % black + Chcago Transit Authority lines

08.01.07

robobait: Prefuse histograms

Posted in Hacking, robobait at 2:02 pm by ducky

I’ve recently been working on showing histograms using the Prefuse framework. I released five files today to help with that:

  • BarRenderer.java — renders x,y coordinates as a bar that goes from x,0 to x,y
  • HistogramTable.java — a Decorator that takes a Prefuse Table object and creates another Table (as a subclass) that has two columns for every column of the source: one column to define the range of a bin and one that says how many objects are in that range.
  • HistogramGraph.java — a JComponent subclass which displays a graph for a bin/count pair of a HistogramTable.
  • HistogramFrame.java — a JFrame subclass which lets you switch between all the data columns in a histogram and also lets you reset the bin count on the fly.
  • HistogramTableTest.java — JUnit4 tests for HistogramTable.

Known bugs:

  • There is a bug somewhere that manifests itself in HistogramGraph. If you select “Species Name” and then “Petal Width”, the first two x-axis labels are species names instead of numbers. I’ve looked at this enough to decide that it is quite possibly a Prefuse bug, and that it was not worth my time to try to fix it.
  • I only recognize two types of column, numeric and string. I don’t distinguish between ints, floats, and doubles. Everything else is a string.
  • I haven’t tested with boolean columns. I suspect that it will treat them as strings, and so it might just happen to do the right thing.
  • I haven’t tested with derived columns. It might accidentally work, but I don’t know.

I encourage people to give me feedback on these. While I’ve done a lot of coding, I am relatively new to Java, so am quite willing to believe that I did something in a suboptimal way.

Administrative note: I’ve made a new category “robobait” for postings whose purpose is primarily to alert search engines to the existence of some other page.  These are likely to be less interesting to human beings.

I’m also going to put “robobait” at the beginning of posting titles for robobait postings.

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »