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 =/

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.

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

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

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…

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

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.

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 )

A good movie tonight, Night at the Museum. Ma likes to watch new movies but interestingly she never likes them rofl.

I enjoyed it though, much like Eight Legged Freaks it is a good movie to just sit back and let go.

S’no greatest movie ever made but still fun. Even more so for me because I love history! And the Museum of Natural History is probably the only reason I could think to visit New York other then to see the Statue of Liberty. The T-Rex on display, ohh baby would I love to get to see that. Paleontology is a field I would love to be closer to, it has always been very interesting to me, ever since I was a kid. But I don’t think my memory is good enough to even consider such a thing lol.

What I like is it is a family movie, think about it. Whats the best way to watch a film? With Family or with Friends or better yet both !!!