Saturday, November 06, 2004

Programming Paradigms

Just ran across this today...
Using Design by Contract in C by Charlie Mills -- Design by Contract is a programming approach that formalizes the interface between callers and callees, leading to more robust and disciplined code. If your language lacks formal support for DBC, though, are you stuck? No--Charles Mills describes the design and implementation of Design by Contract for the C programming language.
Design by Contract is a really great way to develop applications. It was first put forward in 1988 with the book Object-Oriented Software Construction by Dr. Bertrand Meyer (2nd edition published in 1997). This book was the impetus for the development of one of the best OO languages that exists, Eiffel. What is interesting about the article by Mr. Miller is that not only has he described a way of developing C programs under the DBC methodology, it's also that C is capable of using this mythology without becoming so convoluted and complex that the code is unmanageable and unmaintainable. It won't be a elegant as an Eiffel program but it will be something you can easily include in your systems development or any large project.

Ok, call me a geek but I think this stuff is fascinating. I am wanting to get back into programming so learning C and also DBC will be a Very Good Thing™. In another life I was a professional programmer. Between 1989 and 1995 I was a mainframe COBOL programmer (developing under MVS, for those who might know these kinds of things). I'm not going to go into my "Why COBOL doesn't suck" rant right now but suffice to say that it was a good and fun time. Then I accidentally became a UNIX sysadmin and web developer overnight and haven't had the chance to do any major development since. Oh, I do get to hack stuff here and there, mostly using bash, perl and php. But it's not the same as developing something that can be more than just a minor little tool or one-off. So I have decided to try and get back into being a "real" programmer.

The plan is to teach myself using some of the better books and web resources. So far I have worked out a program like this -
  1. (Re)learn basic programming fundamentals using the book Programming From The Ground Up by Jonathan Bartlett
  2. (Re(re))learn C using the book C Programming for the Absolute Beginner by Michael Vine
  3. Build on that with more advanced C using Linux Programming by Example by Arnold Robbins
  4. Finally, GUI programming with GTK+ Programming in C by Syd Logan
I also have the books User Interface Design for Programmers by Joel Spolsky and C Nitty-Gritty by Klaus Schröder as well as K&R 2e and a plethora of other books to draw on for information and help as needed. The only difficulty I have is that it's hard to do anything with a 7yo around. If I can get 15 minutes without hearing "DAAAAAAAAAD! Come here!" it'd a miracle.

Tuesday, November 02, 2004

Geek voting

Geek voting
Geek voting,
originally uploaded by x-nc.
I was wearing my Red Hat Official Mirror t-shirt when I voted. No one knew what the heck it meant but I figured I'd show a little spirit for the community.

Image hosting compliments of flickr.com.

I Voted

That's what the sticker on my shirt says. And I honestly didn't know who I'd vote for until that last second before I pulled the lever. It doesn't really matter, though. This election is going to be far worse than 2000 with the litigation and accusations and recounts. It's possible that we will not know who won the election until after Inauguration Day. This whole system is breaking down. We need a new way to run this country. Unfortunately there's no way to fix it short of revolution. I definitely don't want that extreme of a "solution." We should get rid of the electoral Collage at least. It served it's purpose once but that was a long time ago. Also, it would be good to withhold results of all the states votes until after every state in the union has closed their polls. These two things would help make for a better election process and also would be more accurate WRT who wins and who loses. Oh well... It's not gonna happen. There's way to much money involved in the current governmental process. None of the elected members of our government would want things to change.

The rest of the day was a total bust. I couldn't make it into work so there's another day or doom on my chart. [Side comment: The only reason I was able to vote is because the school is right behind my house. I was able to drag myself there and back but that's about all I'm good for today.] My mail server went down this morning. It's funny how much we rely on email these days. I feel like there's a big hole in my day. The server is my own so I know what the likely causes are. The only problem is that it's co-located in another state. Not with one of those big name companies but with a friend of mine. He's got a little business and he's been letting me ride his pipe for free. I just need to make sure that my mirrors don't suck up all the bandwidth. Got to throttle ftp quite seriously. I've been trying to get a pipe to where I'm living for over two years now but I can't get a decent line that works. Verizon(sucks!) is the only game in town as they have not let any other provider, like Covad, put equipment in their CO. I tried a Verizon DSL link twice. The first time it never worked at all. The second time it worked for a couple of months then went whack-o again. I was paying ~$100/month for 1.5M/128K and it was broken. Speakeasy(yea!) has a line that's, and I'm not exaggerating, 6M/768K for $115/month. Speakeasy uses Covad. Therefore I'm s-k-rude. Verizon has just started rolling out fiber pipes to end users. They are claiming 6M/2M lines. That's ungodly big and would be wonderful to get but who knows when (or if) it will be available in my area. I think they've done a test run in TX and the word is that some of the cities up north of me have it available. We'll just have to wait and see.

I only thought of killing myself once today. Doing the car wreck thing, you know, but that's to unpredictable and really messy. I'd have to drive off a cliff or something for it to really be viable but there's no cliffs around here. I must say that the thoughts of suicide are getting fewer and smaller lately. Maybe because I'm deluding myself into thinking that the nice Chinese lady (have I mentioned her?) might actually be interested in pursuing a relationship. Maybe it's the Wellbutrin. Who knows? I don't.

I guess that's about it. My son is with my mom and my nieces today (no school due to elections) so I should take some time to rest before he comes back home. I should watch some of the TV shows I've recorded. The last new episode of Star Trek: Enterprise would work. I doubt I'd have enough time to watch the Farscape mini-mini-series. One hour vs four hours and all...

Sunday, October 31, 2004

October 31st

Halloween.

I'm feeling really bad so my brother brought my son over to trick-or-treat. We normally get together at their house with my sisters family and go through that neighborhood. I hope he has a good take this year. We usually do pretty good. If I wasn't so desperate with money I would have bought a costume for myself.

It's getting really difficult to try and do anything these days. I'm feeling crushed by the world. It's bearing down on me so hard I'm going to get crunched into pancake. Life and the FM and work and everything is becoming to heavy. I can't see a way out of this. I've said that before, haven't I? Well, it's the truth. I can't work but I can't not work. It's hopeless.

I had more thoughts of killing myself today. Just a fleeting passage of a flicker of a thought. But it was there, none the less. I kinda wonder how I'd do it, though. I don't have a gun so I can't shoot myself. Hanging or any kind of asphyxiation is out. My "death fear" is not breathing. No drowning or suffocating or some such. I can always slit my wrists or some other body part and bleed out. I'd have to do it on a weekend when my son is with his mother and I don't want that. I've got a boatload of meds I'm taking but I don't know if OD'ing on them would work. Guess I'm not really committed to offing myself. If I were I'd know how I'd do it. Still, it's a real worry that the thought even exists. But the thought exists because the pain has reached a very serious level. It even infects my dreams.

I'm to trashed to go into anything right now. I'm doing my "asleep at the wheel" impression.

Time for bed.

Tuesday, October 26, 2004

When does depression become despair?

Yesterday I couldn't make it to work. Another day of income lost. I couldn't walk until nearly 1400. How am I supposed to make enough money to support my son? But that wasn't even the real crisis. Something happened that is far worst than that.

I actually, for the very first time in my life, thought of suicide.

This scares me to high heaven, as they say. But the pain levels have been getting higher and higher so even with all the meds I'm taking I hurt so much that it encompasses my conscious thoughts. It's always been there, weighing like a boulder on my back. But it's normally just under the radar. Just under the conscious level. But now it's risen up to become the primary thought of every moment. I can't tune it out and get on with my life. It's blocking my cognitive efforts to do anything except think of the pain.

Now, I know that there are things much more painful than what I'm having. Hell, I had virile spinal meningitis two years ago. I now know what a scale of 10 is on the pain chart. But that was all temporary. All my other experiences with pain are temporary to one extent or another. It is my belief that the vast majority of people only ever experience temporary pain. The kind of pain I'm having is just like the afore mentioned boulder. It's a crushing pain that will not let up. Like being caught in the coils of an anaconda, every time I breath the coils get tighter and tighter. Soon I will not be able to do anything at all but fight the crushing pain. It is quickly becoming the only thought in my mind. It's all ready become the center point of my dreams. I used to have wild and fun and erotic dreams of all kinds. Now it's just pain. Me and pain in my dreams.

This is why the "S" word came into my head. I was finally able to take a shower at around 1500. I'm standing there with the water spraying on my head and face wishing the pain would go. Then, BANG! I think that I could slit my wrists (or some better place) and just bleed out in the shower. It wouldn't make a mess and I could just sit down and let the warm water spray on me as I slowly lose consciousness. Clean and fairly non-painful.

The real scary part of this, though, is that whenever these kind of thoughts would invade my subconscious I would just think of my son and I'd be able to push those thoughts back. This time when I thought of my son the pain was at such a level that I actually decided to let him live with my sister and her family when I'm gone. He'd have two parents who'd love him and two sisters to play with him. He'd be better off with them.

All of this thinking took about 5 minutes, I'd guess. I was finally able to push it back down out of conscious thought. But the fact that it did break through is beyond frightening to me. What if it comes back stronger next time? What if it comes back at all? What do I do? The pain isn't going away and I'm starting to see death as a viable way to deal with it. This is not something I can do. I need to be here for my son and also for the rest of my family. Killing yourself makes your problems go away but brings on more pain and anguish to those around you. I love my family and friends to much to cause them that kind of pain. But my pain doesn't give a rats ass what I want. If it keeps getting stronger, as it has been for over the past few months now, I don't know if I'll be able to keep these kind of thoughts out of my head.

I just don't know.

Brazilian GP incoherent babbling

Rubens was racing for his home town. He started from the poll and got out to an early lead. Michael had a crash in testing so he had to start 18th. Just as the race was getting ready to setup, there was a bit of a downpour so most of the cars started on wets. Only the Renault guys and one or two others started on slicks. The wets were good for the first 1/4 of the race but the track dried out and those who switched to slicks the soonest made strong advancements. Michael spun early and it dropped him back to nearly last. He ended up 7th, though to ad to his massive points total. Rubens was able to claw back in to third so that means there has been a Ferrari driver on every podium this year. Anyway, it was a fun race with JP and Kimi taking 1-2.

That's all for now. I can't see the keyboard anymore. I'm going to bed to dream of sex and giant boulders with snakes. Don't try to do this, though. It would not be bad to start out small, like with go-carts. It's dangerous but so is F1.

Monday, October 25, 2004

Good and bad all mixed up

Karma. The balancing of fate on a knifes edge. One little breeze and you're toast. That seems to be where I'm at right now. This weekend was both great and horrible at the same time. Often in the same moment. Right now I can't sleep. I woke up at 0200 Sunday morning and other than a few minutes dozing off on the couch I haven't gotten any sleep. Tomorrow is looking real bad but I have to figure out a way to get to work. But that's for later. Right now I have a small dilemma... I should be happy, or at least feeling a bit upbeat. But I'm sitting here feeling numb and lost. In two days I went on two dates. One a fresh, kinda-like blind date and the other with someone I knew last year who didn't seem to find me her type but who might have changed her mind. While I should be happy, I'm only scared. Not of the women (there's a psych book on that one), or the non-feelings inside of me but the feeling and, I'll go ahead and say it, strong desire to stop the pain and leave it to the gods or fate or Karma to sort it out when I'm gone. The glass is half empty and there really is no spoon.

I can't see straight and I keep node's off at the keyboard so I'm going to bed now. I'll try and get to the final GP race in Brazil. I also recorded the Farscape episod(s) today. Don't know when I get to watch either. 'Night.

Sunday, October 24, 2004

Oh, by the way...

I haven't had a cigarette since October 7th. This time is feels pretty good. I hate to jinx it by posting here but I haven't even had the faintest of cravings so there's a good chance it'll take this time. Man, I hope so.