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
| Original version | |
| ----------------------------------------------------------------------------------- | |
| $ echo "test.text=Test" > Bundle.properties | |
| Sending out for translation | |
| ----------------------------------------------------------------------------------- | |
| $ prop2po Bundle.properties Bundle.po | |
| $ cat Bundle.po | |
| #. extracted from Bundle.properties |
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
| irb(main):001.0> JRUBY_VERSION | |
| => "1.5.1" | |
| irb(main):002:0> test = "| 12345678 | 123456789 |" | |
| => "| 12345678 | 123456789 |" | |
| irb(main):003:0> test.gsub(/(\d\s*){9,}/, 'XXX') | |
| => "| XXX | XXX|" | |
| irb(main):004:0> test.gsub(/(\d\s*?){9,}/, 'XXX') | |
| => "| XXX| XXX |" |
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
| // | |
| // Find the bug. :-) | |
| // | |
| interface HeavyLifting { | |
| void doSomeBlockingStuff() throws InterruptedException; | |
| } | |
| // meanwhile, somewhere else in the universe: | |
| class MyUsefulUtility { |
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
| // | |
| // Find the bug - Hard Mode | |
| // | |
| class SomeSunLibrary { | |
| /** | |
| * @throws InterruptedIOException sometimes, depending on the OS and the moon. | |
| * @throws IOException | |
| */ | |
| void doSomeIO() throws IOException { |
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
| import org.hamcrest.Matchers; | |
| public class WtfHamcrest { | |
| @Test | |
| public void testWtfHamcrest() | |
| { | |
| Integer a = 1; | |
| String b = "2"; | |
| assertThat(a, Matchers.<Object>is(not(equalTo(b)))); |
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
| import java.awt.BorderLayout; | |
| import javax.swing.JEditorPane; | |
| import javax.swing.JFrame; | |
| import javax.swing.JScrollPane; | |
| import javax.swing.JSplitPane; | |
| import javax.swing.SwingUtilities; | |
| import javax.swing.text.html.HTMLEditorKit; | |
| import javax.swing.text.html.StyleSheet; |
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 class Overflow | |
| { | |
| public static void main(String[] args) | |
| { | |
| int value = 2000000000; | |
| long increment = 1000000000; | |
| value += increment; // no problemo! |
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
| class NotThreadSafe { | |
| private String value; | |
| public NotThreadSafe() { | |
| value = generateSomehow(); | |
| } | |
| public String getValue() { | |
| return value; | |
| } |
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
| Start date: 3 Nisan 5768 (Gregorian: 8 April 2008) | |
| First day of month: 1 Nisan 5768 (Gregorian: 6 April 2008) | |
| Minimum Date: 1 Tishri 5362 (Gregorian: 27 September 1601) | |
| incremented one month: 1 Heshvan 5362 | |
| incremented one month: 3 Kislev 5362 | |
| incremented one month: 3 Tevet 5362 | |
| incremented one month: 5 Shevat 5362 | |
| incremented one month: 6 Adar 5362 | |
| incremented one month: 5 Nisan 5362 | |
| incremented one month: 6 Iyar 5362 |
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
| // What I would like to write: | |
| UNQUOTED | |
| : UnquotedStartChar UnquotedChar* | |
| {but not matching WSLASH NUMBER} | |
| ; | |
| // What it seems I actually have to write: | |
| UNQUOTED |