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/python -u | |
""" | |
Python port of PHP serialize() and unserialize() | |
by Samuel Cochran <[email protected]> | |
I couldn't find a nice, fairly efficient implementation of serialize/unserialize for Python... so I wrote one. I didn't use str().partition because I wanted Python <2.5 compatibility. | |
TODO: Performance review. There's an awful lot of string copying. >.> |
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 | |
//Found on http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html | |
//Modified by http://www.php-code.net | |
//Modified: add executor | |
class Thread { | |
var $pref ; // process reference | |
var $pipes; // stdio | |
var $buffer; // output buffer | |
var $output; | |
var $error; |
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
<div id='intake'> | |
<img src="/sites/nishantverma/GBSRequest/SiteAssets/loading.gif" /> | |
<br/> | |
Submitting your request for approval | |
</div> | |
<script type="text/javascript" src="/sites/nishantverma/GBSRequest/SiteAssets/jquery-1.7.1.js"></script> | |
<script type="text/javascript" src="/sites/nishantverma/GBSRequest/SiteAssets/jquery.SPServices-0.7.0.min.js"></script> | |
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
Terminology | |
=========== | |
1. Platform - The combination of Operating System, Kernel, Tools and Runtime, and/or specific hardware device. | |
2. Desktop Platform - Typical computer with mouse & keyboard | |
3. Mobile Platform - Cell Phone, Touch Pad or other similar portable device | |
4. Host Platform - The platform on which the product is built. | |
5. Target Platform - The platform on which the product runs. | |
6. Target Runtime Library - The main "C" library for which the product is compiled. |
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
#pragma once | |
#include <SDKDDKVer.h> | |
#define WIN32_LEAN_AND_MEAN | |
#define NOMINMAX | |
#include <windows.h> | |
#include <tchar.h> | |
#include <shellapi.h> | |
#include <string> | |
#include <sstream> | |
#include <functional> |
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
int c; | |
char *hex = "0123456789abcdef"; | |
while( (c = getchar()) != EOF ){ | |
if( ('a' <= c && c <= 'z') | |
|| ('A' <= c && c <= 'Z') | |
|| ('0' <= c && c <= '9') ){ | |
putchar(c); | |
} else { | |
putchar('%'); |
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 <cstdint> | |
namespace detail | |
{ | |
// FNV-1a 32bit hashing algorithm. | |
constexpr std::uint32_t fnv1a_32(char const* s, std::size_t count) | |
{ | |
return ((count ? fnv1a_32(s, count - 1) : 2166136261u) ^ s[count]) * 16777619u; | |
} | |
} // namespace detail |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <time.h> | |
#include "hiredis.h" | |
#include "async.h" | |
#include "adapters/ae.h" | |
#include "sha1.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
/* curl_multi_test.c | |
Clemens Gruber, 2013 | |
<[email protected]> | |
Code description: | |
Requests 4 Web pages via the CURL multi interface | |
and checks if the HTTP status code is 200. | |
Update: Fixed! The check for !numfds was the problem. |
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
-- gets all fields from a hash as a dictionary | |
local hgetall = function (key) | |
local bulk = redis.call('HGETALL', key) | |
local result = {} | |
local nextkey | |
for i, v in ipairs(bulk) do | |
if i % 2 == 1 then | |
nextkey = v | |
else | |
result[nextkey] = v |
OlderNewer