This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(':text').focusin(function () { | |
| $(this).css('background-color', 'yellow'); | |
| }); | |
| $(':text').blur(function () { | |
| $(this).css('background-color', '#fff'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public int compareTo(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2) | |
| { | |
| if(buffer1 == buffer2 && offset1 == offset2 && length1 == length2) | |
| return 0; | |
| int end1 = offset1 + length1; | |
| int end2 = offset2 + length2; | |
| for(int i = offset1, j = offset2; i < end1 && j < end2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function () { | |
| $('#message').fadeIn('slow'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(':button').click(function () { | |
| $('p').css('background-color', '#000').css('color', '#fff'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object o; | |
| StringBuffer sbuf; | |
| if(! o.getClass().isArray()) | |
| { | |
| safeObjectAppend(sbuf, o); | |
| } | |
| private static void safeObjectAppend(StringBuffer sbuf, Object o) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static <T> T checkNotNull(T reference) | |
| { | |
| if(reference == null) | |
| throw new NullPointerException(); | |
| return reference; | |
| } | |
| public static <T> T checkNotNull(T reference, @Nullable Object errorMessage) | |
| { | |
| if(reference == null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @visibleForTesting static String format (String template, @Nullable Object... args) | |
| { | |
| template = String.valueOf(template); | |
| StringBuffer builder = new StringBuffer(template.length() + 16 * args.length); | |
| int templateStart = 0; | |
| int i = 0; | |
| while(i < args.length) | |
| { | |
| int placeholderStart = template.indexOf("%s", templateStart); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String nullToEmpty(@Nullable String string) | |
| { | |
| return (string == null) ? "" : string; | |
| } | |
| public static @Nullable String emptyToNull(@Nullable String string) | |
| { | |
| return isNullOrEmpty(string) ? null : string; | |
| } |
OlderNewer