Days coding

The current stage of things for the settings menu. As can be seen I still have a few things to do with the layouts, I think a grid would be better personally. At the moment it also doesn’t actually set the settings it front ends for yet. I still need to test out the QSettings class first to see if I want to replace the custom system I’ve done with Pythons build in INI parser or not. I also need to cook up some icons and finish the portsnap entry. Right now it is purely a Qt3 program but if PC-BSD has finally fixed the ‘ugly’ theme settings for root under KDE I might consider a conversion to KDE modules before Qt4/KDE4. At least since what ever version I used to install on my Laptop the default Qt3 themes for Root are even worse…

Another thing I want to do is look at Pythons ability to handle manipulation of UID, it would be kind of nice to prompt for roots password and only elevate permissions when necessary. I aim for things to be the best they can be but paranoia never hurt in programming… hehe. Some day I would also like to expand this beyond explicitly using portupgrade/pkg_*/portsnap/csup/cvsup/psearch in the background but I don’t have time right now. I could get more done if I had a peaceful working environment…. any way here are some screen shots

click to enlarge images

ports settings
Free Image Hosting at www.ImageShack.us

logging settings
Free Image Hosting at www.ImageShack.us

network settings
Free Image Hosting at www.ImageShack.us

I think this is pretty good considering I rewrite most of what I already had today and most of this was done in about 6 hours of work, between chores, dog walking, lunch, interruptions, and phone answering ! Plus another hour or so of minor changes and additions so far tonight. I wish my strength could hold out for another 5 hours worth of work so I could get done some of the other things on my list for the night…. Hopefully I can get at least some of the other work done before I pass out. because I do need to get some shuteye if I’m ever going to make it to work in the tomorrow on time.

*SIGH*

thinking ? crazy : sane;

The one thing my room lacks, a comfortable working area..

Problem list

  1. furniture is expensive !
  2. my room is “used” for storage… with and without my permission
  3. no raw materials
  4. raw materials are costly too

Now on the other hand, I do have an old book shelf that has been a pain in the neck for years.. I don’t think I could make a worse desk of it then it already is as a miserable book shelf !(^_^)!

A simple pedestal desk like design comes to mind but without the drawers, to complicated and time consuming to build without either spending $$$ I don’t have or finding some thing else to cannibalize for parts. I figure, cut the main vertical boards in half’ish from the book shelf.. Mount them side by side on top of a set of boards (legs/pedestals). And use one of those old project board things from school as a backing to lend stability to it. Much the same trick used by whoever designed the computer desk that I bought lol.

The question of it being free standing or making a bottom board for it to rest on the desk with is a variable factor. It would be simple enough to duplicate the top piece, in effect making the desk usable upside down if necessary haha! But for the primitive building knowledge I have which is basically common sense. And the limited resources, namely what ever I have “inherited” which hopefully still includes one of my Dads saws!

I’m not exactly a handy man but one could always hope for a little Genetic potential… My father was quite skilled and so was my mothers father. My logical ability however out weights my operational experience, needless to say common sense + few resources = all I got if I try it. If I actually had enough money to buy material (or newer tools) I could probably afford to buy a bloody desk and assemble it myself <_<.

Because what I’d be dealing with here is using a bookshelf for wood and mostly being limited to a hammer, nails, and sandpaper for putting it together lol. Crude by most peoples standards of the job but effective when you’ve got nothing better to work with I must admit. Hmm, I wonder if I could actually pull it off… The only real problem is where to put the darn crap from the shelf, since other people have already filled my last free space.

It really would be nice if I could get away with it and a big plus, I could cut it to just the right height to sit at it and use my laptop 😉

brooding

I think if I thought it would do any better then either breaking my knuckles or cracking the air vents I’d give my PC a reverse punch…

Oh how fun it would be to exact some revenge from this GeForce 8400GS…. worthless piece of micro-shit !!!!!

NPM Settings Menu

Photobucket

Work begins on a settings GUI for NPM. I have a QIconView standing in for the list of config topics, I expect in the end it will probably be some form of widget stack or some thing like that. The changes I’ve committed to the trunk tonight are purely cosmetic, there is no link to the exsisting settings code that revolves around an RC file yet. I’m actually interresting in moving to using QSettings instead, tests will show the direction to be taken.

At the moment it has the majority of important options. I want the logging section to allow the user to set the logging level and files e.t.c. one thing that I think would be cool is to save the result files from portupgrade with a proper time-stamp appended to the file name. Although it would only take a minute to check the script to see if it would truncate the log file if reused.

There also needs to be a small network section whether separate or added to the others that can handle setting the portsnap/sup servers to use. And I would like it to be able to have a list of servers to query set. So that if it can’t reach one it tries the next (pardoning the retry options set).

Between a Rock and a Hard Case.

Finally a stroke of luck some thing decent on. Got to see most of The Rock on TV. I flipped channels to it just as Hummles men were taking over the island. I was also reminded why I originally gave up on watching TV at all in the first place.

Never nothing good on

and if there is, I usually don’t get to see it

At least tonight I actually got to see most of it <_<. And the Money Pit is on next, not quite as good as Mr Blandings Builds His Dream House but the same basic concept. Man and his Wife buy an old house and have the worlds worst time rebuilding it hehe.

One thing I find fun about The Rock, is they make references to Mason being old. Heck after going through what the guys in the Special Air Service go through he could probably be 90 years old and still whip some bodies ass lol.

A few memorable quotes hehe

Stanley Goodspeed: I love pressure. I eat it for breakfast.

Agent Paxton: Now you tell me I’m on a need-to-know basis. And I’m telling you right now, I need to who the fuck John Mason is, right now sir!
Womack: You want to know? Okay. 1962: J. Edgar Hoover is the head of the FBI, some say the country. It’s no secret that he kept secret files on prominent Americans and Europeans. De Gaulle, British members of Parliament, even the Prime Minister. I mean, this guy had dirt on everybody in the world.
Agent Paxton: Yeah, I know all of the cloak and dagger stories. Where does Mason fit in?
Womack: Mason was the British operative who stole the files, but our Bureau agents caught him at the Canadian border. Of course, the British claimed that they never heard of him. So we held him without trial until he gave up the microfilm. But he never did.
Agent Paxton: Well, I’m surprised Hoover didn’t use his daughter as leverage.
Womack: Hoover was dead in ’72, she wasn’t born yet. Today… it’s a different Bureau.
Agent Paxton: So, you held this guy without trial his whole life. No wonder he’s pissed.
Womack: This man knows our most intimate secrets from the last half century! The alien landing at Roswell, the truth behind the J.F.K. assassination. Mason’s angry, he’s lethal, he’s a trained killer… and he is the only hope that we have got.

Kid On Motorcycle: Hey man, you just fucked up your Ferrari.
Stanley Goodspeed: It’s not mine.
[steals bike]
Stanley Goodspeed: And neither is this

Stanley Goodspeed: Hi, I’m an agent with the federal… FBI… Well, my, I’m Stanley Goodspeed.
John Mason: But of course you are.
Agent Paxton: Well, at least he got his name right.
Stanley Goodspeed: Of course I am.
John Mason: And you have an emergency.
Stanley Goodspeed: Right.
John Mason: And you need my help.
Stanley Goodspeed: Exactly right.
John Mason: Coffee.
Stanley Goodspeed: No, I’m fine, thank you.
John Mason: Offer me coffee.

John Mason: Are you sure you’re ready for this?
Stanley Goodspeed: I’ll do my best.
John Mason: Your “best”! Losers always whine about their best. Winners go home and fuck the prom queen.
Stanley Goodspeed: Carla was the prom queen.
John Mason: Really?
Stanley Goodspeed: [cocks his gun] Yeah.

John Mason: I’m sure all this will make a great bed time story to tell your kid.
Stanley Goodspeed: You’re insane, Mason. The kid’ll have nightmares. I’ll spend all my money on shrinks.

John Mason: I’m fed up saving your ass. I’m amazed you made it past puberty.

Kill’n time

Found an interesting time paser, GNU Robots. Quite interesting really you write program in scheme and it uses GNU Guile to run the robot off the scheme program you supply.

It’s also a good excuse to learn more about Scheme hehe. I also found an interesting program called gnubg, I want to take a look at it’s windows port to see how well behaved it is. I might know some one that might have use for it 😉

I also need to start writing my todo list for what to do next with NPM and to get NPM_PortConfig operational.

Tired, Angry, and Generally P.T.F.O.

At the wits end and bored as watching shit roll down a snow drift in winter.

The only remaining possibility for the GF8400GS’s amazingly crappy performance with RvS and TSS… Drivers or worse the games are just rubbish with that card because of the age difference. I did first run RvS on a GF4200 and SWAT4 on a high end Radeon 9800 after all lol

To top it all off, I could’ve either gotten a 8600GT online for less after rebates or same care for much less if I could’ve “just ordered online” but no… who the fook listens to me lol.

I can’t roll back drivers to the ones that I know did work smoothly with RvS & TSS on my 6200 though because they are so damn old that those drivers don’t support the 8400 even through the unified arch. Grrrrr…. I’m not getting a fucking deskjob out of this and retirement is not an option !!!

How the rat fucking hell you can kick at a games settings until you’ve gotten average frame rates from every thing between 30 FPS and a 150FPS and still get the lag step feeling of “doing the robot” when moving is ridicules ! FFS I may as well have blown it all on a paper weight instead of an “upgrade” of a replacement.. Sheesh if they had the right port type I’d get the same cheap-ass card I had to replace… Wasn’t much but at least it fucking worked right !!!

It can run BF2 all out without even moving a muscle but RvS and TSS kill it. Today we had a rough & tumble assault plan by Rct Hawke, slow down was so bad I practically got hng up on the door. When I got to the stairs it was so damn slow it felt like I was wearing lead army boots. By the time I did get up top of the stairs in what felt like minutes later, I was shot, limping, still in high FPS rates all through it, and hadn’t seen a flib’n tango along the way that could’ve hit me. piece of crap…. I guess I should move Americas Army up on the test list since it’s the only other Unreal Engine game I own, who knows maybe it could effect all Unreal 2.x games : I don’t own any of the UT games to test either.

Now that would suck… if every Unreal Engine game was utter crap on this piece of crap card.

*sigh* why do I even fscking bother…

Oh wait, I forgot I’m in this mess because the card I didn’t want in the first place but got stuck with went bad. And the card I had to get to replace it because I couldn’t get any other (thank you very much for no online shopping option!!!) doesn’t work well with the damn games I play.. I swear, if I ever get the cash for a Personal Computer again.. I’m building it my self and ain’t listening to no whining ass family when it comes to how to spend the money !!

Hell, I’ve been accustomed to a weekly income of $0 my entire life and having to make the absolute most of what I do spend. And I know more about computers then any one in this burg I’ve met that ain’t paid to know more then I do. Let along being capable of assembling my own workstation and buying the parts wisely enough. My desktop has been $1600 + $80 and now + $100 worth of hell and countless headaches over the past two years. And I could build a better system for $1200 ffs !!! Thi sis what happens when you compromise on your freedom.

You become the (en)slave(d).

days recap

It’s been a bit of a busy night, took a little time to work on the NPM_PortConfig class but I’m still not really happy with it. The main thing that concerns me at the moment is dealing with saved config’s. Namely how to handle a situation where the Makefile has more options in it then the saved options from last time the system was built. Because other then that, it is really just as simple as check for a saved config,parse it if found and the makefile if not then and move on..

Also been playing around with the ol’C++ tonight. So farI’ve been reminded of why I hate C++ and why I love Qt and the GNU Compiler Collection at the same time lol. It does feel kind of weird to be working on some thing in C++ again, it was my first language but I have not used it in ages.. used C yeah sure but not C++ :

Lead some Planning & Leading training on TG#1 today. I was a little disapointed that Chester was the only one that showed up… But I think it whent quite good. Chester continues to show he’s worth our time in training. And the best part, we got to sneak past a ton of tango’s right under their noses hehe xD

Still early here, 0320R (local) but it’s hard to keep my mind on the code…

*sighs* women… lol.

Proof of Concept: Randomize a list

Well, the idea was essentially that RvS allows up to 30~32 maps or so all stored as a pair of assicated arrays loaded from the servers configuration file. One array that holds the game types (e.g. tango hunt, hostage rescue, misson et. al.) and the other the actual maps to load, i.e. GameType[0]=first maps gametype and Maps[0]=first map to load.

I took a moment the other day (before my gfx card went fuzzy) to write a small program that would generate a new configuration file with a maplist specified from another file, the prototype works fine but I didn’t know how I could archive my real goal: randomly populate the maplist from that file.

Here is a proof-of-concept algorithm that takes a list of items and returns a new list containing the same values but sorted into a ‘random’ order.


#!/usr/bin/env python

import random

def unsort(list, index):
    "return a copy of list reordered randomly"

    new_list = []
    table = []

    while len(new_list) != index:
        r = random.randint(0, index)
        try:
            if r not in table:
                table.append(r)
                new_list.append(list[r])
            else:
                continue
        except IndexError:
            pass
    return new_list

if __name__ == "__main__":
    li = [1,2,3,4,5]
    print unsort(li, len(li))

This took me about 10 minutes of thinking at work today and about 12 or 14 hours later I’ve made a test script in Python since that is the language I’ve been using for stuff latly. Basically the problem is the only way to randomly map items from one list into another is if you access elements in the list at random. But if you access a list at a random index and push it into a new list you can get duplicates. So a table (list) is used to store random numbers we have already generated. If the current number is not referenced in the table we can assume that we have not copied the element at that index in the list into the new list, if it does exist we need to try again. One bad thing is the algorithm is designed to run until completion, which can take an arbitrary amount of time to ‘unsort’ any given set. In theory, it could loop forever! However it would be trivial to modify it to abort the randomization process after a given time frame (such as >N iterations or seconds, which ever comes first) and just append remaining elements onto the end of the new list.

Here is a few test runs:

Terry@Dixie$ ./unsort.py
[3, 5, 4, 1, 2]
Terry@Dixie$ ./unsort.py
[3, 5, 2, 1, 4]
Terry@Dixie$ ./unsort.py
[4, 1, 2, 3, 5]
Terry@Dixie$ ./unsort.py
[5, 4, 1, 2, 3]
Terry@Dixie$ ./unsort.py
[5, 2, 4, 1, 3]
Terry@Dixie$ ./unsort.py
[3, 2, 1, 4, 5]
Terry@Dixie$ ./unsort.py
[4, 5, 3, 2, 1]
Terry@Dixie$

Odds are the PRNG is being seeded with the system time by default or making use of /dev/random on my FreeBSD laptop and that is good enough for me. And these results are random enough for me because I dunno how to write first class pseudo random number generators hehe.