Cookie Notice

As far as I know, and as far as I remember, nothing in this page does anything with Cookies.


Bluetooth Question

I have a netbook. It has a Bluetooth dongle. An IOGear dongle using a Broadcom 2046 chip. Don't know if that makes any difference.

I have a phone. A Samsung Instinct. Don't know if that makes any difference.

I wanted to try to use my Samsung as a data modem for my netbook in those few moments when I didn't have WiFi close by. Never really got it to work. Not really a huge concern for me, as I spend most of my time within easy access of WiFi.

And now, when I have my netbook on, it seems to try to connect every 30 seconds or so to my phone.

  • I work out of cell phone reception, so it couldn't connect on my desk if I wanted it to, which really I don't
  • It drops to the speed dial menu after it fails and drops the lock, which puts me in danger of butt dialing
  • It keeps it from being in sleep mode, thus eating the battery
So, clearly, I hate hate hate that it does this.

Any pointers to fixing this behavior while still keeping the Bluetooth dongle on? I on occasion want to copy things to the phone without finding my USB cable, and would rather have things on.


Hardware Annoyances: IOGear USB KVM

This is an IOGear USB KVM. I've used it for one day, and really, it's a neat thing.


It's not a hub. It isn't general-plugin. The keyboard plug goes on the left and the mouse plug goes on the right. Which means that, unless you're left-handed, or have other reasons to mouse left, you are guaranteed a tangle. And there's a light to indicate which computer has focus, so you don't really want to flip it over.



Good news and bad news. I have my new keyboard, a Logitech K120, plugged in and going, and it's into my KVM USB (of which I use the K and M, as I have 3 monitors and want them all!) It's a cheap keyboard, but as friend-of-the-blog Patrick says, if it isn't an IBM Model M keyboard, it's a pretty much just a keyboard. So, I'm able to switch between my stuff with a double-tap on the Scroll Lock. And really, what else are you going to do with a Scroll Lock now that Microsoft has gone from DOS to Windows?

That's the good news. The bad news is that I don't really have much to switch between right now, as the move from Karmic to Lucid has borked my X11, as you can see above. I've copied an old, good config into place. We'll see how it goes.

ETA: Put in an old X11 config file, and that got me X again, but it's not showing great signs of stability.


Python Grrr

As mentioned earlier, I'm trying to code Sikuli, which is a tool for scripting GUI events. Sikuli uses Python, or more accurately, Jython, as the scripting syntax. I have tried to get beyond print "Hello World" in Python a few times, and have largely failed. It's simple inline stuff so far, so not much problem. But I'm wanting to group. Consider this Perl code:

use subs qw{ myFunction } ;
myFunction('x') ;

sub myFunction {
    my $x = shift @_ ;
    print qq{$x\n} ;

I open the file in the editor and my function is at the bottom and my logic is on top. This makes it easier to understand the code when it's more than one line of logic and one function.

def myFunction(x):
    print x 


This is functionally the same. Some might look at the syntax and prefer it. Fine. But if you put myFunction() before def myFunction():, you have an undefined function and an error. Which means you 1) get your logic at the bottom or 2) put your functions into a module, or whatever the term of art is in Python. I'm writing Sikuli, so I don't know exactly how many Python trics I can really do.

So, is that it? Must I put my logic at the bottom?


Absolutely Awesome Perl Modules: IO::Interactive

I'm reinstalling on another box and have a few moments to knock this out.

Say you have a batch job that does lots and lots and lots of stuff overnight, or even several times an hour. You want to know what's going on with it when you're working on it, so you add print or say statements all over.

say &do( $this ) ;
say &do( $that ) ;
say &do( $the_other_thing ) ;

And it emails you all the time, giving you status updates you don't need. So, you change it.

$debug and say &do( $this ) ;
$debug and say &do( $that ) ;
$debug and say &do( $the_other_thing ) ;

And you have to remember to set the $debug flag for testing.

Along comes IO::Interactive

use IO::Interactive { interactive } ;
say { interactive } &do( $this ) ;
say { interactive } &do( $that ) ;
say { interactive } &do( $the_other_thing ) ;

Now, it can tell if you're running interactively or not, and suppress your prints (by giving a non-writing file handle) when you don't want to print. Absolutely awesome.


Trying The Automation Thing

I think I might have it.

Sikuli, an MIT project, uses the CV library to pattern-recognize places to click. (I'll add links later, or you can Google it.) LINK

It's a bit flaky on Ubuntu, but I got it working out-of-the-box on XP. Which makes me sad, but also gives me progress.

Well, Sikuli on XP on VirtualBox on Ubuntu on old Dell hardware. This is not a fast process. But it seems to be working.

Not a replacement for having access to the API in the first place, but as it doesn't require me to a) decompile a program and b) code Java, I'll accept it.


Need Help Automating a Java GUI App

When being passed to me, it was described as an "impossible task".

We get big ugly data in a digital form. There is a big Java GUI app that munges it and gives the data in understandable PDFs and tab-delimited formats, which we can then use, or pass to our clients to use.

We want to give the clients the same thing each time, and when there are lots of steps, it's easy for people to forget a step, which makes things inconsistent.

Obviously, we would love to put this in a batchable setup, but we don't really have any way to program with the underlying libraries. So, we have the Java GUI tool. Sucks to be us.

But the goal of automating this mess is still with us.

s/goal/impossible task/mx

I'm looking at a page of tools for testing Java GUIs, but I don't strictly want to test this GUI. I want to bend it to my will. I want to master it like a Jedi masters the wills of the weak-minded. I want to consistantly, first-time every-time, have it follow my every whim, even while I'm miles away and asleep.

To put it bluntly, I want to batch-slap that thing.

Any pointers? I'm running Ubuntu and Gnome right now, but if I can get something to work, I can get a Windows or KDE or Solaris or maybe even Mac to run it on. If I can get it to work.


Absolutely Awesome Perl Modules: Cwd

It's the libraries that make a language. It's nice to have cool ways to do loops and such, but if the tool does the task you need it to do, that's what pays the bills.

This is one I've found very useful. Cwd gives you your current working directory with getcwd and it also takes a relative path or and gives you the absolute path, with abs_path.

This is a small script that sends an image path to gconftool to set as the background image. I call it gconftool is a stickler for absolute paths ('/home/user/Pictures/foo.png', for example), and I could either hack something up to make absolute paths, or I can just use Cwd 'abs_path' ;


use 5.010 ;
use strict ;
use warnings ;
use Cwd 'abs_path' ;
use IO::Interactive qw{ interactive } ;

my $command = join ' ' ,
    qw{gconftool -t string -s /desktop/gnome/background/picture_filename} ;

my $img = shift @ARGV ;
my $bg  = abs_path $img ;

say { interactive } $bg ;
say qx{$command $bg} ;

IO::Interactive is simlarly cool, but we'll get into that later.