Thursday, 28 June 2012

Recording Internet Radio & Chinese Learning

This post is intended to show how to use VLC to make MP3 recordings of streaming internet radio stations.  The hardest part is locating and copying the streaming address for your station, once you have this it's very simple from there.  VLC is a free and fully featured video and audio playing tool.  It also has a wide range of related functionality, like playing and recording internet streams.

I record the local Mandarin language radio station AM936 so that I can:
  • Have access to pre-recorded Mandarin language listening material wherever I am.
  • Listen to a particular part of the broadcast as often as I need to better understand it.
  • Save money due to the cost of streaming in New Zealand.
The first step is to open VLC and select the Open Network Stream option in the Media menu (or just hit Ctrl-N, as shown).


Then select the Network panel, paste in the streaming address and click on Stream.


At this point you should hear the streaming radio.  To start recording, click on the record button (the red dot).


VLC will then record the stream with a useful file name within a standard folder.  In my case, and most likely any case, it was in the Music folder under the Libraries folder on the Desktop.


That's pretty simple.

You can make it more complicated by choosing the Convert / Save option shown in the menu in the first screenshot.  But that gets overly messy and buggy.  When I tried it, it refused to encode the stream as an MP4 file, giving an unhelpfully vague message.

Wednesday, 27 June 2012

Google Translate & Chinese Learning

One of the complaints I had about (perhaps misuing) Google Translate as a language learning tool was that when I looked up words, it just generically listed the meanings.  Did it mean future as a noun or adjective?  I've just noticed that it has been upgraded at some point, and now gives this information.

In this case, I was listening to a recording of a local Mandarin AM radio station.  The speaker kept repeating weilai.  Looking it up in Pablo gave me the match "wèilái"  (未来), but the definitions it gave are the same non-grammatically specific ones that you get in all the free dictionary based products (and up to this point, also Google Translate).


For the same of future reference, here's the current Google Translate output with separated nouns and adjectives:


On a related note, two of the cheap MP3 playing devices that I have accrued over the years also receive and play FM radio.  I'd love to find one that also receives and plays AM radio.

TiddlyWiki Recovery

TiddlyWiki is a extremely handy way to store notes locally.  As a one file wiki, with no install process -- you just run it -- it is as low overhead as you get.  Gone are the days when I run a local web server, so that I can run Trac, MoinMoin or whatever.  But like all software projects, it has it's downsides.

One downside is that occasionally the manual saving simply fails.  You get a dialog box with some unhelpful text simply stating "It is not possible to save changes.."  If you search for this text, all results suggest that you have removed the drive which you are saving to.  But this is not necessarily the case, I save to my internal laptop hard drive and this occasionally happens to me regardless.

What to do?

If you search further, there are references with links to a recovery process.  You'll notice that text is in the Wayback Machine.  It's links are dead.  But if you search for "FAQ_RescueStoreArea" there is perhaps one existing TiddyWiki instance which still contains the content you need.  It contains the following link:
Link to copy.
  1. Right click on the above link and copy it.  In Chrome this is the "Copy link address" menu item.
  2. Switch to the browser tab where your unsaveable TiddlyWiki is located.
  3. Paste the copied link into the address bar.
  4. Hit enter! Observe the new window with your raw wiki contents.
  5. Edit a local copy of your wiki ".html" file.
  6. Paste the raw wiki contents within the div HTML tag with the "storeArea" id.  You can get further detail on this from the "one existing" link above.
  7. Save your modified HTML file.
  8. Open it and verify that it contains your most recent changes.
  9. Close the old unsaveable TiddlyWiki instance tab and pretend this horrible affair never occurred, that the TiddlyWiki powers that be document a clear recovery process and forget about your wasted time.
To be clear about where to insert the recovered raw wiki contents, here is the quoted text from the "one existing" link:
<!--POST-SHADOWAREA-->
<div id="storeArea">
.... *** replace this part *** ...
</div>
<!--POST-STOREAREA-->
In theory, I would hope you could copy the tiddler into your own wiki so it is available for future use.  But it appears to be plugin-based, so this will not work and the raw pre-generated javascript link needs to be used instead.


Good luck!

Tuesday, 26 June 2012

Stackless Python and Stack Overflow

I often search for programming related information, and gladly use the Stack Overflow based results.  More often than not, the answer I am looking for is already there.  This unfortunately means that people blindly post their questions there, without it occurring to them that there might be a better place where actual experts are present.  This better place is the Stackless Python mailing list.

For projects where the number of knowledgeable users present on Stack Overflow is high enough, it obviously serves as an invaluable resource.  For a lesser used niche project like Stackless Python, not so much.

Monday, 25 June 2012

Shanghai water delivery

I found this in my drafts folder.  Have I already posted a version?  Beats me, but between my cold and my desire to go to bed.. I'm going to assume I haven't and just post it.

---

If you're drinking water in Shanghai, you have several options. You can boil the tap water to kill the germs and drink that, but then you still have the heavy metals. You can buy bottles from the supermarket, but then you're killing the environment with all that discarded plastic and it gets old carrying the bottles home. And you can also obtain or buy a water dispenser and have 5 gallon bottles delivered to your home.

I'm at the point where I am buying a water dispenser. The word on Shanghai Expat was that you can get one for around 100 RMB at a store like Gome. So I located my nearest Gome store on Changshou road and went there.

2011-04-04 - Water delivery - Gome - 01 - Storefront

The process of buying something at a store like these, let alone a water dispenser, is long and complicated. You start off buy going to find the good you want on the shelf, then you negotiate in limited Mandarin with all the old ladies standing around. Then one of them goes off and fills in a form, and gives it to you. Then you head up stairs to the payment counter, and pay the girls there. Then they give you two slips, one of which (the white one) is to give to the collections counter and the other (the pink one) is your fa piao / receipt.

So you head over to the collections counter, where someone takes the white slip and goes to fetch whatever you bought.

2011-04-04 - Water delivery - Gome - 02 - Pickup counter

Then you grab it and leave.

2011-04-04 - Water delivery - Gome - 03 - Takeaway

The next step is to get the water bottles to accompany it. On Shanghai Expat people seem to talk about preferring three brands mostly. Nongfu Springs, Watsons and Nestle. Nongfu Springs is a local cheaper brand, but no-one seems to talk about getting it delivered. I normally drink Nestle, so I decided to stick with it and order that. After a bit of Googling, I managed to find a Chinese language Nestle web page. Life must have been so much harder for people living in China before tools like Google Translate were around.


There are three types of water offered. Distilled at 28 RMB, mineral water for 19 RMB and purified water at 17 RMB. It is kind of confusing which to choose, but Shanghai Expat comes to the rescue again. People advise against the distilled water because it lacks the minerals and salts of normal water, which causes problems in the long run. The word is to buy mineral water.

So I called the listed number, pressed 2 for English. Then gave my address, named how many bottles I wanted, agreed to pay a 40 RMB deposit for each, chose which type of water I wanted and they will be delivered tomorrow between 12 PM and 5 PM. It is not exactly ideal to have to stick around home for five hours!

I've since left Shanghai, and didn't bother getting the ~40 RMB refund per bottle.  The Nestle delivery service was consistently helpful, and went out of their way to get me the water.  If they came at the wrong time, or when I popped out, they'd ring and sort out a new time.  I'd recommend anyone living in Shangai use them.  Many of the locals simply boiled the water, maybe that's good enough for you.. but maybe you should think twice.