- 博客(31)
- 资源 (1)
- 收藏
- 关注
原创 [题解][LeetCode][Valid Parentheses]
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are
2014-07-31 12:50:27 599
原创 [题解][LeetCode][Divide Two Integers]
题解:位运算Code:class Solution: # @return an integer def divide(self, dividend, divisor): if divisor == 1: return dividend if divisor == -1: retu
2014-07-30 16:17:14 948
原创 [题解][LeetCode][Scramble String]
题目:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great /
2014-07-30 14:47:57 714
原创 [题解][LeetCode][Binary Tree Level Order Traversal]
题目:题解:Code:class Solution: # @param root, a tree node # @return a list of lists of integers def levelOrder(self, root): ans = [] if root is None: return ans a = [
2014-07-22 20:02:05 684
原创 [题解][LeetCode][Sort Colors]
题目:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the
2014-07-21 21:52:59 618
原创 [题解][LeetCode][Linked List Cycle II]
题目:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?题解1:
2014-07-18 14:58:39 682 1
原创 [题解][LeetCode][Single Number II]
题目:题解:Code:class Solution: # @param A, a list of integer # @return an integer def singleNumber(self, A): d = {'0' : 0} for i in A:
2014-07-16 16:53:06 730
原创 [题解][LeetCode][Linked List Cycle]
题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?题解:我们需要一块
2014-07-15 15:45:38 575
原创 [题解][Leetcode][Unique Binary Search Trees]
题目:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's.1 3 3 2 1
2014-07-15 14:36:24 687
原创 [Matlab][数据挖掘算法][线性回归]
x0 = linspace(1,1,size(X,2)); %x0 is all 1 X = [x0; X]; w = inv(X * X') * X * y';
2014-05-31 21:01:07 1122
原创 [Matlab][数据挖掘算法][感知机]
Perceptron X = [linspace(1,1,size(X,2)) ; X]; % add x0 % p = p + 1 P = size(X,1); N = size(X,2); k = 0; flag = 0; iter = 0; w = rand(P, 1); while (1)
2014-05-31 20:46:19 1587
原创 [C/C++][Log]
1. extern extern可以置于变量或者函数前,以表示变量或者函数的定义在别的文件中,提示编译器遇到此变量和函数时在其他模块中寻找其定义extern int a;//声明一个全局变量aint a; //定义一个全局变量aextern int a =0 ;//定义一个全局变量a 并给初值。一旦给予赋值,一定是定义,定义才会分配存储空间。in
2014-05-24 19:04:05 598
原创 nutch on hadoop 遇到 ls: 无法访问data/segments: 没有那个文件或目录
在将nutch部署在hadoop上运行的时候,
2014-04-09 10:46:59 3892
原创 nutch + solr —— 搭建初探
1. 配置 nutch-site.xml http.agent.name MySpider http.robots.agents MySpider,*http.agent.name 必填http.robots.agents 选填,若不填,fetch开始会提示,但不影响运行附:Nutch学习笔记二——抓取过程简析ht
2014-04-02 15:49:20 2053 3
原创 Hadoop Error Log
1. javac -classpath hadoop-core-1.2.1.jar:lib/commons-cli-1.2.jar -d FirstJar WordCount.java2. bin/hadoop jar WordCount.jar WordCount input output Exception in thread "main" java.lang.Cla
2014-03-24 09:42:22 921
原创 Linux Play Log
1. 怎么看Linux的位数Terminal 输入 uname -a 即可看到其架构。ps. X86-64 -> 64位2. Linux 下如何打开rarhttp://www.rarlab.com/download.htm1. 下载rar for linux2. 解压3. cd rar4. make即可。这样就可以在命令行下使用rar, unrar
2014-03-07 16:32:40 879
原创 Java串口通信——Notepad与Eclipse之迷
配置:操作系统:WIndows 7-64java -version: java version "1.7.0_45"串口通信第三方库RXTX:RXTXcomm.jarrxtxSerial.dllrxtxParallel.dll要放置的位置:Java\jre7\lib\ext RXTXcomm.jarJava\jdk1.7.0_
2014-01-09 01:24:31 1931
原创 Java串口通信——Error: no rxtxSerial
JAVA写完Java串口通信程序,运行,报错:no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDrive解决:把rxtxSerial.dll 放到%JAVA_HOME%/bin (注意,不是rxtxSerial64.dll 。不过我也不是很清楚这两个dll的区别)
2013-12-17 20:54:23 2891
原创 汇编与接口——串口通信篇
汇编与接口(御姐控...= = 万恶的搜狗输入法)学习FPGA + Verilog 的同学们,推荐一门书 《FPGA Prototyping by Verilog Examples》。非常经典!里面的讲解,代码很到位。今天在调COM串口程序(书中第八章内容,UART)。得出的结论是,大家一定要仔细研读书本。不要因为是英文就跳读,读不懂也要读!之前看书的时候,跳过
2013-12-17 20:13:49 1440
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人