Monday, December 31, 2007

Favorite Song

This is my favorite ones to hit my usual radio station hehe.

Found a YouTube link as well


(This is for all you sophisticated ladies out there)

She grew up in the city in a little subdivision,
Her daddy wore a tie, Momma never fried a chicken,
Ballet, Straight A’s, Most likely to succeed

They bought her a car after graduation
Sent her down south for some higher education
Put her on the fast track to a law degree

Now she’s comin home to visit
holdin the hand
Of a wild-eyed boy
with a farmer’s tan

And shes ridin in the middle of his pickup truck
Blarin Charlie Daniels yellin, “Turn it up!”
They raised her up a lady
but there’s one thing they couldn’t avoid
Ladies love country boys

(You know its true)

Yeah, you know momma’s and daddy’s want better for their daughters
Hope they’ll settle down with a doctor or a lawyer
In their uptown, ball gown, hand-me-down royalty

They never understand
why their princess falls
For some camouflage britches
and a southern boy drawl

Or why she’s ridin in the middle of a pickup truck
Blarin Hank Jr. yellin, “Turn it up!”
They raised her up a lady
but there’s one thing they couldn’t avoid
Ladies love country boys

(oooh, get country with it)

You can train ‘em
You can try to teach ‘em right from wrong
But it’s still gonna turn ‘em on

When they go ridin in the middle of a pickup truck
Blarin Lynyrd Skynyrd yellin, “Turn it up!”
You can raise her up a lady
but there’s one thing you jus can’t avoid
Ladies love country boys

They love us country boys
Ooooooh yeah
It's that country thing you know

Sunday, December 30, 2007

What Do You Have To Say? - Ringing in 2008

What are your New Year's Eve plans?
Brought to you by HP
Live Journal Writer's Block


Hmmm...

Stuff my face with food (two days of family semi-feast'ish eating hehe)

Blast the music (via headphones when others are near)

Nuke some tangos and rescue hostages with teammates

Code :-)

And get home work done.


Nice NY eh? Well I'm not actually complaining loool


I've actually got almost 3 back tests ready to be sent in for grading.. I'm gettinmg that bloody High School Diploma if I've gotta kick myself through it... The working hours are level enough that I can actually do home work now lol. And without having to worry so much...


2008 can't be a worse year then those that have gone before, the worst events of my life might be classifiable in the 2006-2007 range but the best probably 2004-2005 and even the worst times... Not really that bad compared to some people. I can't help but wonder what growth and learning the future may offer and the dreams that follow them.


I also wonder just how much 'alike' in its own way things might have been back in 1908 in regard to various events and happenings.

Saturday, December 29, 2007

3 Modules and a pillow.

Been at work on 3 modules tonight, the searchlet looks like it's able to stand alone quite well, leaving the NPM_MainWindow() to sort out how to lay it out in the main window. The module to handle pkg_info is becoming likewise (atm it's just a thin layer around QListView). I've also made a few minor changes to the dialogs module, as soon as I have time to learn a more effective way of dealing with the arg's involved I can get several classes sorted quickly in that module.


Very productive day all around it seems lol.


Now for some Simpsons and Sleep....... zzzZzzzzZzzzZzzZzzz

What Do You Have To Say? - My Favorite Games

What kind of games do you play?
Brought to you by HP

Live Journal Writer's Block



This kind :-)
Spent last night working on further modulariation of the NPM_MainWindow class and I ended up sleeping next to Dixie =/


How many lucky guys get to wake up next to a laptop hahaha !!!



Today every one else was out so I managed to get time to sort out my paper work, makes me feel a little better at having dozed of after 2-3am =/



We also had a nice live op.. Went quite nice until we came to an area, from what I could see through lakes cam I thought the area was maybe 25-30m square. So I figured, roll a sting ball out and dominate along the two flanks. One man down in the entry attempt, 2 pinned down and one separated...

Moving out and trying to take cover we lost 2 more men so I shouted for Pittman to hold in cover.. Only to get sniped by a buckshot firing shotgun lol.... My failure not the teams.


Playing through the round for fun after we failed the live op (yuke whent to post the report). The resut of us went through again to explor, finding out that the area was closer to 45-55m square with evated shooters along one flank.


Nice secrets we uncovered, lake found a secret passage 'ghost wall' that opens a passage into hallway below. There's a |_| area there that leads into a pair of dark rooms, one of which the door to the out-side is closed until you get to the room; it was there when we were exploring. But not there when me and Lake when hunting, until we cleared that room!

The passage under the pools, I h ad fired several 5.56x45mm FMJ into it before but no go, Lake applied his .45Cal UMP45 and it worked :-). So we went through the water, up to the secret room, and back through a sand filled set of hallways and boom.


We found out that the statue of a Crypt guarded by Anubis had slid to one side, unveiling the next hidden passage and exit.



While Lake went off to hunt down stuff, I tried walking off a platform into some plants. To my shop I fell through and found myself in an armour, varius pisol, smg, ar, sg, and tac aids on shelves and I took this screen shot of names on the wall:

[Click to Enlarge]
Free Image Hosting at www.ImageShack.us

Friday, December 28, 2007

Spent most of the dy with a headache and killing time in the servers..


I did manage to get time to read most of the documentation on QT's I18N & L10N features and it actually seems to be a lot easier then I thought.


I knew there was some thing I liked about the folks at Trolltech ^_^


As far as coding for tonight, I'm not sure what I'll be working on.. All I know is my paper work is late and the dead lines in two days... So I think that has priority if my family would ever leave me be...


I don't really know what is worse, taking aspirin so often you get stomach ulcers or putting up with the results of life here =/

Thursday, December 27, 2007

code at last

Spent tonight working on rewritten logger and options modules for the next phases of their prototypes.

There still is a fair bit of work to do with logger (i.e. telling it / getting from it the name of log file(s)) but it's now essentially integrated with the rest of the program. Internally the module might change quite a bit but it's usage throughout NPM will remain pretty much the same save where the above is concerned ^ (basically within the options module).


The options module is quite a lot cleaner imho, now has a search for a config file and can write the configuration file, the module matures bit by bit. I've also streamlined the configuration file a bit but I've still got to find the time to work on some concept drawings of the GUI's configuration menu.

I also want to take a look at QAction and QActionGroup later on based on inputs from the QT4 doc's.


*technically* I could probably get it operational for building a port right now with a wee bit of work... But I'd much rather have the bloody thing working properly and tested first :-).



*sigh* after 0400... time for bed because work is in the morning. It sucks that I've to wait till like 2300 or later to start coding... Any attempt at getting stuff done while the rest of my family is awake has proved futile over the last year and a half..... I could be so much more productive if I didn't have to cram-things around every one.. I've got paper work due for En4cers inbox that's overdue, school work piling up, and a project to work on (npm) and I've got to fit it all into the time slot of

>= every one else in bed
< I'm ready to pass out
< the time to go to work
<= time to go to bed if I'm ever gonna get to work on time


Grrr...

What Do You Have To Say? - My Secret Talent

What's your secret talent?
Brought to you by HP
Live Journal Writer's Block



The ability to learn :-)

Wednesday, December 26, 2007

snoring through logging

been working on a simple logging module for npm, so far I've set it up to handle 3 different outputs, the usual STDERR for big problems, a regular log file for every thing but debugging, and a developers log file for use during debugging.


stderr
CRITICAL: critical message
ERROR: error message
WARNING: warning message
run log
2007-12-27 07:27:45,156: CRITICAL -:- critical message
2007-12-27 07:27:45,157: ERROR -:- error message
2007-12-27 07:27:45,157: WARNING -:- warning message
2007-12-27 07:27:45,158: INFO -:- info message
dev log
2007-12-27 07:27:45,156 root CRITICAL: logger.logger.py.73
         critical message
2007-12-27 07:27:45,157 root ERROR: logger.logger.py.74
         error message
2007-12-27 07:27:45,157 root WARNING: logger.logger.py.75
         warning message
2007-12-27 07:27:45,158 root INFO: logger.logger.py.76
         info message
2007-12-27 07:27:45,159 root DEBUG: logger.logger.py.77
         debug message

The formats are just a matter of what I find easy on the eyes, think the middle one could stand with a shorter date format.

I might ditch the idea of a second log file and just follow my original idea of being able to specify the level of logging to use. It'd also be less work then



Either way yee slice it, I need some freaking sleep... because I can't think no more.

:wq!

Tuesday, December 25, 2007

OH how sweet it would be to have the freedom to get through even one day without any headaches......

Monday, December 24, 2007

Remembering

Hail Mary, full of grace,
the Lord is with thee,
blessed art thou among women,
and blessed is the fruit of thy womb, Jesus.
Holy Mary, mother of God,
pray for us sinners, now, and at
the hour of our death.
Amen.

Sunday, December 23, 2007

Qute I/O

Been meandering about with Pythons subprocess and various IPC (inter Process Communication) focuses modules tonight. When I remembered I had noted that QT and KDE had classes for working with processes.

Looked up the class in the documentation and played with it. Then I found a small example program that they included. Here is the QT written example using C++, the primary language.

/****************************************************************************
** $Id: qt/process.cpp   3.3.7   edited Aug 31 2005 $
**
** Copyright (C) 1992-2005 Trolltech AS.  All rights reserved.
**
** This file is part of an example program for Qt.  This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/

#include <qobject.h>
#include <qprocess.h>
#include <qvbox.h>
#include <qtextview.h>
#include <qpushbutton.h>
#include <qapplication.h>
#include <qmessagebox.h>

#include <stdlib.h>

class UicManager : public QVBox
{
    Q_OBJECT

public:
    UicManager();
    ~UicManager() {}

public slots:
    void readFromStdout();
    void scrollToTop();

private:
    QProcess *proc;
    QTextView *output;
    QPushButton *quitButton;
};

UicManager::UicManager()
{
    // Layout
    output = new QTextView( this );
    quitButton = new QPushButton( tr("Quit"), this );
    connect( quitButton, SIGNAL(clicked()),
            qApp, SLOT(quit()) );
    resize( 500, 500 );

    // QProcess related code
    proc = new QProcess( this );

    // Set up the command and arguments.
    // On the command line you would do:
    //   uic -tr i18n "small_dialog.ui"
    proc->addArgument( "uic" );
    proc->addArgument( "-tr" );
    proc->addArgument( "i18n" );
    proc->addArgument( "small_dialog.ui" );

    connect( proc, SIGNAL(readyReadStdout()),
            this, SLOT(readFromStdout()) );
    connect( proc, SIGNAL(processExited()),
            this, SLOT(scrollToTop()) );

    if ( !proc->start() ) {
        // error handling
        QMessageBox::critical( 0,
                tr("Fatal error"),
                tr("Could not start the uic command."),
                tr("Quit") );
        exit( -1 );
    }
}

void UicManager::readFromStdout()
{
    // Read and process the data.
    // Bear in mind that the data might be output in chunks.
    output->append( proc->readStdout() );
}

void UicManager::scrollToTop()
{
    output->setContentsPos( 0, 0 );
}

int main( int argc, char **argv )
{
    QApplication a( argc, argv );
    UicManager manager;
    a.setMainWidget( &manager );
    manager.show();
    return a.exec();
}

#include "process.moc"


Needless to say, I am not really a fan of C++ at times ^_^. I translated the example into Python for a simple test and I like it quite a bit.


#!/usr/local/bin/python

# I translated the example: process/process.cpp to python and boy do I love qt!
#
#############################################################################
##
## Copyright (C) 1992-2005 Trolltech AS.  All rights reserved.
##
## This file is part of an example program for Qt.  This example
## program may be used, distributed and modified without limitation.
##
##############################################################################

import sys
from qt import *

class UicManager(QVBox):
    def __init__(self):
        QVBox.__init__(self)
        self.output = QTextView(self)
        self.quitButton = QPushButton(self.tr('Quit'), self)
        self.connect(self.quitButton, SIGNAL('clicked()'), qApp,
                     SLOT('quit()'))
        self.resize(500,500)

        # QProcess related code
        self.proc = QProcess(self)

        self.proc.addArgument("uic")
        self.proc.addArgument("form1.ui")
        
        self.connect(self.proc, SIGNAL('readyReadStdout()'),
                           self.readFromStdout)
        self.connect(self.proc, SIGNAL('processExited()'),
                           self.scrollToTop)

        if not self.proc.start():
            sys.stderr.write('fatal error could not start uic\n')
            sys.exit(1)

    def readFromStdout(self):
        'read in proc data which may be in chucks'
        self.output.append(str(self.proc.readStdout()))

    def scrollToTop(self):
        self.output.setContentsPos(0,0)

if __name__ == "__main__":
    a = QApplication(sys.argv)
    manager = UicManager()
    a.setMainWidget(manager)
    manager.show()
    sys.exit(a.exec_loop())

QProcess is nice but I'm not sure about using enormous amounts of data though yet.


EDIT:

As a test I set up the Python script to pass a 'ls -R /' basically causing it to list all files on all mounted file systems. The code to scroll back to the top caused major lock up to the program and some performance loss for the entire laptop: probably screaming at being down to about a 150MB of swap space left.

Removing that and closing programs so only konsole running it and top + amarok playing music was running. At times top reported free memory over < 1MB about 30-40% swap usage. However without the scroll to top thing gone it didn't cause any real performance for the laptop; probably because there was much less swap usage used up.

As a test I ran ls -R / direct afterwards and while it did pile on the stats in top, it still kept to about 50MB free and even less swap usage on the displays.


So far I think it would probably work for whatever is needed as long as the computer continues to provide adequate memory and the kernel doesn't have a hissy fit about the pipes and things in the background.

Saturday, December 22, 2007

Well, been meaning to do this for awhile now since I had re-installed PC-BSD awhile ago in the course of an upgrade.

A list of all ports and packages I've 'added' to the base install (not counting depends).

Note that I installed a bunch of KDE packages on CD#2 since they were not in PBI format,

kdeedu-3.5.7        Collection of entertaining, educational programs for KDE
kdegames-3.5.7      Games for the KDE integrated X11 desktop
kdesdk-3.5.7        KDE Software Development Kit
kdevelop-3.4.1_1    IDE for a wide variety of programming tasks
koffice-1.6.3,2     Office Suite for KDE3

For software I've installed since the first boot up,

cscope-15.6         An interactive C program browser
ctags-5.7           A feature-filled tagfile generator for vi and emacs clones
de-kde-i18n-3.5.8   German messages and documentation for KDE3
diablo-jdk-1.5.0.07.01 Java Development Kit 1.5.0_07.01
diablo-jre-1.5.0.07.01 Java Runtime Environment 1.5.0_07.01
docker-1.5_5        A dockapp with support for GNOME2 and KDE3 tray icons
doom-data-1.0_1     Doom data files (Doom, Doom II, Hexen, Heretic and Strife)
elinks-0.11.2_2     Elinks - links text WWW browser with enhancements
emacs-22.1_1        GNU editing macros
gmake-3.81_2        GNU version of 'make' utility
javavmwrapper-2.3   Wrapper script for various Java Virtual Machines
konversation-1.0.1_1 A user friendly IRC client for KDE
kscope-1.6.0        KDE front-end to Cscope
libdvdcss-1.2.9_2   Portable abstraction library for DVD decryption
libdvdnav-0.1.10_3  The library for the xine-dvdnav plugin
linux-flock-0.9.0.2 The free web browser that makes it easier to share with you
linux-mplayerplug-in-3.50 Embed MPlayer into browser
linux-realplayer-10.0.8.805.20060718_2 Linux RealPlayer 10 from RealNetworks
lynx-2.8.7d7        A non-graphical, text-based World-Wide Web client
mg-20050820         A small, fast Emacs-like editor
portaudit-0.5.11    Checks installed ports against a list of security vulnerabi
portupgrade-2.3.1,2 FreeBSD ports/packages administration and management tool s
prboom-2.2.6_2      A multiplayer-capable and modified version of ID's classic 
psearch-1.2         An utility for searching the FreeBSD Ports Collection
ruby18-atk-0.16.0.20071004 Ruby binding for ATK
ruby18-cairo-1.4.1_1 Ruby binding for Cairo
ruby18-doc-stdlib-0.10.1 Documentation for the Ruby language standard library
ruby18-gdk_pixbuf2-0.16.0.20071004_1 Ruby binding for GdkPixbuf2
ruby18-gems-0.9.2   Package management framework for the Ruby language
ruby18-glib2-0.16.0.20071004 Ruby binding for GLib2
ruby18-gtk2-0.16.0.20071004_1 Ruby binding for GTK+2
ruby18-pango-0.16.0.20071004_1 Ruby binding for Pango
ruby18-usersguide-20051121_1 Ruby users guide, in HTML format
rubygem-ini-0.1.1   Ruby INI File Parser and Writer
rubygem-rake-0.7.3  Ruby Make
rubygem-rtags-0.96  A Ruby replacement for ctags
scheme48-1.7        The Scheme Underground's implementation of R5RS
supertux-0.1.3_2    Super Tux is a side-scroller similar to Super Mario Brother
wesnoth-1.2.6       A fantasy turn-based strategy game
windowmaker-0.92.0_3 GNUstep-compliant NeXTstep window manager clone
wmappl-0.6_2        An application launcher dockapp similar to wmbutton
wmbsdbatt-0.1_1     Dockapp for battery & temperature monitoring through ACPI
wmclock-1.0.12.2_2  A dockable clock applet for Window Maker
wmdrawer-0.10.5_3   A dockapp which provides a drawer to launch applications
wmicons-1.0_2       Icons mainly for use in Window Maker
wmmatrix-0.2_2      A DockApp that runs a version of the xmatrix screenhack
xgalaga-2.0.34_2    Galaga resurrected on X
xpdf-3.02_3         Display PDF files, and convert them to other formats
zsh-4.3.4_1         The Z shell


This basically amounts to my standard shell (zsh), a few time wasters; xgaliga, supertux, wesnoth, and stuff to play doom.

A couple of useful tools; java runtime and development kit, exuberant ctags, cscope, kscope (just for the heck of it), and gmake because it's essential to GTK+/QT based projects.

Window Maker and a couple of applets including docker and wmclock (the two I use).

xpdf because I've got vim programed to open PDF's as read only text (using pdftotext)

A few extra editors, (gnu) emacs and mg (micro gnu emacs) just in case => I installed vim from source as I usually do so it's not listed above hehe. Vim is about all I use regularly.


A couple of libdvd* ports to make use of my laptops DVD-ROM ;-)

Web browsers lynx, elinks, and linux-flock, I also have netscape 9 installed manually to the /opt directory within the Linux ABI because it wasn't in ports.

psearch, portupgrade, and portaudit for managing ports as I'm used to

The linux version of realplayer because although the many codecs I manaually installed for mplayer will play the real media I've asked it to, I never had time to twist Mozilla based browsers into using it instead of website foo asking me for a realplayer plugin..


konversation, the worlds greatest IRC client ;-)


Various language stuff, mostly scheme48 and various Ruby things including GTK+ bindings. I used to have QTRuby installed manually but lost it during the reinstall/upgrade of PC-BSD. I'd like to experiment with a few C compilers and a few of the GCC based ports later.


I also have the German language files for KDE handy, using a program in another language can some times be a nice 'crash course' or pop quiz to ones own studies hehe.

The Christmas party

Ahh today was the big bang bash that is the [SAS] 22 EVR's Christmas party :-)


JB lead the guys in warming up the crowd while stuff was getting set up. Wiz and Valroe DJ'd and I tried to keep an eye on things; a nice SHOUTcast server for the music thanks to Wiz. The clan teamspeak server equipped with a party channel and Lake hosting the group chat on XFire with an average of 10-14 [SAS] Members, Recruits., and Friends around to enjoy the fun all around.

About all that was missing in my humble opinion was the Wine, Women, and Dance floor :-)


Spent most of the day 'omni-tasking' and with a headache but I got to enjoy the party and kick back in TG#1 for some RvS. I think every one had a good time and we probably filled two servers most of the day, think Lake led the SWAT favoring elements of the party on a rampage hehe. I had lunch, chores, tech-check, crowd control, two group chats, and numeris IM's while trying to game to boot.


I remember after the party Lake put up a quick video of him on the webcam lighting the fire works, 'This ones for the DJs' hehe.


All in all, really freaking stressful but quite fun. I hope we do it again next year xD. It was also a lot more docile then the last Christmas Party I was at, where we had a nice 'friendly' brawl and I was like "Oh come one" and wound up with some ones knuckles in my teeth -- good party though haha. I'm glade I wasn't the bouncer on that one though =/



Afterwards, a little time to relax watching part of The Hustler (yes I like pool) and taking some time to clean my laptop. I finally peeled off the peeling sticker, blew out her keyboard with a can of air, shined up the case, double checked the battery, and whipped off the touch pad. It's funny that now I seem to have much greater speed and control of it hehe.


Some time though I'd like to strip her down and really clean out the keyboard, uhh that sounds strange doesn't it +S I'm taking about a computer after all ;-)

Friday, December 21, 2007

Another sleepless night

Did some major clean up to the prototype for configuring build options tonight as well as experimented with a few solutions. I just wish I didn't have to cram every thing into such a narrow time slot.

The main problem is I'm so zonked out by the time I get to start, I may as well try and code drunk (mm interesting idea... not!).

As hard as I try to get things done my family twarts me at every turn.. It's like they have some kind of magic radar =/.

During the day, I'd have a better chance of surviving jumping in front of an on comming 18-wheeler then getting stuff done in day light...


At night, I can only work until my brain crashes from lack of sleep.


I can't even remember the last time I had a good nights sleep any more...


At least for today I've managed to get Radio 1 working, although I can play real media in mplayer it konks out after awhile in konqueror.. So I opened it in realplayer rather then keeping the web interface in.


Guess I'll read some doc's before I start snoring with my eyes open....

Thursday, December 20, 2007

Ramblings of a drowsy spider

I comptemplate using C++ again as one of my primary languages, it was the first I started to learn with but one I've never put to much good use.


I generally consider C and C++ different languages, with C++ being C like in so far as C++ is similar to C. Although I do actually like it if the commonalities allow for using either a standard C compiler or C++ compiler. But I still think one should pick one and stick to it.


The main reason for considering C++ as a primary language again, is that it is more C like then any language I use regularly (besides C) so adapting it would be easy. The differences it has over C, might actually make C++ potentionally more productive for me or just annoying but.

The main reason I think digging back into C++ would be counter-productive is the low-level aspects it shares with C, would likely have the same result. Namely the reason I tend look at Bourne shell scripting before deciding to implement things.

The many utilities available outweigh the sense of writing ones own methods of processing the problem. Why have a specialized set of functions when you can just use cat, sed, grep, and awk? And with languages like Ruby or Python; the ability to test code quickly in an interpreter and a fast library of useful tools (batteries included) can be time savers of the write it or find a library for it problem I often face in C.


The main reason I use C, is I love the language and find it very beautiful. Learning the inner secrets of how computers work is a goal for me, one I also find can be a bit of an anti-problem for just getting stuff done.


Using C++ again might also have the problem of my understanding of C interfering with my use of C++ and vice versa after awhile...


Of all the languages I have encountered, The worst things I can say about them...


C -> All fine and dandy till you shoot yourself in the foot without realizing it.

C++ -> See above

Java -> Well, other then the shere bulk these days... I would prefer it to C++ if I wasn't more used to gcc/g++ then javac ;-)

Perl -> A fine language but I dislike reading other peoples scripts at times; nether beautiful nor elegant but like a sharp knife very effective if occasionally complicated to use it as such.

PHP -> I just hate using PHP, period; I'd rather use Perl or C++ -- Assembly might be preferable to PHP in my book !

Python -> A radical departure syntactically from other languages I am used to working with but it is growing on me... The documentation also is quite nice and the occasional irks I have with Ruby are missing.

Ruby -> Like wise very different from the CBF but much more productive for me then either C or Java. A big advantage for me is similarities Ruby has with Perl, while remaining *not* Perl.


Scheme -> very rudermentry knowledge of as I never got to finish reading the standard before work caught me again lol.

Also I have had brief looks into Ada and X86 Assembly but I still consider Bourne Shell, Python, and Ruby my strongest languages; with C and Java as secondary. I don't honestly consider myself a good programmer but I think I am better at programming then I am at playing Chess b||b

Ada fascinates me but never had the time to really study it the way I want to. Assembly, is more so some thing that interests me for one I could learn through it rather then some thing I would want to work with a lot.

I love to study different programming languages, it allows me to learn a lot and to try and wrap my head around different ways of doing things.


Standard libraries and things aside, I am mostly indifferent to language, to me it is just another way to write. I used my abilities to read English to learn C++ and Perl. I bumped into C one day and that was that.. lol. It is just a matter of my 'comfort zone' that I tend to prefer specific languages, namely that I can get stuff done very quickly in Ruby and Python, bourne shell saves me time, and I love C.


From Ada to Vim script, it is all fun to learn.


When I was entering the 7th Grade I tested as having college level reading comprehension and most related things also had high marks aside from my Spelling. It was actually quite strange to get the test results because I was held back one grade as a child because I "couldn't read". My little secret?


I failed the 2nd Grade because I did the reading tests systematically my way. Rather then only hunting down and reading what I could read on the exam when I saw it.


I scanned it for the words I could read and there were plenty of them but the instructor didn't tell me what she wanted me to do other then read it.


So I went through it word by word, left to right, line by line reading what I could: just as I would today now that I could read. And of course I ran out of time; personally I think the instructor thought my scanning time was just struggling on the bigging of the test lol.


Because I was only scored on the words I read allowed, all of the ones I could read down them, well I guess like 80-90% of the test papers; they didn't count. I might very well have passed that test as a boy and got into the 3rd Grade rather then having to repeat the 2nd Grade.


My mechanical nature made me fail that test horribly as a child but if I had merely sat down and tried to 'pass' the test rather then 'doing' it my way. I might never have learned to read the way I did, which I must say is the greatest thing I have ever learned.


English is a very screwed up language when it comes to its written form -> and the family dictionary admits this! But I feel if one can read and understand English well enough, you can learn computers easy.


That is why I find it a bit strange when people struggle with simple tasks on the computer. I don't expect any one to be able to decipher a hexdump but applying a little reading comprehension and common sense yeah I do expect ^_^



I first used a computer when I was still in diapers, I needed to find the command names on a piece of paper in order to run a program. Because I didn't know how to list the contents of a floppy disk and figure out what was on it. Today I regularly use 3 PC's and the command line is my friend. And although I have found superiors when it comes to people that know computers I have never found any one that shares my love of learning.


In gaming I have often said, give me a secure firing position, a mark to shoot at, and I'll hit it given a good sniper rifle for the job. Like wise, give me a book and often I can inhale it, give me a manual and I might love it. I love to learn but I find school boring as shit... teaches nothing beyond the 3 R's... In way to many years.

Heck, I could learn more visiting the library daily then I have from school since completing the 3rd or 4th Grade... And it would be quite a bit less boring at the library I bet.

POST, Power On Self Test

luckily I am off for about a week, well as good as off work hehe. So hopefully I'll have some more time to get things done.


I want to,

work towards getting 'nco's task completed...

send Wiz that memo

send GCHQ that other memo

experiment with a custom widget in both C++ and Python / QT3

continue expanding the configuration systems in NPM.

camp out TG#1 and TG#3

enjoy the [SAS] Virtual Christmas Party


For tonight, I'm not sure what I'm going to work on but I'm glad that I don't need to get up in the morning... I'm also looking forward to the clans big bash, Wiz and Valroe will be DJ'ing so that should be a good pair hehe. It's also a good thing since this close to Christmas, it's unlikely to find me or any of my family on the road more then necessary lol.


I also need to start logging into AIM more often, I havn't gotten to talk to any one lately other then teammates over XFire =/. And since I *hate* phones and the aDSL tends to disconnect when the phone rings, I mostly use Instant Messengering.


"Why the heck did you call me ?"

lol. Unlike phones, IM's allow some measure of coping with life here and actually getting to talk to some one... Without being deafened or inaudible, or losing the cordless.. hahaha.


I don't think I would mind phones so much if it wasn't just a complication of my already insessent multi-tasking.. A clone would be nice, then I could be in two rooms at once rofl. But a clone would probably be as annoyed as I get at it..

As much as I love my family, they can drive me bonkers given a chance +S


Extreme Multi-tasking on the PC and off the PC at the same time can be tricky lol.

Wednesday, December 19, 2007

Sorted my play list for the night, I have a fair system of selection. Using Amaroks file tab, finding each track that matches my listing mood... As usual a mixture of Metal, Rock, Country, and a couple other odds and ends.


Now if my mood... never mind.


Just for the heck of it, I'll feed my m3u file through a little ruby script I wrote some months back out of boredom; it generates a HTML listing from the file, even has the ability to offer a little more information then this when used with id3lib. It also conveniantly has a switch to suppress the HTML tags that make it a full doc, thus generating output that can be copy/pasted into another HTML file or blog ;-)

I think I might actually tweak it a little bit, so it can be used as a filter. I liked working on it because it gave me an excuse to learn a bit of binary because of how I chose to implement it's differing modes lol.



  1. Breaking Benjamin The Diary Of Jane
  2. Bruce Dickinson River of no return
  3. Cybrogs Montage Track02
  4. Cocaine Blues
  5. Die Toten Hosen The little Drummer Boy
  6. Die Apokalyptischen Reiter Ghostriders In The Sky
  7. Daryll Ann Surely Justice
  8. Elvis Presley Johnny B
  9. Folsom Prison Blues
  10. Hinder Lips of an Angel
  11. Hammerfall The unforgiving blade
  12. greenswat
  13. Green Day SeptemberEnds
  14. It Ain't Me Babe
  15. Jackson
  16. Jeff Wunder Way of the sun
  17. JBJ Santa Fe
  18. Jørn Lande Duke of love
  19. LeAnn Rimes Hurt Me
  20. LeAnn Rimes Clinging To A Saving Hand
  21. LeAnn Rimes Blue
  22. LeAnn Rimes On The Side Of Angels
  23. Michael Gungor GOD Is Great
  24. Manowar Call to arms
  25. Nashville Electric Cooperative You Are Still My Only Love
  26. Nashville Electric Cooperative Where Love Was Born
  27. Pillar Frontline
  28. Pillar Rewind
  29. Sammy Kershaw Little Did I Know
  30. SAS
  31. Wildwood Flower
  32. Wiz July07
  33. Wiz Minimix4




Tuesday, December 18, 2007

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.

Monday, December 17, 2007

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.

Sunday, December 16, 2007

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..

Saturday, December 15, 2007

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.

Friday, December 14, 2007

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 :-)

Thursday, December 13, 2007

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.

Wednesday, December 12, 2007

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.

Tuesday, December 11, 2007

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.






Monday, December 10, 2007

Flockzilla

Installed Flock 0.9.0.2 on my laptop today, quick and easy as root:

Dixie# pkg_add -r linux-flock
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/Latest/linux-flock.tbz... Done.
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-stable/All/linux-hicolor-icon-theme-0.5_1.tbz... Done.

And it is installed as linux-flock in my search path, very useful. I have used Mozilla based browsers for a long time. Years ago I started with Firefox 1.x, it was a great improvement over IE5 and 6, tabbed browsing - I was hooked instantly xD


As I got to spend a lot more time on the computer, I soon came to find Firefox less then perfect. The big bonus to using it had become greater portability between websites and OSes, some thing that is a bit of a must for me. I alos use Konqueror and Opera a lot among other browsers.


I tested Flock 0.7.x on my windows box awhile back and was rather impressed, while not perfect it was still pretty great. With a bit of that 'surfer' feel to it :-) I did not think though that it would scale to my laptops hardware quite well though. On a Pentium D 930 with 2GB of RAM, to a Sempron 3300+ with 512MB of RAM... But so far it has actually scalled a lot better then Seamonkey or Firefox 3.0 snap shots !


The main reason I discontinued working with Seamonkey and (Netscape) Navigator (9) was because while I liked them quite a lot, Navigator is actually a nice set up IMHO. The lack of responsfulness, particularly while editing text in fields like this and on forums made it less them ideal on my hardware. Even on the faster Desktop I occasionally noticed slow downs during text editing. On my laptop, even Firefox 2.0.0.x and 3.0a builds had the same issue on my laptop.


So far, Flocks Linux version does not, and it is starting faster then Netscape or Seamonkey ever did. And the funky font issues of using Linux Firefox and friends on PC-BSD no longer seem to apply to PC-BSD v1.4.x systems:-)

The thing I enjoy the most about Flock is the web clipboard and services support, especially for ma.gnolia. Being based on Firefox, Flock is still pretty easy to use but I find most of its shortcomings are inherited from Firefox! All of which seem to relate to configuration options.... But it does add enough other capabilities to be a bit of an improvement over Firefox 2 and 3a imho. And like Netscape Navigator 9, should work fine on Google Doc's and friends hehe.


I think most of the Firefox extensions and add ons should work with Flock, doubt most themes would but Flock has a very nice default theme unlike Firefox. I have never really used much in the way of Firefox Extensions and Add Ons, although I keep several installed in my Desktop; I usually don't use them ^_^.

Now if only Flock didn't use the same crappy Spell Checking technology that Firefox does......... *sighs* I really wish Vim or Google would create a portable spell checking library based on their code, because they offer the best spell checking I've ever found =/

Sunday, December 9, 2007

Night module

Unfortunitly it is 0430 and I've got to get up early for work :'(

Finally had free time to day to shave off that infernal beard.. After so many months it is kind of nice to be reminded I'm more human the Wookie haha.



Spent tonight doing some light but thoughtful work,

Terry@Dixie$ pwd; /bin/ls -1                                               9:26
/home/Terry/code/Python/src/neo/testing/alpha
dialogs.py
main.py
neo.py
options.py
translate.py
Terry@Dixie$                                                               9:29

I have arranged things from the testing directory to it's own work dir to clean up. Not to mention to continue work in a more module oriented pattern then the monolith and scratch files I have been using to test the first mock up of the programs UI.


  • dialogs -> will hold code common to user interaction through 'pop up' windows.
  • main -> the begining of it all, will probably be wrapped in a shell script
  • neo -> the GUI's mock up code for the main window, need to split stuff off into sub modules when more work is done.
  • options -> the option subsystem, currently part of a config parser; to be expanded greatly
  • translate -> quick references to tools we will need later (subject to changes)

There is also a .neorc INI file for the testing :-)


My near-future to do list right now is, in no particular order:

experiment with improving the wrapping paper on pkg_info; regex might be an improvement to the current process what ever the possible speed changes are. It might also be beneficial to look into using a pipe in order to ease start up times.


expanding dialogs into some thing more complete, currently it only has a routine for an error message.


Figure out how we can create a suitable display area for the output of a shell command (such as 'make').



I think I could probably do double the amount of work per day on this, if I didn't have to do it before bed... Which has the bad limit of only being able to do things until my mind gets to the point that I just have got to sleep or the clock passes a point where I need to hit the hay, in order to get enough sleep for work in the morning.


I am lucky though, I've had almost 3 day's off and only light duties tomorrow.





Saturday, December 8, 2007

searchlet test level 7

Almost finished my work on npm from early this afternoon.

Took care of getting the mock up to actually search the ports tree for a given string, considering incorporating a simplified version of psearch but I can worry about that later.

Did most of the right view of installed software today, it still has a problem but this is good progress:

Click to enlarge



Some of the listings are screwed up and trigger a TypeError, I know I'm doing some thing wrong some where but not sure where yet.... At the moment I am about ready to hit the hay.


Some future tasks include fixing that, adding a toolbar to the mockup, a place holder (or working) msg display area. And moving on to other mock up's.


So far, it is not pretty but the mock up is doing quite well. Hopefully fiddling with layout management and spacers will not be to much heartache under QT3 without having to use the Designer tool. Hmm, you know it might even be possible to make things a bit more flexibble rather then choosing one of the mock ups as the basise of the final forms overall appearance.

Any way one slices it though, it is time for BED.

An automatic wall paper changer for wmakerAn automatic wall paper changer for wmaker

I recently switched to using Window Maker on PC-BSD, one of my favorite window managers actually. But it does have a few dis advantages over KDE when it comes to session management...

I went though my large wall papers collection and found several that I would like to use, the WMaker theme I have set is a dark one.

Terry@Dixie$ ls ~/Pictures/Wall_Papers|wc -l                               6:38
     657
Terry@Dixie$ ls ~/GNUstep/Library/WindowMaker/Backgrounds|wc -l            6:40
      57
Terry@Dixie$                                                               6:40

Many didn't scale right and I don't know of any batch image scaler, so I had my shell open each in kolour paint so I could do this. Using a graphical file manager I would have to double click each file at the least level of effort... With the shell, it was simple loop in my backgrounds directory:

for i in `ls`
do
        kolourpaint $i
done

This opened kolourpaint to a file, allowing me to do a quick ctrl+e and set it to smooth scale it to 1280x800 to match my LCD's native resolution. And then to ctrl+s save it, X out of it and volia, kolourpaint would start again with another file as it continued through the loop.


Having done this, I was thinking how to I get it to change after awhile? I thought about a symlink that would be changed to a different wall paper every now and then, tested it no go. Then I found wmsetbg and the -s (-scale) option, so yeah I wasted my time scaling them all lol.

So I removed them and made symlinks to the original files in my wall papers directory:

for i in `ls`                                                 6:40
do
        ln -hfs /home/Terry/Pictures/Wall_Papers/$i /home/Terry/GNUstep/Library/WindowMaker/Backgrounds/$i
done

Like I am going to stand here and create 50++ shortcuts myself? NO WAY!

After that I set to look into hooking up a shell script that could run in the background and change the wall paper for me. I figured that I would want some thing acline to the sleep() function out of unistd.h but I didn't really want to use a C program or any other programming language to do it. Because while looping over the directory in C might be faster then /bin/sh by the time the compiler tried to optimize it. Having to invoke a shell for every call to system() (for running wmsetbg) would probably be a bit wasteful. At least in a shell script, there should be no need to create a new /bin/sh process on each pass. Didn't find a built in shell command for it but /bin/sleep works fine, so I wrote the following script to change my wall paper every 10 minutes:

#!/bin/sh
# A simple automatic wall paper changer for window maker.

while (true)
do
    for p in `/bin/ls /home/Terry/GNUstep/Library/WindowMaker/Backgrounds/`
    do
        wmsetbg -u -s $p
        sleep 600
        continue
    done
done

\


And to run it on window makers start up, I added this line to my ~/GNUstep/Library/WindowMaker/autostart file:

/usr/home/Terry/sh/setbg &


and Hooah ^_^

And here is a python script that displays it in a random order,

#!/usr/local/bin/python

import commands
import os
import random
import time

li = os.listdir('/home/Terry/GNUstep/Library/WindowMaker/Backgrounds/')

while (True):
    x=random.choice(li)
    commands.getoutput('/usr/local/bin/wmsetbg -u -s %s' % (x))
    time.sleep(600)


Hmm, I wonder if I could do this on Windows XP to,under explorer of course hehe.


Friday, December 7, 2007

Since it's impossible to work....I hit up newegg.com to experiment with a few ideas.

The PC I wish I could buy:

 1 * Thermaltake Armor Extreme Edition ATX Full Tower case ($180)
  ; drooling over the VA8004BNS !!!
 1 * 600W Thermaltake PSU ($130)
 1 * Intel Core 2 Duo E6600 or E67x0 2.4/2.66Ghz ($190-$240)
 1 * 1024MB DDR2 667Mhz (PC5300) ($22) ; Kingston preferred
 2 * SATA 250GB HDD ($160 total)
 1 * nVidia Geforce GPU (<=$130)
 1 * Turtle Beach RIVIERA Sound Card ($30) ; ALSA support :-)
 1 * 3.5" Floppy ($7 OEM / $20 retail)
 1 * DVD Burner ($45 retail)
 1 * CD || DVD Reader ($20 retail)
 1 * 10/100MB Ethernet NIC ($12 at the local shop ;-))
 1 * 104 Normal Keys KB ($20) ;  Logitech Access would be nice & cheaper
 1 * Wired Laser Mouse ($40)
 1 * 17" LCD Monitor, 4-5ms, No Widescreen! ($180-$200)

 Estimated Total: < $1350 depending on variables and RAM
  + Motherboard ($70-$120), any extra fans/cables
This is a much better PC then the one I am sitting, $1600 worth !!! And I supplied my own Mouse (replacement), Monitor, and had a Keyboard when I bought it. Although I do admit, a PC Desk and sound card was necessary to add to the pre-build... Hehe The system I had originally planned to build was about the same price range as this custom list but with less specs and a complete system minus the monitor and kb... bloody thing even had a UPS in the price factors! In the end, I ended up having my mother raising all freaking heck, to the point that I had to concede to *not* build my own, or she would really drive me crazy until I did F'up. To which I had my brother raising hell at the very idea (the family gamer), to which I ended up shopping for a pre-build to shut them both up (compromise of no DIY but higher specs) and got stiffed on the core factors... Rather then building my ideal 'personal' machine, I got stuffed into a Gateway Multi-Media PC that I didn't want. Over a year later, that PC I bought has been a royal pain in the neck, often needing coercion to get it to do what I want. It has repeatedly failed to work with most tested Linux Distro's without a lot of kicking, although it does love FreeBSD 6.x as long, the only good thing I can say :-) Instead of the GF6600 I had planned for the prebuilt came with a GF6200 (A real POS but still a major upgrade) and a TV Tuner; shitty PSU, funky BTX Mobo, and a signle 500GB drive Vs the good PSU, standard ATX Mobo, and Dual Seagate drives (1 for Windows, 1 for BSD). And a card reader which I can't use (no media) vs the Floppy drive I wanted so badly. The sound card I had to buy to get the pre-built working properly for my needs was a $80 reck, it is a major POS under Windows... But works great under Linux and FreeBSD, which is why I bought it haha. If I ever could have that level of cash for a PC again, I'd hit Fry's and build it from parts there..... Rather then letting my family have any say in the matter.. *sighs*, why did I have to be diplomatic instead of exercise my right to freedom?

GET ME THE **** OUT OF HERE !

I'm sitting here across the building...


Trying to build a working mockup of my main widget that'll handle searching ports for the entered string through the GUI and volia !


Family is driving me out of my fsck'ing mind.


Just for once in my life, I would love it if I didn't have to stay up to after 4 in the damn morning just to get stuff done because I can't be left alone during the afternoon !!!!!


Every one else asleep == I can get stuff done

Any one else awake == 75% less chance of being able to hear my brains internal dialogue, let along get work done (much lower chances).

What Do You Have To Say? - Ah, Youth

Describe one moment from your youth that is impenetrably seared into your memory.
Brought to you by HP
Live Journal: Writer's Block


Most of them are, good or bad, fun or horrible a like... My memory is just like that =/


A choice of one, would only be which one my brain recalls first.

Of dreams and actions

My dreams seem to have been plagued by the same things that often assail my mind....

Past today's have been a lot of work for me and I'm actualy very lucky to have today off work I spent a little time working with Pre Processor like program but didn't have time to get any thing done.


Today, I want to get back to work on NPM, I'm off (hopefully) till Tuesday so with luck I can get some work done!

Wednesday, December 5, 2007

Some where between merryment and torment, there lays the occasion =/


I'm definitally not looking forward to the holidays... but time stops for no man.


Not really in the mood for coding tonight, I'm tired.. Started work at like 0130 last night, finished and started reading about QT, then logged off for bed 'round 0400... And fell asleep after 0600 !!!

Looking over some of the first things I ever wrote programming wise. The creation dates are mostly november 2005 although the binary of dev-cpp is marked as feburary 2005 on my moms PC. To be honest, I have no real idea why I started learning programing =/ And it's been at least 2 years since day one with C++.


I probably decided, I'd been around PC's long enough and wanted to try taking it to the next level, maybe that is why... I don't really know but I am glad I did. I know what pushed me into the level of computer studies I have, was a little trip through the WWW in that direction and the fish, ehh spider was hooked. I think it was The Unix and Internet Fundamentals HOWTO that hooked me, I wanted to learn more.


It's December 2007 and I've come a long way. From a Windows XP user with no love of DOS. To practically living in a shell and thriving on *BSD systems. C++ I have not used in a long time, snored through Perl... nice tool but not my style. Java, from a book but never cared much for writing in it. C, because I wanted to see the differences between C++ and C, and what I found was a language I liked 10,000 * more lol. Always hated shell script... but came to value it as a great tool once I got used to it. Python and I didn't hit it off and Ruby I had scoffed at early on before I decided on C++ as my first language.

One day, out of boredom I sat down and said, "Ok I'm learning Ruby" and a love affair was bourne. For my current task, I've been cramming the Python and QT like a mad hatter!

HTML, I also muddled with fromtime to time but rarely used. Eventually, writing in XHTML kind of replaced my need for a word processor haha! I've also had a longing to learn Ada but have never had the time :@, Scheme syntactically I find a bit strange but I guess I'm not used to lisp like languages.


I wonder, where the next couple of years will lead me, GOD only knows.

Thinking...

A few concept drawings of what I have in mind

Style #1: simple interface (emphasis on searching and ease of performing common actions)

Free Image Hosting at www.ImageShack.us

Style #2: orthodox interface (commander like with toolbar, I like this one xD)
Free Image Hosting at www.ImageShack.us

Style #3: balanced interface (I think it would be better with the left being a |installed software | build messages | tab-thingy).

Free Image Hosting at www.ImageShack.us


Personally I think the first style is easier to use if your not familiar with what your doing, can you get more simple then 'search, click, click' with a big set of buttons?

The second I really like because I think it makes best use of space and presents the most important information quickly.

The third, I think is probably a better choice since it combines #1 and #2's ways of doing things into a fairly simple yet compact amount of space.



To be honest, I would kind of love docking / undocking elements and a very 'cool' look, like XFire or XMMS L&F with a Gimp or Designer style of operation but I think that would probably be a lot of work and a bit confusing to new people =/

Tuesday, December 4, 2007

searchlet prototypes

Oy'vey why does it have to be so easy to take a nap after chow with that dang couch =/

I suppose it is just as well that I'm finishing Dune tonight as I work because in this case the sleeper must awaken ;-)

I'm trying to finish work on a routine to search the ports tree and generate the necessary stuff for a widget to display. The next phase is to experiment with how signals and slots workout through Python. Then build a more complete 'searchlet' module that can be integrated once the rest of work on the GUI is done. When I get a chance I'll try to post a screen shot of the minimal searchlet in some portion of completion.


I'd also like to work on a few mock ups in designer or a few drawings in kolourpaint of possible configurations of the GUI.


edit:

I've basically finished the routine for searching the ports tree via psearch and getting it to display:

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


I think I've also figured out how to connect a C++ signal to a slot in the Python code but I'm still testing with that. The Signals & Slots mechanism is one thing that I do like a lot about QT. I've yet to use the Designer tool for any of this but for ease of use I probably will beyond test modules like the one pictured above.

I am using C++ documentation for most of this, so I am pretty dang glad that the best docs I've ever found in my time aroung computers has been the OpenBSD Manual, Vim's :help stuff, and Trolltechs excellent offerings on qt documentation through the assistant program and the WWW. I also love that konqueror has qt, qt3, kde, and kde3 time saving web shortcuts like the wp (wikipedia) one I use so often.

Sunday, December 2, 2007

Enter the Dragon

Well, so for work goes well for day one.

I've spent most of the day working on the configuration system, at this point it would be a lot easier to have a configuration file, so I set about to work with Pythons SafeConfigParser class and the format of the config file and options, e.t.c. There is still more to do but it is a great start, especially considering that I am not entirely comfortable with OOP under Python

I'd say greater then half the code for installing and updating the ports tree is done enough for further testing, the only issue right now is the reaction to errors sup'ing or portsnaping.

I am some what tempted to try and have a wrapper of sorts that will abstact the issue of using QT or KDE specifics but I don't think there would be any point. I need to dig deeper into the PyQT/PyKDE, QT, and KDE documentation soon so I can work more gui_error.py.

widets ? qt : kde;

It would be nice to use as many elements of the KDE bindings as possible, so it fits better with systems running KDE, yet it would also be nice to keep to the QT bindings more strongly so it is less tied to KDE.. In the end it will probably be which ever I'm more comfortable with.

My primary goals in the coming days is to finish the options and errors modules while I start work on the 'searchlet', which should handle searching through ports. Until a concreate mock-up can be made of the entire main window, I think I should keep the search stuff as far away from the rest of the program as I can.


Work on the searchlet as I call it, shouldn't be to hard to keep self-contained since I prefer to work on smaller pieces and properly prototype things when I can, I'm not a real fan of monolithic masses =\


Basically 7 tenths of that battle will be wrapping my head around working with the KListView and QListView widgets. Once I've figured that out, it'll be simple enough (I hope) to figureout how to make it work with displaying a search through ports. It's just I need to get a grip on the ListView widgets before I can do that lol.


Either way, I think I have done enough for one day... 0700 Zulu Time and it would probably be nice to have a little sleep before work tomorrow 0.o


A little horsing around before bed, not pretty but considering I don't know QT from a hole int he ground... And I'm doing this with C++ documentation for Python, I think it's a nice 'Hmm, how do you make a QListView object?" test:

#!/usr/bin/env python
# Neo Ports Manager (NPM) -- refer to the LICENSE file for terms and conditions

"""

"""
import sys, os
from qt import *


def main( argc, argv ):
    a=QApplication( argv )
    listViews=QListView()
    listViews.resize(640,480)
    listViews.setCaption("Qt Example - Listview") # Sets window title
    # Add some columns to the list view
    listViews.addColumn('Qualified name') 
    listViews.addColumn('Namespace')
    # element is how to create a new list view item for display
    element = QListViewItem(listViews, 'qName', 'namespaceURI') 
    # Now lets populate an array of items into view
    els=[ [listViews, 'dir1', 'descr1'], [listViews, 'dir2', 'descr2'],
          [listViews, 'dir3', 'descr3'] ]
    for j in els:
        QListViewItem(j[0], j[1], j[2])
    # And sort it descending by col 1
    listViews.setSorting( 1, False )


    a.setMainWidget(listViews)

    # draw & exec
    listViews.show()
    a.exec_loop()


if __name__ == "__main__":
    main(len(sys.argv), sys.argv)

I don't like that QListViewItem(j[0], j[1], j[2]) line but I was trying to translate from the C++,

for ( int i = 0 ; i < attributes.length(); i++ ) {
    new QListViewItem( element, attributes.qName(i), attributes.uri(i) );
}

And I've yet to figure out how to better cook this up, still reading the docs here...

Idiot spider

I am so stupid !!!

I'm sitting here working on a the configuration file stuff in my options class and BAM the laptop shuts down on me.


Battery firmly attached and not in use, laptops been on at least an hour and a half or more but it's still cool, no signs of blockages of ports and the fan was fine last I looked.


Rolled my chair around and made sure the power cable was in the socket check,

turned around to the other flank and saw that the light on the mobile surge protector was on, check, back to the poor laptop...


"Wait", I rolled back around and picked up the A/C Adopter and the surge protector/cable segment had come unplugged -- BINGO WE HAVE A WINNER !!!


I can't believe I've been sitting here using the battery the whole time, like a moron... But I am very glad that I save files often when editing and that vim keeps a swap file so I didn't lose any thing but the open tabs in knoqueror and the interipters history.

It would kind of suck to lose the entire projects files on day one =/


Saved by the editor... hehe

Saturday, December 1, 2007

backlog

This one made my day :-)

[15:11] [SAS]_LCpl_DUKE: Did you know: The Navy takes now only not-swimmers.
[15:11] [SAS]_RSM_Spidey01: ?
[15:11] [SAS]_LCpl_DUKE: Yeah, they defend the war-ships longer...
[15:11] [SAS]_RSM_Spidey01: LOL
[15:12] [SAS]_LCpl_DUKE: the newest joke i got 5 minutes ago... ;-)

I've been brushing up on Python for a little projectI've got in mind, so I've been cramming like a student at finals week. Python is a nice language but one I never put to use when I originally started learning it.

The thing I love the most about Python, is the doc strings, it's such a great idea if you ask me.

--- def test(params):
...     """ Simple test
...
...         More detailed info about it"""
...
...     print params
...
--- test.__doc__
' Simple test\n\t\n\t    More detailed info about it'

A poor example yes, but in actual usage the doc strings can be very useful. I also like it because it can be used to move inline-documentation (some times aka comments) into the body of the function, rather then being above it. And they are accessible at runtime with the __doc__ special method.

One thing I do wish Ruby had, is Doc Strings for methods, b/c then in IRB I could do a simple obj.methods.sort and follow up with checking a methods docstring rather then an intermixing of playful testing in IRB with looking it up in TFM.

With Python, it's quite easy to go to interactive mode and use dir(obj) to get the methods an object responds to and any available __doc__ special methods to learn more about it, before we go RTFM hehe.

Friday, November 30, 2007

Some how, I think if I was the type for it, I would be stone cold drunk tonight... but as it is, I am sober as a codfish =/ Getting lit never helped any thing and my Families history is enough that it is not a fond concept. Although I must admit, a nice mixture of wodka, rum, and a little lemon juice does sound like an interesting idea.. Oh well, a spider can think lol.


trying to see if I can get QT (and possibly KDE) bindings for Ruby installed, I've had no luck with qtruby yet but so far korundum-3.5.5 is doing good, hope I don't jinx it =/.


That's not why I feel like getting drunk though, but even if I was that kind of person I've got to much crap to get done then to worry about it.


It is strange, how being busy is a two edged sword, in that it does have it's advantages but it can be so damn exhausting some days !


damn, the build just blew, would be bloody nice if it would tell me *which* library is missing. Oh well, it's not important. Hmm, what else to work on...

Thursday, November 29, 2007

Funky dreams

From taking part in a commando raid on an out post, gone bad....


To being stuck on an Air Craft Carrier in the middle of a typhoon with a very Hot Blonde, and oh yeah how could I forget the dozens of goons with MP5's trying to steal the ship! Oh well, what is a little adventure on the high sea without a woman that can fight?


All the way to being first mate on a rather super natural pirate ship =\ Like a cross between the Pirates of the Caribbean and a dark rendition of a old Peter Pan fairy tail.


I must admit, some times I have some very strange dreams.. Normally though it usually involves me coding, playing, or 'taking a role in' a Video Game or crack-pot adventure of some sort lol.

A more normal string of dreams for me would include joining the Colonial Marines for a bug hunt with a trusty M41A Pulse Rifle in hand. Once I even dreamed of fighting a Queen Alien one on one afther they took over a school building and chased me down... good thing Predators can make acid proof knifes ;-)


I still remember one from many years ago though, rofl After fighting my way through 5y3 hive. I had signed a peace treaty ending the hostilities ... and the Queen Alien endpushed me out an airlock xD


I don't have nightmares but I do have the craziest dreams when I do get any +S

Wednesday, November 28, 2007

I've compiled all of my stored bookmarks (aside from the handfull on my laptop) into a single flat file...

One URL per line with a grand total of 662 lines.

Plenty are just enqueued to be read while others are perm storage.

Not bad for about 10 years of surfing =/


Now neatly redoing my bookmarks on ma.gnolia is the next big project of the day :'(.


And in the near future, properly using this for all my bookmarking needs.. lol.

Tuesday, November 27, 2007

Wasting time with the Euclidean Algorithm

The other night, I was very bored so... When I remembered reading about the Euclidean Algorithm on Wikipedia, which is a method of finding the greatest common denominator (gcd). I fed several implementations through ye ol'time(1) to get a rough idea of what differences they made.

At first I did it in Ruby and C for comparison, then I recompiled the *.c files with maximum optimization. Tonight I added a set of Java and Python files to the setup, I'll probably include Bourne Shell and Perl later for fun.


For any one interested,

C // no optimization
./iteration 0.00s user 0.00s system 50% cpu 0.003 total
./recursion 0.00s user 0.00s system 66% cpu 0.002 total
./original 0.00s user 0.00s system 57% cpu 0.003 total
Ruby
./iteration.rb 0.01s user 0.00s system 59% cpu 0.014 total
./recursion.rb 0.00s user 0.00s system 79% cpu 0.010 total
./original.rb 0.00s user 0.01s system 75% cpu 0.010 total
C // optimized, -O3
./iteration-o 0.00s user 0.00s system 48% cpu 0.003 total
./recursion-o 0.00s user 0.00s system 32% cpu 0.005 total
./original-o 0.00s user 0.00s system 37% cpu 0.004 total
Java
java EuclideanIteration 0.39s user 0.38s system 66% cpu 1.165 total
java EuclideanRecursion 0.48s user 0.30s system 72% cpu 1.066 total
java EuclideanOriginal 0.36s user 0.42s system 67% cpu 1.155 total
Python
./iteration.py 0.01s user 0.01s system 59% cpu 0.034 total
./recursion.py 0.01s user 0.01s system 65% cpu 0.032 total
./original.py 0.01s user 0.01s system 65% cpu 0.031 total

done with:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-freebsd6]
gcc version 3.4.6 [FreeBSD] 20060305
javac 1.5.0
Python 2.5.1

The C versions were the same sources but compiled with -O3 for the optimized
version.

I've assigned each outcome a score, 3 for what I feel is fastest, 2 for the intermediate (often close) and 1 for the worst and totalled it:

method  C RB C(-O3) Java Python Total
iteration 2 1 3 2 2 10
recursion 3 2 2 1 1 9
original 1 3 1 3 3 11

And the code, which I tried to keep similar. Also the gcd()/mygcd() routines were always implemented as a function because of the recursive version in the tests.

#include <stdio.h>

#define A 1071
#define B 1029

int
mygcd( int a, int b ) {
 int t = 0;
 while ( b != 0 ) {
  t = b;
  b = a % b;
  a = t;
 }
 return a;
}

int
main(void) {
 mygcd(A, B);
 return 0;
}


#include <stdio.h>

#define A 1071
#define B 1029

int
mygcd( int a, int b ) {
 if ( b == 0 ) {
  return a;
 } else {
  return mygcd( b, a%b );
 }
}

int
main(void) {
 mygcd(A, B);
 return 0;
}


#include <stdio.h>
#define A 1071
#define B 1029


int
mygcd( int a, int b ) {
 while ( b != 0 ) {
  if ( a > b ) {
   a = a-b;
  } else {
   b = b-a;
  }
 }
  return a;
}

int
main(void) {
 mygcd(A, B);
 return 0;
}

#!/usr/local/bin/ruby -w

def gcd(a, b)
  while b != 0
    t = b
    b = a % b
    a = t
  end
  return a

gcd( 1071, 1029 )
#!/usr/local/bin/ruby -w

def gcd(a,b)
  if b == 0
    return a
  else
    return gcd(b, a % b )
  end
end

gcd( 1071, 1029 )
#!/usr/local/bin/ruby -w

def gcd( a, b )
  while b != 0
    if a > b
      a = a - b
    else
      b = b - a
    end
  end
  return a
end

gcd( 1071, 1029 )

class EuclideanIteration {
 static final int A = 1071;
 static final int B = 1029;

 public static int
 mygcd( int a, int b ) {
  int t = 0;
  while ( b != 0 ) {
   t = b;
   b = a % b;
   a = t;
  }
  return a;
 }

 public static void
 main( String[] args ) {
  mygcd(A, B);
 }
}



class EuclideanRecursion {
 static final int A = 1071;
 static final int B = 1029;

 public static int
 mygcd( int a, int b ) {
  if ( b == 0 ) {
   return a;
  } else {
   return mygcd( b, a%b );
  }
 }


 public static void
 main( String[] args ) {
  mygcd(A, B);
 }
}


class EuclideanOriginal {
 static final int A = 1071;
 static final int B = 1029;

 public static int
 mygcd( int a, int b ) {
  while ( b != 0 ) {
   if ( a > b ) {
    a = a-b;
   } else {
    b = b-a;
   }
  }
   return a;
 }


 public static void
 main( String[] args ) {
  mygcd(A, B);
 }
}

#!/usr/local/bin/python

def mygcd(a, b):
    while b != 0:
        t = b
        b = a % b
        a = t
    return a


mygcd( 1071, 1029 )
#!/usr/local/bin/python

def mygcd( a, b ):
    if b == 0:
        return a
    else:
        return mygcd( b, a %b )


mygcd( 1071, 1029 )
#!/usr/local/bin/python

def mygcd( a, b ):
    while b != 0:
        if a > b:
            a = a-b
        else:
            b = b-a
    return a


mygcd( 1071, 1029 )