Todo: Toolkit and Library madness

Examine for portability the following toolkits under these OSes: Windows NT, Mac OSX*, Unix-like.

*I sadly don’t have a Mac, although I would really love one. So a OSX binary of some form will have to pass.

GTK+ — C, C++, Perl, Python, Ruby, PHP, C#.NET (Java bindings also avail but seem to be gnome-centric)

Qt4 — C++, Perl, Python, Ruby, Java (C#.NET and PHP bindings seem to be questionable and only C++/Python and possibly Java bindings can be depended on).

WxWidgets — C++, Perl, Python, Ruby, Java, C#.NET

Swing and SWT would be considered if they were available under more languages !!!

Evaluate portable standard/add-on libraries to each language for the following capabilities:

String handling (they all do well in the language standard)
Regular Expressions (Only Perl and Ruby get this great imho)
XML Processing
Network programming — both sockets based API and protocol support (IMAP, POP, HTTP/S, FTP)
Database handling — must support MySQL, SQLite, and some form of flat file.
Basic compression and archive format support (e.g. tar; zip; gz; bz2; lzma)
Inter-Process Communication (IPC) methods and related process control (e.g. fork(), exec(), signal(), kill() type routine-families).
Ease of use and deployment

Goals:

Build up a standard frame work of toolkits/libraries/etc that are portable across both my general operating environment and the various languages I use

Attempt to standardize myself on few languages rather then rubber banding between various programming languages + sh/awk/sed/friends

Ensure full development environments are available to me under FreeBSD 7 and Windows NT 5.1 (e.g. I can code from either machine and not change tools)

At least one language for scripting/prototyping and one for more efficient execution when implemented in that language (e.g. 1 interpreted + 1 compiled)

and try to stay sane along the way without writing a few libraries in the process >_>

A busy day

I was busy trying to catch up a bit with GTK+, I set out to begin making tests of the various language bindings, starting with C++ and Windows; since I know they all work fine under FreeBSD and GNU/Linux. The first thing I did, was download the GTK Development Environment, which proved to be a disaster.

In allowing the installer to “Register Environment Variables”, the installed nuked my systems %PATH%. So I’ve had to reset it, one bit at time. To ‘shield’ it from any future assaults, I’ve split it up into other system environment variables that get sucked in. That should at least eep me from having to backup the registry… Once if ever, I actually manage to get the XP machine up to snuff again, I’ll need to take a proper backup of the system.

Spent a lot of my time today in training with Jonsi and Caern. First doing training with Jonsi, then dealing with Caern after tending to family business.

I’m omni tasking to the point, that I don’t even get to finish LJ Posts loool

Something that has been on my mind of late

DRAFT POST

I very much need to start standardizing myself on a smaller set of tools. Maybe tools is not the best choice of ord, o much as it is a question of languages and libraries. It’s actually kind of ironic, I really would like to learn several more languages (Ada, Fortran, C#, Erlang, and I never did wrap my head around Scheme).

C++

Pro’s:

can do low level stuff

can interface well with C code and libraries

Qt is natively C++ and supports everything I need it to run on (in Qt4 OSE hehe)

Fairly portable and standardized (at least much of the 1998 standard…) with several compilers available.

Mainly toolkits and frame works available, both native and from C.

Widely used and my first language

Con’s:

having to dig into lower level interfaces is very error prone when doing it with a headache the size of California.

Often not my first choice for building a prototype *quickly* but good for final implementation.

Java

Pro’s:

Inheritable portable between JVMs of the same implementation (e.g. Sun JVM for Win and Sun VM for Mac can run same code).

Simpler OOP syntax then C++, imho

The Swing GUI toolkit is fairly portable and SWT sufficiently supports the platforms I want to avoid skipping.

I like the way it handles exceptions, and usually like checked exceptions — when a class is designed appropriately.

It’s well defined if not perfectly standardized and compliant implementations are fairly common enough (Sun’s)

Wildly used and my third language.

Well documented (if a bit boring)

Con’s:

Everything is OOP….

I prefer native code to waiting on java to load

Requires a suitable runtime

Conventions expected by some tools can occasionally be irksome (to me)

C# (C Sharp)

Pro’s:

It’s not Java

It’s similar to Java/C++

Core elements are standardized

Less resistance to shooting oneself in the foot / doing stupid things then Java but not as much as C++.

Gtk#, the binding of GTK+ to C# is available on the platforms I care about.

Con’s:

Most C# applications are probably tied to Microsoft Windows implementation via .NET or through Gnome related interfaces

Requires a runtime (e.g. .NET, Mono, or Dot GNU)

Requires just enough learning of it’s differences from Java, for me to use it.

PHP5

Pro’s:

Portable and interpreted

Widely used across the WWW for server side scripting.

GTK+ bindings to PHP available and portable’ish

Simple language and member of the CBF.

The OOP increasingly resembles Java syntax and is just “enough” syntax to be useful without cramming.

Well documented

Con’s:

Local php.ini files can cause problems (how much can you assume?)

Needs a run time (php) of the right version (5)

php4/php5 is less common off web servers or developers systems

Python

Pro’s:

Great for writing prototypes

Several toolkits available that are fairly portable

Easy to work with and quit portable (and issues of portability well noted in the docs)

Large standard library

Implementations for the Java Virtual Machine and Microsoft .NET framework are available (if not as current as CPython) as well as the standard (C)Python implementation.

Con’s:

Requires a run time

I *hate* it’s handling of regular expressions after being so used to Perl…

It’s slower then native code

Interfacing with C /or C++ code can, uhh… Get interesting, from a portability perspective.

The program is the source

Ruby

Pro’s:

Handy pure OOP language

Great handling of regular expressions within the language itself, as opposed through importing an object oriented interface (i.e. as in Python/Java/C++)

Usually very “comfortable” to write.

Large standard library

Con’s:

It requires a run time and alternative compilers (e.g. xruby, ironpython) may be lacking in reliability or cause some features to be unavailable

The program is the source

Wishing Ruby 2 would come sooner….

Documentation can be irksome at times

It’s slower then native code and even slower then Python (Ruby 1.8.x)

Frustration factor := (3.14159265 ^ 2)*(1024^64)

Since it seems to be to much to ask, too be able to work on things in peace in this hell hole. I’ve closed my terminal for the time being.

What the hell do I have to do, in order to get work done? Buy a rat fucking shotgun and take hostages?! No wait, that wouldn’t work, my family doesn’t give a flying fuck about anyone else. I sat through a five and a half hour project meeting… and despite the insane length of the meeting. I should have had the first milestone completed the day after the meeting, instead fast forward almost two weeks…. The first phase of the damn thing isn’t even complete yet.

If I actually had decent conditions to work in, things would be COMPLETE by now. But no, my family can’t leave be alone to work in peace.

I think if I as about five years old again, I would wait for my family to be doing something…. Go take out a large pot from the kitchenand a pair of equally large wooden spoons. Then take a belt and make a sling for the pot (for ease of marching). And then walk back and forth across the room, banging the spoons on the pot while shouting

“Now whose working, now whose working”.

As absolutely childish as doing that would be, I think that is about the only thing my family would understand…. Without having to take very drastic measures to get the point across… (e.g. using pepper spray, a TASER, or even deadly force e.t.c.),

I fear, one day I’ll look back upon my memories of this place and cry, “Just another picture to burn”.

WWWeb nightmare from hell pages

I’ve just been through a waking semi-nightmare.

With the ISP change, my mothers had to deal with updating e-mail address across a number of accounts. It’s been weeks and the scheduling as finally sorted out for me to help deal with the various mailing lists and accounts from companies (adverts, news, sales papers, blah blah). All the time with me muttering how easy it should be for anyone to change such things, well guess what? I was blood wrong !!!!

Half of the mailing lists had to be unsubscribed and resubscribed, if there was a way to update it, the only practical means of doing so would be to e-mail the mailer program a ‘help’ message and see if it responds. Fluttering across the messages and the associated websites (where findable or Googlable) ranged from useless, to down right worthless. Some where actually pretty good, like the anti-virus data, figures they would make it simple ^_^. While others, it was just pitiful…. Hell on one — belonging to a fairly well known company in it’s category in fact. When submitting the form information, it through up an unhanded null pointer exception popup. Complete with a fucking stack trace and some paths data, for crying out fucking loud…. Showing any Joe blow submitting form data on the website, a bleeding stack trace!!!!

I’ve gone across numerics websites, ranging from looking nice to rather bloated. Aside from a bit of masturbation with JavaScript, the pages source code was the only decent thing about many of the websites I saw… Overall website usability was totally awful, like trying to back a tracker-trailer out of an outhouse without harming anything.

I know it takes a lot of work to make an attractive website, but geeze. How about actually making it a website worth visiting while ya at it fellas?

Am I finally surpised or just about to pass out?

Ok, now I really know that I’ve got to dig up a copy of the C++ standards (both 1998 and 2003) and run a personal sanity check or C++ has finally succeeded in shocking me. Tested each of these with g++ 4.2.1 using the -std=c++98 -pedantic switches for the sake of quickness.

    int f=true;
bool b=15; // 15 is demoted to 1
enum foo_t { ONE,TWO };
enum foo_t spam=ONE; // ok
enum foo_t ham=false; // error
enum foo_t eggs=1; // error

In C the enum would be little better then making a pair of preprocessor defines for 0 and 1 and ‘foo_t’ being much like an equivalent to a typedef to one of the common integer types. In C++ enums create new types, that’s nice because it actually forces you to use one of the enum values, making the last line of the example (assigning a foo_t an int) becomes an error in C++ rather then (likely) a typo in C.

That makes good sense to me and I like it, ok.

Most C implementations that I’ve seen that have a stdbool.h usually settles things as defining bool as an int either via reliance on typedef or the preprocessor, then defines true/false as 1/0. So there is really nothing to enforce a bool to equal anything else in common C, although I’ve never seen an undesired result… But in C++, bool is done as a fundamental type…. not an afterthought. So the thing I don’t understand is why restrict newly created enumerations to there sane values, shooting off a compiler error if something odd happens. But allow the built in booleans to be ‘almost’ automatically converted like regular numerics? (apparently similar to the usual promotion/demotion rules)

bool isSomething = false; // becomes 0
isSomething++; // becomes 1
isSomething -= 500; // strangely becomes 1
isSomething--; // is an error using this operator
isSomething = isSomething -1; // becomes 0

I find it rather odd that things seem to work this way, the only logical reason I could see for it is compatibility with those in a ‘#define true 1’ world. Personally I don’t have a problem with it, I just find it odd. Maybe if I nabbed a copy of the C++ standard it would make more sense. I’m familiar enough with reading the C standard (and enjoy it) but I’ve never managed to get a copy of the relevant C++ standards :. Heh, then again until recent months I haven’t really touched C++ in ages… But it has been encroaching on things I normally use C or Perl for doing.

Or maybe I just need some damn __SLEEP__

I spent about five and a half hours in a project meeting today. So maybe it is a good thing I didn’t have the second set of charts done… We did managed to settle on the important stuff needed before we could continue, along with a couple of good ideas coming from it. The only bad part was it took so dang long to complete lol.

Rockin’ and Rollin’

Spent most of my day working on a couple of flow charts for tomorrows project meeting. I really wish I had the time to setup a proper presentation but the most important stuff is ready. If all the concerned parties are on time, we should even get done fairly quickly I think. I’ve had concept work and test cases stuffed in my brain for the past 2 or 3 days but no real time to sit down and work it out. I think, if I see another flow chart, I am gonna kick something. I’ve found Dia quite nice for doing simple diagrams and charts, it’s enough like GIMP that the learning curve is almost null. It could do with a little more refinement in spots but hey, if it lets me get stuff done in a fraction of the time… I can put up with the stuff I don’t like (mainly to do with text operations).

I’m working on it in my spare time, after work, after [SAS] operations, and along side my own projects, so effective use of my time is a plus hehe.

Some good news in [SAS] finally hit, I’ve been waiting for awhile now… But it was well worth it, seems several great NCOs are leading the charge in the indicated direction. I’ve left the details to others, since the emphasis was on getting it “done” rather then doing it well, and I’m just the schmuck who will probably have to deal with any later maintenance lol. But at least it’s done….

Managed to get a little bit of RvS time in, I think my recent expedition into the SWAT4 server has thrown my movements off. In RvS, things tend to act very fast and chunky but in SWAT4 they tend to feel much smoother, if slow by comparison. I was rather surprised to have around accuracy rankings in the 60s of hit percentages. While I rarely miss in SWAT4, RvS requires more, should I say. “Shoot the fucker, shoot him again, and shoot’em some more” in order to combat latency and super tangos. RvS is nice in that 2 rounds will drop almost any enemy, if you can get the blasted hits to register cleanly over the network.

In the course of my days web surfing I found an interesting language, called erlang. It looks like it would be worth poking around, I just wish I had the time :-(. But I’m just to busy with other stuff and can’t offerd to “cram one more” language between my ears… Rubber banding between C, C++, PHP, Perl, and Bourne for a couple days is, uhh.. a bit odd :

I really do like to learn different languages, the only problem is time spent inhaling documentation and memorizing syntax / interfaces. Much of my thinking i fairly language independent, so I really don’t have trouble picking up other languages. Python for example took a couple of hours at the most and ~2 days of “play testing” it on light problems before I was comfortable using it on a more serious project. Although I do admit, when it comes to expressing ideas I do really draw upon what I know.

For expedience of expression and to actually be able to read it at a glance. I’ll often mangle English and common constructs together, forming a document local style of writing whatever pops up often. Basically writing it in a way that just lets me say what I need to remind myself of later, and read it quickly when I do have to look stuff up. I can usually read things at a fairly quick rate, my eyes scan it and break things down, parsing it into the elements I comprehend and working on the rest as I go along. So the strange code-lish style writing usually speeds things up, since my eyes can parse the flow of it more readily then a few extra paragraphs of contemporaneity English, which means I can also “home in” on the parts of interest and quickly discern what I need to read and what I can ignore when grepping my text.

Sometimes, I wonder if I’m just mad as a hatter lol.