Tiomaidh
Joined 16 years ago
Joined 16 years ago
No, I think the thing to note here is that Clojure--for reasons I can only guess at--has a lot more sex appeal than CL.
public int echo(int x, String name)
{
System.out.println(name + ":\t" + x);
return x;
}
(I also have versions with only x as an argument, and with the other types).In use:
this.setPreferredSize(new Dimension(getPreferredSize.getWidth(), echo(getViewportHeight(itemCount), "Viewport"));
In addition to sparing me from System.out.println verbosity, it's really useful in situations like the above where the value you want to print isn't bound to a variable.Internal Server Error the first time I tried to load comments. (And every time afterwards.)
And it's kind of a bummer not to be able to log in and comment, upvote, etc. I understand it's a MVP though, so presumably that's coming. I'd offer to help a little, but I know Python, Lisp, and Java--not PHP, JS, and CSS, so sorry.
By the way--thanks for babysitting this thread and responding to everyone.
Also: I take it that you have to be in the top 10 to get something? Or is it that the top 3 get something, and 10 others are randomly selected to win a book? The award system is not explained too clearly...
public class Singleton {
private static Singleton self = null;
private Singleton() {
//...
}
public static Singleton getInstance() {
if(self == null) {
self = new Singleton();
}
return self;
}
...
}
So at any point in your code you can call Singleton.getInstance() to have access to the same Singleton object. So it's effectively the same thing as a global variable.Edit: Added `static' to be more correct.
[1] - Yes, I could hit the undo button repeatedly, since any editor worth its salt will have a virtually-unlimited undo. But it's reassuring to know that you've undo-ed to exactly the right point--in Vim, at least, the "+" indicating a modified file disappears once you've undone all your changes.
[1] - http://cshared.com/wp-content/uploads/2011/03/Screenshot-xam...
http://www.tsmacdonald.com, although there's not a whole lot there.