自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

泥瓦匠的专栏

记录点滴

  • 博客(67)
  • 资源 (5)
  • 收藏
  • 关注

原创 809. Expressive Words

Sometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii".  Here, we have groups, of adjacent letters that are all the same character, and adjac...

2018-05-02 14:24:57 487

原创 808. Soup Servings

There are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations:Serve 100 ml of soup A and 0 ml of soup BServe 75 ml of soup A and 25 ml...

2018-05-02 13:44:57 320

原创 807. Max Increase to Keep City Skyline

In a 2 dimensional array grid, each value grid[i][j] represents the height of a building located there. We are allowed to increase the height of any number of buildings, by any amount (the amounts can...

2018-05-02 12:42:36 246

原创 806. Number of Lines To Write String

We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units, it...

2018-05-01 13:51:17 135

原创 805. Split Array With Same Average

In a given integer array A, we must move every element of A to either list B or list C. (B and C initially start empty.)Return true if and only if after such a move, it is possible that the average va...

2018-05-01 13:14:31 310

原创 Markdown 语法解析

基本技巧代码如果你只想高亮语句中的某个函数名或关键字,可以使用 `function_name()` 实现通常编辑器根据代码片段适配合适的高亮方法,但你也可以用 ``` 包裹一段代码,并指定一种语言```javascript$(document).ready(function () { alert('hello world');});```支持的语言:1c, abnf, accessl...

2018-04-16 13:36:31 1265

原创 [leetcode 804] Unique Morse Code Words

International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on.For

2018-04-16 12:39:26 162

原创 [leetcode 803] Bricks Falling When Hit

We have a grid of 1s and 0s; the 1s in a cell represent bricks.  A brick will not drop if and only if it is directly connected to the top of the grid, or at least one of its (4-way) adjacent bricks wi...

2018-04-16 10:38:24 850

原创 [leetcode 802] Find Eventual Safe States

In a directed graph, we start at some node and every turn, walk along a directed edge of the graph.  If we reach a node that is terminal (that is, it has no outgoing directed edges), we stop.Now, say ...

2018-04-16 09:24:17 535

原创 [leetcode 801] Minimum Swaps To Make Sequences Increasing

801. Minimum Swaps To Make Sequences IncreasingWe have two integer sequences A and B of the same non-zero length.We are allowed to swap elements A[i] and B[i].  Note that both elements are in the same...

2018-04-16 08:14:18 343

原创 YAML 语法浅析

YAML简介:YAML是“YAML不是一种标记语言”的外语缩写;但为了强调这种语言以数据做为中心,而不是以置标语言为重点,而用返璞词重新命名。它是一种直观的能够被电脑识别的数据序列化格式,是一个可读性高并且容易被人类阅读,容易和脚本语言交互,用来表达资料序列的编程语言。在线编辑器,可以将YAML 转换为JSON 或Python 的output。语法特性1,使用缩进来表示层级关系, 且禁止使用tab...

2018-04-16 03:23:43 2072

原创 Leetcode[4] Median of Two Sorted Arrays

There are two sorted arraysA and B of size m and n respectively. Find the median of the two sorted arrays.The overall run time complexity should be O(log (m+n)).C++版本double findMedianSortedArr

2015-05-07 22:30:13 359

原创 Leetcode[3] Longest Substring Without Repeating Characters

Given astring, find the length of the longest substring without repeating characters.For example, the longest substring without repeating letters for"abcabcbb" is "abc", which the length is 3. For"bbb

2015-05-07 21:41:59 384

原创 Leetcode[2] Add Two Numbers

You are given two linkedlists representing two non-negative numbers. The digits are stored in reverseorder and each of their nodes contain a single digit. Add the two numbers andreturn it as a linke

2015-04-29 11:30:46 306

原创 Leetcode[1] Two Sum

Givenan array of integers, find two numbers such that they add up to a specifictarget numberThefunction twoSum should return indices of the two numbers such that they addup to the target, whereind

2015-04-28 17:17:20 323

转载 跨平台系统栈的增长方向判断

对于一个用惯了i386系列的机器,跨硬件平台是这个问题的首先要考虑到的因素。C是一个不错的选择。那接下来的问题就是如何用C在哪里会用到栈呢?稍微了解一点等一下,怎么比较两个变量的地址呢?“先声明的先入栈那就函数加个参数,比较参数和局部变量的位置,参数肯定先入栈。那为什么不能局部变量先入栈?第一反应是怎么可能,但仔细想来又没有什么不可以。所以,这种方法也依赖于编译器的实现。不妨回想一

2014-09-13 10:24:31 536

转载 iperf使用

Iperf使用方法 Iperf  是一个网络性能测试工具。Iperf可以测试TCP和UDP带宽质量。Iperf可以测量最大TCP带宽,具有多种参数和UDP特性。Iperf可以报告带宽,延迟抖动和数据包丢失。  Iperf使用方法与参数说明   参数说明 -s   以s

2014-04-18 11:20:40 805

转载 ubuntu下安装Apache+PHP+Mysql

转载:http://www.cnblogs.com/lynch_world/archive/2012/01/06/2314717.html电影《社交网络》中,facebook创始人马克.扎克失恋后入侵哈佛大学宿舍楼服务器,窃取数据库资料,并在两个小时内完成了一个给校内女生评分的交互网站,该网站一天内点击数过10W,直接导致学校服务器崩溃。。。。。。 其实,构建那样一个网站并不需要很多高

2014-01-06 09:02:31 412

原创 SPECjvm2008的安装测试

$ java -jar SPECjvm2008_1_01_setup.jar -i console

2013-10-30 10:29:41 7445

转载 Linux命令行下编辑常用的快捷键

Linux命令行编辑快捷键:history显示命令历史列表↑(Ctrl+p)显示上一条命令↓(Ctrl+n)显示下一条命令!num执行命令历史列表的第num条命令!!执行上一条命令!?string?执行含有string字符串的最新命令Ctrl+r然后输入若干字符,开始向上搜索包含该字符的命令,继续按Ctrl+r,搜索上一条匹配的命令C

2013-10-25 09:33:00 717

转载 STL 中list的sort函数实现

详细道来:fill ------> 2^fill 表示现在能处理的数据的最大数目counter[ fill ]---> 将处理完的2^fill个数据存入 counter[ fill ]中carry---> 就像一个临时中转站, 在处理的数据不足 2 ^ fil l时,在counter[ i ] ( 0=步骤如下: 1) 读入一个数据(carry.splice),通过 car

2013-10-22 09:10:07 637

原创 window+fedora19 grub修复问题

昨天在window下面重新分了一下区,结果导致重起时,因为系统的盘符发生了改变,fedora的grub被破坏。修复方式:grub> lsgrub> ls (hd0,9) /这时你会发现在/下有grub2/选择grub > set root=(hd0,9)grub > set prefix=(hd0,9)/grub2/grub>insmod normalgrub>

2013-10-17 09:14:13 1048

转载 Eclipse下配置主题颜色

对于长期做开发的哥们来说,过于明亮的背景色会导致视觉疲劳,从而致使效率各种下降、困意各种来袭。为了有效阻止这种可怕的事情发生,我们需要改变背景色!  OK,这篇博客主要讲解如何设置eclipse软件的背景色:  1、下载一个eclipse的软件,注意32位和64位的区别,当然了 越新的版本,我们需要下载的东西就会少很多。软件下载地址:http://www.eclipse.org/d

2013-10-12 22:08:19 773

转载 【Google】25匹马的角逐

(1) 首先将25匹马分成5组,并分别进行5场比赛之后得到的名次排列如下:              A组:  [A1  A2  A3   A4  A5]              B组:  [B1  B2  B3   B4  B5]              C组:  [C1  C2  C3  C4  C5]              D组:  [D1  D2 

2013-10-10 10:46:02 527

转载 C语言位段

1.位段结构中位段的定义格式为:unsigned :例如:struct bytedata{unsigned a:2; /*位段a,占2位*/unsigned:6; /*无名位段,占6位,但不能访问*/unsigned:0; /*无名位段,占0位,表下一位段从下一字边界开始*/ unsigned b:10; /*位段b,占10位*/int i;

2013-10-07 22:55:33 467

转载 C++ explicit关键字的含义

C++ explicit关键字基本内容概述C++ explicit关键字的作用主要就是用来修饰类的构造函数,用来表明这一构造函数是显式的。我们将会在这里为大家详细介绍相关内容。在C++编程语言中,各种关键字的应用在实际编程中是非常重要的一个基础操作。对于初学者来说,我们需要在学习和实践中对这一基础应用技巧进行充分的掌握。C++ explicit关键字用来修饰类的构造函数,表

2013-09-09 15:12:24 1912

原创 GNU nano使用简要说明

Nano是一个简单的没有花梢及华丽效果的文本编辑器。Nano在做简单文本文件编辑时相当不错,,可以满足一些基本操作.直接在命令行模式下输入nano 文件名,就可以对文件进行简单的编辑。文件编辑中常用快捷键:ctrl+X 离开nano软件,若有修改过的文件会提示是否保存;ctrl+O 保存文件;   ctrl+W 查询字符串;ctrl +C 说明目前光标所在处的行数和

2013-08-26 21:05:38 20755

原创 Linux下定制VirtualBox中windows8的分辨率

首先搜索找到dir为“VirtualBox VMs”,进入后,执行命令:VBoxManage setextradata "win8XXXX" CustomVideoMode1 1680x1050x32此处"win8XXXX"为构建虚机时起的名字。后面的参数应根据实际显示器的分辨率进行调节.需要注意的是,后面使用小写x而不是*否则出问题。

2013-08-06 23:21:28 799

原创 ubuntu 下maven+eclipse安装测试

1.安装 maven ,下载地址:http://maven.apache.org/download.cgi 下载3.1.0版本2.解压到制定路径下,这里选择/usr/local/java/apache-maven-3.1.0。3.链接 到/usr/bin/mvn : ln -s /usr/local/java/apache-maven-3.1.0/bin/mvn /usr/bin/mvn

2013-08-05 22:31:37 12529

原创 Hadoop 伪分布模式下关机后,fs端口连接不上问题解决方案

总是报出异常如下所示:13/07/24 09:14:24 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepT

2013-07-24 09:34:03 2842

原创 Ubuntu13.04下搭建Hadoop+Eclipse开发环境

1.下载hadoop包:wget http://www.fightrice.com/mirrors/apache/hadoop/common/hadoop-1.2.0/hadoop-1.2.0.tar.gz

2013-07-23 10:29:53 1208

原创 Ubuntu13.04下安装jdk

1.下载jdk,网址http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html2.将下载好的tar包解压到/usr/local/java/目录下  tar zxvf eclipse-jee-kepler-R-linux-gtk.tar.gz3.编辑/etc/profile文件,添加环

2013-07-21 22:41:07 1612

转载 python虚拟环境-virtualenv

1.virtualenv简介VirtualEnv用于在一台机器上创建多个独立的python运行环境,类似于一个个沙盒环境。作用:隔离项目之间的第三方库依赖,如A项目依赖xxx1.1,B项目依赖xxx1.2。为部署应用提供方便,把开发环境的虚拟环境打包到生产环境即可,不需要在服务器上再折腾一翻。尝试新的第三方库,而不用担心污染系统环境。在沒有权限的情況下安装新组件

2013-06-07 16:38:56 2816 1

转载 Paste deploy &Python

帮助文档http://pythonpaste.org/deploy/module-paste.deploy.htmlPaste Deployment是用于发现和配置WSGI appliaction和server的系统。对于WSGI application用户提供一个单独的简单的函数(loadapp),用于从配置文件或者python egg中加载WSGI application。因为WSGI

2013-05-24 14:14:05 1834

转载 Python 的列表排序(用 operator 函数进行多级排序)

在 Python 中, 当需要对一个 list 排序时, 一般可以用 list.sort() 或者 sorted(iterable[, cmp[, key[, reverse]]]).其中:cmp(e1, e2) 是带两个参数的比较函数, 返回值: 负数: e1 e2. 默认为 None, 即用内建的比较函数.key 是带一个参数的函数, 用来为每个元素提取比较值. 默认为 None

2013-05-22 22:38:48 2891

原创 Python 导入自定义的package

例如test1.py 要用到文件test2.py中的函数。可以将test2.py封装为一个类,通过import 导入到test1.py中。具体做法:如果test1.py和test2.py在同一级别的目录中,则直接 : import test2即可如果在test2.py在文件夹 temp中,而temp和test1.py在同一级别的路径中,则需要在temp文件夹中,创建一个文件__init

2013-05-22 11:23:30 1040

原创 使用mulitiprocessing 进行多进程非阻塞

#!/usr/bin/env pythonfrom multiprocessing import Processimport osimport timedef sleeper(name, seconds): print 'starting child process with id: ', os.getpid() print 'parent process:', os.get

2013-05-15 23:09:09 1372

原创 python os.open()方法

os.O_RDONLY   以只读的方式打开 Read onlyos.O_WRONLY   以只写的方式打开 Write onlyos.O_RDWR     以读写的方式打开 Read and writeos.O_APPEND  以追加的方式打开  os.O_CREAT   创建并打开一个新文件os.O_EXCL     os.O_CREAT| os.O_EXCL 如果指定的文

2013-05-08 15:09:13 11875

原创 python实现进程单例(系统级文件加锁)

import fcntlpid_file ='program.pid'fp = open(pid_file,'w')try:    fcntl.lockf(fp, fcntl.LOCK_EX | fcntl.LOCK_NB)exceptIOError:    # another instance is running    sys.exit(0)另外fcntl.fl

2013-05-08 15:05:45 3001

原创 关于python文件操作

1.python中对文件、文件夹(文件操作函数)的操作需要涉及到os模块和shutil模块。得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd()返回指定目录下的所有文件和目录名:os.listdir()函数用来删除一个文件:os.remove()删除多个目录:os.removedirs(r“c:\python”)检验给出的路径是否

2013-04-27 19:08:38 473

中文停用词表

比较全面的中文分词停用词表词表,配合其他的分词工具使用效果不错

2012-12-23

编写自己的网络嗅探器WinPcap+MFC

编写自己的网络嗅探器WinPcap+MFC 实现类似于WireShark和Sniffer类似的功能。使用C++及MFC进行实现

2012-10-22

ice分布式程序设计中文版

ice分布式程序设计,不错的ice学习文档。

2011-12-20

simsun.ttc

用于解决wine乱码问题,解决不了的,站内联系.

2011-12-20

Maven权威指南-中文版

不错的maven学习书籍,适合刚入门和对maven有研究需求的人。

2011-12-20

空空如也

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

TA关注的人

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