Friday, October 29, 2010

Been rather busy of sorts. Times been intermixed between matters of philosophy, you could say; and a small web related gig. I must admit, it is fun to see just how fast my brain can slurp up a large web framework.

That is something that kind of separates people like me, from the average user. We have a sort of "Web fu", that lets us quickly gather tons of information. It goes beyond that though, deeper into all sorts of information sources. You should picture Sherlock Holmes explaining what a glance at a customer tells him lol.

If we can think about it, there isn't much my sort of geek can't figure out, given enough time and resources; each of which create an interesting expression of how long it takes to figure something out.


Now if only I had time to study rocket science!

Wednesday, October 27, 2010

I knew I should have stayed in bed this morning

Well, I've about had it for the day. The one goal I've had was to shave and get cleaned up, her royal pain decided to go shopping before her job interview, so that was delayed. To top it off while passing the time with my laptop, waiting for her to get back from the interview; I found an error in the systems git package.

When leaving, we was pulling out of a very tight space and this little piece of plastic sticking out of the bumper caught on the neighbouring car. It left a small ~1" scratch on the other cars fender and took off most of ma's bumper. The fords front bumper has been hanging by a thread for over a decade with a large gash and shards sticking out, because when it was smashed up back in Florida by someone that ran a red light, my mother didn't spend any of the insurance money on fixing her bumper lol.

Waited for the owner of the other car and apologized for the scratch, she didn't care but took ma's insurance information and gave us her name/number just in case. Unlike some people in my family, I hold myself responsible for my mistakes; some people just drive off. If I fuck up, I admit it.

Tending to the family ford wasn't much problem, the bumper is just like 3mm of painted plastic with a strip of hardened rubber glued on the front. Borrowed a scissor for cutting off the rubber link and adjusted the straps to keep the bumper hanging. Ma has had it hanging half off in one corner for years with plastic cords hooking it to the hood anyway.

Afterwards my mother asked if I thought I should still have my license after this, and I told her that I've seen her do much worse herself, and reminded her that she has been driving for over 40 years; by contrast I only started driving about 10 months ago. Actually now that I think of it, I haven't even been driving for 10 months, because ma pissed away like January through May or April before she even let me drive the fucking car <_<.

As to what sort of things she has done over the years, in fact, if you search through my journal far enough, you'll find a record of ma smashing the rear bumper in the grocery store parking lot, and just driving off illegally. Now how is that for being a responsible senior citizen?

Tuesday, October 26, 2010

God's Gonna Cut You Down



You can run on for a long time
Run on for a long time
Run on for a long time
Sooner or later God'll cut you down
Sooner or later God'll cut you down

Go tell that long tongue liar
Go and tell that midnight rider
Tell the rambler,
The gambler,
The back biter
Tell 'em that God's gonna cut 'em down
Tell 'em that God's gonna cut 'em down

Well my goodness gracious let me tell you the news
My head's been wet with the midnight dew
I've been down on bended knee talkin' to the man from Galilee
He spoke to me in the voice so sweet
I thought I heard the shuffle of the angel's feet
He called my name and my heart stood still
When he said, "John go do My will!"

Go tell that long tongue liar
Go and tell that midnight rider
Tell the rambler,
The gambler,
The back biter
Tell 'em that God's gonna cut 'em down
Tell 'em that God's gonna cut 'em down

You can run on for a long time
Run on for a long time
Run on for a long time
Sooner or later God'll cut you down
Sooner or later God'll cut you down

Well you may throw your rock and hide your hand
Workin' in the dark against your fellow man
But as sure as God made black and white
What's done in the dark will be brought to the light

You can run on for a long time
Run on for a long time
Run on for a long time
Sooner or later God'll cut you down
Sooner or later God'll cut you down

Go tell that long tongue liar
Go and tell that midnight rider
Tell the rambler,
The gambler,
The back biter
Tell 'em that God's Gonna Cut You Down
Tell 'em that God's gonna cut you down
Tell 'em that God's gonna cut you down
God's Gonna Cut You Down—Johnny Cash

I think this is my theme song for the year.

Random codeness

Been contemplating about a few things, that are arguably, the programmers equivalent to several mortal sins. One of these involves standardising my world around a given language setup. Yes, choosing the best tools for the job rather than the same tools can sometimes be troublesome.

The languages I'm considering, are C++ and C#. Python would be a good candidate except that I've waay to many lines of Python over the years lol. Behind the C++ factor, is simply put, Richard Gabriel was correct when he said "The good news is that in 1995 we will have a good operating system and programming language; the bad news is that they will be Unix and C++". Frankly programming in C++ is a bitch. It's not so much the language, which has plenty of warts, as it is building projects causes headaches. Most of which is a mixture of complexity and the inability of people to manage that complexity before shipping it. The other factor, being C#. I've come to rather like C#, because it takes the best part of languages like Java, i.e. using bytecode rather than native code, but unlike Java 6, C# 3 and up is actually a modern fucking language. Java can kiss my rebel dick. It's retarded.

C++ gives painless (as possible) support to C code, while adding some goodies: automatic ctor/dtor invocation, formal namespace schematics, semi-generic data structures, and often disabled or unused support for exceptions and runtime type information. There are also a lot of libraries written in C++, that are less than easy to use in other languages; the fact that many are often less than easy to use in C++, is aside from the point obviously ^_^.

C# is more convenient than C++, because of a more modern syntax (Java can really fuck a duck for all the modernness of it), and because it has the ultimate in language killers, which C++ lacks—A big fucking library. Where as C++ provides stream based I/O, container based data structures, and not much else beyond your systems C library. C# has a large cross-language class library, which essentially throws networking, XML, basic graphics on top of that, and a much more portable interface to system stuff, like Process class and the file system code.

That is the big killer: libraries that are easily incorporated. C++ lacks that. In fact, about the closest you can get is throwing in Boost, POCO, Qt, or Wx. Plus a few other odds and ends.

C# is a much more pleasant language to work in and takes the pain out of compiling projects, because it really can't get much harder than which defines to set and which files to compile into what. Something that life would be fucking great if C++ could say the same, even on a single platform group. Unlike Java, it's also possible to build C# projects promptly and trivially combine code with many other languages.

C++ however has a much wider range of libraries readily available without needing glue code, if one can stand the bitch and a half of making them work \o/.

Monday, October 25, 2010

I decidedly prefer Qt over GTK, and wish it's third party language bindings were better, outside of Pythons \o/

Saturday, October 23, 2010

When there's long stretches between entries, that is when I flush thoughts to my journal; there's usually one of three causes. Either I'm to busy to breath, hitting rock bottom, or both. Looking at my posting records over the last four years, this seems to be fairly consistent \o/
It's been a bit busy lately, I'm very tired right now. Friday a friend figured out a way that I can get around my mothers' communications block sufficiently, so I spent most of today (well, technically yesterday in another 30mins lol) filling out another round of job applications. Somehow, I think that I've learned that GOD and friends make better obstacle removers, and family better obstacle creators.

With a little tweaking to get my laptop into the loop, I should now be independent of ma's phone systems, and thus her control over that aspect of things. The past couple weeks have been rather lax, largely because of losing the commu' block. I can apply all I want, but a lot of good that would do if any calls back get routed to /dev/null, now does it? Using this new setup, I'm free of that delema. Finally!

Family may as well be the most vocal proponents in favour of the idea that I'm a useless bastard worth less than the lump of flesh in front of my computer, yet also tends to be the most obstinate bunch about helping improve life's situation rather than hindering my plans.

Really, it is annoying. How people can act saintly and blameless as a white sheet while dangling the knife they've been stabbing with, and do it in such a way they can fain innocence. At least, that's what it looks like. Yeah, I believe 0+6 can be > 0, don't you? Not.

Hurt

Somehow, this really makes me think about the life of Johnny Cash.

I hurt myself today
to see if I still feel
I focus on the pain
the only thing that's real
the needle tears a hole
the old familiar sting
try to kill it all away
but I remember everything
what have I become?
my sweetest friend
everyone I know
goes away in the end
and you could have it all
my empire of dirt

I will let you down
I will make you hurt

I wear this crown of thorns
upon my liar's chair
full of broken thoughts
I cannot repair
beneath the stains of time
the feelings disappear
you are someone else
I am still right here

what have I become?
my sweetest friend
everyone I know
goes away in the end
and you could have it all
my empire of dirt

I will let you down
I will make you hurt

if I could start again
a million miles away
I would keep myself
I would find a way
Hurt—Johnny Cash

Thursday, October 21, 2010

Should've Been A Cowboy

I bet you've never heard ole Marshall Dylan say
Miss Kitty have you ever thought of running away
Settling down would you marry me
If I ask you twice and beg you pretty please
She'd of said Yes in a New York minute
They never tied the knot
His heart wasn't in it
He just stole a kiss as he road away
He never hung his hat up, at Kitty's place

I shoulda been a cowboy
I shoulda learned to rope and ride
Wearing my six-shooter, riding my pony, on a cattle drive
Stealing young girl's hearts
Just like Gene and Roy
Singing those campfire songs
Oh, I should've been a cowboy

I might of had a side kick with a funny name
Running wild through the hills chasing Jesse James
Ending up on the brink of danger
Riding shotgun for the Texas Rangers
Go west young man, haven't you been told
California's full of whiskey, women and gold
Sleeping out all night beneath the desert stars
With a dream in my eye, and a prayer in my heart

I shoulda been a Cowboy
I shoulda learned to rope and ride
Wearing my six-shooter, riding my pony on a cattle drive
Stealing young girl's hearts
Just like Gene and Roy
Singing those campfire songs
Oh, I should've been a cowboy
Oh, I should've been a cowboy
Oh, I should've been a cowboy
Oh, I should've been a cowboy...


Should've Been A Cowboy—Toby Keith

Wednesday, October 20, 2010



Somehow seeing a [SAS] header on a video being marked as NTF training, makes me remember that someone in [SAS] hosted a F&M exercise in GR1, and filmed it. I remember it being posted in the forums back in '09. Now if I could just remember whether it was Valroe or Sniper who filmed it, lol.

Sometimes you can only laugh or cry

Today is one of those lovely days, you know, the kind where you would rather ...

Day started off with having to take the car in for emissions inspection. The usual being badgered well in advance. Got maybe five or six hours sleep, depending on what hour it was when I finally dozed off. Garage declined to do the inspection, because of steel belting showing through the tyres and the front end being so far out of alignment that the bay chief didn't want any of his techs putting it on the dyno. That means driving over to the mechanic and dropping about $230, plus picking up a pair of aft tyres later on. I'm still counting down the hours until my mother can figure out something venom filled over that one. When I was loading the car for tomorrow and noticed it leaking a bit of anti-freeze, I couldn't help but laugh. It's so fucked I can't do anything else, except cry and I would rather laugh until I cry. At least that's the best of both choices.

Obviously the most cheerful thought of my whole day, is of course: my mother wondering if I've any money she can barrow or anything of value to haulk in a pawn shop. The fact that anything I have to offer, is likely on her collateral with a loan company being aside the point. I intend to call a few pawnshops and see what they will take for a few bits of electronics, that I doubt will carry much of a price. All my life, I've never been alotted anything of value (unless you count friends tangibly). Like I've got anything to pawn, that isn't a piss in the bucket?

It's nice, when I need help, she will sit on her fat ass for half a year. When I turn to the job issue, she's another obstacle. However when she needs something, she'll all but sell my plasma to the first bidder. Ain't love grand? Undoubtedly, I point out that if she wants help out of me, she shouldn't have pissed away my time on the whole license/job thing. I wonder if they still buy human hair.

My original plan for the day, was to just work on getting as much of a small coding project (that I really need to get done), than focus on the job issue for the next several days, distracted by my workload. With my mothers near perfect commu' block, I don't expect that to work out very well. Trying to get a call through this place is futile and she keeps it that way. Between my mother and everything else, obviously nether objective has gotten done today. Some people have fun gaming or partying, coding relaxes me and I enjoy it.  No one seems to be able to understand that, except for more my kind of people. Those are rare.


It makes me fucking sick. I'm not good enough to care about, only good enough to be used. That's what life here is like. I would do well, if I learned how not to care. Even better, odds are, if I learned to be amoral and give up on my concepts of right/wrong, ethics, and the like. Sometimes I hate being me. Unlike a lot of people on the earth, it doesn't matter if you can be of use to me or not, I care about you the same either way. Like I say, I have only one face.

Tuesday, October 19, 2010

This reminds me, I really need to get the razor out of moth balls.... I'm starting to look like this guy.

Monday, October 18, 2010

backtrace

Why am I looking in the freezer for paper towels?
Because I'm happy, that's why.

My replacement headset has finally arrived

Sunday, October 17, 2010

The other day I was thinking about a young semi-student programmer that I know, and thought about presenting him a small set of "Teeth cutting" exercises. Small tasks that would serve a double purpose, help me evaluate his present aptitude for development tasks, and try and prepare him a wee bit for what his future education is likely to throw out. Unlike what seems to be the most common norm in college environments, I can also gently push in more, ahem, practical directions that what most students I've met have learned. I still have yet to find out if the number of stupid programmers on earth is due to the schooling or the students. Alas, that's drifting off topic.

When I stopped thinking about the whole teeth cutting thing, I had done so because no ideas of what to use as a starting exercise had come to mind. Today while chatting, one did: a bare bones version of the UNIX tail program.




(06:30:27 PM) Spidey01: A first exercise:
 language: your choice
 description: implement a program called 'tail' that displays the last N lines of a file, where N is supplied by the user. It need not be a GUI, but can be if you wish.
 goals:
  A/ Minimise the scope your variables are accessible from.
  B/ Describe the procedure (algorithm) you came up with for finding the last N lines in the file.
  C/ Think and discuss, is there a way to improve on your algorithm?


Tail is complex enough that some C implementations are horrendously overcomplicated, yet simple enough that it is an easily completed without a gruelling mental challenge. Especially if the -n option is the only one you care about. The choice of A was chosen it's a very common foul up among programmers, young and old a like.

I wrote a more complex program that that in C years ago as a learning process, that was more or less a fusion of the unix cat, head, and tail programs. Since the student in question was using Visual Basic .NET (oi), I opted to use C# so as to keep things at least, in the same runtime family. Here is a listing of the example code I wrote, the display here was done by feeding it into gvim and using :TOhtml to get syntax highlighted HTML to post here, than clipping a few things, hehe. The gvim theme is github.



  1 /**
  2  * comments having // style, are notes to young readers.
  3  *
  4  * CAVEATS:
  5  *  line numbers are represented by int, and thus have a size limit imposed by
  6  *  the 32-bit integer representation of the CLR.  Whether the users computer
  7  *  will run out of memory before that is irrelevant.
  8  *
  9  *  If there are less lines read than requested by the user, all lines are
 10  *  displayed without error message. I chose this because the error message
 11  *  would be more annoying than useful.
 12  */
 13 
 14 using System;
 15 using System.IO;
 16 using System.Collections.Generic;
 17 
 18 class Tail {
 19     enum ExitCode { // overkill
 20         Success=0,
 21         Failure=1,
 22         NotFound=127,
 23     }
 24 
 25     static void Main(string[] args) {
 26         if (args.Length != 2) {
 27             usage();
 28         }
 29 
 30         using (var s = new StreamReader(args[1])) {
 31             try {
 32                 var n = Convert.ToInt32(args[0]);
 33                 foreach (var line in tail(n, s)) {
 34                     Console.WriteLine(line);
 35                 }
 36             } catch (FormatException) {
 37                 die(ExitCode.Failure,args[0] + " is not a usable line number");
 38             } catch (OverflowException) {
 39                 die(ExitCode.Failure, args[0] + " to big a number!");
 40             }
 41         }
 42     }
 43 
 44     static void usage() {
 45             Console.WriteLine("usage: tail.exe number file");
 46             Console.WriteLine("number = number of lines to display from "
 47                               +"end of file");
 48             Console.WriteLine("file = file to read from tail");
 49             Environment.Exit((int)ExitCode.Success);
 50     }
 51 
 52     // Instead of doing the display work itself, returns a sequence of lines
 53     // to be displayed. This means this function could be easily used to fill
 54     // in a textbox in a GUI.
 55     //
 56     // It could also take a delegate object to do the display work, thus
 57     // improving runtime performance but that would be less flexible.  In this
 58     // particular programs case, just doing Console.WriteLine() itself would
 59     // be OK. See the foreach loop over tail() up in Main() for reference.
 60     //
 61     // This method also sucks up memory like a filthy whore because it stores
 62     // the whole file in memory as a IList<T>.  That's fine for a quick and
 63     // dirty protype. In real life, this should use a string[] array of length
 64     // 'n' and only store that many lines. That way it could handle files 5
 65     // billion lines long just as efficently as files 5 lines long.
 66     //
 67     // I chose not to make that change in this example, in order to make the
 68     // code as simple to read as possible.
 69     //
 70     // Incremental development +  code review = good idea.
 71     //
 72     static IEnumerable<string> tail(int n, TextReader s) {
 73         string line;
 74         var list = new List<string>();
 75 
 76         try {
 77             while ((line = s.ReadLine()) != null) {
 78                 list.Add(line);
 79             }
 80         } catch (OutOfMemoryException) {
 81             die(ExitCode.Failure, "out of memory");
 82         } catch (IOException) {
 83             die(ExitCode.Failure, "error reading from file");
 84         }
 85 
 86         if (n > list.Count) {  // a smart bounds check!
 87             n = list.Count;
 88         }
 89 
 90         // implecations of a GetRange() using a shallow copy rather than a
 91         // deep copy, are left as an exercise to the reader.
 92         return list.GetRange(list.Count - n, n);
 93     }
 94 
 95     static void die(ExitCode e, string message) {
 96         Console.Error.WriteLine("tail.exe: " + message);
 97         Environment.Exit((int)e);
 98     }
 99 }
100 


This is a backtrace of the development process involved.


The program started simple: with the Main() method in Tail. The first thing I did was a simple check to see if args.Length was == 0, and exiting with a usage message. Then I remembered while writing the Console.WriteLine() calls for the usage message, that I really wanted (exactly) two arguments. That's how the test became what's written above in the code listing. A couple minutes later I moved the usage message code from inside that if statement to a usage() method. I did that to keep the Main() method more concise: unless you have reasons to groan over function call overhead, doing that is often a good idea. (Up to a point that is.)

From the get go, I knew I wanted the meat and potatoes to be in a method named tail() instead of Main(). For the same reasons that I created usage(). So that because a short using statement over a new StreamReader object.

First up was converting the string arg[0] from a string representation of a number, to an integeral representation of a number. At first I used uint (Unsigned Integer, 32-bit length) but later decided to make it plane int (Signed Integer, 32-bit length) because that's what subscripts into a collection are defined in terms of. I don't care if the user wants to display more than ~2,147,483,647 lines, it's only an example program, damn it! Because tail() shouldn't give a fuck about converting the programs argument vector to a type it can use (which obviously needs to be numeric), the caller (Main()) does the conversion. First tried args[0].ToUInt32() and when that compiled with errors, I hit Google. That gave me the System.Convert documentation on MSDN, from which it was easy to find the proper method. Because MSDN lists what exceptions System.Convert.ToInt32 can throw, and I know from experience that testing for such things is necessary ^_^, I quickly stubbed out catch clauses for FormatException and OverflowException. I wrote a simple set of messages to the standard output stream and an exit for each one. Than I converted them to using the standard error stream and wrote an enum called ErrorCodes, complete with casts to int when needed.

It was about this time, that I decided that implementing a simple method like Perls die() or BSDs err() would be convenient. Thus I implemented die() and replaced the repetitive error code. Functions are almost like a reusable template in that way. Then I decided that ExitCode was a better than for the enumeration than ErrorCodes, since it was being used more generally as an exit status (code) than an error report; unlike Microsoft I do not consider Success to be an error code ;). That was a simple global search and replace, or :%s/ErrorCodes/ExitCode/g in vim. Followed by a quick write (save) and recompile to test. Job done.

While I was at it, I also had an intentional bug encoded into the exception handlers for Convert, originally n variable was in a higher scope than the Convert (the using instead of try block). The error message for handling FormatException, used n.ToString() and the one for OverflowException used args[0]. The bug here was a subtle food for thought: one displays the result of the conversion, which might not match what the user supplied -> thus confusing the user. The other displayed what the user entered, which might not be what the program had tried to used. That also pushes an interesting thought on your stack, since the same data is used by both die()'s why do we have to write and maintain it twice? Alas, I realised the n variable was in too wide a scope and thus made that mind-play a moot point (by removing n from the scope of the catch statements). If you recall: using minimal scope for variables was actually the intent of the exercise, not error handling and code reuse.

Next I focused on implementing tail(). At first it was a simple. Just take a number and a StreamReader, and do a little loop over reading lines—for a quick test. When I checked the documentation on MSDN, I noticed that StreamReader was an implementation rather than a base class for TextReader. I always find that weird, but that's outside the scope of this journal entry. Thus I made the using statement in Main() create a StreamReader and pass it to tail(), now taking a TextReader. Originally it also had a void return type, and simply printed out its data. I did that to make testing easier. The comments above make a sufficient explanation of why IEnumerable is used, and what I've already written about StreamReader/TextReader may suggest why it doesn't return a straight string[] (e.g. array of strings).


The heart of it of course, is just feeding lines from a file into a generic List of strings. Since the exceptional possibilities are more straightforward, I wrote the catch blogs first. After that it is merely the question of extracting the correct lines from the tail end of the list. That's a simple one to one (1:1) abstraction to how you might do it manually. I believe simple is the best way to make a prototype. Since the student in question was joking about how his implementation would likely crash if the line numbers were out of whack from what's really in the file, I was sure to include a simple check. If the # of lines requested is greater than what really is there, just scale down. Volia. The comments at the top of the listing above, show why there is no error message displayed.

Extracting the items was a bit more of a question, my first implementation was a simple C-style for loop over the list using Console.WriteLine(). In the conversion to returning the data to be displaced, in which the tail() call in Main() became the above foreach loop. I added the comment about GetRange() more so as food for thought (from a code reuse and optimizational perspective). The math needed to extract the correct range of lines is trivial.

I then took a few moments to look at things over, doing a sort of code review. A few things were rearranged for clarity. I also introduced a bug, breaking the specification goals. If you look close enough at tail(), you will see that the variable line is only used inside the try block, yet it is declared at method scope. The #1 goal of the exercise was to avoid such things, hehe. I also thought about adjusting things to use an n sized cache of lines, rather than slurping the entire file in memory but decided against it. To keep the code easier to read, since the target-reader knows neather C# nor a lot of programming stuff, I just left comments noting that pro and contra of the matter.

Some people might find the method naming style odd for C#, but it's one that I've come to like, thanks to Go and C#. I.e. publicly exposed functions get NamesLikeThis and those that ain't, get namesLikeThis. Although personally I prefer C style names_like_this, aesthetically speaking.

The test file I used during the run was this:

line one
line two
line three
line four
line five

and most tests were done using various adjustments on:

terry@dixie$ gmcs tail.cs && mono tail.cs 2 test.txt


After sending the files over, I also whipped up a Visual Studio solution in MonoDevelop, and than realised that I left a rather unprofessional bug. If the filename in args[1] didn't exist, the program would crash. That was easily fixed on the fly.

Overall the program took about an hour and a half to write. For such a simple program, that's actually kind of a scar on my pride lol. But hey, I've barely written any code this month and I had to look up most of the system library calls in MSDN as I went along, I also tried to make it more polished than your typical example code. Which usually smells.


I can also think of a few ways to incrementally adopt that first exercise, into several other exercises. That might be useful.
Between Left 4 Dead versis and COD6: Modern Warfare 2 Team Tactical, I'm almost tempted to concentrate on competitve tactics again :-/.

Saturday, October 16, 2010

I've been experimenting with window managers lately: fluxbox, openbox, awesome, and musca. Fluxbox and openbox, are pretty much just generic window managers, at least in my eyes. That said, they are well worth using, for most peopel. Awesome and Musca are tiling window managers, and a lot more, eh, minimalist. While I used to collect window managers, among quite a few other odds and ends back when I had time for it: but I have never done the "Tiling thing" beyond a very brief test drive of dwm.

Awesome and Musca create an interesting experience: you create the windows, the window manager, manages them. It's almost alien lol. Normally you create a window, the window manager figures out where to draw it. You do the rest, e.g. by resizing and moving it around as necessary. In these tiling window managers however, newly created windows are automatically arranged and sized by dividing containers.

Launching your first window is like maximising, lauching a second window causes everything to resize and give each program half the screen, and so on based on some tiling pattern. The most used seems to be 1 half sized window left and 2 quarter sized windows right; works better than you might think. Rather than resizing the windows individual, you resize the containers. So if the screen is laid out as:



|         | term |
| Firefox |------|
|         | chat |


>

Selecting either the term or chat window and attempting to resize will resize all three windows. Try to enlarge the chat window horizontally, and Firefox will shrink and term grow, horizontally. Try to shrink the term window vertically and the chat window grows vertically, and so on.


It's mind blowingly better than what the style of window management people are used to these days, which dates back to like Mac OS 2 or Mac OS 3 back in the '80s. It is also a little bit awkward to let the computer take care of something, that you've been doing by hand for almost twenty years!

Relishing the experience however, has made me think of something different. I was just experimenting with the MinOverlapPlacementPenalties and MinOverlapPercentPlacementPenalties settings in FVWM, and it hit me. What if you could dynamically define what windows are important? I.e. what screen space should have more "Don't cover this up unless necessary", and how big a frame (i.e. for auto-tiling) should be, and so on?


It is technically possible, if perhaps computationally 'interesting' to figure out at the machine level. The windows that spend the most time focused or are most often gaining the focus, would be prime candidates. If the user 'uses' the window more than others, give it a larger chunk of available space scaled to its idea of how much space it needs, then prefer minimising the percentage of those windows being covered over or shrunken to absorb other windows in the same screen space.


It is food for thought!
Hmm, my mother is so deathly tired she walks in my room and asks me to make her something for lunch, a sandwich would be nice. Oh, and while I'm going to be in the kitchen anyway, could I fill her water and bring back her bag of potato chips?


Then she walks into the kitchen ahead of me to fiddle with the water bottles. She's was also much to tired to take her potato chip back with her when waltzing out of the kitchen. By the time I've delivered her glass of water, she's already gotten up again and walked to the kitchen. I go back to making the sandwich once she gets out of the way.


Somehow, I think everyone else in my family would have shouted, "Make your own ******** sandwich!" If you have strength enough for all that walking, odds are you can at least carry a several oz bag of potato chips with you, it's not like lugging a 10lbs bag of Kartoffeln!

Wednesday, October 13, 2010

The Price of Obedience

Two weeks ago while looking for the house we were supposed to stop at, the car hit "Half a tank" on the fuel gauge before she decided to call for directions. To my mother, the half way mark is synonymous in her tiny mind with what happens in real life when you reach the empty mark.

Somewhere between three to five demands to "Go no further", I reminded my mother that in America it is illegal to just stop the car in the middle of the road because you damn well please. In fact, as the driver: legally it would've been dependent upon my judgement whether or not there was any sudden obstacles ahead to warrant such action, not hers as passenger and owner of the car. It pays to read the fine print, right? Well, she wouldn't stop demanding the car to be stopped. The way English works, her choice of words in fact ordering me to stop on the spot.

Since my mother apparently thought herself smarter than the law, the driver (me), FORD hardware, and GOD (who created physics); and after all, it is her car not mine. So I decided promptly to give my mother exactly what she was demanding of me `ad nauseam`. Checking to make sure there was no one behind, in between her orders to "Go no further", I said "Fine", and slammed the brakes—bringing the car from approximately 43 to 0 miles per hour in the machines absolute minimal stopping time. The kind of extreme breaking that normally, I would only use if the alternative was to hit a brick fucking wall.

Well, the car stopped so fast that you could smell the rubber burning and there was a lovely cloud of smoke to accompany the screeching sound of trying to stop a moving car so near instantaneously. If seat belts weren't buckled or there was any cars behind, I wouldn't have satisfied my mothers orders to the letter. I'm more responsible then that. As there was no threat, I obeyed to the letter: and went no further ;).


A week later (-2 days), just before the weekend the car started to make a metal on metal sound whenever using the breaks. I expected when I chose to obey, that the action of going no further would total the break pads: which were old. Quick thinking methodical bastard, yes I am. Maybe some people should just learn to think rationally before I have to teach them a lesson. In my experience, my family only understands two things: violence and money. Since I'm not willing to beat my mothers brains in, following her orders to the point of burning through old break pads sounds like a good idea.


It took about a day's fearful stewing over it, for my mother to go from remarking that it was nobodies fault because the break pads are old and worn; she's bitched about them getting worn out over the past couple years, and also absolved me of any blame for the breaks; damn I wish I had a hidden tape recorder. To instead, loudly cursing me the next day and wishing me to my face that I would "Drop dead and rot in hell", among much worse things! I expected that would take an hour or two at most. Guess I was wrong.


Now after twenty two years of my mother, I know that being told to drop dead and rot in hell is about as close to a term of endearment as this family gets. It's ceased to phase me a long time ago. Of course, if I ever showed any sign of being phased by it would be like putting blood in shark infested water. So I've learned to take her exponentially increasing hatred with a straight face, rather than risking her doubling her efforts. There's a subtle joke in that for the math savy layman.


At first, I was actually tempted to tell her to "Be careful, I might aim to please" when I was told to die, but decided against it almost as fast as thinking of it. Reasons being that because of family history, that could be a potentiality painful remark to use on her, and obviously if I ever passed on before she did, liable to be remembered; which could also trigger her remembering the last time she was told "I aim to please" in the context of telling someone to up and die. I'm not as hurtful as my family. Sure, sometimes I'm an ass but before I open my mouth, I try to wager how much harm it will do. My mother by comparison skips thinking and lets her rage do the picking of words indiscriminately. I still remember some years ago, my mother mock-threatening to stick me with a fork, within earshot of someone who grew up with that. She just doesn't THINK.



End result? Just over a we bit oer $100 spent on the lesson. The real question is, has she learned anything from it?

A/ Half a tank is not synonymous with out of gas.
B/ You're not supposed to stop in the middle of the road for no reason.
C/ It's the driver's decision not the passengers.
D/ Being an irrational disrespectful bugger gets you no where with a geek.
E/ Be careful what you wish for, English is a very precise language.


Doubt ma has figured any of those out, but alas it does give her something to hate (me) with more focus than normal. Which will at least keep her mind off more serious ailments part of the time. An added benefit of deciding to obey that order to go no further: I'm hated worse than normal for a while, but it distracts her from worse.


I might also note that she almost never allows the car to go further than 20 miles from home, and on roads averaging a speed limit of 35mph to 45mph. That car can go up to 60 miles down the Interstate at an average speed of 70 miles per hour, and not even use up a third of a fuel tank.  When the "Go no further" incident occurred on Sunday, we were just outside walking distance of home and a few miles (or less) from a gas station. That means the chances of running out of gas would have been 0, unless she decided to take a trip to Alabama while we were out. I also bought gas that day, filling up to the mark below full, for $10.01. A full tank of gas for that car would cost about $40 going by the cars manual and average gas prices here.


I have no respect for displays of irrational fear, especially not from someone in their sixties. I'm also used to being automatically despised and loathed by people who should know better.

That's life.

Monday, October 11, 2010

Colt ACR

It has taken my about 17 years but I have finally found out what this freaking weapon is called:


It's the prototype Colt entered in the Army's old Advanced Combat Rifle (ACR) program in the late 80s.


The first time I ever encountered this weapons silhouette, was during the waning days of the G.I. Joe Hall of Fame toy line, because the Combat Camo Duke action figure and Green Beret weapons set came respectively with an olive green and silver. I think that was like 1993, so I must have been 5 or 6 years old at the time. As a child, it was actually a geeks curiosity about my toy's weapons, that drove me to study how weapons work, etcetera. This particular rifles model number always eluded me, it was an enigma that I never saw anywhere else. A stock reminiscent of an M4 tube, an ELCAN/C79 style scope, M16'esque magazine, but the rest became alien. Almost like an alternate evolution of the Colt M16A1 or an early version of the M16A2. Now I know why! It was made by Colt for the ACR program, and obviously based on the M16A2's it would have been replacing, if the program didn't flunk lol. Sadly it's successors also flunked.

Ironically not even knowing about the ammunition being tested with the Colt ACR, as a child I would often use it in toy battles as a substitute for an urban sniper rifle, in a role in between what you might see the old KAC SR-25s and modern Army SDM-R/USMC SAM-R rifles used for—but firing a special "Hyper (velocity) penetrator" sabot round. Still I would rather of had an MSG-90/PSG-1, even as a kid, I had a taste for Heckler & Koch.

Sometimes I wonder if I am part psychic, hehe.

Saturday, October 9, 2010

Since for (network) testing purposes I've rigged a spare partition on my desktop as a virtual duplicate of my laptop, but obviously s/ati/nv/ and Linux is smart enough to take care of the rest. To make the most of it, I also swapped a few things around to the latest packages. For dependency reasons Gnome is installed; like wise KDE for old times sake and Xfce for completeness. I decided that since I needed a desktop session to test the 'common' web browsers, that I may as well take KDE for a spin.

So far, I've tried about four or five versions of KDE since 4 went public, all but one of them was a release version. Taking a count from the moment the KDM wall paper is replaced by my blanked Xfce one, my meagre laptop loads Xfce into a usable state by "The count of three", and has Dropbox and some applets loaded by five seconds. By contrast, on my waaay more powerful desktop, not only did I give up counting at the second mark of the startup splash screen: I dropped my water bottle and had to fish around in the dark to retrieve it from under the table. By then, KDE still had not gotten half way through it's start up splash srcreen 8=). I like KDE, I've even used some versions of 3.4 on a piddly 500Mhz system once upon a time. But KDE 4 is just slow, freaking slow!

However, I must admit that KDE offers a very pleasant and polished visual appearance. Its like looking at a sleek sports car, only better. Their new desktop metaphor as it were, is likely a grand improvement over the traditional desktop. Compared to wrapping ones noodle around Deskmate or living with the UI that has plagued Windows for the last 15, if not 25 years, it is also argubly easier to use. No doubt about it, a first load of KDE is a hell of a lot more straight forward than a straight load of modern (or classic) Windows.

While it's all so well done now, and as much as I remember enjoying KDE(3), if KDE(4) is the way the future desktop will be, me thinks that I will be continuing to use a keyboard and terminal emulator more often than a mouse, keyboard, and GUI applications!

It's nice stuff, but hell, if it's going to be that slow, why even use more than an xterm?

Friday, October 8, 2010

Hmm I must admit that custom configuring a Linux kernel, seems to offer three possibilities:
  • Lean, mean, and sexy kernel build
  • More modules than you can shake a stick at
  • Major headaches


I'm tempted to configure for a balance between the first and second, it is an interesting idea though. If I tuned a kernel build for my very specific system, it would strip out most of the usual bloat. The downside is there are so many configuration options, that making the config might take longer than compiling Linux!

Oh freaking vey, what a cycle!

Sometime ago, installing KDE rather fouled up the gnome session on my laptop. That was the first strike against Ubuntu package management. Well the other day, I was adding a few more development packages, and trying to think of what kind of minimalist tiling window manager I would like to try. The only real reason I've been using gnome the past few months, is that's the default and the system kind of centred around it \o/. In working on a list of what window managers I wanted to test out, I decided that I would like to install dmenu first. So I installed dwm-tools to get it, using synaptic (I find it easier to use the GUI for searching for available dpkg's).

Well, sure enough on reboot things were FUBAR. GDM unable to log into anything, XDM bumfucked, and using KDM to launch a Gnome session resulted in a barely functioning one, just like before. KDE however worked perfectly, and I also have come to see KDE4.4 as the slowest pile of software in the Linux world >_>. That's the only bad thing I currently have to say against it. Reinstalling GDM, Gnome, and related packages didn't help matters any. So I bid farwell to Ubuntu once and for all, and I'm not going to say hello to Debian for a while either.

I've always used Slackware or Debian 'esque systems, when I'm stuck using or desiring to use a GNU/Linux distribution. People have reccomended Arch and Gentoo, and I've meant to experiment with Source Mage and Arch for a while. However, I don't have time to fuck around, and Debian dpkg or Fedora rpm level compatability is desirable. So I flicked a wild switch and decided to try something a bit more red headed.

Enter CentOS 5.5! While certainly a fine Linux distribution, and its yum tool proving much more, pleasurable than manually invoking rpm. There were numerous problems. Most of the packages in CentOS, even after using RPMForge and EPEL (a community supported mirror of newer packages for RHEL)—most of the packages in CentOS were ancient. The youngest of my development packages was slightly younger than my laptop, and most just so old that it's distasteful. That would mean, to get any *real* work done, I would have to forsake yum and install/manage my software manually from source. Joy, why didn't I just slack off? That however wasn't a show stopper. It was getting the blobs I rely on to function on top of that, that seriously broke the deal. I gave up trying to get Chrome working. There were also problems getting the default gnome desktop to work, but I wasn't planning to use anything heavier than blackbox anyway.


CentOS has earned my respect among Linux distributions, and I like the system a lot. I just can't rely on it for my personal work station :'(. For regular desktop and laptop users, CentOS is probably a great idea though. I'm not a regular user by any means.


So after that, I started relying on the only thing left I could trust: my own head. Using a mixture of CentOS on my laptop, a USB stick, and NFS mounting the work dir' on the desktop (faster processor), I set to work. Building scripts to fetch and build Linux and the usual GNU packages. My own Linux distro. Trying to get things to actually fucking build was a bit of a different story. Remind me to never rely on chroots in Linux.


Since plans C and D popped a cork, I quickly zipped up my work and saved it to the flash drive. Then archived my home directory over SSH. Googled for Slackware's latest release and searched ye ol' wikipedia for related distributions. I know of several but have never used anything more slackware, except for a very brief test run of KateOS. Among a quick grep of distros related to Slackware, one that stood out was Zenwalk.


Plan B, as everyone knows, is make it up as you go along. Or at least, out of my ever present plans A through D, that's my plan B ;).


So I have setup Zenwalk Core 6.4—they have several distributions. Unlike the complete Xfce based system of Standard, Zenwalks Core distribution has a rather minimal but complete base of packages. All without the headache of selecting what to install in slackwares installer lol. Core is a command line install, X isn't included. That is my kind of system, hehe. There are a few helper tools but for the most part, I prefer to work directly in /etc when possible. Being based on Slackware, of course Zenwalk Core doesn't feel alien in this department. The Debian/Red Hat based systems tend to be more confusing then need be, where as the BSD systems usually forgo run levels in favour of traditional unix Simplicity. In slack country, a happy median is found.

The main point of interest here, is package management: zenwalk uses a shell script called netpkg to manage things. I really is a crude form of pkg_add/apt-get but it gets the job done. It's not perfect and has it's qurks, for example netpkg foo will interactively ask you if you wish to install/reinstall each package matching 'foo' along with a yes/no to installing each missing dependency; where as netpkg install full-foo-pkg-name.txz will install foo, omitting dependencies. It gets the job done.

It's the slackware compatability that I like about it though, namely the ability to rip apart RPM packages into Slackware tarballs and hand sort the dependency (netpkg can do some dependency work). Installing dropbox was a cake walk, just rip open the RPM and install it as a vanilla slackware package.



The problem is the network, sigh. The reason I hate Linux from a user perspective, is YMMV quite a lot between Linux distributions. Never mind that most distributions use the same software. In my case, the problem seems focused totally on my wireless card. I'm also to tired to go into it right now.


But to suffice it to say, I am still alive <_<

Friday, October 1, 2010

Morose culture

It seems, that while no one put up a fuss that in the original Medal of Honor, you could play Allied or German characters in death match. As far as I know, there has never been a fuss about the later games which both expanded that very far and even took in the Japanese!  Yet now that they are making a new game, just called "Medal of Honor", people are bitching that one of the sides in multiplayer was supposed to be the Taliban, to which there has been enough fuss to simply rename it in the usual OPFOR fashion of AA. What the fuck is wrong with people today.

That is how it is, unless you design multiplayer like America's Army: which few people care to, nor have any reason to, go quiet that far to make everyone the "Good guy". There is also the old DF approach of making both teams look almost identical, resorting in that only noobs and griefers are likely to TK.

Someone has to be on each side of a multiplayer game, that's how you tell which set of fucking morons you can shoot at! If having one side be the Taliban is so bad, why not make it U.S. Army versus British Army, and let someone make a stink about that!

Laptop, sweet laptop

I never thought I could miss such a filthly old computer so much! Today in the snail mail, the replacement AC adaptor I ordered finally arrived, it only took about two weeks. The original one racked up to much damage right near the plug at the laptop end. The thought of slicing it apart where the damgae was and splicing it together, all well in good... until noticing that end is a frigging coax, which works a tad differently than a simple set of copper wire \o/.

After a few days of using my desktops rat "Tuned up" for Quake / COD, and two weeks without using my laptop, it even feels a bit alien to be using a touch pad again. On the upside however, because of how much time I spend typing, contrasted to where I spend it: I feel PERFECTLY AT HOME using my LAPTOP KEYBOARD!!!

I'm sorry to say, that although I love the Model M style kb, I love my laptop even more, it's ingrained in my muscle memory lol.

Ender's Game

Whenever I start reading on the net, I am always moving like a plague: unstoppably grepping all interesting information. The other night, I was looking up the definition of an event horizon. That of course, lead to parsing data trees on the film Event Horizon (haven't seen it in a year or two), Starship Troopers, the Dead Space games, Armor, and Ender's Game. The local library only had the Ender series, not troopers or armor :-(.

I read about 50 some pages of it in the 1.5~2 hours I was at the library, and found it interesting enought o check out. By the time I went to bed, I had finished the 352 page book lol. Ender's Game paints a very odd picture of the world, because the world Ender was born into is both so like and unlike our own. Children can now be "Requisitioned" by the government, and having a "Third" child is both illegal without a wavier and a bit of a social stigma. Ender of course being a disgraceful third with an older brother Peter and sister Valentine.

About 70-80 years previous, the second invasion of earth space was won by a little known peon named Mazer Rackham having a thinkon during doomsday. Ever since, the Earth has been preparing for a third invasion: less the insect like "Buggers" catch the human race with our pants down. Ender is accepted into the Battle School at age 6, after passing the final test. After having the governments monitoring device removed from his neck, young Ender Wiggin being beyond the help of adults, gets stuck in a situation where a gang of bullies are ready to beat the tar out of him, for the rest of his  natural school year. Being smart as a whip, the little bastard realises that he needs to be decisive: win this fight, fight hundreds more but beat the shit out of their leader, and no one will dare touch him. Practically hospitalising the other boy demonstrated Ender's genius.

In battle school, you see Ender go from a newb to the schools best 'Soldier' in history. Using that mechanical mind of his, he outsmarts everyone and twice changes the nature of the war games that their schooling revives upon. When Ender began, you had slow moving formation drills and "Commanders" of an army of 40 boys, that couldn't lead a pop sickle stand to victory. Ender changes that: battles are fast moving and now rely on what we learned from the Blitzkrieg.  Ender's army is organised into 5 'toons' of 8 with a specially trained solider from each available if things hit the fan. Each toon has a leader and assistent. Ender tells them what to do, the toon leaders take care of the detail, and you quickly see that Ender has learned to lead: something the other armies have not. It totally revolutionises the games, to the point the school masters begin cheating. Wearing down Ender and his army of student soldiers by any means possible.

The focused discussion on their craft is also impressive, after all if it is your life for the next four years, you ought to learn it well, right? :-). Mean while his siblings are plotting and succeeding in world domination, as the world gets ready to fall apart!


The writing is a bit more bland than I am accustomed, yet the logical drive to it is refreshing. It also paints an excellent picture of Ender being shaped into another master mind, and the hells he must go through, as well as the side effects of being made a tool to fight the buggers. At several levels, I can comprehend Ender's situation, worse yet because I've been in some of them. Arguably Ender's torments are also, the only thing that lends the novel some depth in the first place, but we can't have everything. While Lord of the Rings has enough information overload to give you a geekasm for a month, Ender's Game only focuses where need be. The style of writing, is actually quite "Odd" at first, or at least from the styles of writing that I have come to easily parse, lol.


By the end of the games, things really ripen up. Towards the end of battle school, Ender has become smart enough to figure out the propaganda from the first and second bugger invasion is a crock, as the secrets of the third invasion gradually unravel on his way through to the prestiges Command School. The war games used to train Ender shift, from a zero-gravity game of freeze tag (a cross between infantry combat and football, really) to commanding groups of units. His games become more like a modern Real Time Strategy game with humans forming nested levels of control, rather than A.I. behind it all.


By the end of the third invasion, we have "Won", the world has gone to piss in less than a week, Ender is outcast—as being to dangerous to ever return home to earth, whilst his brother attempts to bring order to chaos under the pseudonym, Ender sets off for the first distant human colony with his sister Valentine.


Something that I found freaky as all hell, this book was originally written in the 1980s, and based off a short story the author cooked up in the mid '70s. Yet, it describes very much our modern Internet and an effect that only recently, the hopelessly stupid people of our world have begun to understand. Peter and Valentine, using analogs to things like Blog comments, Twitter, mailing lists, etc to methodically boil over the political waters towards a more stable world. Young (but brilliant) children soon are helping to shape public opinion, and become house hold names published on the news nets as Locke and Demosthenes - in ways that are already believable to any netizen of today, or even 15 years from now. Yet back in the 1980s none of that existed yet, and the closet thing to it (the *old* USENET, rather different than today's) was likely unheard of by the author. Even if he was a geeky S.O.B. the  most the author could forsee from his present world would likely have been e-mail, since that arguably dates to before most e-mailers were born. What surprises me, is how dead on Orson Card was in describing the "nets" of Ender's day, and how they seem to resemble our own Internet. In a way, it even explores how realistic games have already become, versus something like Pong and the big games of the 1980s. To the point infact, that it moves past that and the computers have become smart enough to program them :-/.

In so many ways, the book is like looking at today and next week, and only GOD knows what lay in between. Along with the development of Ender, it's almost bloody brilliant!
Things have been a bit busy, fires of family war stoked, work to get done, plans to close in, and reading to do. I had a short interview yesterday for a job that I don't expect to get, and worked on several other queries to weed out the small fish and recon a few others as I waited. I also hit the library for a couple hours.

The thing that irks me, if my family wouldn't like falling on the latter side of the Fore, Neutral, or Against standings, this could all have been sorted many months ago. Or if I was willing to be defeated. That's what you get when you mess with principal and a super geek \o/.