Note to self, don’t use GNU m4 on Win32

Bah, humbug !!!

the focal point of the entire operation is a suitable pre-processor.

The idea:

defined test substitution macros generated by front end for pre processor

template file that relies upon said macros

output to be generated from preprocessing the macros from in the template.

The problem?

Target platform: MicroShaft Windows NT 5.1 (XP)

At first I figured I would use the C Pre-Processor since MinGW is on the target box, along with several other development tools.

Then I remembered I have GNU utilities for Win32 installed on this machine. So I took a look and found that a port of GNU m4 v1.4 is installed. I learned enough of the m4 ‘macro’ language just for tasks like this but guess what!

m4.exe fails to expand all macros in the template file.

Being more then somewhat disappointed, I ssh’d into my OpenBSD machine and fed it through the m4 implementation it comes with (not GNU), and guess what?

That freaking works fine.

*unzips fly, pisses on m4.exe*

Odds are the 1.4.11 version of GNU m4 I have on FreeBSD installed from ports works, hell scripting OpenBSDs sed works for this task, let along custom perl !

So I’ve just used vim to quickly :%s/m4 defines/cpp defines and seem to have to use that in order to get it working. Nice, simple, and effective.

*grrrrr*

task list:

modify that module wiz wanted worked on 😉 — tonight

finish neo ports manager — on going

write article(s) for BSD Mag — weekend, ongoing

write front end for a pre-processor and template based idea for work. — now

Medics live op — tomorrow

work on kde4 — as soon as people let me

write specifications and carry out planning for project black widow — classified until further notice.

Ahh another late night…

Spent about a half hour adjusting last nights work to use a more snappy display. I’ve also gotten the rest of the module done except for the final output to file, since that connects to a module that doesn’t exist yet (note to self, create a dummy).

I’ve been spending a lot of time with C++ and Qt4 lately… I must say, it does grow on you! Although I do personally find Python and Ruby better suited for building prototypes but whatever works.

My heads telling me, I could stream roll a few more things that need trimmin’ but I know if I did that, I would either end up going to bed about the time I need to report for work or worse, end up using Dixie as a pillow >_>. So I guess I’ll have to do those the next night I work on this codebase, rather then tackle the next phase by then :

Sleeping with your head propped on a laptops keyboard is probably not comfortable!

Hence it’s bed time…

misc thoughts

Well some progress, aside from spending an embarrassing amount of time trying to find a problem starring me right in the face shouting “this is wrong you moron!”, I suppose exhaustion can do that…

To be perfectly honest I think one of my biggest problems is my multi-lingual nature when it comes to programming. In the past couple days, I’ve used Bourne (with best buddies SED & AWK of course), Perl, Ruby, PHP, and C++ for various tasks.

In a large way, a language is just pretty much a language to me, a standard syntax, types, and subroutines if you will. Generally I think about solving problems in a way that doesn’t really connect to a specific language. Sure I tend to write and think in a language of the moment but at the end of the day, the implementation is the language specific part — not the solution.

When it’s something that takes me a bit of thought, I usually write it done in a form of pseudo code that relates to how I read code.

Then start thinking about that, i.e. it’s behavior: I dislike needing debugging aids when a brain will suffice. Then I start thinking about how to implement it, which often tends to lead to what language I’ll be using if not already knee deep in it.

For example, when it comes to regular expressions I very, very greatly prefer Perl and Ruby for such tasks. Python in particular has always felt (to me) a bit chunky at regexes compared to Perl but to each their own methods. Heck, a lot of times a scratch and run Perl script is my way of testing regular expressions for things.

Tonight I needed to figure out how to process a programs output, I quickly found the QProcess class to be increasingly *annoying* so I threw it out in favor of popen() and the usual methods — works like a charm. Then took a quick sample of the programs output, wrote a perl script to handle the operations upon it that was needed.

Then used the QRegExp and QString classes to implement the program using those regular expressions: skipping the compile time frustrations and indexing issues. Then proceeded to expand it into something able to meet my required behavior, after checking enough scenarios to validate it (to me). Then tested that to make sure it still behaved properly and moved on to using it to work on the next problem.

I’ve been using C++ a lot lately, really odd because I mostly quit using it after picking up C and Ruby a couple years ago lol.

0400, time for bed… but first it’s snack time!!!

believe it or not but a few hours of working on the computer has a few side effects ^_^

Ahh… home from work.

The jobs about two times the size of our others but it wasn’t really as bad as I originally thought. That’s probably a good thing, now if only it was possible to get more work done when I’m not at work :

Between family and work I’m falling even further behind schedule !!!

Live Free or Die Hard

Great movie for the fourth time out 🙂

It’s like John McClane arguably has the worst luck of any character to ever grace the action flick scene. They send him to pick up a computer-noid and I’m thinking back to a scene in Mindnight Run when the bond guy tells him to whack’em over the head with a hose, toss’em in a bag, and drive back.

of course in McClanes case he gets shot at and almost blown up!

Live Free or Die Hard really depicts a horrible scenario for cyber terrorism. It’s utterly horrifying when you consider how much American society has become reliant on technological networks, satellites, quick como between emergency services, geeze.

Still, it was some fine stuff at work hehe. The traffic jam in the tunnel, ramming a car into a helicopter because he’s pissed off and out of bullets! Smashing through a building in an SUV, into the terrorist chick, and down an elevator shaft after being chucked out a window. A joint Strike Fighter trying to swat his stolen terro-big rig on the highway haha.

The ending, I just couldn’t help be chuckle through it between how they finally took out Thomas Gabriel -> must’ve known plenty about computers but jack crap about geometry and physics when it involves bullets hehe. Not to mention the ending before they all end up on the way to a hospital >_>

****spoiler warning****

Thomas Gabriel: On your tombstone it should say “Always in the wrong place at the wrong time”.
John McClane: How about “Yippi-kay-ay, motherfu – “

[ later ]

Lucy McClane: Daddy, you’re out of your mind.
John McClane: What’re you talkin’ about?
Lucy McClane: You shot yourself!
John McClane: [groaning] It seemed like a good idea at the time.

*** end spoiler warning ***

Honestly, it’s like if John McClane ever took a vacation and let “someone else” handle it, he would probably end up sitting on a beach somewhere sipping a margarita and then terrorists pour in with machine guns -> it could only happen to him! lol

You could say, he really is always in the wrong place at the right time 😉

Happy trails.

Speed Learning — m4

Was on my way to bed (read sitting in front of my laptop <_<) and caught The One on TV just 10 minutes into it. I had seen part of it before but never got to see the second half 🙁

Now in search of something else to watch, I noticed that Live Free or Die Hard starts in at 0140Q, it’s currently 0112Q — so…

Early today I found out that the m4 macro language processor is not a ‘GNU Thing’ although GNU m4 is used as part of the gnu tool chain. Since it’s a language dating back to the 1970s and I could rather use something like m4 from the looks of it.

Let’s see how much I can learn from FreeBSDs m4 manual page before the movie starts hehe 🙂

Tick tock

Courtesy of the Red, White and Blue

One song on yee old favorite radio station that I felt was aptly appropriate today:

American girls and American guys, will always stand up and salute.
We’ll always recognize, when we see ol’ glory flying,
There’s a lot of men dead,
So we can sleep in peace at night when we lay down our heads.
My daddy served in the army where he lost his right eye,
But he flew a flag out in our yard ’til the day that he died.
He wanted my mother, my brother, my sister and me.
To grow up and live happy in the land of the free.

Now this nation that I love is fallin’ under attack.
A mighty sucker-punch came flying in from somewhere in the back.
Soon as we could see clearly through our big black eye,
Man, we lit up your world like the fourth of July.

Hey, Uncle Sam put your name at the top of his list,
And the Statue of Liberty started shaking her fist.
And the eagle will fly and it’s gonna be hell,
When you hear Mother Freedom start ringing her bell.
And it’ll feel like the whole wide world is raining down on you.
Ah, brought to you, courtesy of the red, white and blue.

Oh, justice will be served and the battle will rage:
This big dog will fight when you rattle his cage.
An’ you’ll be sorry that you messed with the U.S. of A.
‘Cos we’ll put a boot in your ass, it’s the American way.

Hey, Uncle Sam put your name at the top of his list,
And the Statue of Liberty started shaking her fist.
And the eagle will fly and it’s gonna be hell,
When you hear Mother Freedom start ringing her bell.
And it’ll feel like the whole wide world is raining down on you.
Ah, brought to you, courtesy of the red, white and blue.

Oh, oh.
Of the red, white and blue.
Oh, hey, oh.
Of my Red, White and Blue.

— Courtesy of the Red, White and Blue., Keith Toby

They also had a lot of Johnny Cash tunes on hehe 😉

On the war path…

The !%*)Y!)% !(%Y)! %)! %)! %)&! (%() !@%!#@!% !%! !!!

I’m sitting here working on C++/Qt4 code and my music is cutting in/out and vim starts to lag. Ok, I figure it is either some process gone wachko eating system resources (which top suggested was not the case) or the router is going fuckers again.

Sure enough, everything relating to my network shares hangs -> I do a power cycle on the AP with no luck. Full reboot and still arguing…

pinging my ap gives < 2ms to > 200ms responses and an apparent average of 20-40% package loss +/- an extra 5-7% and things are still getting rat fucked here. One test, standing right next to the aerials I was getting upwards of 10-15% packet loss for crying out fucking loud.

I’m so going to kill something when I get to the bottom of this….

This level of connectivity starvation is proving to be lethal to the whole write/compile/test cycle, hell even the web browser is dying a laggy death trying to write in this text area. Which means I’m likely to loose the nights work.

That means, if I find the source of this interference, which appears to be costing me over 4 hours of optimal work time remaining on this code base…. there will be a Spidey on the war path — hardware or neighborer related.