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
object MonadInterface { | |
import scala.language.higherKinds | |
trait Functor[T[_]] { | |
def map[A, B](f: A => B)(x: T[A]): T[B] | |
} | |
trait Applicative[T[_]] extends Functor[T] { | |
def pure[A](v: A): T[A] | |
def apply[A, B](f: T[A => B])(a: T[A]): T[B] |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2017 Vladislav Mileshkin | |
# Copyright 2015 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de> | |
# Copyright 2015 Daniel Gultsch <daniel@cgultsch.de> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
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
FROM debian:latest | |
MAINTAINER Vladislav Mileshkin "noein93@gmail.com" | |
RUN apt-get update | |
RUN apt-get install -y \ | |
libncurses5-dev \ | |
libreadline-dev \ | |
nettle-dev \ | |
libgnutls28-dev \ |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
# gem install gnuplot | |
# Jmeter config: ${__P(threads,1)} and ${__P(rampup,0)} | |
module OS | |
require 'rbconfig' | |
def self.os |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
module LCG | |
def self.generate prev, a, c, m | |
(a * prev + c) % m | |
end | |
end | |
class LCGBruteForce |
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 Analyzer | |
attr_reader :name | |
def initialize name, numbers, bits_count = 16 | |
@name = name | |
@numbers = numbers | |
@bits_count = bits_count | |
end | |
# Случайность распределения |
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
#include "MoveSemanticsBench.h" | |
#include <vector> | |
#include <algorithm> | |
#include <memory> | |
#include <iostream> | |
#include "Utils.h" | |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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
// ==UserScript== | |
// @name HentaiVerseBot | |
// @namespace YoukaiCat | |
// @description HentaiVerse Bot | |
// @include http://hentaiverse.org/* | |
// @version 0.0.1 | |
// @grant none | |
// @require http://code.jquery.com/jquery-2.1.4.min.js | |
// ==/UserScript== |
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
# Classic recursive-descent parser for expressions | |
# Inefficient, boilerplate and hardcoded, | |
# but close to grammar rules and easy to understand | |
def expression | |
if @tokens.first.type == :minus | |
Node.new(Token.new(:unary_minus, @tokens.shift.value)).add_child(additive_expression) | |
else | |
additive_expression | |
end | |
end |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define BUFF_SIZE 6 /* 5 chars and \0 */ | |
int main() | |
{ | |
int count = 0; | |
char temp[BUFF_SIZE]; |
NewerOlder