<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8898949683610477251</id><updated>2024-09-04T12:30:24.357+01:00</updated><category term="Hadoop"/><category term="MapReduce"/><category term="Family"/><category term="Amazon EC2"/><category term="Cloud Computing"/><category term="Web Services"/><category term="Apache"/><category term="Book"/><category term="Cloudera"/><category term="Data"/><category term="HBase"/><category term="Hashing"/><category term="Thrift"/><category term="Whirr"/><category term="Amazon S3"/><category term="Amazon Web Services"/><category term="Broadband"/><category term="Conferences"/><category term="Distributed Systems"/><category term="Easter"/><category term="Hardware"/><category term="Java"/><category term="Lucene"/><category term="Mobile"/><category term="Music"/><category term="Open Source"/><category term="Quantum Mechanics"/><category term="Query Languages"/><category term="RPC"/><category term="Regular Expressions"/><category term="Serialization"/><category term="T1D"/><category term="Testing"/><category term="Visualization"/><title type='text'>Tom White</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>67</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-1988684325577020667</id><published>2019-11-08T11:38:00.000+00:00</published><updated>2019-11-08T11:38:03.606+00:00</updated><title type='text'>Bristech 2019</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9cWv8Obtp9AtFPnbHVPw5EbY6gnfopA-JFJgtVcsWqO7nu7qc56kk68aqhB9RV9Vci3u7-9iI0LOnzDv8IwGkehdpttkG67zg_PMqF_gE6wP97d-NsUF-wmA1LmSO-GW2wpQczn5hyphenhyphenzam/s1600/IMG-0048.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1600&quot; data-original-width=&quot;1200&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9cWv8Obtp9AtFPnbHVPw5EbY6gnfopA-JFJgtVcsWqO7nu7qc56kk68aqhB9RV9Vci3u7-9iI0LOnzDv8IwGkehdpttkG67zg_PMqF_gE6wP97d-NsUF-wmA1LmSO-GW2wpQczn5hyphenhyphenzam/s320/IMG-0048.jpg&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Yesterday I went to &lt;a href=&quot;https://2019.bris.tech/&quot;&gt;Bristech&lt;/a&gt;. What a great conference! It’s one day, three tracks.&lt;br /&gt;
&lt;br /&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

The thing I like about it is the variety of the talks. It’s not organized around a single programming language or technology, so it’s easy to go to talks outside your usual sphere of interest (it’s quite hard not to). I went to talks about MLOps (keynote by Luke Marsden), the Language Server Protocol (by Krzysztof Cieślak), a reactive JS compiler called Svelte (by Peter Allen), accessibility (by&amp;nbsp;Svetlana Kouznetsova), Cloud Native ML (by&amp;nbsp;Ant Kennedy), and building autonomous Mars rovers (by&amp;nbsp;Mark Woods).&amp;nbsp;I gave a talk on Single Cell data and algorithms (thanks to Steve&amp;nbsp;Loughran for suggesting I submit it, as well as &lt;a href=&quot;https://twitter.com/steveloughran/status/1192410323988500480&quot;&gt;live tweeting&lt;/a&gt; it!).&lt;br /&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;br /&gt;
&lt;div&gt;
Nic Hemley and the other organizers put a lot of work into lots of small details that made the day more memorable. To name a few: the Icelandic thunder clap; caterpillar and butterfly stickers to encourage attendees to talk to each other; lunchtime &lt;a href=&quot;https://www.larkhall.org/&quot;&gt;music and visuals&lt;/a&gt;; cinema popcorn.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

As a speaker I was very impressed by the care taken by track chairs on the speaker intros. Speakers were asked beforehand to fill in a short “interview” document, which chairs then used to write an intro for each speaker. My track chair was &lt;a href=&quot;https://opcan.co.uk/&quot;&gt;Hannah Smith&lt;/a&gt; who was also very good at gently reminding people in the Q&amp;amp;A session to ask questions rather than give their opinions. So we didn’t have any “this is more of a comment than a question” style ramblings, which I’m sure everyone was pleased about.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

And the Watershed is a very nice venue, even if it gets “&lt;a href=&quot;https://twitter.com/dancookdev/status/1192712736066744321&quot;&gt;night club busy&lt;/a&gt;” between talks.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

Great conference. Highly recommended.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/1988684325577020667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/1988684325577020667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1988684325577020667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1988684325577020667'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2019/11/bristech-2019.html' title='Bristech 2019'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9cWv8Obtp9AtFPnbHVPw5EbY6gnfopA-JFJgtVcsWqO7nu7qc56kk68aqhB9RV9Vci3u7-9iI0LOnzDv8IwGkehdpttkG67zg_PMqF_gE6wP97d-NsUF-wmA1LmSO-GW2wpQczn5hyphenhyphenzam/s72-c/IMG-0048.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-8750887944922509499</id><published>2019-11-02T13:07:00.006+00:00</published><updated>2019-11-02T15:24:36.842+00:00</updated><title type='text'>How I manage my diabetes</title><content type='html'>&lt;div style=&quot;-en-clipboard: true;&quot;&gt;
I was &lt;a href=&quot;http://www.tom-e-white.com/2018/04/type-1-diabetes.html&quot;&gt;diagnosed with Type 1 Diabetes&lt;/a&gt; (T1D) in February last year. Since then I have learnt a lot about the condition, and how to manage it. The first few months were quite turbulent, but now it’s become more settled and is a part of life, and thankfully I don’t spend every minute thinking about it. It never goes away though.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
In this post I describe the technology I’m using to manage T1D. Every PWD (person with diabetes) is different, so what works for me won’t necessarily work for others. Also, some of these things don’t even work for me all the time, such is the unpredictable nature of diabetes. So there are definitely improvements I could make. I’ll mention some of them at the end of this piece.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggxEn8SmasqEatCItD2doxEWu_DJxuYPIOV05LhrBaw5QQianzmZMmUwSxK-P5z2_qtXDc2FBOJfWm-lMBgUos2gDuntQzxgW487_3OPI7IiRXA7Dy84lYuMrrkqM2o8p8Hd9WROd5ndp_/s1600/IMG_0041.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1200&quot; data-original-width=&quot;1600&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggxEn8SmasqEatCItD2doxEWu_DJxuYPIOV05LhrBaw5QQianzmZMmUwSxK-P5z2_qtXDc2FBOJfWm-lMBgUos2gDuntQzxgW487_3OPI7IiRXA7Dy84lYuMrrkqM2o8p8Hd9WROd5ndp_/s400/IMG_0041.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Some of my diabetes kit&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;br /&gt;
&lt;div&gt;
The main tools I use are a &lt;span style=&quot;font-weight: bold;&quot;&gt;FreeStyle Libre&lt;/span&gt; to measure my blood glucose levels, and &lt;span style=&quot;font-weight: bold;&quot;&gt;insulin pens&lt;/span&gt; to administer&amp;nbsp;multiple daily injections (MDI) of insulin. I also use a number of apps and websites to manage the data.&lt;br /&gt;
&lt;br /&gt;
Quite simply, the &lt;a href=&quot;https://www.freestylelibre.co.uk/libre/&quot;&gt;Libre&lt;/a&gt; is a superb piece of technology. It gives an amazing amount of insight into blood glucose levels - you can see what happens after you eat a particular food, or the effect of exercise, and even what happened to your levels during the night. I’ve been using one for over a year, and without it I really think I would be a lot more stressed about BG levels, and probably overcompensating for lows and oblivious to highs.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There are two parts to the Libre system: the sensor and the reader. The sensor is a small white disc that you stick to your upper arm. It has a small needle that sits under the skin where the glucose sensor is located. Each sensor lasts 14 days before it must be changed. The reader is a custom device, like a tiny phone (see picture above), but you can also use your phone to read the sensor using NFC. The sensor only stores 8 hours worth of measurements, so you need to tap the reader on the sensor at least that often to avoid gaps in history.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I use the reader rather than my phone to read the sensor (I only recently upgraded my phone to a version that can read the sensor). The reader can store 90 days of readings, so I periodically download the data as a backup and as a way to run different analyses on it.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Abbott, the company that manufactures the Libre, provides a desktop application to download the data from the Libre over USB. I wrote a &lt;a href=&quot;https://github.com/tomwhite/libre-nightscout-uploader&quot;&gt;script&lt;/a&gt;&amp;nbsp;to upload the resulting data to a service called Nightscout.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIes4PfY00DfBNfGi23fxI30ULFKcoS0-o0-76Gbryvg4J0Wy3gMjDIL88wJ0JijzTNwH6P_NQXRfCanQPiiHRRkL4Cccqf-zsQFdNXD9eUgUXN_Eo3K8oOHeDKm69NvcjRpLzV3ZhDRBI/s1600/ns.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1143&quot; data-original-width=&quot;1600&quot; height=&quot;456&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIes4PfY00DfBNfGi23fxI30ULFKcoS0-o0-76Gbryvg4J0Wy3gMjDIL88wJ0JijzTNwH6P_NQXRfCanQPiiHRRkL4Cccqf-zsQFdNXD9eUgUXN_Eo3K8oOHeDKm69NvcjRpLzV3ZhDRBI/s640/ns.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Nightscout&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;br /&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.nightscout.info/&quot;&gt;Nightscout&lt;/a&gt;&amp;nbsp;is an open source project created by the #WeAreNotWaiting community to allow people with T1D to store their CGM data in the cloud. It was started as a way for parents of children with T1D to monitor their BG levels (particularly at night, without disturbing them), but it is now widely used by many in the T1D community, and forms a basis for DIY looping systems, like OpenAPS.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I use Nightscout&amp;nbsp;as a historical data store, rather than for its realtime capabilities. I like Nightscout&amp;nbsp;because it&#39;s open source and therefore not tied to a corporation (which could pull the service, change its terms, etc), but the downside is that you do have to run your own service, although that’s pretty easy to do on Heroku.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7KR1RQcUk0Qu22CuuudBxIy_w3M0CuzwoYCQQR56aKpkTFewJIwPdnd04nmF0mMaFKKV61hcMCgDPGQf4mqitHwi53LRl4P6Mh7tWWjJ-AxXS3lfMr97kBems39Ij88E15MceGp2MRiBE/s1600/dboard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;638&quot; data-original-width=&quot;1600&quot; height=&quot;254&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7KR1RQcUk0Qu22CuuudBxIy_w3M0CuzwoYCQQR56aKpkTFewJIwPdnd04nmF0mMaFKKV61hcMCgDPGQf4mqitHwi53LRl4P6Mh7tWWjJ-AxXS3lfMr97kBems39Ij88E15MceGp2MRiBE/s640/dboard.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Weekly BG summaries with dboard&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Nightscout&amp;nbsp;provides its own analytics, which are very useful. I also wrote a webpage to provide a weekly summary called &lt;a href=&quot;https://github.com/tomwhite/dboard&quot;&gt;dboard&lt;/a&gt; that reads data from Nightscout&amp;nbsp;and shows a few key stats (time in range, average BG, estimated HbA1c) for the week, so I can see at a glance how the week was.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;-en-clipboard: true;&quot;&gt;
Turning to &lt;b&gt;insulin&lt;/b&gt;, MDI uses two types of insulin - a basal dose of long-acting insulin (I use Levemir) every night before bed that provides a background supply of insulin over the day, and bolus doses of rapid-acting insulin (I use NovoRapid) taken before every meal or snack and which are adjusted to “cover” the carbs in that meal.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I don’t have an insulin pump. After I was diagnosed I assumed that I would eventually move on to one, since they offer a high degree of blood glucose control. However, my doctor said that since my control was very good using MDI, there wasn’t a strong reason to move to a pump. I&#39;m still on MDI, and it works well for me. I was quite surprised to find that the needles on insulin pens are so fine that you can barely feel them, so injections are not normally painful. Extracting a drop of blood from a finger with a lancet for testing the blood glucose level hurts more.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Interestingly, it’s very likely that I’m still in the “honeymoon phase” of T1D, which is when the body still produces some insulin. This helps with control, and is probably another reason MDI works well for me. The literature on the duration of the honeymoon phase is maddeningly vague, but it’s typically between months and years. (One interesting &lt;a href=&quot;https://onlinelibrary.wiley.com/doi/full/10.1111/dme.13802&quot;&gt;paper&lt;/a&gt;&amp;nbsp;I found suggests that doing regular exercise can prolong the honeymoon. A good reason to keep up the running…)
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
How do I know how much insulin to take? The nightly basal dose is fixed and the same every day - the dose was arrived at by trial and error soon after diagnosis, and it hasn’t changed much since.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Bolus doses for meals depend on two main variables: the amount of carbohydrate in the meal, and (to a lesser extent) the amount of exercise I’m expecting to do over the following few hours. This is the most fiddly part of managing T1D, since I have to work out the number of carbs in everything I eat. What’s more, I have to try to take my insulin at the right time before eating since injected insulin takes a while to get into the blood stream and become effective. To complicate things, some foods release glucose slowly, others a lot faster.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For carb counting at home where we cook most of our meals from scratch I wrote a web app called Ingreedy that calculates the number of carbs in a meal from its ingredients. This was especially useful in the early days when we had no idea about the carbs in particular foods. I also eat fewer carbs than I used to, around 120g a day.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOlxu-Xkm70obwAI7HCl9qYWFL4KR5vHrs5f2tByKf2Fa5m1o4L-pzN5wgGTbULV0l1rseuu3VSf0FXn2vDm83jQ84OJsg6F2RYYjyCI9LrsonOfIfxBhW4BnOL6txQFATI63uiv8b0zn2/s1600/ingreedy.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1037&quot; data-original-width=&quot;1600&quot; height=&quot;414&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOlxu-Xkm70obwAI7HCl9qYWFL4KR5vHrs5f2tByKf2Fa5m1o4L-pzN5wgGTbULV0l1rseuu3VSf0FXn2vDm83jQ84OJsg6F2RYYjyCI9LrsonOfIfxBhW4BnOL6txQFATI63uiv8b0zn2/s640/ingreedy.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Carb counting a recipe with Ingreedy&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;-en-clipboard: true;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I&#39;m now better at eyeballing the (rough) number of carbs in food, which I need to do when eating out. If I’m unsure I use the &lt;a href=&quot;https://www.carbsandcals.com/app/app&quot;&gt;Carbs &amp;amp; Cals app&lt;/a&gt; which has photos of foods for different portion sizes and their carb counts.&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
After getting a carb count I have to convert this into the amount of insulin to take - there is a simple ratio to calculate this (e.g. 15g carbs translates to 1 unit of insulin), but the final amount is adjusted by my current BG reading, insulin already &quot;on board&quot; (i.e. in my body), and any exercise I’m going to do in the next few hours. I have a Google spreadsheet that acts as a food diary and does the calculation for me. Then I manually log the meal entry into Nightscout, so I have a log of number of carbs eaten and insulin taken.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;div&gt;
When I was first diagnosed I was told that it’s important not to always inject in the same place, since it can make injections less effective (and also cause damage to the area concerned). So I needed a scheme to &lt;b&gt;rotate injection sites&lt;/b&gt;. At first I recorded a note of the site I just used on paper so I could choose the next one by looking at the note, but that quickly became tiresome, so I made a little gadget out of cardboard with a pin that I moved every time I did an injection. I still use that for my nightly basal injections.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For my meal bolus injections I now use a scheme that maps day of week and meal to an injection site on my tummy. This means I rotate through sites once a week, which is fine, and most importantly it’s stateless (i.e. I don’t need to remember where the previous site was). (Writing this prompts me to think about moving &amp;nbsp;to a similar scheme for my basal injections.)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI29Faj33QWm8KNyN_WbGokjiT4FYpgI6Hi8Aby0HuINdd8tI1ZNbMGUAQgN5PZd8urr95s-LRTS24juY41KjCOP5l2t98RW4oTXtJSoKNywcb8j5a9KFiMm1mgsGWY38g1p2ZkdKUaSx4/s1600/site-rotations.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;660&quot; data-original-width=&quot;758&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI29Faj33QWm8KNyN_WbGokjiT4FYpgI6Hi8Aby0HuINdd8tI1ZNbMGUAQgN5PZd8urr95s-LRTS24juY41KjCOP5l2t98RW4oTXtJSoKNywcb8j5a9KFiMm1mgsGWY38g1p2ZkdKUaSx4/s320/site-rotations.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;div&gt;
&lt;b&gt;Low blood sugar&lt;/b&gt; is an inevitable part of T1D. Sometimes you misjudge the amount of insulin and take too much (the pens I use can only administer whole units, so you have to round up or down to the nearest unit), or you do more exercise than you anticipated, or for some other reason your BG goes lower than you want it to. Although I can feel a hypo coming on, the Libre is a very useful tool for heading them off as I can see how quickly my BG is changing and possibly pre-empt a hypo. (For example, if my BG is a bit lower than expected and I’m going to go out soon I might eat something so I don’t go too low.)
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When I’m having a hypo I will take glucose tablets, which I like for two reasons. First, they have a fixed dose (4g of carbs), and second they don’t taste that nice so you aren’t tempted to overdo the glucose and go too high.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I’ll also fall back to measuring BG with a finger prick test since blood generally gives a more accurate and more up-to-date reading than the Libre (which measures glucose from interstitial fluid, and has a 5 to 10 minute delay to changes in BG). I have a spare meter for this, or I use the Libre with a test strip.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

It’s easily overlooked, but making sure I have all the &lt;b&gt;supplies&lt;/b&gt; I need requires a bit of organization. I thought about building an app that notifies me when I need to order something, but I never got round to it. Instead I have a calendar reminder each week to check supplies and order more of any that are running low. Low tech, but works for me so far.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;div&gt;
Finally, there are a few things I’ve been thinking about changing or tweaking slightly.&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Can I replace the Libre reader with the phone app?
&lt;/li&gt;
&lt;li&gt;Do I need dboard given that both Libre and Nightscout&amp;nbsp;have good analytics?
&lt;/li&gt;
&lt;li&gt;Can I log insulin doses automatically (e.g. with &lt;a href=&quot;https://www.diabnext.com/clipsulin-c3/&quot;&gt;CLIPSULIN&lt;/a&gt;)?
&lt;/li&gt;
&lt;li&gt;Do I need to log meals and carbs?
&lt;/li&gt;
&lt;li&gt;Is there a way of recording hypos? (Preferably automatically since when you are&amp;nbsp;having a hypo you don’t think about logging stuff.)
&lt;/li&gt;
&lt;li&gt;How can we make it easier to move someone’s entire T1D data between systems?&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/8750887944922509499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/8750887944922509499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8750887944922509499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8750887944922509499'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2019/11/how-i-manage-my-diabetes.html' title='How I manage my diabetes'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggxEn8SmasqEatCItD2doxEWu_DJxuYPIOV05LhrBaw5QQianzmZMmUwSxK-P5z2_qtXDc2FBOJfWm-lMBgUos2gDuntQzxgW487_3OPI7IiRXA7Dy84lYuMrrkqM2o8p8Hd9WROd5ndp_/s72-c/IMG_0041.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-7550221259075042528</id><published>2018-04-27T14:41:00.000+01:00</published><updated>2018-04-27T14:41:34.527+01:00</updated><title type='text'>Pastures new-ish</title><content type='html'>After nine and a half years, today is my last day at Cloudera. It’s difficult to write those words as so much of my life has been bound up with this company. On the day I started, I didn’t meet my co-workers as I was living several thousand miles away in a barn in Wales. (The others were in a borrowed meeting room in San Mateo.) As I leave I am still in a barn in Wales (different barn though), but a lot has happened in the intervening period.&lt;br /&gt;
&lt;br /&gt;
On the personal side, my family and I lived in San Francisco during the early formative years of Cloudera, a time we will always treasure for the lifelong friendships we made.&lt;br /&gt;
&lt;br /&gt;
On the professional side, it is no exaggeration to say that working at Cloudera has been the highlight of my career. I already knew that Hadoop was pretty special when I joined (I may have been biased as I was writing a book on it), but I had no idea how it would transform the industry and how it would be used in every sector you could imagine.&lt;br /&gt;
&lt;br /&gt;
To all of you I have worked with over the last decade—at Apache, Cloudera and elsewhere, on many projects—I consider myself to be incredibly fortunate to have had the opportunity to work with you. Thank you.&lt;br /&gt;
&lt;br /&gt;
So what’s next for me?&lt;br /&gt;
&lt;br /&gt;
Jim Waldo, who worked on distributed systems at Sun, once said that he alternated six month periods between the lab and the outside world: in the lab he and his team built systems software, and in the outside world he saw how people used the system he was building. Doing so gave him valuable feedback on the system design, even though it was time away from being able to build the system.&lt;br /&gt;
&lt;br /&gt;
In some ways this is another way of framing the explore/exploit tradeoff, where you decide between exploring new technological ground—building a new system—and exploiting that system to solve particular problems you are interested in, which is why you built the system in the first place. (Of course, this framing is oversimplified, since there are many people working on both parts simultaneously. It’s a useful way of thinking about things as an individual actor though.)&lt;br /&gt;
&lt;br /&gt;
For the past few years I have been working on a few open source biology and healthcare projects (like &lt;a href=&quot;https://blog.cloudera.com/blog/2016/04/genome-analysis-toolkit-now-using-apache-spark-for-data-processing/&quot;&gt;GATK&lt;/a&gt;, &lt;a href=&quot;https://blog.cloudera.com/blog/2017/05/hail-scalable-genomics-analysis-with-spark/&quot;&gt;Hail&lt;/a&gt;, and &lt;a href=&quot;https://blog.cloudera.com/blog/2017/12/large-scale-health-data-analytics-with-ohdsi/&quot;&gt;OHDSI&lt;/a&gt;). I think that the problems in biology are big enough and messy enough that new systems will need to be built. We can’t stop exploring the technological ground since the sheer amount of data will overwhelm even the best of today’s cutting-edge technology. (I like to cite the paper &lt;a href=&quot;http://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.1002195&quot;&gt;Big Data: Astronomical or Genomical?&lt;/a&gt; here for some concrete numbers.)&lt;br /&gt;
&lt;br /&gt;
Having said that, there is still a lot of mileage left in our current crop of tools—which include Spark, TensorFlow, Jupyter, and the cloud. And this is what I am going to do: continue the work to apply tools like these to more bio projects, only now working as a freelancer. I plan to write more about what I’m up to on this blog, so please follow along.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMjQ6q6XtTaNmC73pilJv7dUBLkHoit1sqz-lhss4PA6edkyiSwt6EbzIO8NwxMwpIAGu8qkdIVbYhg0EoKAazS1-AA_1QiOa6BPhlPJwNJ-oJ850WJWkOiNdF2fZs9jxDkSUg0_bGh0E8/s1600/IMG_0245.PNG&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1334&quot; data-original-width=&quot;750&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMjQ6q6XtTaNmC73pilJv7dUBLkHoit1sqz-lhss4PA6edkyiSwt6EbzIO8NwxMwpIAGu8qkdIVbYhg0EoKAazS1-AA_1QiOa6BPhlPJwNJ-oJ850WJWkOiNdF2fZs9jxDkSUg0_bGh0E8/s400/IMG_0245.PNG&quot; width=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Cloudera Inbox Zero for the first time ever!&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/7550221259075042528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/7550221259075042528' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/7550221259075042528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/7550221259075042528'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2018/04/pastures-new-ish.html' title='Pastures new-ish'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMjQ6q6XtTaNmC73pilJv7dUBLkHoit1sqz-lhss4PA6edkyiSwt6EbzIO8NwxMwpIAGu8qkdIVbYhg0EoKAazS1-AA_1QiOa6BPhlPJwNJ-oJ850WJWkOiNdF2fZs9jxDkSUg0_bGh0E8/s72-c/IMG_0245.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-6892220172758872373</id><published>2018-04-15T15:40:00.000+01:00</published><updated>2018-04-15T15:40:09.251+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="T1D"/><title type='text'>Type 1 Diabetes</title><content type='html'>&lt;div style=&quot;-en-clipboard: true;&quot;&gt;
On 16 February this year I was diagnosed with Type 1 Diabetes.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I had been feeling under the weather - a bit weak, but also persistently thirsty and hungry. I would gulp down a large glass of water in one go with ease (a bit like I did when I was 10 years old after running around outside for hours on a hot day), and I would do this several times every day. I would eat a sandwich after dinner, even after having seconds. Strangely, I was losing weight despite eating a lot. And I found it hard to complete my usual morning run, and when I did manage it, it was noticeably slower than normal.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In retrospect these are all classic symptoms of &lt;a href=&quot;https://en.wikipedia.org/wiki/Diabetes_mellitus_type_1&quot;&gt;type 1 diabetes&lt;/a&gt;: weight loss, increased thirst and hunger. My body was not producing enough insulin, which is needed to use the glucose in my blood. The weight loss occurred because my body was using fat reserves for energy. My heightened thirst was my body’s way of trying to flush the excess glucose from my system by getting me to urinate more.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So I went to see the doctor and she arranged a blood test, which I had the next day. That was at lunchtime on Friday, and the nurse who took my blood said it would be a week or two before the results came back. So I was surprised when the phone rang at 6pm, and the doctor’s receptionist asked me to come in. On Friday evening? Weren’t they closed then?
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A few minutes later I went in, and she said that my blood glucose level was over 30, and that normally it would be 7. “Tom, you have diabetes.” I didn’t know what to say. I remember asking what the blood glucose level was measured in (millimoles per litre). (I’m always impressing on my daughters the importance of units in science.)
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I also asked how they knew it was Type 1. Mainly from the symptoms - I&#39;m quite skinny! Most people with diabetes have Type 2, which is characterised by insulin resistance: the body is still producing insulin, but it can’t use it as effectively. Less than 10% of diabetes sufferers have Type 1, and while most of those are children, adults can get the disease too.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The doctor sent me to the hospital straightaway so they could check if my body was coping with the high sugar levels. Left untreated, high blood glucose levels can lead to a dangerous condition called ketoacidosis.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I rang Eliane to tell her, and we both had a bit of a wobble. She drove over to take me to the hospital. We went to the Emergency Admissions Unit, where they would check my ketone levels (which, thankfully, were normal) and give me a shot of insulin. After that I could go home - there was no need to stay overnight, but they asked me to go back the next day and Sunday to be given insulin again.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The next day, Monday, I saw the Diabetic Specialist Nurse (DSN) who gave me a blood glucose monitor and insulin pens so I could manage the condition myself. She explained my new routine: before every meal and before bed I have to check my blood glucose level and inject insulin. The bedtime insulin is a slow-acting background insulin that lasts for almost a whole day, whereas the mealtime insulin is fast-acting and is meant to compensate for the blood glucose level rise caused by the carbohydrates in the meal. The idea is that you count the number of carbohydrates in the meal you are about to eat, then calculate the number of units of insulin that are needed to cover it.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;It doesn’t sound like much, but I hadn’t really paid much attention to the nutritional composition of meals before. And nor had Eliane. We eat healthily, and mainly cook from scratch, but having to analyse each meal was a big change. In the first few weeks it felt like we were spending all our time analysing recipes. It gets easier, but it’s still time consuming.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The goal with diabetes is to keep the blood glucose level between 4 and 7 mmol/l. A person without diabetes has a pancreas that does this for them. Unfortunately, my pancreas has stopped performing this role, hence the need for injected insulin. There are two things to avoid: hyperglycaemia, which is when the blood glucose level is too high, and hypoglycaemia when it is too low.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Broadly speaking, hyperglycaemia has long term effects (such as&amp;nbsp;cardiovascular problems), while hypoglycaemia needs to be treated immediately since its more severe form can require hospitalisation. Normally though, treating a mild “hypo” involves eating something with very fast acting sugar in it (like glucose tablets) and waiting 15 minutes for the level to get back in range. During this time you likely feel weak and shaky.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This chart shows all my blood glucose readings. In the first couple of weeks all my readings were out of range, but then they started stabilising, and now they are mainly in range.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKyuYkXCKPItKNRhv1RlB2z1W8Li4ju2w5p8Q09gmeYOLH_dSluEPv9E4Y6YFJfTWLtfMDE_tfOJI3TNFkKEu12LghoHd3GNtAU3IlQaLm4GAMvtE0arLtfKrOCOQ1mfi0QCImMH_KkZfn/s1600/blood_glucose.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;480&quot; data-original-width=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKyuYkXCKPItKNRhv1RlB2z1W8Li4ju2w5p8Q09gmeYOLH_dSluEPv9E4Y6YFJfTWLtfMDE_tfOJI3TNFkKEu12LghoHd3GNtAU3IlQaLm4GAMvtE0arLtfKrOCOQ1mfi0QCImMH_KkZfn/s1600/blood_glucose.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

&lt;div&gt;
When someone is newly diagnosed with diabetes in the UK, the full support network of the NHS swings into action.&amp;nbsp;In addition to my GP, I have a diabetes consultant, two DSNs, and a dietitian. I saw all of these people in the first week, and I have ongoing support from the DSNs and the dietitian, who I can phone or email if I have a question, or need some help with my insulin dose adjustment. I have a recurring appointment with the consultant every six months. I’ve also been added to the system for annual screening for eye disease. The NHS also provides education programs for carb counting and insulin dose adjustment (one has the fabulous acronym DAFYDD - dose adjustment for your daily diet), as well as an excellent series of videos for newly diagnosed patients. All of this is free. And in Wales, where I live, there are no prescription charges for anyone (for people with diabetes in England, prescriptions are free too), so I don’t have to pay for the medical supplies that I now depend on every day.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
All of the medical staff that Eliane and I have encountered in the last two months have been unfailingly kind and supportive, even when working under pressure (like the first night in the EAU). It’s incredibly reassuring to have access to the resources the NHS provides. I would like to thank everyone there, along with my family, friends, and colleagues from work who have helped me get through the last two months.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/6892220172758872373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/6892220172758872373' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/6892220172758872373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/6892220172758872373'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2018/04/type-1-diabetes.html' title='Type 1 Diabetes'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKyuYkXCKPItKNRhv1RlB2z1W8Li4ju2w5p8Q09gmeYOLH_dSluEPv9E4Y6YFJfTWLtfMDE_tfOJI3TNFkKEu12LghoHd3GNtAU3IlQaLm4GAMvtE0arLtfKrOCOQ1mfi0QCImMH_KkZfn/s72-c/blood_glucose.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-8139455568491892451</id><published>2016-06-22T14:10:00.000+01:00</published><updated>2016-06-22T14:30:17.499+01:00</updated><title type='text'>Be Part of Something Bigger - Vote #Remain </title><content type='html'>David Cameron did not have to call this referendum. He did so in an attempt to settle the European issue within his own party, as there is no new EU treaty that we are voting on. The referendum is not binding either, as the legal blogger David Allen Green &lt;a href=&quot;http://blogs.ft.com/david-allen-green/2016/06/17/david-camerons-unnecessary-eu-referendum/&quot;&gt;pointed out&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Far from quelling the debate within the Tory party, the lead up to the referendum has had the opposite effect. The debate over the last couple of months has been increasingly toxic, with both sides making outlandish claims. Parts of the Leave campaign have been xenophobic and racist, in an attempt to scare people to leaving the EU - this is the true Project Fear. And then last week the appalling murder of the Labour MP Jo Cox brought about some reflection on how we’ve moved away from a more respectful, kinder politics. In the words of Stephen Kinnock, &quot;When insecurity, fear and anger are used to light a fuse, an explosion is inevitable.”&lt;br /&gt;
&lt;br /&gt;
But there is a referendum tomorrow, so we have a duty to vote. The vote is about a host of &lt;a href=&quot;https://www.theguardian.com/commentisfree/2016/jun/22/we-must-remain-final-plea-undecided&quot;&gt;issues&lt;/a&gt;, and on all of them I believe we are better staying as a member of the EU. In my mind it boils down to being a part of something bigger than yourself. This is true on a personal level - being part of a company, a team, a club, or an organisation allows you to achieve more than if you go it alone. I’ve seen this in my professional life where loose-knit groups of programmers build open source software that an individual could never dream of. Of course, where there are many personalities pulling in different directions you get conflict, things get messy, compromises are needed, and you don’t always get your own way. But on some decisions you &lt;i&gt;do&lt;/i&gt; have influence, and you &lt;i&gt;do&lt;/i&gt; get to shape the results.&lt;br /&gt;
&lt;br /&gt;
Being a part of the EU is about the UK being a part of something bigger, and being able to influence policy on issues that affect the UK. The world is a messy chaotic place, and there are many deeply-ingrained, complex problems that require complex policy interventions. Climate change, migration, tax havens, peace - to name a few - all of these need a coordinated approach that cross national borders. Leaving would squander our influence in attacking these problems, while doing nothing to solve them - for us or for the the rest of the world.&lt;br /&gt;
&lt;br /&gt;
One of the more worrying themes of the Leave campaign is not to trust the experts. This allows them to conveniently dismiss the overwhelming opinion amongst economists that &lt;a href=&quot;http://www.independent.co.uk/news/uk/politics/eu-referendum-live-updates-brexit-polls-how-to-vote-what-happens-to-uk-economy-ifs-niesr-lse-a7093111.html)&quot;&gt;Brexit would mean the UK is worse off outside the EU&lt;/a&gt;. It’s like climate change denial, and running a country with that kind of gut-feeling policy making is terrifying.&lt;br /&gt;
&lt;br /&gt;
Britain has been at its best when it has been an outward-looking nation, one that works with others and trades with others. That’s why I am going to vote to Remain in the EU.
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/8139455568491892451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/8139455568491892451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8139455568491892451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8139455568491892451'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2016/06/be-part-of-something-bigger-vote-remain.html' title='Be Part of Something Bigger - Vote #Remain '/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-6311754475867855468</id><published>2015-07-05T22:18:00.000+01:00</published><updated>2015-07-05T22:18:27.324+01:00</updated><title type='text'>The Earth Moon Game</title><content type='html'>If the Moon were the size of a tennis ball then the Earth would be the size of a basketball. How far apart should the balls be placed so that the distance is to scale?&lt;br /&gt;
&lt;br /&gt;
Before you read on, you might like to have a go yourself. If you don&#39;t have a tennis ball and basketball to hand, you can play with this&amp;nbsp;&lt;a href=&quot;https://tomwhite.github.com/earth-moon-game&quot;&gt;online version&lt;/a&gt;&amp;nbsp;I wrote.&lt;br /&gt;
&lt;br /&gt;
My kids and I had a stall at our school fair this Friday where we played this as a game:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA3N_HE7yKVTc2AlNWIC2dB_1HmNJ1WYwmKqrsMlLmc7vhL3Srqd1AbYuhrHz_WZoEAFSoVi-PM0nhxhc94BVHoMxPL0A7dM5lAQkeekVdTBSdVdzfpmDZZZ3ZwwCovRTdwaxnU0p5DLQ-/s1600/20150703_185831.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA3N_HE7yKVTc2AlNWIC2dB_1HmNJ1WYwmKqrsMlLmc7vhL3Srqd1AbYuhrHz_WZoEAFSoVi-PM0nhxhc94BVHoMxPL0A7dM5lAQkeekVdTBSdVdzfpmDZZZ3ZwwCovRTdwaxnU0p5DLQ-/s640/20150703_185831.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Earth&quot;&gt;Earth&lt;/a&gt;&#39;s diameter is 12,742 km and the&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Moon&quot;&gt;Moon&lt;/a&gt;&#39;s is 3,475 km, so the Earth&#39;s diameter is about 3.7 larger. (We measured the basketball&#39;s diameter to be 23.5 cm, and the tennis ball to be 6.5 cm, so the ratio is about 3.6, which is pretty close!)&lt;br /&gt;
&lt;br /&gt;
The Moon is (on average) 384,400 km from the Earth (the&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Lunar_distance_(astronomy)&quot;&gt;Lunar distance&lt;/a&gt;, measured from the centres of the two bodies), which is 111 times the Moon&#39;s diameter. Scaling this to the tennis ball, we get a distance of 111 × 6.5 cm =&amp;nbsp;&lt;b&gt;7.2 metres&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Here&#39;s a picture showing the results at the end of the fair:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhiwOt3TR8m0ptiugfe7hyL6x5G_u2FqoIDjgJoIjtzNbeIwn_xQqmyRwbPwvPfOZ27XIr3GN3XE5IzH_rzKqts6PX0ekQRlYSweZBASULLfhOHfYQLkbol_eiU2YZrv9DRkGSMMyMWH2/s1600/20150703_191328.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikhiwOt3TR8m0ptiugfe7hyL6x5G_u2FqoIDjgJoIjtzNbeIwn_xQqmyRwbPwvPfOZ27XIr3GN3XE5IzH_rzKqts6PX0ekQRlYSweZBASULLfhOHfYQLkbol_eiU2YZrv9DRkGSMMyMWH2/s640/20150703_191328.jpg&quot; width=&quot;360&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The basketball representing the Earth is in the bottom of the picture, and the tennis ball just visible at the top is the Moon, 7.2 metres away. To the right of the green tape are white flags that are the players&#39; guesses for where the Moon would be.&lt;br /&gt;
&lt;br /&gt;
It&#39;s striking that&amp;nbsp;&lt;i&gt;all&lt;/i&gt;&amp;nbsp;the guesses were too low. This seems to be a mixture of two things. Firstly, people really do think that the Moon is closer than it actually is. Secondly, people tend to copy other people, so they would place their flags close to where the others were. (We told everyone that the Moon didn&#39;t have to be restricted to the green tape - that just happened to be how long it was.)&lt;br /&gt;
&lt;br /&gt;
We saw a few interesting tactics though. One girl put one flag so it was the closest to the Earth compared to all the other flags, then another so it was the furthest out. She seemed to think that everyone else had either over- or underestimated the distance - which of course they had! (She didn&#39;t win though, as someone put their flag even further out later on.) Someone else put five flags over a range of about 25cm where she thought the Moon would be.&lt;br /&gt;
&lt;br /&gt;
The most successful approach seemed to be for the player to stand where the Earth is, and have someone walk away holding the tennis ball until it subtends the same angle as the Moon does in the sky (or your mind&#39;s eye). This is easier said than done, however. The player in fourth place (who was about five years old) used this technique.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgClrVVAjXGnIz5ahN5B0FwqME7gW2h1qwMkBV2BAZ0FSKRPx_3gnE0YLG9sP4O9LD5r2b2azsqoH2rjjjZWh35gbADKJnEH1DM8lqFeA__uUUT69wEQQ69olekgxUdCXfqfECbJ_0yC9UC/s1600/20150705_215657.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgClrVVAjXGnIz5ahN5B0FwqME7gW2h1qwMkBV2BAZ0FSKRPx_3gnE0YLG9sP4O9LD5r2b2azsqoH2rjjjZWh35gbADKJnEH1DM8lqFeA__uUUT69wEQQ69olekgxUdCXfqfECbJ_0yC9UC/s400/20150705_215657.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Here&#39;s the &lt;a href=&quot;https://raw.githubusercontent.com/tomwhite/earth-moon-game/master/school-fair/results.csv&quot;&gt;data&lt;/a&gt; &lt;a href=&quot;https://github.com/tomwhite/earth-moon-game/blob/master/school-fair/moon.r&quot;&gt;plotted&lt;/a&gt; graphically, with each flag shown as a line. The blue line represents Earth, and the orange line the Moon.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAWjGP2L-maJD_ar9bpIPs7i0Ia66VjMSxK2elIpofZt0BdxOFTWNZOjREvd3uN-ol2j7apTEw1SYfj8kogi0oYlNvCnmw3_0b_LULtg49Xj6j8EOEwH8WS-4jfF9dFuI7Y_Y8eDIT-9je/s1600/earth-moon.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAWjGP2L-maJD_ar9bpIPs7i0Ia66VjMSxK2elIpofZt0BdxOFTWNZOjREvd3uN-ol2j7apTEw1SYfj8kogi0oYlNvCnmw3_0b_LULtg49Xj6j8EOEwH8WS-4jfF9dFuI7Y_Y8eDIT-9je/s1600/earth-moon.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Interestingly, the guesses did not benefit from the&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/The_Wisdom_of_Crowds&quot;&gt;Wisdom of Crowds&lt;/a&gt;&amp;nbsp;effect, where the average tends to be a good predictor of the actual answer:&lt;br /&gt;
&lt;blockquote&gt;
The opening anecdote [of the book of the same name by James Surowiecki] relates Francis Galton&#39;s surprise that the crowd at a county fair accurately guessed the weight of an ox when their individual guesses were averaged&lt;/blockquote&gt;
For the Earth Moon Game, however, the median distance was 2.6 metres, and the mean was 2.7 metres, which was 2.3 standard deviations (sd=1.96 metres) from the true distance, 7.2 metres.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/6311754475867855468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/6311754475867855468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/6311754475867855468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/6311754475867855468'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2015/07/the-earth-moon-game.html' title='The Earth Moon Game'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA3N_HE7yKVTc2AlNWIC2dB_1HmNJ1WYwmKqrsMlLmc7vhL3Srqd1AbYuhrHz_WZoEAFSoVi-PM0nhxhc94BVHoMxPL0A7dM5lAQkeekVdTBSdVdzfpmDZZZ3ZwwCovRTdwaxnU0p5DLQ-/s72-c/20150703_185831.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-4539175856543595522</id><published>2015-04-19T18:09:00.000+01:00</published><updated>2015-04-19T18:09:55.886+01:00</updated><title type='text'>The Hay Dark Skies Festival, Reverend Thomas William Webb, and Jupiter</title><content type='html'>In 2013, the &lt;a href=&quot;http://www.bbc.co.uk/news/uk-wales-21496562&quot;&gt;Brecon Beacons was designated&lt;/a&gt; a &lt;a href=&quot;http://en.wikipedia.org/wiki/Dark-sky_preserve&quot;&gt;Dark Sky Reserve&lt;/a&gt;, and a year later the first &lt;a href=&quot;http://www.darkskiesfestival.org/&quot;&gt;Dark Skies Festival&lt;/a&gt; was held in Hay-on-Wye. The second festival took place this weekend, and my family went along to some of the activities.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj03DnQTm4GgJ3oPixRy3EcSDtAvqa60VelEOG90UgkFni4cUPs32Zq_gWTGXsYuUm1oLJhOguFfy_gLSNPqQpKgtpcJRX1NIbqHRctIEw00-xOOn56lFZniq1VHANliVMa48DJm2kirutb/s1600/20150418_195650.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj03DnQTm4GgJ3oPixRy3EcSDtAvqa60VelEOG90UgkFni4cUPs32Zq_gWTGXsYuUm1oLJhOguFfy_gLSNPqQpKgtpcJRX1NIbqHRctIEw00-xOOn56lFZniq1VHANliVMa48DJm2kirutb/s1600/20150418_195650.jpg&quot; height=&quot;180&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Young stargazers, Lottie and Millie&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
In the morning, we found ourselves in a planetarium tent, then we looked at sunspots, and held pieces of meteorite.&lt;br /&gt;
&lt;br /&gt;
The evening event was stargazing at &lt;a href=&quot;https://goo.gl/maps/ZC9tT&quot;&gt;Holy Trinity Church&lt;/a&gt; in Hardwicke, just outside Hay. Quite apart from the lack of light pollution, the location was a special one, since the vicar of the parish from 1856 until 1885 was&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Thomas_William_Webb&quot;&gt;Reverend Thomas William Webb&lt;/a&gt;, who in his spare time observed the night sky with telescopes and an observatory he had built himself.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxqrsh6Div3_OmJf9a5cexIGT8cFWfxJWfi8Ar3bdtPbqtQJrDM4TQ9FxV6pAlN4HPMJemmKFsQJ2XDZVvIu-qdp3NOFGnQbTZUi0U_pq0uNjhtIbZDzUFKaaL5o0YKqSLe9I3HhdYMgQD/s1600/20150418_195131.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxqrsh6Div3_OmJf9a5cexIGT8cFWfxJWfi8Ar3bdtPbqtQJrDM4TQ9FxV6pAlN4HPMJemmKFsQJ2XDZVvIu-qdp3NOFGnQbTZUi0U_pq0uNjhtIbZDzUFKaaL5o0YKqSLe9I3HhdYMgQD/s1600/20150418_195131.jpg&quot; height=&quot;320&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Holy Trinity Church, Hardwicke&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
In 1859, while at Hardwicke he wrote the classic book,&amp;nbsp;&lt;a href=&quot;https://archive.org/details/celestialobject02webbgoog&quot;&gt;Celestial Objects for the Common Telescope&lt;/a&gt;, the object of which was &quot;to furnish the possessors of ordinary telescopes with plain directions for their use, and a list of objects for their advantageous employment&quot;.&lt;br /&gt;
&lt;br /&gt;
The book remained in print well into the following century (and was recently &lt;a href=&quot;http://www.cambridge.org/us/academic/subjects/astronomy/observational-astronomy-techniques-and-instrumentation/celestial-objects-common-telescopes&quot;&gt;republished by Cambridge University Press&lt;/a&gt;), and it&#39;s probably difficult to overemphasise the importance of this book in encouraging generation after generation of amateur stargazers.&lt;br /&gt;
&lt;br /&gt;
In the words of &lt;a href=&quot;http://www.herefordshirelife.co.uk/people/herefordshire_people_reverend_thomas_webb_the_stargazer_of_hardwicke_1_1632990&quot;&gt;Janet and Mark Robinson&lt;/a&gt;, who used to live in the vicarage and have edited &lt;a href=&quot;http://www.gracewing.co.uk/page334.html&quot;&gt;a book about Webb&lt;/a&gt;,&lt;br /&gt;
&lt;blockquote&gt;
Like Patrick Moore, he was an enthusiast who wanted to inspire as many people as possible to look through a telescope. Even at the choir party he &quot;arranged the telescope and acted as showman and all in turn had a look at Saturn&quot;.&lt;/blockquote&gt;
Webb would no doubt have been pleased to see yesterday&#39;s gathering of enthusiastic amateurs (including the Robinsons) with an impressive range of telescopes, on a cold but very clear night. The highlight for us was seeing Jupiter and its four brightest moons (Io, Europa, Ganymede and Callisto) through a large reflecting telescope. We could even see the north and south belts, and the Great Red Spot (or Pink Splodge as Lottie named it).&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdIiMOdIn9dOoCtBcxkzSMZkhcgdkjkWsIIlBL2PSZoaasWr5wSOZgbwyyxWGHuYqHusIX8KdFimAEQaF1BlExtrjwJBOL3ohSSL9LZVHq_UH2htBMxghXYsjY6o5FOhXTsmdowjogZ7aM/s1600/20150418_210623.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdIiMOdIn9dOoCtBcxkzSMZkhcgdkjkWsIIlBL2PSZoaasWr5wSOZgbwyyxWGHuYqHusIX8KdFimAEQaF1BlExtrjwJBOL3ohSSL9LZVHq_UH2htBMxghXYsjY6o5FOhXTsmdowjogZ7aM/s1600/20150418_210623.jpg&quot; height=&quot;180&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Sunset. Venus is visible top centre&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Thank you to the organisers of the Hay Dark Skies Festival, and the volunteers from the&amp;nbsp;&lt;a href=&quot;http://www.uskastronomicalsociety.org.uk/&quot;&gt;Usk Astronomical Society&lt;/a&gt;&amp;nbsp;(the oldest astronomical society in the UK), the&amp;nbsp;&lt;a href=&quot;http://abergavennyas.org.uk/&quot;&gt;Abergavenny Astronomy Society&lt;/a&gt; and the&amp;nbsp;&lt;a href=&quot;http://www.hovastronomy.org.uk/&quot;&gt;Heads of the Valleys Astronomical Society&lt;/a&gt;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/4539175856543595522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/4539175856543595522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/4539175856543595522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/4539175856543595522'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2015/04/the-hay-dark-skies-festival-reverend.html' title='The Hay Dark Skies Festival, Reverend Thomas William Webb, and Jupiter'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj03DnQTm4GgJ3oPixRy3EcSDtAvqa60VelEOG90UgkFni4cUPs32Zq_gWTGXsYuUm1oLJhOguFfy_gLSNPqQpKgtpcJRX1NIbqHRctIEw00-xOOn56lFZniq1VHANliVMa48DJm2kirutb/s72-c/20150418_195650.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-8948575044403216039</id><published>2015-03-08T15:33:00.000+00:00</published><updated>2015-03-08T21:28:08.395+00:00</updated><title type='text'>Tennis Ball Parabola</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Here&#39;s an image of me throwing a tennis ball to Lottie:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJUZ7DzzTYpK8FfxvSp71MWiTe3qWA05p5NSX1NacqIiSPX9q9TvYBlpC_1u6qKIJKgKfdWhQfBXmSGjade3LcvwJC5nfsVd3Vi580eiHMZN_X_Y59LdcRYrzm5q7yryZQdqzFxWIrHfc/s1600/result.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJUZ7DzzTYpK8FfxvSp71MWiTe3qWA05p5NSX1NacqIiSPX9q9TvYBlpC_1u6qKIJKgKfdWhQfBXmSGjade3LcvwJC5nfsVd3Vi580eiHMZN_X_Y59LdcRYrzm5q7yryZQdqzFxWIrHfc/s1600/result.jpeg&quot; height=&quot;179&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Millie filmed the video and edited it down to a shorter segment. I turned the resulting video frames into a series of JPEGs by running:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ffmpeg -i Tennis\ Ball.mp4 tennis-%03d.jpeg&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Then I composed them into a single image using ImageMagick:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;convert -compose lighten tennis-014.jpeg tennis-015.jpeg \&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-composite tennis-016.jpeg \&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-composite tennis-017.jpeg \&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-composite tennis-043.jpeg \&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;-composite result.jpeg&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Millie then used &lt;a href=&quot;https://www.desmos.com/&quot;&gt;Desmos&lt;/a&gt;&amp;nbsp;(an online graphing editor)&amp;nbsp;&lt;a href=&quot;https://www.desmos.com/calculator/udjgsp2twp&quot;&gt;to superimpose a parabola on the image&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Update&lt;/b&gt;: Dima&amp;nbsp;Spivak &lt;a href=&quot;https://twitter.com/dimaspivak/status/574633254944276481&quot;&gt;suggested&lt;/a&gt; I use the picture to estimate &lt;a href=&quot;http://en.wikipedia.org/wiki/Gravitational_acceleration&quot;&gt;g&lt;/a&gt;, the acceleration due to gravity.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;My head measures 0.22 m (chin to crown), and is 49 pixels on the picture.&lt;/li&gt;
&lt;li&gt;The vertical distance, &lt;i&gt;d&lt;/i&gt;, from the highest ball to the ball above Lottie&#39;s hands is 204 pixels, or 0.916 m.&lt;/li&gt;
&lt;li&gt;The time, &lt;i&gt;t&lt;/i&gt;, it took to travel this distance was between 12 and 13 frames (it&#39;s hard to say more precisely than this from the picture), which at 29.97 frames per second is between 0.4 and 0.434 seconds.&lt;/li&gt;
&lt;/ul&gt;
The acceleration is 2&lt;i&gt;d&lt;/i&gt;/&lt;i&gt;t&lt;/i&gt;&lt;sup&gt;2&lt;/sup&gt;, which works out at between 9.7 and 11.4 m/s&lt;sup&gt;2&lt;/sup&gt;. This range contains the accepted value of &lt;i&gt;g&lt;/i&gt;, which is 9.8 m/s&lt;sup&gt;2&lt;/sup&gt;.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/8948575044403216039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/8948575044403216039' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8948575044403216039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8948575044403216039'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2015/03/tennis-ball-parabola.html' title='Tennis Ball Parabola'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFJUZ7DzzTYpK8FfxvSp71MWiTe3qWA05p5NSX1NacqIiSPX9q9TvYBlpC_1u6qKIJKgKfdWhQfBXmSGjade3LcvwJC5nfsVd3Vi580eiHMZN_X_Y59LdcRYrzm5q7yryZQdqzFxWIrHfc/s72-c/result.jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-4214990654023824593</id><published>2015-01-16T15:57:00.004+00:00</published><updated>2015-01-16T15:57:58.865+00:00</updated><title type='text'>Hadoop for Science</title><content type='html'>Some of the largest datasets are generated by the sciences. For example, the Large Hadron Collider produces around &lt;a href=&quot;http://wlcg.web.cern.ch/&quot;&gt;30PB of data a year&lt;/a&gt;. I&#39;m interested in the technologies and tools for analyzing these kind of datasets, and how they work with Hadoop, so here&#39;s a brief post.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Open Data&lt;/h3&gt;
Amazon S3 seems to be emerging as the &lt;i&gt;de facto&lt;/i&gt; solution for sharing large datasets. In particular, AWS curates a variety of &lt;a href=&quot;http://aws.amazon.com/public-data-sets/&quot;&gt;public data sets&lt;/a&gt; that can be accessed for free (from within AWS; there are egress charges otherwise). To take one example from genomics, the &lt;a href=&quot;http://www.1000genomes.org/&quot;&gt;1000 Genomes project&lt;/a&gt; hosts a 200TB &lt;a href=&quot;http://aws.amazon.com/1000genomes/&quot;&gt;dataset on S3&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
Hadoop has long supported S3 as a filesystem, but recently there has been a &lt;a href=&quot;https://issues.apache.org/jira/browse/HADOOP-10400&quot;&gt;lot of work&lt;/a&gt; to make it more robust and scalable. It’s natural to process S3-resident data in the cloud, and here there are many options for Hadoop. The recently released &lt;a href=&quot;http://www.cloudera.com/content/cloudera/en/products-and-services/director.html&quot;&gt;Cloudera Director&lt;/a&gt;, for example, makes it possible to run all the components of CDH in the cloud.
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Notebooks&lt;/h3&gt;
By &quot;notebooks&quot; I mean web-based, computational scientific notebooks, exemplified by the &lt;a href=&quot;http://ipython.org/notebook.html&quot;&gt;IPython Notebook&lt;/a&gt;. Notebooks have been around in the scientific community for a long time (they were added to IPython in 2011), but increasingly they seem to be reaching the larger data scientist and developer community. Notebooks combine prose and computation, which is great for exposition and interactivity. They are also easy to share, which helps foster collaboration and reproducibility of research.
&lt;br /&gt;
&lt;br /&gt;
It’s possible to run IPython against PySpark (notebooks are inherently interactive, so working with Spark is the natural Hadoop lead in), but it requires a bit of &lt;a href=&quot;http://blog.cloudera.com/blog/2014/08/how-to-use-ipython-notebook-with-apache-spark/&quot;&gt;manual set up&lt;/a&gt;. Hopefully that will get easier&lt;span style=&quot;font-family: Helvetica; font-size: 12px;&quot;&gt;—&lt;/span&gt;ideally Hadoop distributions like CDH will come with packages to run an appropriately-configured IPython notebook server.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Distributed Data Frames&lt;/h3&gt;
IPython supports many different languages and libraries. (Despite its name IPython is not restricted to Python; in fact, it is being refactored into more modular pieces as a part of the &lt;a href=&quot;http://jupyter.org/&quot;&gt;Jupyter&lt;/a&gt; project.) Most notebook users are data scientists, and the central abstraction that they work with is the &lt;i&gt;data frame.&lt;/i&gt; Both &lt;a href=&quot;http://www.r-project.org/&quot;&gt;R&lt;/a&gt; and &lt;a href=&quot;http://pandas.pydata.org/&quot;&gt;pandas&lt;/a&gt;, for example, use data frames, although both systems were designed to work on a single machine.&lt;br /&gt;
&lt;br /&gt;
The challenge is to make systems like R and pandas work with distributed data. Many of the solutions to date have addressed this problem by adding MapReduce user libraries. However, this is unsatisfactory for several reasons, but primarily because the user has to explicitly think about the distributed case and can’t use the existing libraries on distributed data. Instead, what’s needed is a deeper integration so that the same R and pandas libraries work on local and distributed data.&lt;br /&gt;
&lt;br /&gt;
There are several projects and teams working on distributed data frames, including &lt;a href=&quot;https://www.youtube.com/watch?v=AcyI_V8FeIU&quot;&gt;Sparkling Pandas&lt;/a&gt; (which has the best name), Adatao’s &lt;a href=&quot;http://ddf.io/&quot;&gt;distributed data frame&lt;/a&gt;, and &lt;a href=&quot;http://blaze.pydata.org/docs/dev/index.html&quot;&gt;Blaze&lt;/a&gt;. All are at an early stage, but as they mature the experience of working with distributed data frames from R or Python will become practically seamless. Of course, Spark already provides machine learning libraries for Scala, Java, and Python, which is a different approach to getting existing libraries like R or Pandas running on Hadoop. Having multiple competing solutions is broadly a good thing, and something that we see a lot of in open source ecosystems.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Combining the Pieces&lt;/h3&gt;
Imagine if you could share a large dataset and the notebooks containing your work in a form that makes it easy for anyone to run them—it’s a sort of holy grail for researchers.&lt;br /&gt;
&lt;br /&gt;
To see what this might look like, have a look at the talk by Andy Petrella and Xavier Tordoir on &lt;a href=&quot;http://fr.slideshare.net/noootsab/lightning-fast-genomics-with-spark-adam-and-scala&quot;&gt;Lightning fast genomics&lt;/a&gt;, where they used a &lt;a href=&quot;https://github.com/andypetrella/spark-notebook&quot;&gt;Spark Notebook&lt;/a&gt;&amp;nbsp;and the &lt;a href=&quot;http://bdgenomics.org/&quot;&gt;ADAM&lt;/a&gt; genomics processing engine to run a clustering algorithm over a part of the 1000 Genomes dataset. It combines all the topics above—open data, cloud computing, notebooks, and distributed data frames—into one.&lt;br /&gt;
&lt;br /&gt;
There’s still work to be done to expand the tooling and to make the whole experience smoother, nevertheless this demo shows that it&#39;s possible for scientists to analyse large amounts of data, on demand and in a way that is repeatable, using powerful high-level machine learning libraries. I&#39;m optimistic that tools like this will become commonplace in the not-to-distant future.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/4214990654023824593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/4214990654023824593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/4214990654023824593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/4214990654023824593'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2015/01/hadoop-for-science.html' title='Hadoop for Science'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-1899500969983269448</id><published>2015-01-11T16:53:00.000+00:00</published><updated>2015-01-11T16:53:23.576+00:00</updated><title type='text'>Marmalade</title><content type='html'>I made some marmalade. I&#39;ve never made it before, although I have memories of my parents making it every January, and how slicing the peel seemed to take hours. I used this &lt;a href=&quot;http://www.theguardian.com/lifeandstyle/wordofmouth/2011/jan/20/how-make-perfect-orange-marmalade&quot;&gt;meta recipe from Felicity Cloake&lt;/a&gt; that Eliane found, and it seemed to work pretty well.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinE2bGg-dhRkLmaO7cxRv3bbetRsNmVCZwwNHyIXoM8eU6Hqsr9rJMyUGZ90Y95Al_N6O23UQwSBBWRdOe4tyo624HRpH7jbrJuquzpza_pdTuqY7nB54WarBH0QYavD_O6KFJVS0GSqm5/s1600/IMG_20150110_120440.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinE2bGg-dhRkLmaO7cxRv3bbetRsNmVCZwwNHyIXoM8eU6Hqsr9rJMyUGZ90Y95Al_N6O23UQwSBBWRdOe4tyo624HRpH7jbrJuquzpza_pdTuqY7nB54WarBH0QYavD_O6KFJVS0GSqm5/s1600/IMG_20150110_120440.jpg&quot; height=&quot;320&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVbWcMkrSouVzsp_3q2eXnVzb_DoaDK5sD_-mISjqgO8G-RzznWpjdS8vmnQgxJ-EtIqQ6_bf6fJQt7oZszvysa0jfuyGYzOxzE3iQuR0ZdC0hHsxPD1ZQ9lPZPNMbJ0udHrhfJPdsVOdW/s1600/20150110_123821.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVbWcMkrSouVzsp_3q2eXnVzb_DoaDK5sD_-mISjqgO8G-RzznWpjdS8vmnQgxJ-EtIqQ6_bf6fJQt7oZszvysa0jfuyGYzOxzE3iQuR0ZdC0hHsxPD1ZQ9lPZPNMbJ0udHrhfJPdsVOdW/s1600/20150110_123821.jpg&quot; height=&quot;320&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE4ooTYej5cmXpgYhkxieImUuLAHXw5Zj9eR8008eh4ss6fJmGFiyp9CJLKSExA8ClV1ABxoYZNGjQsyQ1YF2L6NDrKoJ7V99jHFXt1T7M1rIDDlkfeiFZQLVCVdHZ6xop4bOnnzhKQ2JV/s1600/20150110_132550.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE4ooTYej5cmXpgYhkxieImUuLAHXw5Zj9eR8008eh4ss6fJmGFiyp9CJLKSExA8ClV1ABxoYZNGjQsyQ1YF2L6NDrKoJ7V99jHFXt1T7M1rIDDlkfeiFZQLVCVdHZ6xop4bOnnzhKQ2JV/s1600/20150110_132550.jpg&quot; height=&quot;320&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAQyDZSzuVE8mVg986fZJGWwgSGKo_HBwm381TbOcrURIU32yDBZ7YBS4IXh_ROQSHFNI4PrPRg4hYOF1PGzDDuhZUb2RAD1D_ZpRYOSabnFY3ydjRheXnXSiBakhh9ijDu5_HBLNNyaPB/s1600/IMG_20150111_145716.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAQyDZSzuVE8mVg986fZJGWwgSGKo_HBwm381TbOcrURIU32yDBZ7YBS4IXh_ROQSHFNI4PrPRg4hYOF1PGzDDuhZUb2RAD1D_ZpRYOSabnFY3ydjRheXnXSiBakhh9ijDu5_HBLNNyaPB/s1600/IMG_20150111_145716.jpg&quot; height=&quot;320&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-QzGPL_Ns1MSJMeOZlXsOkhVgqnovZwg5-HV3CSoLq2A-C7C2sbXjjyG7fO4Lq79-Eg1PTzsM4poEq2V6nC4H6-LKAIu0w17S2hAiAvRnccsCyQepbNup17nd99E4xiS4KSlPyOXCNGSM/s1600/20150111_094820.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-QzGPL_Ns1MSJMeOZlXsOkhVgqnovZwg5-HV3CSoLq2A-C7C2sbXjjyG7fO4Lq79-Eg1PTzsM4poEq2V6nC4H6-LKAIu0w17S2hAiAvRnccsCyQepbNup17nd99E4xiS4KSlPyOXCNGSM/s1600/20150111_094820.jpg&quot; height=&quot;320&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/1899500969983269448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/1899500969983269448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1899500969983269448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1899500969983269448'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2015/01/marmalade.html' title='Marmalade'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinE2bGg-dhRkLmaO7cxRv3bbetRsNmVCZwwNHyIXoM8eU6Hqsr9rJMyUGZ90Y95Al_N6O23UQwSBBWRdOe4tyo624HRpH7jbrJuquzpza_pdTuqY7nB54WarBH0QYavD_O6KFJVS0GSqm5/s72-c/IMG_20150110_120440.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-2807186314350051149</id><published>2013-10-13T21:13:00.000+01:00</published><updated>2013-10-14T20:42:08.511+01:00</updated><title type='text'>Five years at Cloudera</title><content type='html'>Five years ago today was my first day at Cloudera. The team I joined consisted of the four founders—Mike Olson, Amr Awadallah, Jeff Hammerbacher, Christophe Bisciglia—as well as Aaron Kimball who had joined a week or so before, Alex Loddengaard who was working as an intern, and Matei Zaharia who joined on the same day as me as a part-time consultant.&lt;br /&gt;
&lt;br /&gt;
Before I joined I had been working as an independent Apache Hadoop consultant for a year (probably the first Hadoop consultant anywhere), and was halfway through writing a book on Hadoop. The interview process had involved speaking to all four founders, and I remember when I came off the phone after the last call it was late in the UK but I couldn&#39;t sleep because the vision they had described was &lt;i&gt;exactly&lt;/i&gt; what I wanted to see for Hadoop: a company that wanted to make Hadoop accessible to everyone, by making it easier to use and run, while maintaining a strong commitment to open source. The last point sealed the deal for me, and really at that point there was no way I could &lt;i&gt;not&lt;/i&gt; join, and five years on I can say without exaggeration that it was the best decision of my professional life.&lt;br /&gt;
&lt;br /&gt;
When I started I was living in Wales, which meant that on my first day I didn&#39;t see any of my new colleagues! That was remedied a few weeks later on when I visited California (and ApacheCon in New Orleans) in early November 2008. Initially the others were working out of a single room in AdMob&#39;s offices in San Mateo, but it wasn&#39;t long before we moved to a smart brick-lined office in Burlingame. I was around for the moving in day, which involved more flatpack assembly skills than programming.&lt;br /&gt;
&lt;br /&gt;
From the very beginning we worked on making Hadoop easier to use, run, and support, and better integrated with other systems, so that it could enjoy broader adoption. That was borne out in the early projects at Cloudera which included creating training material, creating packages for Red Hat and Debian (CDH, and later Bigtop), writing tools for data ingest (Flume and Sqoop), creating a rich web UI for Hadoop users (Hue), as well as making contributions to the core project. I was mainly involved in the latter, which I did at the same time as completing the book in time for the Hadoop Summit 2009, which would never have been possible without the time and space my teammates gave me.&lt;br /&gt;
&lt;br /&gt;
Over the first year I would visit every three months or so, and naturally each time the team would have grown. I always enjoyed meeting the new people who had joined since my last visit, but I realized that at such a formative time in a company&#39;s life, when the culture was being laid down that being closer to the team would make it easier for me to stay involved. The opportunity to move to California came up, and on the last day of October 2009 I arrived in San Francisco with my wife, Eliane, and two girls.&lt;br /&gt;
&lt;br /&gt;
As anyone who has moved to a new country knows, there&#39;s a lot of things to sort out—somewhere to live, a school for the girls, reams of paperwork—and during this time the folks at Cloudera were incredibly helpful and supportive. When we moved into our new apartment &amp;nbsp;(which Eliane had found a mere two weeks after we arrived) half of the engineering team turned up to help with Ikea flatpack assembly.&lt;br /&gt;
&lt;br /&gt;
At the end of our three year sojourn in the US, we left having made many friends, sad to leave, but happy knowing we&#39;d be living closer to our family again. Cloudera was an order of magnitude larger than when I had arrived, and was now an international company with offices in several countries across the world.&lt;br /&gt;
&lt;br /&gt;
Over the last five years I&#39;ve been lucky enough to have been given the freedom to work on many parts of the Hadoop stack, in different parts of the Hadoop community, and with different teams at Cloudera. In the course of doing so, I&#39;ve worked with the most talented and intelligent group of people in my life. It&#39;s hard work, and challenging, but also a lot of fun and incredibly enriching. I have every reason to expect it to continue. Thanks Cloudera!&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;i&gt;Update on October 14: reworded to state that ApacheCon 2008 was held in New Orleans, not California. Thanks to Isabel Drost-Fromm for pointing out the error.&lt;/i&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/2807186314350051149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/2807186314350051149' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/2807186314350051149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/2807186314350051149'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2013/10/five-years-at-cloudera.html' title='Five years at Cloudera'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-2077960426562913693</id><published>2013-03-30T18:25:00.000+00:00</published><updated>2013-03-30T18:25:46.885+00:00</updated><title type='text'>Making a Kitchen Table</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
A couple of weeks ago I made a new kitchen table.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUf9K-E37DZyb-Zm7V1xg4DhRLzMYcE3Ecas2yABIOR3-OH0grcIC4TgxYEG9Xv5__A8cBOEWaF6gC6OnFhXsxHY7hWzmLHsg0rvF_qqpaxwiONJ5yIoXAgNxWonRpYI6KU-SsrtLo25qg/s1600/20130316_163046.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUf9K-E37DZyb-Zm7V1xg4DhRLzMYcE3Ecas2yABIOR3-OH0grcIC4TgxYEG9Xv5__A8cBOEWaF6gC6OnFhXsxHY7hWzmLHsg0rvF_qqpaxwiONJ5yIoXAgNxWonRpYI6KU-SsrtLo25qg/s320/20130316_163046.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span id=&quot;goog_1670473399&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_1670473400&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
It was much easier than it looks as all I had to do was attach some hairpin legs to a worktop. If you haven&#39;t seen hairpin legs before, here&#39;s a closeup:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhstCcyDojrb_eFpYXBoZI_rhzcaLDdwoPLTVr6Ph1a6OF9vkM3Fh_Mq4ZdE4j09A-Hv2CkNz0pcPzMgmqr0x5AoUUakDw-sl3DShLfPfknEfMeB2ZZXNbNIiCxx3bSkX2EZk7KGsXt4F4Q/s1600/20130316_152120.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhstCcyDojrb_eFpYXBoZI_rhzcaLDdwoPLTVr6Ph1a6OF9vkM3Fh_Mq4ZdE4j09A-Hv2CkNz0pcPzMgmqr0x5AoUUakDw-sl3DShLfPfknEfMeB2ZZXNbNIiCxx3bSkX2EZk7KGsXt4F4Q/s320/20130316_152120.jpg&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Eliane got the idea for the design after seeing something similar on the web, and she ordered the worktop from &lt;a href=&quot;http://www.worktop-express.co.uk/&quot;&gt;Worktop Express&lt;/a&gt;, and the hairpin legs from the &lt;a href=&quot;http://www.theironmill.co.uk/&quot;&gt;Iron Mill&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
I worked out what size screws to use (#12) and the pilot drill size using &lt;a href=&quot;http://www.wlfuller.com/html/wood_screw_chart.html&quot;&gt;this handy chart&lt;/a&gt;. I also found a tip somewhere that said putting a little wax on the screw makes it easier to drive in with hardwoods (our worktop is oak).&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
The table is pretty sturdy, and hasn&#39;t collapsed! It was quicker to put together than some Ikea furniture, and it&#39;s very satisfying having an everyday piece of furniture that we designed and built ourselves.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/2077960426562913693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/2077960426562913693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/2077960426562913693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/2077960426562913693'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2013/03/making-kitchen-table.html' title='Making a Kitchen Table'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUf9K-E37DZyb-Zm7V1xg4DhRLzMYcE3Ecas2yABIOR3-OH0grcIC4TgxYEG9Xv5__A8cBOEWaF6gC6OnFhXsxHY7hWzmLHsg0rvF_qqpaxwiONJ5yIoXAgNxWonRpYI6KU-SsrtLo25qg/s72-c/20130316_163046.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-3144519400768005075</id><published>2013-02-03T17:52:00.001+00:00</published><updated>2013-02-03T17:52:40.915+00:00</updated><title type='text'>Have you put the chickens to bed?</title><content type='html'>&quot;Have you put the chickens to bed?&quot; -- it&#39;s a question we ask each other frequently in our house, since we are the &lt;a href=&quot;http://welshchickengirl.blogspot.co.uk/&quot;&gt;proud owners&lt;/a&gt; of seven beautiful hens. Normally Eliane has, but when Lottie, our younger daughter, asked long after it had got dark one evening last week it turned out that none of us had, despite having &lt;a href=&quot;http://www.tom-e-white.com/2012/12/ifttt.html&quot;&gt;IFTTT alerts set up to remind us&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The problem with the alert is that it is set to go off at sunset, which is all that IFTTT allows, and that&#39;s a bit too early as it&#39;s not dark enough for the chickens to be in their house. So we wait a bit, then we forget.&lt;br /&gt;
&lt;br /&gt;
So I decided to write an Android app to send an alert a fixed amount of time (say 45 minutes) after sunset, so that when we received it, it would be dark, the chickens would be in their house, and we could close the door there and then.&lt;br /&gt;
&lt;br /&gt;
This is the result:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhciHWbs8DMB0pb7nFgpDCVITV9Z-DsILxv0y1iYHbTJ_MhOIDqsFDMNNuvFgyri3PtNFLEL9WSDbLRnF1w74KiB4SC7-oF_HPmGUjQw6U6x23Y6kp-p6Y4A3JV4EIhvLjz5rvBdAMyPwbF/s1600/chickenalerts.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhciHWbs8DMB0pb7nFgpDCVITV9Z-DsILxv0y1iYHbTJ_MhOIDqsFDMNNuvFgyri3PtNFLEL9WSDbLRnF1w74KiB4SC7-oF_HPmGUjQw6U6x23Y6kp-p6Y4A3JV4EIhvLjz5rvBdAMyPwbF/s1600/chickenalerts.png&quot; height=&quot;142&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Eliane is currently beta testing it, so we&#39;ll see how well it works. (Obviously the long term goal is an automatic sensor to open and close the chicken house door, but we&#39;re not there yet.)&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Writing Android Apps&lt;/h3&gt;
&lt;div&gt;
This is the first Android app I&#39;ve written, and overall I found the process very straightforward. A couple of years ago I ran a &quot;Hello World&quot; Android tutorial, and I seem to remember most of the time taken to get the app running was installing the Eclipse plugin. This time the Android Developer Tools (ADT) include a customized version of Eclipse, making the getting started process much smoother.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The Android API is huge and fairly intimidating. It is, however, incredibly well documented, and the user guides are invaluable. The hardest part of writing the app was figuring out which parts of the API to use - do I need a &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;BroadcastReceiver&lt;/span&gt; or a &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Service&lt;/span&gt;?, how do &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;AlarmManager&lt;/span&gt; and &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Notification&lt;/span&gt; interact? - that kind of thing. There&#39;s a lot of material online covering how to do various things in Android, and these offered general pointers, but not necessarily useful code, since the API evolves rapidly from release to release. And although the older code is generally supported, since compatibility is taken very seriously, there may be a better way of doing things in later versions.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The ADT tooling is good and encourages you to do the right thing - for example, extracting natural language strings from your app so it&#39;s easy to change them (or translate them) later. In this case, a class called &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;R&lt;/span&gt;&amp;nbsp;is generated which has references to all the assets that you need in you app: icons, sound files, strings, etc. For example, the audio file which plays when the notification is received is referred to with:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;







&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;R.raw.&lt;span class=&quot;s1&quot;&gt;cluck&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
To generate the icons I drew a chicken on a piece of paper with a sharpie, then took a photo of it and used an &lt;a href=&quot;http://www.iaza.com/index-ln.html&quot;&gt;online image editor&lt;/a&gt;&amp;nbsp;to make the background transparent. The &lt;a href=&quot;http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html&quot;&gt;Android Asset Studio&lt;/a&gt; completed the job of converting the image to a set of icons. (I didn&#39;t use Inkscape in the end, but &lt;a href=&quot;http://envyandroid.com/archives/271/easiest-way-to-create-android-icons&quot;&gt;this blog entry&lt;/a&gt; shows how to convert from an Inkscape drawing.)&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;
What&#39;s Next?&lt;/h3&gt;
&lt;div&gt;
The biggest limitation in the app at the moment is that the &lt;a href=&quot;https://github.com/mikereedell/sunrisesunsetlib-java&quot;&gt;calculation for sunset time&lt;/a&gt; is hardcoded for the UK. Using the &lt;a href=&quot;http://developer.android.com/guide/topics/location/strategies.html&quot;&gt;Location API&lt;/a&gt; is the obvious next step there.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
There are also some complications to do with making sure that notifications will still be sent even the phone is rebooted. I want to make sure that works properly before putting the app on Google Play.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The UI is pretty rudimentary too and could do with some work.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And before we get to the fully-automated solution, we could have a sensor that detects if the door is open or closed and only sends the reminder if the door hasn&#39;t been closed for the night.&lt;/div&gt;
&lt;br /&gt;
Source is on &lt;a href=&quot;https://github.com/tomwhite/chickenalerts&quot;&gt;GitHub&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/3144519400768005075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/3144519400768005075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/3144519400768005075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/3144519400768005075'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2013/02/have-you-put-chickens-to-bed.html' title='Have you put the chickens to bed?'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhciHWbs8DMB0pb7nFgpDCVITV9Z-DsILxv0y1iYHbTJ_MhOIDqsFDMNNuvFgyri3PtNFLEL9WSDbLRnF1w74KiB4SC7-oF_HPmGUjQw6U6x23Y6kp-p6Y4A3JV4EIhvLjz5rvBdAMyPwbF/s72-c/chickenalerts.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-5000894151668084463</id><published>2012-12-31T16:06:00.000+00:00</published><updated>2012-12-31T16:06:08.382+00:00</updated><title type='text'>How far away is the sea?</title><content type='html'>I wanted an app to answer this question, so I wrote one:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBtNaRxFMfiAJBs9mxkaBgoX5bpwjsp76E_LiP37-2WA3ygH8KIYkEfuABgq5FbAshkunjkAsi3Ahb1a6NZHqox5CW98ZCMt2N4ZRn3G3zn7V2GV6DxdrGR3NSAiOOY-A7Ia1MwJZN-zj/s1600/how-far-away-is-the-sea.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBtNaRxFMfiAJBs9mxkaBgoX5bpwjsp76E_LiP37-2WA3ygH8KIYkEfuABgq5FbAshkunjkAsi3Ahb1a6NZHqox5CW98ZCMt2N4ZRn3G3zn7V2GV6DxdrGR3NSAiOOY-A7Ia1MwJZN-zj/s1600/how-far-away-is-the-sea.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
You can try it out at&amp;nbsp;&lt;a href=&quot;http://how-far-away-is-the-sea.appspot.com/&quot;&gt;http://how-far-away-is-the-sea.appspot.com/&lt;/a&gt;. It works well on phones too, so you can use it when you are out and about.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
How does it work?&lt;/h3&gt;
I used the &lt;a href=&quot;http://www.naturalearthdata.com/downloads/10m-physical-vectors/&quot;&gt;dataset of land polygons&lt;/a&gt; from &lt;a href=&quot;http://www.naturalearthdata.com/&quot;&gt;Natural Earth&lt;/a&gt;, which as the name suggests covers the whole world. The scale is 1:10 million, so inevitably there is some inaccuracy near the coast, particularly where it&#39;s wiggly.&lt;br /&gt;
&lt;br /&gt;
The app uses your current location (or a location you selected by clicking on the map) and computes the closest point in the set of land polygons. This calculation is performed using the &lt;a href=&quot;http://www.vividsolutions.com/jts/JTSHome.htm&quot;&gt;JTS Topology Suite&lt;/a&gt;, a library for 2D spatial work, and it runs as a Java webapp hosted on Google App Engine.&lt;br /&gt;
&lt;br /&gt;
Originally I used &lt;a href=&quot;http://www.geotools.org/&quot;&gt;Geotools&lt;/a&gt; to perform the geospatial calculations, but unfortunately it doesn&#39;t run on GAE, so I wrote an offline tool to convert the Natural Earth shapefiles to a &lt;a href=&quot;http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/io/WKBWriter.html&quot;&gt;JTS binary format&lt;/a&gt;. JTS works fine on GAE, but it lacks a distance calculator. Luckily &lt;a href=&quot;https://github.com/spatial4j/spatial4j&quot;&gt;spatial4j&lt;/a&gt; has the requisite distance functions, and it too works on GAE.&lt;br /&gt;
&lt;br /&gt;
The webapp exposes a simple query endpoint, so a request for the following URL, for example:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;http://how-far-away-is-the-sea.appspot.com/query?lat=51.856479&amp;amp;lng=-3.13551&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
will return a JSON document with the closest point on the coast, whether the (origin) location is on land or at sea, and the distance in metres to the coast:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&quot;latitude&quot;:51.856479,&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&quot;longitude&quot;:-3.13551,&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&quot;coastLatitude&quot;:51.55853913000007,&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&quot;coastLongitude&quot;:-2.984038865999878,&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&quot;onLand&quot;:true,&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&quot;distanceToCoast&quot;:34734.59501052392&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;}&lt;/pre&gt;
&lt;br /&gt;
The page that the user sees is a simple static HTML page that uses the Google Maps API (v3) to render the map and the markers, and jQuery to query the Java webapp.&lt;br /&gt;
&lt;br /&gt;
The complete source code is on Github at&amp;nbsp;&lt;a href=&quot;https://github.com/tomwhite/how-far-away-is-the-sea&quot;&gt;https://github.com/tomwhite/how-far-away-is-the-sea&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Further ideas&lt;/h3&gt;
Some of the polygons are a poor approximation to the coastline, so it would be nice to get a higher-resolution dataset. There are likely many potential sources, such as &lt;a href=&quot;http://cdu.mimas.ac.uk/2011/data/boundary-data/index.html&quot;&gt;this one&lt;/a&gt; for the UK.&lt;br /&gt;
&lt;br /&gt;
It would be interesting to use the dataset to answer the question: &quot;which is the furthest point from the sea [in the UK/in X/in the world]?&quot;. I&#39;d like to find time to do that sometime. Adding in spatial indexes might be helpful too.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
If you liked this app then you might like...&lt;/h3&gt;
&lt;a href=&quot;https://github.com/tomwhite/isitdayornight&quot;&gt;Is it day or night?&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/5000894151668084463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/5000894151668084463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/5000894151668084463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/5000894151668084463'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2012/12/how-far-away-is-sea.html' title='How far away is the sea?'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggBtNaRxFMfiAJBs9mxkaBgoX5bpwjsp76E_LiP37-2WA3ygH8KIYkEfuABgq5FbAshkunjkAsi3Ahb1a6NZHqox5CW98ZCMt2N4ZRn3G3zn7V2GV6DxdrGR3NSAiOOY-A7Ia1MwJZN-zj/s72-c/how-far-away-is-the-sea.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-1747695397940033386</id><published>2012-12-16T12:31:00.001+00:00</published><updated>2012-12-16T12:31:56.740+00:00</updated><title type='text'>IFTTT</title><content type='html'>&lt;a href=&quot;https://ifttt.com/&quot;&gt;IFTTT&lt;/a&gt;, pronounced &quot;ift&quot;, and which stands for &quot;if this then that&quot;, is a great service for wiring bits of the internet together.

The idea is that you create rules for performing actions, based on triggers.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;If this&lt;/b&gt;&amp;nbsp;[trigger] occurs&amp;nbsp;&lt;b&gt;then&lt;/b&gt; perform &lt;b&gt;that&lt;/b&gt;&amp;nbsp;[action].&lt;br /&gt;
&lt;br /&gt;
There are lots of triggers and actions, provided by &lt;a href=&quot;https://ifttt.com/channels&quot;&gt;channels&lt;/a&gt;. For example, the &lt;a href=&quot;https://ifttt.com/weather&quot;&gt;Weather Channel&lt;/a&gt; provides a trigger which fires at sunset. And the &lt;a href=&quot;https://ifttt.com/google_talk&quot;&gt;Google Talk Channel&lt;/a&gt; provides an action to send a chat message. I combined the trigger and action into a &lt;a href=&quot;https://ifttt.com/recipes/70456&quot;&gt;recipe&lt;/a&gt; called &quot;Did you put the chickens to bed?&quot; which will remind me (and Eliane) to close the chicken shed in the evening.&lt;br /&gt;
&lt;action&gt;&lt;br /&gt;&lt;/action&gt;
&lt;action&gt;I love the simplicity of the whole thing. I quickly added a recipe to send a weekly SMS to remind me to put the rubbish out. And one to send an email to Lottie when there is a full moon. Emilia created a recipe to send her an email when a friend of hers posts something on his blog. I fear the recipe that tells me when it has started raining will be deleted soon due to email overload.&lt;/action&gt;&lt;br /&gt;
&lt;action&gt;&lt;br /&gt;&lt;/action&gt;When you start thinking in this way, the more interesting uses invariably involve the the physical world in some way. I want to have a recipe that says &quot;if we&#39;re running out of coffee beans then order some more&quot;, or &quot;if I&#39;m on Skype light up a lamp outside my office so the kids know not to come in&quot; (this one is close with the &lt;a href=&quot;https://ifttt.com/blink1&quot;&gt;blink(1)&lt;/a&gt; device), or even &quot;it&#39;s actually dark now and you still haven&#39;t closed the chicken shed door&quot;.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/1747695397940033386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/1747695397940033386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1747695397940033386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1747695397940033386'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2012/12/ifttt.html' title='IFTTT'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-86665386429028061</id><published>2012-12-09T22:04:00.001+00:00</published><updated>2012-12-09T22:04:44.957+00:00</updated><title type='text'>Apportionment</title><content type='html'>&lt;script type=&quot;text/x-mathjax-config&quot;&gt;   MathJax.Hub.Config({tex2jax: {inlineMath: [[&#39;$&#39;,&#39;$&#39;], [&#39;\\(&#39;,&#39;\\)&#39;]]}}); &lt;/script&gt; &lt;script src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot; type=&quot;text/javascript&quot;&gt; &lt;/script&gt;
&lt;script type=&quot;text/x-mathjax-config&quot;&gt;
MathJax.Hub.Config({
  TeX: { equationNumbers: { autoNumber: &quot;AMS&quot; } }
});
&lt;/script&gt;

&lt;p&gt;&lt;i&gt;[I wrote this in July, but never got round to posting it.]&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;
Last weekend I visited the U.S. Capitol in Washington, D.C., with my family, and I learned that the House of Representatives has 435 seats which are appointed
so that each state has a number of seats that is proportional to its population.
It sounded simple when the tour guide said it, but I wondered how are fractions handled fairly?
Simply rounding off quotas doesn&#39;t work&amp;mdash;firstly because some states could get no seats, which would be unfair, and 
secondly, how do you make sure that the rounding is both fair and assigns all 435 seats?
&lt;/p&gt;

&lt;p&gt;
When I got home I read about the apportionment problem, as it is known, which has a long and interesting history.
Wikipedia &lt;a id=&quot;footnote-1-ref&quot; href=&quot;#footnote-1&quot;&gt;[1]&lt;/a&gt; is a good read, as usual; and &lt;a id=&quot;footnote-2-ref&quot; href=&quot;#footnote-2&quot;&gt;[2]&lt;/a&gt; goes into the history and mathematics of different apportionment algorithms in depth, at least one of which suffers causes a paradox.
Here I&#39;m interested in looking at the algorithm that is used today to calculate apportionments for the House of Representatives,
and why it is considered to be the fairest.
&lt;/p&gt;

&lt;h3&gt;The Algorithm&lt;/h3&gt;

&lt;p&gt;The algorithm in use today for apportioning seats is due to Huntington and Hill and is known as the Huntington-Hill method, or the method of equal proportions.
It&#39;s best understood as a dynamic process, which works as follows:&lt;p&gt;

&lt;p&gt;
To start, each state is given one seat. (This ensures that states with relatively small populations, like Wyoming, get at least one seat.)
Then, each remaining seat is allocated in turn to the state is allocated to the state with the
highest &lt;i&gt;priority&lt;/i&gt;, where the priority of a state of population \(P\) and \(n\) previously-allocated seats is defined as
&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {P} {\sqrt{n(n+1)}}\label{pri}
\end{align}&lt;/p&gt;

&lt;p&gt;We&#39;ll see why the priority is defined as it is below, but for now notice that it is approximately \(P/n\), so the seat is given to the state
that has the least number of representatives per person, roughly speaking.&lt;/p&gt;

&lt;h3&gt;Results for the 2010 Census&lt;/h3&gt;

&lt;p&gt;Running the algorithm for the state populations from the 2010 Census (using a program I wrote &lt;a id=&quot;footnote-5-ref&quot; href=&quot;#footnote-5&quot;&gt;[5]&lt;/a&gt;)
gives the following apportionment, which agrees with the U.S. Census Bureau &lt;a id=&quot;footnote-3-ref&quot; href=&quot;#footnote-3&quot;&gt;[3]&lt;/a&gt;. (The quota column is the percentage of the population for each state.)&lt;/p&gt;

&lt;p&gt;
&lt;table&gt;
&lt;tr&gt;&lt;th&gt;State&lt;/th&gt; &lt;th&gt;Seats&lt;/th&gt; &lt;th&gt;Population&lt;/th&gt; &lt;th&gt;Quota&lt;/th&gt; &lt;th&gt;People per representative&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Alabama&lt;/td&gt; &lt;td&gt;7&lt;/td&gt; &lt;td&gt;4802982&lt;/td&gt; &lt;td&gt;6.76&lt;/td&gt; &lt;td&gt;686140&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Alaska&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;721523&lt;/td&gt; &lt;td&gt;1.02&lt;/td&gt; &lt;td&gt;721523&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Arizona&lt;/td&gt; &lt;td&gt;9&lt;/td&gt; &lt;td&gt;6412700&lt;/td&gt; &lt;td&gt;9.02&lt;/td&gt; &lt;td&gt;712522&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Arkansas&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;2926229&lt;/td&gt; &lt;td&gt;4.12&lt;/td&gt; &lt;td&gt;731557&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;California&lt;/td&gt; &lt;td&gt;53&lt;/td&gt; &lt;td&gt;37341989&lt;/td&gt; &lt;td&gt;52.54&lt;/td&gt; &lt;td&gt;704565&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Colorado&lt;/td&gt; &lt;td&gt;7&lt;/td&gt; &lt;td&gt;5044930&lt;/td&gt; &lt;td&gt;7.10&lt;/td&gt; &lt;td&gt;720704&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Connecticut&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;3581628&lt;/td&gt; &lt;td&gt;5.04&lt;/td&gt; &lt;td&gt;716325&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Delaware&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;900877&lt;/td&gt; &lt;td&gt;1.27&lt;/td&gt; &lt;td&gt;900877&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Florida&lt;/td&gt; &lt;td&gt;27&lt;/td&gt; &lt;td&gt;18900773&lt;/td&gt; &lt;td&gt;26.59&lt;/td&gt; &lt;td&gt;700028&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Georgia&lt;/td&gt; &lt;td&gt;14&lt;/td&gt; &lt;td&gt;9727566&lt;/td&gt; &lt;td&gt;13.69&lt;/td&gt; &lt;td&gt;694826&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Hawaii&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;1366862&lt;/td&gt; &lt;td&gt;1.92&lt;/td&gt; &lt;td&gt;683431&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Idaho&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;1573499&lt;/td&gt; &lt;td&gt;2.21&lt;/td&gt; &lt;td&gt;786749&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Illinois&lt;/td&gt; &lt;td&gt;18&lt;/td&gt; &lt;td&gt;12864380&lt;/td&gt; &lt;td&gt;18.10&lt;/td&gt; &lt;td&gt;714687&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Indiana&lt;/td&gt; &lt;td&gt;9&lt;/td&gt; &lt;td&gt;6501582&lt;/td&gt; &lt;td&gt;9.15&lt;/td&gt; &lt;td&gt;722398&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Iowa&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;3053787&lt;/td&gt; &lt;td&gt;4.30&lt;/td&gt; &lt;td&gt;763446&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Kansas&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;2863813&lt;/td&gt; &lt;td&gt;4.03&lt;/td&gt; &lt;td&gt;715953&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Kentucky&lt;/td&gt; &lt;td&gt;6&lt;/td&gt; &lt;td&gt;4350606&lt;/td&gt; &lt;td&gt;6.12&lt;/td&gt; &lt;td&gt;725101&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Louisiana&lt;/td&gt; &lt;td&gt;6&lt;/td&gt; &lt;td&gt;4553962&lt;/td&gt; &lt;td&gt;6.41&lt;/td&gt; &lt;td&gt;758993&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Maine&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;1333074&lt;/td&gt; &lt;td&gt;1.88&lt;/td&gt; &lt;td&gt;666537&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Maryland&lt;/td&gt; &lt;td&gt;8&lt;/td&gt; &lt;td&gt;5789929&lt;/td&gt; &lt;td&gt;8.15&lt;/td&gt; &lt;td&gt;723741&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Massachusetts&lt;/td&gt; &lt;td&gt;9&lt;/td&gt; &lt;td&gt;6559644&lt;/td&gt; &lt;td&gt;9.23&lt;/td&gt; &lt;td&gt;728849&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Michigan&lt;/td&gt; &lt;td&gt;14&lt;/td&gt; &lt;td&gt;9911626&lt;/td&gt; &lt;td&gt;13.94&lt;/td&gt; &lt;td&gt;707973&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Minnesota&lt;/td&gt; &lt;td&gt;8&lt;/td&gt; &lt;td&gt;5314879&lt;/td&gt; &lt;td&gt;7.48&lt;/td&gt; &lt;td&gt;664359&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Mississippi&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;2978240&lt;/td&gt; &lt;td&gt;4.19&lt;/td&gt; &lt;td&gt;744560&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Missouri&lt;/td&gt; &lt;td&gt;8&lt;/td&gt; &lt;td&gt;6011478&lt;/td&gt; &lt;td&gt;8.46&lt;/td&gt; &lt;td&gt;751434&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Montana&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;994416&lt;/td&gt; &lt;td&gt;1.40&lt;/td&gt; &lt;td&gt;994416&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Nebraska&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;1831825&lt;/td&gt; &lt;td&gt;2.58&lt;/td&gt; &lt;td&gt;610608&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Nevada&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;2709432&lt;/td&gt; &lt;td&gt;3.81&lt;/td&gt; &lt;td&gt;677358&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;New Hampshire&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;1321445&lt;/td&gt; &lt;td&gt;1.86&lt;/td&gt; &lt;td&gt;660722&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;New Jersey&lt;/td&gt; &lt;td&gt;12&lt;/td&gt; &lt;td&gt;8807501&lt;/td&gt; &lt;td&gt;12.39&lt;/td&gt; &lt;td&gt;733958&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;New Mexico&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;2067273&lt;/td&gt; &lt;td&gt;2.91&lt;/td&gt; &lt;td&gt;689091&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;New York&lt;/td&gt; &lt;td&gt;27&lt;/td&gt; &lt;td&gt;19421055&lt;/td&gt; &lt;td&gt;27.32&lt;/td&gt; &lt;td&gt;719298&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;North Carolina&lt;/td&gt; &lt;td&gt;13&lt;/td&gt; &lt;td&gt;9565781&lt;/td&gt; &lt;td&gt;13.46&lt;/td&gt; &lt;td&gt;735829&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;North Dakota&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;675905&lt;/td&gt; &lt;td&gt;0.95&lt;/td&gt; &lt;td&gt;675905&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ohio&lt;/td&gt; &lt;td&gt;16&lt;/td&gt; &lt;td&gt;11568495&lt;/td&gt; &lt;td&gt;16.28&lt;/td&gt; &lt;td&gt;723030&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Oklahoma&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;3764882&lt;/td&gt; &lt;td&gt;5.30&lt;/td&gt; &lt;td&gt;752976&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Oregon&lt;/td&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;3848606&lt;/td&gt; &lt;td&gt;5.41&lt;/td&gt; &lt;td&gt;769721&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Pennsylvania&lt;/td&gt; &lt;td&gt;18&lt;/td&gt; &lt;td&gt;12734905&lt;/td&gt; &lt;td&gt;17.92&lt;/td&gt; &lt;td&gt;707494&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Rhode Island&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;1055247&lt;/td&gt; &lt;td&gt;1.48&lt;/td&gt; &lt;td&gt;527623&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;South Carolina&lt;/td&gt; &lt;td&gt;7&lt;/td&gt; &lt;td&gt;4645975&lt;/td&gt; &lt;td&gt;6.54&lt;/td&gt; &lt;td&gt;663710&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;South Dakota&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;819761&lt;/td&gt; &lt;td&gt;1.15&lt;/td&gt; &lt;td&gt;819761&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Tennessee&lt;/td&gt; &lt;td&gt;9&lt;/td&gt; &lt;td&gt;6375431&lt;/td&gt; &lt;td&gt;8.97&lt;/td&gt; &lt;td&gt;708381&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Texas&lt;/td&gt; &lt;td&gt;36&lt;/td&gt; &lt;td&gt;25268418&lt;/td&gt; &lt;td&gt;35.55&lt;/td&gt; &lt;td&gt;701900&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Utah&lt;/td&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;2770765&lt;/td&gt; &lt;td&gt;3.90&lt;/td&gt; &lt;td&gt;692691&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Vermont&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;630337&lt;/td&gt; &lt;td&gt;0.89&lt;/td&gt; &lt;td&gt;630337&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Virginia&lt;/td&gt; &lt;td&gt;11&lt;/td&gt; &lt;td&gt;8037736&lt;/td&gt; &lt;td&gt;11.31&lt;/td&gt; &lt;td&gt;730703&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Washington&lt;/td&gt; &lt;td&gt;10&lt;/td&gt; &lt;td&gt;6753369&lt;/td&gt; &lt;td&gt;9.50&lt;/td&gt; &lt;td&gt;675336&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;West Virginia&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;1859815&lt;/td&gt; &lt;td&gt;2.62&lt;/td&gt; &lt;td&gt;619938&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Wisconsin&lt;/td&gt; &lt;td&gt;8&lt;/td&gt; &lt;td&gt;5698230&lt;/td&gt; &lt;td&gt;8.02&lt;/td&gt; &lt;td&gt;712278&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Wyoming&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;568300&lt;/td&gt; &lt;td&gt;0.80&lt;/td&gt; &lt;td&gt;568300&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/p&gt;

&lt;h3&gt;The Mathematics&lt;/h3&gt;

&lt;p&gt;
The algorithm finally settled on by Congress was chosen because it was thought to be the fairest. There are different ways of
defining what &quot;fair&quot; means, and so it cannot be settled mathematically.
In this context &quot;fair&quot; is taken to mean &quot;minimizes the relative difference in representatives per person between states&quot;.
&lt;/p&gt;

&lt;p&gt;
To see how the algorithm meets this definition of fairness, let&#39;s see what happens when we examine any two states to see if
transferring one seat between them would improve the apportionment. This is the argument published by E. V. Huntington in &lt;a id=&quot;footnote-4-ref&quot; href=&quot;#footnote-4&quot;&gt;[4]&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;
Suppose after the apportionment, state \(A\) has received \(x+1\) seats, and state \(B\) has received \(y\) seats.
Furthermore, also suppose that \(A\) is over-represented because the number of people per representative is less than for \(B\):
&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {A} {x+1} &amp;\lt \frac {B} {y}\label{Aover}
\end{align}&lt;/p&gt;

&lt;p&gt;We can check this in the case of California and New York:&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {37,341,989} {53} &amp;\lt \frac {19,421,055} {27}\nonumber
\end{align}&lt;/p&gt;

&lt;p&gt;Or&lt;/p&gt;

&lt;p&gt;\begin{align}
704565.83 &amp;\lt 719298.33 \nonumber
\end{align}&lt;/p&gt;

&lt;p&gt;Now let&#39;s see what happens if we try to transfer one seat from \(A\) to \(B\)&amp;mdash;does that make things fairer?&lt;/p&gt;

&lt;p&gt;In the round when \(A\) won its last seat (number \(x+1\)), we know that its priority (defined by (\ref{pri})) was higher than \(B\)&#39;s. That is,&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {A^2} {x(x+1)} &amp;\gt \frac {B^2} {y(y+1)}\label{priority}
\end{align}&lt;/p&gt;

&lt;p&gt;(Note that even if \(B\) hadn&#39;t won its last seat (number \(y\)) at that point, the inequality still holds,
since the number of seats it had would be less than \(y\).)&lt;/p&gt;

&lt;p&gt;Again we can check this in the case of California and New York:&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {37,341,989^2} {52 \times 53} &amp;\gt \frac {19,421,055^2} {27 \times 28}\nonumber
\end{align}&lt;/p&gt;

&lt;p&gt;Which is true. (The numbers also tally with the U.S. Census Bureau &lt;a id=&quot;footnote-6-ref&quot; href=&quot;#footnote-6&quot;&gt;[6]&lt;/a&gt;, and my program to calculate apportionments &lt;a id=&quot;footnote-5-ref&quot; href=&quot;#footnote-5&quot;&gt;[5]&lt;/a&gt;, where the priority value for California&#39;s last seat is \(711,308\), which is \(37,341,989/\sqrt{52 \times 53}\).)&lt;/p&gt;

&lt;p&gt;Dividing (\ref{priority}) by (\ref{Aover}) we get &lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {A} {x} &amp;\gt \frac {B} {y+1}\label{Bover}
\end{align}&lt;/p&gt;

&lt;p&gt;which we can interpret as saying that \(B\) would be over-represented if one seat were transferred to it from \(A\).
For our example of California and New York, this becomes&lt;/p&gt;

&lt;p&gt;\begin{align}
718115.17 &amp;\gt 693609.11 \nonumber
\end{align}&lt;/p&gt;

&lt;p&gt;The question now is, which over-representation is the smallest? That is, which is fairer, and therefore, to be preferred?&lt;/p&gt;

&lt;p&gt;Using (\ref{Aover}), we calculate the relative difference before the transfer as&lt;/p&gt;

&lt;p&gt;\begin{align}
\newcommand{\slfrac}[2]{\left.#1\middle/#2\right.}
\slfrac{ \left( \frac {B} {y} - \frac {A} {x+1} \right) } {\frac {A} {x+1}}  = \frac {B(x+1)} {Ay} - 1 \label{Adiff}
\end{align}&lt;/p&gt;

&lt;p&gt;And, using (\ref{Bover}), the relative difference after the transfer is&lt;/p&gt;

&lt;p&gt;\begin{align}
\newcommand{\slfrac}[2]{\left.#1\middle/#2\right.}
\slfrac{ \left( \frac {A} {x} - \frac {B} {y+1} \right) } {\frac {B} {y+1}}  = \frac {A(y+1)} {Bx} - 1 \label{Bdiff}
\end{align}&lt;/p&gt;

&lt;p&gt;To compare these relative differences, note that we can rewrite (\ref{priority}) as&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {A(y+1)} {Bx} &amp;\gt \frac {B(x+1)} {Ay}
\end{align}&lt;/p&gt;

&lt;p&gt;Thus&lt;/p&gt;

&lt;p&gt;\begin{align}
\frac {A(y+1)} {Bx} - 1 &amp;\gt \frac {B(x+1)} {Ay} - 1
\end{align}&lt;/p&gt;

&lt;p&gt;and the relative difference is smaller before the seat transfer (using (\ref{Adiff}) and (\ref{Bdiff})). So the original apportionment is optimal.
There was nothing special about the choice of \(A\) and \(B\), so we can conclude that the apportionment is optimal overall.&lt;/p&gt;

&lt;p&gt;Again, this checks out for our example. The relative difference for 53 seats for California and 27 for New York is \(0.021\), versus \(0.035\) for 52 for California and 28 for New York.&lt;/p&gt;

&lt;h3&gt;References&lt;/h3&gt;

&lt;p id=&quot;footnote-1&quot;&gt;
[1] &lt;a href=&quot;http://en.wikipedia.org/wiki/United_States_congressional_apportionment&quot;&gt;United States congressional apportionment&lt;/a&gt;, Wikipedia. &lt;a href=&quot;#footnote-1-ref&quot;&gt;&amp;#8617&lt;/a&gt;
&lt;/p&gt;

&lt;p id=&quot;footnote-2&quot;&gt;
[2] &lt;a href=&quot;http://www.ams.org/samplings/feature-column/fcarc-apportion1&quot;&gt;Apportionment: Introduction&lt;/a&gt;, American Mathematical Society. &lt;a href=&quot;#footnote-2-ref&quot;&gt;&amp;#8617&lt;/a&gt;
&lt;/p&gt;

&lt;p id=&quot;footnote-3&quot;&gt;
[3] &lt;a href=&quot;http://2010.census.gov/news/pdf/apport2010_table1.pdf&quot;&gt;&quot;APPORTIONMENT POPULATION AND NUMBER OF REPRESENTATIVES, BY STATE: 2010 CENSUS&quot;&lt;/a&gt;, U.S. Census Bureau.  &lt;a href=&quot;#footnote-3-ref&quot;&gt;&amp;#8617&lt;/a&gt;
&lt;/p&gt;

&lt;p id=&quot;footnote-4&quot;&gt;
[4] &lt;a href=&quot;http://links.jstor.org/sici?sici=0002-9947%28192801%2930%3A1%3C85%3ATAORIC%3E2.0.CO%3B2-H&quot;&gt;The Apportionment of Representatives in Congress&lt;/a&gt;, E. V. Huntington, &lt;i&gt;Transactions of the American Mathematical Society&lt;/i&gt;, Vol. 30, No. 1. (Jan., 1928), pp. 85-110.  &lt;a href=&quot;#footnote-4-ref&quot;&gt;&amp;#8617&lt;/a&gt;
&lt;/p&gt;

&lt;p id=&quot;footnote-5&quot;&gt;
[5] &lt;a href=&quot;https://github.com/tomwhite/apportionment&quot;&gt;A program to calculate apportionments&lt;/a&gt;, Tom White, July 2012.  &lt;a href=&quot;#footnote-5-ref&quot;&gt;&amp;#8617&lt;/a&gt;
&lt;/p&gt;

&lt;p id=&quot;footnote-6&quot;&gt;
[6] &lt;a href=&quot;http://www.census.gov/population/apportionment/files/Priority%20Values%202010.pdf&quot;&gt;PRIORITY VALUES FOR 2010 CENSUS&lt;/a&gt;, U.S. Census Bureau.  &lt;a href=&quot;#footnote-6-ref&quot;&gt;&amp;#8617&lt;/a&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/86665386429028061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/86665386429028061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/86665386429028061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/86665386429028061'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2012/12/apportionment.html' title='Apportionment'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-623392643395801041</id><published>2012-12-03T22:27:00.000+00:00</published><updated>2012-12-03T22:27:47.306+00:00</updated><title type='text'>d3troit</title><content type='html'>







&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
I wrote a &lt;a href=&quot;http://tomwhite.github.com/d3troit/index.html&quot;&gt;visualization&lt;/a&gt; of the populations of the largest cities in the US over the years. I got the idea when I was in Detroit in the summer, and read about the huge decline in Detroit&#39;s city population since the 1950s when the automotive industry was at its peak. According to Wikipedia&#39;s &lt;a href=&quot;http://en.wikipedia.org/wiki/Shrinking_cities_in_the_USA&quot;&gt;Shrinking cities in the USA&lt;/a&gt;&amp;nbsp;page, Detroit has declined by 61.4% from its peak population. This is a decline of over 1 million, which makes it the largest decline among US cities in absolute numbers, but not in percentage terms since St. Louis has a slightly higher percentage decline (62.7%, or 537,502 people).&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
These figures are all for city populations, not for the greater urban or metropolitan areas, which, in the case of Detroit, have both significantly increased in size since the 1950s. Detroit has therefore seen one of the largest population shifts to the suburbs since the middle of the 20th century. Much has been written on the dramatic decline of Detroit&#39;s city population, and the impact on life there. These are some pieces that I found interesting:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;For more information on Detroit&#39;s history, particularly its buildings, I highly recommend&amp;nbsp;Dan Austin&#39;s&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&lt;a href=&quot;http://historicdetroit.org/&quot;&gt;http://historicdetroit.org&lt;/a&gt;.&lt;/span&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;The Guardian has an amazing &lt;a href=&quot;http://www.guardian.co.uk/artanddesign/gallery/2011/jan/02/photography-detroit&quot;&gt;photo gallery&lt;/a&gt; of some of&amp;nbsp;Yves Marchand and Romain Meffre&#39;s pictures of Detroit in ruins.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.motherjones.com/politics/2012/06/detroit-economy-art-recovery?page=1&quot;&gt;How to Bring Detroit Back From the Grave&lt;/a&gt;&amp;nbsp;by&amp;nbsp;Josh Harkinson, Mother Jones.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.wired.com/geekmom/2012/02/the-maker-culture-is-reinventing-detroit/&quot;&gt;The Maker Culture is Reinventing Detroit&lt;/a&gt; by&amp;nbsp;Gina Clifford, Wired.&lt;/li&gt;
&lt;li&gt;We didn&#39;t get to see it, but a friend highly recommended &lt;a href=&quot;http://heidelberg.org/&quot;&gt;the heidelberg project&lt;/a&gt;, a street art project.&lt;/li&gt;
&lt;li&gt;Eliane on our visit:&amp;nbsp;&lt;a href=&quot;http://faites-simple.blogspot.co.uk/2012/06/journey-into-past-detroit-in-words.html&quot;&gt;A journey into the past: Detroit in words&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;







&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;h3&gt;
How I wrote the visualization&lt;/h3&gt;
&lt;div&gt;







&lt;div class=&quot;p1&quot;&gt;
I used the wonderful &lt;a href=&quot;http://d3js.org/&quot;&gt;d3 library&lt;/a&gt; to write the visualization, combining elements of the &lt;a href=&quot;http://mbostock.github.com/d3/ex/population.html&quot;&gt;Population Pyramid example&lt;/a&gt;&amp;nbsp;with an &lt;a href=&quot;http://mbostock.github.com/d3/tutorial/bar-2.html&quot;&gt;updating bar chart&lt;/a&gt;. The documentation on &lt;a href=&quot;http://bost.ocks.org/mike/constancy/&quot;&gt;Object Constancy&lt;/a&gt;&amp;nbsp;was critical to getting the visualization to work.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
The population data is from the US Census Bureau, although I found the actual files linked from Wikipedia&#39;s&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Largest_cities_in_the_United_States_by_population_by_decade&quot;&gt;Largest cities in the United States by population by decade&lt;/a&gt;. I had to write some simple scripts to turn the source data into CSV files that d3 could read.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/623392643395801041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/623392643395801041' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/623392643395801041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/623392643395801041'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2012/12/d3troit.html' title='d3troit'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-1017419998967425216</id><published>2012-05-10T21:42:00.000+01:00</published><updated>2012-05-10T21:42:44.895+01:00</updated><title type='text'>Volcanoes!</title><content type='html'>I&#39;ve just finished reading &lt;a href=&quot;http://www.amazon.com/Super-Volcano-Ticking-Yellowstone-National/dp/0760329257&quot;&gt;&quot;Super Volcano: The Ticking Time Bomb Beneath Yellowstone National Park&quot;&lt;/a&gt; by Greg Breinin. Despite the hyperbolic title, it&#39;s a really good introduction to the subject. Actually, the title is entirely appropriate, since the previous Yellowstone eruption around 600,000 years ago was one &lt;i&gt;thousand&lt;/i&gt; times as powerful as the 1980 Mount St. Helens eruption. And it&#39;s likely to erupt again, but no one knows when.&lt;br /&gt;
&lt;br /&gt;
We&#39;ve been on a bit of a volcano tour recently. First &lt;a href=&quot;http://faites-simple.blogspot.com/2011/10/lake-almanor-eagle-lake-and-lassen.html&quot;&gt;we visited Lassen Volcanic National Park&lt;/a&gt; in October (climbing the Cinder Cone was a highlight), and &lt;a href=&quot;http://faites-simple.blogspot.com/2012/04/towards-seattle-and-other-thoughts.html&quot;&gt;we stopped in on Mount St. Helens visitor center&lt;/a&gt; on our way to Seattle last month. Yesterday &lt;a href=&quot;http://faites-simple.blogspot.com/2012/05/yellowstone-mammoth-hot-springs-to-old.html&quot;&gt;we ventured into the Yellowstone caldera&lt;/a&gt; (the bit that blew out in the last eruption).&lt;br /&gt;
&lt;br /&gt;
Before reading the book I hadn&#39;t appreciated how recent our understanding of Yellowstone&#39;s geology is. It was only in the 1960s that scientists combined new empirical data about the ages of different rock formations in the park with the then emerging theory of plate tectonics. One of the scientists was Robert Christiansen of the U.S. Geological Survey, who, with Richard Blank, collected samples from all over Yellowstone and pieced together the puzzle of how Yellowstone formed. (He also wrote &lt;a href=&quot;http://pubs.usgs.gov/pp/pp729g/&quot;&gt;the definitive account of Yellowstone&#39;s geology&lt;/a&gt; in 2001.)&lt;br /&gt;
&lt;br /&gt;
They realized that the series of calderas between Oregon and Wyoming were all eruptions caused by what is now known as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Yellowstone_Hotspot&quot;&gt;Yellowstone hotspot&lt;/a&gt; over the last 16 million years. The continental plate is moving south west, which makes the newer volcanoes appear in the north east.&lt;br /&gt;
&lt;br /&gt;
This &lt;a href=&quot;http://en.wikipedia.org/wiki/File:HotspotsSRP.jpg&quot;&gt;diagram from Wikipedia&lt;/a&gt; summarizes it nicely:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/HotspotsSRP.jpg/800px-HotspotsSRP.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;219&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/HotspotsSRP.jpg/800px-HotspotsSRP.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/1017419998967425216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/1017419998967425216' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1017419998967425216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1017419998967425216'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2012/05/volcanoes.html' title='Volcanoes!'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-7077861757926689669</id><published>2011-06-04T23:04:00.017+01:00</published><updated>2011-06-06T04:50:16.882+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache"/><category scheme="http://www.blogger.com/atom/ns#" term="Cloud Computing"/><category scheme="http://www.blogger.com/atom/ns#" term="Hadoop"/><category scheme="http://www.blogger.com/atom/ns#" term="Whirr"/><title type='text'>What&#39;s new in Apache Whirr 0.5.0-incubating</title><content type='html'>&lt;a href=&quot;http://incubator.apache.org/whirr/&quot;&gt;Apache Whirr&lt;/a&gt; 0.5.0-incubating is &lt;a href=&quot;http://www.apache.org/dyn/closer.cgi/incubator/whirr/&quot;&gt;now available&lt;/a&gt;. Whirr is a library and command line interface for running distributed services like Apache Hadoop in the cloud. Note that Whirr is currently undergoing       Incubation at the Apache Software Foundation, which means that, in particular, the project has yet to be&lt;br /&gt;fully endorsed by the ASF. Please read the full &lt;a href=&quot;http://svn.apache.org/repos/asf/incubator/whirr/trunk/DISCLAIMER.txt&quot;&gt;disclaimer&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In this release the &lt;a href=&quot;http://incubator.apache.org/whirr/team-list.html&quot;&gt;Whirr development team&lt;/a&gt; have added many new features while still making the core more solid. This post covers some of the more important changes. The full list can be found in the &lt;a href=&quot;http://incubator.apache.org/whirr/release-notes.html&quot;&gt;release notes&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Improving the new user experience&lt;/h3&gt;Orchestrating multiple services on cloud instances is a challenge to make simple, and Whirr has sometimes been a little fiddly to get running. SSH settings, in particular, have been a common sticking point with new users. The new &lt;a href=&quot;http://incubator.apache.org/whirr/whirr-in-5-minutes.html&quot;&gt;Whirr in 5 Minutes&lt;/a&gt; guide walks through the minimum number of commands you need to type to get a simple 3-node ZooKeeper cluster running in a few minutes. From there you can move on to the &lt;a href=&quot;http://incubator.apache.org/whirr/quick-start-guide.html&quot;&gt;Quick Start Guide&lt;/a&gt; and the &lt;a href=&quot;http://incubator.apache.org/whirr/configuration-guide.html&quot;&gt;Configuration Guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The sample configurations in the &lt;i&gt;recipes&lt;/i&gt; directory in the distribution contain useful settings for running the services on a variety of cloud providers. Users are always encouraged to share their working configurations with the &lt;a href=&quot;http://incubator.apache.org/whirr/mail-lists.html&quot;&gt;community&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;New services&lt;/h3&gt;Elastic Search and Voldemort have been added to the roster of services that come with Whirr. This brings the total to six; adding to Apache Cassandra, Apache Hadoop, Apache HBase, and Apache ZooKeeper.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;API improvements&lt;/h3&gt;Whirr is still a young project so it is not surprising that its API is rapidly evolving. In &lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-245&quot;&gt;WHIRR-245&lt;/a&gt;, the demarcation between the user API (for users who control Whirr clusters from Java) and the service API (for developers writing new Whirr services) was clarified. The user API can be found in the &lt;a href=&quot;http://incubator.apache.org/whirr/apidocs/org/apache/whirr/package-summary.html&quot;&gt;org.apache.whirr&lt;/a&gt; package; whereas the service API is in &lt;a href=&quot;http://incubator.apache.org/whirr/apidocs/org/apache/whirr/service/package-summary.html&quot;&gt;org.apache.whirr.service&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can find out more about writing Whirr services in &lt;a href=&quot;https://cwiki.apache.org/confluence/download/attachments/25199475/how-to-write-a-whirr-service.pdf?version=1&amp;amp;modificationDate=1301953266000&quot;&gt;this presentation&lt;/a&gt; (PDF).&lt;br /&gt;&lt;br /&gt;The firewall API that service writers use to open ports for services was simplified and made more powerful in &lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-275&quot;&gt;WHIRR-275&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Overriding scripts&lt;/h3&gt;This feature was actually introduced in Whirr 0.4.0-incubating, but it&#39;s useful enough to mention here. In older versions of Whirr, if you wanted to make a modification to the scripts that run on cloud instances - to tweak some settings, for instance - you would have to upload your modifications (as well as all the other scripts) to a publicly available web server (Amazon S3 was a common choice), then point Whirr at the new location. Not particularly difficult, but a big enough barrier to discourage users from trying it.&lt;br /&gt;&lt;br /&gt;The new approach is to push scripts to nodes from the launching machine, so you can just edit them locally before launch. Full instructions are covered in the &lt;a href=&quot;http://incubator.apache.org/whirr/faq.html#How_can_I_modify_the_instance_installation_and_configuration_scripts&quot;&gt;FAQ&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Running scripts on nodes&lt;br /&gt;&lt;/h3&gt;In 0.5.0 the scripts that run on cloud instances have been broken up to be more fine-grained, so many services have individual start and stop scripts (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-266&quot;&gt;WHIRR-266&lt;/a&gt;). Combined with the ability to run scripts on  sets of nodes in the cluster (by ID or role), users now have more control of the cluster once it has launched (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-173&quot;&gt;WHIRR-173&lt;/a&gt;). Try running &lt;code&gt;whirr run-script&lt;/code&gt; at the command line to use this feature. There&#39;s a contrib script to run the &lt;a href=&quot;https://github.com/brianfrankcooper/YCSB&quot;&gt;Yahoo! Cloud Serving Benchmark&lt;/a&gt; (YCSB) against an HBase cluster, which takes advantage of the run-script command (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-287&quot;&gt;WHIRR-287&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Also useful is &lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-291&quot;&gt;WHIRR-291&lt;/a&gt;, which allows you to launch &quot;blank&quot; nodes with no services running on them (in a &quot;noop&quot; role), and then, with &lt;code&gt;whirr run-script&lt;/code&gt;, run arbitrary scripts on them to bring them into the state you want.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Custom service builds&lt;/h3&gt;Developers who work on services supported in Whirr will find the ability to push a custom build to a cluster very useful for testing (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-220&quot;&gt;WHIRR-220&lt;/a&gt;). For example, if you are working on a ZooKeeper feature, you can build a ZooKeeper tarball with your new feature, then launch a cluster that uses this tarball by specifying &lt;code&gt;whirr.zookeeper.tarball.url&lt;/code&gt; as a local &lt;i&gt;file://&lt;/i&gt; URL pointing to your tarball. Whirr will push the tarball to a temporary blob store container, then each node will download from there.&lt;br /&gt;&lt;br /&gt;I used a variation of this feature to try out a &lt;a href=&quot;https://builds.apache.org/job/Hadoop-22-Build/&quot;&gt;nightly Hadoop 0.22 build&lt;/a&gt; on a small Whirr cluster. In this case the tarball URL is not a local file, so Whirr doesn&#39;t copy the tarball to a blob store since it is already accessible from the cloud.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Service improvements&lt;/h3&gt;Whirr is only able to exist because of the powerful abstraction that &lt;a href=&quot;http://code.google.com/p/jclouds/&quot;&gt;jclouds&lt;/a&gt; provides for interacting with cloud providers. A great example of this power is the API that jclouds provides for discovering the hardware capabilities of an instance running on any provider. &lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-282&quot;&gt;WHIRR-282&lt;/a&gt; took advantage of the jclouds API to find the number of cores on a node to dynamically configure the number of slots in a Hadoop cluster. Previously, you had to set this manually for each cluster to take full advantage of larger image sizes.&lt;br /&gt;&lt;br /&gt;This is just the beginning - there is more work to use memory capabilities to set configuration (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-229&quot;&gt;WHIRR-229&lt;/a&gt;), and to use hardware capabilities generally in services other than Hadoop.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Cluster state storage&lt;/h3&gt;In previous releases of Whirr, information about launched instances was stored in a file on the machine that launched the cluster (&lt;i&gt;~/.whirr/&amp;lt;cluster-name&amp;gt;/instances&lt;/i&gt;). With &lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-288&quot;&gt;WHIRR-288&lt;/a&gt;, it&#39;s now possible to store this information in a blob store instead (such as Amazon S3, although any jclouds-supported blob store can be used), which is useful if you want to control clusters from multiple machines.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Bring Your Own Nodes&lt;/h3&gt;Or just BYON, for short. Many users have requested the ability to deploy to privately owned hardware - and jclouds added this feature in 1.0-beta-9. Whirr now has preliminary support for BYON clusters. In a nutshell, you write a YAML file enumerating the nodes to deploy to - their addresses, access credentials, etc. - then Whirr will start services on them. The nodes just need to have a base OS like Centos or Ubuntu installed. You can find an example BYON configuration in the &lt;i&gt;recipes&lt;/i&gt; directory of the download.&lt;br /&gt;&lt;br /&gt;BYON is also useful for testing locally by using VMware or VirtualBox to host target nodes.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;A hummingbird&lt;/h3&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://incubator.apache.org/whirr/images/whirr-logo.png&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: right; cursor: pointer; width: 247px; height: 260px;&quot; src=&quot;http://incubator.apache.org/whirr/images/whirr-logo.png&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Last, but not least, Whirr finally has a logo! Many thanks to Alison Wong, who designed it and donated it to the ASF.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Credits&lt;/h3&gt;I would like to thank everyone who helped with the 0.5.0-incubating release. We have a growing community, and we welcome feedback and help from new users and developers. If you&#39;d like to get involved you can start by &lt;a href=&quot;http://www.apache.org/dyn/closer.cgi/incubator/whirr/&quot;&gt;downloading the new release&lt;/a&gt; and joining us on the &lt;a href=&quot;http://incubator.apache.org/whirr/mail-lists.html&quot;&gt;mailing lists&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What&#39;s next?&lt;/h3&gt;It&#39;s difficult to make firm predictions about the contents of the next release since Whirr is an open source project with many &lt;a href=&quot;https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&amp;amp;jqlQuery=project+%3D+WHIRR+AND+resolution+%3D+Unresolved&quot;&gt;open issues&lt;/a&gt;, but the general themes include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Adding &lt;a href=&quot;https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&amp;amp;jqlQuery=project+%3D+WHIRR+AND+component+%3D+%22new+service%22+and+resolution+%3D+Unresolved&quot;&gt;more services&lt;/a&gt;. In tandem, we want to make it easier to write new services by pushing common patterns into the core (e.g. &lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-326&quot;&gt;WHIRR-326&lt;/a&gt; is one example of this).&lt;/li&gt;&lt;li&gt;Improving existing services. By making them more flexible, better configured, easier to manage.&lt;/li&gt;&lt;li&gt;Adding &lt;a href=&quot;https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&amp;amp;jqlQuery=project+%3D+WHIRR+AND+component+%3D+%22new+provider%22+and+resolution+%3D+Unresolved&quot;&gt;more cloud providers&lt;/a&gt;. The latest release of jclouds supports 30 providers, and we need help testing more of them with Whirr.&lt;/li&gt;&lt;li&gt;Implementing services using other configuration management tools, rather than bash scripting. Andrei Savu is working on using Puppet to write new services (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-255&quot;&gt;WHIRR-255&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;Supporting elastic clusters, so new nodes can be added to running clusters (&lt;a href=&quot;https://issues.apache.org/jira/browse/WHIRR-214&quot;&gt;WHIRR-214&lt;/a&gt;).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/7077861757926689669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/7077861757926689669' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/7077861757926689669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/7077861757926689669'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2011/06/whats-new-in-apache-whirr-050.html' title='What&#39;s new in Apache Whirr 0.5.0-incubating'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-8764174624555956580</id><published>2011-05-09T04:23:00.008+01:00</published><updated>2011-05-09T06:03:43.083+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Data"/><title type='text'>Do Donors Choose Local Schools?</title><content type='html'>&lt;a href=&quot;http://www.donorschoose.org/&quot;&gt;DonorsChoose.org&lt;/a&gt; is a site where people donate money to school projects. For example, a teacher in Iowa might create a project request for some beanbags to create a reading area for her pupils. Then, via the website, donors can give as much or as little as they like to the project, and once the target is reached DonorsChoose purchase and deliver the beanbags to the school.&lt;br /&gt;&lt;br /&gt;DonorsChoose are running a contest. They have opened up their data, and are challenging developers to &quot;&lt;a href=&quot;http://www.donorschoose.org/hacking-education&quot;&gt;make discoveries and build apps that improve education in America&lt;/a&gt;&quot;.&lt;br /&gt;&lt;br /&gt;I thought I&#39;d do a little hack to answer the question &quot;Do donors tend to choose their local schools?&quot;&lt;br /&gt;&lt;br /&gt;I wrote a short Python program to calculate the distance between each donor&#39;s address (where it was provided) and the address of the school for the project they were donating to. Then, using R, I plotted the following histogram:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQMHKTKMhIIuFBmm4-VDIDos7h6f-ko5rpG3lipP0a6Ha80Or6-btm3AZLJ_9fikkv97Hx2RWNlNALS5W0Ya1PQaCxWuAcUeO5nFo24IJtfnWLiuvxH-bamPI2T9sv7oNvMCxel8cHXOHJ/s1600/distance-hist.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQMHKTKMhIIuFBmm4-VDIDos7h6f-ko5rpG3lipP0a6Ha80Or6-btm3AZLJ_9fikkv97Hx2RWNlNALS5W0Ya1PQaCxWuAcUeO5nFo24IJtfnWLiuvxH-bamPI2T9sv7oNvMCxel8cHXOHJ/s400/distance-hist.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5604562315133730578&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It&#39;s striking that many donors are local. In fact, in my analysis, one in four donors live within four miles of the school they are donating to, and the median distance is 128 miles. However, there is a long tail reaching to over 5000 miles!&lt;br /&gt;&lt;br /&gt;If we use a logarithmic scale for the y-axis (count), then a couple of features jump out. This plot is a scatter plot where counts are bucketed by integer distance.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCcqWnvg6f1v_DcZyeUoMfXIfzSGrNNQDavtBByeQlKf4OBtJyk_y8kblG3jkYEIOe09I_v5fHFwU8iAq70ipkLqL-ENfYyUm30OGPCV53vwfl2TzzjtXANbd76pIIi8Tv1yYmF9XG1Myh/s1600/distance-log.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCcqWnvg6f1v_DcZyeUoMfXIfzSGrNNQDavtBByeQlKf4OBtJyk_y8kblG3jkYEIOe09I_v5fHFwU8iAq70ipkLqL-ENfYyUm30OGPCV53vwfl2TzzjtXANbd76pIIi8Tv1yYmF9XG1Myh/s400/distance-log.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5604562621631644050&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There is a small peak at around 2500 miles, which is puzzling until you realize that this is the approximate distance between the East Coast and West Coast of the USA, where the majority of the population is located. I&#39;m guessing that this bump corresponds to people who donate to schools of friends and relatives on the other coast.&lt;br /&gt;&lt;br /&gt;The other noticeable feature is the significant drop off after 2500 miles. This small number of donations is where the donor or school is located in the non-contiguous states (Alaska and Hawaii), which have only a small fraction of the total population.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;How I produced the images&lt;/h3&gt;I wrote a Python program to parse the CSV &lt;a href=&quot;http://developer.donorschoose.org/the-data/&quot;&gt;data&lt;/a&gt; from DonorsChoose. It reads two data files - the projects file and the donations file. The files are joined by the project ID field, which means we can access the school ZIP code (from the projects file), and the partial ZIP code of the donor (from the donations file). The donor&#39;s ZIP code is optional (and was actually only present in 46% of donations, so the results are restricted to this subset of donations). Also, for privacy reasons, only the first 3 digits of the donor&#39;s ZIP code are provided by DonorsChoose. This makes the distance measurements less accurate, particularly for local donors.&lt;br /&gt;&lt;br /&gt;In the case of the partial ZIP code matching the school ZIP code, I set the distance to zero, on the assumption that the donor lives close to the school. This assumption will tend to overcount the zero distance case, and undercount small distances.&lt;br /&gt;&lt;br /&gt;If the partial ZIP code did not match the school ZIP code, I chose a ZIP code with that prefix at random and calculate the distance between that ZIP code and the school&#39;s ZIP code. For this calculation I used Kevin T. Ryan&#39;s Python &lt;a href=&quot;http://code.activestate.com/recipes/393241-calculating-the-distance-between-zip-codes/&quot;&gt;code at ActiveState&lt;/a&gt;, which I modified slightly to support partial ZIP codes.&lt;br /&gt;&lt;br /&gt;The program buckets integers distances and writes the counts to a file. I then used R to plot the distributions show above.&lt;br /&gt;&lt;br /&gt;I&#39;ve put all my code into a &lt;a href=&quot;https://github.com/tomwhite/donors-choose-hack&quot;&gt;GitHub repository&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This hack just scratches the surface of the dataset, and I look forward to seeing some of the cool things that others do in this &lt;a href=&quot;http://www.donorschoose.org/hacking-education&quot;&gt;contest&lt;/a&gt;. The closing date is June 30, 2011.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/8764174624555956580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/8764174624555956580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8764174624555956580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8764174624555956580'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2011/05/do-donors-choose-local-schools.html' title='Do Donors Choose Local Schools?'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQMHKTKMhIIuFBmm4-VDIDos7h6f-ko5rpG3lipP0a6Ha80Or6-btm3AZLJ_9fikkv97Hx2RWNlNALS5W0Ya1PQaCxWuAcUeO5nFo24IJtfnWLiuvxH-bamPI2T9sv7oNvMCxel8cHXOHJ/s72-c/distance-hist.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-8434577759482729644</id><published>2011-04-16T23:23:00.005+01:00</published><updated>2011-04-18T04:59:14.088+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Whirr"/><title type='text'>Whirr in 5 Minutes</title><content type='html'>A couple of days ago I wrote down a sequence of command lines to install &lt;a href=&quot;http://incubator.apache.org/whirr/&quot;&gt;Apache Whirr&lt;/a&gt; (an incubator project for running distributed systems on various cloud providers) and run a service from scratch. You just need Java, SSH, and some &lt;a href=&quot;http://incubator.apache.org/whirr/faq.html#How_do_I_find_my_cloud_credentials&quot;&gt;cloud credentials&lt;/a&gt; (Amazon EC2 in this case): I&#39;ve reproduced the commands here:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;export AWS_ACCESS_KEY_ID=...&lt;br /&gt;export AWS_SECRET_ACCESS_KEY=...&lt;br /&gt;curl -O http://www.apache.org/dist/incubator/whirr/whirr-0.4.0-incubating/whirr-0.4.0-incubating.tar.gz&lt;br /&gt;tar zxf whirr-0.4.0-incubating.tar.gz; cd whirr-0.4.0-incubating&lt;br /&gt;ssh-keygen -t rsa -P &#39;&#39; -f ~/.ssh/id_rsa_whirr&lt;br /&gt;bin/whirr launch-cluster --config recipes/zookeeper-ec2.properties --private-key-file ~/.ssh/id_rsa_whirr&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;At this point you should have a 3 node ZooKeeper cluster running, which is easily checked with&lt;br /&gt;&lt;code&gt;&lt;br /&gt;echo &quot;ruok&quot; | nc $(awk &#39;{print $3}&#39; ~/.whirr/zookeeper/instances | head -1) 2181; echo&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;You can shutdown the cluster with the following command.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;bin/whirr destroy-cluster --config recipes/zookeeper-ec2.properties&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;There are recipes for more services in the &lt;a href=&quot;http://www.apache.org/dyn/closer.cgi/incubator/whirr/&quot;&gt;Whirr download&lt;/a&gt; package, and more detailed instructions in the &lt;a href=&quot;http://incubator.apache.org/whirr/quick-start-guide.html&quot;&gt;Quick Start Guide&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/8434577759482729644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/8434577759482729644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8434577759482729644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/8434577759482729644'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2011/04/whirr-in-5-minutes.html' title='Whirr in 5 Minutes'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-1093096056004881234</id><published>2010-11-28T05:22:00.004+00:00</published><updated>2010-11-28T05:58:24.087+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>My favourite talk at Devoxx 2010</title><content type='html'>I went to &lt;a href=&quot;http://www.devoxx.com/display/Devoxx2K10/Home&quot;&gt;Devoxx&lt;/a&gt; in Antwerp for the first time this year, and really enjoyed it. I didn&#39;t go to that many talks, but the quality seemed very high. My favourite talk was &quot;Performance Anxiety&quot; by &lt;a href=&quot;http://en.wikipedia.org/wiki/Joshua_Bloch&quot;&gt;Josh Bloch&lt;/a&gt;, because he&#39;s a great speaker and because he presented a single important idea so well.&lt;br /&gt;&lt;br /&gt;The idea was this: determining the performance of programs should be treated as an empirical science. We should give up any hope (if any existed) that predicting a program&#39;s performance will become easier in the future, since every layer in the deep stack of a modern computer is becoming more complex. Increased complexity is actually the price we must pay for increased performance. And increased complexity leads, almost inevitably, to reduced predictability.&lt;br /&gt;&lt;br /&gt;As an experimental demonstration, Josh ran a micro benchmark to sort an array of integers. (The demo actually failed to show what he wanted to show, but he assured us it had worked earlier... It&#39;s somehow reassuring when live demos don&#39;t work for Java demigods either.) Each invocation of the benchmark did a number of runs, and the timings of the runs converged on a stable value. However, between benchmark invocations, the stable values that they converged on varied by up to 20%.&lt;br /&gt;&lt;br /&gt;The reason is subtle: the HotSpot compiler produces different compile plans on different runs, and these have different performance profiles. (This is explained in Cliff Click&#39;s 2009 JavaOne presentation, &lt;a href=&quot;http://www.azulsystems.com/events/javaone_2009/session/2009_J1_Benchmark.pdf&quot;&gt;&quot;The Art of (Java) Benchmarking&quot;&lt;/a&gt;.) They all converge on stable values, but &lt;span style=&quot;font-style: italic;&quot;&gt;different&lt;/span&gt; stable values for &lt;span style=&quot;font-style: italic;&quot;&gt;different&lt;/span&gt; runs. The fact that HotSpot is non-deterministic may not be particularly surprising, but Josh said that the same behaviour has been shown in C code and even assembler, since non-determinism exists at lower levels of the stack too.&lt;br /&gt;&lt;br /&gt;The practical upshot is that we need to change how we iteratively benchmark code. No longer is it permissible to run a benchmark, make a change, run the benchmark again, see that the execution time was faster (even across a number of runs in one VM) and legitimately conclude that it was due to the change we made. We have to reach for statistical tools that tell us the improved execution time was significant after we have run enough VMs.&lt;br /&gt;&lt;br /&gt;How many VMs? The short answer is &quot;30&quot;, the longer answer is in &lt;a href=&quot;http://buytaert.net/files/oopsla07-georges.pdf&quot;&gt;&quot;Statistically Rigorous Java Performance Evaluation&quot;&lt;/a&gt; by Andy Georges, Dries Buytaert, and Lieven Eeckhout.&lt;br /&gt;&lt;br /&gt;Thankfully there is a Java framework called &lt;a href=&quot;http://code.google.com/p/caliper&quot;&gt;Caliper&lt;/a&gt; which can help you run microbenchmarks and which even plots the error bars for you. This stuff needs to see wider adoption in the industry.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/1093096056004881234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/1093096056004881234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1093096056004881234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1093096056004881234'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2010/11/my-favourite-talk-at-devoxx-2010.html' title='My favourite talk at Devoxx 2010'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-7308341528704841683</id><published>2009-05-01T16:52:00.008+01:00</published><updated>2009-05-06T21:33:53.937+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Book"/><category scheme="http://www.blogger.com/atom/ns#" term="Hadoop"/><title type='text'>&quot;Hadoop: The Definitive Guide&quot; Coming Soon</title><content type='html'>&lt;a href=&quot;http://www.hadoopbook.com/&quot;&gt;&lt;img style=&quot;margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 240px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht7LyWorh349Y6F4Wcdj3Y2j8nTescUQKzVDo8dbYtUlsinuSJzuTnPl89xH-CcYt88Olq1reM-GuXqptZaxOLmxY8A-pTyI2EHyQ0YFjgJD2mpFP9394v53hMNlKMVh2sa96ZWF3lkW4_/s320/htdg.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5330887690130538978&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;After a busy couple of months I&#39;ve finished the writing for &quot;&lt;a href=&quot;http://www.hadoopbook.com/&quot;&gt;Hadoop: The Definitive Guide&lt;/a&gt;&quot;. It&#39;s now going through the production process at O&#39;Reilly.&lt;br /&gt;&lt;br /&gt;You can pre-order it on &lt;a href=&quot;http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/0596521979/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1241193282&amp;amp;sr=8-1&quot;&gt;Amazon&lt;/a&gt; and &lt;a href=&quot;http://oreilly.com/catalog/9780596521998/&quot;&gt;O&#39;Reilly&lt;/a&gt;. You can also get the Rough Cuts version from O&#39;Reilly to read today, although it hasn&#39;t yet been refreshed with my latest draft (I hope that will happen in the next few days).&lt;br /&gt;&lt;br /&gt;Here&#39;s the final chapter listing. Readers of earlier drafts will notice that the number of chapters has grown: this is because the elephantine MapReduce chapter has been split into three (chapters 6, 7, and 8) to make things more digestible.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Meet Hadoop&lt;/li&gt;&lt;li&gt;MapReduce&lt;/li&gt;&lt;li&gt;The Hadoop Distributed Filesystem&lt;/li&gt;&lt;li&gt;Hadoop I/O&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Developing a MapReduce Application&lt;/li&gt;&lt;li&gt;How MapReduce Works&lt;/li&gt;&lt;li&gt;MapReduce Types and Formats&lt;/li&gt;&lt;li&gt;MapReduce Features&lt;/li&gt;&lt;li&gt;Setting Up a Hadoop Cluster&lt;/li&gt;&lt;li&gt;Administering Hadoop&lt;/li&gt;&lt;li&gt;Pig&lt;/li&gt;&lt;li&gt;HBase&lt;/li&gt;&lt;li&gt;ZooKeeper&lt;/li&gt;&lt;li&gt;Case Studies&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;The writing&#39;s done but I still have to package up the example code. I&#39;ll be doing this soon, and it will appear on the &lt;a href=&quot;http://hadoopbook.com/&quot;&gt;book&#39;s website&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/7308341528704841683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/7308341528704841683' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/7308341528704841683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/7308341528704841683'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2009/05/hadoop-definitive-guide-coming-soon.html' title='&quot;Hadoop: The Definitive Guide&quot; Coming Soon'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht7LyWorh349Y6F4Wcdj3Y2j8nTescUQKzVDo8dbYtUlsinuSJzuTnPl89xH-CcYt88Olq1reM-GuXqptZaxOLmxY8A-pTyI2EHyQ0YFjgJD2mpFP9394v53hMNlKMVh2sa96ZWF3lkW4_/s72-c/htdg.jpg" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-1506167963919896927</id><published>2009-01-27T10:01:00.002+00:00</published><updated>2009-01-27T10:17:18.091+00:00</updated><title type='text'>Draft Pig Chapter</title><content type='html'>A couple of quick updates on the &lt;a href=&quot;http://www.hadoopbook.com/&quot;&gt;Hadoop book&lt;/a&gt; I&#39;m writing. The Pig chapter is now available on &lt;a href=&quot;http://safari.oreilly.com/9780596521974?cid=orm-cat-readnow-9780596521974&quot;&gt;Safari&lt;/a&gt;. It still has a few holes, but I&#39;d love to hear feedback on it.&lt;br /&gt;&lt;br /&gt;Also included is a Hadoop case study from Last.fm. Thanks to Adrian Woodhead and Marc de Palol for writing it.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/1506167963919896927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/1506167963919896927' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1506167963919896927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/1506167963919896927'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2009/01/draft-pig-chapter.html' title='Draft Pig Chapter'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8898949683610477251.post-5053020334356534059</id><published>2008-11-20T10:39:00.005+00:00</published><updated>2008-11-20T10:49:06.393+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cloudera"/><category scheme="http://www.blogger.com/atom/ns#" term="Hadoop"/><title type='text'>Hadoop Developer Zeitgeist</title><content type='html'>The Cloudera team have just released a &lt;a href=&quot;http://community.cloudera.com/&quot;&gt;website&lt;/a&gt; which has a few reports on various Hadoop development metrics. I like the &lt;a href=&quot;http://community.cloudera.com/reports/2/issues/&quot;&gt;Most Watched Open Jira Issues&lt;/a&gt;, as it gives a good summary of what Hadoop Core developers are thinking about.&lt;br /&gt;&lt;br /&gt;Personally, I can&#39;t wait for the new MapReduce API (&lt;a href=&quot;http://issues.apache.org/jira/browse/HADOOP-1230&quot;&gt;HADOOP-1230&lt;/a&gt;), which is currently the third most watched issue.</content><link rel='replies' type='application/atom+xml' href='http://problemsworthyofattack.blogspot.com/feeds/5053020334356534059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8898949683610477251/5053020334356534059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/5053020334356534059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8898949683610477251/posts/default/5053020334356534059'/><link rel='alternate' type='text/html' href='http://problemsworthyofattack.blogspot.com/2008/11/hadoop-developer-zeitgeist.html' title='Hadoop Developer Zeitgeist'/><author><name>Tom White</name><uri>http://www.blogger.com/profile/02418758537880869494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://farm2.static.flickr.com/1358/822201572_051b33f802_s.jpg'/></author><thr:total>0</thr:total></entry></feed>