September 2004 Archives

September 30

newsgroups

I have had several exercises in my C book that deal with binary, hex, octal and base 10 numbers, which is all new stuff to me, I pretty much understand that computers rely on information in the form of 1's and 0's, but exactly how all that works is a mystery to me. I did once read up on how ip adresses work but would have to revisit that to fully understand it. Its just stuff that I dont need to know, even in my dealings with linux, I have been able to avoid all all that black magic voodo until now.

So, I was to write a program that converts a number you enter into a base you enter. So if you say num = 21 base = 2, the program prints: 10101

The book gave an abbreviated tutorial into what exactly base numbers were but I didnt really understand it. The formula to get the base numbers was provided, so the program was able to take shape, but the irony is, I can convert base 10 numbers into base 2, but not know what base actually is :)

So last night I got a little binary lesson from an irc guru/ teaching assistant and am now proud to say I can count to ten in base2. This will undoubatbly come in useful one day.

Maybe I will be minding my own buisness in a coffee shop, reading the paper, when police officer will burst through the door, and frantically yell.. "Can anyone here count to ten in binary?!!!!!!, Anyone??!!!"

My isp has newsgroups where you can get all kinds of information about anything really, and of course stuff like movies, photos and mp3s. I have a 6gb a month limit though on what I can download. My favorite group, or one of them is alt.binaries.sounds.mp3.lounge which has tons of acid jazz, house and chill out music. I think I might have found a loophole in the 6 gig limit, If I download 4 gigs over night, then 2 gigs the next night, the next time I connect, Im told I have exceeded my monthly quota and cannot connect until next month.

I havent gotten anything this month, and didnt want to let the month expire so I opened up Pan and went to my favorite group. I was tired, not paying attention and selected all the mp3's to download, clicked ok and went to bed. I had asked pan to download the entire group, about 27gbs it turns out.

When I got home today, my mp3 folder had indeed grown by 27gbs! So it seems they dont check until the next time you connect, which is good, as I can go over my limit as long as its in one session.

I then run Easytag and delete anything not properly tagged, not named properly or with a crappy encoding. Then when ever I am working, I listen to the new stuff and delete what I immediately dont like and keep anything interesting or flat out awesome.

æc♥

Posted by æc♥ | Permanent Link

September 28

gnome isuues fixed

I found out today what I was doing wrong with my gnome hidden file problem, I simply have to right-click on a non hidden file or folder and it will ask to display the hidden ones.



So, Im not mad at gnome anymore, but wouldn't mind a little checkbox instead of the right clicky stuff.

Also with mozilla, you can press ctrl-l then backspace to quickly clear the address bar if your keyboard surfing instead of using a mouse.

Not sure why these things elude me sometimes!

æc♥

Posted by æc♥ | Permanent Link

September 26

gdb

I spent some time today learning about Gdb a debugger for among other things C programs. Its not that hard to learn and is cool how it can step through a program and show you the values of variables and what functions are returning what as you go along. Fun stuff :)

My Mom called me this morning at around 8am, then 8:45 then about 3 more times... all in the name of convincing me to go to Ikea, its Christmas shopping time for Mom you see and I am supposed to be right there along side of her. I really didnt want to go and Sarah, god bless her, went in my stead. I have, I must admit some Christmas shopping completed already, so I am almost as eager as Mom.

If you like that sort of minamalist desktop with borderless terminals, you might like the Xfce Terminal, you need these sources if your a Debian user..
deb http://www.os-cillation.de/debian binary/
deb-src http://www.os-cillation.de/debian source/
then: apt-get update; apt-get install xterminal
It looks alot and behaves alot like gnome-terminal, has tabs, anti-aliased font support, and can be made transparent, and borderless. I find it loads waaaay faster than gnome-terminal and seems a little more zippy to use. I don't like however, that it dosent respond to alt+arrow keys when I run it with irssi, so I have to change windows with the alt+[0-9] keys instead, which is dealbreaker for me. I think if you use gnome-terminal you will like this smaller, lighter and faster replacement.

Im being taken out to dinner tonight, so yay! i gtg..

æc♥

Posted by æc♥ | Permanent Link

September 25

bush and paris

I am not sure if you have seen these or not, but George Bush making an ass of himself is always entertaining. What I would personally advise him to do, is admit when a reporters question confuses him.

Just flat out say "hmm, Im not sure what you mean" I know we require our leaders to be well educated and informed, but many people will also respect a leader that acknowledges his or her shortcomings instead of fumbling along painfully reaching for words as Bush does in this clip.





This is the apartment I am going to live in next. It is in Paris, and you will see that the view is spectacular. I just need to find someone who will marry me, whisk me off to Paris and buy that apartment.



Well, Im allowed to dream a little too right?

æc♥

Posted by æc♥ | Permanent Link

September 24

ugh...



This is the problem presented to me as the last excersise in chapter 7.

Seive of Erastosthenes Algorithm:

(I should have just stopped reading right after that title)

The Seive of Erastosthenes Algorithm to display all the prime numbers between 1 and n.(n being 150 in this case)

  1. Define an array of integers P. Set all the elements Pi to 0,2<=i<=n.
  2. Set i to 2.     // that I can do :-)
  3. If i>n the algorithm terminates.
  4. If Pi is 0, then i is Prime.
  5. For all positive integer values of j, such that i x jn, set P> i x j to 1.
  6. Add 1 to i and go to Step 3.


So, that pretty much wraps up the formula part :-\   I don't know what he's going on about in step 1. I know how to initialize an array, but not in the manner that step 1 is talking about. The rest is probably do-able, a little bit at a time.

The answer can be found at the books website which I swear, I havent looked at (yet). Its fine to go off and look when you get stuck I guess, then after saying "ahh, thats what I need to do", I feel like less has really been learned.

This is the last exersise before the chapter on functions, and functions I am told are the heart of C, alot of things will fall into place then the guru's tell me, so I am tempted to file this one away in my FIXME folder, but too stubborn to do that just yet. I really hate old dead mathematicians.

A geek might find this pic amusing, it was in a "post your screenshot" thread on Ars



æc♥

Posted by æc♥ | Permanent Link

September 23

gnome stuff

This first picture is from the gnome "add background" dialog box. I opened up the wallpaper app in Desktop Prefrences and then chose to add a new wallpaper.

gnome1.png

As you can see, it will only display folders that are not hidden, I suppose somewhere along the line somebody decided that if you choose to hide a folder why should a file browser by default be able to see it? I'd like to see at least a "show hidden folders" checkbox, I do have a .archive folder that old backgrounds among other super secret stuff is kept.

Now Vim is a really cool editor, and has plugins that other people have written. You can download them and place them in your hidden directory ~/.vim/plugin

I downloaded one such plugin that happened to come in zip format. Firefox will open up "file-roller" which is a gnome app that handles zipfiles, allowing me to view the contents of the zip file, then extract what I want where I want.

gnome2.png

As you can see, again, no option to save it to a hidden folder :(

I can do this from a terminal, wget the file, unzip it and move it to the right folder, but I was browsing in X and in cases such as this it should be faster than opening a terminal and issuing the right commands.

While I am on the nitpicking bandwagon, does anyone know how to clear the address window in firefox? Without having to backspace over an existing url I mean. I'm hoping for a quick keyboard shortcut.

Oh, heres another one, in GDM the gnome graphical logon manager, when you type your password, some ******'s are echo'd back to your screen, so if your pass is 6 characters long, someone walking by your desk can see that no? I thought Linux was all careful about such things. Not that its an issue for me at home, but still.

Vi-improved.org is another Vim-centric site based more around the comings an goings of the #vim channel on freenode. Some good tips there though. Its funny now all of a sudden since starting a book on C, I have probably learnt as much about the editor I am using as I have C.

Posted by aec | Permanent Link

September 22

hurray for arrays

This week hasnt been a whole lot of fun on several different levels, bf, family job and computer...

My younger brother it seems is hellbent on getting kicked out of my parents house, which isnt really news to me and I generally dont get involved anymore except he has already expressed some interest in "crashing at my place" if the need arises. The thought of him a. living with me and b. having access to my computers/network/bandwith has forced me to involve myself, mainly for the latter reason.

I have started chapter 7 in my book which covers "arrarys" and am without any doubt, blissfully in over my head again. The pages seem to just stare back at me instead of offering up any insight as to their meaning. Re-reading is a given now, and the little moments of "ahhh...I get it!" occur with less frequncey than I'd like. But, I keep telling my self that its better than watching tv among other little inspirationals.

In the "look forward to" dept though, Debian will soon make a long awaited release so my "woody" server will get alot of upgrading at last. And, hopefully not too far past that, Xorg will go into Sid (Debian unstable). Not that XFree86 dosent do its job for me now, but I like playing with new "stuff".

Posted by aec | Permanent Link

September 20

another cheat client

One of the downsides to open source games such as Bzflag is how easy it is to cheat, the code is there for you, all you have to do is learn what to change and where to place your changes and your all set.

Its actually worse than that, you do not have to even learn any code, you can just ask other cheaters or google the web for a cheat client. One such client popped up recently and this is taken from the authors web site:


Motivation: The reason this client was created is because of the rampant cheating on bzflag. Since the game is open source, it is trivial to modify the code to do anything you want if you are an experienced hacker. Among the popular modifications is an enhanced radar. What this does is give the person an unfair advantage at spotting particular flags, like Genocide, on the radar. That is why you see one person get Genocide time after time. Because of that, I have decided to level the playing field. If a handful of top scorers are able to modify their client, why shouldn't everybody else have the same advantage? Not everyone knows how to modify the code to give themselves a similar advantage. That is why I have put this binary and source code up on this site. That's the power of open source, I suppose.



So, because a "handfull" of players do cheat, this guy feels we should all cheat and is nice enough to make a client available for that.

This particular guy then dropped into #bzflag to defend his client, he seemed suprised by the response he got from the developers and players that hang out there. It was good in a way as this led to somone proposing a network ban for cheaters, which was coded up and commited into cvs.

In the upcomming release, it will be possible for a cheater to be banned from all bzflag servers, not just the one they were caught on. This of course would be used only in the more extreme cases and only an official developer can ban you in this manner.

Personally I dont feel cheating has escalated, you see it from time to time as most cheats are obvious, and many of the more popular servers are actively admined, so a cheater is usually removed or even voted off by the other players.

The subtle cheats are much harder to detect if at all, and can probablly only be addressed within the code itself.

Saturday afternoon I went to a freinds housewarming party and had probably to many glasses of red wine, I did leave though without getting flat out drunk so it wasnt too bad :)

My neice and nephew awoke me bouncing up and down on my bed all anxious for a trip to the beach. It was beautiful outside all day and we had a great time. It wasnt until last night that I found out, several miles down the beach from where we were, police had discovered some sicko had planted razor blades in little chunks of wood buried under the sand! ugh.

Posted by aec | Permanent Link

September 17

patch

It looks like the Hockey players and the owners of the teams are on strike. So this weekend there will be no hockey on tv and most of the men in my life (dad,bf,bro's) are all pissed off and not sure what to do without their saturday night Toronto Maple Leaf game. I like hockey, its fun to watch and its so built into everything that is Canada, You will see in every town in every province no matter how small, a group of kids, out in the street, in the most freezing cold, rushing up and down the street chasing the puck, yelling to each other over the clatter of sticks, and suddenly having to pull the nets aside as a car turns onto the top of the street. Everyone who has lived in Canada has seen this scene countless times. Thank goodness those children dont also go on strike.

I submitted my countdown patch to sourceforge and will have to see if its accepted or not. I think this is a little bit more useful than my first attempt and without a doubt, much harder. I still dont know near enough to do all the things I'd like to, and it would be nice one day to even fix a bug or two! So, back to the book for now....

Posted by aec | Permanent Link

September 13

frustrated a little

So far September has by far outdone all the other summer months for weather, it has been so nice and warm with a little breeze most of the month. I dont know about your neck of the woods but its weird that the last 3 months were so crappy and now its all gone nice again...not that I am complaining mind you.

I usually pick up something for Dad when Im at the coffee shop in the mornings and he asked me to get him (I got my sweet tooth from him) one of these. I have sadly now become addicted to them, and find myself craving them as soon as I drive past a Tim Horton's. This isnt good..

I have for the most part completed that exercise I was working on in C, but it took forever, like most of my freetime over the weekend was sucked up by this block-hole of frusration. I guess the biggest downer is that it isnt the code thats tripping me up, it is that many times, problems can be solved in C by first developing a mathematical formula that solves the problem on paper, then converting this formula to statements, the latter I can for the most part handle.

I am not a good math student, I never liked math because it seemed so boring to me in school, it wasnt "neat" to figure something out like it is now when you learn some new silly shell trick or something. It seems I am now paying for this lack of enthusiasm for math in school.

Speaking of neato, for ages I had used:

export HISTCONTROL=ignoredups


In my ~/.bash_profile assuming it would take care of any duplicate entries in my bash history, all those annoying "ls -la"'s in the file. What it really does is remove an entry that matches the previous entry, you would never have two "ls -lh" in a row.

export HISTCONTROL=erasedups


Will actually not allow any duplicate entries at all. Yay for being pointed to the man pages in a mailing list.

Posted by aec | Permanent Link

September 11

roomate drama

Sarah and her boyfriend have split up now and it really looks like it will be permenant. He hasnt been sleeping here for close to 2 weeks and came by last night to grab some clothes and say bye to me. :-\

Its been tough on her and shes thoroughly depressed so shes gone up to her parents for a little bit. I'm not happy about it all either and feel like I often do in situations like this, longing for a world where stuff that is good, never ends and dosent change.

There will be some other minor side effects to all of this, the rent going up of course is one of them, unless we find another roomate which will obviously be hard as we only have a two bedroom apt, so I told Sarah whomever we get, will have to sleep with her :)

My laptop is back to its "useful" state now with wireless set up and my browsers cache and cookies restored with all the little plugins reinstalled and basically the same desktop I had under Gentoo.

It was a distraction for me from C and I find it has slowed me down, at least my reading took a hit, i had hoped to have finished all the chapter 6 exercises by now but have a few left. One of them is to write program that takes whatever number you type in, 234 or 130 and print out the results in words. "two three four" or "one three zero" the books author warns "This is a hard one"

yay.

My second job at night in the bar has been too hard on me and I have all but gave it up. I went it last night for a few hours, and then went out for a meal with my bf and we discussed this situation. I cant continue to work at the office at 100% on 3 hours sleep and Im not keen on messing up at the office because of that.

It means I will see less of him at first but thats not always a bad thing either, and we might look forward to our time together now a little bit more

Posted by aec | Permanent Link

September 08

bye bye gentoo

As the last few weeks went by, my gentoo laptop got worse and worse at updating software, emerge was barfing on packages that I could not remove, and I swear to God it wasnt my fault!

I finally got fed up last night and did a backup, then installed Debian from the latest Debian installer. This was fine but of course in my hasty backup, I forgot to copy the kernel conifg from the gentoo install and would then have to configure a kernel again from scratch.

Being all smart and stuff, I thought, wait a sec, Debian dumps a copy of the installed kernel config into /boot, i will just use that.

The problem is though, that kernel conifg is for an initrd kernel, which has filesystem types and generic ide drivers as loadable modules, and of course this totally went unotced by yours truly, 3 times I attemted to recompile the kernel, at about 30 mins a pop, I finally gave up and went to bed, I will give it another try tonight.

I played Midtown Madness with my niece on the weekend on her Xbox, it was the first time I had ever tried that game and frankly was hilarious, we were in stiches laughing at my horrendous driving.

Posted by aec | Permanent Link

September 05

bzflag patch

A short time ago I submitted my first patch for Bzflag. It wasnt a very mind-blowing patch, but it does work, basiclly adding the irc style "/part" command to the game.

A player can type "/part I gotta run, cya later!!" and the server will relay that to all the players. and exit you from the game. So this took along time to figure out but several other commands like this exist, such as /me, and by examining how they work, writing yours in similar fashion, and harrasing devs on #bzflag, I was able get it finished.

So, what next? that was the redhot question burning inside me... I noticed that on the league servers, to start a game, you type /countdown and the clock is set to a configurable amount of time, and the game begins. However, there was never any actual countdown that the players see, and so I set off to fix this.

It seemed simple enough...find the part of the code that deals with the countdown, just before it starts, insert some code that prints 10..9..8..7.. etc Test it, update the changelog, and send it off :)

Well of course its no where this simple. I did get it to count off some numbers, but they were timed off the main server loop ( a special loop the server runs over and over during the game) but this loop was so fast, the numbers flew off the screen pretty much. A quick lesson in TimeKeeper, and I was able to slow down my messages.

After messing with one or two other things, (while it was counting off 10..9... ..8..7..the real game clock had actually begun) it finally came together and seemed to work!

countdown.png

There however remained one serious flaw, as it currently stands, when a countdown is issued, the server kills all the players, resets the flags and generally "sets the table" for a match. The players then have to respawn into the game and the match is underway. In the newest cvs version of bzflag, you are not allowed to quickly rejoin the game, if you leave, you have to wait 5 seconds before rejoining, this eliminates the problem of those pesky "rejoiners" who sign out to reset their scores and stuff. Its a good idea and should be included. But, this then stops my match players from rejoining and they will miss the first 5 seconds of the game.

Solving this is far beyond my capabilities and I had to get a certified dev to fix it for me :)

I still want to do a couple of things to this before submitting it. I would like it to be configurable, so the player does: /countdown 15 and it counts down from 15, or any other number for that matter. (perhaps with a limit)

So, I have learned quite a bit I suppose, I now know that "staring at the screen, in hopes it will fix it self" is not always a bad thing, sometimes you have to just look at it long enough, other times, like I said, you have to know when you are beaten and seek help.

I am itching to get back at my book to be honest, but I do have one more idea for a nice little command bzflag could use...

Posted by aec | Permanent Link

September 02

obligitory post

This is more to just say hi, Im fine but too busy to write anything!

I am still working away at my C book, and if it gets tedious, I poke around in the bzflag source code looking for fun stuff to do at a later date. The bz code is way above my level of understanding, but like I mentioned before there are some part that are clear, and I can see how to go about changing the code a little to make it do things I'd like it to do, which is a start, not to mention bzflag is written in c++, and I am learning C.

Tonight I spent a long time being walked trough several functions line by line, and at the end although some parts of it were clear, It was evident that I have way more to learn before even looking at bz code. Discouraging a bit but not unexpected.

I apt-got a nice replacement for top, called htop that is a colored version of top that allows horizontal scrolling.

If you have some processes invoked with insanely long command lines...



You can scroll sideways to see what the rest of the command is, which along with the colors and a somewhat nicer output makes it a pretty handy improvement over the standard "top" thats debian ships.


Posted by aec | Permanent Link