Changchun Master Li

一个玩坏的JavaScript面试题

programming
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var o = (function() {
var person = {
name: 'Vincent',
age: 24
};
return {
run: function(k) {
return person[k];
}
}
})();

// TODO 在不改变上面代码的基础上,并且在只知道 person 是一个对象的基础上
// 只能在本段注释后面继续写代码,最终通过 o 打印出 person ,对于上文中的 person 即 `Object {name: "Vincent", age: 24}`
// 例如 o.someThing = 1; cosnole.log(o.run('someThing'));
// 在考虑到 person 为未知对象的基础上,尽可能写出更加完善的代码。
// 最终,如果不能完成该题,请尽可能的记录下来你思考的过程。

Read more

有序对的js实现

programming

有序对的作用是存储两个值,并在之后根据需要再次提供

1
2
3
PAIR = -> x { -> y { -> f { f[x][y] } } }
LEFT = -> p { p[ -> x{ -> y { x } }] }
RIGHT = -> p { p[ -> x{ -> y { y } }] }

(摘自《计算的本质,深入剖析程序和计算机 Understanding ComputationFrom Simple Machines to Impossible Programs》)

Read more

leetcode 239. Sliding Window Maximum

algorithm leetcode

Python暴力通关

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
ret = []
length = len(nums)
if 0 == length:
return []
w = length - k + 1
for i in range(w):
m = max(nums[i:i+k])
ret.append(m)
return ret
Read more

leetcode 126. Word Ladder II

algorithm leetcode
123456789101112131415161718192021222324252627282930313233343536373839404142import stringimport collectionsclass Solution(object): def findLadde ...
Read more

离散随机变量的相对熵和机器学习
KL divergence and Machine Learning

统计学习

目录

  • 熵和交叉熵 基础
  • 相对熵 性质
  • 证明一 Infomation inequality(信息不等性)
  • 证明二 KL and maximum likelihood(极大似然估计相对熵最小)
Read more

we are team

jlu

挂他一科又何妨?

Read more

LeetCode Word Pattern

algorithm leetcode

leetcode

Read more

remove-duplicates-from-sorted-list-ii

algorithm leetcode

leetcode

Read more

推荐一本书 -> Linux Sea

Linux Gentoo

在桌面领域

Linux的并不擅长,市场占有率约为3%。然而,你很可能认识几个执着使用Linux的人。如果你考虑过,你估计比大多数人更了解个人操作系统的偏好。

Read more

An Introduction to Machine Learning Theory and Its Applications

统计学习

Machine Learning (ML) is coming into its own, with a growing recognition that ML can play a key role in a wide range of critical applications, such as data mining, natural language processing, image recognition, and expert systems. ML provides potential solutions in all these domains and more, and is set to be a pillar of our future civilization.

Read more
Prev Next