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
/// <summary> | |
/// Serializer Class. | |
/// </summary> | |
public class Serializer | |
{ | |
//types: | |
// N = null | |
// s = string | |
// i = int | |
// d = double |
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
#! /bin/bash | |
## PHP 7 Initial Compile ## | |
## Some help from the various places like these. ## | |
# http://www.zimuel.it/install-php-7/ | |
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu | |
## Setup Ubuntu 15.04/15.10 ## | |
# Other dependencies for PHP 7. Add any missing ones from configure script | |
# complaints, plus some LAMP needs too. |
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
let loop = Loop::new(); | |
for i in 0..256 { | |
start_request(loop); | |
} | |
fn start_request(loop: Loop) { | |
Request::new(loop) | |
.get('http://google.com') | |
.then(|response| { |
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
let pool = new Pool(); | |
for i in 0..5_000_000 { | |
pool.submit(|| { | |
// качаем картинку и обрабатываем. | |
}) | |
} |
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
extern crate bk_tree; | |
use bk_tree::{BKTree, metrics}; | |
use bk_tree::Metric; | |
use std::cmp::min; | |
pub struct Hamming; | |
impl<K: AsRef<str> + ?Sized> Metric<K> for Hamming |
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
extern crate bk_tree; | |
use bk_tree::{BKTree, Metric}; | |
pub struct Hamming; | |
impl<i64> Metric<i64> for Hamming | |
{ | |
fn distance(&self, a: &i64, b: &i64) -> u64 { | |
*a ^ *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
extern crate bk_tree; | |
use bk_tree::{BKTree, Metric}; | |
pub struct Hamming; | |
impl Metric<i64> for Hamming | |
{ | |
fn distance(&self, a: &i64, b: &i64) -> u64 { | |
let mut dh = 0u64; |
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
<?php | |
require 'vendor/autoload.php'; | |
$from = new DateTime('2009-01-01'); | |
$to = new DateTime('2009-12-31'); | |
$loop = React\EventLoop\Factory::create(); | |
$browser = (new Clue\React\Buzz\Browser($loop)) | |
->withOptions(['timeout' => 3]); |
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
# # # # # # # # # # | |
# USAGE: | |
# | |
# $accelUri = '' | |
# . '/' . 'internal_google_drive' | |
# . '/' . $google_drive_file_id | |
# . '/' . $filename | |
# . '/' . $google_drive_access_token; | |
# http_response_code(204); | |
# header('X-Accel-Redirect: ' . rawurlencode($accelUri)); |