Friday, January 31, 2014

Pet Peeve: "infinite number of"

Welcome to my long list of pet peeves, "infinite number of"!!

Why say "infinite number of monkeys" when you can just say "infinite monkeys"??

Tuesday, January 28, 2014

Solaris TAR with Excluded Directories

It's been a long time since I had to use Solaris, and tar is bad enough without the differences between Linux and my previously favorite Unix!

$ tar cfX - /tmp/excludes . | gzip > ~/excluded.tgz

where /tmp/excludes looks like this:

./sub1
./sub2
./sub3

So it's not just a list of what's excluded, it's starting with the dot!

hattip: thank you, My Couple Of Cents!!

Saturday, November 02, 2013

Android SQLite queries and numeric predicates

The typical code for making an Android SQLite query goes something like this:

Uri uri = MyProvider.URI;
String[] projection = ...;
String where = COLUMN_NAME + "=?";
String[] whereArgs = new String[] { someValue };
String sortOrder = SORT_COL + " " + sortDir;
Cursor c = getContentResolver().query(uri, projection, 
  where, whereArgs, sortOrder);

But what if someValue isn't a String? What if you want to query your database on a numeric column? I was bashing my head against this and getting wrong results until I stumbled onto the suggestion that the "?" argument needs to be converted to a number. How to do it? Just add zero.

long someValue = ...;
Uri uri = MyProvider.URI;
String[] projection = ...;
String where = COLUMN_NAME + "=(?+0)";
String[] whereArgs = new String[] { Long.toString(someValue) };
String sortOrder = SORT_COL + " " + sortDir;
Cursor c = getContentResolver().query(uri, projection, 
  where, whereArgs, sortOrder);

You have to pass your selection arguments as an array of strings, so you'll use toString for that. But the query itself can use an addition operation to convert the string argument to a number. See the "+0" in the where string? That's it.

Maybe there's another, even better way, but this solved my problem - my queries now return just what they're supposed to. All you need is plus.

Tuesday, October 22, 2013

World Series Match-Ups

How many times have the Red Sox and Cardinals played each other in the World Series? This is the fourth time. The others were in 1946, 1967 and 2004. I was alive for two of those - can you guess which ones?

In case you're wondering about other match-ups, here is the complete list of which teams have played each other how many times.

11 Dodgers & Yankees
 7 Giants & Yankees
 5 Cardinals & Yankees
 4 Athletics & Giants
 4 Braves & Yankees
 4 Cubs & Tigers
 3 Cardinals & Red Sox
 3 Cardinals & Tigers
 3 Reds & Yankees
 2 Athletics & Cardinals
 2 Athletics & Cubs
 2 Athletics & Dodgers
 2 Athletics & Reds
 2 Braves & Indians
 2 Cubs & Yankees
 2 Giants & Senators
 2 Orioles & Pirates
 2 Phillies & Yankees
 2 Pirates & Yankees
 1 Americans & Pirates
 1 Angels & Giants
 1 Astros & White Sox
 1 Athletics & Braves
 1 Athletics & Mets
 1 Blue Jays & Braves
 1 Blue Jays & Phillies
 1 Braves & Twins
 1 Brewers & Cardinals
 1 Browns & Cardinals
 1 Cardinals & Rangers
 1 Cardinals & Royals
 1 Cardinals & Twins
 1 Cubs & Red Sox
 1 Cubs & White Sox
 1 Diamondbacks & Yankees
 1 Dodgers & Orioles
 1 Dodgers & Twins
 1 Dodgers & White Sox
 1 Giants & Indians
 1 Giants & Rangers
 1 Giants & Red Sox
 1 Giants & Tigers
 1 Giants & White Sox
 1 Indians & Marlins
 1 Indians & Robins
 1 Marlins & Yankees
 1 Mets & Orioles
 1 Mets & Red Sox
 1 Mets & Yankees
 1 Orioles & Phillies
 1 Orioles & Reds
 1 Padres & Tigers
 1 Padres & Yankees
 1 Phillies & Rays
 1 Phillies & Red Sox
 1 Phillies & Royals
 1 Pirates & Senators
 1 Pirates & Tigers
 1 Red Sox & Reds
 1 Red Sox & Robins
 1 Red Sox & Rockies
 1 Reds & Tigers
 1 Reds & White Sox

Source: Wikipedia, of course! ðŸ˜ƒ

Wednesday, August 07, 2013

MySQL Reference

Doing some MySQL work over the past couple of days, I googled a couple topics I needed help with, and both times I ended up at the same place.

So thanks, nixCraft, for the assist!!

Tuesday, July 02, 2013

Upgrading Debian

Upgrading from Squeeze to Wheezy

Why? Why not!!

Actually, it's because of the whole google-chrome-stable and gconf-blah-blah business. It's scrolled off my screen, but it's all over the internets.

Mainly I'm following the steps I found here at HowtoForge.

Updated my sources.list, just replacing squeeze with wheezy

Did an update and an upgrade, started to do a dist-upgrade, but got this error:

E: Could not perform immediate configuration on 'openjdk-6-jre'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)

Did this to continue:

sudo apt-get remove default-jre
sudo apt-get remove openjdk-6-jre

Now it's running... we'll see what happens next!

How about being WAN'd in via SSH and my end goes sleepy or wonky? Yikes!! But I did a:

sudo dpkg --configure -a

and the dist-upgrade is chugging along again.

A word of advice to whoever is responsible for configuration files: It sure would be nice if I could resolve all of the config conflicts either before or after the upgrade. Having the upgrade pause for me to Z and cp and blah blah blah, that's annoying.

And it's done. Now to fix the above:

sudo apt-get install default-jre
sudo apt-get install google-chrome-stable



Ta-da! It works! Even Chrome is back!!

Friday, June 21, 2013

Starting Oracle

This is what happens when I don't write stuff down. Fortunately I was able to piece together what I needed to remember when starting up my database after a reboot. And now I'm writing it down!

$ cd install-area/oracle11/software
$ setenv ORACLE_HOME `pwd`

$ setenv ORACLE_SID orcl

$ ./bin/sqlplus 'sys/password as sysdba'

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jun 21 06:35:36 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
.
.
.

$ ./bin/lsnrctl start

Filed under note-to-self and let's hope next time I remember there is a note!


Monday, March 18, 2013

Debian Console Mode?

I got myself stuck in VNC full-screen mode and like any good monkey just started pressing random key combinations. And I actually stumbled onto something magical and useful!

Sunday, March 17, 2013

Debian Wireless (solved)

I was struggling quite a bit with the Wi-Fi on the TiBook. Then for some reason I rebuilt Debian and had a chance to start over.

Sunday, March 10, 2013

My Apache setup

What, no notes to self about my previous Apache installation? Well how about I do that this time...

Friday, March 08, 2013

Debian on the TiBook!

I've got Debian on my TiBook!!

Tuesday, March 05, 2013

Firefox already running? Not.

Dear Me,

Next time Firefox won't start and complains of "Firefox is already running but is not responding..."

Sunday, February 24, 2013

I have a new favorite OS!

I have a new favorite OS - spoiler alert, it's Debian!

Friday, February 08, 2013

Where the streets have node names

Have you ever googled your email address? If you do, you'll find all kinds of things you've posted on the internets. And for once I'm not using that word sarcastically!

Thursday, January 03, 2013

Samsung 923NW Screws

Got a Samsung 923NW? Did you take the stand off and lose the screws? And now you want them back?

Monday, December 10, 2012

TightVNC selection sharing

With RealVNC you use vncconfig, but according to this post by a guy named Thomas, this is what you'll put in your xstartup for tightvnc:

autocutsel -s PRIMARY -fork

Thanks, Thomas from the Internets!

Reverting iTunes to 10.6.3 -- yes, you can!!

Do you hate iTunes 11 as much as I do? Are you so angry with Apple that you're ready to throw your Mac through a window? Please, open the window first and make sure there is nobody on the ground below.

OR... (better yet, DON'T INSTALL ITUNES 11!! -- I hope somebody reads this before it's too late)

Sunday, December 09, 2012

VNC keymap swap

Ahhhhhhhhhh! (that's the choir of angels sound)

I switched to tightvncserver hoping that my vnc crashing will go away ::fingers crossed::

Saturday, December 08, 2012

MySQLdb ≠ autocommit

Something else I've learned recently is that MySQLdb disables autocommit.

Permission and PSP Import

If you have a PSP page and you're trying to import a custom module and you get an error like this:

ImportError: No module named mymodule

Wednesday, December 05, 2012

Getting older sucks!!


;;(mouse-set-font "-misc-fixed-medium-r-normal--13-*-*-*-c-70-iso8859-1" "7x13")
(mouse-set-font "-misc-fixed-medium-r-normal--15-*-*-*-c-90-iso8859-1" "9x15")

Saturday, November 10, 2012

Trot Diamond, 2005-2012

Trot has gone to herd the chickens in heaven. He was born with fifteen years of love inside him, but used them up in only seven. 

Saturday, October 06, 2012

113 hours

I just finished with a project I've had on my list for the longest time. I watched all seven seasons of The West Wing, my favorite TV show of all time. It only took me 40 days to watch 154 episodes, about 113 hours running time. And no, I have no idea how I managed that!

Wednesday, October 03, 2012

Android Calendar tip

I stumbled onto a useful feature in the Android Calendar this morning.

I'd been trying without any luck to find a way to make Agenda the default tab. I'd long given up wondering why the Week view wasn't available anymore.

Then mostly out of frustration, I long-pressed the Agenda icon and all of a sudden I was looking at this screen:



So it turns out you can choose which Calendar views to choose from and which order they appear in at the bottom of the Calendar screen. Yay!

Saturday, September 29, 2012

Ubuntu notes

Some Ubuntu notes-to-self, because I'm running over VNC and don't have the whole start menu thing going on...
File Manager $ nautilus
Terminal $ gnome-terminal
System Settings $ gnome-control-center
Update Manager $ sudo update-manager
Backup deja-dup (ui?)
$ wmctrl

Wednesday, September 05, 2012

VNC tip

I was connected to one of my VNC servers with Chicken and I don't know why, but all of a sudden I got an error, was disconnected from the server, and wasn't able to reconnect...

Unknown message type 5

The google wasn't much help, so I just tried stabbing at it, and luckily, it didn't take long for something to happen.

Turns out that if went to the Connection Profiles and UN-checked ZRLE, I was able to reconnect again.

Nope, it's happening again.  :-(

But fortunately, Mac OS's built-in Screen Sharing does seem to work just fine. :-)

Useful ssh tricks

Here are a couple useful things I found recently: Corkscrew, for ssh-ing out of a firewall Using ssh -L to set up a port you can VNC through

Thursday, August 16, 2012

Rezound ICS Linking Fixed!!

After the recent over-the-air upgrade of my HTC Rezound to Ice Cream Sandwich, I found that an important feature of Android (and indeed of every operating system) no longer worked: clicking links no longer launched the application responsible for handling that type of link.

I found the problem written up on Talk Android and realized I had a couple of choices:

  1. I could restore my Rezound back to Gingerbread (Oh no you can't)
  2. I could root my phone and make the fix.

As technical as I am, rooting is still kind of scary/daunting. I was really wishing I could go back to Gingerbread. But the Ice Cream Sandwich is so tasty! So root it would be.

My first search led me to an extremely helpful guide on Android Forums. I followed the instructions there for unlocking my bootloaded using htcdev, a tool that HTC provided. One thing I should say here is when the instructions call for using adb on the PC, you want your phone to be up and running and plugged into your PC. If you're using fastboot on the PC, your phone will want to be in the fastboot state, which, as much as it should have been obvious to me, wasn't at first.

Then I installed Amon Ra as my recovery, and I'm linking to it because that's proper, but you really should go to Android Forums and read up on all of this.

And next, to be honest, I wasn't quite sure what to do. I was under the FALSE impression that you needed to flash a ROM to be root. Don't know why I thought that, but it's not the case.

But where I ended up at this point was really great, the All-In-One Tool. It would have done the bootloader unlocking for me if I hadn't done that already. It also does five flavors of recovery flashing, which I wasn't needing at that point. What I did need, though, was Super User. And the instructions were muddy clear, so let me add some advice about that. You want to run the Perm Root (GB/ICS) command while the phone is plain old up and running, since adb is used to push a zip file, SuperSU.zip. It's after that file has been pushed that you want to reboot into recovery and use that recovery's zip installer. The output of the Perm Root command tends to give the impression that you're already rooted, but that's not the case until you've used recovery to do the installation of the zip.

So now I was rooted, but I wasn't done. I had copied /system/build.prop to my desktop, made the necessary edits* and pushed it back to my phone as /sdcard/build.prop.new, but I needed to put it back into /system. To do this, I used Mount /system (rw / ro) to make /system writable and I used Root Explorer (File Manager) to move build.prop.new to /system, rename build.prop to build.prop.old and finally rename build.prop.new to build.prop.

*Oh, and by the way, I found "ro.da1.enable" in build.prop twice, so I just made all of the changes twice.

Once I rebooted my phone, the good old linking behavior was fixed. Just as for centuries, clicking a Microsoft Word Document link on my desktop browser has always launched Microsoft Word, clicking on an Amazon MP3 link now launches the Amazon MP3 app, just as the gods intended.

Now that I'm able to declare victory, thanks to lots of help from the Internets, I'm off to click some thank-you and donation buttons.

Saturday, August 11, 2012

Screen capture!

My HTC Rezound has been upgraded (ha!!) to Ice Cream Sandwich, and I wondered whether screen shots might be possible. It is!! Just power/vol- and voila!!


Monday, April 16, 2012

Emacs Colors Begone

Thanks to Bjørn Hansen, I now know how to rid my Emacs of the annoying syntax coloring!

(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

If you're like me, you will someday experience that terrifying, dreadful feeling upon reading these words on your phpMyAdmin screen...

Wednesday, March 07, 2012

Fun with words

What do each of the following have in common?

  • something
  • tenletters
  • eighteencharacters
  • two words

Sunday, March 04, 2012

layout.xml -> Activity.java

I made a bunch of changes to a layout file this morning and wished I had a quick way to get all of those elements into my java code so I could make it go. So I popped into Emacs and wrote a little function to do it! And here it is. Enjoy!
(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

Here's another link I can never find when I need it... maybe you need it to!

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

Here's something that would make a nice addition to the Google Calendar Developer's Guide (v3)...

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

Android Developers Blog: Android’s HTTP Clients

I read the above post back in the fall and thought, "yeah yeah, I'm using HttpURLConnection, so need to think about this at all."

Well this week I found some odd, frustrating behavior and decided to try the Apache HTTP Client to see if it gave different results. And oh boy, does it -- it always just works!

OP Jesse says Apache has "fewer bugs" on Froyo, which is my target release. I guess I should have switched sooner. But now I have!

Sunday, January 22, 2012

Android Emulator | Android Developers

I can never find this when I need it, i.e. when I forget which keys simulate the menu and search buttons. Note to self, they're F2 and F5.

Android Emulator | Android Developers

Friday, January 06, 2012

(Semi-) Auto-complete your declarations

Too lazy to type the class name of the variable you're declaring? Or maybe you can't remember the exact name of the class.

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

This Android SQLite code wasn't working:

    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!

Survey

Friday, October 14, 2011

how to get screen to stay on when plugged in? - Android Forums

Want to listen to music with your Android device plugged in and keep the screen from shutting off? I did, and it was driving me crazy! I found the answer at Android Forums -- it's in Settings under Development, of all places!!

Thursday, October 06, 2011

createElement + iframe = NO

Don't use createElement to create IFRAME elements.

IE doesn't like it. Click here for the details and a workaround.

Wednesday, August 31, 2011

Droid2 Unrooting

I'm unrooting my Droid2 in case I ever need it to have that new-droid smell.

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!

Thursday, August 11, 2011

Add UIBinder widget to root panel

This page from the GWT doc is very helpful for getting start with UIBinder.

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);

Thanks, Hilbrand!

Wednesday, August 10, 2011

Got default constructor?

got this error?

was not included in the set of types which can be serialized by this SerializationPolicy

could be you're missing a default constructor, like I was.

thanks, holyjeez!!

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.

p.s. Blogger, when I write a post in HTML, please let me edit it the same way... thank you. And to visitors from the future, if you find yourself needing to edit your HTML-written post, it's actually easy now that I think about it. Just ask your browser to show you the source, grab what you need, and paste that back into the post editor.

Thursday, July 28, 2011

Deploying GWT

I'm ready to try deploying my GWT app to WLS... so how u do dat?

I found a handy how-to on elitecoderz.net.

Thanks, Erik!

Tuesday, July 26, 2011

GWT widgets with radio buttons

Here's something I learned today.

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

This is mainly a note-to-self about how to make summer nest boxes, the kind that are open on top. I'm always forgetting the dimensions.

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.

Which nails to use? I'll be back to answer this all-important question.

Saturday, July 09, 2011

Google+!!

That's a lot of punctuation.

But here I am!!

https://plus.google.com/110123658033707277435

Friday, July 01, 2011

Fun with Eclipse on Mac OS: the command/option saga

When I tried to run Eclipse on my Macbook Pro the other day, I discovered that the command and option keys were reversed. If I tried to Paste with cmd-V, I'd get some funny character, but if I typed opt-V, it would paste. Instead of quitting, cmd-Q would insert this "Å“" character, which is supposed to be input via opt-Q, which instead would quit me from Eclipse. Yeah, loads of fun.

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

This is kind a note-to-self, but maybe it will help somebody else some day.

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

I've tried a few different Twitter/Facebook apps, but just tried TweetDeck... LOVE IT!! SWITCHED!!
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)

Hey, speaking of Ubuntu, I didn't mention that I upgraded to 11.04 (natty what?) and have not had a single problem since with the whole suspend/restore on this Dell Latitude C640 that I sometimes use. Thanks, Ubuntu -- you all rock!!

Installing Eclipse (on Ubuntu, of course)

It sure is nice to have the package manager for installing software, but sometimes it's out of date. In the case of Eclipse, I think it gave me the G release, whatever that was, but the latest is Indigo, which you can download from whereverz. And I found a handy page explaining how to "install" it.

Wednesday, June 22, 2011

SCP and spaces

I was looking for help with linux SCP and spaces in file names. I found a somewhat helpful link here: http://www.thingy-ma-jig.co.uk/blog/14-05-2007/how-to-scp-a-path-with-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.

Wednesday, May 25, 2011

One less hyphen to kick around

I have decided to stop hyphenating the word "email".

That's all for now.

Friday, March 25, 2011

Changing Ubuntu screen resolution

As I noted in the previous post, I have gotten resume to work. However, when the screen appears, the resolution has changed. Obviously you can click
System -> Preferences -> Monitors
and change the resolution there, but I googled around and stumbled onto a command line solution -- this is the command that did the trick:
$ xrandr -s 1024x768

Tuesday, March 22, 2011

#resume-fail

pm_op(): pci_pm_resume+0x0/0xa0 returns -16
PM: Device 0000:00:00.0 failed to resume async: error -16


This is a Latitude C640, by the way, in case anyone else is searching for a fix for this... if someone should stumble in here, please leave a comment, even if you don't find an answer, so I can follow up and see how you did.

In the mean time, I've set my lid-close behavior to hibernate, which does seem to work. Odd thing about that, though, is it displays a similar error (with "resume" replaced by "thaw") when the hibernate is taking place. But it does shut itself off and restart does restore the system properly.

UPDATE: I found a post on Ubuntu Forums that mentions a different issue, but the solution seems to help -- here's my /etc/default/acpi-support file...

#
# Configuration file for the acpi-support package
#
#
# The acpi-support package is intended as "glue" to make special functions of
# laptops work. Specifically, it translates special function keys for some
# laptop models into actions or generic function key presses.
#


#
# Suspend/hibernate method
# ------------------------
#
# When gnome-power-manager or klaptopdaemon are running, acpi-support will
# translate the suspend and hibernate keys of laptops into special "suspend"
# and "hibernate" keys that these daemons handle.
#
# Only in situations where there is no gnome-power-manager or klaptopdaemon
# running, acpi-support needs to perform suspend/hibernate in some other way.
# There are several options for this. The options are:
#
# dbus-pm:
#    Perform suspend and hibernate actions via a DBUS request to the power
#    management daemon. This works for power management daemons that we don't
#    know of. (For gnome-power-manager and klaptopdaemon this will do nothing,
#    since those will be detected when they are running, and triggered using
#    a virtual keypress.)
#
# dbus-hal:
#    Perform suspend and hibernate actions via a DBUS request directly to HAL,
#    bypassing any running power management daemons.
#
# pm-utils:
#    Use pm-suspend and pm-hibernate to suspend and hibernate. (The dbus method
#    normally results in this as well, but calls through dbus. Use this option
#    only if you don't have dbus installed.)
#
# hibernate:
#    Use the hibernate package to suspend and hibernate.
#
# acpi-support:
#    Use the legacy built-in suspend/hibernate support. (DEPRECATED)
# 
# none:
#    Do not attempt to suspend/hibernate. Set SUSPEND_METHODS="none" to
#    disable suspend/hibernate handling in acpi-support.
#
# If you specify dbus or pm-utils, the result will normally be the same as when
# you suspend from your desktop environment. If you specify "hibernate" or
# "acpi-support", be aware that this probably does not match what your desktop
# environment would do (unless you have managed to configure something so that
# the DBUS power management interfaces call the hibernate package).
#
#
# Please specify a space separated list of options. The recommended value is
# "dbus pm-utils"
#
SUSPEND_METHODS="dbus-pm dbus-hal pm-utils"



#
# LEGACY BUILT IN SUSPEND SUPPORT (DEPRECATED)
# --------------------------------------------
#
# These options only work for the "acpi-support" suspend method. This is NOT
# recommended, but is retained for backward compatibility reasons.
#

# Comment the next line to disable ACPI suspend to RAM
ACPI_SLEEP=true

# Comment the next line to disable suspend to disk
ACPI_HIBERNATE=true

# Change the following to "standby" to use ACPI S1 sleep, rather than S3.
# This will save less power, but may work on more machines
ACPI_SLEEP_MODE=standby

# Add modules to this list to have them removed before suspend and reloaded
# on resume. An example would be MODULES="em8300 yenta_socket"
#
# Note that network cards and USB controllers will automatically be unloaded 
# unless they're listed in MODULES_WHITELIST
MODULES=""

# Add modules to this list to leave them in the kernel over suspend/resume
MODULES_WHITELIST=""

# Should we save and restore state using the VESA BIOS Extensions?
SAVE_VBE_STATE=false

# The file that we use to save the vbestate
VBESTATE=/var/lib/acpi-support/vbestate

# Should we attempt to warm-boot the video hardware on resume?
POST_VIDEO=true

# Save and restore video state?
# SAVE_VIDEO_PCI_STATE=true

# Should we switch the screen off with DPMS on suspend?
USE_DPMS=true

# Use Radeontool to switch the screen off? Seems to be needed on some machines
# RADEON_LIGHT=true

# Uncomment the next line to switch away from X and back again after resume.
# This is needed for some hardware, but should be unnecessary on most.
# DOUBLE_CONSOLE_SWITCH=true

# Set the following to "platform" if you want to use ACPI to shut down
# your machine on hibernation
HIBERNATE_MODE=shutdown

# Comment this out to disable screen locking on resume
LOCK_SCREEN=true

# Uncomment this line to have DMA disabled before suspend and reenabled
# afterwards
DISABLE_DMA=true

# Uncomment this line to attempt to reset the drive on resume. This seems
# to be needed for some Sonys
# RESET_DRIVE=true

# Add services to this list to stop them before suspend and restart them in 
# the resume process.
STOP_SERVICES=""

# Restart Infra Red services on resume - off by default as it crashes some
# machines
RESTART_IRDA=false

# Add to this list network interfaces that you don't want to be stopped
# during suspend (in fact any network interface whose name starts with
# a prefix given in this list is skipped)
SKIP_INTERFACES="dummy qemu"

# Note: to enable "laptop mode" (to spin down your hard drive for longer
# periods of time), install the laptop-mode-tools package and configure
# it in /etc/laptop-mode/laptop-mode.conf. 

Do-over!

Well I'm glad I did that, the writing down of what I was installing on this Linux system. Or should I say that Linux system? The disk was bad, I'm pretty sure. I could install Windows on it, but Linux just had a hard time with it. I kept getting this error on restore -- the kind that happens after a suspend. I'm really, really hoping I don't run into the same thing on this new install. The other bummer is that other disk is 250GB and this one is only 30GB. Oh well, this system is more or less an experiment and I'm months from a new laptop that has to be the one true laptop.

Wednesday, March 16, 2011

How I roll Linux

I was going to write a note-to-self post, something to keep track of system changes on this laptop I'm setting up with Ubuntu (and Windows, which is a long story)...

I'm installing Linux

Hey, guess where I'm writing from? I'm installing Linux right now!

This post isn't about the fact that I'm on this crazy lovefest with Linux, which certainly isn't news.

No, I'm running the browser and writing this post WHILE I'M INSTALLING!!

This happens to be the umpteenth time I've tried to install on this one hard drive -- it's a long story, every chapter of which ends with "Error: out of disk" and some kind of Grub recovery prompt that doesn't do anything... so I ended up repartitioning, putting 40GB in for Windows to see if NTLDR will save me. We'll see. And if it does, it will be thanks to an article on linux.com.

Anyway, I was -- still am -- in the middle of the latest install and Ubuntu has this little slide show going on showing you all the cool things about 10.10 -- and believe me, Ubuntu has lots of coolness, which is why I'm working so hard getting it onto my biggest spare laptop drive...

Anyway, among the slideshow blurbs was a link to Ubuntu's support page... and it was clickable... so I clicked it... and the browser came up... and the install is still going on... totally amazing!! I wonder how you'd be able to bring up the browser, or anything else on the Live CD, and with any luck I won't have any more opportunities this morning to find out!! ::fingers crossed::

Thursday, March 10, 2011

With a name like Blekko...

"With a name like Smuckers, it has to be good," isn't that what the ads say? Yes, I've confirmed that, using none other than the beta-labeled search engine Blekko. And with such a stupid name, it would have to be great, right? Maybe I'll search for that phrase again in a few days and see where it leads me. But searching with "/date" for "EMPIRE, Wargame of the Century" did not bring me back here. I have to confess, seeing that "/date" made me nostalgiac for VAX/VMS (sorry, Alpha and Open -- you don't rate anywhere nostalgia-wise for me). Hey, maybe my site is one of the millions that Blekko banned, which I read about in the New York Times -- and oh yes, that is how I learned of this new search engine. OK, here's another experiment, since I'm feeling all scientifical -- what if I were to coin a word like experimiftical? It's an adjective describing someone annoyed by search results and making up words to use as test cases. Come on, Google and Bing, I know one of you can do it, but Blekko? I'm not so sure.

Update (4:58 a.m.) go ahead and try to create a word on Wiktionary, but some guy will delete your page before you can even see it in the search results! #jackwagon

Update (~6:45 a.m.) a Google search already includes my test word, but they do have a leg up, this being a Google-hosted blog after all.

Update (Friday) 24 hours later, only Google has my results!

Monday, March 07, 2011

Working with TOPS-10 .TAP files in SIMH

Step 1: mount request
.assign mta0: tape:
.mount tape:/reelid:??????/nowait
Step 2: mount the "tape"
(go to SIMH and hit ctrl/E to interrupt the simulator)
sim> set tu0 lock
sim> attach tu0 /path/??????.tap
sim> go

.r opr

OPR>shoW queUES 
OPR>
21:04:05                -- System Queues Listing --

Mount Queue:
Volume    Status     Type     Write    Req#   Job#          User
-------  --------  --------  -------  ------  ----  -------------------
T10FOR   Waiting   Magtape   Locked        4     2  OPR    [1,2]
   Volume-set: TAPE
   Label-Type: No, Tracks: 9, Density: 1600 BPI
There is 1 request in the queue

OPR>ideNTIFY (device) mta0: (with) reQUEST-ID 4
OPR>
21:04:29        Device MTA0  -- Volume T10FOR reassigned --
                User: OPR    [1,2] Job #2

OPR>exit
Step 3: restore the files
.r backup

/tape tape:
/files
/rew
/restore dsk:=[*,*]*.*
With a tip of the hat to www.asun.net for help with the first two steps.

Sunday, March 06, 2011

Empire, another timewaster from my youth

People are always asking me, "Dave, you're so good at wasting hours and hours on trivial nonsense... what's your secret?"

Well here's the latest gem of my youth: EMPIRE, Wargame of the Century. Just log into your nearest Ubuntu system and say "$ empire" -- you'll thank me, I'm sure!!
    ...+++++++...      .++++++++.........+..  .+.  0 S 
...+++++aX+..........+++A+A++.........AA. .+. e
+++Xa+++..a++............+O+.........++AA. .++ 2 c
.+++++++...++++...........++........++AAOA....++ t
..+++++.....+++++...........+.........A++AA...+++ 4 o
++++++.......+++......................+AAA....A++ r
++................+++............T...........A+O+ 6
+X.........p..T...A++++.....................A++++ 5
a+++.++++........AO+++++..+..........++.....+++++ 8
+++a++........AA++A++++++.......++++....AA+++. R
++X++......A++++A++++++......+++++....A+++.. 10 o
++aaa......AAA+AAAO++++O....++++++.....+O.. u
++++a.....AA......++A+....A++O++......... 12 n
+++a+....................A++++A......... d
aa......................+A+++++....... 14
aa......................A+++++++...... 1
aa....................AOA+A++++...... 16 7
a++....................AAAAA+OA++... 8
.aXa....................AAAAAAA++... 18
........++++.......+++.......AA+A..
.....+X+++...... ++.. ....AA... 20
....++++a...... +... ........
...+++ a.... ++.. ....... 22
... +.. .....
+....... 24
.......
..... 26
...

My hope was to build this from the Fortran/Macro sources on TOPS-10, but that didn't pan out -- many undefined symbols in the Link. But this updated version is definitely the next best thing!

Friday, March 04, 2011

Setting javax.net.ssl.trustStore in JDev

While running an application deployed to my integrated WLS instance, I was seeing this error:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

And trying to solve it using the program attached to this post.

Unfortunately when I'd run it, instead of seeing the same error as above, I'd see this:

No errors, certificate is already trusted

And here's why: I noticed when JDeveloper started up WLS, it was setting

javax.net.ssl.trustStore=%OH%/Middleware/wlserver_10.3/server/lib/DemoTrust.jks

But when I ran InstallCert, it was instead referencing a keystore that does contain the certificate I need

%OH%/Middleware/jdk160_21/jre/lib/security/cacerts

It turns out that in JDev preferences, setting Client Trusted Certificate Keystore will change the value of javax.net.ssl.trustStore. A quick restart of WLS and your app is working great!

Java switches

Why can I never remember this?

$ javac -d ./classes ...

$ java -cp ./classes ...

I.e. I can never remember which one gets the -d and which gets the -cp. I need to make up a little song or something.

Wednesday, March 02, 2011

No more crashes!

My Droid 2 was crashing waaaay too much. Or should I have said wayyyy? It's hard to know. I never let it bother me too much until one day when my phone felt physically hot in my pocket and after setting it on my desk, I heard the tell-tale buzz of rebooting. Enough. I wish I could remember which site I was reading that led me to an idea of a culprit, because they deserve credit for what I'm about to tell you. Which is that Advanced Task Killer is no longer on my phone, and ::knock on wood:: it has been nearly crash-free (once) ever since. Come to think of it, the article I read might not have named the software, but just blamed task killers in general. Maybe the fault lies elsewhere and ATK is being blamed unfairly, but the result of removing one app does tend to speak pretty loudly for itself.

Too many windows

Every now and then I'll click a link in the Android browser and an alert will pop up, telling me I have too many windows open. Should I blame the web programmer for insisting that a new window be created? No, he/she might never have imagined their site being used on my tiny, wondrous computer. The developers of the Android web browser, on the other hand, had a pretty good idea where their program would be running and should have left the new-window decision up to me. The very idea of multiple windows, unless the user has requested such a thing, seems contrary to the natural flow of the Android UI. So let it never be said that this Phandroid never had a critical word for Google, even if it is a small one.

Monday, February 28, 2011

An old map

This *should* be an old map, but the truth is I just drew it. Anyone care to take a guess at what it is?
                          refrigerator  
|
N/S
closet | | u:A
| ENS------ENW-------------C/UDWS
N/S | d:B
| | | u:B |
ENS----------ENW----(-----------------A/UDWS |
| | d:C |
| | | | u:C | |
| ENS----ENW----(----------B/UDWS | |
| | | d:A | |
| | u:F | u:E | | |
| ENS--D/UDWS ens--F/UDWS ENS-- ENS-- |
| | d:E | d:D | | |
| | | | | | | |
| | | --ENW----ENW----ENW-- | |
| | | | |
| --ENW----ENW------------------------ENW-- |
| |
| u:D |
ENS--------E/UDWS ENS--
| d:F |
| | |
--ENW----------ENW------------------------------ENW--E/W--torture

Sunday, February 27, 2011

Google algorithm changes and eHow

I believe wholeheartedly that Google is doing the right thing by changing their algorithm and trying to reduce spam.

But having said that, I needed to look up the specs on some computers this morning and eHow came up in the result all three times. OK, that's kind of weird, right? In one case, I was able to get my information from one of the other results. But in the other two, I wouldn't have gotten the answer unless I'd clicked eHow's article.

I don't know what all this means, since eHow is still on Page One, but maybe it was only because the other results were pretty crappy.

Monday, February 14, 2011

I heart Emacs

How would I ever get anything done if I couldn't hack my own customizations to Emacs?

And REALLY, Blogger?? I can't use <3 in the subject of a post? COME ON!!

Saturday, February 12, 2011

Twitter rant #43

Clicking a #hashtag is really great when you want to see the same message retweeted 100 f-ing thousand times #fail

Friday, February 11, 2011

Green

Recycle? The wide-mouth plastic caps of some juice bottles can be RE-USED as handy fruit stands!


Wednesday, February 09, 2011

dude_memory_exists => false

its shocking how I ALWAYS have to refer to the documentation every time I use array_key_exists -- I can never remember the order of the parameters!!

Monday, February 07, 2011

Android meet iTunes

I kind of hated to do it, but I've bought The Missing Sync for Android to keep the iTunes on my Mac in sync with my Droid 2. I say "hated" only because I figured there would be something else out there I could pay a buck for and be done. But sometimes you get what you pay for and in this case the thirty bucks (upgrade from the Pocket PC version) was well worth it. I had tried a different solution (the one dollar one) and it just wasn't doing it for me. I switched over the weekend and after a few hiccups (everything in there twice until I nuked it all and started over) I'm thrilled with how well it's working -- over USB (which I strongly recommend for getting started), Wi-Fi (best way to do it on the home network) and Bluetooth (for everywhere else).

Friday, February 04, 2011

Tap tap tap

Is this thing on? Hey maybe I'll get back to blogging now that there's a handy Android app!!

Saturday, December 04, 2010

Sunday, August 29, 2010

Photo!

Self-portrait of an artiste!
Posted by Picasa

Toria goes to college

Here is a picture of Toria at here desk in her college dorm room!
Posted by Picasa

Thursday, August 12, 2010

Off to the races!

Monday, August 09, 2010

Be sure to check out the e-stim cam on you-tube!

Saturday, August 07, 2010

I've been caught cheating at the yellow car game

Sunday, July 25, 2010

Right now, thousands of tourists are sitting in traffic, wondering why they didn't book that extra day and go home on Monday.
There are four bars at Horton Center. I'm not sure about cell service, though.

Friday, July 23, 2010

Power's out. How exciting! Anybody else?

Tuesday, July 20, 2010

Yesterday in the kitchen at work there was a teddy bear wearing a t.shirt... Today the bear is naked. What's up with that??

Saturday, July 17, 2010

Most people have a cat that brings them a gift of a mouse now and then... We seem to have a spider who has caught us a very lovely fly!

Thursday, July 15, 2010

Freud's Last Session at Peterboro Players is excellent!
Hey Nashua - come on down to the Elks and give blood!

Saturday, July 10, 2010

I was trapped for a while under the EZ-up but decided not to spend the rest of my life there and made a run for it -- with three chairs and a hammer

Thursday, June 24, 2010

I'm network-free... Thanks, Comcast! :/

Tuesday, June 22, 2010

Celebrating my 34th New Hampshire-versary today

Sunday, June 20, 2010

Graduation day!!

Saturday, June 19, 2010

My shoes are on vacation

Sherry: "Your shoes must be on vacation."

Me: "What?"

Sherry: "That's not where they live."

Ha ha ha ha ha!

Wednesday, June 16, 2010

I misspelled "retarted" - ha ha ha

Tuesday, June 15, 2010

Go ahead and search for "dilithium crystal spill" -- you won't find it in Google or Yahoo or Bing.

Do I smell a cover-up?

Macaroni and Cheese

Here's my very special recipe for macaroni and cheese. I keep mistyping macarone instead of macaroni. What's up with that?

Anyway, here's what you need:
  • some cooked macaroni -- any leftover pasta will do
  • a slice of American cheese, enough to cover your macaroni
And here are the so-called cooking instructions:
  1. Put the pasta in a microwave-safe bowl. Plastic = fail.
  2. Add the cheese on top.
  3. Place the bowl in the microwave and press the "minute" button. I almost forgot to put "minute" in quotes and then you would have been looking for a really tiny button. But I digress.
  4. Stir until the pasta is all cheesy. If the pasta isn't cheesy enough, use more cheese next time. Or less pasta. I really can't tell you how to live your life.
Enjoy!

Monday, June 14, 2010

Should I eat my lemon yogurt now or save it for tomorrow? Decisions, decisions.