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
apt-get update | |
apt-get install apt-transport-https ca-certificates curl software-properties-common -y -q | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
apt-key fingerprint 0EBFCD88 | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
apt-get update | |
apt-get install docker-ce -y -q |
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
sysctl vm.overcommit_memory=1 | |
echo never > /sys/kernel/mm/transparent_hugepage/enabled |
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
#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