Παρουσίαση με Ετικέτες

HowTo: round a number up to N decimal digits in Javascript
17 Ιουνίου 19 05:21 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Was just trying to round-off some Google Maps coordinates for display in Javascript up to 3 decimal digits and that was a bit like a blast from the past (the end of the ‘90s to be more accurate)… So here’s my contributed answer at: https://stackoverflow.com/questions/2221167/javascript-formatting-a-rounded-number-to-n-decimals This works for rounding to N digits (if you just […]
Δημοσίευση στην κατηγορία: , , , , , , , , , , , , ,
HowTo: Code folding in NetBeans IDE source code editor
07 Σεπτεμβρίου 13 03:45 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
As explained near the end of https://ui.netbeans.org/docs/ui/code_folding/cf_uispec.html, the NetBeans IDE source code editor supports custom code folding tags for any language, like below (here defining the code folding tag in a Java comment, obviously need to use specific comment syntax for the respective language). // <editor-fold desc="isUserStudent"> —————————————- public static boolean isUserStudent(PortletRequest request)    throws […]
Δημοσίευση στην κατηγορία: , , , , , , , ,
Gotcha: Java Calendar class returns 0-based month, but 1-based days
18 Ιουλίου 13 02:02 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
Just noticed that the Java Calendar class breaks the least-user-expected rule (that is don’t make something behave in the least expected way) regarding the indexing of the month value it returns, compared to all other indexed variables it can return (like day of year, day of month, day of week etc.). The former is using […]
Δημοσίευση στην κατηγορία: , , , , , , , , ,
Validating E-mails using Regular Expressions in Java
01 Ιουνίου 12 05:27 μμ | Μπιρμπίλης Γεώργιος | 0 σχόλια   
To sum up the discussion at http://stackoverflow.com/questions/1360113/is-java-regex-thread-safe/, you can reuse (keep in static variables) the compiled Pattern(s) and tell them to give you new Matchers when needed to validate those regex pattens against some string: import java.util.regex.Matcher; import java.util.regex.Pattern;  /** * Validation helpers */ public final class Validators {  private static final String EMAIL_PATTERN = [...]
Δημοσίευση στην κατηγορία: , , , , ,

Search

Go

Ιστορικό Δημοσιεύσεων

Συνδρομές