Bjorn Tipling

unapologetically uninformed, unthoughtful and unimaginative

Archive for September, 2008

Scons Scanner for Dojo

Comments

Omg! It’s not a post about something political! :o

Anyhow, I wrote a Scons Scanner for Dojo.

Scons is a python based build tool like Make and Ant, only it rocks and those others suck. A scanner is a neat feature of scons that allows you to create a way to follow #include foo.h like statements that Scons doesn’t understand, like Dojo’s dojo.require(”foo.js”); to create a list of dependencies. The list of files scanned will be examined for changes and if a change has been found it will trigger a build. Dojo is a JavaScript framework like prototype or JQuery only it rocks and those others suck.

I am making this scanner available to you at the low low cost of free! With an MIT License.

Here it be (I assume an understanding of Scons):

import re
import os

include_re = re.compile(r'^dojo.require\("(.*)"\).*$', re.M)

cwd = os.getcwd()

def DojoScan(node, env, path):
  contents = node.get_contents()
  includes = include_re.findall(contents)
  return [env.File("%s/%s" % (cwd,"/".join(n.split(".")) + ".js")) for n in includes]

scan = env.Scanner(function=DojoScan, skeys=['.js'], recursive=True)
env.Append(SCANNERS = scan)



Note this wont yet detect changes in Dijit templates. :/
My implementation as a Sconscript file in a js directory that has dojo, dijit, etc:

import re
import os

Import('env')

include_re = re.compile(r'^dojo.require\("(.*)"\).*$', re.M)

cwd = os.getcwd()

def DojoScan(node, env, path):
  contents = node.get_contents()
  includes = include_re.findall(contents)
  return [env.File("%s/%s" % (cwd,"/".join(n.split(".")) + ".js")) for n in includes]

def JSMin(target, source, env):
  cwd = os.getcwd()
  os.chdir("static/js/util/buildscripts")
  cmd_ = "./build.sh profile=karmerd action=release"
  r = os.system(cmd_)
  os.chdir(cwd)
  return r

minifier = Builder(action = JSMin, src_suffix=".js", suffix=".js")
env.Append(BUILDERS = {'JSMinifier' : minifier})
scan = env.Scanner(function=DojoScan, skeys=['.js'], recursive=True)
env.Append(SCANNERS = scan)
JSBuild = env.JSMinifier(env.File("release/dojo/karmerd/karmerd.js"), env.File("karmerd/karmerd.js"))
env.Depends(JSBuild, env.Glob("karmerd/templates/*.html"))
env.Install("%s/%s" % (env["releaseDir"],"static/js/karmerd/"), JSBuild)
dojo = env.InstallAs(target = "%s/%s" % (env["releaseDir"],"static/js/dojo/dojo.js"), source=env.File("release/dojo/dojo/dojo.js"))
resources = env.Command(env.Dir("%s/%s" % (env["releaseDir"], "static/js/dojo/resources")), env.Dir("release/dojo/dojo/resources"), [Delete('$TARGET'),Copy('$TARGET','$SOURCE')])
env.Depends(dojo, JSBuild)
env.Depends(resources, dojo)

Updated:
Updated my implementation to include a dijit template directory and an installation of dojo’s resources directory. It still doesn’t trigger a build if Dijit templates in Dojo’s trunk are modified. I will investigate that some more.

Written by Bjorn

September 25th, 2008 at 6:56 pm

Posted in programming, python

Tagged with ,

Wall Street Lobbyists say Executive Salary Caps Would Hurt the Economy

Comments

Yah. They said that.

… Wall Street, its lobbyists and trade groups are waging a feverish lobbying campaign to try to fight compensation curbs. Pay restrictions, they say, would sap incentives to hard work and innovation, and hurt the financial sector and the American economy.

I know something that might hurt the economy: incompetent executives who get paid millions for unimaginable levels of failure, failure such that government money must be used to bail them out of the poor fucking mess they got themselves into. W T F. An entry level janitor adds more to the economy than those idiots.

Written by Bjorn

September 23rd, 2008 at 8:08 pm

Posted in opinion

Tagged with

McFannie: McCain needs a new line of attack against Obama

Comments

Because the ‘ol “advised by Fannie Mae crooks” one no longer works since the New York Times reveals that McCain’s own advisor’s firm was receiving $15,000 a month from Fannie Mae for about three years for the sole reason that he worked for McCain, a presidential candidate. Yeah.

Time to for Tucker Bounds to shut his big stupid mouth.

Written by Bjorn

September 23rd, 2008 at 5:29 pm

Posted in news, opinion

NYTimes adds TimesPeople with social networking features

Comments

Opened the New York Times today and noticed a new white bar at the top of the screen that follows whenever you scroll. I thought it was some new unfortunate advertising gimmick, but instead it turned out to be TimesPeople, a new social networking feature. You can recommend stories, share, and also add and follow people similar to Twitter. I think you can also make that white bar at the top go away. Amazing that they have it launch on default for all users. They must really be pushing this.

Screenshots:

Update:
Looks like TimesPeople has been around as a Firefox plugin. Interesting.

Written by Bjorn

September 23rd, 2008 at 8:38 am

Posted in news, sites

Tagged with

Don’t believe the hype

Comments

The McCain camp is going at great lengths to blame Obama and Democrats for the financial mess. A recent article on Bloomberg is an example. The Politico by the way does a great job pointing out how McCain’s effort at pushing blame is usually riddled with errors. I expressed my amazement earlier at how the most of the right was generally trying to push blame away.

My amazement continues. The previously mentioned Bloomberg article is so frustratingly insipid. The basic gist is that a few Democratic legislators in a committee blocked a pure political move by Republicans to attack campaign funding for Democratic party members. The normally anti-regulation free-market buffs that are Republicans wrote a bill to regulate Fannie Mae et. al, and their chief motive wasn’t to prevent systemic disaster of the financial system. Ever since Republicans took back congress in 1994 they’ve gone after every little way imaginable to destroy the Democratic party’s influence in our national and state governments. For example when Republicans talk about ‘tort reform’ under the guise of reducing frivolous lawsuits they are in fact after the purse strings of tort lawyers who donate almost exclusively to the Democratic party. If these lawyers instead donated to Republicans I doubt the GOP would have moved a finger or feigned outrage at the cost of lawsuits.

That this McCain lackey would publish and article in Bloomberg boiling the entire financial disaster we’re facing down to a single politically motivated bill that never made it out of committee years ago is ludicrous. Then the stupidity continues when the writer ties campaign contributions that don’t equal a tenth of a percent of Obama’s fund raising total to an act he had nothing to do with.

Please, stop the stupidity.

Update:
Thankfully, it looks like most Americans aren’t buying the GOP’s lies. Awesome.

Written by Bjorn

September 22nd, 2008 at 2:59 pm

Posted in opinion

Upgraded WordPress Finally

Comments

Upgraded to 2.6.2. It wasn’t actually that hard, but I have been putting it off forever. I have to say the post writing tools are much better than they were before!

I also switched to the beautiful Journalism Theme, which I think looks very nice, I like wide layouts and I upgraded the Disqus comment plugin but Disqus’s site is down so I haven’t been able to get their new api key yet.

Written by Bjorn

September 16th, 2008 at 9:15 pm

Posted in misc

What I find amazing beyond anything…

Comments

…is while reading conservative blogs to get their perspective on the massive AIG bailout, that I see how many on the right find ways to blame Democrats despite years of Republican power in the White House, and their ongoing debacle to deregulate the market since Ronald Reagan.

Look at this idiocy:

Rush Limbaugh finds connections between Fannie Mae executives donations to the Democratic party to come to the bizaare conclusion that the mortgage mess is the fault of Democrats.

Michelle Malkin doesn’t place blame, but read the comments on her post about the AIG bailout from her readers finding ways to connect the problem with Democrats and their socialist ways, even though it is a Republican administration bailing out these fools.

No Quarter, the most despicable site on the internet, always pushing the most ridiculous lies to fuel Obama hatred, finds a way to use credit crisis to attack Obama’s judgement.

Ed Morrissey, a Republican political hack who without fail always seems to find a way to spin things against Democrats, sees connections between Social Security policy of Democrats and the current crisis.

Now I admit that progressive blogs like the Huffington Post, the Daily Kos are also guilty of unwavering partisanship and misleading spin. But to fathom the sheer extent of the malicious lies written by people who know they’re lying just disgusts me to no end. I wish it were possible to hold these people accountable for what they’re doing. It’s pure fiction. People like Ed Morrissey have absolute no credibility. These blogs, including the liberal trash I mentioned previously, are doing nobody any favors. Feigned outrage at every little thing that could possibly be construed into a game changing gaffe is all I ever read on Memeorandum these days. I really hope that the vast majority of online readers are able to see beyond this absolute garbage. Given what I read in the comments however, I don’t have much hope.

I wish a sense of decency prevailed. The thing is, that Republican bloggers are always blabbing on about American values and decency, and yet they (along with some progressive bloggers also) show so little of it in themselves.

Stop Fucking Lying.

Written by Bjorn

September 16th, 2008 at 8:36 pm

Posted in opinion

The Intellectual Elitist Left is Pissed at Palin

Comments

Of course I am also, but the best political reading I have done all year comes from the witty comments on a TPM blog post. I am not even halfway through it, and comment after comment is filled with ingenious wit and clever biting remarks:

Palin scares me because she is single-handedly reminding me of how blisteringly stupid the American voting public is. She is demonstrating that a public figure can lie like grandma’s rug, and get away with it. She is showing that people will swallow as many horsefeathers as get shoveled at them. She is making plain that the critical thinking skills of the people who will decide the fate of the country are atrophied to the point of uselessness.

She has patently lied about a central plank in the floor of her “reform” narrative. She has been airlifted in from a state utterly unlike the rest of the country, with unspecified skills beyond the purely rhetorical. She holds social views that can be carbon-dated back to the Pleistocene, which I am apparently supposed to overlook because she has “gay friends.” And she is getting away with it.

So, yeah. McCain/Palin looks like it could win. I’m sure Chan and tep will enjoy the balthazar of bubbly they can split when it does. For my part, it makes me want to vomit.

There is some actual great discussion, but I love the whining:

This is bulls**t. In 2000, the country was at peace and was prosperous. Bill Clinton, despite all his warts, was an historically popular president, and his very capable Vice President ran against a bumbling unaccomplished idiot who would not have been hired to manage a Wal-Mart let alone run the country. Yet the Republicans won. Four years later, that same idiot had a resume full of failures that would have been hard to accomplish even if he had been trying. The Democrats had a mediocre candidate who ran a horrible campaign and lost yet again. Many of us soothed our sorrow with one of two over-wrought rationalizations: 1) the country is flat-stupid and I am moving to Canada or 2) it is better to lose now lest a Democrat have to deal with a collapsed economy and an albatross of an endless war. In this campaign, the Republicans had no viable candidates and now 8 years of historical failures to run from. A friend said to me in the Fall of 2007 that the Dems could run Crusty the Clown and win in 2008. But they actually had not one, but two of the strongest candidates in recent memory. And one of them captured a magical spirit and won the nomination. And the Republicans have an aged, boring, and tired nominee who is running on the failures of his predecessor. So here we are on the brink of yet another impossible Republican victory. How? How can Augusta Green Jackets beat 1927 New York Yankees three times in a row?

Some constructive criticism also given:

Barack Obama has got to realize he won’t win the Lying Game or the Blaming Game. He has to go on the offensive by attacking the one group he’s been afraid to attack before: the people whose votes he wants. He needs to say, straight up, “Get what, folks? We’re fucked. It’s either gonna be bad or it’s gonna be worse. With me it’s gonna be bad, and here’s how: I’m gonna raise your taxes and you’ll get little in return. You’re gonna continue to shoot up millions of barrels of oil before I can get you into detox. Iran, Russia, Venezuela et al. are gonna yank your chains and there’s not a God damned thing you or me or anybody else can do about it. In fact, the only thing I’ll promise you under an Obama Administration is that a hell of a lot of America’s families will get sober, truly sober, for the first time since the late 1800s when we started getting high on cheap energy.”

“Any questions? Okay, line up in alpha order, drop your pants, bend over and wait for the body cavity search. And shut the fuck up.”

There’s a lot more where that came from.

Written by Bjorn

September 8th, 2008 at 8:49 pm

Posted in opinion

Oh that makes it ok!

Comments

The US Military, according to the New York Times says:

For two weeks, the United States military has insisted that only 5 to 7 civilians, and 30 to 35 militants, were killed in what it says was a successful operation against the Taliban

Ah, only 5 to 7, not the 90 civilian deaths that “the Afghan government, human rights and intelligence officials, independent witnesses and a United Nations investigation” claim. Great! Personally, I don’t think any loss of innocent life is acceptable, but I must be some kind of left wing extreme wacko nut job to think life is precious. If so, I don’t mind. Hell, label me whatever you want. I don’t give a shit anymore.

Written by Bjorn

September 8th, 2008 at 9:14 am

Posted in opinion

Smart People Making Dumb Statements

Comments

Slate’s Fred Kaplan has a great essay on smart people saying idiotic things about Palin:

In an uproarious essay, Gaffney wrote that Palin had learned more about foreign policy than Obama and Biden “by osmosis,” because Alaska lies “along the trajectory of ballistic missiles launched eastward out of Stalinist North Korea.”

This strikes me as unlikely. I live under the flight path of nearly every domestic flight that lands at LaGuardia and JFK. Yet that random fact doesn’t supply me with the slightest wisdom, by osmosis or some other mystical means, about the operations of the airline industry.

I recommend this read. Go quick, read it now, while your boss isn’t looking!

Written by Bjorn

September 4th, 2008 at 9:54 am

Posted in news, opinion