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 <fcntl.h> | |
#include <unistd.h> | |
#include <uv.h> | |
#if !defined(CONTAINER_OF) | |
#define CONTAINER_OF(ptr, type, field) \ | |
((type *) ((char *) (ptr) - ((char *) &((type *) 0)->field))) |
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
Windows Registry Editor Version 5.00 | |
; Open files | |
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code] | |
@="Edit with VS Code" | |
"Icon"="c:\\VSCode\\Code.exe,0" | |
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] | |
@="\"c:\\VSCode\\Code.exe\" \"%1\"" |
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 <windows.h> | |
#include <tchar.h> | |
#include <stdio.h> | |
VOID __stdcall ReadFiberFunc(LPVOID lpParameter); | |
VOID __stdcall WriteFiberFunc(LPVOID lpParameter); | |
void DisplayFiberInfo(void); | |
typedef struct { |
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
#ifndef _LINUX_LIST_H | |
#define _LINUX_LIST_H | |
#include <stdio.h> | |
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | |
/** | |
* container_of - cast a member of a structure out to the containing structure | |
* @ptr: the pointer to the member. |
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 <stdbool.h> | |
#include <string.h> | |
#include <setjmp.h> | |
#include <assert.h> | |
#include <unistd.h> | |
#include <time.h> | |
#include "list.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
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import sys | |
import http.client | |
def main(argv): | |
if len(argv) != 2 : | |
print("\nUsage: ", argv[0], " <hostname>") | |
print("\n- <hostname> looks like www.python.org\n") |
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
package main | |
import ( | |
"fmt" | |
"net" | |
"time" | |
) | |
func main() { | |
host := "baidu.com" |
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
/* SPDX-License-Identifier: GPL-2.0 | |
* | |
* Copyright (C) 2018-2021 WireGuard LLC. All Rights Reserved. | |
*/ | |
#include <winsock2.h> | |
#include <Windows.h> | |
#include <ws2ipdef.h> | |
#include <iphlpapi.h> | |
#include <mstcpip.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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"time" | |
) | |
var query = "test" | |
var matches int |
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
// quick sort | |
void swap(int* a, int* b) | |
{ | |
int tmp = *a; | |
*a = *b; | |
*b = tmp; | |
} | |
// 快速排序 | |
void quick_sort(int* arr, int left, int right) | |
{ |