Skip to content

Instantly share code, notes, and snippets.

@oliverdaff
oliverdaff / log_output.log
Created September 4, 2011 12:00
log from simpledb_dev.py with updated version to 2009-04-15
Sep 4, 2011 9:46:00 PM com.amazonaws.http.HttpClient execute
INFO: Sending Request: POST http://localhost:8080/ / Parameters: (Action: ListDomains, SignatureMethod: HmacSHA256, AWSAccessKeyId: xxx, Version: 2009-04-15, SignatureVersion: 2, Timestamp: 2011-09-04T11:46:00.220Z, Signature: 2SAEsWQNyXnq6XzHQgYnIiTwiR+LzemDMGa8zsDlhd8=, )
Sep 4, 2011 9:46:00 PM com.amazonaws.http.HttpClient handleResponse
INFO: Received successful response: 200, AWS Request ID: e03fd2d0-3e83-4b38-bf8b-f2c1a1ac2e96
@oliverdaff
oliverdaff / SimpleDbDevTest.java
Created September 4, 2011 12:02
SimpleDbDevTest client
package simpledbtest;
import org.junit.Test;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.simpledb.AmazonSimpleDBClient;
public class SimpleDbDevTest {
@oliverdaff
oliverdaff / simpledb_dev.diff
Created September 4, 2011 11:38
simpledb_dev with updated version to 2009-04-15
MAX_DOMAINS = 100
THIS_DIR = os.path.dirname(sys.argv[0])
DATA_DIR = os.path.join(THIS_DIR, 'data')
if not os.path.exists(DATA_DIR):
os.mkdir(DATA_DIR)
- VERSION = '2007-11-07'
+ VERSION = '2009-04-15'
#Enable to turn off template caching etc.
DEV_MODE = False
@oliverdaff
oliverdaff / log_output.log
Created September 4, 2011 11:59
simpledb_dev.py 2007-11-07 error
Sep 4, 2011 9:26:31 PM com.amazonaws.http.HttpClient execute
INFO: Sending Request: POST http://localhost:8080/ / Parameters: (Action: ListDomains, SignatureMethod: HmacSHA256, AWSAccessKeyId: xxx, Version: 2009-04-15, SignatureVersion: 2, Timestamp: 2011-09-04T11:26:31.741Z, Signature: AQ5KYCFtZ4C7dDg+GC9zegw3FGg4AQZO5+QTP+JsNYE=, )
Sep 4, 2011 9:26:32 PM com.amazonaws.http.HttpClient handleErrorResponse
INFO: Received error response: Status Code: 400, AWS Request ID: 256f2c06-0a76-43f3-8816-81f98b9125dc, AWS Error Code: NoSuchVersion, AWS Error Message: SimpleDB/dev only supports version 2007-11-07 currently
@oliverdaff
oliverdaff / commons-codec sbt error
Created September 6, 2011 11:35
commons-codec sbt error
Getting org.scala-tools.sbt sbt_2.8.1 0.10.1 ...
:: problems summary ::
:::: WARNINGS
[NOT FOUND ] commons-codec#commons-codec;1.2!commons-codec.jar (2ms)
==== Maven2 Local: tried
file:///Users/xxx/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar
@oliverdaff
oliverdaff / commons-codec sbt error resolved
Created September 6, 2011 11:40
commons-codec sbt error resolved
~/Documents/projects/xxx/xxx$ sbt update
Getting org.scala-tools.sbt sbt_2.8.1 0.10.1 ...
downloading file:/Users/xxx/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar ...
[SUCCESSFUL ] commons-codec#commons-codec;1.2!commons-codec.jar (61ms)
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
36 artifacts copied, 0 already retrieved (6414kB/297ms)
[info] Set current project to default-e431db (in build file:/Users/xxx/Documents/projects/xxx/project/plugins/)
[info] Updating {file:/Users/xxx/Documents/projects/xxx/project/plugins/}default-e431db...
[info] Done updating.
@oliverdaff
oliverdaff / simpledb_dev select error
Created September 12, 2011 11:32
simpledb_dev select error
Status Code: 400, AWS Request ID: 334d75f9-1204-4370-91aa-3f91c9e4db8e, AWS Error Code: NoSuchAction, AWS Error Message: The action Select is not valid for this web service.
@oliverdaff
oliverdaff / build.sbt
Created September 13, 2011 10:55
sbt default resolvers
resolvers +="Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
@oliverdaff
oliverdaff / build.sbt
Created September 13, 2011 10:57
build.sbt with two repos
resolvers ++= Seq(
"Twitter repo" at "http://maven.twttr.com/",
"Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
)
@oliverdaff
oliverdaff / FileLoader.java
Created September 20, 2011 03:47
FileLoader to load from classpath or filepath like Spring
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
public class FileLoader {
private static final String CLASSPATH_CONST = "classpath:";
private static final String FILEPATH_CONST = "filepath:";
public File loadFile(String file) throws FileNotFoundException{