Skip to main content

33 docs tagged with "java"

View all tags

Fxxk PHP! A Javaer's Experience Migrating Large PHP Projects

When migrating old code, the most painful thing is staring at this huge pile of code - you look at it, it looks at you, over and over again, but you still don't know what the code does. No comments, no documentation, meaningless variable names, context that seems to talk past itself, a method that's over 2000 lines, strange patterns everywhere, if statements nested 7-8 levels deep in loops like the abyss, and to get a certain property you have to traverse 7 classes and a dozen methods before you finally see that crooked SQL statement with a comment that just says "RUN"

Getting Computer Monitor Resolution in Java

You can use Java's java.awt.Toolkit class to get the computer monitor resolution. Specifically, you can use Toolkit.getDefaultToolkit().getScreenSize() to get the screen dimensions, or use Toolkit.getDefaultToolkit().getScreenResolution() to get the screen resolution (in pixels per inch).