Cookie Notice

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

2009/12/29

TV on my PC? We live in the Future

Several weeks ago, I got a Diamond ATA TV Wonder 650 PCI TV tuner. This means I can watch and store shows on my computer. I'm curious about workflow possibilities with this: I want to convert the files to smaller formats and copy them to better places. It will be a period of learning, I am convinced.

2009/12/22

Lies! All Lies!


Most of the lab wants to take the week between Christmas and New Years off. But there are researchers who are still dropping off samples today, the day before Festivus. I've got a lot of problems with you people!

2009/12/21

The 12 Days: an analysis

Using this code:


#!/usr/bin/perl

use 5.010 ;
use strict ;
use warnings ;
use DateTime::TimeZone ;
use File::stat ;

my @count ;
my @days ;

$days[1] = 'Partridge in a Pear Tree' ;
$days[2] = 'Turtle Doves' ;
$days[3] = 'French Hens' ;
$days[4] = 'Calling Birds' ;
$days[5] = 'Golden Rings' ;
$days[6] = 'Geese A-laying' ;
$days[7] = 'Swans A-swimming' ;
$days[8] = 'Maids A-milking' ;
$days[9] = 'Ladies Dancing' ;
$days[10] = 'Lords A-leaping' ;
$days[11] = 'Pipers Piping' ;
$days[12] = 'Drummers Drumming' ;

for my $a ( 1 .. 12 ) {
for my $b ( 1 .. 12 ) {
next if $b > $a ;
$count[$b] ++ ;
}
}

for my $a ( 1 .. 12 ) {
say join ' ' , $count[$a] * $a , $days[$a] ;
}


I determined the precise number of each gift as presented in the song.


12 Partridge in a Pear Tree
22 Turtle Doves
30 French Hens
36 Calling Birds
40 Golden Rings
42 Geese A-laying
42 Swans A-swimming
40 Maids A-milking
36 Ladies Dancing
30 Lords A-leaping
22 Pipers Piping
12 Drummers Drumming

I suppose it preferable to have a smaller number of drummers than geese. Time to get into the geese and swan market, though.

2009/12/15

A MySQL Bug? A Programmer Bug?



I have been trying to teach myself data analysis. I have been keeping some weather data in a MySQL database so I can take it out, munge it and graph it. The above example is done with the Perl module Chart::Clicker, which I am sure will take a large role in my current job. Especially if it works fast and graphs correctly.

On that topic, take a look at it. The red line represents the day's highs, the green line, the day's lows, and the purlple line the day's average temperature. Here's the code that determines what the numbers should be.

my $sql ;
$sql .= 'SELECT ' .
'cast( avg( temp_f ) as unsigned ) , ' .
'min(temp_f) , ' .
'max(temp_f) , ' .
'DATE(time) ' .
'from weather_data where zip = "47909" ' .
'and DATEDIFF( CURDATE() , DATE(time) ) < 7 ' .
'group by DATE(time)' ;

And here's the schema for this code.

CREATE TABLE weather_data (
id int(10) not null auto_increment primary key ,
time TIMESTAMP not null ,
zip varchar(5) ,
city varchar(255) ,
temp_c varchar(255) ,
temp_f varchar(255) ,
humidity varchar(255) ,
wind varchar(255) ,
conditions varchar(255)
) ;

I'll admit that it's pretty lazy. If the current conditions stretches beyond 20 characters, that's some complex weather. The main problem, I believe, is that temperature data is being saved as a string rather than a signed integer. Why it mostly shows up as error on that one day, I don't know. Here's all the temperature data for that day. (Thank you, Google Weather API.)
timetemp_ftemp_c
2009-12-10 00:00:0228-2
2009-12-10 00:10:0228-2
2009-12-10 00:30:0328-2
2009-12-10 00:40:0228-2
2009-12-10 00:50:0228-2
2009-12-10 01:00:0228-2
2009-12-10 01:10:0228-2
2009-12-10 01:30:0216-9
2009-12-10 01:40:0216-9
2009-12-10 02:00:0316-9
2009-12-10 02:10:0216-9
2009-12-10 02:20:0216-9
2009-12-10 02:40:0214-10
2009-12-10 02:50:0215-9
2009-12-10 03:00:0215-9
2009-12-10 03:10:0215-9
2009-12-10 03:20:0215-9
2009-12-10 03:30:0314-10
2009-12-10 03:40:0114-10
2009-12-10 03:50:0115-9
2009-12-10 04:00:0315-9
2009-12-10 04:10:0214-10
2009-12-10 04:20:0214-10
2009-12-10 04:30:0212-11
2009-12-10 04:40:0212-11
2009-12-10 05:00:0213-11
2009-12-10 05:10:0212-11
2009-12-10 05:20:0212-11
2009-12-10 05:30:0312-11
2009-12-10 05:40:0212-11
2009-12-10 05:50:0212-11
2009-12-10 06:00:0312-11
2009-12-10 06:10:0211-12
2009-12-10 06:20:0211-12
2009-12-10 06:30:0211-12
2009-12-10 06:40:0111-12
2009-12-10 07:00:0311-12
2009-12-10 07:10:0210-12
2009-12-10 07:20:0210-12
2009-12-10 07:30:0210-12
2009-12-10 07:40:0410-12
2009-12-10 07:50:0210-12
2009-12-10 08:00:099-13
2009-12-10 08:10:059-13
2009-12-10 08:20:069-13
2009-12-10 08:30:059-13
2009-12-10 08:40:069-13
2009-12-10 08:50:059-13
2009-12-10 09:00:068-13
2009-12-10 09:10:088-13
2009-12-10 09:20:088-13
2009-12-10 09:30:088-13
2009-12-10 09:40:138-13
2009-12-10 09:50:079-13
2009-12-10 10:00:0710-12
2009-12-10 10:10:0710-12
2009-12-10 10:30:0710-12
2009-12-10 10:40:1010-12
2009-12-10 10:50:0712-11
2009-12-10 11:00:0712-11
2009-12-10 11:10:0512-11
2009-12-10 11:20:0812-11
2009-12-10 11:40:0812-11
2009-12-10 12:00:0914-10
2009-12-10 12:30:0714-10
2009-12-10 12:50:0714-10
2009-12-10 13:00:0914-10
2009-12-10 13:10:0615-9
2009-12-10 13:20:0815-9
2009-12-10 13:30:0615-9
2009-12-10 13:50:0717-8
2009-12-10 14:00:0917-8
2009-12-10 14:10:0717-8
2009-12-10 14:20:0817-8
2009-12-10 14:40:0918-8
2009-12-10 14:50:0817-8
2009-12-10 15:20:0818-8
2009-12-10 15:30:1518-8
2009-12-10 15:40:0818-8
2009-12-10 15:50:1119-7
2009-12-10 16:00:1119-7
2009-12-10 16:10:0819-7
2009-12-10 16:20:0819-7
2009-12-10 16:30:0719-7
2009-12-10 16:40:1019-7
2009-12-10 16:50:0819-7
2009-12-10 17:00:0319-7
2009-12-10 17:10:0319-7
2009-12-10 17:30:0219-7
2009-12-10 17:40:0218-8
2009-12-10 17:50:0218-8
2009-12-10 18:00:0218-8
2009-12-10 18:10:0217-8
2009-12-10 18:20:0217-8
2009-12-10 18:30:0217-8
2009-12-10 18:40:0216-9
2009-12-10 18:50:0116-9
2009-12-10 19:00:0217-8
2009-12-10 19:10:0217-8
2009-12-10 19:20:0217-8
2009-12-10 19:40:0217-8
2009-12-10 19:50:0217-8
2009-12-10 20:00:0217-8
2009-12-10 20:20:0217-8
2009-12-10 20:30:0217-8
2009-12-10 20:40:0217-8
2009-12-10 21:00:0317-8
2009-12-10 21:10:0117-8
2009-12-10 21:20:0218-8
2009-12-10 21:30:0218-8
2009-12-10 21:40:0218-8
2009-12-10 22:00:0217-8
2009-12-10 22:10:0217-8
2009-12-10 22:20:0218-8
2009-12-10 22:30:0218-8
2009-12-10 22:40:0218-8
2009-12-10 22:50:0118-8
2009-12-10 23:00:0218-8
2009-12-10 23:10:0118-8
2009-12-10 23:20:0218-8
2009-12-10 23:30:0218-8
2009-12-10 23:40:0218-8
2009-12-10 23:50:0218-8

I could show you the temp_c graph, but that's just beyond the pale wrong, which makes sense as the temperature has been bouncing between positive and negative the whole time.

Ultimately, I got used to Perl's ability to effortlessly bounce between strings and numbers, and here I'm bitten. I can only use that data in a meaningful way if I pull it all and manipulate it in Perl, which cuts off some labor-saving tools. Let that be a lesson to you, and to me.

2009/12/14

Terry Childs Trial Begins

Finally.

As an admin, I hold that Childs is in jail for proper system administration. I hold that Childs is in jail for protecting the networks of the city of San Francisco, ultimately protecting the people of San Francisco, from his bosses.

San Francisco remains a city that jails people for doing system administration right.

2009/12/13

Instinctive and Alarming

As I have said, I now use a Samsung Instinct s30.

And as I have said, I haven't been happy with the alarm. I love how many alarm it has, but it never seemed to go off.

I understand the problem now.

I didn't dime the volume. Do that and it is OK.

2009/12/11

A Perfect Stocking Stuffer


Bluetooth USB dongle. Push it into your USB port and you can talk to your fancy schancy smart phone. What can you then do? Don't know yet. I don't have one yet. I guess soon after I'll start wanting a Bluetooth headset, a Bluetooth external DVD burner, a Bluetooth toothbrush. But one step at a time.

2009/12/10

New Gear Day

There's one thing I find about being a geek, which is that when people who aren't geeks give up on trying to make a thing work, it gets passed on to me. Sometimes I can pass it on — a while ago, a rack-mount UPS got passed on to me, and today that UPS, that danged-heavy lead-filled monster, protects some servers that serve, among other things, the Purdue Perl Mongers site. Yayness.

The newest thing to land on my lap is, well, swank. An HP Pavilion Slimline. 320 GB SATA. 3GB memory. Dual-core processor. It's running Vista, which yeah, could be a blessing, could be a curse. We'll see. I have the technology to upgrade it to XP at will, and of course I can jump to Ubuntu. It's a tight little case, so not much room to upgrade. Seeing that it's far faster and better than anything sitting around the house, that should be no problem.

The problem it had in Mom's hands was that it couldn't keep connected to AOL. That will NOT become a problem with me.

I think I want to stick with Vista, though. At least at the moment. I am a big fan and user of Open Source software, but my user experience as a Unix guy has not really been strongly changed since I first started working with Unix in the mid-1990s. Unix, a shell (then tcsh, now bash), X, terms, and browsers. Vista is wildly different, and I think coming to terms with the differences, with what Vista has to offer. Similarly, I'd keep MacOSX around if it landed on my lap. This, more or less, is why I bought BeOS back in the day, to get another view on things.

So, we'll see. Thanks Ma!

Sprint Rant as Modem, pt 1 of ... 1

My home is a reasonably-networked environment. My work is a well-networked environment. I have a USB dingus that lets me link my Compaq Mini 110 to the Sprint phone network, but between my two computing environments, I don't need it very often.

K, on the other hand, has much more of a need for it. But it has not worked for her and her EeePC. Never has. It's gone back to the shop recently to get some work, but it's still flaky. I have just now downloaded the new Sprint SmartView software ...

I don't even get to get into it. I downloaded the newest version of SmartView, it grabbed newer drivers for the USB dingus, and now K can use the USB dingus to connect at Bill-Kurtis-like speeds. I was going to write down all my notes toward using her Samsung Rant as a modem, but the dingus works.

Don't you hate it when you're just about to get a nice hate-filled rant on and the thing just works?

Annotated jQuery, or pass me the crack pipe

Here's some code. This is what is on my mind today.


$( '<div/>' ) // We create a DIV tag
.attr( 'id' , 'e_solid' ) // give it a unique identifier
.text( 'solid' ) // put text into it
.appendTo('#head') // give it a unique identifier
.click( function() { // and set what happens when you click it
var ajax = a_dir + '2g_slide_formats.cgi' + '?e=solid' ; // which is, set a URL
$( '#e_454' ).css( 'color' , '#abc' ) ; // do some CSS stuff
$( '#e_solid' ).css( 'color' , '#000' ) ; // that won't work by
// setting it in the CSS file
$( '#run' ).empty() ; // clear some other
$( '#slide' ).empty() ; // subordinate tags
$( '<div/>') // We create a new DIV tag
.text('Slide Type') // fill it
.appendTo('#run') // put it into another tag
;
$( '<select/>') // we create a select box
.attr('id','holder') // give it an id
.appendTo('#run') // put it in the same tag
.wrap(document.createElement("div")) // put a DIV tag around it
.change( function() { // and an action for when
// the select changes
var value = $(this).val() ;
$( '#slide' ).empty() ; // empty '#slide' again
for ( var i = 1 ; i <= value ; i++ ) { // and figure the number of
// regions from the select value
var div_name = 'region_' + i ; // and make a name
$( '<div/>' )
.attr( 'id' , div_name ) // which we use to name a new DIV
.text( 'Region ' + i ) // which we fill
.addClass( 'region' ) // class
.appendTo( '#slide' ) // and append to the emptied #slide
;
$( '<span/>') // then add a SPAN
.appendTo( '#' + div_name ) // which we append to that new DIV
.text( 'Add barcode' )
.click( function() { // and when you click it ...
var accession = prompt( // you're prompted for one field
'Set Accession Number'
) ;
var barcode = prompt( // and then another
'Set Barcode, or Make Blank' , 'MID'
) ;
var strID = 'div_' + div_count ++ ;
alert( div_name ) ; // this is a bit of debugging.
$( '<div/>' ) // yet another DIV
.attr( 'id' , strID )
.appendTo( '#' + div_name + ' .body' )
; // which should go to the .body
// but doesn't, which is why I'm writing
$( '<span/>' )
.appendTo( '#' + strID)
.text( accession )
.addClass( 'accession' ) // and we add SPANs to that DIV
;
$( '<span/>' )
.appendTo( '#' + strID)
.text( barcode )
.addClass( 'barcode' ) // which are the data we are
; // prompted for
$( '<span/>' )
.appendTo( '#' + strID)
.text( 'delete' )
.addClass( 'delete')
.click(function(){ // and another SPAN
$( '#' + strID ).remove() ;
}) ; // that you click to remove
}) ; // this whole DIV and all in it
}
}) ; // It looks like we're done but that's just the end
// of the definition of the SELECT
// which we fill with AJAX and JSON
$.getJSON( ajax , function(data){ // we get a data chunk from JSON
var objD = eval( data ) ; // convert it to an object
for ( var i = 0 ; i < 100 ; i++ ) { // The shotgun approach saves me
if ( objD[i] != undefined ) { // from having to be clever
$( '<option/>') // and we add all the OPTIONS
.attr('value', objD[i].max_regions )
.text( objD[i].format ) // to the previously mentioned SELECT
.appendTo('#holder') // Remember the SELECT?
;
}
}
}) ;
}) // And here we end it. That was all one "line"
; // and it isn't quite correct.


My brain hurts.

2009/12/08

Memento Mori


I have a cast-away desktop machine I'm trying to patch into a vaguely useful machine for my son. I have a 40GB drive into it, which is a bit tiny — it's XP, so 10GB will be taken by the OS and programs before he even starts trying to use it — so I'm have been trying to slip in a second 40GB drive that came from a machine whose power supply died on him. But the number two drive is not working.

I'm not sure why. I'm mostly sure that it's a jumper setting, but to check it, I will put back the Zip drive I took out to makeo room.

I remember when I put stuff on ZIP drives, when they were a good alternative to CDROMs, which when burned were unchangable, and floppy discs, which were and are just too small. I remember how proud I was, how cool I thought I was when I installed a Zip drive onto my beater Celeron about a decade ago.

I was filling it up so there would be something on it when I tried to load it on that machine. I remember thinking that Zip drives had just massive amounts of space. First thing I tried to put on there would not fit. It was too big.

That's the way, isn't it? Time was, I thought a 1200-baud modem was fast, and now I want broadband. I was once satisfied with memory measured in Ks while now you want multiple Gs. And so it goes.

And if you'll excuse me, I have a computer to fix.

2009/12/06

Hardware Fun

A friend gave me a cast-off desktop, a white Gateway. He had it set up to be his MythTV box, doing network boot. I tried to get it going and it kept saying it couldn't find a bootable drive and looking for something in the A:. Finally figured out what BIOS mod was necessary — the drive was set as the secondary drive on the IDE bus — and now it's booting and running and installing.

Now I'm putitng on XP SP3. That should take another hour.....

2009/12/04

Gizmo - The Rest of the Story

I reinstalled XP on my netbook. I just thought about Gizmo. I've dealt with this before, but this time, post-reinstall, it works.

Just to clarify what I mean by "it works". I have called my laptop with my cellphone. I have called my cellphone with my laptop. I was able to call. I was able to answer. It works.

Google did buy Gizmo, so, like GrandCentral before it, it will soon be integrated directly into the Google stack. Expect it to be integrated first with Google Voice and then with the Android. Which ultimately gets to an interesting point.

My friend Patrick says that when VoIP becaomes universal, VoIP companies will be superfluous. Or words to that effect; I could look it up in my GTalk logs, but nah. When is easy and commonplace for people to call point-to-point via whatever networked device they have, with nothing but TCP/IP between them, what's the point of the AT&Ts and Verizons and Vonages of the world? And with Google making the OS for that device, plus the mechanism (Gizmo) and voice mailbox for this to work, it seems like they're pushing for that future.

Anyway, it's working.

2009/12/02

Love The Phone You're With

I used to be on Verizon, and when I was there, I had a Blackberry Pearl. I have to say, it's a swank phone. Never had an iPhone, so I don't know the full experience of the ultimate app-phone, so to me, the coolest phone I ever held is that Blackberry.

But that's not my phone anymore.

Right now, I carry a Samsung Instinct. It is not the phone I want. But it is the phone I have.

I am not a bleeding-edge wired individual, but I have been electronically connected for over 20 years. I'm wired and wireless and all that. And today, Google is the center of all connectivity. Between the phone and the provider, it was quick and painless to set up Google Voice as my voice mail, which is nice. Someone calls you and it translates it and sends it to you. That's sweet. Plus, web interface, which you don't have to deal with the confusing "If you want X, dial 4" stuff.

Google Mail was also an easy config. I do most of my GMail manipulation from Thunderbird via IMAP and between that and sorting, I've gone hog-wild for labels, but the mail interface is inbox-only. This just means I have to be more clear in sorting and filtering to make sure only what I want enters the inbox, but that's OK.

But that's it. I want to sync the on-board calendar with my Google Calendar, but it seems there's no connection capability. I learned the joy of having an online calendar when I worked for the clinic, but the calendar I had was the clinic's Exchange calendar, so I lost all my stuff when I left. The onboard calendar is pretty neat looking, but you can't have it synchronize with my main contacts list in Gmail. Yeah, there's a synch through Sprint, and that's fine. It means I can get my contacts back should I lose my phone, but that still means I manage them through on-screen one-handed typing rather than the full keyboard on my desktop.

I use XMPP, mostly through Google Talk, and the choices I have are AIM, Yahoo or MSN, and I went to GTalk to avoid those three. And there's no connection between my connections in GMail and my phone connections.

Plus, it uses a different power and connect cable than everything else I own, which I think use Micro-AB USB. The industry should unify on one.

But it is pretty, it has Bluetooth, it has a camera, it takes a microSD card, and it works just fine as a phone. It even works in the house, while K's phone kinda doesn't. There are elements I don't like about it, sure, but I do like it. I am decided in being happy with it.