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
//hahahaha | |
synchronized (myCache) { | |
myCache = cache; | |
} |
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 TokenReplacement { | |
private static final Logger log = | |
LoggerFactory.getLogger(TokenReplacement.class); | |
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.*?)\\}"); | |
public static String replaceTokens(final String input, Properties props) { | |
Matcher matcher = TOKEN_PATTERN.matcher(input); |
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 enum HttpStatus { | |
OK(200), | |
CREATED(201), | |
ACCEPTED(202), | |
NOT_MODIFIED(304), | |
BAD_REQUEST(400), | |
UNAUTHORIZED(401), |
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
/** | |
* @return Returns the timeZone. | |
*/ | |
public TimeZone getTimeZone() { | |
return (timeZone != null ? timeZone : | |
getCurrentUser() != null && getCurrentUser().getTimezone() != null ? | |
DateUtil.getTimeZone(getCurrentUser().getTimezone()) : | |
DEFAULT_TIMEZONE != null ? DateUtil.getTimeZone(DEFAULT_TIMEZONE) : | |
TimeZone.getDefault()); | |
} |
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.apache.commons.codec.binary.Hex; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
/** | |
* @author Ray Krueger | |
*/ | |
public abstract class SimpleUID { |
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
apt-get install ruby ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 \ | |
ruby1.8-elisp ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 \ | |
libtcltk-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8 sqlite3 \ | |
libsqlite3-ruby1.8 | |
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz | |
tar xzf rubygems-1.3.1.tgz | |
cd rubygems-1.3.1 | |
ruby setup.rb | |
ln -s /usr/bin/gem1.8 /usr/bin/gem |
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
if (cidrBlock != null) { | |
............ | |
//eclipse told me to make this function static, so i did...is that the right thing to do? | |
sqlLabel = dao.getLabel(id, cidrBlock.getIpAddress(), cidrString); | |
//Above function throws data exception, will that also be caught by the generic Exception e clause below? | |
if (sqlLabel != null) | |
{ | |
cidrElement.setAttribute("label", sqlLabel); | |
logger.debug("Label found:(" + sqlLabel + ")"); | |
} |
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
%d{yyyy-MM-dd HH:mm:ss,SSS z} |%.13X{sessionId} |%X{user} |%-5p |%c{1}: %m%n |
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
#release configuration | |
#Mon Aug 10 11:11:27 CDT 2009 | |
project.scm.com.googlecode\:hibernate-memcached.tag=HEAD | |
project.scm.com.googlecode\:hibernate-memcached.connection=scm\:git\:[email protected]\:raykrueger/hibernate-memcached.git | |
project.scm.com.googlecode\:hibernate-memcached.url=http\://github.com/raykrueger/hibernate-memcached/ | |
scm.tag=hibernate-memcached-1.2.1 | |
scm.url=scm\:git\:[email protected]\:raykrueger/hibernate-memcached.git | |
preparationGoals=clean verify | |
project.scm.com.googlecode\:hibernate-memcached.developerConnection=scm\:git\:[email protected]\:raykrueger/hibernate-memcached.git | |
remoteTagging=true |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'json' | |
http = Net::HTTP.new('stream.twitter.com', 80) | |
get = Net::HTTP::Get.new("/1/statuses/filter.json?track=awesome") | |
get.basic_auth ARGV[0], ARGV[1] |
OlderNewer