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
""" | |
http://www.careercup.com/question?id=5127611667709952 | |
""" | |
RowSize = 5 | |
Data = [['a', 'b', 'c', 'd', 'e'], | |
['f', 'g', 'h', 'i', 'j'], | |
['k', 'l', 'm', 'n', 'o'], | |
['p', 'q', 'r', 's', 't'], | |
['u', 'v', 'w', 'x', 'y'], |
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
class Test(object): | |
def __init__(self): | |
self.val = None | |
def __eq__(self, rhs): | |
return self.val == None | |
t_0 = Test() | |
print(t_0 == None) # True |
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/env python | |
import cv2 | |
import math | |
import numpy | |
from argparse import ArgumentParser | |
def main(): | |
ap = ArgumentParser('image difference tool') | |
ap.add_argument('--img1', required = True) |
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 <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <utility> | |
class T { | |
public: | |
T(const string& value) | |
: value(value) |
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
def safe_mp_copy(target_b, target_k, source_b, source_k): | |
""" | |
:target_b: boto.s3.Bucket | |
Destination bucket | |
:target_k: str | |
Destination object key | |
:source_b: boto.s3.Bucket | |
Source bucket |
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
bool | |
impl_query_pose_index(PoseIndexUncompressCtx* ctx, PoseIndexReq* req | |
, PoseIndexRes* res) | |
{ | |
if (!unpack_block(ctx)) | |
return false; | |
static void* dispatch[] = { &&above, &&below, &&exit }; | |
enum State { AboveThreshold = 0, BelowThreshold = 1, Done = 2 }; | |
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 <cassert> | |
#include <cstring> | |
#include <ctime> | |
#include <iostream> | |
#include <type_traits> | |
#include <tuple> | |
using namespace std; |
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
import boto | |
def gather_hosts(): | |
for reservation in boto.connect_ec2().get_all_instances( | |
filters = { 'tag:purpose' : 'ingestion' }): | |
for instance in reservation.instances: | |
print(instance.public_dns_name) | |
print(instance.private_ip_address) |
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 "serial.hpp" | |
#include <iostream> | |
int | |
test(double a, int b) { | |
return 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
#include "HttpParse.hpp" | |
#include <cstdint> | |
#include <vector> | |
namespace { | |
static constexpr size_t MaximumHeaderSize = 8 * 1024; | |
/// {@ |
OlderNewer