Skip to content

Instantly share code, notes, and snippets.

View lushl9301's full-sized avatar
🙃
hi

˥n Sɥǝuƃlᴉɐuƃ lushl9301

🙃
hi
View GitHub Profile
ip link set enp5s0 down ; ip link set enp5s0 name eth0 ; ip link set eth0 up
for i in {1..9}; do awk -F',' '{printf "%s,%s,%s,%s,%s\n", $1, $2, $3, $5,$6}' dc_topo_new350${i}.csv > dc_topo_cap_${i}.csv; sleep 1; done | tee 1
for i in {0..9}; do awk -F',' -v i="${i}" '{printf "%s,%d,%d,%s,%s\n", $1 + i * 40000, $2 + i * 10000, $3 + i * 10000, $5,$6}' dc_topo_new351${i}.csv > haha_${i}; done
#include <iostream>
#include <set>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
using namespace std;
double Pow(double x, double y) {
@lushl9301
lushl9301 / cuda-mutex.cu
Created March 9, 2017 15:45
CUDA Lock; Critical Session; Mutex
#include <stdio.h>
#include <vector>
#include <cuda_runtime.h>
using namespace std;
__device__ void lock(int *mutex) {
while (atomicCAS(mutex, 0, 1) != 0);
}
__device__ void unlock(int *mutex) {

Kaggle_CrowdFlower

Download souces and data

git clone https://github.com/ChenglongChen/Kaggle_CrowdFlower.git
cd Kaggle_CrowdFlower
cd Data
cp ~/Downloads/*.csv .
@lushl9301
lushl9301 / run.sh
Created January 8, 2016 03:29
quick solution for compile xtratum
#!/bin/bash
XM_SDK_PATH="/opt/xm-sdk"
cd ~
rm -rf $XM_SDK_PATH
cd ~/src
#make distro-run
/usr/bin/expect <<EOF
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
fib_a := 0
fib_b := 1
return func() int {
@lushl9301
lushl9301 / tmux-cheatsheet.markdown
Created November 3, 2015 12:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
//./core/include/xmconf.h:323:struct xmc
//This structure contains every important part of the XtratuM.
struct xmc {
#define XMC_SIGNATURE 0x24584d43 // $XMC
xm_u32_t signature;
xm_u8_t digest[XM_DIGEST_BYTES];
xmSize_t dataSize;
xmSize_t size;
// Reserved(8).VERSION(8).SUBVERSION(8).REVISION(8)