A little real life…. (IRC style)

     i3lack0p | so is there an exit script for blackbox?      │
SAS_Spidey01 | 'exit script' ? │
i3lack0p | yea when a user request to log out of a │
blackbox seesion is there a script that will │
execute │
i3lack0p | before the user leaves │
SAS_Spidey01 | somehow I think blackbox enter and exit │
scripts are delegated to the 11th power of X │
i3lack0p | what │
i3lack0p | .blackboxrc is the startup script is there an │
exit script │
-*- SAS_Spidey01 bangs head against wall │

note: Blackbox = Window Manager for X11; .blackboxrc = x resource file which is != a script.

this is something I would do

This linguistics professor was lecturing the class.
“In English,” he explained, “a double negative forms a positive. In some languages, such as Russian, a double negative is still a negative.”
“However,” the professor continued, “there is no language wherein a double positive can form a negative.”
Immediately, a voice from the back of the room piped up: “Yeah….. right….”

mm, bash.org is making this a laughing day lol

Chuckle of the day, 2009-03-29

Quote #877975:

I got the worst fortune after having a condom break
what “Even the smallest leak can sink a ship”
Damn Asian Cookies

*rolling on the floor laughing my freaking rear-end off*

additionally:

#26985 +(75)- [X]

-= fortezza] if I push my honda over a cliff, how fast will it get to 60mph?
-= x1bncwn] the same speed as the viper
-= x1bncwn] 😛

The others, are at best rated NC-17 or generally offensive in anture, but still funny lol.

interm to-do-list

  • finish sas work
  • finish implementing history commands/HISTFILE in tpsh
  • take a shower
  • hexedit firefox3 > /dev/hell/level/7
  • figure out the least painful route of doing a crap load of software updates on my laptop

spent most of my day in the proving grounds, and a little time on the hallway. Really, I was rather surprised: my first trip down the hallway I was making good accuracy, good pace (for an old fart), until I got to the nearly bullet proof potted plant and the 9mm roller skater next to the hostage lol.

bookmark: cmp nasm gas

http://www.ibm.com/developerworks/linux/library/l-gas-nasm.html

last line read: NASM uses the resb, resw, and resd keywords to allocated byte, word, and dword space in the BSS section.

(back in dec/jan or so, I was trying to learn some asm using examples in GAS and the NASM manual; wish I had time to restart those studies!)

Good girl, bad girl?

Willow laid down on the floor eating something and I called out, “did you give her a carrot or something?” (the Vet Tech proscribed healthy-snacks lol) and Ma answered back No, as the dog ran out of the room.

I found Willow on the floor behind the cache trying to eat it, but didn’t see it… to me it looked like it might’ve been a big piece of bird seed, I couldn’t get it out of her mouth so I commanded her to “split it”, she did…. surprise, surprise – it was Ma’s Vitamin E softgel! She did it once with a calcium pill, that looked just like her interceptor (worm-preventive) pill; but hid it because it didn’t taste good enough to chew haha; after that she stopped eating her interceptor like candy. This time, I guess the vitamin E must have tasted good :

“Bad giir… good girl for spitting it out, but bad girl for taking it!”

So I swapped it with a marrow bone, and Willows all the happier lmao.

Dogs are just like kids, gotta watch them close or don’t be shocked at what ends up in their mouths when you’re not looking lol.

Code monkey go to bed…

It’s been a rather slow day, but somewhat productive (only about 10 or 11 commits :@). My families made sure that I’ve had a throbbing headache most of the day… rat fuckers! But at least there is some work to show for it. tpsh now has a concept of $PATHEXT based on cmd.exe’s %PathExt% variable.

Windows is ruled by file extensions, while UNIX could care less about them; so really one of the few good things about Microsoft’s cmd.exe is you can tell it what file extensions should be “understood”, i.e. so you can type ‘notepad’ instead of ‘notepad.exe’. Since tpsh is modeled after the standard Unix sh, it’s mostly oblivious to file extensions: it cares about names. However it is virtually _impossible_ to use Windows from the CLI level without implementing something like PATHEXT or typing yourself into a nightmare (winxp/cmd.exe is actually good at making you do that, compared to a unix/sh).

For better compatibility with a Windows environment, tpsh now implements it’s (my) own concept of the feature, complete with a ‘pathext’ option (default on) to toggle the functionality. The main reason tpsh does this, is so I can type ‘gvim’ when I mean ‘C:Pathtogvim.bat’, the fact that I’m used to typing ‘vim’ is aside the point lol. (I rarely use gvim off win32 b/c of diffs between nt and unix cli)

About the only time I use file extensions is when forced (Win32), when ideal (.zip, .tar, etc), when saving text with CRLF for new line indicators (notepad friendly .txt), multimedia files (.png, .ogg, etc), or when deploying crap to a Windows machine lol. So it’s not an important thing for me; just a time saver.

Another thing I sorted out is what I call the “hash separator” for environment variables. UNIX shells by convention separate values like $PATH with a ‘:’, e.g. ‘/bin:/usr/bin’, but DOS and related bastards use ‘;’ for things like %PATH%, e.g. ‘C:Windows;C:WindowsSystem32’. Because many older operating systems use a ‘letter:path’ style for paths anyway, there is no universally portable default setting. Since virtually all operations involving a variables like PATH, CDPATH, and ENV (an extension used in tpsh, which I’ve never seen another shell use) involve a hash table, I call the mark the ‘hash-sep’ for short. One of today’s changes was exposing the hash-sep directly to the user.

The default hash-sep is ‘;’ under MSWin32, DOS, and OS/2 and ‘:’ otherwise, I’ve no clue what the hell VMS uses and don’t have access to it, so no worries yet ;-). Whenever the user changes the HASHSEP environment variable, the next time an operation that relies on it (basically hsplit(), short for hash-sep split()) the shell compiles it down to a suitable regular expression to save time on future commands.

setenv HASHSEP '/'
rehash

the rehash will cause ‘/’ to compile via qr for to speed up later splits; and due to the change of hashsep, causes the internal cache of $PATH to switch from the default ‘:’ or ‘;’, to ‘/’, which is probably not something anyone wants to do, but being able to fiddle with it can be useful for scripting reasons ^_^. Not to mention the fact that it makes concatenating things like PATH/CDPATH settings more portable when the environment requires something different.

Another bit of today’s work, was setting it up so that the history built-in now displays the correct line numbers. I want to setup builtins to save/load data from HISTFILE; so that command history is not lost between sessions – I’ve always had a bit of an itch about how most shells deal with it; wonder what tpsh might do hehe. Not sure about the $LINENO yet, I never really use it in scripting or interactive usage that much: will probably take the single unix specification into consideration on $LINENO.

If I didn’t have to so much crap for tomorrow, I could probably have half the manual done tonight and still get to bed before 0600 local. But no…. work early, work long, to be driven nuts after work, and probably end up PTFO instead of coding the night way.


*sigh*.

my idea of a great vacation: a Ferrari, laptops, solar panels to power them, hot date, and a tropical island with a sunny beach 😉

An epiphany!

3. a sudden, intuitive perception of or insight into the reality or essential meaning of something, usually initiated by some simple, homely, or commonplace occurrence or experience.

I actually thanked my mother for dragging my out on a shopping expedition today, because I figured out sometime a ways “down” my todo list: implementing control flow in tpsh. I guess you can take the programmer away from the code, but you can’t take the code away from programmer ^_^ ^_^ ^_^.

Earlier I recorded that the goal was for tpsh to use a queue of commands to execute rather then going by lines, the idea being:

`cmd1; cmd2; cmd3`

would parse into a list like ‘(cmd1, cmd2, cmd3’) which tpsh would then walk, eval, and execute the result in sequence (i.e. first in, first out). Then it occurred to me, if the shell will go that route for lexical reasons: why not implement the shells control flow operators as keywords that manipulate that queue directly? So that conceptually, a shell snippet like:

cmd0
if [ expr ]; then
cmd1
cmd2
else
cmd3
cmd4
fi
cmd5

would be inserted into the queue in a suitable manor and passed to the call back, so if the queue looked something like this:

( cmd0, if [ expr ], cmd1, cmd2, else, cmd3, cmd4, fi, cmd5 )

the call back would receive that relevant portion of the queue, (i.e. queue1 through queue7), evaluate the test and return the appropriate portion to be spliced into the queue, in this case:

( cmd0, cmd1, cmd2, cmd5 ) or ( cmd0, cmd3, cmd4, cmd5 )

depending on whether `[ expr ]` evaluated as true or false.

Damn, this so makes me want to straighten up the necessary parts of tpsh… now if only I didn’t have to work tomorrow from morning to whenever I drop over undead, or pass out lol. These kinds of things have always fascinated me about programming, but life has never offered much chance to study compilers, virtual machines, and interpretors… let along create something like tpsh, that requires implementing a scripting language :. The one good thing, despite the ups/downs and expressiveness of sh script, it’s really an easy language for a human to understand.