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
package com.jcheype.webServer.scala | |
import org.scalatest.{BeforeAndAfter, FunSuite} | |
import org.apache.http.client.methods.HttpGet | |
import org.apache.http.HttpResponse | |
import org.apache.http.impl.client.DefaultHttpClient | |
import org.scalatest.matchers.ShouldMatchers | |
/** | |
* Created with IntelliJ IDEA. |
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
select docid from ovp_monographie (all) where " + FOLDER + " and subject like '%ASAP%' GROUP BY (docid) having count(docid) > 1 |
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
package com.jcheype.neoTest; | |
import com.google.common.base.Predicates; | |
import com.google.common.collect.Maps; | |
import com.jcheype.neoTest.manager.MonographieManager; | |
import com.mongodb.DBCursor; | |
import com.mongodb.DBObject; | |
import com.mongodb.Mongo; | |
import org.bson.types.ObjectId; | |
import org.neo4j.cypher.javacompat.ExecutionEngine; |
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
@Override | |
public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) { | |
HttpRequest httpRequest = (HttpRequest) event.getMessage(); | |
logger.debug("Request: {}", httpRequest); | |
QueryStringDecoder qs = new QueryStringDecoder(httpRequest.getUri()); | |
final Request request = new Request(ctx, httpRequest, qs); | |
final Response response = new Response(ctx, httpRequest); |
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
object Main { | |
def main(args: Array[String]) { | |
// javafx.application.Application.launch(classOf[Main]) | |
val system = ActorSystem("MySystem") | |
val greeter = system.actorOf(Props[GreetingActor], name = "greeter") | |
greeter ! Greeting("Charlie Parker") | |
} | |
} |
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
def main(args: Array[String]) { | |
val kryo = new KryoInjection2(new Output(1024 * 4)) | |
kryo.register(classOf[String]) | |
for (_ <- 1 to 100000) { | |
kryo("toto") | |
} | |
Thread.sleep(1000) |
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
class KryoInjection2(val output: Output) extends Injection[AnyRef, Array[Byte]] { | |
val input: Input = new Input() | |
val kryo = KryoBijection.getKryo | |
def register(clazz: Class[_]) { | |
kryo.register(clazz) | |
} | |
def apply(obj: AnyRef): Array[Byte] = { | |
output.clear() |
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
package com.vidal.bo.test.webapp; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
/** | |
* Created with IntelliJ IDEA. | |
* User: jcheype | |
* Date: 18/06/13 | |
* Time: 13:24 |
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
angular.module('Plite', []).directive('panel', () -> | |
{ | |
restrict: 'E', | |
replace: true, | |
transclude:true, | |
templateUrl: 'partials/main/panel', | |
scope: true, | |
controller : [ | |
'$scope', '$element', '$attrs', | |
($scope, $element, $attrs) -> |
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
is_end_of_tag = (char)-> char is '>' | |
is_start_of_tag = (char)-> char is '<' | |
is_whitespace = (char)-> /^\s+$/.test char | |
is_tag = (token)-> /^\s*<[^>]+>\s*$/.test token | |
isnt_tag = (token)-> not is_tag token | |
class Match | |
constructor: (@start_in_before, @start_in_after, @length)-> | |
@end_in_before = (@start_in_before + @length) - 1 | |
@end_in_after = (@start_in_after + @length) - 1 |