My thoughts on food, technology, politics, running and... nope, those are the only thoughts I've got!
Friday, January 06, 2012
(Semi-) Auto-complete your declarations
Well let's say you're declaring and assigning, like this:
SomeTypeName foo = something.getFoo();
But you can't remember the SomeTypeName part. Try this instead:
String foo = something.getFoo();
Eclipse will underline the error (oh yeah, you have to be using Eclipse, but who isn't??) and all you have to do it press Ctrl/1 (or Cmd-1 if you're on a Mac) and the quick fix will pop up,
Change type of 'foo' to 'SomeTypeName'
Just hit Enter and you're done! You're welcome!! :)
Saturday, December 10, 2011
SQLite.delete with args workaround
getContentResolver().delete(LogProvider.URI, LogDatabase.COL + " < ?", new String[] { Long.toString(lval) });
But this code does:
getContentResolver().delete(LogProvider.URI, LogDatabase.COL + " < " + Long.toString(lval), null);
Don't know if it's a bug in SQLite or in the way I was calling it. Doesn't matter, it's an easy enough workaround. Hope this saves somebody else some trouble!
Monday, December 05, 2011
Ballot Experiment
GraniteGeek at the Nashua Telegraph is doing an experiment with multi-choice ballots, and anyone can participate! Wish you could endorse Buddy Roemer's effort to get money out of elections? Afraid to vote for the candidate you truly like best because you would be "throwing your vote away"? Here is a chance to play with a system that fixes all that... Give it a try!
Friday, October 14, 2011
how to get screen to stay on when plugged in? - Android Forums
Thursday, October 06, 2011
createElement + iframe = NO
IE doesn't like it. Click here for the details and a workaround.
Wednesday, August 31, 2011
Droid2 Unrooting
Anyway, here are some links I found useful:
Here are the instructions for getting RSD Lite and the SBF file you need:
http://droid2hacks.com/droid-2-hacks/how-to-unrootunbrick-droid-2-back-to-factory/
And here is a tip on what to do when you're stuck at "Please manually power up this phone" -- just go back into the bootloader (up-arrow/power) and plug back in if you became unplugged. Part of my problem may be that I was running under Parallels and I goofed when it asked me to retain the USB connection to the phone.
Anyway, here's the other thing. When you're done, if you go to your settings and it has forgotten your phone number, no need to panic. From here I learned that by dialing *228 and hitting SEND you'll connect to the automated programming system. You'll hear stuff in the earpiece but if you pull the phone away from your face, you'll actually see the phone telling you it's being programmed. As in activated.
And Here's something else I didn't know. When I was done, I still had all of my apps. I'm not sure how this is possible. I expected everything to be wiped out. Did I do it right? Did the flash really happen? I'm assuming that it did, since my phone had to be reactivated onto Verizon's network. Oh well, it does seem to have worked!
Saturday, August 20, 2011
Thursday, August 11, 2011
Add UIBinder widget to root panel
And they give this example for adding your UIBinder object to your application:
Document.get().getBody().appendChild(helloWorld.getElement());
Maybe that's OK for an HTML UIBinder. I haven't tried that.
Instead, I was using GWT widgets in my UIBinder, and I wanted to add a ClickHandler to one of my buttons. But nothing ever happened when I clicked it. Turns out, as I read on Stack Overflow, that indeed the handlers aren't initialized properly unless you add to the root panel.
So here's what I did that worked just fine:
RootPanel.get().add(helloWorld);
Wednesday, August 10, 2011
Got default constructor?
Sunday, July 31, 2011
sls (combination of ssh and ls)
Here's a little bash script I just wrote and thought somebody might find useful. I'm always moving files around using scp and also needing to ssh around to ls them. So why not combine the ssh and the ls into sls -- just like scp, right?
Here are the usage and help text...
usage: sls [ls-option]... user@host[:file]...
sls is a magical combination of ssh and ls. Simply give the sls command some (or no) ls options and one or more remote locations and you'll get a listing for each. The remote spec is the same user@host:file specification you would use with the scp command, and the file part is optional.
And here is the script itself. If you have any fixes or improvements, please let me know.
Thursday, July 28, 2011
Deploying GWT
I found a handy how-to on elitecoderz.net.
Thanks, Erik!
Tuesday, July 26, 2011
GWT widgets with radio buttons
First the problem, which was that setValue didn't seem to be doing anything -- my radioButton's weren't getting set. This isn't actually true. It turns out that if I scrolled down, one of the radio buttons on the page WAS getting set. Can you guess what was going on? That's right, all of the radio buttons from all sets all had the same name.
Heres the lesson: If you make a GWT widget that has radio buttons in it, and you use more than one of these widgets on a single page, you're going to need to make the name of each radio set unique.
And my solution: What I did was to use the hashCode of the panel that contains the buttons, and this worked just fine.
You're welcome!
Sunday, July 24, 2011
Summer nest boxes
Cut from a 1"x10"...
- a 4" piece for the front
- a 7" piece for the back
- a 17.5" piece for the bottom
- two 17.5" pieces for the sides
The front and back stand on top of the bottom, such that the interior length of the box is 16".
The sides and bottom rest on the same surface, such that the exterior width of the box is 10.75".
If you cut the 17.5's short by the width of your saw blade, you should be able to get three nest boxes out of two 8-foot boards -- one board for five 17.5's and two 4's and the other board for four 17.5's, one 4, and three 7's.
Saturday, July 09, 2011
Friday, July 01, 2011
Fun with Eclipse on Mac OS: the command/option saga
I googled all around and found nothing, nothing at all, about this. The only other thing I could think of was to submit a bug (this one) and hope that someone could point me to some page about a gotcha... or whatever.
Well the plot thickens. Turns out that if I create a new user account on the Mac, that user doesn't have the same problem. So at least I know it's not even something about my system, but rather about my normal user account. So if I can't figure out, the worst case solution is I have to switch users to run Eclipse. Maybe I'd just switch to a new user account instead and move all my stuff to it.
But before I do all that, I'll see if I can figure out what it is about my account that's causing this. If I find any answers, I'll be posting them here.
Update: I tried a bunch of things -- moving all of the Preferences out of ~/Library, moving .* out of ~, moving Application Support files... I finally got fed up and just created a new account. Oh what fun this will be! :/
Wednesday, June 29, 2011
Kensington Universal Multi-Display Adapter
I've got a Kensington Universal Multi-Display Adapter hooked up to my Mac Mini, so I can have two displays. Works really great, but... whenever the power goes out and the system shuts down, I'll start it back up and that monitor is dark, dead, like a paperweight.
Want to know what I did to fix it? It's really complicated. Unplug the adapter from the system and plug it back in. Yes, that's all. Only took me an hour this time to think of that. Maybe next time I'll google it and end up back here and ::facepalm:: suffer for only a few minutes.
You're welcome, self!!
TweetDeck
Try it yourself, it's in the Android market: here.
Update: one thing I found kind of annoying is that I couldn't figure out how to switch the order of the columns. Maybe someone can give me a better idea how to do this, but I ended up jotting them down, deleting them (the "home" and "me" columns can't be deleted) and re-adding them. Hey, it worked!
Sunday, June 26, 2011
Speaking of Ubuntu (which rocks, by the way)
Installing Eclipse (on Ubuntu, of course)
Wednesday, June 22, 2011
SCP and spaces
Its advice didn't work for me out of the box, however.
What I ended up doing instead that did work was this:
scp -r 'myserver.com:"/path/with/a/Space\ In\ It' ./
Which is to say that I single-quoted the whole source argument and single-escaped each space.
I'm dealing with left-parentheses similarly:
scp -r 'myserver.com:"/path/with/a/Space\(s)\ In\ It' ./
Looks like there are other characters I need to escape, like single quotes, but I'm not going to worry about those right now. If you have any idea about escaping those in this context, please leave a comment.