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

todo list

update http://sas-spidey01.livejournal.com/12253.html Vi user how-to

sync my bookmarks

An interesting Apple

Could this bring the power of the command line, to the GUI?

An interesting idea, I wonder how it works from a security and flexibility point of view.


One reason I enjoy the Unix Shell is it is very easy to solve problems with the vast and expandable workbench provided. And to automate various tasks quickly, not to mention many good programs are extensible/scriptable :-)

The only sad thing for new users of traditional unix-likes is that the interfaces are often different, such as Emacs Lisp Vs Vim Script, Various Shell scripting languages vs DOS/Windows batch files e.t.c. Although most of the best programs I've used do run on many different platforms hehe.

Sunday, November 25, 2007

daily fortune cookie

Nothing is faster than the speed of light.

To prove this to yourself, try opening the
refrigerator door before the light comes on.

To days date is: Mon Nov 26 04:24:21 UTC 2007
Terry@Dixie$                                                               4:41

That so reminds me of some thing Lake posted xD

Saturday, November 24, 2007

Dixie decked out

Since KateOS was a tad bit disappointing, I booted back into my PC-BSD v1.4 partition and set out to use Window Maker, by far my favorite window manager. I love the look and feel wmaker has but rarely have used it. The main reason I use PC-BSD, is I don't want to go through the bother of installing/upgrading KDE, given the time involved.... If I used FreeBSD, I'd probably use Window Maker instead of KDE lol.

Here is some initial work,

PC-BSD v1.4, running Window Maker 0.92.0
screen shot hosted on imageshack

I've installed docker to gain a system tray, which I have done with Blackbox in the past. And I've used wmclock which I find less obstrusive then the wmclockmon program I've used in the past. I might experiment with running Window Maker as KDE's window manager but I don't mind hacking up my menu hehe.

Play time

About 25:17 woth of downloading later I burnt the disk, install went great but Linux hangs during the boot :-(

I installed KateOS on my laptop using a spare storage partition. It works great aside from not auto-detecting my Atheros based PCMCIA card with the rest of my hardware. The default Desktop Environment is Xfce4, never used any of the Xfce's but it's a dandy GTK+ based one. I found it some one suprising that I had to create my own ~/.xinitrc to be able to log in through the GUI but it was as simple as coping roots to my home directory.

Surprisingly with the exception of Live CD's, I have never had a Linux Distro that just 'worked' with my hardware :\. I've always had to screw with them to get them work, even in Ubuntu when I tested 6.06 to try Gnome. Although I must admit having to rewrite Ubuntu's /etc/fstab was not as annoying as Debian and NetBSD telling me I have no hard drive xD

FreeBSD has always worked well for me, except on one laptop. Which I could swear should have been marketed as a 'Wintop' lol.

Maybe it's just a strange twist of fate, I generally get along with FreeBSD/OpenBSD more readidly and vice versa in terms of getting things done.

I must admit, I am tempted to either to use OpenBSD (for the first time with X11) or FreeBSD on the new system. Although I could probably roll my own Linux From Scratch but that's a tad more time consuming !

Friday, November 23, 2007

Update

Well, 10% of download complete in about 2 1/2 hours (two and a half)... Interesting although the download speed is only about 20~28kbyte/sec, it is generating enough network traffic that page loads are very slow, normally I can ping www.google.com and get a response average in the 48-62ms range, and maybe 150ms or so to my primary DNS server set by the ISP.

By contrary, the *US* mirror alone for KateOS pinged at > 400ms and still has a just as bad D/L rate, so since it would mean downloading 3 disks from them as they don't have a copy of the DVD ISO, there's no loss by a server from a far off place... But I've got to admit, if I had the $6... I would by the bloody disk instead of download it LOL.


As I do with many of my pre-planned operations, I've assigned this one a code name: Phoenix. Both because it will be raising an old cannabolized PC out of the ashes; and will probably end up either enflaming my rageometer or proving to be worth the trouble...


Here is part of my ~/phoenix.outline file, I've worked out a number of things so far. Software needed on the system once it's ready op, General goals of the overall plan, changes to Vectra, which PC gets what drive, Suggested file system schemes, estimated the probable cost ($95), since time can only be guessed at I factor that as a level of involvedness it will take to get changes done. I've also worked out a strnger concept of what each system will be doing. What follows is the tail end of my outline, pointing out the major placement alternitives. I think points 0 and 2 are best, 0 is annoying but probably the best solution given the terrain, although idea 2 is also a nice idea if I didn't have a fscking parakeet screaming my head off from morning to just before bed time -- No wonder they invented WORK !


Ideas:

| 0/ Remote Workstation {
| | Move either Vectra or Phoenix into my room and set the other up
| | in Vectra's current position (Living Room, my PC desk, lower
| | store point).

| | Set up Phoenix? to make use of xrdp server and access it from
| | Dixie, SAL1600, and also if necessary Josephine.

| | Pro's:
| | | Grants a *decent* working environment from my Desktop
| | | without forcing me to use the Cywgin provided x-server
| | | (also an option here, since it's installed on SAL1600).
| | | And without making me use my laptop for every thing.

| | | Takes best advantage of space, e.g. my Desktop (SAL1600) is
| | | the only place I can actually set up a PC to sit at and
| | | use comfortably, hence why my Laptop (Dixie) has been
| | | such a life saver, because I can sit in bed or at a
| | | regular table -- hole problem could be solved with an
| | | LCD Monitor, which I can't afford... Only have 2 CRT's
| | | in the 19 and 17 or 19 inch range.

| | | Further integrates remote access across the LAN, which
| | | is currently limited to all BSD boxes running OpenSSHs
| | | ssh daemon and all systems having SSH Clients installed.
| | | My Desktop having WinXP MCE's built in RDP capabilities
| | | and all other systems RDP Clients.
| | Con's:
| | | Lack of (me) testing RDP based operations for indented
| | | purposes, also no configuration experience with xrdp.

| | | The 'annoyance' of having to use my Desktop as a client
| | | to access another box for getting work done.

| | | Wireless adaptor must be supported by either Linux or
| | | OpenBSD, which could be a bit *hard* to confirm based on
| | | the local shops generic stockpiles.

| | | Due to the amount of local network traffic, it might be
| | | bet to setup the File Server with the Wireless instead
| | | of the Linux system.
| }

| 1/ Bedroom Work Platform {

| | Set up Phoenix? in my room with Wireless adapter,
| | possibly attempt to cannibalize Vectras CD-ROM drive so
| | that Vectra becomes reliant on Floppy disks only. Wish I
| | had a way to either give all systems a card reader or a
| | floppy drive... Would make life easier!

| | Pro's:
| | | Less disturbing of existing systems then other
| | | ideas.

| | | Gets me further away for
| | | disturbances/distractions

| | | Can use Monitor, Keyboard, and Mouse, as well as
| | | rest of PC physically rather then remotely

| | Con's:
| | | No decent working environment in my room to use
| | | a full size PC without purchasing either an LCD
| | | Monitor or setting up a /or another PC Desk in
| | | my room; I only have the one that SAL1600 and
| | | Vectra are hooked up to.

| | | I can hear my family  from at least 10 metres
| | | out side of the building! Let along every where
| | | inside of it.

| | | My laptop might get a lot less use, since most
| | | times I use my laptop it is in my bedroom.

| | | Any possible working environment I could arrange
| | | in my room is likely to be much less then
| | | comfortable for physically sitting at a PC
| | | without buying another PC Desk.

| | | Requires Wifi to be compatible with Linux.
| }

| 2/ Bedroom Game box {

| | Move SAL1600 into my room and swap the Ethernet NIC with
| | the Wireless Adapter.

| | Place Phoenix? in SAL1600's place in the living room

| | Pro's:

| | | Eases shopping for wireless adapter

| | | Moves my Gaming system away from most common
| | | 'interruptions'

| | | Better chance of hearing people on TeamSpeak !

| | | Limits potential for using my laptop less

| | Con's:

| | | No decent working environment in my room to use
| | | a full size PC without purchasing either an LCD
| | | Monitor or setting up a /or another PC Desk in
| | | my room; I only have the one that SAL1600 and
| | | Vectra are hooked up to.

| | | Any possible working environment I could arrange
| | | in my room is likely to be much less then
| | | comfortable for physically sitting at a PC
| | | without buying another PC Desk.

| | | With a work platform placed in the living room
| | | (in SAL1600's place), it would be even *HARDER*
| | | to get freaking work done.

| | | Being in my room on the game box would likely
| | | make it harder for Ma to call me when she needs
| | | things done.
| }

The braces denote folds and the pipes I inserted into the copy/paste so it displays as I see it in my text editor. I've configured vim to run a function when ever reading or writing a file with a .outline extension, the function sets settings that I find help write an outline and try to categorize my thoughts more clearly. This is actually how my vimrc file sets different style and other minor options to suit the language I am currently editing, for example a standard tab (visually equal to 8 spaces) when working with C files, and 2 actual spaces for Ruby, e.t.c.

The Pipes or '|' are not really in the file, they just show the tab-deliminated indentation. While I don't use this when editing source code, I find it works nice for things like this. Normally foldmethod is set to indent, and changed to 'syntax' where supported suitably. For outlining, since I didn't have time to work on a more suitable method of folding, I mearly set it use single braces and fdm=marker; usually it uses 3 braces but I rarely use the marker foldmethod.

Heres my function in vimrc:

function! My_OutlineMode()
 setl tabstop=8 shiftwidth=8 noexpandtab
 setl listchars =tab:\|\ " Mark \t's with |'s
 setl list
 setl spell
 setl autoindent smartindent
 setl showmatch matchtime=3
 setl matchpairs+=(:),{:},[:],<:>
 " Fold by tabs
 "setl foldmethod=expr
 "setl foldexpr=getline(v:lnum)[0]==\"\\t\"
 " Fold by braces
 setl foldmethod=marker
 setl foldmarker={,}
endfunction
autocmd BufNewFile,BufRead *.outline call My_OutlineMode()

Although it is probably unnecessary on most vim builds but the autocmd should probably be wrapped in an

if has("autocmd")
autocmd goes here
endif


hmm, supper time

distro ? unix : linux

Since it's time to plan for a probable addition to my LAN this December/January I want to start planning now.


I have my brothers old Dell 4500 PC on hand, well what is left of it hehe. The Pentium 4 is still there, which should be a Northwood core @ 2.0Ghz but it could possibly be a Willamette with a slower clock-speed, only a successful boot will tell.


Before I can boot her, I need some RAM. So the plan is to buy Ma a pair of 512MB (total 1GB) chips for her PC. And to take her old 2x256MB (total 512MB) for this salvage operation. The PC's are very close models and as far as I can tell the Mother Boards are the same chipset and as much research as I've had time to do shows that I shouldn't run into an problems here.


The box also needs a Networking card, because even if there was a way to get two 56K Winmodems chained together, I wouldn't want to LOL. I'm figuring that I'll try to buy a Wireless adopter or an Ethernet NIC depending on my final plan. One of these computers, my Desktop (SAL1600), File Server (Vectra), or this Dell 4500 I'm repairing will likely go in my bedroom with a Wifi card. While the other remain/swap into place with its/its swapped Ethernet card.


If I can, I'll probably leave it on 24/7 as a workstation or use it to transition my File Servers OpenBSD install over to better hardware. If I do make use of it as a Work system, I'd like to run GNU/Linux on it, because most of my experience has been with FreeBSD and OpenBSD. The problem with that is there are very few Linux Distros I can stand using.... Ether way I need to start planning and testing for what I'm going to do, and this damn blasted parakeet is not helping with the insensent squaking... After ~8 years or so, you'd think he'd STHU!


The only GNU/Linux distributions that I respect are Debian and Slackware. Debian, can be a bit of a hard case about things but you've got to give them credit to sticking to their guns. The differences between Debian's Iceweasel, Icedove, Iceowl, Iceape and Mozilla's Firefox, Thunderbird, Sunbird, and the communities SeaMonkey come to mind... Slackware, well hehe enough said. The only problem is they are both more trouble then they are worth in this case, I want to get the system set up but without having to screw with it to much along the way.


Other then Debian and Slackware, the only distro to interest me is Gentoo, I think if I ever put the effort into setting it up, Gentoo and I would get along very well. The only problem is I don't have time to fiddle with it. I would probably have to go with trying a Stage 1 install, and that is a little time consuming... Hehe.


Other Distros that I have considered are Ubuntu, I've tested Ubuntu when it was at 6.06 but I don't care for it. It is a nice system but I don't really 'dig' it. It's just not my cup of tea, although it's what I would recommend to users who just want an easy to use OS, without having to learn more then using Synaptic. One of my reasons for FreeBSD, is I wanted to learn about the underlaying system and it's complexity, not just write an E-Mail without having to tell it my POP3 server (for which no MUA can do, until they invent mind-reading ones). I have no interest in using Ubuntu on this system unless I *have* to.

The install is likely to be a cross between a server and a desktop as far as software goes, it will include X and a proper development environment either way. My OpenBSD box basically only has what it needs to run the services I use it for by comparison.


Two suggestions that came up were PLD Linux and KateOS, both from Poland. PLD looks like a nice system but not my style. I'm not found of the RPM's either... KateOS on the other hand is based on Slackware. So far it looks like a very nice system to my tastes, my plan is to test it on my desktop (SAL1600). Because I maintain my 'gaming' install of WinXP on it along with a dedicated Linux and BSD partition for testing purposes. I might even use KQEMU if it supports DVD ISO's.

It looks like a good system for me but no one told me that the Polish and US mirrors download at about 20~26kb/sec !!! Since I'd want at least 2 or 3 of the 3 CD sets... I figured I would get the DVD since I don't want to test the minimal install. There are also 2 'extension' disks, one for GNOME and one for KDE so one can skip installing them over the Internet. It's looking like an 11 hour download for my initial testing.... Joy.


I need to get to work on the planning for when I'll need to get the system working, so while KateOS 3.6 downloads I may as well get cracking, current factors are:

location
use/purpose
software
hardware
management
cost
time

I've yet to think of any thing else I need to do yet, the biggest issue is going to be location, most importantly what systems physically go where. And which system will be doing what.

Wednesday, November 21, 2007

New toy..

Managed to get some nice time off today, read some of the library books, watched Tron, Ghost Busters I, and Spaced Invaders, but most of all got to relax. I've also placed my VIMRC file into a cvs repository on my OpenBSD box, that should make syncing changes with my Desktop/Laptop easier, plus allow me to see what I've changed hehe.


Had an interesting idea and started playing with some Ruby today also.


Normally when I start a new program I make a new directory in ~/code/Lang/src/ and copy a template makefile over from ../../makefiles/ and edit it to my needs. In one of the library books, I found a GNU Makefile that essentially automates building a C/C++ program where by all C/C++ source files (subject to make handling the dependencies) are compiled into corresponding files and get linked together into the binary, nice little thing when you look at it. With a little tinkering it could probably be made semi-language independent but I don't really have time to dig into GNU Make's syntax and features to do that.

I've basically written makefiles in the past that should work with just about any ol'make program. For much the same reason I write shell scripts that should run on most any /bin/sh, because I don't want to edit the freaking thing if I ever meet a Unix like OS it won't run on lool.


The idea I had was a enlazynating program that by knowing a fair bit about a given languages normal build process (such as C, C++, and Java), it could then automate the process of building it without having to generate a makefile, kind of like a 'smart-makefile' of sorts. I've got a alias set in my shell so that gcc is called on the command line with my usual settings. I also tend to include a few more once the things done.


It's probably a stupid idea to do this, a decent BSD or GNU Makefile would likely serve much better (and be worth the learning of each ones extensions to make). But I rather like to be able to just 'have fun' playing with and testing stuff.


Right now, it seems to be able to handle a simple compile/link of files in one directory but needs some work to properly link files in subdir's, lots of other stuff to do. But working on it has been a good way to pass the time.


Currently I classify this as a toy rather then a program for serious usage. But if I ever finish it, I might use it just for the sake of keeping a fairly fast build/test cycle.


If I could, I would've made a machine to manage VHS-Tape/DVD-Disk changing but hey, I'm not an inventor when it comes to to building some thing out of thin air...


Here is what I've done over the past couple hours, it's not very good but it's a starting point for later play.

#!/usr/local/bin/ruby -w
# usage: make [opt] project [dir]
# TODO:
#   rdoc...
#   handle header files and linking properly in C
#   support more then C
#   implement a way to set lang opts/debug/profiler stuff correctly
#   reduce usage of $globals
#   clean up code... looks like sludge

require 'getoptlong'
require 'rdoc/usage'

$lang=nil
$project=''
$startdir=Dir.pwd
$debug=false
$profiler=false
$verbose=false

def main()

  opts = GetoptLong.new(
    [ '--help', '-h', GetoptLong::NO_ARGUMENT ],
    [ '--lang', '-l', GetoptLong::REQUIRED_ARGUMENT ],
    [ '--lang-opts', '-o', GetoptLong::REQUIRED_ARGUMENT ],
    [ '--debug', '-d', GetoptLong::OPTIONAL_ARGUMENT ],
    [ '--prof', '-p', GetoptLong::OPTIONAL_ARGUMENT ],
    [ '--clean', '-c', GetoptLong::NO_ARGUMENT ],
    [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ]
  )

  begin
    opts.each do |opt, arg|
      case opt
        when '--help'
          RDoc::usage()
        when '--lang'
          proc_lang( arg )
        when '--lang-opts'
          puts "#{arg} -> --lang-opts not implemented!"
        when '--debug'
          $debug = true
        when '--prof'
          $profiler = arg
        when '--verbose'
          $verbose=true
      end
    end

    if ARGV[0]
      $project = ARGV[0]
    end
    if ARGV[1]
      $startdir = ARGV[1]
    end
    puts ARGV #debug
    puts "\n\n"
    n=LangC.new()
    n.make()

    unless $lang
      $stderr.puts( 'WARNING: --lang not set!, defaulting to ISO C99' )
    end
 
    # call usage() on *any* error and print the problem
    rescue StandardError 
      puts( $! )
      RDoc::usage()

  end

end

def proc_lang( str )

  case str
    when 'c','C'
      # set up for C
      $lang=str
    when 'c++','cpp','C++','C++','cc','CC','cxx','CXX'
      # set up for C++
    when 'java','Java'
      # set up for Java
    when 'Perl','pl', 'plx'
      # Setup for Perl
    when 'Python','py'
      # Setup for Python
    when 'Ruby','rb'
      # set up for Ruby ;-)
  end
end

class Lang

  def make()
  end

  def each( startdir, &block )
    dp = Dir.open(startdir) do |dir|
      dir.each do |node|
        if node == '.' or node == '..' 
          next
        end
        p = File.expand_path( node, startdir )
        yield( p )
        if File.directory?( p )
          self.each( p, &block )
        end
      end
    end
  end

end # !class Lang


class LangC < Lang

  @@compiler  =   'gcc'
  @@cflags    =   "-Wall -Wpointer-arith -Wcast-qual -Wcast-align " +
                  "-Wconversion -Waggregate-return -Wstrict-prototypes " +
                  "-Wmissing-prototypes -Wmissing-declarations " +
                  "-Wredundant-decls -Winline -Wnested-externs " +
                  "-std=c99 -march=i686 -pipe "
  @@ldfags    =   nil
  @@debug     =   '-g'
  @@prof      =   nil
  @filelist = Array.new()

  # The very bloody boring constructor which serves only to override the
  # defaults for our static class variables.
  #
  def initialize( compiler=false, cflags=false, ldflags=false, 
                  debug=false, prof=false )

    if compiler then @@compiler = compiler end
    if cflags then @@cflags = cflags end
    if ldflags then @@ldfags = ldflags end
    if debug then @@debug = debug end
    if prof then @@prof = prof end
    @@ldflags=nil;@@prof=nil#debug

  end

  # Assemble project
  def make()

    @filelist = Array.new()
    self.compile()
    self.link()

  end

  # Walk the directory tree and compile all .c files into .o
  #
  def compile()

    $stdout.puts '------- COMPILING -------' if $verbose

    self.each( $startdir ) do |file|
      if file =~ /.*\.c$/ 
        p = file.to_s.gsub( File.extname(file),".o" )
        @filelist.push( p )
        # Don't compile unless the source is newer then the object files
        if File.exists?( p )
          next unless timecheck(file,p)
        end
          
        system( "#{@@compiler} #{@@cflags} #{@@debug} #{@@prof} " +
                      "#{file} -c -o #{p}" )
      end
    end
  end

  # Walk the directory tree and link all object files
  def link()

    $stdout.puts '------- LINKING -------' if $verbose

    @filelist.each do |obj|
      system( "#{@@compiler} #{@@cflags} #{@@ldflags} #{@@debug} " +
                    "#{@@prof} #{obj} -o #{$startdir}/#{$project}" )
    end
  end

  # Return true if first filename has a newer time stamp then the second
  #
  def timecheck( f1, f2 )
    File.mtime( f1 ) > File.mtime( f2 ) ? true : false
  end

end

if __FILE__ == $0
  main()
end

Operation: Sit on my Ass, starts.... NOW !!!

I got off wok early today, about 1400 local and home for lunch by 1445, hit the Forums over at www.sasclan.org, ate, and got my movies list ready... Taking the rest of the day off as a personal vacation/holiday.


Blog, radio, tv, food, code, books, e.t.c :-)


Raided my bookshelves bottom shelf for the VHS collection. We've got like 150-250 VHS tapes in the house but I've maintained only a small collection (20-40) in my room, so I know where to find them lol. We've taped just about every thing but watch almost none of it unless it's on TV HAHAHA ! It set off my nose but I've complied my watch list, probably will take me a few weeks but it's nice considering that I have not seen most of them in ages.

Links the the plot outlines on the Internet Movie Database (IMDB) for convenience.

Robot Jox
Indiana Jones and the Last Crusade
Dune -- A great book also
The Three Amigos
Dear GOD -- A goodie I found on late-tv years ago.
Mission Impossible
Legend of Drunken Master
Ghost Busters I and II
Ernest Goes to Jail
Jackie Chan's First Strike
The Freshmen
Tron
Hot Shots
Spaced Invaders
Hook
El Dorado

Not all of them are my favorites although a few are, they all are however good movies xD

Monday, November 19, 2007

Late night wise-cracks

"It's 5:50 a.m., Do you know where your stack pointer is?"

I saw this one and I couldn't help but smile :-)

Especially since if I get any decent edits done, it's usually after 0500 when I get to sleep.. and a fair bit of time using GDB hehehe.


"Programming is a lot like sex. One mistake and you could have to support it the rest of your life."

"You can't make a program without broken egos"

"There are two ways to write error-free programs; only the third one works. "

"You never finish a program, you just stop working on it."

Sunday, November 18, 2007

I started at ~1230, it's now ~1630 and I've gotton shit done...


You've just got to love my family....

Thursday, November 15, 2007

Ready to scream

The official rage list...

  • I'm f***ing tired of not being able to get stuff done in the afternoon.
  • I'm f***ing tired of being driven out of my skull.
  • I'm f***ing tired of having my train of thought derailed.
  • I'm f***ing tired of of being annoyed.
  • I'm f***ing tired of being interrupted.
  • I'm f***ing tired of not being able to concentrate.
  • I'm f***ing tired of being antagonised by computer-illiterate scum.
  • I'm f***ing tired of being barked, screeched, and shouted at.
  • I'm f***ing tired of having to live like this.
  • I'm f***ing tired of being tortured whenever I try to learn some thing.
  • I'm f***ing tired of having to stay up till 4am or later.
  • I'm f***ing tired of not being able to do f***ing any thing other wise.
  • I'm f***ing tired of watching my home work pile up.
  • I'm f***ing tired of not being able to rest when I'm *not* trying to do some f***ing thing.
  • I'm f***ing tired of being denied a chance to follow my goals.
  • I'm f***ing tired of this.
and I'm about ready to explode !!!


This mother f***ing rat ass sucking hell hole is pushing the limit. I've got over 4,500 pages to read -- and I'm going to start knocking the damn walls down if I have to, but I am FINISHING THESE f***ing BOOKS.


There is no where else to go to read, study, nap, or any damn other thing. And my family makes it very hard to do any of those.


That means either this house learns to live with my work load or face the consequences. I should fuk'n start evicting people by force.... Let them enjoy freezing their ass off outside for a few hours.. While I get things *DONE* for a change.


Why, just why can't I just once let myself be as cruel and vindictive as the rest... Instead of suffering aggravation after one another and hating that I feel like hating back...




Is it to much to ask to sit down and read a damn blasted book before I have to get back to work? I think not !!!!!!!!!!!!



I need a frigging vacation..... big time

Wednesday, November 14, 2007

Library takedown

The new reading list:


Maximum Security: A Hacker's Guide to Protecting Your Internet Site and Network -- I wonder what the last chapter I read was last time I checked it out hehe.

Upgrading and Repairing Servers -- I'd love to learn more and it's got some stuff that interests me a lot on the bare hardware-level.


Learning Java, Second Edition -- Useful because the book I own on Java was published ~1996.

The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference -- Probably will put me to sleep but is useful to have on hand, should I have time to read it.


Linux® Programming Bible -- Old (2000'ish I think) but worth a thumb through in case I learn any thing I missed from it. I think it even includes a basic unix shell in the code listing, which is nice because one of my projects was trying to implement a bare bones shell in ruby.



Not counting indexes, glossaries, or appendixes (one of which as A-D I think): There are 4746 pages in all !

Counting every books last page with a pg# on it, we have 5381 pages total !!!

Borg wars?

Far be it from me not to admit I have some crazy dreams... laugh out loud.


I dreamed that I was aboard a Sovereign class starship on escort duty in the middle of a bitter United Federation of Planets Vs Borg war.


Surrounded by a swarm of smaller borg scout-strike craft and most of the convoy assimilated. The Soverign class ship tried fighting off the swarm but it didn't do any good, just to many ships to keep remodulating our weapons to.


So the Captain ordered all power transfered from weapons to what was left of our forward shield grid...


And we chased down and rammed every last one of those little bastards head on at warp speed!


Using the reinforced frontal shields and the navigational deflector to take the brunt of the damage and the Structural Itegerty Field (SIF) to keep us in one piece... Crazist dang thing I've ever seen but it worked great haha! The littler ships were just to much smaller then us, that they couldn't hold up to the force of impact of such a massive force ;-)


The fictional-fact that most of what were left of the ships shield emitters would've been to damaged by heat build up beyond use if we tried that after duking it out in combat so hard... Is probably irrelivent as far as dreams go lol but still.



Hmm, maybe I should've skept reading star trek tech-manuals when I was little hehe.

Monday, November 12, 2007

Writer's Block: Current Favorites

Tell us your current favorite: book, movie, CD, video game.
Live Jorunal Writer's Block

Book:
The Thrawn Trilogy by Timothy Zahn, Mara Jade is definitely my favorite charactor in Star Wars and watching, uhh reading. The Thrawn Trilogy and Duology, my favorite parts are the relationship between Luke Skywalker and Mara Jade. Grand Admiral Thrawn is also one of a good example of a decent commander, especially for an imperial...
Movie:

I'd say I probably like to many movies to be able to honestly nail it on any specific one now. I generally enjoy Comedy, Science Fiction, and Action movies as well as Classics.


CD:

N/A, haven't boughten any CD's in ages, I don't really follow music... If I had money odds are it would go for a mixture of Country, Rock & Roll, and Metal....


Video Game:

SWAT3, the best of the best. I've yet to meet a better Tactical FPS Game then SWAT3. The net code blows but the game play is just freaking awesome

Saturday, November 10, 2007

“Betty Davis advised to know who your friends are and also know your enemies. When asked how one can identify ones enemies she said “anyone who interferes with your work”


I'm beginning to agree...

FreeBSD + Java?

How easy is it...


The JDK and JRE packages on the FreeBSD Foundation require the following to install and run correctly:

inputproto-1.4.2.1, javavmwrapper-2.3, kbproto-1.0.3, libICE-1.0.4,1, libSM-1.0.3,1, libX11-1.1.3,1, libXau-1.0.3_2, libXdmcp-1.0.2, libXext-1.0.3,1, libXi-1.1.3,1, libXp-1.0.0,1, libXt-1.0.5, libXtst-1.0.3, pkg-config-0.22, printproto-1.0.3, recordproto-1.13.2, xextproto-7.0.2, xproto-7.0.10_1, xtrans-1.0.4


If you run a Desktop based system with Xorg installed most of these are probably already there, on my laptop which has KDE 3.5.7 for the GUI all I had to do was install one package first:

pkg_add -r javavmwrapper

If you don't have a required package it will tell you what you need to install when you try to pkg_add Java. Most probably can be pkg_add -r'd unless you want to the ports.


I then went over to the FreeBSD Foundation website to download Java


If you only want to run Java programs, you will need the JRE (Java Runetime Environment) but if you wish to develop Java programs you'll require the JDK (Java Development Kit).


The packages currently are for FreeBSD 5.5/i386 and FreeBSD 6.1/i386 and amd64. Just download the one that matches your FreeBSD major branch and CPU Architecture. I fetched both JRE and JDK for FreeBSD 6.1/i386 which is about a 70MB download combined, my Laptop runs PC-BSD v1.4 so the underlaying system is FreeBSD 6.2-Stable, no problems so far.


You need to accept the license agreement to download and when you pkg_add, just scroll to the bottom and type 'yes' and press enter, you can probably use the shift+g command to jump to the bottom of the license.


I think because of the terms that the JRE/JDK were licensed for distro we've got to live with the manual download. Once you've got your packages downloaded, just do a :


pkg_add ./diablo-jdk-freebsd6.i386.1.5.0.07.01.tbz


of course replacing ./ with the path (if necessary) and the filename with the proper one. Tip: If you don't want to typo it, use tab completion in your shell. I usually just download things to /tmp and cd over to it. You also need to be root in order to run pkg_add with any possibility of success. Depending on ones shell a 'rehash' command might also be needed before the programs can be found in the command prompt.


which tells me that java and javac are working, and it passed the test of compiling a small test program and running it.

Friday, November 9, 2007

Vista gone loco, connection limits!

Windows Vista tcpip.sys Connection Limit Patch for Event ID 4226


I have officially lost any respect or regard for Microsoft Windows Vista and I've yet to have a chance to test the bloody thing.


My Windows XP machine has SP2 installed by the connection limit is returned to a extremely high level. Because I was getting some crap with being the only box to drop off the 'net connection, making that change had a noticable impovement for me. The difference between VISA versions shows it all to true, it's about the money.


Instead of doing some thing about it, they make a buck off it. What ever happened to passion ruling OS development? Not the dollar.....

Upgrades to be done

http://openbsd.org/faq/upgrade42.html


They just had to muck around with a major'ly used lib...

Wednesday, November 7, 2007

I'm exausted.... Tonights a night I feel like just sleeping, but I know then nothing would ever get done.... Thats how I end up staying up til around 0400 and having to be to work by 1000... After enough years it takes it's toll I guess.


I've broken out my old Java source book to see if it might be able to use it for a SAS project I'm working on.. I was figured I would just use Ruby and place the classified parts into a C Program. I can make the C program make very darn sure that it is "The" authorized ruby script that it passes information to. But then I remembered that there are ways of out witting that with Ruby. And just counting on end-users lack of technical exbertise would kinda be stupid, because other wise they could just have the info... Since my prefered way of doing it in C/C++ would require replacing the Ruby prototype with a C++/QT4 program, that means it would have to be under the GPL, a license I don't like but one I can live with (ISC and X/MIT licenses are more my style). I was planning on making as much of the code available as possible any way. But using a compiled language would just make it much safer and more effective, if I didn't need a program to call it and try and make it 'secure' enough, much easier to just do it all in one spot... And I think Java would make it easier b/c I'm used to C/C++ and probably know Java syntax better then C++, even if I'm about 9 years out dated in Java haha!



Hey..... if only Windows built in ftp client was worth a flying fuck... hehe

back to work

to get done:


finish release of SAS Skins v3 for S4:TSS and SAS Personal Uniforms v1 (with installers). -> TO NIGHT WOULD BE NICE.


Get screen shots of Element, 4-5 men, linear and column stacked.


Finish final edits on the SOP rewrites pending to be sent spamward to GCHQ.


Bagger Random until he's sent me GCHQ's edits to those that have been sent in.


Oh what joy grammer correction will be =/


post in T&T forum about RvS 'plan' day.


Schedule my S4 Training Session 'from hell' day hehe.

Tuesday, November 6, 2007

reading

Worry undermines the body, dulls the mind, and slows down thinking and learning. It adds to confusion, magnifies troubles, and causes you to imagine things which really do not exist. If you are worried about something, talk to your leader about it. He may be able to help solve the problem.


Now if that's not good advice to pray, I dunno what is hehe.

Sunday, November 4, 2007

Table of C keywords, by language standard


Traditional
auto
break
case
char
continue
default
do
double
else
extern
float
for
goto
if
int
long
register
return
short
sizeof
static
struct
switch
typedef
union
unsigned
while

C89 Standard
const
enum
signed
void
volatile

C99 Standard
_Bool
_Complex
_Imaginary
inline
restrict

Saturday, November 3, 2007

For the first time in a good while a good classic was on, Gone with the Wind. Although I've defintally snored through it enough times over the years, it's regarded as one of the greatest movies ever made.


I still find it hard to watch at times, I might not agree with every thing that has happened. I don't discriminate against any one, be it for race, creed, colour, or religion.. To me the difference between a White man and a Black man is only a matter of appaearence, you can tell them apart in a Line Up. Beyond that they are pretty much the same to me, they are both human beings and should be respected as such.

What else can I say of the South other then it is my home? I was born in the South, I live here and I work here. I'm proud to be an American and I love my home.


In the Civil War as in so many other places, so many wars, so many countries... The people of the south were made to feel results of war. The Union army burned, raped, and enough and many were ground into the dirt to ensure such a thing could never happen again. Thousands of men dead, sick, and dying, not even any thing left to ease the pain of those still alive... Most of the people starving and penniless with there families torn apart. People shouldn't be ground into dust, what good does it serve. All the more worse then because it was not a war between countries but between brothers.. One I feel that could have been settled without firing a single shot.


Even to Christ on the cross, it's never been enough for some people. Even without a war to fight, people can still be monstrous.


When the time came... It wasn't enough to nail him to a wooden cross and be done with it. They tortured Jesus beyond the bounds of torture until death could only be a release from the agony and pain... Is it not enough just to kill?


Man has both the ability for Good and for Evil, I think it is the choice of which do you seek that matters.


When the chance comes, will you do what you think is right or will you play to your own advantage at any cost?

+S

Hmmm.... learning the hardway.



lukeftp advantages over filesilla site manager.


You have to manually type information so you can't fuck it up unless you really fuck up.... lol.

Friday, November 2, 2007

0144, nothing to do.... can't sleep.... Brain cells anbsent minded for more interesting waters...


All I can thing of... but I guess it's not good to think of the past to much, not at the expense of the present any way.


Hmm, I wonder.....


*sigh*


Better to look towards the future I suppose..

Bushed

Finally time to rest...

Yesterday was probably to worst allergy day of my year, even for me it was pretty bad. I also had to work 2 shifts back to back.. Only 8 hours but in this business hours tend to be shorter but harder. I went through about 10-12 paper towels (what I use for a Kleenex) just during work.


Plus work today, 2 days chores including 6 mops to wash out, a live op (dang it, shot in the tookus again!), and I'm not even going to worry about my inbox...


TGIF


Time for some R&R, plan... Sit on my ass with a cup of Rooibos Tea and maybe fetch a game or two, unless I start restructuring my laptop early... hehe