- Calendar -

March 2010
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

- Archive -

- Browse By Random Tag -

- Most Commented -

- Random Favourites -

- Blogs I Like -

- Email Viruses Received -

- My Geek Code -

-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d-- s: a- C++ UL++ P+++ L+++ E--- W+++ N+ o-- K- w--- O- M-- V- PS+++ PE-- Y++ PGP t++ 5+++ X R tv b+ DI+ D++ G e h r+ y+
--END GEEK CODE BLOCK--
Get The Encoder
Get The Decoder

- My Blog Code -

-BEGIN BLOG CODE BLOCK-
B6 d+ t++ k+ s++ u-- f i++ o+ x+ e l c-- --END BLOG CODE BLOCK--
Blog Code Encoder
Blog Code Decoder

- The Internet is Cool -

- Nifty Blog Toys -

RSS Feed

- Content License -

Blog

Things About Which to Care

I haven't posted in here for a while, but now that I have a few minutes I've been inspired by Melanie and Karen who are blogging 24hrs today for charity to do a little PSA and share some info about three topics I think everyone should be thinking about.

Copenhagen 2009

In December of this year, 192 countries will gather at the UN Climate Change Conference in Copenhagen to essentially determine the future of the planet. It's going to be a mix of climate activists, scientists, politicians and very powerful special interests and there's a lot on the line. Potentially, this conference could mean massive change to help save us from ourselves, both environmentally and economically, or it could be more posturing and inaction. We need to pressure our leaders to Do the Right Thing on this front and let them know that we are willing to support them in doing so.

Hopenhagen

Think of the potential for both the economy and environment. International agreements to raise tariffs on unsustainably harvested primary resources, subsidy programs for R&D into new energy production, or an accord to phase out coal fired plants by 2050. It's possible, the potential is there. Here's some links to get you started:

Copyright Reform

Humanity is changing and at the root of it is how we communicate. What rights we have to control our own culture and what it means to foster creativity and innovation is finally becoming a discussion worth having because for the first time ever, the average person has the potential to become their own printing press.

Technology has given us the tools, but the old guard of copyright owners is actively pushing back to retain their hold on our culture while simultaneously eroding our own privacy rights. Canada has great potential here to stand on its own and do the right thing, thereby becoming a centre for innovation and creativity on the world stage -- we just need the will.

Michael Geist, a copyright lawyer and activist for years on this issue has created a site called Speak Out on Copyright, a compilation of resources covering what you can do to affect change in this area. Talk to your MP, write letters to the editor for your local paper, do whatever you need to help people understand that what the Conservatives want to do right now is more dangerous than the damage Bush did to digital rights in his 8 years as a wrecking ball.

Net Neutrality

The Internet is gradually being eroded into a consumer tool from the powerful equalising force it was from the beginning. The key issue (for me anyway) is that the Internet is moving from a telephone-style system where all traffic moves at the same rate regardless of who's using it or what it's being used for, to a consumer service where people can pay more for better service or access to different content.

This can sound appealing at first until you realise that this means that your ISP (Shaw, Telus, Bell, Rogers, etc) is trying to make it so that you can't use our Internet the way you want. If they don't want to let you see certain sites, they won't, if they don't want you using a particular technology regardless of how you're using it, they'll throttle it or block it altogether. Moves like this impede innovation and turn the power of the Internet over to a conglomerate of 4 companies in Canada... companies we know that from considerable past experience, can't be trusted.

A number of sites have sprung up on this issue:

Your History in 140 Characters

Wil Wheton posted to Twitter today a request for an easy way to fetch all of one's tweets and store them locally. Someone might want to do that if they want a personal archive, or if they're interested in porting their data over to a Free implimentation like Laconica. Whatever your reasoning, here's a quick and dirty way to do it:

for i in {1..999}; do
  curl -s "http://twitter.com/statuses/user_timeline.xml?screen_name=your_screen_name&count=200&page=$i" | grep '<text>' | sed -e 's/^ *<text>\(.*\)<\/text>/\1/'
  sleep 2
done

Just hit "ctrl-c" when you hit your first post ever.

php.py

I wrote something rather fun today and I thought that I'd share it here. It's a Python module that you can use to interact with PHP products. Specifically, it's a reproduction of PHP's http_build_query() and parse_ini_file() functions that act as PHP does according to PHP's own way of doing things.

This means that if you've written an API server (as we have) in PHP that makes use of things like the above, you can interact with it using Python as your scripting language with little effort.

Examples:

from php import parse_ini_file

config = parse_ini_file("/path/to/config.ini")
print config["sectionName"]["keyName"]

This would give you the value for keyName in the section called sectionName in your config.ini file.

from php import http_build_query

somedata = {
  "keyname": "valuename",
  "otherkey": 123,
  "anotherkey": [1,2,3,{"seven": "eight"}]
}
print http_build_query(somedata)

This would give you:

otherkey=123&keyname=valuename&anotherkey[1]=2&anotherkey[0]=1&anotherkey[3][seven]=eight&anotherkey[2]=3&

The code was fun to write, and I'm guessing that it'll be useful to others so I'm posting it here. If you do end up using it, lemme know by posting a comment here eh?

You can download it here: php.py.

When I mentioned this to some other coworkers, they pointed out that I'm not the only one trying to get some of PHP's odd functionality into Python. Another developer has mimicked PHP's serialize() functions in the form of a Python module. I wonder if there are any other cases where this kind of stuff might be useful.

pit-faulty