Skip to content

Instantly share code, notes, and snippets.

View yukixz's full-sized avatar
❤️
Your Sponsor

Dazzy Ding yukixz

❤️
Your Sponsor
View GitHub Profile
/*
* @author: dazzyd
* @email: dazzyd2#gmail.com
* @license: BSD license
*/
#include <stdio.h>
#include <stdlib.h>
void printCode( char c )
{
@yukixz
yukixz / poj1002.c
Last active December 16, 2015 11:09
#include <stdio.h>
#include <stdlib.h>
#define MAXLEN 100000
#define NUMLEN 64
int compare(void const *a, void const *b) {
return ( *(int*)a -*(int*)b );
}
@yukixz
yukixz / server.py
Created June 22, 2013 05:22
Serve a SimpleHTTPServer for Images. Each Image will link to next one or directory if last.
#!/usr/bin/python
import http.server
import html
import io
import os
import socketserver
import sys
import urllib.parse
#include <stdio.h>
#include <stdbool.h>
#define MAXINST 65536 // max instructions
#define AXISLEN 0x1FFFF
bool axis[AXISLEN]; // 2 * 0x10000 - 1
void actU(int left, int right) {
// S ← S ∪ T
@yukixz
yukixz / tv.bilibili.player.xml
Last active December 20, 2015 04:29
Bilibili mute list. Please enable regexp mode.
<?xml version="1.0" encoding="UTF-8"?>
<filters>
<!-- Railgun -->
<item enabled="true">t=(.+)\1{5,}</item>
<item enabled="true">t=[^\n\r]{65,}</item>
<item enabled="true">t=[,.?!、,?!]{4,}</item>
<item enabled="true">t=^[0-9.:/\- 年月日]+$</item>
<item enabled="true">t=^\d+\/\d+</item>
<item enabled="true">t=^\d+00</item>
<item enabled="true">t=^[第前][0-9一二两三四五六七八九十百千]+</item>
// ==UserScript==
// @name 修改 Bangumi 绿标
// @description 修改当日放送为绿标、去除默认绿标
// @namespace http://dazzyd.org/
// @version 0.2
// @include http://bangumi.tv/
// @include http://bgm.tv/
// @include http://chii.in/
// @run-at document-end
// ==/UserScript==
% deadbeef
starting deadbeef 0.5.6
server_start
loading plugins from /home/ks/.local/lib/deadbeef
loading plugins from /usr/lib/deadbeef
plug_load_all: scandir found 163 files
loading plugin /usr/lib/deadbeef/aac.so
loading plugin /usr/lib/deadbeef/adplug.so
loading plugin /usr/lib/deadbeef/alac.so
loading plugin /usr/lib/deadbeef/alsa.so
@yukixz
yukixz / a3-1.c
Created April 14, 2014 15:43
《计算机算法设计与分析》电子工业出版社·第4版 算法分析题 3-1
#include <stdlib.h>
#include <stdio.h>
struct IntArray {
int *array;
int length;
};
void IntArray_init(struct IntArray *a, const int max_length) {
a->array = malloc(max_length * sizeof(int));
@yukixz
yukixz / a3-3.c
Created April 15, 2014 07:33
《计算机算法设计与分析》电子工业出版社·第4版 算法分析题 3-3
#include <stdio.h>
#include <stdlib.h>
static const int B = 10; // Bag volume
static const int N = 5; // Item number
static const int A[] = {1, 2, 3, 4, 5}; // Item weight
static const int C[] = {3, 3, 3, 3, 3}; // Item value
static void knapsack_r(int *m, int *x) {
// Use variable from global.
@yukixz
yukixz / i6-2.c
Created May 27, 2014 06:54
《计算机算法设计与分析》电子工业出版社·第4版 算法实现题 6-2
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ML 1024
typedef struct node {
int n; // current edge (has put into)
int w; // current weight.
int flag[ML]; // whether V[i] is used.
struct node *next;