- 博客(168)
- 资源 (7)
- 收藏
- 关注
原创 python 背单词
import sysimport fileinputword_name = ""file_buf = ""file_object = ""word_dict = {}words = \[ #1 ["acrimonious", "avid", "barrage", "cache", "calcify", "condemn", "contradict", "d
2016-05-25 22:52:54
3464
2
原创 我的.Xmodmap文件
文件內容:clear lockclear controladd control = Caps_Lock Control_L Control_Rkeycode 66 = Control_L Caps_Lock NoSymbol NoSymbol運行方法:加到 /etc/bashrc後xmodmap /home/shiywang/.Xmodmap
2016-05-25 15:30:52
1991
原创 linux下解決ctrl+l 清屏失效
bind -x '"\C-l": clear'把这个写到/etc/profile或者/etc/bash.bashrc里头#exampleecho 'bind -x '"\C-l": clear'' >> /etc/profilesource /etc/profile#如果执行以上命令还未生效那么你应该安装readline库
2016-05-25 15:19:44
5526
3
原创 哈哈哈了啊
int get_token(){ int c, len, i, max_word_len, state, token, flag, pause_line, pause_block; state = START; pause_line = 0; pause_block = 0; while( state != OVER ) {
2015-05-03 18:13:41
800
原创 文章标题
int get_token(){ int c, len, i, max_word_len, state, token, flag, pause_line, pause_block; state = START; pause_line = 0; pause_block = 0; while( state != OVER ) { if( s
2015-05-03 18:11:44
569
原创 二叉树的非递归遍历——java实现
import tree.Tree;public class Main { public static void main(String[] args) { Tree left = new Tree(2,null,null); Tree right = new Tree(3,null,null); Tree head = new Tree(1
2015-03-24 18:11:02
865
转载 计划
这篇文章取名叫Build Your Programming Technical Skills,我实在不知道用中文怎么翻译,但我在写的过程中,我觉得这很像一个打网游做任务升级的一个过程,所以取名叫“技术练级攻略”,题目有点大,呵呵,这个标题纯粹是为了好玩。这里仅仅是在分享Mailper和我个人的学习经历。(注:省去了我作为一个初学者曾经学习过的一些技术(今天明显过时了),如:Delphi/Power
2015-03-19 22:38:52
600
原创 git rebase 使用详解
rebase图示mergerebase总结rebase本地两个分支 一个我的分支 test 一个主分支 master 现在我修改的部分要合并到 master 上,可以有两种选择 merge 或者 rebase两者的最后得到的结果是一样的,但是区别是 rebase 一个两个分支 就各位了一个分支,test合并前所有的 patch也就是commit 消失了而merge 则还是两个分支,只不过在
2015-03-07 22:42:33
57953
1
转载 Linux内核优化之TCP相关参数
tcp_syn_retries:INTEGER默认值是5对于一个新建连接,内核要发送多少个SYN连接请求才决定放弃。不应该大于255,默认值是5,对应于180秒左右时间。(对于大负载而物理通信良好的网络而言,这个值偏高,可修改为2.这个值仅仅是针对对外的连接,对进来的连接,是由tcp_retries1决定的)tcp_synack_retries:INTEGER默认值是5对于
2014-11-05 23:12:01
700
原创 save
#include #include "lily.h"/* run this program using the console pauser or add your own getch, system("pause") or input loop */extern int get_token();char test[100][100]={ "begin", "int", "ch
2014-09-15 14:32:14
603
原创 N-Queens II
class Solution {public: #define N 30 int A[N] = {0}; int max; int sum; int canput( int k ) { for( int i = 1; i < k; i++ ) if( A[i] == A[k] || abs(i-k) == abs(A
2014-08-28 15:05:13
572
原创 Integer to Roman
class Solution {public: string intToRoman(int num) { string ret; string x[] = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" }; int value[] = {10
2014-08-21 12:45:47
463
原创 Merge Two Sorted Lists
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *me
2014-08-21 12:25:35
511
原创 Remove Element
class Solution {public: int removeElement(int A[], int n, int elem) { int pos = 0; for( int i = 0; i < n; i++ ) { if( elem != A[i] ) {
2014-08-18 18:38:43
619
原创 Roman to Integer
class Solution {public: int romanToInt(string s) { int flag = 1, num = 0; map m; m['I'] = 1; m['V'] = 5; m['X'] = 10; m['L'] = 50; m['C']
2014-08-17 16:45:38
584
原创 Remove Duplicates from Sorted List
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *de
2014-08-17 15:49:48
528
原创 Search Insert Position
class Solution {public: int searchInsert(int A[], int n, int target) { int begin, mid, end; begin = 0; end = n-1; while( begin < end ) { mid = (end+beg
2014-08-11 12:33:42
479
原创 Reverse Integer
class Solution {public: int reverse(int x) { int sum = 0; while( x ) { sum = sum * 10 + x % 10; x /= 10; } return sum; }};
2014-08-10 17:03:52
738
原创 Single Number
class Solution {public: int singleNumber(int A[], int n) { int i, sum = 0; for( i = 0; i < n; i++ ) { sum ^= A[i]; } return sum; }};
2014-08-10 17:02:15
430
原创 Maximum Depth of Binary Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2014-08-10 17:00:59
578
原创 Populating Next Right Pointers in Each Node
/** * Definition for binary tree with next pointer. * struct TreeLinkNode { * int val; * TreeLinkNode *left, *right, *next; * TreeLinkNode(int x) : val(x), left(NULL), right(NULL), next(NULL)
2014-08-10 16:59:10
512
原创 Binary Tree Inorder Traversal
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2014-08-09 19:50:16
578
原创 Binary Tree Preorder Traversal
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ //递归版clas
2014-08-09 19:35:27
515
原创 Linked List Cycle
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: bool hasCycl
2014-08-09 19:34:06
576
原创 记一次阿里实习生电话面试
昨天晚上8点的一个杭州打来长串的电话号,终于开始了我的阿里巴巴实习生面试之路。因为学校以前一个大四学长内推的原因,所以淘宝的官方校园实习生招聘,我就没有投递,按袁茁学长当时的话说:"走那个还不如我这边来得快。" 的确,阿里的官方笔试还没有开始,我的人生中的第一次面试电话就来了,把第一次献给阿里,应该还不算很差吧。。。。哈哈哈,邪恶了。电话面试我的是淘宝的文景GG,google了一下,应该是
2014-03-20 18:00:59
3447
原创 C标准库stdio源码分析
//// stdio.h//// Standard I/O routines//// Copyright (C) 2002 Michael Ringgaard. All rights reserved.//// Redistribution and use in source and binary forms, with or without// modification, are
2013-12-26 17:05:38
11484
2
原创 编译原理上机作业4——LR(0)分析的DFA生成
#include #include #include #include #include #define INIT_LIST -1#define HAVE_LIST 1using namespace std;typedef struct grammer{ char content[24]; // init value: "\0" int s_pos; // init
2013-12-09 21:10:24
3218
原创 我的tmux配置文件
#status barset-option -g status-utf8 onset -g status-interval 1set -g status-justify centre # center align window listset -g status-left-length 20set -g status-right-length 140set -g status-lef
2013-12-03 18:59:16
1393
原创 编译原理上机作业3——算符优先算法
#include #include #include char grammer[200][200];char terSymbol[200];char nterSymbol[200];int firstVT[100][100];int lastVT[100][100];int vtnum, vnnum, pronum;int M[200][200];int l
2013-11-09 09:59:38
2964
原创 编译原理上机作业2——LL(1)语法分析
#include #include #include #include char grammer[200][200];char terSymbol[200];char nterSymbol[200];int firstSET[100][100];int followSET[100][100];int vtnum, vnnum, pronum;int M[200][200];
2013-11-03 20:55:09
6379
原创 编译原理上机作业1——词法分析器
/* 单词符号 种别码 单词符号 种别码 # 0 + 27 main 1 - 28 if 2 * 29 include 3 /
2013-09-23 17:20:59
2504
原创 uva 712
简单的建立树,遍历 数据也很水1A的题#include #include #include #include int time = 1, n;int tree[1000];int flag;void deal( int i ){ if( flag == -1 ) return ; if( i >= pow(2,n)-1 ) { printf( "%d", tree
2013-07-22 09:58:55
732
原创 uva 993
一个数分解,不过是从2开始的,1 分解是 1 2分解是 2 3分解是 3 4 分解是 4 不清楚为什么 10 分解不是10 而是 2 5题目说是找最小的Q 但是 10 不是比25 小吗? 但是好像题目就是让你找从小到大的分解。。所以这题不太懂#include#include#include#include#include#
2013-07-18 08:24:33
661
原创 NYOJ 18 动态规划入门
#include #include #include #include int d[1000][1000];int N;int max( int a, int b ){ return a > b ? a: b;}int main(){ scanf( "%d", &N ); memset( d, 0, sizeof(d) ); for( int i = 1; i <= N
2013-07-14 09:05:18
618
原创 NYOJ 36 LCS 动态规划入门
#include #include int max( int a, int b ){ return a > b ? a : b;}int d[1001][1001];char s1[2000];char s2[2000];int main(){ int la, lb, N; scanf( "%d", &N ); while( N-- ) { memset( d, 0
2013-07-13 15:35:57
698
原创 uva 10282 Trie树
字典树是哈希树的一种,通常用于字符串匹配,由于思想和实现都很简单,所以我就不再介绍了,自己google之吧。。很水的题,RE了一次,好吧我现在太浮躁了...#include #include #include #include #include #define CLR(array,val) memset(array,val,sizeof(array))#define MAX 2
2013-06-11 16:33:50
769
原创 uva 10763
这题据说数据给的很水,所以用邻接矩阵表示边,直接水过。方法二: 如果数据量的的话每次输入u到v 分别存入两个数组x[], y[] 然后把x, y分别排序,如果最后x数组所有元素都和y数组元素顺序相同且一一对应,则说明YES#include #include #include #include #define CLR(array, val) memset(array,val
2013-06-08 16:49:03
728
原创 uva 10905
很水的贪心,重点在于如何排序字符串。开始我用的排序方法是按字典序比,不过不一样的是,如果前面的字母都一样,单词短的排前面,开始觉得没什么问题,后来遇见这个数据就跪了。。2 9909 990最后使用了c++ 的string比较, 思路是两个string : a 和 b 连接成a+b 或者b+a ,直接比较即可。#include #include #include
2013-06-06 15:35:45
890
PHP圣经 PHP bible
2012-03-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人