g++ -fPIC -shared lib.cpp -o lib.so -lbz2
- generated lib.so
g++ -fPIC -shared bz.cpp lib.so -o liblib.so
- generated liblib.so
g++ main.cpp liblib.so
- generated a.out
count_max = count = 0 | |
sum_max = sum = 0 | |
prev_val = 0 | |
with open("input.txt") as f: | |
for line in f: | |
num = int(line) | |
if num > prev_val: | |
count += 1 | |
sum += num |
std::cout << "Start" << std::endl; | |
clock_t begin = clock(); | |
//do something | |
clock_t end = clock(); | |
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; | |
std::cout << "Time = " << elapsed_secs << std::endl; |
Flat profile: | |
Each sample counts as 0.01 seconds. | |
% cumulative self self total | |
time seconds seconds calls ms/call ms/call name | |
45.07 0.46 0.46 63437824 0.00 0.00 std::_List_const_iterator<int>::operator++() | |
22.78 0.69 0.23 32000 0.01 0.03 std::iterator_traits<std::_List_const_iterator<int> >::difference_type std::__distance<std::_List_const_iterator<int> >(std::_List_const_iterator<int>, std::_List_const_iterator<int>, std::input_iterator_tag) | |
18.32 0.87 0.19 63469824 0.00 0.00 std::_List_const_iterator<int>::operator!=(std::_List_const_iterator<int> const&) const | |
4.95 0.92 0.05 46462 0.00 0.00 void __gnu_cxx::new_allocator<std::_List_node<int> >::construct<std::_List_node<int>, int const&>(std::_List_node<int>*, int const&) | |
1.98 0.94 0.02 46462 0.00 0.00 std::_List_node<int>::_List_node<int const&>(int const&) |
g++ -fPIC -shared lib.cpp -o lib.so -lbz2
g++ -fPIC -shared bz.cpp lib.so -o liblib.so
g++ main.cpp liblib.so
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-latest.js'></script> | |
<script src='arun.js'></script> | |
<script type="text/javascript"> | |
</script> | |
</head> | |
<body> |
fox@fox-VirtualBox ~/Desktop $ telnet | |
telnet> open 201.221.131.99 8080 | |
Trying 201.221.131.99... | |
Connected to 201.221.131.99. | |
Escape character is '^]'. | |
CONNECT 31.28.23.219:8118 HTTP/1.1 | |
HTTP/1.1 200 OK | |
#include <stdio.h> | |
int main(){ | |
unsigned x, bout; | |
scanf("%d", &x); | |
bout = __builtin_popcount(x); | |
printf("%x, %x\n", x, bout); | |
__asm__("movl %1, %%eax; popcnt %%eax, %%eax; movl %%eax, %0;" | |
:"=r"(x) /* output */ |
#!/usr/bin/env python3 | |
from pprint import pprint | |
comb_set = set() | |
def comb(li): | |
global comb_set | |
if len(li) > 0: comb_set.add(tuple(li)) | |
for i in range(len(li)): | |
temp_li = list(li) | |
temp_li.pop(i) |
#sudo /home/anirudh/Installation/dellfand-0.9/dellfand 1 10 25 30 35 | |
#sudo pkill dellfand | |
#sudo pkill dellfand | |
sudo modprobe i8k force=1 | |
sudo i8kfan 2 2 |
inxi -Fxz #list several devices and drivers running on them |