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
// MAin Code | |
public static void main(final String[] args) throws Exception { | |
// Load Configuration | |
ApplicationContext context = | |
new AnnotationConfigApplicationContext(ApplicationConfig.class); | |
// Load Repository | |
BlogPostRepository repo = context.getBean("blogPostService", BlogPostService.class).repository; | |
// Store 2 Blog Posts |
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
Or compressed: | |
var _bin2num={},_num2bin={},_num2b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),_buf=[],_idx=0,_error=0,_isArray=Array.isArray||function(f){return"[object Array]"===Object.prototype.toString.call(f)},_toString=String.fromCharCode,_MAX_DEPTH=512;function msgpackunpack(f){_buf="string"===typeof f?toByteArray(f):f;_idx=-1;return decode()} | |
function decode(){var f,c,e,a=0,d,g,b=_buf;c=b[++_idx];if(224<=c)return c-256;if(192>c){if(128>c)return c;144>c?(a=c-128,c=128):160>c?(a=c-144,c=144):(a=c-160,c=160)}switch(c){case 192:return null;case 194:return!1;case 195:return!0;case 202:return a=16777216*b[++_idx]+(b[++_idx]<<16)+(b[++_idx]<<8)+b[++_idx],d=a>>23&255,g=a&8388607,!a||2147483648===a?0:255===d?g?NaN:Infinity:(a&2147483648?-1:1)*(g|8388608)*Math.pow(2,d-127-23);case 203:a=16777216*b[++_idx]+(b[++_idx]<<16)+(b[++_idx]<<8)+b[++_idx]; | |
c=a&2147483648;d=a>>20&2047;g=a&1048575;if(!a||2147483648===a)return _idx+=4,0;if(2047===d)return _idx+=4,g?NaN:Infinity;a=16777216* |
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
/*!{id:msgpack.js,ver:1.05,license:"MIT",author:"[email protected]"}*/ | |
/* Modified by @daschl and @avsej to strip out whats not needed */ | |
// === msgpack === | |
// MessagePack -> http://msgpack.sourceforge.net/ | |
var msgunpack = (function () { | |
var _bin2num = {}, // BinaryStringToNumber { "\00": 0, ... "\ff": 255 } | |
_num2bin = {}, // NumberToBinaryString { 0: "\00", ... 255: "\ff" } | |
_buf = [], // decode buffer | |
_idx = 0, // decode buffer[index] | |
_toString = String.fromCharCode; // CharCode/ByteArray to String |
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
/*!{id:msgpack.js,ver:1.05,license:"MIT",author:"[email protected]"}*/ | |
/* Modified by @daschl and @avsej to strip out whats not needed */ | |
var msgunpack=function(){function k(){var g,d,e,b=0,f,h,c=m;d=c[++a];if(224<=d)return d-256;if(192>d){if(128>d)return d;144>d?(b=d-128,d=128):160>d?(b=d-144,d=144):(b=d-160,d=160)}switch(d){case 192:return null;case 194:return!1;case 195:return!0;case 202:return b=16777216*c[++a]+(c[++a]<<16)+(c[++a]<<8)+c[++a],f=b>>23&255,h=b&8388607,!b||2147483648===b?0:255===f?h?NaN:Infinity:(b&2147483648?-1:1)*(h|8388608)*Math.pow(2,f-127-23);case 203:b=16777216*c[++a]+(c[++a]<<16)+(c[++a]<<8)+c[++a];d=b&2147483648; | |
f=b>>20&2047;h=b&1048575;if(!b||2147483648===b)return a+=4,0;if(2047===f)return a+=4,h?NaN:Infinity;b=16777216*c[++a]+(c[++a]<<16)+(c[++a]<<8)+c[++a];return(d?-1:1)*((h|1048576)*Math.pow(2,f-1023-20)+b*Math.pow(2,f-1023-52));case 207:return b=16777216*c[++a]+(c[++a]<<16)+(c[++a]<<8)+c[++a],4294967296*b+16777216*c[++a]+(c[++a]<<16)+(c[++a]<<8)+c[++a];case 206:b+=16777216*c[+ |
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
Java HotSpot(TM) 64-Bit Server VM warning: PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output | |
Loaded disassembler from hsdis-amd64.dylib | |
Decoding compiled method 0x0000000105146150: | |
Code: | |
[Disassembling for mach='i386(base-hsdis)'] | |
[Entry Point] | |
[Constants] | |
# {method} 'hashCode' '()I' in 'java/lang/String' | |
# [sp+0x30] (sp of caller) | |
0x00000001051462a0: inc esp |
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
@Override | |
protected void encodeHeader(ByteBuf buf, BinaryMemcacheRequestHeader header) { | |
buf.writeByte(header.getMagic()); | |
buf.writeByte(header.getOpcode()); | |
buf.writeShort(header.getKeyLength()); | |
buf.writeByte(header.getExtrasLength()); | |
buf.writeByte(header.getDataType()); | |
buf.writeShort(header.getReserved()); | |
buf.writeInt(header.getTotalBodyLength()); | |
buf.writeInt(header.getOpaque()); |
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
/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/bin/java -Didea.launcher.port=7536 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 12.app/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Li |
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 io.netty.bootstrap.Bootstrap; | |
import io.netty.buffer.PooledByteBufAllocator; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.channel.ChannelInboundHandlerAdapter; | |
import io.netty.channel.ChannelInitializer; | |
import io.netty.channel.ChannelOption; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.SocketChannel; | |
import io.netty.channel.socket.nio.NioSocketChannel; |
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
/* | |
* Copyright 2013 The Netty Project | |
* | |
* The Netty Project licenses this file to you under the Apache License, | |
* version 2.0 (the "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at: | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/** | |
* Handle {@link ConnectRequest} messages. | |
* | |
* @param request the connect request message. | |
* @return a {@link ConnectResponse}. | |
*/ | |
private Promise<ConnectResponse> handleConnect(ConnectRequest request) { | |
if (connected.get()) { | |
return Promises.success(ConnectResponse.alreadyConnected()).get(); | |
} else { |