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
| data:text/html, | |
| <style type="text/css"> | |
| #e { | |
| position:absolute; | |
| top:0; | |
| right:0; | |
| bottom:0; | |
| left:0; | |
| font-size:16px; | |
| } |
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
| # -*- coding: gb2312 -*- | |
| import sys | |
| import string | |
| #统计 | |
| def satisics(numbers): | |
| my_numbers = [] | |
| last_row = [] |
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
| local socket = require('socket') | |
| local threads = {} | |
| local function receive(conn) | |
| conn:settimeout(0) | |
| local s, status = conn:receive(1024) | |
| if status == 'timeout' then | |
| coroutine.yield(conn) | |
| end |
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
| // The maximum size needed for the compressed output. | |
| int GetMaxCompressedLen(int souceLen) | |
| { | |
| // round up any fraction of a block | |
| int n16kBlocks = (souceLen + 16383) / 16384; | |
| return ( souceLen + 6 + (n16kBlocks * 5) ); | |
| } | |
| int ZlibCompress(const BYTE* input, int inlen, BYTE* output, int outlen) |
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
| typedef std::vector<BYTE> ByteArray; | |
| int CompressByteArray(const ByteArray& input, ByteArray* pOutput) | |
| { | |
| size_t inlen = input.size(); | |
| assert(inlen > 0 && pOutput); | |
| /* allocate deflate state */ | |
| z_stream strm; | |
| strm.zalloc = Z_NULL; |
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
| /** | |
| * @file rle.cpp | |
| * @date Oct 23, 2013 | |
| * @author ichenq@gmail.com | |
| * @brief Run-length encoding and decoding | |
| * | |
| */ | |
| #include <assert.h> | |
| #include <vector> |
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
| /* | |
| Copyright 2001, 2002 Georges Menie (www.menie.org) | |
| stdarg version contributed by Christian Ettinger | |
| This program is free software; you can redistribute it and/or modify | |
| it under the terms of the GNU Lesser General Public License as published by | |
| the Free Software Foundation; either version 2 of the License, or | |
| (at your option) any later version. | |
| This program is distributed in the hope that it will be useful, |
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
| /* how many days this month have */ | |
| int getDaysOfThisMonth() | |
| { | |
| time_t now = time(NULL); | |
| tm date = *localtime(&now); | |
| /* first day of this month */ | |
| tm this_month = {}; | |
| this_month.tm_year = date.tm_year; |
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
| // | |
| // compile: | |
| // g++ -std=c++11 -lrt -luuid | |
| // | |
| #include "bench.h" | |
| #include <iostream> | |
| #include <set> | |
| #include <unordered_set> | |
| #include <string> |
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
| #pragma once | |
| #include <time.h> | |
| #include <stdint.h> | |
| #include <array> | |
| typedef std::array<uint8_t, 16> UUID_T; | |