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 PoorStripperImpl implements IStripper { | |
@Override | |
public String stripThing(String originalString) { | |
return originalString == null ? "???" : originalString.substring(0, 8); | |
} | |
} |
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 GoodStripperImpl implements IStripper { | |
@Override | |
public String stripThing(String originalString) { | |
return originalString.substring(0, 8); | |
} | |
} |
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 interface IStripper { | |
String stripThing(String originalThing); | |
} |
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
try { | |
client.makeCall(someArgument); | |
} catch (IOException e) { | |
log.error("Oh bumcakes", e); | |
return null; | |
} | |
// or even more obnoxious | |
try { | |
client.makeCall(someArgument); |
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
try { | |
client.makeCall(someArgument); | |
} catch (IOException e) { | |
log.error("Couldn't make call!", e); | |
throw new RuntimeException(e); | |
} | |
// or if you like Guava and javac does too! | |
try { | |
client.makeCall(someArgument); |
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
ImmutableMap<String, String> foo = ... | |
// take foo, add 'new' => 'kvp' | |
ImmutableMap<String, String> bar = ImmutableMap | |
.builder() | |
.addAll(foo) | |
.put("new", "kvp") | |
.build(); |
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
var shoppingCart = { | |
"apples": 2, | |
"oranges": 3 | |
}; | |
shoppingCart.sh_t = "bananas"; |
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
def setup_something(): | |
# do some kind of setup | |
return 1 | |
def finish_doing_something(arg): | |
# do something else | |
print(str(arg)) | |
def do_work(work): | |
val = setup_something() |
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
def setup_something(): | |
# do some kind of setup | |
return 1 | |
def finish_doing_something(arg): | |
# do something else | |
print(str(arg)) | |
def some_method_a(): | |
a = setup_something() |
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
0x000000010be89ca3: jmpq 0x000000010be89d1e ;*iload_1 | |
; - com.logentries.blog.VolatileClass::run@2 (line 12) | |
0x000000010be89ca8: vmovsd 0x10(%rsi),%xmm0 ; implicit exception: dispatches to 0x000000010be89eae | |
0x000000010be89cad: vmovq %xmm0,%rdx ;*getfield a | |
; - com.logentries.blog.VolatileClass::run@13 (line 13) | |
0x000000010be89cb2: movabs $0x1,%r10 | |
0x000000010be89cbc: add %r10,%rdx | |
0x000000010be89cbf: mov %rdx,0x40(%rsp) |
NewerOlder