Skip to content

Instantly share code, notes, and snippets.

View stevenschlansker's full-sized avatar

Steven Schlansker stevenschlansker

  • Wholesail
  • San Francisco, CA
View GitHub Profile
{
"responseCode": 200,
"requestUri": "http://localhost:8080/json-api/v3/user/904955/feed?euidOverride=904955",
"requestStart": 1309543645803,
"responseEnd": 1309543672717,
"requests": [
{
"requestUri": "client:RatingsStorage#getFirstRatings",
"requestStart": 1309543663146,
"responseEnd": 1309543663204,
<profiles>
<profile>
<id>verify-lessio</id>
<dependencies>
<dependency>
<groupId>com.kaching.platform</groupId>
<artifactId>kawala-testing</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>test</scope>
for machine in db6 s00{10,11,12,13}
do
for slot in s{0,1,2,3,4}
do
rsync -azvP $machine:/home/deploy/$machine-$slot/current/launcher.log $machine-$slot.log
done
done
from ness.rating import RatingClient, RatingClientModule
from ness.user import UserClient, UserClientModule
shell.setEnvironment("staging/DEPLOY-83/json-api")
shell.registerModule(UserClientModule())
shell.registerModule(RatingClientModule())
shell.reload()
uc = injector.getInstance(UserClient)
rc = injector.getInstance(RatingClient)
from ness.query.util import CallbackCollector
from ness.user.query import AccountQuery
CREATE TEMPORARY TABLE foo (a BIGINT);
INSERT INTO foo VALUES(null);
INSERT INTO foo VALUES(null);
INSERT INTO foo VALUES(null);
INSERT INTO foo VALUES(null);
SELECT * FROM foo;
public class ElLikeSubstitutionUtils {
private static final Pattern MATCH_PATTERN = Pattern.compile("\\$\\{([^}]+)\\}");
/**
* Replace ${name} with the appropriate template value retrieved from the map.
* Does not gracefully handle nested or mismatched brace patterns
*/
public static Verified<String> substitute(String string, Map<String, String> parameters) {
List<SyndicationVerificationError> errors = Lists.newArrayList();
create temporary table foo (key integer primary key, value integer);
insert into foo values (1,1);
insert into foo values (1,2);
insert into foo values (3,10);
WITH ids AS ( SELECT 1 AS id ) SELECT * FROM foo, ids WHERE key = ids.id OR value = ids.id;
key | value | id
-----+-------+----
1 | 1 | 1
bind (MyCoolObject.class).annotatedWith(bindingAnnotation);
bind (MyDependentObject.class).annotatedWith(bindingAnnotation).toProvider(new MyDependentProvider(bindingAnnotation));
class MyDependentProvider implements Provider<MyDependentObject>
{
MyDependentProvider(Annotation bindingAnnotation) { ... }
@Inject
public void setInjector(Injector injector) { ... }
package com.nesscomputing.uuid;
import java.util.UUID;
import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
public class PerformanceComparison extends SimpleBenchmark
{
@stevenschlansker
stevenschlansker / gist:6153643
Created August 5, 2013 05:09
Java String intern() speedup
diff -r 2bfa00fac03f src/share/vm/classfile/javaClasses.cpp
--- a/src/share/vm/classfile/javaClasses.cpp Thu Jul 04 01:00:19 2013 -0700
+++ b/src/share/vm/classfile/javaClasses.cpp Sun Aug 04 22:08:03 2013 -0700
@@ -322,9 +322,7 @@
jchar* result = NEW_RESOURCE_ARRAY_RETURN_NULL(jchar, length);
if (result != NULL) {
- for (int index = 0; index < length; index++) {
- result[index] = value->char_at(index + offset);
- }