My thoughts on food, technology, politics, running and... nope, those are the only thoughts I've got!
Monday, April 16, 2012
Emacs Colors Begone
(setq-default global-font-lock-mode nil)
I'm not sure what version of Emacs that was for, but here's what I had to do (a couple times, actually) in version 23.1.1...
M-x global-font-lock-mode
Monday, April 09, 2012
Database Dropped
Wednesday, March 07, 2012
Fun with words
- something
- tenletters
- eighteencharacters
- two words
Sunday, March 04, 2012
layout.xml -> Activity.java
(defun xml-to-java ()
(interactive)
(progn
(setq tmp (buffer-string))
(switch-to-buffer "tmp")
(insert tmp)
(goto-char (point-min))
(save-excursion
(replace-regexp "[\n\t ]+" " ")
)
(save-excursion
(replace-regexp
" *<\\(\\w+\\)[^>]*android:id=\"@\\+id/\\(\\w+\\)\"[^>]*>"
"\nprivate \\1 \\2;\n\\2 = (\\1) findViewById(R.id.\\2);\n")
)
(save-excursion
(replace-regexp " *<!-- \\([^>]*\\) -->" "\n/* \\1 */\n")
)
(save-excursion
(replace-regexp " *<[^>]*>" "")
)
(save-excursion
(replace-string "\n\n" "\n")
)
)
)
Thursday, February 23, 2012
Facebook Subscriptions
Facebook Subscriptions
Very handy if you want to unsubscribe from annoying f-book friends.
Hat tip: Quora
Thursday, February 16, 2012
Google Calendar v3 Entry Update
I've been trying to update an event and all I've been getting back is a cryptic 400 error, "unsupported output format" -- BIG HELP!!
Well maybe if it had said input format... I don't know what made me try this, but when I set the Content-Type header of my PUT request (application/json) -- IT WORKS!!
Saturday, January 28, 2012
HTTP Clients for Android
Sunday, January 22, 2012
Android Emulator | Android Developers
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!