Skip to content

Instantly share code, notes, and snippets.

We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 12. in line 1.
no11
400.perlbench,9770,342.737275,28.505799,1,S,,,,,NR,"SelectedIteration (base #2)"
401.bzip2,9650,496.388853,19.440404,1,S,,,,,NR,"SelectedIteration (base #2)"
403.gcc,8050,301.848171,26.669037,1,S,,,,,NR,"SelectedIteration (base #1)"
429.mcf,9120,271.583367,33.580849,1,S,,,,,NR,"SelectedIteration (base #1)"
445.gobmk,10490,462.053761,22.702986,1,S,,,,,NR,"SelectedIteration (base #2)"
456.hmmer,9330,429.788319,21.708361,1,S,,,,,NR,"SelectedIteration (base #2)"
458.sjeng,12100,513.934958,23.543835,1,S,,,,,NR,"SelectedIteration (base #3)"
462.libquantum,20720,367.549355,56.373381,1,S,,,,,NR,"SelectedIteration (base #2)"
464.h264ref,22130,552.763484,40.035206,1,S,,,,,NR,"SelectedIteration (base #2)"
@wuyongzheng
wuyongzheng / genmathcards.py
Created February 6, 2017 09:54
Generate math cards for kids
def gendpage (cards, linesPerPage):
nitem = linesPerPage*2;
if len(cards) < nitem:
co = cards + [("", "", "")]*(nitem-len(cards))
cards = []
else:
co = cards[0:nitem]
cards = cards[nitem:]
for i in range(0, linesPerPage):
#include <windows.h>
#include <psapi.h> // for GetMappedFileName
#include <stdio.h>
static const struct memprot_name_type {
unsigned int value;
const char *short_name;
const char *desc;
} memprot_names[] = {
{PAGE_NOACCESS, "noa", "PAGE_NOACCESS (cannot dump)"},
#include <windows.h>
#include <psapi.h> // for GetMappedFileName
#include <stdio.h>
static const struct memprot_name_type {
unsigned int value;
const char *short_name;
const char *desc;
} memprot_names[] = {
{PAGE_NOACCESS, "noa", "PAGE_NOACCESS"},
Naive Bayes
Logistic Regression
Sequential Minimal Optimization
Laxy-Ibk
Random Committee
Decision Table
PART
J48
LMT
Random Forest Tree
/* Discretionary Round Robin
A DFQ tries to achieve the same criterias as in a Round Robin Queue
1. No starvation.
2. Traffic Shaping: throughput and burst guarantee
Instead of controlling _when_ to send as in normal traffic shaping queue,
DRR decides whether to send. When a sender wants to send a packet, it first
calls Flow.send(size). DRR either returns "Yes. You can send now" or "No.
Check with me again after t seconds."
*/
/* Discretionary Fair Queue
A DFQ tries to achieve the same criterias as in WFQ:
1. Fairness: equivelent to byte-level round-robin
2. Traffic Shaping: throughput and burst guarantee
Instead of controlling _when_ to send as in WFQ, DFQ decides whether to
send. When a sender wants to send a packet, it first calls
Flow.send(size). DFQ either returns "Yes. You can send now" or "No. Check
with me again after t seconds."
*/
@wuyongzheng
wuyongzheng / TestSelect.java
Last active August 29, 2015 14:04
Java Selector behaviour
import java.net.InetSocketAddress;
import java.nio.channels.Selector;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.nio.ByteBuffer;
public class TestSelect
{
public static void main (String [] args) throws Exception
{
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.crypto.spec.IvParameterSpec;
public class CFBTest
{
final protected static char[] hexArray = "0123456789abcdef".toCharArray();
public static String bytesToHex(byte[] bytes, int offset, int size) {
char[] hexChars = new char[size * 2];
for ( int j = 0; j < size; j++ ) {
@wuyongzheng
wuyongzheng / gist:b9a9bf4900841c1d4e6d
Last active August 29, 2015 14:03
Problem: re-order correction code
Problem: re-order correction code
You need to send a message through a datagram channel which may reorder
packets. It only reorder packets, but not drop or duplicate packets. You are
asked to design an efficient error correction code that can reliably deliver a
message. Minimal packets should be used. Specifically, you need to design two
functions (Java syntax for illustration purpose):
1. byte[][] encode (byte[] message, int packetSize)
2. byte[] decode (byte[][] packets)