- 博客(280)
- 收藏
- 关注
原创 Git, Misc
不用每次输入账号和密码的方法对单个 repo 设置 user.name 和 user.emailaddress不用每次输入账号和密码的方法 git config credential.helper store git push https://github.com/repo.git Username for ‘https://github....
2018-05-10 14:59:51 382
原创 服务器配置
1.安装 cuda 8.0 直接官网安装即可,cuda 8.0 中自带 gpu driver. 所以不用提前装 driver. 注意安装 cuda 8.0 时,不要装 xconfigure, opengl。 在网上看到据说什么用。装 cudnn, 比较简单。 貌似得下 linux 版本,而不用选 ubuntu 版本编译 caffe 时说找不到 /usr/bin/ld: cannot fin
2017-01-20 13:11:43 355
原创 Others, Academic
经验和分享Yoshua Bengio 研究生科研指导演讲:解读人工智能全貌和下一个前沿基础Back-propagation无监督深度学习基础, by Ruslan SalakhutdinovAttention based model 是什么,它解决了什么问题? - 知乎深度学习如何入门迁移学习综述VAE条件变分自编码器数学蒙特卡罗哈密顿方法(交互式)详解前沿机器学习对抗性攻
2017-01-11 13:39:57 366
原创 Interested Papers
Dec 4 1. https://arxiv.org/pdf/1612.00835.pdf 2. https://arxiv.org/pdf/1612.00500.pdf 3. https://arxiv.org/pdf/1612.00522.pdf 4. https://arxiv.org/pdf/1612.00593.pdf 5. https://arxiv.org/pdf/1612.
2016-12-05 13:54:11 848
原创 C++ 引用传递
以前对引用传递一知半解,尤其是 & 符号。现在做一下梳理。Get idea from here.先来看下 alias: int i = 5;int &j = i; // j is an alias to ij = 5;这里 j 就是 i 这个变量的另一个名字。所以这个对象现在有两个名字 i 和 j. 现在就好理解引用传递了。用这种方法,形参就变成了实参的一个 alias. 1 #include<
2016-02-09 07:51:14 870
原创 Python Closure 闭包
Summaryglobals locals闭包闭包需要注意的地方1 不能在闭包中引用任何会改变的变量2闭包的应用1 为英语增加复数形式的代码Summary闭包就是函数和它的环境(变量) 1. 尽量把 closure 中的变量变成 local 变量1. globals, localsCitation先来说下作用域,一共有三种作用域 – l
2016-02-01 08:43:16 587
原创 Python Decorators 装饰器
QuestionA group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the home of someone in the group. The distance i
2016-02-01 04:11:59 425
原创 Python Skills
Summarythe peculiar nature of and and or1 andorConditional Assignmentset builtinSummaryavoid "for" and "if-and-else" instead, use list comprehension and conditional assignmentfs1. the pecul
2016-01-31 11:01:27 403
原创 Leetcode: Maximum Product of Word Lengths
QuestionGiven a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower ca
2016-01-05 10:11:28 369
原创 Leetcode: Shortest Distance from All Buildings
QuestionShortest Distance from All Buildings My Submissions Question Total Accepted: 919 Total Submissions: 3251 Difficulty: Hard You want to build a house on an empty land which reaches all buildin
2016-01-05 09:13:29 1209
原创 leetcode, Range Sum Query - Mutable
class NumArray(object): def __init__(self, nums): """ initialize your data structure here. :type nums: List[int] """ self.nums = [0]*len(nums)
2016-01-03 12:42:04 370
原创 Leetcode: Range Sum Query - Mutable
#Question Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at index i to val. Exa
2016-01-02 10:52:53 578
原创 Leetcode: Coin Change
QuestionYou are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of
2015-12-30 12:32:23 881
原创 Leetcode: Range Sum Query - Immutable
QuestionGiven an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example: Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRa
2015-12-30 10:45:19 399
原创 Leetcode: Range Sum Query 2D - Immutable
QuestionRange Sum Query 2D - Immutable My Submissions Question Total Accepted: 5239 Total Submissions: 25173 Difficulty: Medium Given a 2D matrix matrix, find the sum of the elements inside the rect
2015-12-30 10:39:04 438
原创 Leetcode: Smallest Rectangle Enclosing Black Pixels
QuestionAn image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one black region. Pixels are connected horizontall
2015-12-28 18:16:36 465
原创 Leetcode: Walls and Gates
QuestionYou are given a m x n 2D grid initialized with these three possible values.-1 - A wall or an obstacle. 0 - A gate. INF - Infinity means an empty room. We use the value 231 - 1 = 2147483647 to
2015-12-28 15:34:03 765
原创 Leetcode: Nim Game
QuestionYou are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will
2015-12-28 12:00:57 359
原创 Leetcode: Flip Game
QuestionYou are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take turns to flip two consecutive “++” into “–”.
2015-12-28 11:25:36 415
原创 Leetcode: Sparse Matrix Multiplication
QuestionGiven two sparse matrices A and B, return the result of AB.You may assume that A’s column number is equal to B’s row number.Example:A = [ [ 1, 0, 0], [-1, 0, 3] ]B = [ [ 7, 0, 0 ],
2015-12-28 11:02:50 1294
原创 Leetcode: Generalized Abbreviation
QuestionWrite a function to generate the generalized abbreviations of a word.Example: Given word = “word”, return the following list (order does not matter): [“word”, “1ord”, “w1rd”, “wo1d”, “wor1”,
2015-12-28 00:16:12 1179
原创 Leetcode: Bulb Switcher
QuestionThere are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it’s off or turni
2015-12-27 22:55:35 451
原创 Leetcode: Binary Tree Longest Consecutive Sequence
QuestionGiven a binary tree, find the length of the longest consecutive sequence path.The path refers to any sequence of nodes from some starting node to any node in the tree along the parent-child con
2015-11-20 18:21:40 351
原创 Leetcode: Sliding Window Maximum
QuestionGiven an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding w
2015-11-19 16:04:09 359
原创 Leetcode: Longest Increasing Subsequence
QuestionGiven an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101], t
2015-11-05 13:34:33 257
原创 Leetcode: Longest Substring with At Most Two Distinct Characters
QuestionGiven a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s = “eceba”,T is “ece” which its length is 3.Hide Company Tags Google
2015-11-04 05:58:16 293
原创 Leetcode: Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair:
2015-11-03 16:01:26 257
原创 Leetcode: Edit Distance
QuestionGiven two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a wo
2015-11-02 10:27:28 331
原创 Leetcode: Two Sum
QuestionGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target,
2015-10-26 06:13:09 238
原创 Leetcode: Populating Next Right Pointers in Each Node II
QuestionFollow up for problem “Populating Next Right Pointers in Each Node”.What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant extra
2015-10-25 09:06:24 231
原创 Leetcode: Unique Paths
easy one;A robot is located at the top-left corner of a m x ngrid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach t
2015-10-25 06:22:42 253
原创 Leetcode: First Missing Positive
QuestionGiven an unsorted integer array, find the first missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant
2015-09-25 10:22:06 313
原创 Leetcode: Spiral Matrix II
QuestionGiven an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example, Given n = 3,You should return the following matrix: [ [ 1, 2, 3 ], [ 8, 9, 4 ],
2015-09-19 13:26:14 309
原创 Leetcode: Meeting Rooms
QuestionGiven an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), determine if a person could attend all meetings.For example, Given [[0, 30],[5, 10],[1
2015-09-15 15:41:20 446
原创 Leetcode: Product of Array Except Self
QuestionGiven an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(
2015-09-15 15:21:22 308
原创 Leetcode: Zigzag Iterator
QuestionGiven two 1d vectors, implement an iterator to return their elements alternately.For example, given two 1d vectors:v1 = [1, 2] v2 = [3, 4, 5, 6] By calling next repeatedly until hasNext retur
2015-09-15 15:09:23 498
原创 Leetcode: Shortest Word Distance III
QuestionThis is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as word2.Given a list of words and two words word1 and word2, return the shortest distance betw
2015-09-15 14:51:28 398
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人