After playing around with Twitter’s API, I decided to take a look at Flickr’s API as well. Nothing special, just something I wanted for myself and decided to extend it for general purpose.
Introducing ‘Strip to Print’
Have you ever wanted to print a website but only part of it? Especially from a blog. Remove the comments, the navigation menu, the footer; basically everything else other than the post itself. Well, I can think of at least one website that I want to print right now. And, as any programming geek would think, the easiest way I found to do so is by creating a small tool.
Sharing the ‘PAE8397′ short film script
Have you ever started something with your friends and had to leave it because it turns out, nobody was as excited as you were? What did you do about it?
Well, I decided to share it.
Introducing Twitter Followers Checker
Ever so often my Twitter followers list changes and usually that means that somebody stopped following me. Leaving aside their reasons (if you ask me, I wouldn’t follow me in the first place) I hate the fact that Twitter doesn’t provide a way of informing me who was it. Instead, I have to remember. And since I have the worst memory anyone could possibly have, I decided to do something about it (about Twitter’s lack of functionality, not my memory).
Introducing Final Grade Calculator
I had a lot of free time these days so I sat down to play with jQuery. I ended up creating a small calculator that tells me whether I have a chance to pass a module or not. Turns out, this wasn’t the right thing to spend my time.
How many access levels does Java have anyway?
Before I start with my new post, I would like to talk a little about my previous one: “Rule for public void method signatures“. As it turns out, this is a proposal for Java 7 called “chained invocations”. You can find more details here. There is also another way of doing this called “Double Brace Initialization“:
JPanel panel = new JPanel() {{ setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder()); }};
At first site, it seems useful in a number of situations (i.e. Graphical User Interfaces), on the other hand, many suggest that this should not be abused as it creates ugly and cluttered code.
Now, let’s put that in the side and go back to what you have learned in Java programming.
Email Forwarding – A rant to my friends
Today I read yet another rant about receiving forwarded emails. He yells at everyone for using CC (or To:) instead of BCC. I totally agree about using BCC.
Idea: Rule for “public void” method signatures
I don’t remember in which book I read this, but the book created a wrapper class for MenuItem that when calling a setter it would return the class itself. So I started thinking: Would it be a bad practice if every time I created a class I would replace a public void with a public MyClass? In other words, use this as a general rule. Why don’t we see?
Dive In: JSnake
Continuing on the Dive In series, we are going one step further and creating a small game using animation: a clone of the classic video game Snake. As always, this will be as small as possible and many many changes can be made (which I’ll once again try to point out). We’ll start from design all the way to implementing and testing it using the easy Water Fall model. You can run the game and download the source code at my JavaCorner.
So, without further ado, let’s start!
Playing with Try, Catch and Finally
I read a blog post (Greek) recently that described the path Java takes when executing a try, catch, finally block. But before I continue I would like you to consider the following code. What will be printed out?
public class ErrorClass { public static void main(String[] args) { System.out.println(getMessage()); } private static String getMessage() { String toReturn = "Initializing"; try { throwException(); toReturn += "+No Exception"; return toReturn; } catch (Exception e) { toReturn += "+Catch"; return toReturn +" from Catch"; } finally { toReturn += "+Finally"; return toReturn +" from Finally"; } } private static String throwException() throws Exception { throw new Exception("original exception"); } }
a) “Initializing+No Exception”
b) “Initializing+Catch from Catch”
c) “Initializing+Catch+Finally from Catch”
d) “Initializing+Catch+Finally from Finally”
