Callum Stott
Posts
Netflix is making it hard not to just watch South Park all the time. Loving it.
If you have a hipster startup then you’re probably going to need to say ‘hi’ in a few different languages (Flickr, Soundcloud etc). Here’s a ruby method for ya so you don’t have to bother going to Google Translate:
def random_hi
['Hi', 'Salut', 'Ciao', 'Hola', 'Hallo', 'Hei', 'Hej'].sample
end
Laphroaig (10 Year)
Why?
My good mate Dan and I were out having a drink and things took a turn for the whisky.
Verdict
Like I have heard, it tasted very smoky or “peaty” (a term that people who have never dug peat before seem to use) and I would describe it as having a nice ‘light’ texture. I would say it was quite similar to Talisker but with less kick to it as I felt it tasted almost watered down compared. All in all I liked it and it further cemented that I am leaning towards the island whiskies more and more.
So everyone is always like “JAVA SUX OMG”. But then again, everyone else is like “SHUT UP HIPSTER JAVA IS TEH WIN”. Here’s an example of why people express an opinion in correlation to the former:
So in Java we can do this:
Integer[] array = new Integer[] { 1,2,3,4,5 };
for (Integer i : array) {
System.out.println(i);
}
That makes sense right? We can think of this as “For each integer ‘i’ in array do…”. So far so good. Now lets think about it with something more complex. Suppose I replaced array’s definition:
ArrayList
array.add(1);
array.add(2);
for (Integer i : array) {
System.out.println(i);
}
So this also works and it is very useful but for a moment lets think about how this works. In the first example the equivalent for loop would simply be:
for (i = 0; i < array.length; i++) {
System.out.println(i);
}
Here we see that the ‘for each’ is quite a nice syntactical sugar tool and can be very useful. But here’s the equivalent for the ArrayList:
for (Iterator
Integer i = iter.getNext();
System.out.println(i);
}
So if you already knew this you’re probably thinking “Who cares?”. And, if you didn’t you’re probably thinking “Wait.. what?”. For the latter here’s whats going on: all the data structures in Java’s standard library implement a ‘Collection’ interface that has an ‘iterator’ method. This method returns and Iterator instance that can be used to iterate through that collection. Here Java is taking advantage of this and allowing Collections to use the ‘for each’ construct.
This makes sense and it all works but here’s my problem: There is a language construct in Java that assumes implementation of features in Java itself. Not a problem to you? Cool. You can have a happy life and never worry about this but personally I hate this. I really detest the idea that a language has constructs that utilise code built with the language. Here’s a challenge for people who think I’m an idiot: Go and build a data structure in Java and don’t use the library. You can, but you can never use ‘for each’ - you’re going to need ‘Iterator’ and to implement ‘Collection’ to do so and then you’ve lost. Isn’t that just a little sad?
I always think I’ve gotten over how good this album is but I never do. This decade’s number one so far?
I get really annoyed because, being at uni, I download a .pdf roughly every 5-10 seconds. This means I have to delete them at some point so I can find that crappy movie I just torrented. So, I stuck this into a shell script and put it into my /usr/bin:
rm /Users/$USER/Downloads/*.pdf
Now I can just execute this any time I start to drown under exercises/lectures/papers etc. So far, this one line of shell script is feeling like it might the most useful thing I’ve ever typed…
Audio
-
Keeping me happy while struggling with Java’s Sound API (for project demos).26532 plays
Updates
-
LAST EXAM EVER YO (@ St Leonards Sports Hall) http://t.co/mjX8NWFQ
-
I just unlocked the "Century Club" badge for checking in at the same place over 100 days! http://t.co/3X5CuIPc
-
This is kinda great. https://t.co/4arFISl0
-
@xoebus @frasercrmck THEN WHERE WERE YOU CHRIS!?32 hours ago from web | Reply, Retweet, Favorite
-
Fortran being written on a board by @frasercrmck. Think twice before taking compiler courses kids. http://t.co/UdKPbm0k
-
@shearn89 I KNOW. OH MY GOD.33 hours ago from web | Reply, Retweet, Favorite
-
HE'S HERE http://t.co/VQ7Cy13C
-
@LlamaSnacks BEST. SNACKS. EVER.42 hours ago from web | Reply, Retweet, Favorite
-
@shearn89 the software or the song?
-
In contrast the most fun I've had today was listening to the IE9 song while using IE9.
-
My CS friends are playing American football with my girlfriend's Eng. Lit friends. I've never hated an exam more than this one.
-
@sskelton90 @xoebus @Danzeru @wellinformatted you guys suck. My foursquare recent check ins is making fun of me not having finished yet.
-
@Danzeru got bored and made us a schedule. OMG that looks good. http://t.co/93EQJJ1b
-
Really should have organised a trip to Monaco for this weekend. Would be a good opportunity to lose all my money.2 days ago from web | Reply, Retweet, Favorite
-
I just ousted Tommi D. as the mayor of Lupe Pinto's on @foursquare! http://t.co/BE8MwJML
-
@shearn89 @wellinformatted I AM MAYOR. BOW BEFORE ME. MUHAHAHAHAAHAHAHAHAHAA.3 days ago from web | Reply, Retweet, Favorite
-
I just ousted Wenqi Y. as the mayor of Appleton Tower on @foursquare! http://t.co/rBD55KO9
