Skip to content

Instantly share code, notes, and snippets.


Ted Yin Determinant

View GitHub Profile
View p-dump.patch
diff --git a/vms/platformvm/reward_validator_tx.go b/vms/platformvm/reward_validator_tx.go
index 58e2426c..ae21d7f0 100644
--- a/vms/platformvm/reward_validator_tx.go
+++ b/vms/platformvm/reward_validator_tx.go
@@ -14,6 +14,7 @@ import (
+ ""
View competing_workers.cpp
#include <cstdio>
#include <thread>
#include <vector>
#include <mutex>
#include <atomic>
#include <condition_variable>
#include <unistd.h>
std::atomic<bool> processing;
View gist:dd0f26436c8ef8c530e5d64937752753

GNU/Linux kernel internals

Linux kernel booting process. Part 1.

If you read my previous blog posts, you can note that sometime ago I have started to get involved low-level programming. I wrote some posts about x86_64 assembly programming for Linux. In the same time I started to dive into GNU/Linux kernel source code. It is very interesting for me to understand how low-level things works, how programs runs on my computer, how they located in memory, how kernel manages processes and memory, how network stack works on low-level and many many other things. I decided to write yet another series of posts about GNU/Linux kernel for x86_64.

Note, that I'm not professional kernel hacker and I don't write code for kernel at work, just a hobby. I just like low-level stuff and it is interesting to me how these

Determinant / xim_example.c
Last active Sep 10, 2022
A minimal example for X Input Method.
View xim_example.c
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#include <assert.h>
Display *dpy;
Window win;
extern crate winit;
extern crate libc;
extern crate x11_dl;
fn main() {
let mut events_loop = winit::EventsLoop::new();
unsafe {
libc::setlocale(libc::LC_CTYPE, b"zh_CN.utf8\0".as_ptr() as *const _);
let xlib = x11_dl::xlib::Xlib::open().expect("get xlib");
(xlib.XSetLocaleModifiers)(b"@im=fcitx\0".as_ptr() as *const _);
View cvimrc
imap <C-h> deleteChar
imap <C-w> deleteWord
unmap x
map d closeTab
map u lastClosedTab
map <C-u> scrollPageUp
map <C-d> scrollPageDown
map <C-p> J
map <C-n> K
set smoothscroll
Determinant /
Created Aug 17, 2015
Concatenate features with speaker level ivector
#include "base/kaldi-common.h"
#include "util/table-types.h"
#include "util/parse-options.h"
#include <map>
using namespace kaldi;
const char *usage =
"Concatenate features with speaker level ivector (e.g. appending speaker\n"
"ivector to each frame of the corresponding utterance)\n"
"Usage: append-ivectors <ivector-rspecifier> <utt2spk-rspecifier> <in-rspecifier2> <out-wspecifier>\n\n"
* Author: Ted Yin (Maofan Yin) <>
* Description: Implementation for performing a move in direction left in 2048 game
class Game2048 {
public int moveLeft(int[][] b, int i) {
int bonus = 0;
int h = 0; /* b[i][0..h-1] has its final value and cannot be changed
again (exactly the same definition in your hint) */
View config.json
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
Determinant / log.rst
Created Jul 20, 2014
Log of My Academic Life
View log.rst

Log of My Academic Life

Sun Jul 20

  • kaldi
    • 完成kaldi动态链接
    • 几经周折后,在小集群上重现