C:\youtube-dl.exe -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' 'https://www.youtube.com/watch?v=mgHxHIPcjbw' --proxy https://localhost:1080
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
#set connection data accordingly | |
source_host=localhost | |
source_port=6379 | |
source_db=0 | |
target_host=localhost | |
target_port=6379 | |
target_db=1 | |
#copy all keys without preserving ttl! | |
redis-cli -h $source_host -p $source_port -n $source_db keys \* | while read key; |
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 <unistd.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <signal.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.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
#include <uv.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define WORKER_NUM 10 | |
uv_thread_t worker_tid[WORKER_NUM]; | |
uv_async_t async[WORKER_NUM]; | |
uv_mutex_t mutex[WORKER_NUM]; |
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
/** | |
# -*- coding:UTF-8 -*- | |
*/ | |
#include "json_parser.hpp" | |
#include <assert.h> | |
static JO _g_jo_empty; | |
JO::JO() |
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/awk -f | |
BEGIN { | |
dec = ARGV[1] | |
for (e = 3; e >= 0; e--) { | |
octet = int(dec / (256 ^ e)) | |
dec -= octet * 256 ^ e | |
ip = octet delim ip | |
delim = "." | |
} | |
printf("%s\n", ip) |
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
# | |
# STL GDB evaluators/views/utilities - 1.03 | |
# | |
# The new GDB commands: | |
# are entirely non instrumental | |
# do not depend on any "inline"(s) - e.g. size(), [], etc | |
# are extremely tolerant to debugger settings | |
# | |
# This file should be "included" in .gdbinit as following: | |
# source stl-views.gdb or just paste it into your .gdbinit file |
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
#define _CRT_SECURE_NO_WARNINGS | |
#include <stdio.h> | |
#include <time.h> | |
#include <assert.h> | |
#ifdef _WIN32 | |
#include <Windows.h> | |
#else | |
#include <unistd.h> | |
#endif |
先看看题目:结对编程-四则运算(挑战出题)
以下思路来自轮子哥:
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 <stdint.h> | |
uint32_t time31_hash_bin(const void* data, uint32_t length) | |
{ | |
uint32_t hash = 0; | |
const uint8_t* p = (const uint8_t*)data; | |
const uint8_t* pend = p + length; | |
for(; p < pend; ++p) | |
hash = (hash<<5) - hash + *p; | |
return hash; |
NewerOlder