Skip to content

Instantly share code, notes, and snippets.

View SharpMan's full-sized avatar
🚩
Layer 8

Ismail K SharpMan

🚩
Layer 8
View GitHub Profile
//1-Count high speeds: Find the number of speeds > 100 in the data set.
db.agg_w_loopdata.find( { speed: { $gt: 100 } } ).count()
//2-Volume: Find the total volume for the station Foster NB for Sept 21, 2011.
db.agg_w_loopdata.aggregate([
{ $match:
package koh.protocol.client.codec;
import java.util.Date;
import koh.protocol.MessageQueue;
import koh.protocol.client.Message;
import koh.protocol.messages.handshake.ProtocolRequired;
import org.apache.mina.core.buffer.CachedBufferAllocator;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.buffer.IoBufferAllocator;
import org.apache.mina.core.session.IoSession;
package koh.concurrency;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Optional;
import java.util.Spliterator;
import java.util.concurrent.Callable;
import java.util.concurrent.ForkJoinPool;
import java.util.function.*;
import java.util.stream.*;
@SharpMan
SharpMan / .as
Created December 28, 2015 17:27
public function writeVarShort(param1:int) : void
{
var _loc5_:* = 0;
if(param1 > SHORT_MAX_VALUE || param1 < SHORT_MIN_VALUE)
{
throw new Error("Forbidden value");
}
var _loc2_:ByteArray = new ByteArray();
if(param1 >= 0 && param1 <= MASK_01111111)
{
package koh.glicko;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.util.ArrayList;
/**
* Created by Melancholia on 3/18/16.
*/
public class Glicko2Player {
# Vider les tables actuelles
iptables -t filter -F
# Vider les r�gles personnelles
iptables -t filter -X
# Zero counters
iptables -t filter -Z
iptables --policy INPUT ACCEPT
protected function lowReceive(_arg_1:IDataInput):INetworkMessage
{
var _local_2:INetworkMessage;
var _local_3:uint;
var _local_4:uint;
var _local_5:uint;
if (!this._splittedPacket){
if (_arg_1.bytesAvailable < 2){
if (DEBUG_LOW_LEVEL_VERBOSE){
_log.info((("Not enought data to read the header, byte available : " + _arg_1.bytesAvailable) + " (needed : 2)"));
private static MapPoint getBestNextPortal(MapPoint param1, MapPoint[] param2) {
Point refCoord = null;
Point nudge = null;
MapPoint refCell = param1;
MapPoint[] closests = param2;
if (closests.length < 2) {
throw new Error("closests should have a size of 2.");
} else {
refCoord = refCell.coordinates();
nudge = new Point(refCoord.x, refCoord.y + 1);
if (isset($_POST['login']) AND isset($_POST['password']) AND !empty($_POST['login']) AND !empty($_POST['password'])) {
if ($loginArray = Application::$cache->get('login')){
var_dump($loginArray);
if(array_key_exists($_SERVER['REMOTE_ADDR'], $loginArray)){
if($loginArray[$_SERVER['REMOTE_ADDR']]["nb"] >= 7){
$timeLeft = (time () - $loginArray[$_SERVER['REMOTE_ADDR']]["lastTime"]) /60;
if($timeLeft >= 5) {
$loginArray[$_SERVER['REMOTE_ADDR']]["nb"] = 0;
User::login();
}
@SharpMan
SharpMan / as
Created December 2, 2015 04:12
BasicACKMessage blend
/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java -Didea.launcher.port=7535 "-Didea.launcher.bin.path=/Users/Melancholia/Desktop/IntelliJ IDEA 15 CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/Java