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.

Continue reading…

by Panagiotis Peikidis on 28 Jan 2009 - 1 Comment »

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.

Continue reading…

by Panagiotis Peikidis on 27 Nov 2008 - 1 Comment »

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.

Continue reading…

by Panagiotis Peikidis on 13 Aug 2008 - 1 Comment »

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?

Continue reading…

by Panagiotis Peikidis on 09 Apr 2008 - 1 Comment »

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!

Continue reading…

by Panagiotis Peikidis on 25 Mar 2008 - No Comments »

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”

Continue reading…

by Panagiotis Peikidis on 16 Mar 2008 - No Comments »

Dive In: JSameGame

In this post I’ll create a small game project in Java from scratch based on the game SameGame. There are numerous of ways to create this game. I’ll try to make it as simple as possible and use Good Practices as much as I can. We’ll go step by step all the way from designing the idea to creating and testing it. Because this is a small project, we will be using the Waterfall Model. This post is dedicated to a friend of mine, Niko (see, it’s that simple! ;) ). The game along with the source code can be found at pek’s Java Corner.

So, let’s begin!

Continue reading…

by Panagiotis Peikidis on 24 Feb 2008 - 1 Comment »

What’s next? A service to upload my clipboard?

I have recently stumbled upon TechCrunch‘s article about ControlC. The idea sounds, well, ridiculous.

First of all, how many people use the clipboard to remember things? There are numerous of other applications like Google Notebook, other notes applications, windows notepad and even plain old Post-It. Why the hell should I use the internet for this?

On top of that, does anybody care what other people copy on their clipboard? ControlC’s public user profiles isn’t for people viewing other peoples clipboard, it’s seeing what other people are sharing (by using ctl+c combination and declaring it public). In other words, “Copying something and sharing it” is just another way of saying “posting to my del.icio.us” or “posting to my flickr” etc. Nothing new.

If somebody really would like to keep his clipboard history, there are plenty of freeware applications to assist them. The idea here is not, again, at all new. You can’t even copy from one PC to paste it to another without having the service installed in both, unlike some other portable clipboard utilities out there.

I believe this is a service that runs to catch the Web2.0 bubble before it explodes (A.K.A. Built to be Bought)

I give them two months tops.

by Panagiotis Peikidis on 14 Feb 2008 - No Comments »

Word Patents – A revolutionary idea(TM) of 2020

I would like to inform you(TM) that the idea(TM) of letting a company to patent(R) any common word(R) is starting to bother me(R). It is very difficult for me(R) to pay(TM) at least 10 dollars a word(R) and ending up paying(TM) more than 399 dollars an article(R). Please(TM) do not call me backward when I say(TM) that it was better(R) before when we(R) could freely(TM) write(R) anything(TM) without worrying about writing expensive(TM) words(R). I still can’t believe(R) what happened to that poor(TM) guy(R) who paid one thousand dollars(R) just because(R) he wrote in his article(R) the word(R) XXXXX (I cannot write this because it is too expensive(TM) for me(R)). Luckily(TM) I can(TM) write(R) a shorter version of a word(R) to lower the cost but then again, it would be really hard to read(TM) anything(TM). So, thk u for your tim.

Sincrely
pek

P.S.(TM)
Price(R) for the word(R) word(R): 12 dollars
Price(R) for this article(R): 489 dollars
Freedm: Pricelss (actually, the correct word(R) costs more than 600 dollars)

by Panagiotis Peikidis on 30 Apr 2007 - No Comments »
Page 2 of 212