Gathering social media posts into Day One


Day One is a great journalling application that runs on the Mac, iPad and iPhone. I have been using it since January to write a diary, keep track of my diet, keep track of my exercise and record a few other things.

Sometimes, it is nice to drag items from other sources into Day One. This is possible to do by hand but automating it is better. I have been looking at integrating Twitter and Insta.gram into Day One using IFTTT, a web based tool for triggering actions between web sites. An example of the use of IFTTT is that you can setup a rule to post on Facebook when you post on Twitter.

The integration of Day One with IFTTT is not a new idea at all. The GiftttDy script will do most of the work provided you are prepared to buy Hazel for $28. Hazel is a tool for running scripts or actions on the basis of files appearing in directories.

I used GiftttDy for a couple of days and it does the job. For me, a couple of things were missing:

1. I don’t like the format of the Twitter journal entries

2. I don’t want every Tweet to be imported. For example a blog post like this will be manually added by me in DayOne, so adding any related tweets is not necessary.

3. I couldn’t see how to tag my tweets in GiftttDy

So I set about writing my own scripts to do it. The way it works is exactly the same to GiftttDy. I have an action on IFTTT that saves every tweet to a file on Dropbox in a designated directory. Hazel monitors this directory and runs my script against the text file. The script uses the Day One command line tool to add the entry to Day One.

The Day One command line tool could do with some extra features, but the one that is missing is an option to tag a post. I didn’t have too long to spend on this, but I decided that the best way to proceed was to add a second directory that Hazel monitors. This directory contains details of the new Day One file and I have a script to hack in the tags. This script is truly horrible – it edits an XML file and inserts text in the right place. And this nastiness can simply disappear when a command line option to the tool is added to tags.

Obviously owning the code to the script means that I can format the tweets exactly how I want them. I have some ugly code to tag the tweets. What about my second problem? For this, I use curl and some simply pattern matching on the tweet. I use curl to expand any URLs in the tweet to their actual full versions because usually they are short URLs. Once I have the full versions, I can determine if I want to ignore them on the basis of the URL.

By a similar means, it is possible to add Instagram photographs to Day One – this is even easier than a tweet because IFTTT will write the picture file to a directory with the message in the filename.

My scripts are so ugly I won’t publish them here, but you can contact me if you want to see them. You should probably start with GiftttDy and go from there. I may well start using GiftttDy again if I can work out how to format the messages but one cannot beat a little exercise in programming to stretch the mind.

Posted in Technology and Web | Leave a comment

Don’t let your own marketing work against you

This was the weekend to buy an Xbox One or for me at least. I saw an offer at a leading games store and that convinced me to go ahead and finally purchase one. I wrote in November that I would not go out and buy one immediately, but it felt like the right time.

The store had an offer on for an Xbox One, Titanfall download and Call of Duty Ghosts at £399. I went to the store and the offer was advertised outside. I allowed my lady to choose an addition game (Need for Speed Rivals for the record) and I picked up a second controller. All this would have brought the store about £500 of sales but when I got to the till they could not sell me the offer. They had no copies of Call of Duty. All they could offer me was the Titanfall Xbox at the same price as the offer, £399. They were not prepared to let me pick up Call of Duty at a later date, so I left it.

We checked a second shop and the prices were too high. Then we checked a third shop where they had an Xbox One, Titanfall and Kinect Sports for £420. We ended up buying this with Need for Speed Rivals and a second controller.

What is the moral of this tale? Well, I guess the original advert whetted my appetite and I decided to make the decision to buy an Xbox. At this point, I’d made the decision and I was going to get one regardless. The marketing at one store enticed me to buy an Xbox at a different store. The lack of willingness on the behalf of the first store meant they lost my business – they were advertising a deal outside the store and they should not have been given the lack of stock.

Posted in Games, Technology and Web | Tagged | Leave a comment

5 ways to avoid pointless eating

Since April 2011 I have taken more care about what I eat and furthermore since July 2012, I have been eating less sugars and starchy carbohydrates. I have become more sensitive to “pointless eating”.

The fact is, when we go out to a sporting event, the cinema or the theatre we have the option to buy junk. It is everywhere. At the football it is traditional to have a pie and a pint. At the cinema, I get sick to death of the sound of popcorn being munched. At the baseball stadium, it is easy to buy hot dogs, popcorn, crackerjacks, fried dough, burgers, fries and beer at your seat. It is true that you can find a decent steak sandwich and a salad at some baseball stadiums but it is rare (I mean non-existent rather than the way it is cooked before you ask).

The time when I lost the most weight (or rather fat) in my life was when I spent September 2012 travelling around New England and Baltimore. I was on the Slow-Carb diet. At the beginning of September i was wearing 38 slim jeans which were a little baggy. Three weeks into September and I had to visit Gap in a hurry to buy 36″ ones. I was living off scrambled eggs and broccoli, rice-less Chipotle bowls, steaks and fish with vegetables. In the oldest restaurant in America, I ordered a lobster for dessert. On Saturdays I was stuffing my face with anything I could get my hands on. The only exercise I was doing was walking. The diet itself was doing its magic and by October I’d got to 76kg down from 86kg in July.

Being on my own and travelling made me very observant of others. I sat on a Greyhound bus from Boston to New Hampshire. There was a dude on the bus. He looked like a cool dude, but he was severely overweight. In the space of an hour he got through a pack of Reese Peanut butter cakes and a pack of cola bottles. I doubt very much he was hungry.

These are snacks that are completely pointless and unnecessary – you should forget about them for most of your week.

Here are some steps to take to avoid stuffing your face with pointless foods:

  1. Go nuts. A handful of cashew nuts will stop your hunger. Buy a large bag and portion them off into 8-10 pieces. Keep these for emergencies. After 15 minutes of eating them, your hunger will have gone. So will celery sticks laden with peanut butter (choose a pure one – peanut butter does not need any other ingredients other than peanuts).
  2. Hydrate. Are you hungry or thirsty? Yes, you are probably thirsty. Contribute to your 2 litres of water a day by drinking instead of snacking.
  3. Treat yourself with a glass of red. Out at the theatre or with friends? A small glass of red wine will not kill you and may have positive health benefits, but small means 125ml. You can have two of these a day. Make sure you are hydrated however.
  4. Queue it up. Want a doughnut? Write it on a list. On Saturday allow yourself what you want and revisit that list. 
  5. Try to think about those less fortunate in the world. Did you have a choice for breakfast today? Congratulations. Many in the world did not this morning and will not tomorrow morning either. If you have a choice to eat healthily, why choose otherwise?
Posted in Diet | Tagged , , | Leave a comment

Setbacks

It has been a month of setbacks. About one month ago I went to the gym and did some shoulder exercises. The following day, I carried a large suitcase and a very full backpack to the office in London, intending to carry it onto the Heathrow Express later in the day. Strangely, it was picking up a small laptop that caused the back problem. Twang!

I still flew to Prague but went to an Osteopath there and got fixed up. In parallel to all this, I have been working on a personal project that has taken a lot of my time but alas has gone nowhere. I have not been able to train for my bike ride in May (London to Amsterdam then to Brussels) either. When I have had the time, I have not felt like it.

Oh, and I had a Burger King for lunch today. Big King XXL of a fail.

Basically all these silly little things have affected my diet and my fitness. I can see the difference in my muscles just by looking in the mirror.

The only way to start riding a bike after falling off is to get back on it. Start again. And if you fail, start again. Keep starting again and never give up. I went to the gym this evening and working on my chest and triceps, finishing with a bike ride. It was great to feel the pump of the gym again.

Posted in Diet, Fitness, Rants and Opinion | Tagged , | Leave a comment

The Cyrillic Alphabet

I have an interest in foreign languages but I have to say that I’m not very good at learning them. I did reasonably well at French at school but could never really apply what I learnt. I did 5 years of French and 2 years of German, and I can speak neither if the truth be told. 

In early 2012 I started to learn Czech and took lessons. It didn’t really sink in and I had to stop the lessons. In late 2012 I started to learn Dutch and did 4 hours of the Michal Thomas course. I picked up a lot but again I had trouble applying it. The way to learn a language is to use it. The most I’ve done with Dutch is order some chicken in a Chinese restaurant in Amsterdam and a couple of beers in a bar in Sluis.

Over the past 2 years I have been exposed to the Cyrillic alphabet, particularly with my travels to Sofia and Moscow. In December I decided to spend some time on Russian. In addition to my usual language barrier of actually learning the thing, I also have the barrier of not being able to read the words in the first place. My strategy is to learn the alphabet first and then try and learn some phrases. Luckily I have found a book called Read and Write Russian Script by Daphne West.

Interestingly Daphne got into Russian because it was taught as an alternative to Physics at her school at O-level. The result of this early decision has led her to a degree in Russian, a PhD on Russian poetry and winning the Pushkin medal for her contributions to the teaching of Russian. The path of life is fragile – make your choices wisely.

Anyway, the Cyrillic alphabet is named after St Cyril who with St Methodius created the Glagolitic alphabet which was a forerunner of the Cyrillic alphabet. It is now the third official script of the European Union – the first two being the Latin alphabet and the Greek alphabet.

Cyrillic takes a lot from Greek in fact. At a first glance, the ignoramus (i.e. me) wonders why someone would write В for a V sound and Р for an R sound. The answer lies in the fact that the Modern Greek letter beta is pronounced v and the Р is similar to the Greek letter row which sounds like r. As someone who had to learn the Greek alphabet to study mathematics where one runs out of letters quickly, I have found the Greek connection a good way to remember how to pronounce Cyrillic letters (concentrating on the Russian pronunciations). I’m still not there yet… Of course, if you are a Latin only person you will have to start from scratch. However remembering some of the explanations below may help you with remembering the differences, particularly of the letters that look familiar but sound different.

Here is a summary of the alphabet and its origins. One can group the letters as follows:

1. Letters similar to Latin ones, probably because the Romans nicked them off the Greeks in the first place.

The Cyrillic letter а, for example, is similar to our a and is pronounced ah or the a in father – much in the same way that a is pronounced in Dutch, German and Czech. In both Latin and Cyrillic alphabets, this letter is derived from the Greek letter alpha α.

The letters are the vowels А(а) and О(о), and the consonants К(к), М(м) and Т(т). These letters are similar to their Latin counterparts, but also to their Greek counterparts Α(α), Ο(ο), Κ(κ), Μ(μ) and Τ(τ).

2. Letters that are similar to Latin ones but sound different. 

Е(е) – pronounced ye. It has a different sound but it derives from the Greek ε like the Latin e.

У(у) – pronounced oo and is related to the Greek Υ(υ) which is more like the Latin u. 

В(в) – pronounced v. It derives from the Greek β which in modern Greek is more of a v sound.

Н(н) – pronounced n as in new. Derived from the Greek Ν(ν). Go back a bit further in time – this letter comes from an equivalent in the Phoenician alphabet which looks similar to an H.

Р(р) – pronounced r as in rat but rolled. Derived from the Greek ρ.

С(с) – pronounced s as in sip. This letter is derived from a version of the Greek Σ which was more C-shaped, called the Lunate Sigma.

Х(х) – pronounced ch as in loch. Derived from the Greek χ called Chi.

3. Letters that sound familiar to Latin users but look different. All of Greek origin again.

И(и) – pronounced ee in feet like a European i which is how it is transliterated. It is derived from the Greek eta Η(η) and in fact was written like this up to the 13th century.

Й(й) – pronounced like the y in toy and usually transliterated as a j. Active use of this letter started between the 15th and 16th centuries with it becoming considered a separate letter from И in the 1930s.

Б(б) – pronounced like the Latin b and it is derived from the ancient Greek β, much like the Latin b.

Г(г) – a soft g and derived from the Greek gamma Γ.

Д(д) – a d sound and derived from the Greek delta Δ

З(з) – derived from the Greek zetta ζ, this is pronounced like the z in zoo.

Л(л) – pronounced l. This is the Greek λ lambda in disguise. Actually I have trouble with this one because I confuse it with pi π because of the curly line.

П(п) – pronounced p as this one is derived from the Greek π.

Ф(ф) – derived from the Greek Phi φ, this is pronounced like the f in fill.

4. Letters that neither sound familiar or look familiar

Ё(ё) – pronounced like the yo in yonder. A variation of е.

Ы(ы) – yes, it is one letter. I itself has been removed from the Russian alphabet but this letter remains. The sound does not exist in the English language but you can get there by trying a shortened i as in ill. It is derived from the combination of the soft sign Ь and the defunct Cyrillic i which was derived from the Greek iota ι.

Э(э) – the backwards e is in fact an e and similar to the Latin e, it is derived from the Greek epsilon ε.

Ю(ю) – pronounced like the u in university. Believed to originate from the Greek combination omicron-iota οι.

Я(я) – derived from an older Cyrillic character called Little Yus, this letter is pronounced ya as in yard.

Ж(ж) – pronounced like the s in treasure. It is not known where this letter derives from.

Ц(ц) – pronounced like the zz in pizza. This letter is thought to have come from a similar Glagolitic letter.

Ч(ч) – pronounced like the ch in choose.

Ш(ш) – pronounced like sh and is thought to derive from a Hebrew letter.

Щ(щ) – pronounced like shsh in EnglishShampoo. Derives from a Glagolitic letter.

5. Letters that have no sound of their own

Ъ – the hard sign which for practical purposes adds a tiny pause between syllables.

Ь – the soft sign which for practical purposes means that a gentle soft y is included after the preceding consonant.

The letters originate in Old Church Slavonic. Here endeth the lesson.

Posted in Languages | 1 Comment

At Christmas

It is very easy to forget the suffering of others in the world. Here are three ways you can help others this Christmas.

1. Children. In May 2014 I will be cycling from London to Brussels via Amsterdam and I will be doing this in aid of Make-A-Wish.

Make-A-Wish Foundation UK aims to grant magical wishes to children and young people fighting life-threatening conditions. Please donate generously if you can. The event is organised by Skyline who enable many people to raise money for charity but also have fun doing it. I have had a rest from cycling since September and I will start training in January for the ride.

2. Poverty. Despite being a first world country, thousands live below the poverty line in the United Kingdom. In 2012-13 food banks fed 346,992 people nationwide, of which 126,889 were children. The Trussell Trust food banks provide a minimum of three days emergency food and support to people experiencing crisis in the UK. Their goal is to have a food bank in every town. You can donate on the web.

3. Worldwide. There are many tragedies happening around the world. This Christmas I have decided to support Save the Children’s Syria campaign. The country is war-torn and the children are suffering. Save the Children have so far helped 600,000 refugee children and family members including 230,000 children and family members inside Syria with food, safe water, medicine, and shelter.

Wishing you all a very merry Christmas and a happy new year.

Posted in Charity | Leave a comment

Tim Noakes on a low carb diet

Prof. Tim Noakes talks about his experience on a low carb, high protein and high fat diet.

 

Posted in Diet | Leave a comment