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
#!/bin/bash -e | |
# Download OpenJDK Reference Implementation Sources from | |
# http://jdk.java.net/java-se-ri/10 | |
curl -O https://download.java.net/openjdk/jdk10/ri/openjdk-10_src.zip | |
# Navigate to the hsdis sources | |
unzip openjdk-10_src.zip | |
cd openjdk/src/utils/hsdis |
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
class A(): | |
def __del__(self): | |
pass | |
def foo(): | |
a=A() | |
b=A() | |
a.a=b | |
b.a=a | |
b.data = [0] * 1000 * 1000 * 100 | |
import time, gc |
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 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"ScanCode Map"=hex:00,00,00,00,00,00,00,00,22,00,00,00,2d,00,30,00,24,00,2e,00,\ | |
11,00,33,00,33,00,11,00,12,00,20,00,34,00,12,00,1b,00,0d,00,0d,00,1b,00,16,\ | |
00,21,00,17,00,22,00,20,00,23,00,1a,00,0c,00,2e,00,17,00,23,00,24,00,14,00,\ | |
25,00,31,00,26,00,35,00,1a,00,30,00,31,00,13,00,18,00,26,00,19,00,2f,00,34,\ | |
00,28,00,10,00,0c,00,28,00,19,00,13,00,18,00,1f,00,1f,00,27,00,2c,00,35,00,\ | |
15,00,14,00,22,00,16,00,25,00,2f,00,10,00,2d,00,21,00,15,00,27,00,2c,00,00,\ | |
00,00,00 |
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 <algorithm> | |
#include <iostream> | |
struct C{ | |
int v{}; | |
C(int v_):v{v_}{ | |
std::cout << "C()[" << v << "]\n"; | |
} | |
C(const C &)=delete; | |
bool operator<(C const & o) const{ | |
return v < o.v; |
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 <pwd.h> | |
int main() | |
{ | |
struct passwd *p; | |
p = getpwnam("root"); | |
if (p == NULL) { | |
printf("no root!\n"); | |
} else { | |
printf("root is %d\n", p->pw_uid); |
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 <iostream> | |
#if defined(__clang__) | |
enum { max_depth = 256}; | |
#else | |
enum { max_depth = 100}; | |
#endif | |
#define INIT_REGISTER(REG) \ | |
template<typename T, int N> \ | |
struct REG:REG<T, N-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 <iostream> | |
#include <boost/asio.hpp> | |
#include <boost/date_time/posix_time/posix_time.hpp> | |
#include <boost/asio/spawn.hpp> | |
#include <memory> | |
void bar(boost::asio::io_service &io, std::function<void()> cb){ | |
auto ptr = std::make_shared<boost::asio::deadline_timer>(io, boost::posix_time::seconds(1)); | |
ptr->async_wait([ptr, cb](const boost::system::error_code&){cb();}); | |
} |
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
%lex | |
%% | |
\s+ {} | |
(AND|OR) { return 'LOG'; } | |
[a-zA-Z]+ { return 'VAR'; } | |
"(" return '(' | |
")" return ')' | |
"!" return '!' | |
<<EOF>> { return 'EOF'; } |
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 <tuple> | |
#include <memory> | |
int main(void){ | |
using namespace std; | |
tuple<unique_ptr<char []>> b; | |
} |
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 <tuple> | |
#include <memory> | |
int main(void){ | |
using namespace std; | |
unique_ptr<char[]> a(new char[3]); | |
make_tuple(move(a)); | |
} |
NewerOlder