Skip to content

Instantly share code, notes, and snippets.

View chiehmin's full-sized avatar

Chieh-Min Wang chiehmin

View GitHub Profile
2795 while ((dom->item_in + 1) % SYSCALL_SIZE == dom->item_out && (timeout-- > 0))
2796 {
2797 udelay(100);
2798 }
2799
2800 spin_lock(&dom->syscall_lock);
2801 if ((dom->item_in + 1) % SYSCALL_SIZE == dom->item_out)
2802 {
2803 printk("Domain buffer full !!!!\n");
2804 goto out;
@chiehmin
chiehmin / display_toggle.html
Created September 2, 2012 11:56
Javascript Practices
<html>
<head>
<title>Reveal</title>
<style type="text/css">
.reveal * { display: none; }
.reveal .handle { display: block; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
#!/bin/busybox sh
#
# By Chih-Wei Huang <cwhuang@linux.org.tw>
# and Thorsten Glaser <tg@mirbsd.org>
#
# Last updated 2014/01/15
#
# License: GNU Public License
# We explicitely grant the right to use the scripts
# with Android-x86 project.
static void* doit1(void *arg) {
time_t startTime, endTime;
while(true) {
pthread_mutex_lock(&t1_mutex);
while(t1 == 0)
pthread_cond_wait(&t1_cond, &t1_mutex);
startTime = timeInUs();
getBestSwapTarget(bin_index1, cell_index1, curr_swap_target1, curr_target_profit1);
endTime = timeInUs();
t_doit1 += endTime - startTime;
@chiehmin
chiehmin / Zip.java
Last active December 20, 2015 03:19
import java.io.*;
import java.util.zip.*;
public class Zip{
private ZipInputStream zipIn;
private ZipOutputStream zipOut;
private ZipEntry zipEntry;
private static int bufSize;
private byte[] buf;
private int readedBytes;
package tw.fatminmin.intentparser;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
typedef struct _List {
struct _List *next;
int val;
} List;
const sort = (arr) => {
const l = arr.length;
for (let i = 0; i < l; i++) {
for (let j = 0; j < l - i; j++) {
if (arr[j] > arr[j + 1]) {
const t = arr[j + 1];
arr[j + 1] = arr[j];
arr[j] = t;
}
}
@chiehmin
chiehmin / android.rst
Last active February 14, 2017 20:39 — forked from anonymous/android.rst

build android guest on linux-kvm-arm host on arm Fast Model

all files

binaries/
├── config                (download from virtualopensystem)
├── cookies.txt           (download from virtualopensystem)
├── jb_ve_4_1_1.bz2       (download from virtualopensystem)
#include <bits/stdc++.h>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
using namespace std;
class Bus {
public:
string name;
int count;