scary…

Ok, picking apart X86 assembly by studying code written for Linux under GAS, using NASM for documentation on FreeBSD, was fun.

When it’s after 0800 zulu, I’m starving, and picking apart notations is beginning to compile into making sense….. and you can’t remember the last time you slept at ease, somerhing is just nuts… : I guess, the real question, is how much will still be remembered in the morning, or with the time frame I’m likely to get to bed at, probably the _afternoon_

Should reading lisp be considerd hazardous?

my eyes are starting to see ) and jump back to matching (, then reparse what I just read, jump back to ); like a bloody type writer, lol

(define (factorial n k)
(= n 0 (lambda (b)
(if b
(k 1)
(- n 1 (lambda (nm1)
(factorial nm1 (lambda (f)
(* n f k)))))))))

if I wasn’t hungry, I would think that I was getting dizzy after 30min of this kinda stuff :. I generally don’t mind the parens, but I find assembly easier on the brain sometimes…

Camels rock

Been reading a bit more of Programming perl, I left off at the start of Chap. 7 “Formats” for the night, so I could get to taking care of things before work tomorrow (I haven’t been on the computer all day lol). I enjoyed the later parts of the chapter on regular expressions; although I’ve known regular expressions (hence forth regex) for a long time now, I *loved* getting to read more about how the parser & engine works; it has changed the way I think about the /PATTERN/ (and just how much hard work perl does to deal with greedy people).

I also learned a few new things, namely just how advanced Perls regexes are: I’ve always felt that Perl must be the king & queen of regex implementations…. after seeing all the (?…) stuff that is referenced in the book (the ones I didn’t know yet), I think Perl must be the king, queen, jack, and ace; or as my hanging jaw expressed, “Fucking brilliant!” ;-). The other things, is how in the universe can ‘pos($str) = 1;’ could possibly be legal, rather then just an interesting form of magic; and how functions that skip the dang comma after a block, like the built in ‘map { block } @list’ does, can be defined. Which interestingly, also explains how modules like Error and Exception from CPAN likely do there stuff.

This is getting interesting hehe.

DTrace entry in /usr/src/UPDATING

20080826:
DTrace support was merged to STABLE today. In the best
tradition of “the dog ate my homework”, subversion decided
that the commit message was too large and opted not to send
it. It was a stealth commit!

A ‘make buildkernel’ will now default to build the kernel
and modules with both DTrace kernel hooks and CTF data ready
for DTrace.

After you have installed both world and the kernel, and
rebooted, you can ‘kldload dtraceall’ to load all the DTrace
kernel modules and then you’re set to run the ‘dtrace’
client (as root).

For DTrace documentation, refer to:

We are limited to kernel tracing at the moment, so the pid
provider is not available.

For the syscall provider, note that the arguments to the
return probes are the same as for the entry probes.

hehe, gotta love Subversion 🙂

Just finished the preface maybe 15min ago, and even by then, I could tell I was gonna like this book xD

stressful, yet economical day

I logged off around 0530~0545R, I couldn’t sleep…. was around 0730’ish when Ma got up, and aroun d800 by the time the woke me up to start shuffling crap around; operating under the assumption that the maintenance guy would have to replace the entire water heater in order to deal with the now kaput elements. Managed to clear the forums a bit & get throuhg it. Then she decided to go shopping; I managed to get to BestBuy and Barnes & Noble.

Spent my gift card towards a (DDR-333) PC-2700 SO-DIMM, got my laptop sold 512MB one sitting on a dresser now. So far, it seems the system has become more processor limited, but hey, GNU emacs starts quickly now >_> (but I’m a vim user :-P). I also bought a little Jumbo LapDesk to replace the chestboard I’ve been using as a tray table for my laptop. I don’t like the slippage, but it’s sound enough when in ‘use’, but I wouldn’t want to use it for storage though – for fear the laptop will slide off the lapdesk, off the table, and onto the hard deck lol. As a replacement for the chessboard, I miss how the laptop used to stick in place on the surface, I kinda wish that I got the wooden lapdesk for about $10 more, but hey… I’m a cheap bastard. The only reason why I’m replacing the chessboard, is because last week I was wondering why my left leg was hurting around the inner-side (Tibia?), when about 3 days later I found the edges of the chess board were starting to cut into my leg :.

Found a much wider scope of books at the store then I expected, basically every kind of Linux (especially Fedora / Ubuntu) and Windows server book out there; VisualBasic, heck of a lot of ASP.net (barf), sweet stockpile of Java & JavaScript books, even C#, Python, and Ruby books; even PHP & MySQL. I didn’t find anything I had *wanted* to find though, stuff like the works of W. Richard Stevens (especially those on network programming), or some of the books on LaTeX I have interest in (as opposed to flipping through webpages of documentation). not to much of a surprise though. I was rather disappointed with the amount of computer related and science books there, but alas, that’s the world we live in — I didn’t really expect to find anything better then “Learn Visual Basic in 20 minutes” or something useless like that 8=). I did however find something worth buying, the llama, Camel, and the Cookbook. I hated to pay the price ($50), but I bought Programming Perl; hopefully it will come in handy someday.

I know both programming and Perl well enough, that the cook book doesn’t interest me that much, not for $50 lol. Learning Perl, is good for refreshing my memory if I never touch the language for over a year or so… But I’ve never read Programming Perl, no idea where to put it on my book shelve yet either lol. The thing I’m mostly interested in, is not having to look for the manual pages / plain old documentation for various things and switch between windows back / forth while coding. Although, I do have both perldoc.perl.org and search.cpan.org on keyword access in Fx, it’s a bit of a poor substitute for a few book marks hehe. I was also a good boy, I kept myself firmly away from the science fiction and fantasy sections…. I’d be to tempted to pick up good reading material, lol.

I almost never buy computer books really, most of the ones I have were $1 at a library book sale; since I’m the only mook around who would care, bought’em lol. That’s actually how Java entered my skill-set, even though I often avoid writing Java code when I can. Most of the books I get, usually are Sci-Fi or technical material related to such topics >_>. On computers, I’m used to using documentation and reading comprehension to understand stuff.

All in all, I guess a fair day…. NOW IF ONLY I COULD GET SOME SLEEP !!!

Why I love Perl…..

For a little project, I basically need a quick but simple way of translating things from one format to one of another; the catch? How to do it! I figured, a hash would be a great way to do it, since each of the translations can be quickly processed as translate_from => translate_to. The problem? There’s a fair # of keys and values, most hashes I encounter in Perl are written like this:

# modern
my %hash = ( foo => 1, bar => 'string', );
# classic
my %hash = ( 'foo', 1, 'bar', 'string', );

the main value of the arrow operator => is that we get to skip quoting the hashes key… but wtf good is it, if we have to quote each value, because they are all strings in our hash? So I sat and thunk for about 45 seconds and wondered…. wouldn’t it be so wonderful, if I could say something like qw/key1 value1 key2 value2 …/ and format it much like the classic style for legibility, but not have to write *any* quotes for the strings?

Attempting it 2 minutes later:

my %hash = qw/foo  1
bar string
... ...
/;

It never actually occurred to me before, b/c almost every time I care about hash keys, is w hen I can use a hash as a form of quick dynamically created storage for data, that I will probably want to walk across both the keys and values on later. But since qw/foo bar/ is equivalent to (‘foo’, ‘bar’), it works just perfectly here!

Perl is not the most beautiful language, it’s a language for *getting the job done*, and in that spirit, has 1000s of little things that help make things less painful -> like not having to quote every dang gum key value in a hash lol. One thing I also like abut Perl, I can always read my scripts 6++ months later 😉

I love this tool, lol.

Looking at the EE editor

http://pastebin.ca/1291353

That has to be within the top 20 longest functions I have ever seen…. but without a doubt, some of the most heavily indented code I have ever seen lol. Like WoW man !

0x5065726c20726f636b7321

Hooah, I’ve nearly completed my little organizational pattern hehe.

~/stuff                            -> dumping ground for work load management
-------/bin -> binaries to help out (links to ~/sh)
------------/cgrep -> comma grepper for contacts file
------------/reminded -> reminder notifications daemon
-------/bookmarks -> links to pages I need to read
-------/contacts -> CSV file with why,method,id of people I need to contact
-------/delegates -> list of things I pawned off on other people (and need to follow up with)
-------/open-loops -> list of things I need to do; if it is here, it is a commitment
-------/reminders -> directory full of reminders
-----------------/YYYY-MM-DDTHH:MM -> send me this files contents on YYYY-MM-DD at HH:MM UTC
-------/hope-chest -> things I wish I had time for; deal with in future
-------/school -> reserved for future need
-------/projects -> tmp files for various projects.

On Sunday (2008-12-07), I started writing cgrep in Perl, and setting up the contacts & open-loops files. Finished the final touches yesterday, and finished reminded today (Aside from tweaks needed for WinXP; adjust $ENV vars). Not to bad, considering how little coding time I’ve had lately :

Terry@dixie$ ~/stuff/bin/cgrep -h   
/usr/home/Terry/stuff/bin/cgrep -- Grep for the contacts CSV file

Usage:
cgrep [IWhimvw] [-f file | --file file] regex [file ...]

Options:
-I, --id grep the 'id' column
-W, --why grep the "why" column
-V, --verbose display line for AWK
-h, --help print usage help info
-i, --ignore-case ignore case distinctions
-m, --method grep the "method" column
--man read manual page
-v, --invert-match select non-matching items
-w, --who grep the "who" column

Terry@dixie$ ~/stuff/bin/reminded -h
/usr/home/Terry/stuff/bin/reminded -- reminder notifications daemon

Usage:
reminded [-t seconds] [-n|-m addr] [-p program] [-d directory]

Options:
-D, --debug Debugging output
-d, --directory Directory to search
-m, --mail=address Remind by Mail to address
-h, --help print usage help info
-n, --notify Remind by notification popup
--man read manual page
-p, --program=string Execute string as the notifier
-t, --timer=secs Sleep secs between checks

Terry@dixie$

I’ll probably modify ~/init.sh to launch reminded during my sessions; maybe rsync files to Vectra, and run it in mailing mode.

Things in ~/stuff/open-loops are more or less sorted into a queue of tasks; which are to be done in mostly the order listed. Once they are done, they get deleted; and generate or nuke other entries IAW the resulting outcome. So far, it’s actually worked well enough; cgrep, reminded, and the structural are all done ahead of schedule. Now if I could just do something about controlling the amount of time available to work on crap!!! I once tried Personal Information Manager (PIM) software, but usually found the surveyed apps to lack the level of flexibility I need. And to hack it in, would take more time then using a few megs in sticky notes. ssh’ing to Vectra and mucking with a todo file ain’t so hot either, so here we go 🙂 It’s simple, it’s effective (as anything else), and no need to screw around with a big, overwait, memory hogging, overly mouse riddled program, just to manage things -> I can use my shell xD.

It’s amazing, how often I can throw perl at a problem, and see it work lol.

Then again, I can usually read my Perl scripts in six++ months… can’t always say the same for other peoples golf game.