UKOLN Dev » Uncategorized http://blogs.ukoln.ac.uk/ukolndev Developer Labs Mon, 16 Dec 2013 00:09:02 +0000 en-US hourly 1 http://wordpress.org/?v=3.5.2 The Raspberry Pi http://blogs.ukoln.ac.uk/ukolndev/2012/09/18/the-raspberry-pi/?utm_source=rss&utm_medium=rss&utm_campaign=the-raspberry-pi http://blogs.ukoln.ac.uk/ukolndev/2012/09/18/the-raspberry-pi/#comments Tue, 18 Sep 2012 20:01:08 +0000 ac568 http://blogs.ukoln.ac.uk/ukolndev/?p=1751 Unless you’ve been living under a rock for the last six months or so, you’ll almost certainly have heard of the Raspberry Pi. If not, here’s the low-down. The Raspberry Pi is a single-board computer aimed at the hobbyist and educational markets. It comes in two flavours, the Model A and Model B, which are subtle references to the BBC Micro computers of the 1980s and 90s. Unfortunately, for the foreseeable future only the Model B – the higher specification model – is scheduled for production. Lurking within the guts of this credit-card sized wonder is 256mb of RAM, and a 700MHz ARM chip that is easily capable of being pushed to 800MHz. For audio and video there are RCA video and 3.5mm audio out, as well as an HDMI port. Resolutions covered range from VGA all the way up to 1080p (and beyond!), with almost all PAL and NTSC video standards covered. Connectivity is a doddle, as a 10/100 Ethernet socket is included on the board. WiFi is also possible; although ARM devices are notoriously finicky about which USB adapters they will work with. I/O is covered too – two USB ports are provided, and are extensible with a hub, and GPIO (general-purpose input/output) pins are provided for connections in and out to various devices, more about which will be covered shortly.

Raspberry Pi Board

The Raspberry Pi viewed side-on. Visible here is the the HDMI port (front centre), the SD card slot (left) the GPIO pins (back left), RCA video (yellow jack) USB ports (back right) and Ethernet port (front right).

While unfortunately the hardware of the Raspberry Pi is almost unchangeable (short of the size of the SD card used), this is more than made up by the choice of operating systems. In true hacking fashion, several operating systems have sprung up, each doing different things. Here are a selection:

1) Raspbian “Wheezy”

Raspbian is based on the Debian kernel, and is the recommended start point for beginners to the Raspberry Pi. It boots to a command prompt by default, but pre-installed is LXDE – a lightweight X11 manager. Other tools included include the Midori web browser, and all the development tools you’d expect on a Linux system, including Python and Java compilers. Of course, since it’s a Debian installation, new software is a doddle to install using the package manager. Within minutes I had set up VLC and was playing 1080p video with no problems.

2) Arch Linux ARM

Arch Linux is extremely popular with the modders and tweakers of the Raspberry Pi community. Its no-frills approach centres on “simplicity and full control for the end-user”. By default, no X11 server is included – it is up to the user to decide which (if any) they would like. Obviously, this distribution is not recommended for those with little to no Linux knowledge.

3) RaspBMC

On the other end of the scale, RaspBMC is totally different to either of the distributions mentioned above. When you use this distribution to boot the Raspberry Pi, it becomes a fully-fledged home media centre, with the ability to play films, music and even YouTube videos. RaspBMC is based on the very popular XBMC, a cross-platform media centre that is used by countless people worldwide.

 

RaspBMC screenshot

The default home screen for the really quite good RaspBMC media centre operating system for the Raspberry Pi.

One of the main reasons that the Raspberry Pi came about was to teach children in schools about electronics and programming. As such the GPIO pins can be used to interact with code and give sensor readings to programs. Unfortunately, in Raspbian at least, the Python modules for interacting with the GPIO pins are not included by default. Instructions for installing them are given here.  A popular way to interface the Raspberry Pi is a simple ribbon cable and a prototyping board, which will let you try out many different combinations before settling on something more permanent. One of the peripherals that has generated the most buzz lately is a camera module featured here which would pave the way to features such as image recognition for navigation, or more multimedia capabilities.

As with most things, however, there are a few drawbacks, but what else did you expect from a machine costing £25/$35? The biggest caveat for me was initially the lack of hardware MPEG-2 decoding, which meant my whole library of movies would have to be transcoded to h.264 for smooth playback on the device. However, the Raspberry Pi Foundation has now released licenses for roughly £2.50 for MPEG-2 and £1.50 for VC-1. The other gripe that some may have is the lack of expandable RAM, as it is all contained within the CPU. Such users may find the VIA APC or cubieboard a little more suitable for their use, however, for pure value for money and form factor, the Raspberry Pi is hard to beat.

Edit (1/11/12) – As of October 15th, the Raspberry Pi now ships with 512MB RAM, making it an even more attractive proposition for its price point.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2012/09/18/the-raspberry-pi/feed/ 0
Streaming video with VLC http://blogs.ukoln.ac.uk/ukolndev/2012/07/12/streaming-video-with-vlc/?utm_source=rss&utm_medium=rss&utm_campaign=streaming-video-with-vlc http://blogs.ukoln.ac.uk/ukolndev/2012/07/12/streaming-video-with-vlc/#comments Thu, 12 Jul 2012 16:48:26 +0000 Emma Tonkin http://blogs.ukoln.ac.uk/ukolndev/?p=1722 Occasionally one wants to stream video for various reasons, whether it’s within the institutional network or a live feed from a conference venue. A few years ago Greg Tourte and I wrote a paper about the process of streaming video from a DV camera using FireWire, encoding into Ogg Theora/Vorbis, and transmitting the result to an audience via IceCast. For no adequately explored reason I have found myself playing with VLC’s inbuilt streaming methods for various purposes over the last week or so, and since VLC isn’t especially well documented, I’ve put the results up here.

 

1)  Streaming video to an icecast server.

Once you have the icecast server set up this is actually shockingly easy to do. Set up a mountpoint on the server side, in your icecast.xml setup (/usr/local/etc/icecast.xml by default):

<mount>
<mount-name>/test.ogg</mount-name>
<username>myusername</username>
<password>mypassword</password>
<max-listeners>10</max-listeners>
<burst-size>65536</burst-size>
</mount>

for example.

Now, on the client side (which could be anything from Windows to Linux to MacOS, because VLC is cross-platform, but this example is Windows), try

C:\Users\Em>”c:\Program Files (x86)\VideoLAN\VLC\vlc.exe” “C:\Users\Public\Videos\My Video.wmv” –sout=#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=128,channels=2,samplerate=44100}: std{access=shout,mux=ogg,dst=myusername:mypassword@myicecastserver.domain.com:port/test.ogg}

It should transcode on the fly into Ogg Vorbis/Theora and throw it at your icecast server. Viewers who go to myicecastserver.domain.com:port should be able to view it from there. Note that you can change various settings on the transcode process (for example scale=0.5, vb=400), so you can reduce the network bandwidth required, for example, but that paradoxically reducing some of these settings will actually increase the time taken for the transcoding process, so it can result in the transcode getting laggier than it was already.

Why transcode? Well, icecast only handles a limited format set. It’s really designed for audio data, not audiovisual. It’ll handle pretty well anything in an Ogg wrapper, though, and it is free. So if you want to stream video with Icecast, transcoding will probably be involved somewhere.

2)  Streaming from a DVD (previously recorded event)

One would expect this to be as simple as

“c:\Program Files (x86)\VideoLAN\VLC\vlc.exe” dvdsimple:///E:/#1

but as it happens this seldom works, and the reason is the reaction time. Icecast is contacted with a header as soon as the streaming process begins. If it takes too long to get the DVD spun up and begin the process of streaming, icecast simply times out on you, leaving an error message along the lines of ‘ WARN source/get_next_buffer Disconnecting source due to socket timeout’.

Having tested this on various platforms, I find that the following string: “vlc dvdsimple:///dev/dvd –sout=’#transcode{vcodec=theo,vb=200,scale=0.4,theora-quality=10,fps=12,acodec=vorb,ab=48,channels=2}:std{access=shout,mux=ogg,dst=username:password@myicecastserver.domain.com:port/destination.ogg}’ –sout-transcode-audio-sync –sout-transcode-deinterlace” works very well in some cases. Apparently the DVD drive I first tested this with is just unusually slow. This DVD, being homegrown, doesn’t require libdvdcss to view/transcode.

3) Streaming with ffmpeg2theora

Bit of a Linux solution, this one. Install libvpx, libkate, scons and ffmpeg (all available as Slackbuilds for those who are that way inclined).  Install ffmpeg2theora. Install libshout and oggfwd.

Then: try a command line along the lines of the following:

ffmpeg2theora /source/material/in/ffmpeg/readable/format.ext -F 16 -x 240 -c 1 -A 32 –speedlevel 2 -o /dev/stdout -  | oggfwd myicecastserver.domain.com server_port password /test2.ogg

Obviously the output of this is not exactly high-quality; it’s been resized to a width of 240 pixels, audio has been reduced in quality, framerate’s been reduced to 16. But all these configuration options can be played with. Here’s a useful help page: http://commons.wikimedia.org/wiki/Help:Converting_video/ffmpeg2theora

Having called this a Linux solution, it’s worth pointing out that ffmpeg2theora is available for Windows (http://v2v.cc/~j/ffmpeg2theora/download.html) and that oggfwd/ezstream (http://www.icecast.org/ezstream.php/) have been used successfully on Windows as well. It’s also worth noting that, again, VLC can do the ogg/theora encoding too (and has done since 2006)- it’s just a question of seeing what’s better optimised for your purpose on your platform.

Note also that in this instance no username is needed, and the password used in this case is that set in the ‘<source-password>’ directive in icecast.xml.

4)  Streaming without icecast

Icecast is a useful default solution if you want to broadcast your event/recording to multiple people across the web. It’s also useful because, operating via HTTP, it doesn’t suffer from the sort of firewall/router problems that UDP-based video streaming, for example, typically encounters. On the other hand, if you’re streaming across a local LAN (for example, into the next room), there’s (usually) no network border police to get in your way — and VLC does also offer a direct VLC-to-VLC HTTP-based streaming solution. Unlike Icecast, though, it’s not ideal for one-to-many broadcast.

The Videolan documentation has a graphical explanation of this setup: http://www.videolan.org/doc/streaming-howto/en/ch02.html

 

5) Mixing video for streaming

An obvious application to test in this context is FreeJ. Sadly it’s a bit of a pain to compile as it doesn’t seem to have been touched for a while. You’ll need to use the following approach for configuring the code:

CXXFLAGS=-D__STDC_CONSTANT_MACROS  ./configure –enable-python –enable-perl –enable-java –disable-qt-ui

Typing ‘make’ will result in : error: ‘snprintf’ was not declared in this scope. Add #include <stdio.h> to any files afflicted in this way.

You then come across a crop of errors resulting from changes in recent ffmpeg. Some of these can be resolved with a patch, the rest, you’re better off going to the git repository rather than trying a stable version.

In principle you probably want to enable-qt-gui, but since it doesn’t currently compile I have left it as an exercise for some other day.

And once you have FreeJ working, you need to read the tutorial. Note this advice regarding addition of an audio track to FreeJ output.

 

 

]]>
http://blogs.ukoln.ac.uk/ukolndev/2012/07/12/streaming-video-with-vlc/feed/ 0
Archiving Old Dynamic Websites http://blogs.ukoln.ac.uk/ukolndev/2012/05/29/archiving-old-dynamic-websites/?utm_source=rss&utm_medium=rss&utm_campaign=archiving-old-dynamic-websites http://blogs.ukoln.ac.uk/ukolndev/2012/05/29/archiving-old-dynamic-websites/#comments Tue, 29 May 2012 13:55:42 +0000 md269 http://blogs.ukoln.ac.uk/ukolndev/?p=1701 Archiver is a web based application written in Java using the Spring Framework. Its main use is to produce static versions of websites which are no longer updated with new content. This is important for many reasons; firstly, dynamic sites will typically target specific software dependencies.  As time passes certain dependencies will no longer receive patches, posing a security risk, or updates, meaning it may no longer function with the latest operating systems and code environments. This is almost always a problem for system administrators who sometimes end up maintaining software that can be tens of years old on outdated systems. Archiver offers an easy means of creating a static versions of of these dynamic sites that can deployed simply to a standard web server, typically, but not limited to, Apache.

 

Websites will run using different software; some will be written in plain HTML and CSS whilst others will run on CMS or WIKI platforms such as WordPress, MediaWiki or Drupal. Each of these methods will provide a slightly different way of performing some tasks, writing certain elements in HTML/CSS etc and laying out structure. After analysing the problem it was clear that we would need to target specific software in order to provide a high quality solution. For this reason, the ‘Strategy’ design pattern was chosen.

In this case an interface and super implementation provided a default set of methods for dealing with the processing of individual web elements written to work in the majority of cases. It can be thought of as standard web behavior. Subclasses of this Strategy were provided to account for software differences.

We currently support the following strategies -:

  • Basic (Static websites for migration)
  • Drupal
  • Media Wiki
  • WordPress

One of the main tasks which Archiver performs is to make any links which appear in HTML, CSS or JavaScript files relative to the homepage of the website so they are not absolute links. The JSoup plugin for Java was especially useful in this case as it allows the detection of a specified tag in the HTML file. JSoup also uses a Jquery type syntax to select the different elements from the HTML e.g. “#” is used to select an ID and “.” is used to select a class. JSoup also allows invalid HTML which is useful doesn’t prevent a site from being fully archived if there are mistakes in the markup. For the CSS and JavaScript, Regex was used to create expressions in the specified format for a CSS or JavaScript link, this could then be used to find and change the links. Alongside making links relative, Archiver also adds each link which it finds to the list of files to be added into the archive folder. After archiving recursively a zip file is served up to the user.

While existing solutions are available none of them provide the comprehensive rewriting capabilities of Archiver. All the user has to do is point the webapp at a site, choose a strategy and deploy the resulting zip.

Archiver also produces a README file which provides details of all the files which have been included in the archive and lists any errors such as missing pages.

Code is available from https://bitbucket.org/ukolnisc/archiver/src

While this is working code it has not received sufficient testing which is obviously vital for this type of project. With that in mind we would love to hear your feedback.

 

]]>
http://blogs.ukoln.ac.uk/ukolndev/2012/05/29/archiving-old-dynamic-websites/feed/ 0
Two cities, two hack days http://blogs.ukoln.ac.uk/ukolndev/2012/05/23/two-cities-two-hack-days/?utm_source=rss&utm_medium=rss&utm_campaign=two-cities-two-hack-days http://blogs.ukoln.ac.uk/ukolndev/2012/05/23/two-cities-two-hack-days/#comments Wed, 23 May 2012 14:48:28 +0000 Julian Cheal http://blogs.ukoln.ac.uk/ukolndev/?p=1662 During March and May, I attended two very different hack days. The first was part of Bath’s first ever digital festival, aptly called, Bath Digital Festival. The hack day was organised by local web development consultancy Storm.

Unlike previous Storm hack days that have had a theme, this one was open ended for the developers to develop anything they wished. They have had good success in their previous hack days resulting in some of the hacks being turned into finished products and released on Apple’s App Store, such as Spyhunt and Shaken created by local software development company Riot.

At the hack day I teamed up with fellow Ruby developer and hardware hacker Paul Leader (who just happens to work at Storm). We had borrowed a receipt printer from Mike Ellis (organiser of Bath Digital Festival) with the intention of plumbing it up to the internet in order to print out tweets from the conference as a physical takeaway memento for festival goers.

Arduino Printer wiring diagram

Working from a highly complicated wiring diagram, we attempted to connect the printer to the internet. Unfortunately for us after many hours in the morning trying to get this to work, we eventually gave up and had lunch. One of my fellow attendees sums this up quite nicely on her blog.

Conclusion

“I also spent a large part of the day sat next to Paul and Julian who were attempting to turn an old receipt printer into a tweet printer – sadly, they couldn’t get it to work, which was a shame – but it was interesting to see the processes and patience they both possessed to get to the desired result (or at least close to it).”

As is the way with most events the wifi during the morning wasn’t quite up to par, so the other 60+ developers in the room found it hard to implement the ideas they wanted to build. After a lunch the wifi was going strong and people started hacking again, I mainly spent the afternoon, finding out what others were working on, and also worked on a twitter text analysis tool with another at attendee.

I think the day went really well, I spoke to some interesting people and thought the event was well organised.

MRD Hack day

The Managing Research Data hack day in Manchester was part of the JISC call by the same name being run by Simon Hodson. Although technically I am not part of any of the projects in the MRD call, I was still asked to attend. The hack day was actually a hack two days, with the room we were in open until the last person left.

After a morning of talks about various projects on the MRD call and various other data related presentations, it was time to start/join a team and brainstorm some ideas. I joined forces with Nick Jackson and Harry Newton of Lincoln University and Nick Syrotiuk of Mimas. The idea of our project came from Joss Winn which he had got from an academic at Lincoln. The basic idea was to create a system whereby an academic could see the outputs of all the research projects not just in their department, but across theirs and every other university.

To get started we first chose a project name from a random name generator, and then I created a GitHub project for it. The project would now and forever be know as Project Rainbow Beam. Built onto of MongoDB I created a simple Sinatra web app to accept a JSON payload which would then be added to the Mongo database. We soon realised that the incoming JSON data need to by sanitised, I volunteered. As I was now chief of sanitisation, Nick J, rewrote the front end using a PHP framework called Codeigniter. To keep enable optimum developer communication we created a chatroom on Campfire, as we were using Campfire, it seemed a good idea to hook GitHub to the chat room, so that every time we pushed code, Campfire would play a Vuvuzela on all of our computers.

Skip to many hours later, Nick J and I were the last to go to bed having been up many hours hacking away at the project.

By mid to late morning day two, we had a fully Bootstrapped website, documentation, api endpoint, data sanitizer, and live feed which was updated via Pusher.

At the hack event, it was decided to vote on all the hack projects that had been going on to see which one would win a further two days development work. With the developers being whisked away to a hotel and given two days to make their project better. Unfortunately we didn’t win this, although our project was well received. The prize of getting two more days to work on their project went to the BitTorrent group whose idea was to use BitTorrent and SWORD to move large research data sets around.

Conclusion

These two events were very different, and were targeting very different audiences. However the common thread they shared was they were meant for developers. They both did well in catering for developer needs, coffee, wifi, and electricity. It was great to be part of these two events, I learned a lot and met lots of great people. I look forward to the next hack day to find a new challenge to work on.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2012/05/23/two-cities-two-hack-days/feed/ 0
Ebook reader basics: file transfer via USB http://blogs.ukoln.ac.uk/ukolndev/2011/12/03/the-basics-does-it-work-when-you-plug-it-in/?utm_source=rss&utm_medium=rss&utm_campaign=the-basics-does-it-work-when-you-plug-it-in http://blogs.ukoln.ac.uk/ukolndev/2011/12/03/the-basics-does-it-work-when-you-plug-it-in/#comments Sat, 03 Dec 2011 20:18:29 +0000 Emma Tonkin http://blogs.ukoln.ac.uk/ukolndev/?p=1214 We covered some of the basics of these devices in an earlier series of posts, but it might be worth taking a few minutes to focus on the most basic behaviour of the lot: getting data onto the devices from a laptop. One might expect that all of these devices would operate as USB mass storage devices (plug it in and copy files on). As anybody who’s ever tried to copy data off an iPod knows, nothing could be further from the truth.

Assumptions used here: the task is to copy non-DRM’d ebook files onto an ebook reader.

Sony PRS-600, Hanvon n510, etc.

Like most of your basic e-Ink devices the Sony and its type are ridiculously straightforward to use, if a little slow, as long as you are familiar with copying files using a file manager. These devices function as USB mass storage devices. Plug it in, copy files, unplug it and (in the case of the Sony) wait for it to reindex pretty much the entire filesystem, including files that have been on the ebook reader for months. Don’t keep too many files on the Sony, or you’ll run out of battery life before you ever read a page – the indexing is the most power-hungry step it takes. The Hanvon doesn’t bother with exhaustive indexing, which saves time and battery life here but means that it doesn’t offer the same search functionality.

Filesystem speed stats were generated using:

rsync -auvh --progress --stats --no-o --no-g --no-p /some/files .

We ran this on Linux in each case, in order to ensure that there weren’t any confounding factors such as Spotlight indexing.

Results:  Hanvon N510: 2.34M bytes/sec

Kindle

The Mac recognises the Kindle as a USB drive, and allows you to copy items directly onto it (.pdf or .mobi – convert using Calibre if required). It’s not all plain sailing, though; the Kindle tends to place items imported in this way into a menu section entitled ‘items not yet indexed’. When this happens, it seems that you may need to reset the Kindle (hold the sleep button for 20 seconds), at which point it will reindex on startup.

File transfer rates: 1.87M bytes/sec
We found the Kindle’s file transfer rates to be unusually slow.

Xoom

The Xoom is a somewhat frustrating device. It’s using a driver called MPT (Motorola Phone Tools). Seems this is standard to Android devices, instead of SCSI-like hard drive/mass storage, so we’ll all have to get used to it… Google’s explanation for this decision may be found on this blog post: in short, MPT is seen as an improvement on USB mass storage because

‘for devices with lots of internal memory, a manufacturer no longer needs to come up with some hard partition between the USB mass storage and internal storage. Instead, they are all in one partition, with MTP providing access to the directory of media files that would normally be available through USB mass storage. This means there is no longer a need for apps on SD card for such devices, because what used to be the ‘internal SD card’ is in the same partition as where applications are stored. The storage on your device can be used for either applications or media, depending on what you want to put on it. You aren’t stuck with how much space the manufacturer decided to leave for the two areas. Also, this means that the media storage doesn’t need to be unmounted from Android when it is being access[ed] through the PC.’

On Windows, once the appropriate drivers are installed, it can be treated like a standard storage device – you can simply drag and drop files. On the Mac you’ll need to download the Android File Transfer software, which will allow you to drag and drop files in either direction, plus or minus the occasional bug.  On Linux, you can mount it through MPT using mptfs, a fusion driver for MPT drives. GNOME users will probably find that this happens automatically. The rest of us just do mptfs -o allow_other mountpoint. Android File Transfer on a Mac feels rather slow, but our test on Linux (see data below) suggests that mptfs is not unreasonably slow.

File transfer rates:
mptfs on Linux (calculated as above): 4.59M bytes/sec
Compare this to a similar test of an HP USB2 16GB USB drive: 7.66M bytes/sec

iPad

The iPad was clear winner of the ‘least cooperative’ award in this category. iDevices don’t show up in the filesystem by default. The traditional mechanism used to get files onto the device involves iTunes. This music software has been adapted after the fact for use as an ebook organiser, and its origins are still clearly visible. The results are indifferent: the right-click context menu in the ‘Books’ pane, for example, invites you to ‘download album artwork’. Using this approach, getting files onto your iPad is a multi-step process; download files, import them into iTunes, sync with iPad.

Right-click context menu for ebooks (iTunes screenshot)

Right-click context menu for ebooks (iTunes)

iTunes is the Vegemite of the tablet user; you either love it or hate it. Unless iTunes is a big part of your ebook-reading life already, it becomes an irritant, dragging out the file copy process unnecessarily. The OPDS approach is simpler, if all you want to do is get your files onto the iPad: just download them directly onto the iPad itself.

File transfer rates:
cannot be compared directly.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2011/12/03/the-basics-does-it-work-when-you-plug-it-in/feed/ 0
AI-Class with tablet devices http://blogs.ukoln.ac.uk/ukolndev/2011/11/12/ai-class-with-tablet-devices/?utm_source=rss&utm_medium=rss&utm_campaign=ai-class-with-tablet-devices http://blogs.ukoln.ac.uk/ukolndev/2011/11/12/ai-class-with-tablet-devices/#comments Sat, 12 Nov 2011 01:08:58 +0000 Emma Tonkin http://blogs.ukoln.ac.uk/ukolndev/?p=1139 Quote from Sebastian Thrun

@SebastianThrun: Who's up for a $2000 Stanford degree?

You might have seen the intense publicity received by Stanford’s current experiment: Ai-Class, not to mention the sibling efforts ML-Class and DB-Class. These were described to the public as beta-releases of a new kind of education, and have been made available for free, possibly a once-in-a-lifetime offer, possibly never to be repeated. Class began in mid-October, and it’s not clear whether these will run again in their current form.

I joined two classes; AI-Class (artificial intelligence, taught by Sebastian Thrun and Peter Norvig) and ML-Class (machine learning, taught by Andrew Ng). Given that the midterm exam happens next week, I won’t be sharing my grades, but I would like to write a little about accessing these courses on various platforms.

First, a confession: despite the fact that the AI-class draws extensively on material from Russell & Norvig’s ‘Artificial Intelligence: a modern approach’, and the fact that I would’ve liked to use this to check out some ebook reader platforms, I haven’t been able to do so. There are various reasons for that, but the most compelling is :

Content Unavailable in the United Kingdom

Oh well.

There were other problems, anyway; the price of Norvig’s other books suggest that I would not have been happy to pay the price for a Kindle copy. Keep in mind that the office wouldn’t be paying; this is something I’m doing in what I laughably refer to as ‘spare time’. Norvig’s cheapest available Kindle download, Case Studies in Common Lisp, costs £41.89. If AI:AMA cost anything like that, I’d have ended up checking out the second-hand market anyway – you can pick up a second-hand copy for between a fiver and a tenner. Even if I’d bought a paper copy new it may have been cheaper; e-books attract VAT.
This got the Kindle out of the running very quickly. The primary use it can be put to during the course is revision of notes from the ML-class, which conveniently includes revision slides/PDFs.

That left the Apple iPad and Motorola Xoom, which could not only view the PDFs, but also access the videos offered by each site. In the case of ML-Class, a download link was even provided for each video – perfect, I thought, I’ll download them and watch the videos in transit. One difficulty: the iPad seems to disapprove of the concept of downloading files. Safari will consent to send pdfs to iBooks, but as for storing videos for later review, the obvious solutions involve a laptop and iTunes. If you are not always online, the need for advance planning – the faff factor, if you like – increases rapidly. The determined can mitigate the problem via applications for the iPad such as the MyMedia download manager, but the app-centric viewpoint is frustrating. Stanford could solve this through iTunes U – but how many channels must a provider support?

The Xoom did not go to the same finishing school as the iPad, if it went to one at all. Unaware that saving files from the browser and displaying them in anything available is an uncouth habit, it simply does it. It also seems to have passed through its formative years without learning that arbitrary soft-resetting is rude, so it occasionally does that as well.

ML-Class makes extensive use of Octave, a free and fairly Matlab-compatible language and interpreter, giving weekly assignments. The idea of Octave on a mobile device is not as far-fetched as it sounds – Nokia N800/810 owners were able to use both Octave and Gnuplot. Similar software packages, such as Addi and Mathmatiz, are available for Android. In general these are works in progress. iPad owners with a desktop copy of Matlab can try connecting to it remotely via Matlab Mobile, a function that is available through unofficial apps on Android. The interface is not, however, optimised for the iPad, and as with the problem of watching videos in transit, those with limited network connectivity will find this an imperfect solution. Why no Octave clone on iOs? The App Store, the GPL, and extensible interpreters apparently don’t mix, although since Apple changed the language in their SDK, some of the issues mentioned have been resolved.

To conclude: the iPad is polished, but I found myself reaching for the (heavier, clunkier) Android device instead. The Xoom is indeed something of a brick, but the iPad seems to be designed for a world with uniformly excellent 3G coverage, in which nobody ever spends much time offline.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2011/11/12/ai-class-with-tablet-devices/feed/ 0
Social media sites in China http://blogs.ukoln.ac.uk/ukolndev/2011/10/28/social-media-sites-in-china/?utm_source=rss&utm_medium=rss&utm_campaign=social-media-sites-in-china http://blogs.ukoln.ac.uk/ukolndev/2011/10/28/social-media-sites-in-china/#comments Fri, 28 Oct 2011 17:07:46 +0000 Xuan Luo http://blogs.ukoln.ac.uk/ukolndev/?p=1062 Introduction

When we talk about social media sites, we tend to focus on a number of well-known examples – Facebook, YouTube, and so forth. Yet there are many international social media sites of all kinds. This post is written by Jenny Luo, who is studying Electrical Power Engineering at Bath and works part-time at UKOLN. In it, she looks at some examples of social media sites in China, compares them to other popular sites, and collects together information about the sites’ APIs.

– Emma

 

Social network sites (similar to Facebook)

1. renren

Renren means “people and people”. Renren is very similar to Facebook, not only in terms of function but also in terms of interface. You need to register on this website first ,then you can add somebody else as your  friends. You can upload some photos, write diaries, share videos, add some comments or delete some comments.There are also some online games. Anyway, it’s almost the same as Facebook. But, in my opinion British tend to share more pictures than the Chinese do.

Link: www.renren.com
API: http://www.programmableweb.com/api/renren
Description: This is an open platform based on OpenSocial

2. douban

Douban means “watercress”. On this website you will feel free to comment on any  books, films, and music. You can find others’ recommendations about books, films and music. Everything shown on your douban webpage can be chosen by yourself. For example, if you are a mother the website will recommend you some recipes. Unlike Renren, which is mainly used by college students, this website focuses on all kinds of people, they will help you find friends from what you like, then you can find more things you like from them. It has more than 5,000,0000 users now.

Link: www.douban.com
API: http://www.douban.com/service/apidoc/reference/
Description: The weblink given above is the instruction of API utilisation. The Douban API follows the Atom and GData principles. When addition or deletion operations are used, OAuth certification would be required. Then, there are also lots of instructions about how to use the API to acquire different information.

3. kaixin001

The website’s name means ‘having fun’. It was set up in 2008. Till now, it has about 110 million registered users. This website mainly focuses on the urban white collar. This website has 3 main functions, such as ‘basic tools’, ‘social games’, and ‘other applications’. For example, in ‘other applications’ you can get a weather forecast, a service for buying tickets online, and many other practical applications.

Link: http://www.kaixin001.com/
API: http://wenku.baidu.com/view/671f256e1eb91a37f1115c5a.html
Description: The link given above is the instruction of  kaixinoo1 API. This API support java, PHP, NET and a variety of kinds of programming language. Kaixin API uses a REST connection. All the Kaixin open platforms are achieved by using HTTP POST to send requests to http://rest.kaixinoo1.com/api/rest.php The following instructions are about Users API, Friends API, actions API and so on.

Blogging (similar to Blogger)

1. Sina Webblog

‘Sina’ is not a a Chinese word, I asked baidu about why it got this name, and it says that it means China in Latin. Sina Webblog is the most popular and also mainstream blogging service in China. It includes amusement celebrities’ blogs, intellectual celebrities’ blogs, sensibility blogs, and common people blogs.

Link: http://blog.sina.com.cn/
API: http://blog.csdn.net/用户名/services/metablogapi.aspx
Description: The link above is found in a message board. It seems that till now sina blog haven’t provided public access to their API. The Chinese character in the link above means user name.

2. SoHu Webblog

‘So’ means ‘ searching’  ‘Hu’ means ‘ ‘fox’. So the name means ‘search a fox’. It’s similar to the sina’s but not as popular as the one above.

Link: http://blog.sohu.com/
API: http://ow.blog.sohu.com/guide#11
Description: Sohu open widget(SOW) is proposed by sohu company, which is based on the UWA (Universal Widget API) principle, applied on many platform’s Widget standards. A brief introduction about SOW follows. Firstly, it’s based on a standard Widget principle — the UWA principle. Secondly, everyone can use this to develop their own Widget, and share it to multiple net friends, adding to their sohu blog for utilisation. Then there are loads of information about how to apply.

Microblogging services (similar to Twitter)

1. Sina Microblogging

Sina Microblogging is very similar to twitter.You can also call it ‘one sentence’ blogging. Users can send messages from mobile phones’ SMS messaging functions, WAP, Internet, or MMS.You can send what you hear, see, and think immediately. Your friends can also see what you sent immediately and add some comments. It has the most users of all Chinese microblogging services, and public celebrity is its character.Sina microblogging invite stars and celebrities to be users and will authenticate them. After authentication,a ‘character “V”‘ will be added after their names to distinguish them from common users.

Link: http://weibo.com/
API: http://open.weibo.com/wiki/API%E6%96%87%E6%A1%A3_V2#.E5.BE.AE.E5.8D.9A
Description: The link above is a introduction to the sina microblog API. This documentation contains detailed information about the reading and writing of Microblog, users, comments, relationships, accounts, topics, searching, registration, and so on. Some of them are signed by a red Chinese character, which means this is high class permission, and can only be used by making an application.

2. SoHu microblogging.

It’s very similar to the one above, but not as popular as the above.

Link: http://t.sohu.com/
API: http://open.t.sohu.com/en/%E9%A6%96%E9%A1%B5
Description: This link above is instructions for how to use the sohu API. They give some English labels.

Instant Messaging (similar to MSN)

1. QQ

This name means cute because its symbol is a little penguin.This software support online chatting, video chatting, sending documents, sharing documents, qq email, Netdisk. You can also join some groups which are built by the qq users. For instance,if you like yoga, you can join a yoga group, and you can chat with the people in this group. It’s the most widely used chatting software in China.

Link: www.qq.com
API: http://wiki.opensns.qq.com/wiki/%E3%80%90QQ%E7%99%BB%E5%BD%95%E3%80%91Qzone_OAuth2.0%E7%AE%80%E4%BB%8B
Description: The link above has these contents. 1, a brief introduction to qq zone OAuth 2.0. 2,The procedures involved in using qq zone OAuth2.0. Step1: How to acquire access-token, qqzone. OAuth 2.0 provide different log-in checking and authorization procedures for website, mobile application and desktop. Now they provide 2 ways to acquire an access token. 1.server-side mode. 2. client side-mode. The two modes  only have differences in acquiring an access-token, but work similarly in the following steps of acquiring an  openid and invoking the API. Step 2: Using access-token to get the corresponding openid. Step 3 : using openAPI to get resources. You can also get specific information about API  from the following link given http://wiki.opensns.qq.com/wiki/%E3%80%90QQ%E7%99%BB%E5%BD%95%E3%80%91API%E6%96%87%E6%A1%A3

2. MSN

No more introduction, but not as popular as qq in China

Link:http://cn.msn.com/
API: http://dev.live.com/messenger/

Video Sharing (for example, YouTube)

1. YOUKU

This name means ‘you are so cool’. A very popular video sharing website in China, founded in 2006. In 2007, it launched an activity called ‘LOMO is everywhere’, and turned out to be very successful. It’s also a website which gathers lots and lots of people who like to share their videos.

Link: www.youku.com
API: http://dev.youku.com/
Description: The weblink describes the basic functions of youku’s open API. They are: uploading videos, getting users’ related data, broadcasting which includes designing your own player’s appearance. Their characteristics are XML or JSON format data, and using Javascript client-side to directly insert youku videos without having to add anything on the server-side. Youku API is only open to partners, so a partner ID must be applied for first.

2. Tudou

Its name means ‘potato’. You can upload, download, and share videos through this website.

Link: www.tudou.com
API: http://api.tudou.com/wiki/index.php/%E9%A6%96%E9%A1%B5
Description: The link given is a tudou open platform document. Every developer can use a tudou account to login to the open platform and apply for a APP. Every APP has a limited amount of interface requirements. The interface includes functions that require user authorization, and others for which user authorization is not needed.

Photo sites (similar to Flicker)

1. babidou

‘Babidou’ I don’t know its meaning actually. But I think this name sounds good in Chinese and may mean ’some interesting beans’.  Babidou internet photo album Internet Save centre was founded in 2005. Babidou specially serves Internet business. Almost all its photos are from taobao, yiqu, paipai, some large Internet shopping Websites. It has a strong documents management system, and a humanistic operator interface. Very easy and convenient to use and totally free.

Link: www.babidou.com
API: N/A.
Description: N/A.

2. bababian

‘bababian’ means ‘change’. This website imitates flicker.It has two subsites, one is for Internet shops, the other is for individual photo albums.

Link: www.bababian.com
API: http://www.bababian.com/api/api.htm
Description: This is the open platform link of bababian, but a bababian account is needed to see more detailed information.

Social bookmarking services (for example Addthis, or Delicious)

1. jia This
‘jia’ means add in Chinese. Its function is as same as its name. It provides these functions: website link collection, website sharing, and website link sending as well. Users can share everything they want to share to many popular social website by using this tool.
Link: www.jiathis.com
API: http://www.jiathis.com/help/html/share-with-jiathis-api
Description:The link gives a standard jiathis API interface, which make the implementation easier.This link, http://www.jiathis.com/send/?webid=shareID&url=$siteUrl&title=$siteTitle&uid=$uid is the standard form, share ID can be gleaned by a ID list. $siteUrl means the weblink that you want to share, $siteTitle means the shared website title which can also be defined by yourself. $uid(非必须) is used for data statistics. Four examples are also given.

2. bshare.cn

bshare is also a social sharing web2.0 button tool.

Link: www.bshare.cn/index
API: http://www.bshare.cn/api
Description: The link above gives detailed information about the API. It’s an open platform.

3. Baidu share

This is almost as same as the tools above.

link: http://share.baidu.com/
API: http://open.baidu.com/
Description: The link given above is the website of baidu open platform where you can find the APIs of different baidu applications, such as baidu share, baidu map, baidu encyclopedia.http://share.baidu.com/get-codes. This link is the specific code of baidu share, and also the instructions for use. You can copy and paste the code given and put it in any position within the webpage between <body> and </body>.

Online Trade (for example, ebay)

1. taobao

‘Taobao’ means ‘finding treasure’ in Chinese. Taobao is the biggest online retailer in Asia Pacific.It was funded by alibaba enterprise in 2003.Its business include c2c( person to person) and B2C( Business to person). By 2008, its registed member is more than 98million and represented about 80% of China on line trade, and its turnover reached 41.3billion yuan.

Link: www.taobao.com
API: http://open.taobao.com/doc/api_list.htm?id=102
Description:The link given above is an API list of taobao.It has API of users , products, businesses and so on.You can click on what  you need to get more detailed information.

Deal of the day (for example: Groupon)

1. meituan

Meituan means ‘Shopping happily in group’. This group shopping website is funded by the same company that funded Renren. Meituan reccomends you a qualified life service everyday. Its recommendation must be of excellent quality and reasonable value.

Link: www.meituan.com
API:http://www.meituan.com/help/api
Description:The weblink given is meituan API. You can get cities API,and also the daily deals API.

A general overview of lots of Chinese social media sites, including many not covered here, can be found at: http://www.bshare.cn/share. English speakers might prefer to read it through Google Translate (Click here for a translation).

CC image by Dainis Matisons

]]>
http://blogs.ukoln.ac.uk/ukolndev/2011/10/28/social-media-sites-in-china/feed/ 0
Project Sunflower: Devices for Research http://blogs.ukoln.ac.uk/ukolndev/2011/06/29/ereaders-to-be-used-for-research/?utm_source=rss&utm_medium=rss&utm_campaign=ereaders-to-be-used-for-research http://blogs.ukoln.ac.uk/ukolndev/2011/06/29/ereaders-to-be-used-for-research/#comments Wed, 29 Jun 2011 12:55:18 +0000 Harsh Khatri http://blogs.ukoln.ac.uk/ukolndev/?p=295 There are a large number of eReaders currently available in the market. We have chosen three devices, one with an E Ink display and the other two with LED displays, each running on a different operating system. Amazon Kindle DX, Apple iPad 2 and Motorola Xoom are three devices we will be using. The Kindle DX runs on Linux, iPad on iOS and the Motorola Xoom on Android 3.0.

 

Amazon Kindle being a dedicated eBook reader has capability to read eBooks by default, without requiring the installation of an eBook application. iPad and Xoom being tablet PCs primarily, require an additional application to be installed that allows the device to render eBooks. We will be considering the native applications that are developed specifically for the device.

Apple iPad

iBooks is the default application for reading eBooks on the iPad. It is free to download from the Apple App Store, and allows in-app purchases. The iBookstore has over 200,000 eBooks available for purchase, with some free ones. There are other eBook apps too, such as the Kindle app and many more.

Motorola Xoom

Google Books is the default application for reading eBooks on Android devices. However, due to publisher restrictions, Google Books is not available to users in UK (yet). The Kindle app for Android works just fine, though you need to have an Amazon account. The other eBook apps rated highly in the Android Market (Android’s App Store) are mostly paid.

Amazon Kindle DX

The Kindle is a dedicated eBook reader. Books are directly displayed on the homescreen, where you can start reading immediately. You can purchase books from the Kindle Store. Most of the books also have a free sample that Amazon wirelessly transfers to the device, allowing you to read the beginning of the book and then decide whether to buy it or not.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2011/06/29/ereaders-to-be-used-for-research/feed/ 0
DIY touch-sensitive surfaces http://blogs.ukoln.ac.uk/ukolndev/2011/06/04/diy-touch-sensitive-surfaces/?utm_source=rss&utm_medium=rss&utm_campaign=diy-touch-sensitive-surfaces http://blogs.ukoln.ac.uk/ukolndev/2011/06/04/diy-touch-sensitive-surfaces/#comments Sat, 04 Jun 2011 00:52:26 +0000 Emma Tonkin http://blogs.ukoln.ac.uk/ukolndev/?p=208 The £4 touch-sensitive surface (Arduino and resistors not included).

Prerequisites:

2 piezoelectric vibration sensors
2 x 1 megaohm resistors
1 Arduino

Result:

Click here to view the embedded video.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2011/06/04/diy-touch-sensitive-surfaces/feed/ 0
Cuboid Tetris http://blogs.ukoln.ac.uk/ukolndev/2011/06/03/cuboid-tetris/?utm_source=rss&utm_medium=rss&utm_campaign=cuboid-tetris http://blogs.ukoln.ac.uk/ukolndev/2011/06/03/cuboid-tetris/#comments Fri, 03 Jun 2011 18:56:30 +0000 Emma Tonkin http://blogs.ukoln.ac.uk/ukolndev/?p=213 More about this later, but for now, tactile tetris prototype #1.

Click here to view the embedded video.

]]>
http://blogs.ukoln.ac.uk/ukolndev/2011/06/03/cuboid-tetris/feed/ 0