Archive | Tech Reviews

# 5 cool reasons to use LaTeX

One of the differences between undergraduate level study and masters level study is the amount of report writing you do. I can only think of two times in my bachelors degree that I wrote a significantly sized report — and one of those was my dissertation. So far in my MSc I am yet to have handed in a coursework without a report.

During he early stages of my third year I discovered a tool (language?) called $\LaTeX$, however it would be yet another thing to learn alongside my 4 large modules and everything I needed to learn to do my dissertation, so I gave it a miss. This year I decided I would finally give it a go, see what all the fuss was about and see whether it could really replace a Microsoft Word shaped hole in my life.

It did. LaTeX offers a lot of advantages over Microsoft Word, LibreOffice and many other Word Processors, some of the more interesting ones I’ll talk about here. (Note: this isn’t a tutorial, just some observations — so if you don’t know anything about LaTeX I recommend you look it up online first)

## 1 – Better Source Control

$\LaTeX$ produces full PDF output, including tables images and other complex objects, from declarations made in plain text. If you’re not quite sure how to think about $\LaTeX$ sometimes it’s best to think of it like a Markup language — such as HTML — in which you tell it what you want in plain text and it creates the graphical representation.

Git Diff of LaTeX

Because all of the declarations are in plain text it makes source control really easy. Above you can see an image of a git diff in the Github application on OS X. Showing the difference between binary (.doc) word files is impossible, showing differences between Open Office XML files is difficult to decipher at best.

## 2 – Include code and automatically Syntax Highlight it

Using the listings package you can pull it code from other files on your system and automatically syntax highlight it using colours of your choice. No more copy and pasting code into your report over and over when you make changes.

First use the listings package, and load the programming language(s) you would like to include in your document. Optionally include the XColour package for some more interesting colours to use to syntax highlight your code.

% In your preamble
\usepackage{listings}
\usepackage[usenames,dvipsnames]{xcolor}


Then set up the colours you want keywords, comments and strings etc to appear as, as well as some basic settings such as line wrapping. You can redefine these at any point in your document if you need to change the colours for different bits of code for any reason:

\lstset{%
basicstyle=\ttfamily\color{black},
keywordstyle=\ttfamily\color{CornflowerBlue},
stringstyle=\color{SeaGreen},
identifierstyle=\color{Mahogany},
showstringspaces=false,
breaklines=true}


Now you can just include any code files…

\lstinputlisting[language=Ruby]{path/to/code.rb}


or any inline code snippets you like

\begin[language=Java]{lstlisting}
//This is a comment in Java
System.out.println("I love printing to stdio");
\end{lstlisting}


I personally prefer to include from files, so that I can edit the code that is being displayed in my preferred editor for that language. Additionally, if you are required to dump all of your source code in a report, as was required of me recently, this is a nice way to ensure any updates to that source code are displayed in your final document without any work on your behalf.

## 3 – Run a Script from inside your documents

If you run a Unix-like operating system with a bash shall, such as Linux or OS X, then you can compile your $\LaTeX$ documents with the --shell-escape flag which allows you to embed bash scripts inside your document that get run when the document gets compiled.

I recently used this to run a bash script which counted the number of words inside the document that was being compiled, meaning I could have an always accurate word count printed inside the document. Handy.

I could also envisage this being useful to generate pretty PDF reports of services on a server or other systems. An guide on how to achieve something like this is available at CTAN.

## 4 – Easily cite other peoples work and change reference style

Using the Bibtex bibliography subsystem for $\LaTeX$ you can write your references in a simple, almost JSON like, syntax — as shown below:

@online
{
demes,
author = {Vesselin K. Vassilev and Julian F. Miller and Terence C. Fogarty},
title = {The Evolution of Computation in Co-evolving Demes of Non-uniform Cellular Automata for Global Synchronisation},
year = 2007,
urldate = {2015-01-25}
}


When you come to cite this article in the body of your document you can just write \cite{demes} and it will print out the correct citation style as specified in your documents preamble, and print the full information about the article in the correct style in your bibliography. At York we use the IEEE citation system, and so the above is output like so:

Inline citation IEEE

Bibliography IEEE

However, if I change this one line in my preamble from:

\usepackage[backend=biber, style=harvard]{biblatex}


to

\usepackage[backend=biber, style=authoryear-ibid]{biblatex}


Then my references and citations show up in the Harvard style, as I used in my final year project at Hull. No retyping citations.

Harvard Style Reference

## 5 – Write and Read Anywhere

Because the ‘source files’ for $\LaTeX$ are just plain text, and the output files are PDF files everyone, on any operating system, can make changes to and read the output of your documents. No more worrying about what version of word someone has, or whether or not they’ll have Calibri in their font library. Furthermore there is a LaTeX compiler available for almost any machine.

There is an abundance of editors for  $\LaTeX$ including features such as syntax highlighting, autocomplete, automatic packing including and simplification of the PDF generation process. My personal favourite is TexPad.

I hope I will have convinced at least a few of you to try out LaTeX when you’re next writing a report for university of work. Let me know how it goes if you do!

Danny

# Nokia DC-16 Portable Charger

When I went to the Olympic opening ceremony rehearsal I was pretty immobile due to being on crutches thanks to a broken foot. Therefore it was vital I could keep in contact with my family who were waiting for me at the end of the ceremony. I also knew it was a once in a lifetime opportunity so I wanted to take as many pictures and videos as possible. My trusty Nokia Lumia 710 did the job… mainly.

Toward the end of the ceremony I have no videos at all because my phone ran out of charge. I wasn’t as upset about being unable to take anymore video as I was about being unable to contact my family and arrange a way to get home, even more annoying seeing as I couldn’t walk and Transport for London were using the event as a way to stress test the tube network, so it was a slow slog to get to the tube station and took over an hour to get onto a train. My family of course wouldn’t have known where I was and were worried. Fortunately through pure luck I managed to get on to the same connecting train as my family — the last train of the night in fact — so everything was O.K, but it was a close call!

That night I decided I would buy a portable charger to stop any such event happening again and ensuring that in the future I would always be connected to my loved ones and be able to take as much video and do as much photography, web browsing and other battery intensive tasks as I want! After some research I decided the Nokia DC-16 portable charger was the right device for me and ordered 2 – one for me and one for my mum.

Since I’ve had it I’ve used it a few times — it’s not something you’re going to use most days as my phone lasts around 14 hours with Wi-Fi on etc, even longer in battery saving mode — and each time I’ve been thankful I’ve had it. You never know where you’re gonna have to make or receive an important call or text or when you’ll see something you want to snap a photo of, and in much the same way you never know when a train delay is going to turn a 5 hour outing into a 12 hour nightmare. Its for this reason I always carry my DC-16 with me. 🙂

Thankfully I’ve found the DC-16 fits snugly into my Jeans pockets alongside my phone itself and it weighs almost nothing. When I get it out of my pocket to charge my device I find it’ll give it 2 or 3 full charges, so you could potentially go a few days charging just from the DC-16.

My favorite thing about the DC-16 however is its wide compatibility, its literally just a battery strapped to a USB. The cable that comes with it is a Micro-USB cable, the standard for all Smartphones — except iPhones. So just with that cable you can charge most phones. But if you really wanted you could just plug an apple charger into it and then have 100% compatibility. This just means that if you’re out and one of your friends phones runs out of charge you can help them out 🙂

I can’t recommend the DC-16 portable charger enough. 5 Stars.

Danny

# Sweepy Cleaner is “New and Impressive”

I was pleasantly surprised when my fellow Hull Computer Scientist and good friend John Van Rij pointed out that my version of Sweepy Cleaner was listed as the 7th most “New and Impressive” application on AppFlow.

AppFlow describes a new and impressive app as one that was “released in the past few months and according to ratings so far is definitely worth trying”. That to me seems quite good 🙂

For those who don’t know AppFlow is an alternative way to find and view applications on your windows phone, in my opinion its 100x better than the built in marketplace and some of the statistics it provides are actually better than the Windows Phone Developer portal, create.msdn.com. But don’t get me started on that… It really needs some work. AppFlow is also one of the most beautifully designed Silverlight applications I’ve seen.

If you still haven’t downloaded and played Sweepy Cleaner it’s available here.

Thanks to all 320 people that have download the game so far!

Danny

# UX not Specs!

So, I’ve been back in Hull for a few days now, only to discover my friend Nick has betrayed the good ship Windows Phone and moved to the dark side of Android. 😛 Whilst we were discussing his new phone, a Samsung Galaxy Nexus,  we got talking about HTC’s latest Android offering — the One X.

What sets the One X apart from the rest of the crowd is the fact that it has a quad core processor. Quad core processors aren’t actually the norm in desktop PC’s yet, most people still have dual core chips, so to have one in a phone is an interesting development. Interesting, I would say, but not entirely useful — in fact, quite the opposite.

In my day-to-day life, my one concern about my phone is how long it will last. It’s always a pain when your phone runs out of juice just as you’re expecting a text, call or email. Smartphones at the moment typically have a battery life of around 20 hours, with light to moderate use of more advanced features like Wi-Fi and high screen brightness. This will last you a day at University or work, but god help you if you forget to charge it up at night and want to make a phone call the next day.

An issue I don’t encounter on a day-to-day basis is lack of computing power on my phone. Whilst I frequently think “I wish this had a bit more oomph sometimes” on my i3 powered Dell Inspiron 15R Laptop I can honestly say the thought has never occurred to me about my Samsung Focus Flash Windows Phone, everything seems seamless and frankly im not doing anything taxing like editing and converting video on my phone… I make phone calls, text people, read my emails, browse the web, listen to music and play the occasional game — none of this requires the power of a quad core.

Quad core processors sip more battery than a single core would. Simple fact, so for my experience at least it would actually enhance an issue I have and ‘solve’ an issue I don’t. Of course, everyone uses their devices differently, so your experience may indeed be improved by a bit more power but I think most people want to get the essentials done, with a tad of gaming but be able to do all that for a longer period of time.

Going back to the seamlessness of my phone experience, during our conversation about processing power in phones I coined the term “UX not specs”, which is now the title of this blog post. UX stands for User Experience, the way in which users experience your hardware and software, this includes the “person’s perceptions of the practical aspects such as utility, ease of use and efficiency of the system” according to Wikipedia. What is important here is the word perception, a quad core is usually going to be quicker than a single core clocked at the same speed, but this increase in speed might be so small that it not be noticeable by the user, in which case its almost a waste.

Specs stands for Specifications and rhymes nicely with UX. 😉 Specifications are the list of details about a piece of  hardware’s innards, including its CPU Core count, amount of RAM, measurement of storage space etc.

Windows Phone is very cleverly designed so that smooth animations cover the loading time, so even if something takes a while because everything is moving you deem it to be efficient, fast, and working instantly on command. The user experience is good, I’ve never been irritated by a slowdown in Windows Phone so I personally wouldn’t be willing to sacrifice any battery life for more cores. The user experience is great, even without the specs which you think it would demand, so windows Phone has got the UX, but not the (battery draining) specs of some high-end Android phones.

Until we invent a technology capable of holding many days’ worth of battery life on a smartphone device I for one will yearn for more battery life over computational power.

Danny.

# A “Resolutionary” Screen Vs. Extended Battery Life

Today I made the 15 mile journey to Milton Keynes, my trademark black skinny jeans had a hole in a rather unfortunate position and needed replacing, whilst there I strayed into the Apple Store and saw a gigantic floor-to-ceiling display for the iPad 3 with a few display models underneath.

Now, the Milton Keynes Apple Store uses iPad 2’s as a sort of catalogue, which can also be used to interact with the employees and flag that you require assistance, this is quite clever. It also meant that I could see an iPad 2 right next to an iPad 3.

Having seen both together, I found that to my eye there was very little difference between the normal old iPad 2 screen and the new “RESOLUTIONARY” iPad 3 screen. Admittedly, the iPad 3 did look better, just, but at that screen size I don’t think a PPI (pixels per inch) increase of the size that Apple did would ever have made much difference. The iPad 3’s screen is not the same “retina” display of the iPhone 4, which has 326 PPI, but rather a screen with a much less impressive 264 PPI. This is double the 132 PPI of the iPad 2.

Why does this all matter so much? Well, It comes down to what you want to do with your iPad. Having a more impressive screen (and really, its not that much more impressive) comes at the cost of battery life. The Battery in the iPad3 is 70% larger than that of its predecessor, but the battery life that apple says the device gets is exactly the same, about 10 hours. Personally, if I was going to buy a tablet I would prefer to have the extra 70% battery life than a screen that seeps all of those gains away, especially as its meant to be a portable device, and not one permanently plugged into a wall.

I must say, it strikes me as odd that apple have gone down this route of making a small adjustment to the screen at the expensive of battery, especially as they are now marketing the iPad as a portable productivity device (e.g. one you can use to write up documents etc.) Instead I think they would have been better of giving the new iPad the 70% bigger battery and a Keyboard attachment as standard, making it into a true laptop competitor and potentially gaining more of the business and education markets.

If you look around our lectures at University you’ll see well over 150 people with laptops, but as far as I know only 2 or 3 with iPads and not many more with Android powered tablets. If apple made a tablet with really good battery life (im talking 15 hours here, which seems possible if they dimmed down the displays a bit) and a nice, portable keyboard attachment as standard they could really be on to something.

Perhaps this is where Windows 8 on ARM tablets will step in, the ARM CPU architecture — which Apple uses in the iPad —  allows for really good power-efficiency, and due to the fact that Windows 8 is licensed rather than sold on devices manufactured by Microsoft we may see a lot of different form factors and ideas of what a tablet should be like from different OEMs (Original Equipment Manufacturers).

Here’s to a more power efficient, productive tablet future,
Danny

PS: “Resolutionary” isn’t and never will be a word, I hate when companies make up silly words like that.

# Playing with Kinect on Windows

I’ve spent the last few days playing with a Kinect, which I’m borrowing from the Computer Science Department, hooked up to my Laptop which is now pretty easy to do thanks to the new release of the Kinect for Windows Platform.

I must say that when I first heard about Microsoft releasing a Natural User Interface device a few years ago I was a bit sceptical, and If I’m honest I don’t think the devices main role is that of a gaming device. Having said that it is great fun as I’m sure you can infer from the below image of James and Rob “Skeleton Fighting”.

As you can see, the device is pretty accurate (even with my head in the way of much of robs body) and it maintains a consistent frame rate of 30 – 31 frames per second even when providing highly detailed skeleton and joint information on the fly, I must say this is the most impressed I have been by any software or hardware in years.

Its not all play however, the plan is learn how to program using Kinect and its associated API’s and eventually (hopefully) get something ready for the 10th Microsoft Imagine Cup, the only problem is that so far the documentation for the latest release of the API (admittedly only a few weeks old) is pretty much non existent, or very high level. I’m sure we’ll figure it out eventually though.

Danny.