自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Sengo的博客

森狗的博客

  • 博客(74)
  • 收藏
  • 关注

原创 leetcode刷题笔记-heap

​​​​​​​。

2018-09-07 09:33:01 1062 1

原创 leetcode刷题笔记-hashtable

939.Minimum Area Rectangle给一些点,找最小的rectangle的面积。方法2比较简单明了。https://leetcode.com/problems/minimum-area-rectangle/solution/380.Insert Delete GetRandom O(1)class RandomizedSet(object): de...

2018-09-07 02:18:45 689 1

原创 leetcode刷题笔记-math

780.Reaching PointsFirst while: x, y comes fromx, k*x+y or x+k*y, yfor each stepSecond:check if we reduce target points to (x, y+kx) or (x+ky, y)class Solution(object): def reachingP...

2018-09-04 05:32:05 784 1

原创 leetcode刷题笔记-string

809.Expressive Wordsclass Solution(object): def expressiveWords(self, S, words): re = 0 def check(W, S): i, j, s, w = 0, 0, len(S), len(W) for i in ...

2018-08-23 23:41:16 890 1

原创 leetcode刷题笔记-后续遍历

332. Reconstruct ItineraryGiven a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man wh...

2018-08-23 05:51:30 397

原创 leetcode刷题笔记-topological sort拓扑排序(DFS)

207.Course Schedule 找环There are a total ofncourses you have to take, labeled from0ton-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, whi...

2018-08-23 04:38:44 1823 1

原创 Leetcode刷题笔记-Tree

Background:https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to t...

2018-08-20 23:12:23 929 1

原创 leetcode刷题笔记-Dijkstra‘s algorithm

Dijkstra's algorithm具体:https://blog.csdn.net/cjc211322/article/details/24933909505.The Maze IIclass Solution(object): def shortestDistance(self, maze, start, destination): des = ...

2018-08-20 22:52:37 8381

原创 leetcode刷题笔记-回溯 Backtracking

140.Word Break IIclass Solution(object): def wordBreak(self, s, wordDict): return self.helper(s, wordDict, {}) def helper(self, s, wordDict, memo): if s in memo: ret...

2018-08-20 03:33:54 608 1

原创 leetcode刷题笔记-stack

255.Verify Preorder Sequence in Binary Search Treeclass Solution(object): def verifyPreorder(self, preorder): if not preorder:return True largerThan = float('-inf') s...

2018-08-20 02:57:49 431

原创 leetcode刷题笔记-DFS and BFS

212.Word Search II在trie分类529.Minesweeper不会点击数字的,所以不用考虑这点class Solution(object): def updateBoard(self, board, click): # 1. 如果是M雷的话,改成X结束 # 2. 如果不是M的话,附近有雷就改成数字结束。否则就是...

2018-08-19 09:07:25 1354

原创 Leetcode刷题笔记,palindromic strings回文

516.Longest Palindromic SubsequenceOne possible longest palindromic subsequence is "bb".class Solution(object): def longestPalindromeSubseq(self, s): """ :type s: str ...

2018-08-18 23:46:44 232 1

原创 Leetcode刷题笔记-dp

44.Wildcard Matchingfunc isMatch(s string, p string) bool { dp := make([][]bool, len(s)+1) // dp[s_idx][p_idx] for i := range dp { dp[i] = make([]bool, len(p)+1) } ...

2018-08-12 03:50:02 1277 1

原创 Leetcode刷题笔记-array

723.Candy Crushclass Solution(object): def candyCrush(self, board): # 只有横着或者竖着连续3个才可以消去。 # 把满足消去的设置为负数,比如2设置为-2,最后再一起消去 r, c = len(board), len(board[0]) fo...

2018-08-04 06:47:35 1602 1

原创 【持续更新】tensorflow学习中的一些笔记

1.指数衰减函数的参数和计算方程:tensorflow提供了一个灵活的学习率设置方法,指数衰减函数tf.train.exponential_decay(),它的计算实现如下: decayed_learning_rate = learning_rate * decay_rate ^ (global_step / decay_steps) 其中decay_rate是衰减系数(取值小于1,比如0.1),...

2018-06-30 10:28:16 340

原创 【机器学习】Moving Averages 滑动平均的原理和直观感知

前言:百度滑动平均的原理出来的都是什么乱七八糟的? 谷歌英文Moving Average一下子就看懂了。于是准备写下来。本文将介绍Simple moving average 和 Exponential Moving Average.背景:滑动平均是用来衡量当前趋势的方向。每种类型的滑动平均(MA)都是一个通过计算过去数据的平均值得到的数学结果。经常用于金融领域的预测,一旦计算出一个平均值结果,就会...

2018-05-31 09:55:56 13502

原创 Ubuntu 新服务器配置整合

前言:经常要配置新的服务器,需要网上查找很多资料还经常是错的或者过时的,趁着现在又要搭2台服务器(一台桌面版,一台客户的云服务器)把需要的步骤写下来方便以后用。其中,inodes节点在最开始挂载硬盘的时候一定要多分配一点,血淋淋的教训。我的经验是100GB硬盘分配1千2百万个节点。目录:一、上传SSH公钥到服务器二、vim设置永久显示行号和中文支持三、Mysql 安装与配置四、P...

2018-05-18 08:28:18 1446

转载 Intrinsic Image Decomposition

Group Member:Shusen WuIntroduction : The idea of intrinsic images was already picked up by Barrow and Tenenbaum in 1978 and is based on the observation that humans are able to derive intrinsic charact...

2018-05-06 08:49:19 4184

原创 【计算机图形】Perlin Noise 实例和理解

Perlin noise一、 背景介绍分形:分形,具有以非整数维形式充填空间的形态特征。通常被定义为“一个粗糙或零碎的几何形状,可以分成数个部分,且每一部分都(至少近似地)是整体缩小后的形状”,即具有自相似的性质。分形(Fractal)一词,是芒德勃罗创造出来的,其原意具有不规则、支离破碎等意义。1973年,芒德勃罗(B.B.Mandelbrot)在法兰西学院讲课时,首次提出了分维和分形的设想。(...

2018-05-01 05:11:05 9784 2

原创 曲线

连续性G0-位置连续G1-切线连续G2-曲率连续G3-曲率变化率连续G4-曲率变化率的变化率连续C−1: Curves are discontinuousC0: Curves are continuousC1: First derivatives are continuousC2: First and second derivatives are continuousCn: First throu...

2018-04-09 03:36:14 385

原创 这两周的浑噩

     这两个礼拜过得太浑浑噩噩了,感觉自己活在半睡半梦半醒中。生活空虚,迷茫,没有方向。没有追求,没有上进心,只想沉迷。     开始一遍遍的听巴赫的曲子,感觉人生充满了悲沉和空虚。所谓闻弦歌而知雅意,我听到的是自己内心的空虚吧?我知道巴赫的曲子既可以放在婚礼上,也适合葬礼的场合。音无此最悲乎?我心中响起的却是葬礼的咏叹调。但是也有轻松俞悦的调,真的很喜欢《加沃特舞曲》,可是空虚仍然挥之不去。...

2018-04-03 07:12:54 225

原创 【computer vision】Stereo Depth Estimation

Introduction:Stereo Vision is a technique aimed at inferring depth from two or more cameras. Stereo matching is the process of taking two or more images and estimating a 3D model of the scene by findi...

2018-03-26 04:07:36 1678

原创 DP回顾篇

前言:知识真的是学习了,总结了,练习了,运用了,再次总结归纳了,但是还是会一点点遗忘。动态规划(DP)又是算法里面非常非常重要的部分,所以一定要再次复习一遍。写这篇博客的时候不由想起上学期算法课上的一个小插曲。老师问有没有喜欢音乐的,一堆人举手。然后老师随便找了个黑人同学上去,让他用手在桌子上拍一首大家都知道的歌的节奏,让全班同学都来猜歌名。(全班70人左右)。拍了半天,有几个同学举手回答...

2018-03-11 04:18:48 331

原创 学习方法

Scott H Young 在一年内修完MIT 4年的33门CS课程,并且之后通过各种实验研究如何高效学习。他开了很多视频讲解具体的高效学习的方式,教学生如何只花费1%的金钱和12个月时间自学完麻省理工CS 4年的课程。TED上可以看到他非常多的视频。他的一个观点我非常赞同,就是我们对某些课程,如数学等,听不懂但是别人却听得懂的时候,不是我们智商比其他人差,而是其他人只是比我们多了一点基础、前置知...

2018-03-11 03:20:48 299

原创 【计算机图形2】实验2: 扫描线填充算法+Z-buffer被00覆盖点消除

前言:通过扫描线算法对多边形面进行颜色随机填充。再使用Z-buffer算法比较重叠物体的点的深度,即对同一个X,Y位置的多个点,选择深度浅的点显示。扫描线算法:对每个物体的表面分别进行扫描线算法,扫描线自底向上,扫描范围为物体的最低点的Y值到最高点的Y值。扫描线每次向上移动1个单位距离(1个像素)。在openGL中,如果我们把画布大小定义为600X600px,画布坐标轴定义为(0,600,0,60...

2018-03-08 13:00:41 1316

原创 【计算机图形2】实验1: 从[世界坐标系]到[相机坐标系]到[透视投影变化]及[隐藏面消除]的计算

前言:本文记录计算机图形2的第一个实验,如何从世界坐标系投影到2D平面上并做隐藏面消除。由于我看的材料(课件及资料)很多都是英文的,因此可能导致英文名词写成中文翻译得不对。从世界坐标系到相机坐标系:这里引用我在GW上这门课的教授James K. Hahn的课件。把世界坐标系转成相机坐标系(如图1),就是把世界坐标系的点一个个转换成以相机(观察点)为原点的坐标系中所在的点。换句话说就是,在世界坐标系...

2018-02-27 13:34:58 1401 1

原创 Project 2 (Computer Vision) : Hybrid Images

OverviewThe goal of this part of the assignment is to create hybrid images using the approach described in the SIGGRAPH 2006 paper by Oliva, Torralba, and Schyns. Hybrid images are static images that ...

2018-02-19 11:48:48 3546

原创 Project 1(Computer Vision): Images of the Russian Empire

BackgroundSergei Mikhailovich Prokudin-Gorskii (1863-1944) was a photographer ahead of his time. He saw color photography as the wave of the future and came up with a simple idea to produce color phot...

2018-02-08 10:49:14 923

原创 Pseudo-polynomial Partition Problem

1       Problem StatementPseudo-polynomialPartitionGiven a set consisting of n integers [a1, a2, …an], you want to partition into two parts so that thesum of the two parts is equal.  Suppose s =  

2017-12-04 09:51:48 437

原创 顶点覆盖问题的NP完全证明(Proving NP-completeness of Vertex Cover)

顶点覆盖问题(Vertex Cover Problem):即在给定的图中,找出最小规模的顶点覆盖。如:给定图G, 它的顶点覆盖为V的子集V', 任意(u,v)属于V构成的边e, 必有至少一点属于覆盖点集合V'。如图,白色的点为即该无向图的顶点覆盖。

2017-11-24 06:25:40 4520

原创 EAP(6110)作业系统launchpad之开挂做题

EAP的作业非常多,本文将带领你如何飞一样的直接获取Launchpad上prof布置的题目答案,甚至直接修改成绩!希望同学们不要举报我提供这种“作弊”的方法。本文仅供参考学习,大家有时间做还是尽量自己做题吧。方法一. 针对Exercises 这种题型登入Launchpad之后,对同一份Exercises的作业打开2次,即有2个同一份作业的窗口。然后在窗口1中直接点击“sub

2017-11-24 06:01:59 903

原创 python基于protobu+websocket+tornado实现多种二进制协议消息的接收发送和解析demo

protobuf方面资料实在少,中文资料更少。由于公司需要,自己看文档写了一个demo代码放到 :https://git.oschina.net/sengo/ws_protobuf说明:demo自定义了5种protobuf消息, 用户发送消息时,通过把定义的protobuf消息类型编号(4字节 int32)和 接收方的用户ID(4字节 int32) 写入二进制protobuf头部,

2017-04-30 23:46:08 3201

原创 python:多线程+队列Queue 实现:生产者和消费者demo

# -*- coding: UTF-8 -*-# __author__ = 'Sengo'import Queueimport threadingimport timeclass BookThread(threading.Thread): def __init__(self, thread_id, q, func): threading.Thread.__in

2017-04-26 14:55:28 5977

原创 记一次xss攻击尝试(厦门工学院网站)附代码

厦门工学院网站xss跨站攻击尝试。

2017-03-15 23:25:23 1005

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除