May. 11, 2012

Most insiduous letters of the alphabet

Having seen this tweet, my natural response was to examine the letter frequency of the names and produce here what are probably the likeliest letters of the alphabet to reject US citizenship.

Well, nah, I just wanted to make some rotating letters (mouseover for wheeee). But the frequency counts are accurate....

 

No comments \ Leave a comment

My dad built a shed as a scale model of our house destroyed in the war of '92

The other night, I opened up a bottle of red wine, fired up Photoshop,  edited for a few minutes and saved a collage picture of my parents' house in Bosnia next to a shed my father built in Texas.  This story begins in 1984, or thereabouts.  My dad built our house from scratch, on a teacher's salary- he and mother designed the blueprints, paid structural engineers to edit and certify them, and then had the house constructed over the years.

Then, before the house was completed, the war broke out. In 1992 our part of Bosnia was overrun by Serb paramilitary forces. Many people died, and many more suffered.  A small footnote in that reality is that our house was destroyed: hit by tank shells and later set on fire while we made our separate ways to concentration camps.

Skipping the war parts and our collective exodus, nearly 20 years later, my father built a shed in his back yard, in Texas, modeled after our original home.  It's been some years since I've visited mom and dad, so I only learned of the shed via facebook after my brother posted a set of photos.

Feeling a bit overwhelmed, I didn't know how to respond to the shed. But, I posted it on reddit,  By morning, the picture had hit the front page of their /pics/ section and nearly two hundred people voiced their responses to the picture.  It's amazing how a person can be oblivious to something immediately in front of them.

It took strangers from the internet to put the right caption behind that picture.  By now, server stats show that a quarter million people had viewed the picture.

Collective caption of this picture highlights my dad's strength and pride in commemorating a difficult time in his life. And the internet is right: he is a strong man, having expressed a desire to see the home he built with his own hands.

No comments \ Leave a comment
May. 04, 2012

Why some, but not all, of "Open Data Movement" is a joke

Tom Slee struck a nerve writing a blog post titled Why the "Open Data Movement" is a joke. Only problem with it was that he should have been more specific.  Readers who weren't well versed in Canadian politics didn't pick up on the localized nuances they were supposed to, and instead reacted to their very own reflections in the mirror.

His complaint is spot on when it addresses the range between datawashing and its directly related "open data" businesses that are sprouting like mushrooms after a rain. Though the real open data movement issue has nothing to do with data. It has to do with the old saying "You can lead a horse to water, but you can't make it drink."  Specifically, mismanagement.

Proper Use of Data

Tina Rosenberg from NYT wrote a recent damning piece called "Armed With Data, Fighting More Than Crime." The piece is a good example of appropriate open data as it addresses crime, data, data collections and especially decisions made with that data in the new (sometimes unspoken) sphere of open data movement.

But, this process is nothing new in the world. We've always made informed decisions based on analysis.

Census tallying used to take decades, then years, then months. Now that this generic data collection asymptote approaches zero, it's triggered a series of events that people, administrations and businesses are reacting to.  Same technological shift that made this possible is allowing for us to have greater sample sizes, to bypass survey vendors and sample directly, and perform  instantaneous analysis as the data comes in. Faster. More accurate.

We now have to make faster decisions

Message that open data movement carries puts pressure on decision makers, especially in the public sector. If they find their organization ill-equipped to handle this accelerated process, they can cop out and embrace an open data vendor and, paraphrasing a set of PR releases, let "citizen journalists engage with open government data and collaborate on solving problems while increasing transparency and improving level of trust between people and their government."  As noble as that sounds, most directives requiring data sets be released don't ever address a level of significance for that data.

If all you do is make a quota of compulsorily collected data sets available, you're doing it wrong:

  • Vendor's catalog of all 'available' data implies that it's a finite set, and there is nothing else to be had
  • No compendium exists of hidden data sets, or reasons why they are unlisted
  • Data limits are vague, if even provided: no collection timing lag, related costs
  • No context is provided on how original data provider uses the data sets

Putting finding gotchas on citizens evades responsibility, especially when it's inane data sets whitelisted by an anonymous employee.

It's a disconnected chain: Vendors can shrug their shoulders. That's all the data they got. Officials can shrug their shoulders. They released data, and in a budget-strapped year, it was John Q. Citizen who failed to spot an indicator of a major issue. And where was the newspaper? They always complain about not getting data, and now we handed it all to them. Why are you calling about data? It's all listed on our site.

Management Shortfall

Intentional, or unintentional, this is datawashing. Even Baltimore, a fairly progressive city in this data realm, has been caught under-reporting rape incidents to the tune of 80% over the past decade.  It took an investigation by the Baltimore Sun for the city to admit they've been gaming statistics.

As Tina expands her article, this data governance movement is merely a cosmetic change for some organizations. An intelligent process is being visually mimicked, but there is no improved accountability or responsibility, and there are no reactive follow ups.  Worst yet, there is no evidence that management is using any of the data to make decisions.

Instead, the allegedly open data is put out there and indirectly placates the public. While I understand that open data movement figureheads can't bite the hand that feeds them, their collective cheerleading minimizes actual issues and limits they incur.

Shirking from responsibility is a joke.

No comments \ Leave a comment
May. 02, 2012

WordPress plugin that removes useless image hyperlinks that point to themselves and make you cringe

Ever cringe when someone you work with inserts images in blog posts, but images are hyperlinked, pointing to themselves?

When inserting images in WP, the Link URL may automatically be set to File URL, so it's an easy slipup.  Just like the title says, this plugin removes useless hyperlinks that do nothing.

<?php
/*
Plugin Name: remove useless image links
*/
 
function remove_useless_hyperlinked_images( $content ) {
 
	$doc = new DOMDocument();
 
	// cheap trick to avoid smart characters being mangled
	@$doc->loadHTML( '<?xml encoding="UTF-8">' . $content );
 
	$path = new DOMXpath( $doc );
	$images = $path->query( "//a//img" );
 
	// remove useless hyperlinks
	for( $i = 0; $i < $images->length; $i++ ) {
		$img = $images->item($i);
		$a = $images->item($i)->parentNode;
 
		// discard useless image link
		if( $img->getAttribute('src') == $a->getAttribute('href') ) {
			$a->parentNode->replaceChild( $img, $a );
		}
	}
 
	// cheap trick to get <body>
	$html = $doc->saveHTML();
	@preg_match( "/<body\>(.*)<\/body>/is", $html, $r );
	if( is_array( $r ) && isset( $r[1] ) ) {
		return( $r[1] );
	} else {
		return( $content );
	}
 
}
add_filter( 'the_content', 'remove_useless_hyperlinked_images' );
 
?>

You're welcome, OCD universe.

1 comment \ Leave a comment
Posts on this blog solely represent my personal opinions and technical experience.

© 2009-2017 Edin (Dino) Beslagic