Climate change refugees.

Carteret Islands|First climate refugees move to new home

Imagine that you live on the Carteret Islands, seven tiny coral atolls in the Pacific that have been described as the home of the world’s first climate change refugees.

[…]

‘‘We have a feeling of anxiety, a feeling of uncertainty because we know that we will be losing our homes. It is our identity. It is our whole culture at stake,’’ she said in Melbourne yesterday.

rossetti@Wakatipu:~/door$ sqlite3 door_wordlist.db "SELECT articles.date, articles.link, articles.title FROM articles LEFT JOIN ratings_1 ON articles.id = ratings_1.id where articles.content LIKE '%refugee%' AND articles.content LIKE '%climate change%' ORDER BY ratings_1.q3 DESC LIMIT 10;"

2009-03-28 16:00:00|http://www.nzherald.co.nz/nz/news/article.cfm?c_id=1&objectid=10564124&ref=rss|Brits flee to Godzone
2007-10-03 09:16:00||Heffernan plays down climate refugee comments
2009-07-27 04:02:00|http://www.abc.net.au/news/stories/2009/07/27/2637587.htm|75 million to flee climate change: report
2009-02-13 11:29:00|http://www.abc.net.au/news/stories/2009/02/13/2491415.htm|Bougainville works to relocate ‘climate refugees’
2009-05-12 22:00:00|http://www.abc.net.au/news/stories/2009/05/13/2568746.htm|’Coral triangle’ a global emergency
2009-06-03 03:34:00|http://www.abc.net.au/news/stories/2009/06/03/2588165.htm|Indonesia’s rent-an-island answer to climate change
2007-12-19 03:00:20|http://feeds.feedburner.com/~r/dailymail/worldnews/~3/202175143/worldnews.html|The world’s first climate change refugees to leave island due to rising sea levels
2007-09-30 17:00:06||The heat is on national security, Australia told
2007-04-04 00:00:00||The 450 million refugees we don’t want to talk about
2008-10-18 23:20:00|http://www.abc.net.au/news/stories/2008/10/19/2395035.htm|Zoos becoming ‘refugee camps for animals’

Michael Jackson in the news.

sqlite> SELECT strftime('%Y/%m', date) AS date, SUM(CASE WHEN content like '%Michael Jackson%' THEN 1 ELSE 0 END) AS count FROM articles GROUP BY date ORDER BY date DESC;
date|count
2009/07|54
2009/06|94
2009/05|3
2009/04|1
2009/03|0
2009/02|1
2009/01|0
2008/12|1
2008/11|4
2008/10|0
2008/09|0
2008/08|1
2008/07|0
2008/06|0
2008/05|0
2008/04|0
2008/03|0
2008/02|0
2008/01|0
2007/12|0
2007/11|2
2007/10|0
2007/09|0
2007/08|0
2007/07|2
2007/06|1
2007/05|0
2007/04|0
2007/03|0
2007/02|1
2007/01|1

Top 20 verbs.

sqlite> select count,phrase from phrases where pos = ‘V’ order by count desc limit 20;
count|phrase
19340|said/VBD
18704|says/VBZ
14604|is/VBZ
8383|was/VBD
6424|say/VBP
5495|writes/VBZ
5306|are/VBP
4992|be/VB
2672|were/VBD
2672|killing/VBG
2578|died/VBD

2476|has/VBZ
2034|accused/VBN
1928|including/VBG
1925|killed/VBN
1793|had/VBD
1734|’s/VBZ
1729|according/VBG
1610|saying/VBG
1563|found/VBD

Phidget motor controller.

After heading down a complex path with Arduino and a motor controller with many more features than are required I think I can simplify the build by switching to a Phidget motor controller (1064 – PhidgetMotorControl HC). Its all in one (rather than Arduino + controller), has Python (and many other) libraries, and has built-in inputs for sensors as required. The only issue with the HC is the height of the terminator block – I’m checking this at  the moment.

Updating a Twitter profile image using Python and cURL

I’ve been trying for ages to update the Twitter profile image from Python and getting lost in multipart boundary rubbish. It seems as though its a fairly ad-hoc part of the Twitter API that hasn’t ever been updated. PyTwitter doesn’t handle it currently which is being used for all the other Twitter updates being done.

Finally here is a working method using PycURL. Thanks to pieceofpy for solving the actual syntax for form file uploads.

def SetProfileImage(self, filename):
import pycurl
url = 'https://twitter.com/account/update_profile_image.xml'
head = ['Expect: ']
data = [('image', (pycurl.FORM_FILE, filename))]
c = pycurl.Curl()
c.setopt(pycurl.URL, url)
c.setopt(pycurl.USERPWD, "%s:%s" % (self.user, self.passwd))
c.setopt(pycurl.HTTPHEADER, head)
c.setopt(pycurl.HTTPPOST, data)
c.perform()
c.close()

This is the equivalent of the curl command

curl -u anxiousdoor:xxxxxxxx --header "Expect: " -F image="@/home/rossetti/door/icon-unlocked.png" https://twitter.com/account/update_profile_image.xml

EeePC arrives.

JB HiFi matched Harvey Norman’s sale price on a new EeePC 701SD. A better price than older and second hand models have been going for on Ebay this month. Hopefully I’ll be able to use the Asus online storage (10GB) in the project too perhaps for database backups.

One of the first jobs will be to install the conceptnet package and see how it performs. Then take the netbook apart and try and thin it down to 27mm.