Skip to content

Instantly share code, notes, and snippets.

@userqq
userqq / C php Serializer.cs
Created May 8, 2017 18:57 — forked from xiangwan/C php Serializer.cs
C# php Serializer
/// <summary>
/// Serializer Class.
/// </summary>
public class Serializer
{
//types:
// N = null
// s = string
// i = int
// d = double
@userqq
userqq / php7_build_ubuntu.sh
Last active May 18, 2017 02:59 — forked from m1st0/php_build_ubuntu.sh
Compiling PHP 7 on Ubuntu 15.04 with Various Supported Modules
#! /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.
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| {
let pool = new Pool();
for i in 0..5_000_000 {
pool.submit(|| {
// качаем картинку и обрабатываем.
})
}
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
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;
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;
<?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]);
# # # # # # # # # #
# USAGE:
#
# $accelUri = ''
# . '/' . 'internal_google_drive'
# . '/' . $google_drive_file_id
# . '/' . $filename
# . '/' . $google_drive_access_token;
# http_response_code(204);
# header('X-Accel-Redirect: ' . rawurlencode($accelUri));