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
import com.codahale.metrics.Gauge; | |
import com.codahale.metrics.Metric; | |
import com.codahale.metrics.MetricRegistry; | |
import com.sensus.common.database.hikari.SingletonMetricsRegistry; | |
import com.sensus.util.timing.Timeout; | |
import com.sms.db.manager.DatabaseState; | |
import com.sms.db.manager.DatabaseType; | |
import com.sms.db.manager.DbConnector; | |
import com.zaxxer.hikari.HikariConfig; | |
import com.zaxxer.hikari.HikariDataSource; |
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
class SampleToString { | |
@Override | |
public String toString() { | |
return "KeyManagementState{" + | |
"repId=" + repId + | |
(managementState == null ? "" : ", managementState:" + managementState) + | |
(desiredState == null ? "" : ", desiredState:" + desiredState) + | |
(lastAction == null ? "" : ", lastAction:" + lastAction) + | |
(lastActionResult == null ? "" : ", lastActionResult:" + lastActionResult) + | |
(lastActionTime == null ? "" : ", lastActionTime:" + lastActionTime) + |
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
package leoliang.springtest; | |
import org.springframework.beans.BeansException; | |
import org.springframework.beans.factory.config.BeanDefinition; | |
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; | |
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ApplicationContextAware; | |
import org.springframework.context.SmartLifecycle; | |
import org.springframework.context.support.AbstractRefreshableApplicationContext; |
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
import rx.Observable; | |
import rx.Observer; | |
import rx.Subscription; | |
import rx.observables.ConnectableObservable; | |
import rx.subscriptions.Subscriptions; | |
import rx.util.functions.Func1; | |
public class SettableObservable<T> { | |
private final Observer<T> observer; |
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
import com.sensus.util.threading.DelayedWorkExecutor; | |
import rx.Observable; | |
import rx.Observer; | |
import rx.Subscription; | |
import rx.subscriptions.BooleanSubscription; | |
import rx.util.functions.Func1; | |
import java.util.List; | |
import java.util.concurrent.CopyOnWriteArrayList; | |
import java.util.concurrent.Future; |
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
package org.totalgrid.reef.models | |
import org.scalatest.junit.JUnitRunner | |
import org.junit.runner.RunWith | |
import org.squeryl._ | |
import org.squeryl.PrimitiveTypeMode._ | |
import java.util.UUID |
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
package reef.persistence.squeryl | |
import org.scalatest.{ FunSuite, BeforeAndAfterAll, BeforeAndAfterEach } | |
import org.scalatest.matchers.ShouldMatchers | |
import org.scalatest.junit.JUnitRunner | |
import org.junit.runner.RunWith | |
import org.squeryl.{ Schema, Table, KeyedEntity } | |
import org.squeryl.PrimitiveTypeMode._ |
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
Select | |
Measurement.pointId, | |
Measurement.measTime | |
from Measurement | |
inner join ( | |
select max(Measurement.measTime) as t1, | |
Measurement.pointId as p1 | |
from Measurement | |
where Measurement.pointId in (1, 2, 5, 10) | |
group by pointId |
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
class Foo(val value: String) extends KeyedEntity[Long] { | |
val id: Long = 0 | |
} | |
object FooSchema extends Schema { | |
val foos = table[Foo] | |
def reset() = { | |
drop // its protected for some reason | |
create |
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
#This is the command you would normally try | |
#gpg --keyserver wwwkeys.eu.pgp.net --recv-keys F758CE318D77295D && gpg --export --armor F758CE318D77295D | sudo apt-key add - | |
#replace with: | |
wget http://gist.github.com/raw/668194/336603c2b2cd4a576c3ec97932c7ca70dc9e1e6e/cassandra.pgp | |
sudo apt-key add cassandra.pgp |
NewerOlder