This is not a blog. So sue me!

Crikey, things are looking up!

Tuesday, October 28, 2008

Flash and Subversion backups: Batch file to copy files excluding certain files

One thing about Flash (or any non-text binary type files) and Subversion, if you check your flas and swfs into a subversion library that is regularly backed up, for example nightly, you will soon be using a huge amount of space.

So the inestimable James (who's price is above that of rubies) found that our main code SVN library was not being backed up ...eek!

When he turned on backups in a reasonable schedule, well, we were checking in flas and swf several times in a day and these copies were all being stored in SVN as binary blobs or something, leading to a huge volume of backup files.

Our solution: Create a new SVN library just for Flash code, and don't bother backing it up except once per month. When we have code completed for the daily build we just drop swfs into the code build folder SVN. When we have significant code changes (finish an app, get ready for the weekly QA build)  we drop everything from our new SVN into the traditional place.

To help this, we have this little batch file to copy from the new SVN to the old one:


rem put the ".svn" string and the filename excludefile.txt into the file of things to be ignored
echo ".svn" > excludefile.txt
echo excludefile.txt >> excludefile.txt

rem copy all files in all subdirectories, excluding those with .svn in the path

XCOPY /S /E /EXCLUDE:excludefile.txt "C:\projects\binaryDoc\studentui" 

"C:\projects\current\trunk\autoskill\academy\modules\ui\app\src\web\studentui" /Y

rem remove the excludefile
del excludefile.txt

Monday, October 27, 2008

What's next?

I swore I wouldn't put any political stuff here but there comes a point.
What happened to rational discourse? Reasoned debate? Issues?

All we have now is the hate-filled public arena with blood'n'sawdust on the floor and circling hyenas.

...and they complain that there is a campaign of hate against one candidate. Here's another:

It's a Sarah Palin blow up sex-doll. I mean, I think she's unsuitable as a VP, but it's not my call. Lots of folly of that kind in the past...Dan Quayle, for example. However, we don't create a sex doll of Dan Quayle do we? (God I hope not).

This is the kind of ad hominen-plus-extras that women in public life have to handle. Sure I disagreed with Margaret Thatcher and hated her policies, but the idea that people would make a rapeable image of someone like this is terrible and terrifying. And before any of you tell me it's just a joke: I say "Drop dead."

Some Americans have always been good at demonizing individuals, as if that somehow takes the hard work out of foreign relations or politics. I distinctly remember my first visit to a U.S. gun shop (not what you think, I bought a pen-knife). The owner had posters in the form of rifle targets of Colonel Ghadafi the Libyan dictator on the wall. I exclaimed about this and he thought I was complimenting him on his taste. He said: "If only I could get my hands on some of that (expletive) Noriega*, I'd make a fortune!"

Then it was Saddam Hussein, now it's Osama bin Laden.

And on the domestic political side it was Nixon. Carter. And getting nastier, Obama. And Palin. I haven't made a study of this, it's just the things I see as a frequent visitor who lives a half kilometre from the U.S.

It's so easy. Black hats, white hats. Us, them. They hate us because we're good. Why do they hate us? God loves us. We're the best country in the world. I am right. You are wrong and I'll do you an injury because I hate you. God hates you.

Sorry monkeys. At best God doesn't exist. Although perhaps on current evidence I'd say the chances are that she does and she's a Trickster or possibly a cat.

* - Manuel Noriega then the leader of Panama, shortly before the U.S. invasion. I seem to think he's out of prison now.

Sorry but he still sucks

My oppo sent me this: Neal Stephenson lecture on Sf as a literary genre

So my response is:
OK, well he isn't stupid. And most of what he says is sort-of truthy, at least worthy of an argument. Now you started it; since I spent 38:45 listening to his talk, you're gonna get the full 5 minutes.

He's very centred in his time and place, don't you think? I mean we were just talking about Fred Hoyle and John Wyndham (and there are loads of others*, not just Brits) who were very smart, wrote well and published compelling, yes, literature, 45+ years ago. (Not to mention Jules Verne or H.G. Wells).

Just because he didn't know about a bunch of stuff, it doesn't exist? It's like knowing the Rolling Stones and then realizing they were ripping off a bunch of poor black people.

My main beef with Quicksilver is that it is badly written, or badly edited (it's hard to tell the diff), predictable and was obviously written as a potboiler. It led me basically nowhere (except perhaps to set the scene attempting to force me to buy the next door-step of a book). It is appallingly Ameri-centric (the Crypto-thing is more so, according to Don). I would argue that even Heinlein was more honest in his idea porn. The protagonist as the super-hero is exactly what Quicksilver has. At the end of it I didn't care if the character lived or died, which is a good measure of how involved I was.

However, like I said before, he does have a few nice turns of phrase ("idea porn" being one of them, guilty, compelling pleasures of what might be, right?) I just wish he hadn't become so vastly popular before he became a better writer. If you say his earlier books are good, then I might give it a try.

If you haven't read the Da Vinci Code, you should before you slag it. It's crap but it is popular for a reason and it is quite well-written**.

And I have read one Hairy Potter book and seen one movie. No more, but I now know what I'm bleating about.

Now come back when you're ready for the full half-hour.


* All probably contemporary with Heinlein, far better writers and more typical of the best sf writing of the time:

Samuel R. Delaney,
Doris Lessing,
Harry Harrison (well perhaps not exactly contemporary, but I like it)
Philip K. Dick,
J.G. Ballard,
Ursula K. Le Guin,
Issac Asimov,
Brian Aldiss,
Ray Bradbury.

p.s. “This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction."
John Wyndham

** Update: OK, I lied. But it WAS a dark and stormy night!

Penis enlargement is still drooping off

Time for my quarterly review of the world o' spam, from the worms eye-view anyway.

It is my sad duty to report that the comfortable world of P.E. spam has dropped into the single percentage digits in my in-box. Sad but true. Those mellifluous phrases lovingly crafted to set my heart a flutter ("love cannon", fer sure) are being drowned out by mechanistic appeals to buy chemicals on-line with names that have too many x's and z's in them.

There was one little prick of light in the darkness, dear readers: "Get a magic wand to satisfy your lady!" Isn't that nice? Will surely warm the cockles of your kidneys...

Anyhoo, back to the harsh realites of spam watching.

We have now got a profile like this:
56% - Pharma spam*
12% - Posh watch replicas
10% - Girls hot 4 u**
6% - Gambling
4% - P.E. (Oh, how the mighty are fallen! Don't worry dear, these things happen.)
4% - Diplomas granted without study (excluding M.A. Oxon)
2% - Puzzling discount offers, including "exclisive atches" Silly me.
1% - Lame attempts to mimic internet sales confirmations
1% - Peculiar courses: a very promising new category ***
1% - Diet drugs: also promising new category
1% - Twitter spam****

* - does include a lot of Viagra-type stuff, but not nearly so poetic as good old P.E.

** - this is just silly; "I am beautiful girl, I am charming blue-eyed blonde brunette..." WTF, which bit is blonde and which is brunette, m'dear? (Er...perhaps, on second thoughts I'd rather not know). And why are you so hot for an ol' trout like me? I'm not even bi, sweetie.

*** - Ah, for future reference, you saw it here first. A "Christian college network" (sic) offering courses under the banner "Christian careers are right around the corner, learn on-line..." Somehow it seems unethical to offer no-study courses to Christians, poor dears. However, the meek don't get much so perhaps it is nice after all, purely as an example of loser-chic-appeal. Unfortunately the profile, addresses etc. are identical to the offers of "Insurance for Less" and "Culinary Universities" not to mention "Plasma TV Testing Center". So presumably if I were a halfwit, I'd like to let them to give me a plasma TV for free as well.

**** - sigh, I should never have signed up, twit, but this was from a person called blondesHot4u so it's not entirely a waste.

On second thoughts another prediction...we should see increasing spam in the next while to do with the mortgage crisis, bankruptcy, stock market decline and property capital losses, apart for the normal sub-one-percent perennial "make money fast" category. After all spam is nothing if not topical.

One final tip to the P.E. fellas. Chin up chaps. Just buckle down, straighten up and fly right. Increase your visibility, improve your productivity and the world will be your oyster...or should that be clam?

Wednesday, October 15, 2008

ActionScript 2; replace string any number of times

The cheeseparing number of useful String class methods released by Adobe leaves something for the programmer to do. Here is a replace function that will replace a substring within another string any number of times. It starts at the first occurrence.

// replace findThis string from stringIn with replaceWith, repeat number of times
//repeat must be >=1, anything else it will do 1 repeat anyway
// if the string doesn't occur nothing will happen

public static function replaceString(stringIn:String, findThis:String, replaceWith:String, repeat:Number):String {

var stringOut:String = '';
var tempArr:Array;
tempArr = stringIn.split(findThis); //spilt the string into an array based on the occurrences of the target string
stringOut = tempArr[0]; //get the first split item
for (var i=1;i < tempArr.length;i++){
if (i < repeat+1){
stringOut = stringOut + replaceWith + tempArr[i];// replace the next occurrence and add the next split item
else {
stringOut = stringOut + findThis + tempArr[i];// restore the rest of the string as it was
trace("String in: " + stringIn + " String out: " + stringOut);
return stringOut;


St Lawrence Rowing

Test content from SLRC