Bracing against the wind  
www.documentroot.com  

Thursday, May 08, 2008

Perl Round Function

Yes, you can't find this easily on the web. What you get is people telling you to import posix, or do some wacky one-off thing that works half the time. This is the only solution you'll ever need... it should be a builtin.

# round to any decimal place
sub round {
my ($n,$d) = @_;
return int($n/(10**$d) + .5 * ($n <=> 0)) * (10**$d);
}

[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Useful Line for Quoting Shell Arguments

Safely pass "@*" to ssh without having to worry about the remote shell re-expanding variables.

qa=`perl -e 'for (@ARGV) {s/(["\\$])/\\\\$1/g; $_="\"$_\"";} print join(" ", @ARGV)' "$@"`
ssh remote-server "cd /some/where; do something; $qa"

Single quote version is safer, but is harder for me to read.

qa=`perl -e "for (@ARGV) {s/'/'\\\\\''/g; \\\$_=\"'\\\$_'\";} print join(' ', @ARGV);" "$@"`

[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Monday, May 05, 2008

Latest Barack Obama News, In My Opinion

In North Carolina, Republicans paid good money for an Obama attack ad, only 1 week before the primary. This meddling in the opposing party's election is an encouraging sign that can *only* mean that Republicans have decided that Hillary will be easier to beat. Meddling in another party's primary may or may not be seen as "ethical" or "fair game". But, IMO, NC voters should be smart enough not to be swayed.

Sure, the media is having a field-day with Obama's charismatic former pastor, and it's obvious that his radical sermons make great prime-time viewing. I have relatives in my family who would make Wright seem *boring*, and I'm sure Hillary's cocaine dealing brother in law, Roger Clinton won't turn up in the press, but it seems like white American's are "fixin' for a lynchin'" this year and just aren't ready for a President who grew up with controversial figures that they don't understand.

If Obama's pastor was a white conspiracy theorist, who talked about the 911 attacks being coordinated by the Bush-Bin Laden cartel (did you know there's Bin Laden airfield in Texas), we would have understood. Maybe some of us would have even been sympathetic. But, instead, he was a black conspiracy theorist. Ouch! When my white brother mails me a conspiracy video about depleted uranium exposure in the Iraq war, I can choose to think "harmless hobby" or "maybe there's something to it". But when I see Jeramiah Wright claiming that HIV could have been bioengineered as an assault of blacks and gays (yes, there's a gene that whites have gives them resistance and immunity to AIDS), I'm supposed to think "my god I can't vote for someone who hung out with this guy".

Sure, Hillary's mentor was Saul Alinsky, who was analogous to a secular, white Jeramiah Wright, a rabble rouser and conspiracy theorist from Chicago. But that actually gives her credibility among liberals... any news about that and Democratic voters would cheer.

The downturn in polls for Barack reflects white liberal America's misunderstanding of what Wright represents. He's a charismatic kook, but really, a lovable one... and among those who are struggling to get by in Bush's economy, he is one that is more to Obama's credit (in a political-street-cred sort of way) than to his disfavor.

Labels:


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Monday, April 28, 2008

Trip Insurance

We're going to Vancouver for a month. Any time we travel, and we plan on renting a car, we buy trip insurance.

Why? Because the collision insurance provided by car companies is usually very expensive, wheras the insurance provided by travel insurance agencies is cheap, just as good, and also covers any medical expenses, baggage delays, etc. IE: I save money, and I get full coverage.

We use InsureMyTrip.com (no, I don't get paid if you click on it). It's a model website for what medical insurance *should* look like ---- but doesn't. I don't understand how travel insurance for 1 month, which includes a half-million dollars in medical claims, is 8 time cheaper than regular medical insurance. Also, I don't understnad how any time we've made a claim (thrice, a damaged stroller and 2 foreign doctor's visits for my son), they pay, and pay quickly and without much fuss.

What I am sure of is that the medical insurance industry is extremely profitable, and is probably guilty of the biblical sin of usury.

Labels:


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Thursday, April 24, 2008

Costume Armor

I tried to cobble together all the reference material and information I had on making costume armor into a Squidoo lens. I guess we'll see how that works out.

Labels:


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Wednesday, March 12, 2008

Stop Biofuels Now!

US, UK and EU politicians, including Bush, Clinton, McCain and Obama, and their well-meaning activists are wrong in their promotion of biofuels. Biofuel subsidies have to stop as soon as possible. There is a global economic and environmental collapse that is being hastened by this self-serving agricultural lobby.
Instead.... try solar:
How can we justify continued advocacy for biofuels versus alternative energies like solar - which isn't damaging our planet?

More references on the damage caused by biofuels: Wikipedia , IHT

Labels: ,


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Tuesday, March 04, 2008

Canadaian Conservatives help Clinton

The sly contact made by conservative Canadian ministers with Barak Obama, and then the "accidental" leak of a memo to the associated press 2 days before the Ohio primary was far from an accident.

So now conservatives in Canada, pleased with "politics as usual", have chosen meddle in America's elections. And it worked. Clinton leaped on the bone offered by the Canadians and has been doing her best to smear Obama in Ohio.

The worst part is, though, that Obama's economic adviser fell for it.

Labels:


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Monday, February 25, 2008

Logo Maker

MkLogo allows you to generate an image of some text in any font chosen (or uploaded). The "effects" are essentially parameterized shell scripts of ImageMagick examples. I used CoolText for a lot of quick site logos, but I got tired of the "glitzy" styles. Fonts aren't all categorized yet. Maybe I should make them editable, see how that plays out. Don't ask me why I seem to need to get a new domain name every time I write a small program. Habit borne of dotcom days.

Labels: , ,


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Monday, February 18, 2008

FormLite instead of FormMail

Created a simple FormLite program for saving an HTML form to a database file in a generic way that should be portable to most systems. IE: Anyone can paste it into the cgi-bin dir of nearly any hosting provider. It allows data to be exported to excel or to an html table. This was a frequent request of friends, etc. There are probably other things out there like this, but it was fun to write.

Labels:


[View/Post Comments] [Digg] [Del.icio.us] [Stumble]

Home | Email me when this weblog updates: | View Archive

(C) 2002 Erik Aronesty/DocumentRoot.Com. Right to copy, without attribution, is given freely to anyone for any reason.


Listed on BlogShares | Bloghop: the best pretty good | Blogarama | Technorati | Blogwise