June 29, 2008

Friedman: A Nation in Decline

My fellow Americans: We are a country in debt and in decline — not terminal, not irreversible, but in decline.
Posted by Tim at 08:03 AM | TrackBack

June 28, 2008

Writing Custom Contexts for Django

A context is just some information. They will usually be QuerySets, but they could be anything. They will be available from within your templates. Oh, and they are a breeze to make.

When building my site I wanted to have a selection of random entries available on the navigation bar on each page, lets look at how we can do this with a context.

Contexts are simply functions that take one argument, request, and return a dictionary of values. The one I wrote looks like this:

Posted by Tim at 09:15 PM | TrackBack

June 27, 2008

Better CSS Font Stacks

Font stacks give you freedom. You want to use Gill Sans? Go right ahead. Nothing should stop you. Font stacks are prioritized lists of fonts, defined in the CSS font-family attribute, that the browser will cycle through until it finds a font that is installed on the user’s system. This means that you can use Gill Sans, and if your users don’t have it, you can give them an adequate substitute that will not diminish their experience.
Posted by Tim at 05:18 PM | TrackBack

Seashore: Simple Mac Image Editor

Seashore is an open source image editor for Mac OS X's Cocoa framework. It features gradients, textures and anti-aliasing for both text and brush strokes. It supports multiple layers and alpha channel editing. It is based around the GIMP's technology and uses the same native file format.

However, unlike the GIMP, Seashore only aims to serve the basic image editing needs of most computer users, not to provide a replacement for professional image editing products.

Posted by Tim at 11:54 AM | TrackBack

June 24, 2008

Tantrum Practice

At home during a calm period, tell the child you're going to play a game. "You say, 'I'm going to pretend to say no and you're going to have a tantrum, but you're not going to hit or throw things. If you can do that, we're going to walk over to the refrigerator and put a star up on your chart,' " which can be turned in for a reward, such as a favorite food or TV time.

"You remind the child it's pretend and then do it. If a child complies, you say, 'I can't believe it, you just stood there when I said no and didn't throw things.' Then you say, 'I bet you can't do it again.' And when the child does, you praise and give another star. If the child fails, you say calmly, 'Okay, no star this time because you threw things. We'll try again later.' "

Posted by Tim at 07:13 PM | TrackBack

Full text: An epic Bill Gates e-mail rant

Read on past the jump for one of the gems that turned up, showing Gates in the role of chief rabble-rouser. (Original document: PDF, 5 pages.) It shows that even the Microsoft co-founder -- who champions the "magic of software" -- isn't immune to the frustrations of everyday computer users.

The lack of attention to usability represented by these experiences blows my mind. I thought we had reached a low with Windows Network places or the messages I get when I try to use 802.11. (don't you just love that root certificate message?)
Posted by Tim at 06:51 PM | TrackBack

Command to dump data as a python script

Django snippets: Command to dump data as a python script. Extremely useful—dumps the data for an application as an executable Python script which will re-import it in to another database without any risk of colliding with existing IDs, sorting out foreign keys along the way.
Posted by Tim at 06:39 PM | TrackBack

Running Sums in Python

Suppose we want to generate the running sum series r formed by sums of n consecutive elements taken from a series s. For example, to sum consecutive pairs taken from the first 6 integers:

>>> n = 2
>>> s = 0, 1, 2, 3, 4, 5
>>> running_sum(s, 2)
[1, 3, 5, 7]

Posted by Tim at 06:30 PM | TrackBack

Free Fonts

Posted by Tim at 02:01 PM | TrackBack

June 23, 2008

Marginal Revolution: Microfinance

Ryan Hahn asks:

In the case of microfinance, however, it seems to me the problem of limited liability is rearing its ugly head. Poor borrowers generally have little or no collateral, so they usually have little reason to avoid a strategic default.

It is a common myth that microfinance loans have no collateral.

Posted by Tim at 06:34 PM | TrackBack

mcDropdown jQuery Plugin: Hierarchical Dropdowns

For our help desk, customer service and call center software applications, we needed to develop a unique UI control that would allow users to select from a complex hierarchical tree of options. We wanted this control to be intuitive and it had to allow for both quick mouse and keyboard entry.
Posted by Tim at 06:22 PM | TrackBack

Database Performance 1: Huge Inserts

Maintaining ACID compliance is expensive for the database server. It must in effect keep two versions of every row in play, and it must do so while multiple users have multiple transactions running at the same time, even while other users may be trying to read the rows that are being effected. This cost is considered more than acceptable when the reliability requirement is high. But there is one case where the inevitable consequence of ACID compliance is to destroy performance, and this is on large UPDATES and INSERTS. Today we are going to look particularly at large INSERT operations.
Posted by Tim at 05:48 PM | TrackBack

June 21, 2008

Hybrid Bike Pedal

Double sided design works with cleated or standard shoes making it a perfect choice for commuting or trekking
Posted by Tim at 04:04 PM | TrackBack

June 19, 2008

Deals With Iraq Are Set to Bring Oil Giants Back

Exxon Mobil, Shell, Total and BP — the original partners in the Iraq Petroleum Company — along with Chevron and a number of smaller oil companies, are in talks with Iraq’s Oil Ministry for no-bid contracts to service Iraq’s largest fields, according to ministry officials, oil company officials and an American diplomat.

..Yet at today’s oil prices, there is no shortage of companies coveting a contract in Iraq. It is not only one of the few countries where oil reserves are up for grabs, but also one of the few that is viewed within the industry as having considerable potential to rapidly increase production.

Posted by Tim at 08:02 AM | TrackBack

June 18, 2008

Bush: Offshore Oil Drilling Strengthens National Security

President Bush urged Congress on Wednesday to end a federal ban on offshore oil drilling and open a portion of the Arctic National Wildlife Refuge for oil exploration, asserting that those steps and others would lower gasoline prices and “strengthen our national security.”
Posted by Tim at 06:30 PM | TrackBack

June 17, 2008

Can Bicycling Really Damage the Environment?

Contrary to popular opinion, bicycling can potentially damage the environment due to the increased longevity of people engaged in physical activity, says Karl Ulrich, a Wharton Business School professor.
Posted by Tim at 08:18 AM | TrackBack

June 15, 2008

Kristof: The Weapon of Rape

Painfully slowly, the United Nations and its member states seem to be recognizing the fact that systematic mass rape is at least as much an international outrage as, say, pirated DVDs.
Posted by Tim at 10:56 PM | TrackBack

Obama the Delegator Picks When to Take Reins

If a presidential campaign is intended to be a test-run for the presidency, his chief priorities are the words in his speeches, messages in his television advertising and policy pronouncements. On other matters, even if he disagrees, he often allows himself to be overruled.

Mr. Obama was not thrilled with a campaign slogan, “Change We Can Believe In,” that was unveiled last September. And he did not initially like the campaign’s blue and white logo — intended to appear like a horizon, symbolizing hope and opportunity — saying he found it too polished and corporate.

Posted by Tim at 10:51 PM | TrackBack

Microfinance in Mexico: for Profit

Critics of Compartamos include Muhammad Yunus, a Bangladeshi economist who won the Nobel peace prize in 2006 for his work in popularising microfinance through the Grameen Bank. He was reportedly “shocked” by the IPO, and has argued that microfinance should be about “protecting [poor people] from the moneylenders, not creating new ones.” Another critic, Chuck Waterfield of Microfin, a provider of software to microfinance institutions, accuses Compartamos of “monopolistic exploitation of the poor”. He alleges that it is charging interest rates of over 100% a year, little different from what illegal loan sharks demand, and that it is deliberately making it difficult for poor borrowers to understand how much they are paying for their loans. He and Mr Yunus are campaigning for the microfinance industry to agree on common standards on disclosing charges to help borrowers.
Posted by Tim at 10:21 PM | TrackBack

June 13, 2008

When Mom and Dad Share It All: Adventures in Equal Parenting

Women, she says, know that the world is watching and judging. If the toddler’s clothes don’t match, if the thank-you notes don’t get written, if the house is a shambles, it is seen as her fault, making her overly invested in the outcome.
Posted by Tim at 09:38 PM | TrackBack

Programmer Insecurity: Sharing Unfinished Work & Code Reviews

OK, so what’s the conclusion here? People are scared of sharing their unfinished work, plain and simple. I know this isn’t headline news to most people, but I really think I’ve been in deep denial about this. I’m so used to throwing my creative output up for constant criticism, that I simply expect everyone else to do it as well. I think of it as the norm, and I can’t comprehend why someone wouldn’t want to do that… and yet clearly, the growing popularity of distributed version control shows just how thrilled people are to hide their work from each other. It’s the classic “testimonial” for systems like git (taken from a blog comment):

“Don’t tell me I should cooperate with other people at the beginning and publish my modification as early as possible. I do cooperate with other people but I do want to do some work alone sometimes.”

Hm, okay. Please just don’t work alone for too long!

Posted by Tim at 07:11 PM | TrackBack

June 12, 2008

Django Training

Our Django courses are designed to get professional developers up to speed fast. We offer a syllabus covering all aspects of the Python programming language, and development in Django, with modules on using Django with other technologies such as Web services, Ajax, image manipulation and PDF generation.
Posted by Tim at 08:45 AM | TrackBack

June 11, 2008

Swivel: Make Data Useful

Swivel's mission is to make data useful.

  • Explore and compare data, graphs and maps.
  • Share insights via email, blog or data downloads.
  • Upload the data you care about.

If you're curious about data, Swivel is the place for you.

Posted by Tim at 01:57 PM | TrackBack

June 10, 2008

Brooks: For a New Thrift: Confronting the Debt Culture

The agents of destruction are many. State governments have played a role. They aggressively hawk their lottery products, which some people call a tax on stupidity. Twenty percent of Americans are frequent players, spending about $60 billion a year. The spending is starkly regressive. A household with income under $13,000 spends, on average, $645 a year on lottery tickets, about 9 percent of all income. Aside from the financial toll, the moral toll is comprehensive. Here is the government, the guardian of order, telling people that they don’t have to work to build for the future. They can strike it rich for nothing.

First, raise public consciousness about debt the way the anti-smoking activists did with their campaign. Second, create institutions that encourage thrift.

Posted by Tim at 08:13 AM | TrackBack

June 09, 2008

Trixie Tracker: The Data-Driven Baby

Trixie Tracker is an easy-to-use web and mobile tool to help parents uncover and understand patterns in their baby's sleep and daily schedules. Trixie Tracker lets you create visually striking charts for...

  • Sleep schedules
  • Diaper changes
  • Bottle and breastfeeding
  • Solids
  • Pumping
  • Milk inventory
  • Medicine doses
Posted by Tim at 10:17 PM | TrackBack

Rural U.S. Takes Worst Hit as Gas Tops $4 Average

Gasoline prices reached a national average of $4 a gallon for the first time over the weekend, adding more strain to motorists across the country. But the pain is not being felt uniformly. Across broad swaths of the South, Southwest and the upper Great Plains, the combination of low incomes, high gas prices and heavy dependence on pickup trucks and vans is putting an even tighter squeeze on family budgets

The disparity between rural America and the rest of the country is a matter of simple home economics. Nationwide, Americans are now spending about 4 percent of their take-home income on gasoline. By contrast, in some counties in the Mississippi Delta, that figure has surpassed 13 percent.

Posted by Tim at 07:57 AM | TrackBack

June 08, 2008

Partisanship and McCain's Disability Pay

Imagine what the Republicans would have done had the Democratic candidate been profiting to the tune of $58,000 a year from the feds for a "disability" that didn't stop him from staying in the military another eight years, where he took over the command of a training squadron, and which didn't stop him from later getting elected to the US Congress for 26 years. Yes, you can be disabled and do all that, but again, imagine had the Democratic candidate had the vigor of John McCain, while claiming to be disabled to the tune of $58k a year.
Posted by Tim at 05:22 PM | TrackBack

Map of Earmarks by State

Interactive map showing amount of earmarks per capita
Posted by Tim at 04:50 PM | TrackBack

June 07, 2008

Do food miles matter?

Weber and colleague Scott Matthews, also of Carnegie Mellon, conducted a life-cycle assessment of greenhouse gases emitted during all stages of growing and transporting food consumed in the U.S. They found that transportation creates only 11% of the 8.1 metric tons (t) of greenhouse gases (in CO2 equivalents) that an average U.S. household generates annually as a result of food consumption. The agricultural and industrial practices that go into growing and harvesting food are responsible for most (83%) of its greenhouse gas emissions.
Posted by Tim at 07:34 PM | TrackBack

At $4, Everybody Gets Rational

Want to wean us off oil? Be open and honest. The British are paying $8 a gallon for petrol. Goldman Sachs is predicting we will be paying $6 by next year. Why have the extra $2 (above the current $4) go abroad? Have it go to the U.S. Treasury as a gasoline tax and be recycled back into lower payroll taxes.

Announce a schedule of gas tax hikes of 50 cents every six months for the next two years. And put a tax floor under $4 gasoline, so that as high gas prices transform the U.S. auto fleet, change driving habits and thus hugely reduce U.S. demand -- and bring down world crude oil prices -- the American consumer and the American economy reap all of the benefit.

Posted by Tim at 01:17 PM | TrackBack

June 06, 2008

SocialText: Enterprise Wiki

For technical users that want to deploy Socialtext wiki and social software on their own or developers that want to build applications on top of the industry's leading platform, Socialtext offers an open-source version.
Posted by Tim at 08:54 AM | TrackBack

June 05, 2008

Resolver: Python - Spreadsheet Hybrid

Resolver One is a Rapid Application Development tool for analysing and presenting business data using a familiar spreadsheet interface, combined with a powerful IronPython-based scripting capability that allows you to insert your own code directly into the recalculation loop. There's a one-minute screencast about it
Posted by Tim at 10:29 PM | TrackBack

America's Medicated Army

For the first time in history, a sizable and growing number of U.S. combat troops are taking daily doses of antidepressants to calm nerves strained by repeated and lengthy tours in Iraq and Afghanistan. The medicines are intended not only to help troops keep their cool but also to enable the already strapped Army to preserve its most precious resource: soldiers on the front lines. Data contained in the Army's fifth Mental Health Advisory Team report indicate that, according to an anonymous survey of U.S. troops taken last fall, about 12% of combat troops in Iraq and 17% of those in Afghanistan are taking prescription antidepressants or sleeping pills to help them cope.

In some ways, the prescriptions may seem unremarkable. Generals, history shows, have plied their troops with medicinal palliatives at least since George Washington ordered rum rations at Valley Forge. During World War II, the Nazis fueled their blitzkrieg into France and Poland with the help of an amphetamine known as Pervitin. The U.S. Army also used amphetamines during the Vietnam War.

Posted by Tim at 04:41 PM | TrackBack

June 04, 2008

Versions Subversion Client for Mac

Versions provides a pleasant way to work with Subversion on your Mac. Whether you’re a hardcore Subversion user or new to version control systems, Versions will help streamline your workflow.
Posted by Tim at 04:25 PM | TrackBack

Picalo: Python Data Mining and Fraud Detection

Welcome to the world of Picalo, a collaborative, open-source effort to produce a data analysis application suitable for auditors, fraud examiners, data miners, and other data analysts!
Posted by Tim at 02:59 PM | TrackBack

June 03, 2008

Scotts Classic reel lawn mower

We looked at all the different large reel lawn mowers available and chose to carry the Scotts Classic because we feel it is the best large reel mower in regard to price, performance, quality and features.

Related

Posted by Tim at 08:18 PM | TrackBack

It’s Not So Easy Being Less Rich

“They fear their kids won’t get invited to the right birthday parties,” said Michele Kleier, an Upper East Side-based real estate broker. “If they have to give up things that are invisible, they’re O.K. as long as they don’t have give up things visible to the outside world.”
Posted by Tim at 05:37 PM | TrackBack

Cargo Bikes

This bike was offered by Ford as an optional extra for a MTB themed car. I got one on eBay, since at the time, it was by far the cheapest bike with dual disc brakes available. After moving to the big city, it has been repurposed as a cargo bike. It also does school bus duties with the addition of a stoker stem and bar, so that my daughters can hang on for dear life. This setup is much more agile than either a bike with trailer, or the double kid back recumbent tandem that we use for recreational riding.

Related

Posted by Tim at 09:40 AM | TrackBack

June 02, 2008

It Isn’t Magic: Putin Opponents Are Made to Vanish From TV

On a talk show last fall, a prominent political analyst named Mikhail G. Delyagin had some tart words about Vladimir V. Putin. When the program was later televised, Mr. Delyagin was not.

In a still frame from video, the incomplete digital erasure of a Putin critic named Mikhail G. Delyagin from an episode of the program "The People Want to Know" can be seen. Mr. Delyagin's leg and hand remain visible, to the right of the man holding the microphone. Not only were his remarks cut — he was also digitally erased from the show, like a disgraced comrade airbrushed from an old Soviet photo. (The technicians may have worked a bit hastily, leaving his disembodied legs in one shot.)

Posted by Tim at 11:35 PM | TrackBack

June 01, 2008

Military Drones in Iraq

The UAV—known as a Shadow—had spotted children going in and out of the building. "We knew the bad guys were there," Williams said. "We saw them walk in and out, we saw them place the [missiles] … We could have serviced that building and we probably could have killed four or five of the guys that were involved in it.

But the decision was made at the command level—because of the women and children who were potentially in that building—not to service the target."

..In the tribal areas of Pakistan and Afghanistan, village mothers have been known to use the threat of a Predator attack to get their children to behave: "Obey or the 'buzz' will come after you."

Posted by Tim at 11:01 PM | TrackBack

Rowing: The Chinese Plan for Olympic Medal Count

In anticipation of China’s debut as an Olympic host, officials here have seized the opportunity to prove their country is a world power in sports. Rowing is at the heart of China’s plan to capture, for the first time, more gold medals than any other nation at the Olympic Games.

Grinko, 62, called it a priority for the Chinese to focus on sports like rowing that offer many gold medals, unlike basketball and soccer. The Summer Games in Beijing include 14 rowing events — 14 chances to for China to win gold and prove itself on home soil.

Posted by Tim at 09:33 PM | TrackBack

Taking Their Faith, but Not Their Politics, to the People

“The easy thing is to fight, but the hard thing is to put your gloves down and work together towards a common cause,” said the Rev. Scott Thomas, director of the Acts 29 Network, which helps pastors start churches. “Our generation would like to put our gloves down. We don’t want to be out there picketing. We want to be out there serving.”
Posted by Tim at 09:17 PM | TrackBack