Skip to content

Instantly share code, notes, and snippets.

View limboinf's full-sized avatar
🎯
Focusing

limbo limboinf

🎯
Focusing
View GitHub Profile
@limboinf
limboinf / 两顺序栈共享空间.c
Created December 24, 2016 07:32
数据结构:两栈共享空间
//
// Created by 方朋 on 16/12/20.
//
#include <stdio.h>
#include "global.h"
/*
* ADT 栈(stack)
@limboinf
limboinf / 顺序栈.c
Created December 23, 2016 09:46
数据结构:顺序栈
#include <stdio.h>
#include "global.h"
/*
* ADT 栈(stack)
* InitStack(*S) // 初始化一个空栈S
* DestoryStack(*S) // 若栈存在则销毁
* ClearStack(*S) // 将栈清空
* StackEmpty(S) // 是否为空
@limboinf
limboinf / thread_pools.py
Created December 23, 2016 05:52
Python线程池
# coding=utf-8
"""
线程池.
:copyright: (c) 2015 by fangpeng.
:license: MIT, see LICENSE for more details.
"""
import sys
import Queue
import threading
@limboinf
limboinf / static-link-list.c
Created December 22, 2016 07:35
数据结构:静态链表
@limboinf
limboinf / main.c
Created December 21, 2016 14:41
数据结构:单链表
//
// Created by 方朋 on 16/12/20.
//
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
@limboinf
limboinf / global.h
Created December 17, 2016 07:20
数据结构:线性表之顺序表
//
// Created by 方朋 on 16/12/15.
//
#ifndef DATA_STRUCTURES_GLOBAL_H
#define DATA_STRUCTURES_GLOBAL_H
#define OK 1
#define ERROR 1
#define TRUE 1
@limboinf
limboinf / .vimrc.perl
Last active December 8, 2016 07:55
我的vim配置,有如下文件和目录: ~/.vimrc ~/.vim/vim_template/vim_header_for_python ~/.vim/vim_template/vim_header_for_sh
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
@limboinf
limboinf / algorithm.c
Created September 20, 2016 14:27
快速排序
#include <stdio.h>
int a[101], n;
void quicksort(int left, int right)
{
int i, j, t, temp;
if (left > right)
return;
@limboinf
limboinf / word_count.js
Last active August 19, 2016 10:46
轻松实现并行机制, 只要异步即可.下面是并行统计一个目录下所有文件的单词数.
/*
轻松实现并行机制,统计单词个数
目录结构如下:
├── word_count.js
└── text
├── a.txt
├── b.txt
└── c.txt
@limboinf
limboinf / reqRss.js
Last active August 19, 2016 10:18
实现串行化流程控制的思路:按 预期执行顺序 将异步 依次 放入数组中(队列),完成一个任务后按顺序从数组中取出下一个。
//Task 1. 判断rss文件是否存在
//Task 2. 解析rss文件
//Task 3. 发起网络请求
//Task 4. 解析rss响应
var fs = require('fs'),
request = require('request'),
htmlparser = require('htmlparser'),
rssPath = './rss.txt';