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
var nowall_proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080;"; | |
var wall_proxy = "DIRECT;"; | |
var direct = "DIRECT;"; | |
var ip_proxy = "DIRECT;"; | |
/* | |
* Copyright (C) 2014 breakwa11 | |
* https://github.com/breakwa11/gfw_whitelist | |
*/ |
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
from __future__ import print_function | |
#Y-combinator | |
Y = lambda f: (lambda x: x(x))(lambda x: f(lambda *args: x(x)(*args))) | |
#fact | |
print(Y(lambda f: lambda n: 1 if n == 1 else n * f(n - 1))(5)) #120 | |
#sum | |
print(Y(lambda f: lambda n: 1 if n == 1 else n + f(n - 1))(100)) #5050 |
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 -*- | |
""" | |
A very simple stack-based virtual machine in Python | |
Example: | |
PSH 1 # push 1 into the stack | |
PSH 2 # push 2 into the stack | |
ADD # add the topest 2 values and pop them | |
POP # pop the top of the stack and print 3 | |
HLT # end the program |
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 <cstdio> | |
#include <algorithm> | |
#include <cstring> | |
#include <queue> | |
using namespace std; | |
const int MAX_V = 100000; | |
const int MAX_E = 1000000; | |
typedef long long ll; |
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
from random import choice | |
from collections import Counter | |
from copy import deepcopy | |
g = {} | |
def kargerMinCut(g): | |
while len(g) > 2: | |
#Selecting a random vertex | |
u = choice(g.keys()) |
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 | |
include "config.php"; | |
$dep_keyword = $_GET['dep_keyword']; | |
$des_keyword = $_GET['des_keyword']; | |
$tran_keyword = $_GET['tran_keyword']; | |
$count = 0; | |
$order_cate = 'price'; | |
if( $dep_keyword == $des_keyword ){ | |
$dep_keyword = ""; |
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 "stdlib.h" | |
#include "stdio.h" | |
typedef unsigned long long int ll; | |
int main( int argc, char * argv[] ) { | |
ll v_addr = atoll( argv[1] ); | |
ll page = v_addr; | |
ll offset = v_addr; | |
printf( "The address %llu contains:\n", v_addr ); |
NewerOlder