Thursday, March 23, 2006

39:45 South Philadelphia Loop - Chelsea Williams

It's been a while since my last run, and o lord could I feel it. I was about to go microwave some couscous when a tiny voice in my mind reminded me that I am 41 and will quickly become a tremendous lard-ass if I just eat and never exercise.



I found Chelsea Williams through a friend of a friend. She's a busker in Los Angeles. Man, busking must be tough in Los Angeles if this is the level of quality. I busked quite a lot in Barcelona, and I always thought I was pretty good, but I suck by comparison.



Unfortunately, I wasn't able to download more than two of Chelsea Williams's songs, so I filled out the rest with standbys. Here was my playlist:




  1. Undecided - Chelsea Williams

  2. This Will Be - Chelsea Williams

  3. Te Recuerdo Amanda (I remember you Amanda) - Jose Mercé

  4. La autoradio canta (The car radio sings) - Miguel Bosé

  5. Dime quién soy yo (Tell me who I am) - Niña Pastori

  6. I'm Digging Your Scene - Dr. Robert

  7. Springtime for the World - Dr. Robert

  8. Telephone - Zap Mama



I got into some flamenco today (Jose Mercé & Niña Pastori). And the Miguel Bosé song was a favorite from 1996.



The Dr. Robert songs are from a new acoustic album coming out from the former singer of "The Blow Monkeys".



The run itself was very hard-- I got really tired about halfway through. Not out of breath, oddly enough, just generally worn out. My god I'm an old fart.

Tuesday, March 21, 2006

Microsoft Paint (PBRUSH) Text Toolbar Disappears

I use Microsoft Paint (pbrush) a lot. I recently had the problem that my Text Toolbar just disappeared. I tried selecting and unselecting "Text Toolbar" from the view menu, but nothing worked.



You can fix this from Regedit. The keys are:




My Computer/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Applets/Paint/Text/PositionX

and PositionY


From Regedit you can set both of these to 0 and the text toolbar will show up on screen again.

Thursday, March 9, 2006

HP-32SII :: Hewlett-Packard RPN Scientific Calculator

What this page is about

I set up this page to see if I could find any other HP32/HP32S/HP32SII
enthusiasts (that is, geeks). I had a great HP-15C when I was
in University, but alas, I could not find another when it came
time to buy a new calculator (I sold the 15C like an idiot).
The HP32SII seemed to fit my bill. It was RPN, programmable,
and had a lot of the same features of the HP15C.


Sample Program
Euclid's Algorithm for the Greatest Common Divisor

; This is an HP-32S version of Euclid's Algorithm to find the greatest common divisor.
; You run this by putting the two numbers for which you want to find the GCD and pressing "XEQ E"
; I'm modifying this to put the non-shifted
; key in brackets next to the shifted key
; to make it less confusing. (Thanks, Stefan)
; Where I say oShift, I mean hit the orange shift key first
; Where I say bShift, hit the blue shift key first
E01 LBL E ;[oShift +]
E02 STO A
F01 LBL F ;[oShift +]
; Divide y register by x register
F02 ÷
; Get the Fractional part
F03 FP ;[bShift square root]
F04 RCL A
; Multiply the fractional part by the first number you put in
F05 x
F06 1
F07 x>y? ;[oShift ÷] then select >
F08 GTO G ;[oShift XEQ]
F09 R(DOWN)
F10 PSE ;[bShift R/S]
; Exchange the x-register with STOrage A
F11 x <-> A ;[bShift x<->y] (next to ENTER)
F12 RCL A
F13 GTO F ;[oShift XEQ]
G01 LBL G
G02 RCL A
G03 RTN


Links

SQL Server: Understanding SYSFILES/SYSALTFILES status

SYSFILES and SYSALTFILES describe the data files used by SQL Server databases. They have the same structure, except that SYSFILES refers to data files in the current database, and SYSALTFILES resides in the MASTER database and refers to all data files in the database.



The STATUS column of SYSALTFILES is made up of a series of flags to tell you properties of a data file. The following query checks for the flags. A zero indicates the flag is not set, a non-zero indicates that the flag is set:




select name,
status,
status & 0x1 [Default device (unused in SQL Server 2000)],
status & 0x2 [Disk file],
status & 0x40 [Log device],
status & 0x80 [File has been written to since last backup],
status & 0x4000 [Device created implicitly by CREATE DATABASE],
status & 0x8000 [Device created during database creation],
status & 0x100000 [Growth is in percentage, not pages]
from master..sysaltfiles


There is more information on this table in Inside SQL Server 2000 by Kalen Delaney from Microsoft Press.

SQL Server: Data file monitor stored procedure

This is a script that lets you monitor datafile sizes in SQL Server. It collects the sizes of all data files in the database and stores them in a history table. You can set this up to run with a SQL Server Agent Job to collect data file sizes nightly.



The table the history gets stored in looks like this:



create table altfiles_history (
date datetime,
dbid smallint,
fileid smallint,
size int
)


The stored procedure code looks like this:




/*
* size_monitor
* Timothy Chen Allen
* http://www.timallen.org/blog
*/
create procedure dbo.size_monitor
as
set nocount on

-- Cursor: names and sizes of data files
declare c_dbsize cursor for
select dbid, fileid, size
from master..sysaltfiles

-- Declare variables into which to fetch
declare @dbid smallint
declare @fileid smallint
declare @size int

open c_dbsize

fetch next from c_dbsize
into @dbid, @fileid, @size

while @@fetch_status = 0
begin
fetch next from c_dbsize
into @dbid, @fileid, @size

insert into trf_dba_utilities..altfiles_history (date, dbid, fileid, size)
values (getdate(), @dbid, @fileid, @size)
end

return


You can query the history table to see how your data files are growing with this query:




/*
* 1) size and maxsize are displayed in 8K blocks. You can
* get this to MBs by dividing by 128.
* 2) maxsize is -1 when the datafile is allowed unlimited
* growth.
*/
select s.date,
d.name database_name,
f.name datafile_name,
s.size/128.0 datafile_size,
case when f.maxsize = -1
then -1
else f.maxsize/128.0
end max_datafile_size
from altfiles_history s
left join master.dbo.sysaltfiles f on s.dbid = f.dbid and s.fileid = f.fileid
left join master.dbo.sysdatabases d on s.dbid = d.dbid
order by d.name, f.name, s.date


Basically, I'm just storing the size column and keys from SYSALTFILES. This history is a nice thing to have so you can watch file growth and see if you need to be automatically shrinking databases, or to watch for unexpected jumps in size.

Wednesday, March 8, 2006

The Katrina Tapes

I thought I had just about written my last Katrina category blog. Guess I was wrong.

I just watched the tapes of the President's briefing four days prior to Katrina hitting New Orleans: http://video.ap.org/v/en-ap/v.htm?f=CADIU . I dunno. Go watch them yourself.

The tape of the White House Press Secretary shows Scott McClellan attempting to spin this somehow to say that the President was blameless. I'm tired of that. Even I was not blameless in this-- there were things I could have done to better ensure my family's safety. I could have done a lot of things better.

That's why it makes me angry to see the most powerful man in the world dance around like a fly girl trying to convince us that he never did a damn thing wrong. Everyone knows he screwed up-- it just makes him look like a liar on top of it for him to claim that he didn't. The kind of excuse making I'm hearing out of the White House in that press conference had a name when I was at the Academy: Sea Lawyering. It's not owning up to one's responsibilities because of some loophole. It's trying to pin a company-level screwup on some PFC in the third rank. It's not being President-- it's just cowardice.

Saturday, February 18, 2006

No lunchtime Kung Fu in Philadelphia

It's been nasty cold here in Philadelphia, and I've taken a hiatus from running as a result.

I've been looking for a place to learn Kung Fu for the last three weeks. Some advice for Martial Arts instructors in Philadelphia: if you want to get rich, set up a Martial Arts class in Center City, Philadelphia, at lunch hour. There are no Kung Fu, no Aikido, no Karate, and no Tae Kwon Do classes within walking distance of Chinatown in Philadelphia at lunch time. There is one place that teaches Brazilian Jiu Jitsu (http://www.maxercise.com) but have you seen those guys fight? They start by pulling each others' ears off! I still might consider that place, though.

We're also looking for a T'ai Chi Ch'uan (Taijiquan) here in Southern Philadelphia for both Sonia and me, but again, it seems there is a dearth of Tai Chi schools here. Which seems odd, because I thought people were getting more into this sort of thing, but I guess they really are just interested in Yaga and Pilates these days.

Monday, February 6, 2006

SQL Server: How to create a user login and give it access

This is just a script that I put together to create a user and assign it database access and roles. The login actually existed previously with the wrong roles, so the script starts out by deleting the login from both the database and the server. Here are the commands I entered and the server's responses:




-- Start up OSQL from the command line
c:>osql -S SERVER_NAME -d DATABASE_NAME -E

-- Set the database to the one we want to
-- grant access to
1> use DATABASE_NAME
2> go

-- Drop the login's database access
1> sp_revokedbaccess @name_in_db='USER_NAME'
2> go
User has been dropped from current database.

-- Drop the SQL Server login
1> sp_droplogin @loginame='USER_NAME'
2> go
Login dropped.

-- Add the SQL Server login with the
-- correct password and default database
1> sp_addlogin @loginame='USER_NAME', @passwd='PASSWORD', @defdb='DEFAULT_DATABASE'
2> go
New login created.

-- Grant database access to the login
1> sp_grantdbaccess @loginame='USER_NAME'
2> go
Granted database access to 'USER_NAME'.

-- Grant the login the "db_owner" role
-- to this database
1> sp_addrolemember @rolename='db_owner', @membername='USER_NAME'
2> go
'USER_NAME' added to role 'db_owner'.


This was for a login with "Standard" security-- that is, not a domain user name.

21:05 Southern Philadelphia

I rolled out of bed at 6AM for this one-- I've figured out that to run and meditate before work, I have to get up pretty early. It was nice to run down South Street at 6AM. No traffic, just a lot of different sounds: trucks loading, wind chimes in front of "Garland of Letters", a homeless guy mumbling. Knees didn't hurt, probably because I could run on the actual road.

Sunday, February 5, 2006

45:00 Southern Philadelphia with Daniel

We have house guests (Angeles and Jerry-- the third series of house guests since Katrina!), and Dan and I had been horsing around playing Power Rangers all morning while the Spaniards sat and chatted. We got bored, so I whispered, "psst... let's get out of here and go running". Dan whispered back "okay!".

We got bundled up, grabbed the baby jogger, and took off. I meant to do about 30 minutes, but Dan nodded off about 10 minutes into the run, and I wanted him to get a little rest, so we kept going.

Down South Street to the end where it meets up with Front Street an back, then looping around a bit. The only drag was that I was running on the sidewalk the whole time to keep Dan out of traffic, and my knees hurt like tarnation after that.