ZzzzZzz

Mondays are always tiring… thanks to the holidays that jobs now on Tuesdays until Janurary.. So I’m about ready to pass out.

Been playing with the prototype for configuring a port. Made some changes including actually writing out the options to a file. I also got to poke around at Pythons ways of handling file locking, nice to see that fcntl, flock, and lockf work more or less the same as in C.

At least work tomorrow work should be light and I might actually get home in time to rest.. The down side to having to reserve most of my time spent working on this to after dark, is I can only go about as long as it takes for my brain to crash.. And that is a bit constraining at times. Between a full days work and work the next morning.. Can’t wait for the weekends!

Tomorrow I need to finish work on the prototype and then start integrating it with the rest of the more complete code the day after. In between I’d like to experiment with a few things in QT, migh tbe a little easier to do the tests in C++ but that wouldn’t be totally helpful… hehe.

Spent about 2 hours tonight, mostly reading make files. I think I’ve read all of the bsd.port* makefiles in /usr/share/mk and /usr/ports/Mk. Along with most of /usr/ports/Tools/* and a ton of stuff in /usr/share/mk/. While there is a lot of leg-work there as far as ports goes it doesn’t seem to be as complicated as I would have thought.

Made some changes to the prototype for the dialog to handle our way to ‘make config’ but it’s to late to work on it further on it. I need to set it up to store what options have been checked / unchecked so they can be used to get things set up to run make.

if I didn’t have the small problem of getting up for work tomorrow I’d have that done tonight…

So far, work on this program has been fairly easy, the main problems I am anticipating is sorting out the final-form of the main GUI. I’ve been using the 2nd style that I posted awhile back, for the prototype but I can still replace it with another quite easy once the rest of the work is done.

I may have 0 formal education when it comes to Computers or Programming. But I am accustomed to doing things the way I am doing them now. Namely trying to implement things in as small and manageable sections as possible; where each section only handles as much as necessary and relies on as little as possible out-side of it’s related code. I like it when things can be tested as stand-alone as possible and then modified/rewritten as part of the larger program. You could say I’m not a fan of 10,000 line monolithic modules that do their job plus everything but recreate emacs lol.

I test the sections making sure that it does what I need it to. Then experiment with it to see how it reacts, and incorporate it into the rest of the project based on what was learned from that prototype. This is just the way I like to tackle the problem of writing a program.

I’m more used to dealing with C and a mess of .c/.h files but python is quite nice. And it has allowed me to spend most of my time concentrating on building a working program, solving the problems not tinkering around with GDB or malloc() more then thinking about how to best make stuff work.

I hate debuggers… But some times they are necessary. My favorite method of coping with some thing that doesn’t work as anticipated is go back to the code and apply brain power. Why doesn’t it work and why does it do what it does instead? Although I must admit GDB is invaluable when needed. But I’ve rarely needed to use a debugger outside of C and C++, and even then usually to track down a stray pointer or get a backtrace.

A short look

Well, almost missed my narrow window of code time… Was passed out on the couch with a full stomach before bed until nearly 0100 xD

Between My mom, my sister, the bird, and my nephew (a louder bird)… And helping with baking there is really not much I can do during the day.. Any attempt at even thinking about seriously trying to read or write goes out the window and in comes a headache. So I have to work at night, when every one else is alseep… Until I crash or the clock reaches a point where I need to go to sleep in order to be @ work on time.

I completed the mock up of a simple dialog for simulating make config. And I’ve almost finished a working prototype for the module but I don’t have time to handle writing the slots and associated code to deal with the check boxes right now. And I need to get that done and tested before I can incorporate the prototype unto the module it belongs.

I posted a screen shot of the mock up awhile back. I’ve fixed the display a bit (the leading variable name from the makefile is removed). And added an ok and cancel button with the beginnings of a more key-board friendly behavior when it comes to using the keys instead of the rat to use it hehe. I’ve also set the caption on the dialog to contain the ports name as category/program.

In doing this, I figured the most simple way was to just muck around with a string of our target (e.g. /usr/ports/net/samba3 and /usr/ports/www/links/ in my tests). Although now that I think of it, the same routine I wrote to get a list of options to create check boxes for. Could be used to look up the category and portname variables from the makefile instead because it’s not tied to looking up any specific variable. — TODO: compare both methods for speed
after the prototype is ready to be moved to alpha group.

In trying to figure out how to get the desired result from a string version of our working path, I remembered that most languages offer some way to obtain the basename of a file or directory and set to look for it in Pythons os module. But doing that would mean we’d have to cut off the trailing slash and refeed the path to the library routine then join them into a new thing. Not exactly my idea of fun when writing a quick helper subroutine. I was very happy that help(os.path.split) revealed a method that takes care of most of that legwork itself.

Python also has some thing called list compression and which allows the mapping of the contents from one list into another based on given criteria. I’ve generally avoided list compressions out of disfavor for some of the (large) examples I’ve seen before. But for this, I actually found it yielded both quick to write and easy to understand code.

p = name # '/usr/ports/category/program' for example
prog = os.path.split(p)
cat = os.path.split(prog[0])

path = ["%s/%s" % (c,p) for c,p in zip(cat, prog) if c and p]
return path.pop()

The above snippet splits name into two lists of two elements, each a string. Basically the 2nd line returns a list of [‘/usr/ports/category’, ‘program’]. So obviously line 3 likewise splits /usr/ports/category into a list of two elements, the last of which is category. I really love how os.path.split() speeds up reading this, it takes only a glance to read it without having to double check it.

The 5th line maps any elements of the two lists (cat and prog) into a single a list of strings, i.e. some thing like path => [ ‘/usr/ports/category’, ‘category/program’ ]. The test for each element being true could be ommited in this case but I wanted to show the possibility.

Since path is a list and we want to display a string (without using str() on the result!), we just pop() the last element off path, which is exactly the element we want ‘category/program’

mm, now for some sleep… It’s after 5am here and I’m exhausted.

Prototypes: Tigerstripe and Desert DPM

Many thanks to [SAS]_Sgt_Miles for helping me find my way through the software and to [SAS]_LCpl_Duke for modeling these skins thus each making this preview possible 🙂

Making these skins was not hard but I’m not very happy with the Tigerstripe. Although I do love the Desert one! Two view a larger (1024x768px) version of each image click them and hit ‘full size’ when the pop up opens.

Background:

Tigerstripe was used by elite troopers during the Vietnam War at least until they found out that a lot of wear and tear made the material it was often machined from turned colors into some thing that would give away your position =/

The Desert Disruptive Pattern Material (DPM) is a British Army camouflage pattern in use since the first gulf war as far as I know. I’m American so the British army is not my specialty lol

Previews:

SAS Tigerstripe.

I created the SAS Tigerstripe as a prototype skin to test my ability to make a reasonable camo skin based on a fabric pattern. I wasn’t sure how they would come out so I selected two for test, Tigerstripe is some thing that thought about incorporating into my personal skin. But I feel that the quality of this prototype is to low for it to be used in the core skins :'( So I don’t think SAS Tigerstripe will likely get past the prototype phase… Armour comes from SAS Assault – Black Kit, and was designed by [SAS]_Sgt_Miles based on the existing SAS skin. The great face texture is from the contrib;s SoliderMilhaus91 made to the project.

SAS Desert

SAS Desert was a prototype meant to test the validity of making a ‘decent’ Desert Ops skin. It reminds me some what of the costumes used by the actors playing Delta Force operators in the movie Black Hawk Down. When you combine the camo with the vest same vest that [SAS]_Sgt_Miles made for the SAS Assault skins and the same face from SoliderMilhaus91. As far as I know this is the current pattern used by the British Army but I’m a little short of British Army contacts atm to check further then I’ve already done so lol. I expect this skin to make it to the core skins, give or take the heavy armour.

I had originally planned to ship SAS Black, SAS Blue, SAS Green (largely because I liked green xD), SAS Sabre, and a skin for Training Personal (SAS Trainer) as the ‘SAS Assault’ or core skins.

While SAS Black turned out to be pretty freaking awesome thanks to Mile’s work on the vest. The SAS Blue and SAS Green did not come out so good, because they were originally based on the Suspects Old Greens and GIGN light pants…. Not so pretty. SAS Trainer on the other hand I think is ok enough but I don’t particularly care for the mustache on the face textures we’ve used. The SAS Sabre skin is an awesome gray battle suit based on one of our old SWAT3 uniforms and I love it xD

Unless I can make some improvements, SAS Blue and SAS Green are scrapped until further development… SAS Desert will ship once it’s heavy and no armour configurations are ready.

SAS Tigerstripe, currently remains prototype-status… Maybe to be released in the future but I think it is more likely to see some thing based on DPM-95 shipping instead…

If attempts to improve BDU_Tigerstripe.tga are successful, who knows… I love Tigerstripe but for SAS I want good stuff..

Zombie cream cheese?

I was dreaming that I was testing a simulator of a huge roller coaster, quite nice but not as good as the real thing; even in dreamland =/

The guys running it left some thing behind when I hopped out and tracked me down later to find it. I told them where I saw it land and tried tot ake them to it.

The only problem was that every thing on display was alive and mighty pissed off…

Dodging zombies, chainsaw packing nutter, and very funky tow-truck from hell among other parrals I managed to get to the simulator but couldn’t get it in time and was forced to retreat… I did acquire a battle ax from one of the creatures on the rampage.

Not scarry, I have not really been scared by any of my dreams in ages. It was just that you can’t stop moving or your toast kind of thing =/

Fleeing to the control room, the operators told me it wasn’t real so I set out. So they set me back out on the quest… Now armed with the battle ax I started cleaving through zombies trying to fight my way through to the simulator.

A battle ax is a very powerful offensive weapon because you can put a lot of force behind it but unlike a sword (which is more my style) you have very little defensive ability… The ax is only good while attacking, if you’ve got to block you are doomed against multiple enemies who other wise would be scared crap less.

The strange thing is the Zombies were made out of cream cheese!! Now I know I’m getting weird dreams lol. Bull dozing the nut with the hocky mask & chain saw and chopping the truck to bits I made it to the simulator and got the thing the operators lost.

Returning back, I heard sounds… as if it was penetrated. Crouching @ the corner and slicing the pie in, I saw no one.. Then found one of the operators hiding; handing over the items (and stupidly the ax!). He sliced me with the ax leaving 2 black streams; like in Spaceballs when they accidentally take out a camera guy during the fight. And I deflated like a balloon. The two operators put on Christmas hats and started to look like elves and walked off.

I really have some crazy dreams eh? That one was like the ending of a good horror book but a bit funky =/

After that… I started to dream some thing else but some thing…. More private then I would like to post in public view… lol. A dream that worries me but is not as strange as my normal dreams. Funny to be saying that rofl :S.

I normally don’t place much meaning on my dreams because they are usually so crazy but this one was one with a straight face.

tinkering

click to enlarge
Free Image Hosting at www.ImageShack.us

Last night I was trying to figure out a little bit about trying to display a suitable array of checkboxes for letting the user select the ports options. I checked out the QWidget class, looks like a nice time saver but a bit of over kill for what I need. I’m also sorry to see it’s deprecated in QT4, for the heck of it I started trying to write the examples in the QT4 doc’s for replacing it, in PyQT but I’ve got QT3 C++/Python bindings on my laptop and the same for QT4 on my Desktop so I didn’t have time to finish it completly. I find it rather werid using C++ doc’s for Python but I am starting to get pretty used to working with Python although I think Ruby and Perl handle regular expressions better along side strings. Not sure if QT3 has a Regex Engine le talong if PyQT has it if there is one =/. It is good to know how to use many different languages though.

For right now I’ve been tinkering with getting the checkboxes laid out and displayed, like in the screen shot of my mock up above. It is not done yet but once the mock up is finished I can set to work on doing more; most interestingly integrating it with the more robust code in the alpha directory (yes I’m to lazy to set up CVS for working from one machine).

In the end I’m likely to use QT Designer to take care of it, so it can be made to look nice. And after feeding it through pyuic use that and the mock up to create some thing to work in a more complete version. For right now though I need to get a little rest, it has been a very busy day. I would like to rest a little bit and finish the movie. Then get back to working on this stuff when I’m more relaxed but I am liable to fall asleep… I’m off until like Tuesday so I suppose it doesn’t really matter when I wake up… And a quick run of xgalaga is a good mental re focuser hehe

*Yawn*

Sneaking a peak at KDE4

I downloaded The Kubuntu-KDE4-RC2 live CD tonight, was only about 422MB of ISO.

I am sorry to say that although I think KDE4 will be a fenominal success (as long as most KDE3 users stick to it) but I am rather disappointed by KDE4 RC2 =/

I do not care much for the Oxygen look and feel as used by default in the Live CD and I especially dislike how there is little distinction between the window and it’s title bar / decore thing. That top bar with the mini/maxi mize buttons and close, e.t.c. or what ever you call it. I did like however the up/down looking buttons for minimize and maximize rather then some of the other things I have seen. As long as Keramik is still available (it was on the live cd as a window decore) I’ll probably be happy.

Konsole seems little changed other then settings->configure konsole it is replaced by editing ones profiles; This will probably cause a small level of new-user confusion but it is worth the clean up to the actual configuration dialog.

I don’t know if it is the way konqueror is done in KDE4RC2 or the way Kubuntu has it set up on the disk but loading any webpage seems to cause a massive flood of download boxes as it loads every page (probably image files). I suspect the problem is Kubuntu’s configuration but didn’t take the time to poke around, got other things to attend to tonight. I was also happy to see that Konquerors configuration system is still very abundant but a lot better organized now in regard to using it as a File Manager, Web Browser, or Both 😉

Kontact id almost the same as I remember it only looking better. Kwrite worked well, did not see Kopete or KOffice apps so I can only guess it is Kubuntu, I’ve often heard that Kubuntu is often pretty bare bones compared to Ubuntu when listing in #kde; which is why I would probably use Ubuntu and apt-get KDE if I swung that way 😉

The panel applets seem to be smoothly and very nicey integrated into the system, I plan to look further at them when I have more time to ‘play’. I fear that KDE4 RC2 seems to show less configuration options to the user then the KDE 3.4.3 through KDE 3.5.7 that I am used to…. However the Control Center has a make over that makes it a lot easier to find what you are looking for, much appreciated in my case but I don’t think it blends in with other or past KDE apps very well. It actually reminds me of the classic style Windows control panel but done in a more integrated way.

The K-Menu is drastically different, not sure if it is an improvement or not… I like the tabbed thing but dislike the focus-follows mouse usage there; it also remembers what ‘sub’ elements you were in when you reopen it, a matter of taste if you like or hate it. But it is rather nice to see a new idea! Or at least, as new as I’ve never seen it before, I used to collect Window Managers for a brief time, along with Terminal Emulators and Shells before settling on my current styles.

I like how the task manager thing in the panel had an icon and a label, I did not try to run a lot of applications to see how it collapses but it is nice the way they show it.

The only thing that really annoys me about the K-Menu is the ability to configure it by a quick right-click didn’t seem available… I don’t think that I will like KDE4 as much as KDE3.. Yet when we get to KDE 4.2 or KDE 4.3 it might be more to my style.

I got to try dolphin the new file manager…. From screen shots that I had seen of its KDE4 port I thought I would love it but after trying it on KDE4RC2 I am very un-amused. It presents a very nice user interface, I always found Konqueror a bit cluttered without stooping to custom profiles for file management and web browsing — A very damn nice feature of konqueror!!! The big killer for dolphin for me, was seeing a large lack of configuration options compared to konqueror or most major KDE applications. Which I could probably stand since it looks like a great program for being able to use effectively for it’s task (file management). The lack of a traditional type the file path address bar was a big let down; I will have to dig deeper into it to see if I can enable that. The alternative method I found in Kubuntu’s setup is a great setup compared to Windows Explorer, which I guess defaults to none… Looking at my moms user settings =/

For me, it is critical to be able to type /path/to/directory/ and go there in any file manager because it is what, like 1,000 times faster then clicking your way through? At least for me — I type at around 70 WPM on typing tests I’ve tried and when composing my self, I can type as fast as I can think; and some times faster as my speeellling show cases often enough on Forums. The primary reason use the Command Line Interface (CLI) for 99% of file management tasks on *nix systems is because the CLI is so much more useful then command.com/cmd.exe that it blows even konqueror away for file management: Most times I do things with file management I would really much rather type it out and use tab-completion then click 20 thousand times to do things. Dolphin and Konqueror however are *very good* file managers as far as GUI File Managers go and I have never found one that I like more then Konqueror (with a custom profile xD) unless I do actually drop to a shell prompt.

I’ll probably end up using KDE4 when it becomes the norm but I think so far, I’d rather have KDE3 as my Desktop with KDE4 applications around it if I could…. Amarok on Windows would probably be worth the concession since the only decent media players I have used are Amarok, MPlayer, Kaffeine, and VLC (which crashes a lot on me in Windows XP).

KDE is one of the projects that I would really like to help in the future, like FreeBSD and Ruby. The main reason I have never tried to get involved with KDE is that I hate C++ and doubt if I could be much use without touching any of it. For KDE I could almost stand working with C++ because I really love KDE. I don’t think I am looking forward to using KDE4 =/ I do however hope that it is the biggest greatest thing to hit the Unix based Desktop since OpenBSD in 1996, Vim (text editor) and the Linux kernel in 1991. Which are the best things I’ve ever bumped into hehe.

Gnome, is not my style and is contrary to my way of doing things. Although Ubuntu 6.06 had a very attractive look/feel with it hehe. I am a KDE User and most of my favorite graphical programs are KDE based or merely front ends to other ones or both in KMPlayers and KPlayers cases xD.

I think for a world of people KDE 4 will revolutionize the desktop when it matures but I am not to sure if it can beat out the matured KDE 3 in my books 🙂

wrapping make config

I was trying to work on creating a simple pop up window that would list of a ports configuration options, same as the dialog you get when doing a make config on a port with options. But for the life of me, I couldn’t figure out how on earth to nab it because of it being a multi line variable.

With the bird screaming my head off and Ma trying to bake (including calling for help). I gave up on even trying.

Tonight I sat down and tried to *concentrate*, it sucks that I’ve got to wait till everyone else is asleep to ensure I can work with my brain on my thoughts… But the anwser to the problem it me quite quickly once I started tonight.

Don’t think about it as grabbing the OPTIONS out of th Makefile, think of it as if I was the make program!

So obviously if I was make(1) I would want to look through the Makefile in order to find all variables declared. Storing them in a simple data structure and relying on the @ EOL continuation syntax that is used — So I would be getting the ‘whole’ thing when storing a variable for later reference.

Stepping back to the problem at hand, I made it look exclusively for Options by wrapping it in a regex check for the specific variable rather then any. I’ve converted the routine to be able to hunt for an indicated rather then specific variable so it is not so closely tied to the problem it is actually solving for me.

Next up, figuring out how QT handles check boxes and adusting the routine for a ‘nicer’ way to use it.

When I can just sit and work/read, I can in-hale a problem/book but when I’ve got to do things so late at night, I am limited to how long I can go until my brain just conks out of logical thinking… Do to the requirement for sleep.

open default browser

for KDE:

$> kfmclient exec

this will open the file with the default binding if at all it exists…i.e. any app that associates itself with .swf MIME type.

for GNOME:

$>gnome-open

^ open file in proper program.

Blissful reading, uhh cramming.

Finished off the last of my library books.

I only read the sections of Upgrading & Repearing Servers that I was interested in, didn’t have time to even open the book on TCP/IP… I probably don’t need that level of information right now, filled for ‘check out again later’ hehe.

Skipped most of the book on Java and like last time I read a book on Java. I’ve also managed to avoid writing a lot of Java code, not a language I am very fond off… but would likely prefer Java to C++, then again I generally prefer C to C++ too hehe. The goal however was not to get into writing Java programs but to see how much the language had changed since the mid-late 1990’s.

Most of my interest in the books I checked out was the Linux Programming Bible, which was useful for a few of the things common to Unix like OSes. For which the only good examples I have been able to dig up in the past, has been reading my Operating Systems user land programs.

The Security book, heck I would by that sucker if I had the cash; especially if there was a 5th edition xD

I generally inhale information when I am free to just do so, so polishing them off was not a problem.