This file contains hidden or 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 <stdio.h> | |
#include <math.h> | |
#define FIXED_BIT 12 | |
float fix2float(unsigned short int n) | |
{ | |
float ret = 0.0; | |
int integer_part; | |
int i; |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
import difflib | |
FILE1 = 'file1' | |
FILE2 = 'file2' | |
def main(): | |
fh1 = open(FILE1, 'r') |
This file contains hidden or 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 perl | |
use strict; | |
use warnings; | |
use DBI; | |
use Time::HiRes qw(time); | |
# *** DDL *** | |
# CREATE TABLE `autocommit_test` ( |
This file contains hidden or 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
DELIMITER // | |
CREATE PROCEDURE intrx() | |
BEGIN | |
SELECT COUNT(*) as in_trx FROM information_schema.innodb_trx WHERE trx_mysql_thread_id = (SELECT connection_id()); | |
END; | |
// | |
DELIMITER ; |
This file contains hidden or 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 perl | |
use strict; | |
use warnings; | |
use Time::HiRes qw(time); | |
sub bench(&) { | |
my $start = time; | |
shift->(); |
This file contains hidden or 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
DELIMITER // | |
CREATE PROCEDURE grouping(IN _sql varchar(128), IN _col varchar(32)) | |
BEGIN | |
SET @sql = | |
CONCAT( | |
CONCAT( | |
CONCAT( | |
CONCAT( | |
'SELECT @in := GROUP_CONCAT(t.', |
This file contains hidden or 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
// Playground - noun: a place where people can play | |
import Cocoa | |
var str = "Hello, playground" | |
println(str) | |
var foo = 1 | |
var bar = 2 | |
var baz = foo + bar |
This file contains hidden or 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
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user nobody nobody; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
#error_log /var/log/nginx/error.log notice; | |
#error_log /var/log/nginx/error.log info; |
This file contains hidden or 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
defmodule EchoServer do | |
def accept(port) do | |
{:ok, sock} = :gen_tcp.listen(port, [:binary, packet: :line, active: false, reuseaddr: true]) | |
loop_accept(sock) | |
end | |
defp loop_accept(sock) do | |
{:ok, client} = :gen_tcp.accept(sock) | |
serve(client) | |
loop_accept(sock) |
This file contains hidden or 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
defmodule ChatServer do | |
def accept(port) do | |
{:ok, sock} = :gen_tcp.listen(port, [:binary, packet: :line, active: false, reuseaddr: true]) | |
loop_accept(sock, []) | |
end | |
defp loop_accept(sock, queue) do | |
{:ok, client} = :gen_tcp.accept(sock) | |
queue = queue ++ [client] | |
case queue do |