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!!
My thoughts on food, technology, politics, running and... nope, those are the only thoughts I've got!
Tuesday, January 28, 2014
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);
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);
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
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!!
- Redhat Enterprise Linux (RHEL) Install and Configure MySQL Database Server
- How Do I Enable Remote Access To MySQL Database Server?
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
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
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!
$ 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
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..."
Next time Firefox won't start and complains of "Firefox is already running but is not responding..."
Sunday, February 24, 2013
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!
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)
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::
I switched to tightvncserver hoping that my vnc crashing will go away ::fingers crossed::
Saturday, December 08, 2012
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:
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")
Subscribe to:
Posts (Atom)