This file contains 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
http://shin.hateblo.jp/entry/2013/03/23/211750 |
This file contains 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
print '/'.join(['', 'usr', 'lib', 'python']) |
This file contains 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
print ', '.join(str(x) for x in list_of_ints) |
This file contains 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
JFYI, I recently learned (or reconfirmed) that instanceof returns false for null. | |
So it's NPE-safe :) | |
http://stackoverflow.com/questions/2950319/is-null-check-needed-before-calling-instanceof |
This file contains 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
with self.get_write_target_file('some_file') as write_target_file: | |
fcntl.flock(write_target_file, fcntl.LOCK_EX) | |
write_target_file.write('\t'.join(str(x) for x in data_list) + "\n") | |
fcntl.flock(write_target_file, fcntl.LOCK_UN) |
This file contains 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 CryptUtil { | |
private static final String DEFAULT_KEY_STRING = "12345678901234567890123456789012" | |
private static final String DEFAULT_TRANSFORMATION = "AES/ECB/PKCS5Padding"; | |
public static Key generateKey(String keyString) { | |
if (keyString == null) { | |
keyString = DEFAULT_KEY_STRING; | |
} | |
int keylen = keyString.length(); | |
if (keylen > 32) { |
This file contains 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
if [ ! -f ${src} ] | |
then | |
echo Error message : ${src} >> /dev/stderr | |
fi |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.springframework.org/schema/context | |
http://www.springframework.org/schema/context/spring-context.xsd | |
http://www.springframework.org/schema/mvc | |
http://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
This file contains 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
http://www.thefinancials.com/Default.aspx?SubSectionID=curformat |
This file contains 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
@Test(expected= IndexOutOfBoundsException.class) | |
public void empty() { | |
new ArrayList<Object>().get(0); | |
} |
OlderNewer