Freeform object selection lassos

Currently, to select objects in a GUI, such as icons in a file manager, you use the mouse to draw corners of a rectangle (called a “bounding box” or “rubber band” in the Gnome Human Interface Guidelines).  Usually, though, the objects you want to select aren’t contained within a single rectangle. To select them all, you have to hold down the Ctrl key while drawing several different rectangles. For instance, you might want to select a block of icons, but not a few in either corner, because of the way they are ordered, which requires you to draw 3 or 4 rectangles.

It would be easier to just outline the things you want.  Instead of rectangles, it should be possible to select objects by drawing a free-form lasso around them.  This is more intuitive, and will be easier to grasp for the less technically-inclined. After watching many people interact their computers, I suspect the majority aren’t even aware they can use the Ctrl key to combine multiple selections. This would let you select all the files with a single swoop:

As shown, a line would be drawn back to the starting point to complete the selection, so you don’t have to draw the entire outline.  The line that you draw should be smoothed as you draw it, on the order of the size of one icon, so as not to be messy, since we don’t need any more precision than a single icon anyway.  It should also be possible to “backtrack”; if you draw backwards within a certain width of the line you already drew, it will erase it, so as to de-select something you accidentally went around.

You could even select disjoint groups of objects with a single mouse movement, for a group of files that wraps to a new line, for instance:

Objects will be considered selected if their centerpoint is inside the lasso. Alternately, the lasso’s shape could be redrawn to go around objects as you draw (shrink-wrapped), but this might be less intuitive:

Here’s a mock-up in Processing.js to play with.  Since you can draw sloppily and still select things, it’s actually faster to use the lasso in most situations than rectangles, as well as being more intuitive.  It’s especially good for touch screens and styluses.

Obviously this idea of selecting multiple objects with a lasso instead of rectangles is applicable to more than just Nautilus File Manager.

WordPress madness

So I’ve been trying out WordPress, but having lots of problems. Here are the two most recent:

  • Not being able to insert the text “convert (from” — even with other characters in the middle — without getting a 403 error.  Not being able to insert images without getting a 403 error.  I had to create a .htaccess file in my wp-admin directory.  Support thread here.
  • Not being able to insert special characters without them being converted into question marks on pressing Save.  I had to convert the mySQL database to UTF-8, which was created as Latin encoding by default.  This screwed up all my posts, but I made backups first.  Support thread here.

This really isn’t working out the way I expected it to.  Spending much more time maintaining WordPress itself than I would have spent maintaining a bunch of hand-written web pages.

BitScope

Note: “BitScope DSO” is the software interface for the BitScope USB oscilloscope.  This is totally different from the “Bitscope” package used to monitor digital audio in JACK Audio Connection Kit.

I have an old 2-channel analog oscilloscope, but it’s not very convenient and doesn’t have any storage capabilities, making it really difficult to measure transients or things that happen long after the trigger.

LIZEN LAS-5020 20 MHz 2-channel analog oscilloscope

I looked around at different options and decided a USB scope would be nice to have.  Since I’ve started using predominantly Ubuntu Linux at home, but Windows XP at work, I wanted something that would work in both operating systems.  The BitScope seemed to be what I wanted, but is quite expensive, with even the cheapest pocket analyzer at $475. (My old analog scope was less than $50 on eBay.)  With the help of a saved eBay search for “bitscope”, though, I eventually ended up finding one for 1/3 the normal price.

Photograph of BitScope BS50U Pocket Analyzer

As is often the case with deals like this, the unit didn’t work when I got it.

Repair

The seller said it worked fine for him, so I poked around some more.  I tried it in Windows and it didn’t work there, either.  I went to Gnome System Log (/var/log/messages), and saw this among the messages it displays when I plug it in:

Jun  1 23:18:24 Inspiron kernel: [53398.974351] hub 1-0:1.0: over-current change on port 1

Aha.  It’s drawing too much current from the USB bus and getting shut down.  This is the sort of thing I develop at work, so I should (theoretically) know how to fix this.  I found a compatible DC power supply (12 VDC, 800 mA, 2.5 mm center positive) and tried it with that, and it worked!  It also worked when I first plugged it into the external supply, then plugged in the USB cable, and then disconnected the external supply.  So it seemed like an inrush current problem rather than a short circuit/bus power problem.

(According to the USB spec, devices cannot draw more than 100 mA in an unconfigured state, except for a brief inrush current spike, but the amount of excess charge during that spike is limited to 50 µC.  In other words, you aren’t allowed to put more than 10 µF across the VBUS line to ground.  A lot of USB device manufacturers ignore these requirements, and most computers don’t care, but my Dell Inspiron 8600 seems to be especially picky.)

The BitScope website emphasizes the fact that it’s “open design hardware”, but there were no schematics for this unit on their web site, and the eBay purchase didn’t include a manual.  So I wrote to the company and asked for help.  They were very helpful, going so far as to scan in a manual and convert it to PDF for me:

The company told me there’s a “slow-start” circuit, but it’s more of a “delayed start”.  While plugging in USB, the PWREN pin on the USB FIFO (FT245BM) is brought high immediately.  This keeps the PMOS switch IRF7314Q open, so no current can flow from VBUS into the rest of the circuit.  After initialization, the PWREN pin snaps low, opening the PMOS switch and connecting 47 µF directly across VBUS to ground.  My computer doesn’t like this much current, and presumably shuts down the FIFO, evidenced by the PWREN pin going high again about 8 ms later.  (Remember that I am just eyeing this up on an analog scope with no storage ability.  Thankfully, Linux was kind enough to continually re-initialize the USB port, trying to connect and failing over and over again, so I didn’t have to keep plugging and unplugging the USB cable manually while holding the probes against the relevant pins.)

After realizing this, I decided I should try to make the FET open up a little more slowly so the current into the cap is not so high.  So I connected a 1 µF cap (time constant of 10 ms) from the gate of the FET to ground.  It worked!  But when I looked at the system log, it was still showing the over-current error.  In fact, it looked like it got the over-current error, shut down, re-initialized, and then started correctly, probably because the cap was still charged from the previous attempt.  Then I realized what I had done.  By putting the cap to ground, the FET was held closed during startup, so there was still an inrush spike while plugging in, instead of after initialization. So I connected the cap between the gate and VBUS instead:

A 1 uF capacitor is connected between VBUS and the gate of the FET

Photo of a 1 uF capacitor soldered between VBUS and the gate of the FET

Now the gate is pulled up instantly along with VBUS at plug-in, but when PWREN goes low, the FET gate voltage is slowly dropped down, so it doesn’t open fully until after ~10 ms.  Now it works on bus power with the laptop, and doesn’t complain about over-current at all.

Software

After getting the electronics working, I started up the DSO software.

You have to download and install kylixlibs3-borqt along with the BitScope DSO software or it won’t work.  I used the BitScope-maintained kylixlibs3-borqt_3.0.2bs-1_i386.deb package from the download page.  Other .deb files are available from the kylixlibs SourceForge site, but I don’t know if they work for this.

So then it continually popped up the .csv import screen, indicating that it can’t connect to the hardware.  Eventually I figured out that I had the wrong thing entered in the configuration dialog.  Press the SETUP button and put /dev/ttyUSB0 in the IP Address or Port box under the Setup tab.

Screenshot showing \

I had tried just ttyUSB0 alone and it wasn’t working.

Launcher

After getting it working, I made a Launcher for the main panel.  Right-click Applications, click Edit Menus, go to the Other menu, press New Item.

I got the real icon out of the Windows version, which you can download directly here:

Icon file for BitScope DSO

There’s also a scope icon on Rachel’s pages.

It works!

My body has a built-in signal generator: