start new:
tmux
start new with session name:
tmux new -s myname
Herewith is an example of encoding to and from base64 using OpenSSL's C library. Code presented here is both binary safe, and portable (i.e. it should work on any Posix compliant system e.g. FreeBSD and Linux).
The MIT License (MIT)
Copyright (c) 2013 Barry Steyn
void TCPConnection::Notify(Loop* loop, int events) { | |
static const size_t kMaxBufSize = 4096; | |
char buffer[kMaxBufSize]; | |
int res; | |
if (events & kLoopErr) { | |
Close(); | |
} else { | |
if (events & kLoopOut) { | |
int res = SendInLoop(); |
BIN=main | |
SRC=src \ | |
third_party | |
CC=gcc | |
CXX=g++ | |
CFLAGS=-g | |
CXXFLAGS=-g -std=c++11 | |
LD=g++ | |
LDFLAGS= |
#include <stdio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
double hongbao(double m, int n) { | |
double x = m - (double)n * 0.01; | |
x = m / (double)n; | |
if (n != 1 || x > 0.01) { | |
double y = rand() % 200 / 100.0; | |
x *= y; |
#include <stdio.h> | |
#include <assert.h> | |
int binary_search(int* a, int n, int d) | |
{ | |
assert(a != NULL); | |
if (a[0] == d) { | |
return 0; | |
} |
#include <stdio.h> | |
#include <assert.h> | |
#include <strings.h> | |
#include <stdlib.h> | |
struct node_t { | |
int data; | |
struct node_t* pre; | |
struct node_t* next; | |
}; |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <strings.h> | |
int match(int *arr, size_t len, int *arr_input, size_t len_input, int *seq) { | |
int found = 0; | |
for (int i = 0; i < len_input; ++i) { | |
if (arr[arr_input[i]]) { | |
found = arr[arr_input[i]]; | |
break; |
import scrapy | |
from scrapy.http.request import Request | |
class xxxxSpider(scrapy.Spider): | |
main_url = "http://www.xxxxx.com"; | |
name = "soda" | |
allowed_domains = ["www.xxxxx.com"] | |
start_urls = [ | |
main_url + "xxxxx.html" | |
] |
var version = '0.1', | |
httpport = 8765; | |
var express = require('express'), | |
compression = require('compression'), | |
redis = require('redis'), | |
mysql = require('mysql'); | |
var app = express(); | |
app.use(compression()); |