CircularBuffer added to my .net Utils Library

I’ve just updated my .net Utilities Library with a Circular Buffer. Such a buffer (also called Ring buffer) has a given capacity, and when this capacity is reached new entries overwrite old ones. In other words, it is a buffer that holds the last {capacity} items.

The implementation is currently not optimized for speed, this is something I’ll tackle soon. (Update: Done, CopyTo and Contains should be much faster) Implementing a circular buffer is relatively simple, but it makes my head spin with off-by-one errors that you encounter when you have to deal with an array that’s split at an arbitrary point. It is definitely a nice exercise for a Code Kata though and may teach you a thing or two about Enumerators.

It is not possible to remove items (I don’t need that functionality yet for my purposes), I might look into it in the future. The Enumerator works as expected, it starts with the oldest element and returns all elements until the most recently inserted one. Modifying the collection while enumerating throws an Exception, and thread safety is the same as with a List<T>, which means "none at all".

Example usage:

var buffer = new CircularBuffer<int>(3);
// buffer now holds [2,3,4]

Kindle Fire Impressions

I received my Kindle Fire two days ago and played around a bit with it. Let me make a few general comments about reviews first: A lot of people are making a big deal out of the price and saying that a $200 device naturally needs to cut some corners. That is fully true, but looks at it from the wrong angle. We shouldn’t look at what the device doesn’t do. Instead, we need to look at what it does, and decide if it’s worth $200, because garbage is garbage regardless of the price.

The question is, what is the Fire? The general consensus is that it’s an Android Tablet and thus in competition with the iPad. Well, if you are in the market for a tablet and you actually have the money to spend, then get the iPad as it easily beats the Kindle Fire as a tablet in every possible comparison. I also have an iPad 1 and thought that speed would be comparable since the iPad 1 has a 1×1 GHz CPU compared to the 2×1 GHz CPU in the Fire, but even with that the iPad runs circles around it.

So it’s certainly not a Tablet. What is it? A Kindle? A big iPod Touch device? Something completely different? Let’s ignore any comparison at the moment and instead just look at what features it offers and most importantly, how well are these features implemented.

Browsing stuff

The Fire has a carousel as it’s home screen, with favorite apps underneath it if held in portrait mode. If I had one word to describe it: train wreck. Okay, that’s two. Anyway, the carousel displays recently used content – apps, videos, books – in a cover flow-type view that allows you to flip through it. How often have you used Cover Flow on an iOS or Mac OS X? Exactly, me neither. Carousels look nice on still images for the press, but in real world use they are about as useful as tag clouds – not at all. Are you someone who flips through all your stuff just to find something random to do? I do that for music, but I wouldn’t shuffle between my music, video, books and games and then decide if I’d rather read a book or watch a movie. Especially since it doesn’t shuffle through your entire collection but only recent stuff. It’s not very useful as a list of favorite stuff because things change positions and the latest app is always in front even if you never use it again. Also, the carousel is extremely sensitive. Touch something, move your finger only slightly and the carousel will scroll in that direction. Opening stuff through it is a game of luck and patience if you just want to casually flip through stuff.

The Carousel is broken and I do not see any way to fix it. The usual grid view of applications is infinitely better and I can only hope for Amazon to kill the Carousel and replace it with a normal bookshelf of manually placed items. This also solves the problems of many applications not playing well with it (e.g., when viewing videos through the Gallery app, the Carousel does not list the video but the Gallery app. Videos watched through Amazon’s streaming services do show up perfectly fine though).

Speaking of a bookshelf: This is the view used when you tab the "Books" or "Apps" or one of the other tabs, and it’s much better. Problem: The search bar is not displayed on these tabs,


Since this is a Kindle, books are the natural fit for it. They appear in a Bookshelf (like iBooks on iOS) and 12 are displayed on the screen at once as a grid. Alternatively, there is a list view which shows 9 at a time. They can be sorted by Author, Title and Recent usage. They can not be categorized, which I find braindead. The eInk Kindles support putting books into categories, and I admit it doesn’t work too well (The eInk Kindles are not responsive enough to make management of more than 2 pages of books really good). But a device like the Fire would have fantastic opportunities to categorize books into collections, sync those categorizations into the cloud and back to the eInk Kindles. A lost opportunity right there.

When reading, you can select the font size, margins, color (Black-on-White, White-on-Black (I like that one) and Sepia (which is a gimmick, just like on iBooks)) and font. As a book reader, the Fire is really nice. The display is not eInk though, so there is considerably more eye strain and because the device is heavier than a normal Kindle it isn’t as convenient to hold for hours.

Still, as a book reader it is a competent device, but Amazon missed opportunities here to make it an epic experience. I have a Kindle 4 as well, and that one will stay my primary eReader.


The Fire plays Music locally or from your Cloud Drive. Let me briefly talk about the latter: Amazon’s MP3 Uploader either never received a UX pass or Amazon’s UX people are idiots. Also, there is a limit of 100 MB for tracks, which means that some of my live songs cannot be uploaded (Sorry, but Transatlantic’s The Whirlwind is a single 79 minute track on both Live Albums). Once music is in the cloud however, it plays well.

When browsing all Songs, you get a long list. if the list is really long, then a slider appears that can be dragged. This is common in the UI and works very well. There is no bookmark for individual letters though like the iPod has, however starting letters are displayed when using the slider. There is no search though (apart from the global search).

One thing that Amazon does right and Apple does wrong since forever: Songs a sorted properly. The song "A View from the End of the World" is listed near the top, because it starts with an A. "The Whirlwind" is sorted between S and U because it starts with a T. Apple for some braindead reason sorts these two songs under "V" and "W" respectively, because apparently articles aren’t part of the song name. I’ll sort "Apple" under P from now on for the same reason.

Another thing the iPod supports that I would have loved to see on the Fire: Chapter support. I have several AAC Audio files that have chapters, for example live concerts, DJ mixes and Audio Books. No chapter support on the Fire, it’s one 80 Minute song while the iPod also treats it like an 80 Minute song, but tapping the Playlist view shows me individual chapters.


Here’s one of the two reasons to buy a device like the Fire over an eInk Reader. Video is available through Amazon’s streaming library (which includes a lot of really good content, a lot of it free to stream if you are a prime customer) which has gems like Super Troopers or Star Trek DS9. The screen is fantastic, and the overall picture quality of the things I watched was great, a lot better than the stuff on iTunes.

There are no subtitles though, a feature I only saw on Netflix on a PC yet though. Speaking of Netflix: There is an official, free Netflix app in the Marketplace and it works well. It is not Kindle Fire optimized though, which means that watched movies do not show on the Carousel. Also, the status bar is always visible, something I talk about in the "Apps" section below. I hope they come up with an optimized app.

So streaming is awesome, how about on-device playback? Well… Not so awesome. I copied some video to the device and first looked around where to play them. Naturally I checked the "Videos" tab, but this is solely dedicated to Amazon-bought/streamed videos. There is an App on the device called "Gallery" that works as a photo and video player, and it sucks. It’s clearly a third party app because it behaves nothing like the Books or Music part. It supports only non-HD MP4, at least none of my other videos played. Of course, videos don’t show up in the Carousel either.


Okay, so this thing runs Android which means that a ton of apps are available, right? Well, yes and no. Yes, there are many apps but if you expect a consistent experience or good functionality you might be surprised.

I’m looking at my App Screen right now and I see 5 different icon styles. Some icons are smaller than the rest. Some have round edges, others are square. Some have a border as part of the image, some have gloss, some are neither. Many struggle with one unique thing the Fire does: There is ALWAYS a status bar (because there is no physical home button) which is either 40 pixels high when expanded or 20 when collapsed. The 20 pixels are always there and can obstruct the view. For example, imagine watching a movie on Netflix and the bar is always there, which sucks when watching dark movies. Some games have the UI partially hidden. Sure, it’s only 20px but it’s not a great experience.

One thing that really surprised my is the absence of an official Twitter client. There is one for the Android, but it’s not compatible with the Fire. There is an icon "Facebook" in the Apps section which is a glorious, fantastic… browser bookmark. Yes, you read that right, it’s a friggin bookmark that launches the browser on the mobile Facebook site. Okay, fair enough, let’s just delete it… Oh, you can’t.

Crapware is something every Smart Phone owner knows. Apps installed by the device manufacturer or carrier that cannot be deleted and are generally useless. The iPhone has them, Android phones have them, and the Kindle Fire has them as well. An undeletable Facebook bookmark and an Office App that has WAY too many permissions on the system, and possibly some others. This sucks.

Amazon doesn’t use the Google AppStore since they have their own. This is nice, but it means you miss out on some Apps like Firefox Mobile, They do a reasonably good job to filter out Apps that don’t work on the device, so every App you buy or download at least starts. However, not all are really great yet.

The Fire comes with a Comixology app which is clearly rushed but overall works really well. The guided read feature works perfectly and I’m really happy with it. The reason I say it is clearly rushed is because a) it has a few crash bugs. Using the slider when scrolling a large list always crashes it. The other reason is b) Navigation is buggy I select Category > Fantasy and a Comic, then hit back. I would expect to get back to the Fantasy Category, ideally at the same scrolling level I was. Nope, I’m brought back to wherever I was before. I’m pretty sure they’ll update the App though, it seems they had to hit the date and got all the core functionality working.

Also, usability is inconsistent. The Fire Status bar offers a "Back" and a "Menu" buttons, and Apps haven’t consistently found out what to use them for yet. Some apps have their own menu as part of the app, other use the status bar.

Nice however is that the Amazon AppStore offers a free app each day. Yesterday it was Bejeweled 2, before it was a nice 16-bit RPG. Today it’s a crap email app. I also give Amazon a lot of credit for clearly showing what permissions an App wants, so if you see a seemingly harmless app requiring access to contacts and messages you know it’s a scam and can avoid it. It’s a bit sad that this is needed (never had fear for downloading iOS apps), but that’s the downside of a mostly open AppStore. And of course just like on Apples AppStore, there are thousands of garbage and scam apps out there (e.g. Apps that are named very similar to popular games but that are just hints and tips for $1, and of course the amount of stupid apps we used to have on J2ME mobile phones like an X-Ray scanner.)

Browsing the Web

One of the big features if the Fire is Silk, their cloud based web browser that sends all pages through Amazon’s servers where they reprocess it to make the tablet experience snappier. Essentially Opera Mini. I see this being awesome on 3G connections, but I don’t see the point in using it over WiFi.

Well, turns out that browsing WITH Silk is actually slower than without it, so I’ve disabled it. It is a full browser, and pages display properly. Scrolling is slow though, there is a noticable lag between swiping your finger and the page moving. The browser supports Flash and it works just as well as on every single other mobile device in existence, or in other words: It’s sluggish and drains your battery extremely fast. Luckily, Plugins can be disabled in the browser.

You can browse the web, but I find that even my old iPod Touch 2G had a better experience because it was snappier.

Responsiveness, Polish and Stability

I only briefly mentioned performance and stability before. Stability issues is something that affects all devices (I have stopped counting the times my iPod touch crashed or behaved strangely when it’s off, you double tap the home button and press "Next Track" on the iPod controls or unlocked it quickly.) and so far the only app that crashed on my was the Comixology app.

However, performance is a big, big issue. The UI is very sluggish, everything takes a moment to react. Not long, but long enough to notice it. Sometimes it’s downright unresponsive though and I have to hit a button or swipe my finger multiple times before it reacts. This thing has better hardware than my iPad 1 (twice the RAM, a second CPU core and a much better graphics chip) and doesn’t even come close to it.

There is a lot of polish missing as well. For example, you open the Amazon Store app and get a login screen that looks extremely ugly. It’s not centered, it’s a dark screen with an input box and submit button in the top left corner. Also, there is a Notification that says that "One Click Purchase for Mobile has been activated". Apart from the fact that it is there since 2 days and doesn’t go away, I don’t actually have 1 click purchasing enabled.


Hard to make one. If this were a $500 tablet then it would already be on it’s way back. It doesn’t stand a chance against the iPad and I think it even loses to my old iPod Touch 2G. But it’s not a $500 tablet, it is a $200 Kindle. It has really decent hardware and a gorgeous display. As outlined above, the hardware is much better than what the iPad 1 had. So with a few updates, the Kindle has potential to be great.

But that’s the problem: Potential isn’t enough. WebOS had potential. The Motorola Xoom had potential. The Nokia N9 had potential. None of them made anything with that potential. I absolutely HATE reviewers that give good grades for something that "could be cool in the future" because people have to pay their cash NOW. If I could get a device and only pay for it once it unleashes its full potential I would be a happy customer.

Let’s talk about what it does right now:

  • It is a good book and PDF reader, although the normal Kindles are still lightyears ahead thanks to eInk and less weight
  • It is a good video player for Amazon’s Streaming Library with a gorgeous display
  • It is an average but usable video player for Netflix if you don’t mind the status bar
  • It is a below-average video player for your own videos on the device
  • It is a good music player for local and cloud drive content, if you manage to get your music onto the cloud drive
  • It is usable as an all-around device for scribbles, note taking, and games. However, most applications feel strange and foreign on the device, so the experience with Apps is rarely ever fantastic
  • It is lighter than the iPad 2, but feels heavier (possibly because it is smaller).
  • It runs many but not all third party Android Apps if you get the APK and the App is compatible

I’m certainly keeping mine because I am happy enough with the stuff that it does do, and because I can develop my own apps for it in Java, vs. Objective-C. I’m a .net developer and since Java is just a crappier version of C# it’s a lot easier to learn than Objective-C with the weird Interface Builder, 1970’s header files and manual synthesizing of properties.

However, I would NOT recommend it to non-technical people. It’s just not polished enough, not friendly enough for people that just want to get up and running quick. And I would NOT recommend it to ANYONE looking for a full blown tablet. Hate Apple all you want, but the iPad is still the only tablet on the entire market that actually works and thus the only tablet I can recomment, but it is also a lot more expensive than the Fire.

Potential and Outlook

Okay, that was my conclusion about the device as it is right now. Let’s speak about potential. As I said above, the hardware is pretty decent, better than the iPad 1. So if stuff is slow and sluggish, it means that the software sucks, and software can be updated and fixed. I do not want to speculate if Amazon rushed the Fire for the holiday season, because I think it would have been a problem even with 6 months more development time.

One thing Amazon could not avoid is the horrible Android App situation. Thanks to the fracturing of the platform across a million different devices and the lack of a central authority, Apps are not consistent at all. They could have gone with their own OS, but that would mean no apps and a long battle to get developers. Using Android was the right choice.

I think they need to get away from the Android branding though and away from Android apps. They need Developers develop Kindle Fire Apps. Yeah, sure, under the covers it’s all Android, but I don’t want generic apps that suck on every device (Steve Jobs described a similar situation fittingly with "Hence developers only have access to the lowest common denominator set of features."). Instead, I want Apps that are fully optimized for the Kindle Fire. I don’t care if they run on other devices. Amazon made great efforts to hide the Android core and they customized it heavily. It shouldn’t matter that it’s "only" Android 2.3.3, because it shouldn’t matter that it’s Android. Amazon should try to clearly separate themselves and get Developers behind their platform while leveraging the other Android apps.

Jeff Bezos has proven that he is in for the long run in projects, and that they are good about iterating. The Kindle 1 to Kindle 2 upgrade was massive and made a good product into the best one on the market. The Fire is an average product, but it is one that could be equally great. There is no competition in sight, since all other Android devices have the same problem and no one behind them with the patience and money to make things better. In theory, Windows 8 could become interesting if Microsoft resists the temptation to offer Desktop apps on it ("But the people want MS Office on their tablets!" – "No, they don’t. They say they want it, but then never use it because desktop apps aren’t usable on a tablet.").

Still, as an early adopter I think that owners of a first generation Fire will get a product that is at best remembered like the Kindle 1: A market opener, but a slightly crappy device in hindsight.

Using Scrivener and GitHub

I’m participating in this years NaNoWriMo, something I missed last year. For those unfamiliar, the idea is to write a 50,000 word novel during November. With stuff like that, backup and syncing between computers becomes an issue.

Now, I made a smart choice: Instead of using Microsoft Word or other, similar inadequate applications to write the manuscript, I use Scrivener. It saves its data in what seems like a static file at first glance:

However, upon closer inspection it’s really a folder with a lot of TXT, RTF and XML files, which is perfect:

Why is it perfect? Because it plays well with git, that’s why. I have a nice little private repository on GitHub, and because I’m essentially tracking individual textual files I get nice diffs:

Sure, RTF can get a little problematic to read in a diff, but it’s better than the binary formats. And yes, Word’s file format maybe zipped XML, but you can’t just version individual XML files within the docx archive.

With GitHub, my novel is backed up and accessible from almost any computer I want, and if I don’t have a computer with Scrivener nearby I can just log in to GitHub and read/copy parts of the Novel. I haven’t tried Inline Editing and I don’t think it’s gonna work since Scrivener stores a checksum of each file, but there is definitely some idea for growth.