Skip to content

Instantly share code, notes, and snippets.

0 : 1 // reserved id
-1 : 5200 // reserved id
1 : 1 // reserved id
2 : 1 // reserved id
3 : 1 // reserved id
4 : 1 // reserved id
5 : 1 // reserved id
6 : 1 // reserved id
7 : 1 // reserved id
8 : 1 // reserved id
@LiSongMWO
LiSongMWO / results.txt
Created July 20, 2017 15:40
Benchmark results for different thread pool types.
=========================================
Benchmark with random task execution time
=========================================
Single queue thread pool: 2082 ms
Multi queue thread pool: 2220 ms
Work stealing queue thread pool: 11036 ms
Boost asio based thread pool: 2174 ms
=========================================
Benchmark with empty task
@LiSongMWO
LiSongMWO / target.cc
Last active July 11, 2017 20:17
Program for the target that is being calibrated
#include <avr/eeprom.h>
#include <avr/interrupt.h>
#include <avr/io.h>
#include <stdint.h>
#if F_CPU < 1000
#error "F_CPU must be defined to the MCU frequency in Hz"
#endif
#if MASTER_PWM_PERIOD < 1000
@LiSongMWO
LiSongMWO / 8queens .cc
Created April 28, 2017 19:00
Eight queens
#include <array>
#include <atomic>
#include <chrono>
#include <cstdint>
#include <iostream>
#include <set>
#include <unordered_set>
#include <vector>
constexpr int GRID_SIZE = 15;
@LiSongMWO
LiSongMWO / SillyTest.java
Last active October 29, 2016 10:52
UnnecessaryStubbingException SSCCE
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class SillyTest {
@LiSongMWO
LiSongMWO / Lists.java
Created May 5, 2016 19:23
Performance benchmark Java LinkedList vs ArrayList appending.
package perf;
import java.util.ArrayList;
import java.util.LinkedList;
import net.tuis.ubench.UBench;
public class Lists {
public static void main(String[] args) throws Exception {
final UBench bench = new UBench("ArrayList VS LinkedList");
package perf;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
@LiSongMWO
LiSongMWO / lsmlv3symbolcodes
Created July 29, 2014 21:10
LSML V3 symbol codes
[-1]=101
[1000]=0110011100
[1001]=10001
[1002]=010010110
[1003]=10000011
[1004]=100111101
[1005]=11000000011
[1006]=10011000110
[1007]=110000001
[1008]=110010011
@LiSongMWO
LiSongMWO / kitfoxd stock
Created July 28, 2014 11:35
smurfy xml
<?xml version="1.0" encoding="UTF-8"?>
<loadout>
<id><![CDATA[KFX-PRIME]]></id>
<mech_id>175</mech_id>
<valid>true</valid>
<configuration>
<component>
<name><![CDATA[head]]></name>
<armor>8</armor>
<omni_pod>30072</omni_pod>
@LiSongMWO
LiSongMWO / gist:b4f1124c787bdeb31379
Created June 20, 2014 17:49
LSML Link V3 - Symbol Frequency Table
Added range: [1000, 5000],
Added range: [9000, 10000],
Added range: [30000, 31000],
9075 : 1 // reserved id
9074 : 1 // reserved id
9073 : 1 // reserved id
9072 : 1 // reserved id
9079 : 1 // reserved id
9078 : 1 // reserved id
9077 : 1 // reserved id