- 博客(54)
- 收藏
- 关注
转载 a nice article about /dev/urandom vs /dev/random
original post at: http://www.2uo.de/myths-about-urandom/ Myths about /dev/urandomby Thomas HühnThere are a few things about /dev/urandom and /dev/random that are repeated again and again. Stil
2015-09-09 02:37:42 817
原创 port forwarding in yosemite, a way to replace ipfw
Mac OS Yosemite disabled ipfw command, we need use pf rule to work around it. This article is a manual to describe how to address this issue.
2014-10-25 05:02:23 1296
转载 The Best Interview Questions for Would-be C++ Programmers
The Best Interview Questions for Would-be C++ Programmershttp://community.topcoder.com/tc?module=Static&d1=tutorials&d2=tenBestQuestionshttp://community.topcoder.com/tc?module=Static&d1=tutorials&
2013-10-24 13:41:37 875
转载 Java is Pass-by-Value, Dammit!
THIS ARTICLE CONFIRMS MY UNDERSTANDING ON JAVA. ENJOY IT.original post: http://javadude.com/articles/passbyvalue.htm----------------------------------------------------------------------------
2013-10-17 02:55:09 810
原创 Add mappings to an Elasticsearch index in realtime
Changing mapping on existing index is not an easy task. You may find the reason and possible solutions in here:http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/to get
2013-10-15 05:05:13 2002 1
原创 Elasticsearch template configuration
Index templates allow defining templates thatwill automatically be applied to new indices created. The templates may include(1) settings, (2) mappings, or (3) a simple index pattern template thatcontr
2013-10-15 04:51:56 2026
原创 整形数组找回路
一个整形数组,存储的是下一跳的位置,就像指针一样。比如A[0]=2 A[1]=3 A[2]=1 A[3]=1 A[4]=3就这么跳:0 2 1 3 1 3...,于是找到了一个loop,长度为2,由1、3这两个元素组成。题目就是给出这样的数组,返回loop长度。要求O(N) time,O(1) space.int findLoop(int* arr, int a
2013-08-24 04:31:01 797
原创 shallow copy and deep copy (浅拷贝 vs 深拷贝)
a.浅拷贝(Shallow Copy):只复制对象的基本类型,对象类型,仍属于原来的引用。 b.深拷贝(Deep Copy):不仅复制对象的基本类,同时也复制原对象中的对象.完全产生新对象。也就是说,shallow copy 只会拷贝原值,对于指针指向的内存空间,也仅仅拷贝其地址。而deep copy不仅拷贝原值,对于指针指向的内存空间,也做嵌套复制。The default cop
2012-10-15 08:25:50 739
原创 建堆的算法复杂度分析 O(n)
代码:template inline void MaxHeap::make_heap(vector & v) { if (heap_.size() != 0) heap_.clear(); heap_ = v; // start with last parent, and reheapify_down back to root for (int i = parent(v.size
2012-10-11 05:18:30 7400 2
原创 Career Cup 150 (version 4.0) C++ Solution (Git Repositories)
CareerCup 150 :欢迎一起解题练习,在github上建了Repositories,有兴趣就来fork吧: https://github.com/mitkook/Career-Cup-CPP-Solutions.gitThis project try to implement career cup 150 (ver. 4.0) exercises using C++.
2012-08-30 00:47:10 2791
转载 数组找missing元素
大小N的数组有 N-k个不同的数, 范围0-N, 找missing要求用O(1) space发信人: longway2008 (longway2008), 信区: JobHunting标 题: Re: 问个题:大小N的数组有 N-k个不同的数, 范围0-N, 找miss发信站: BBS 未名空间站 (Fri Apr 6 07:07:24 2012, 美东)
2012-04-06 23:10:58 933
原创 maximum subarray
经典面试题Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4
2012-04-06 13:34:24 1246
转载 Edit Distance
有两个字符串s 和 u, 问最少的步数从s转换倒u。转换的方法,从s任意取一个substring,然后可以执行以下三种操作Insert one letter to any end of the string.Delete one letter from any end of the string.Change one letter into any other on
2012-04-04 12:25:43 584
转载 两个大数相乘
两个大数相乘 char* multiply(char*,char*);给了两个字符串,每个都是代表了一个很长的10进制表示的数比如 char str1[] = "23456789009877666555544444"char str2[] = "346587436598437594375943875943875"最后求出他们的乘积string multiply(st
2012-04-03 22:42:28 715
转载 找公共次数最多的点
giving lots of intervals [ai, bi], find a point intersect with the most number of intervals要nlogn的解法【 在 utar (由它) 的大作中提到: 】: 把所有ai, bi合起来排序每点保留记号标明是a还是b,2nlog(2n)(还算O(nlogn)吧),然: 后从头扫描
2012-04-02 23:02:32 783
转载 众数问题
How to find if a number is present >= (n / 2) times in an array of sizen? 关于这个题目,有没有时间复杂度是O(n),空间复杂度是O(1)的解?solution by swanswan @ MitBBSint number=a[0];int count=1;for (int i=1; i<n; i+
2012-04-01 03:10:02 588
转载 Rotating an array in place
发信人: swanswan (swan), 信区: JobHunting标 题: Rotating an array in place发信站: BBS 未名空间站 (Thu Mar 29 02:00:55 2012, 美东)0 1 2 3 4 5 6 7 (N=8, k=3)->3 4 5 6 7 0 1 2leetcode上那个要移动2N次,写了个只要移动N次
2012-04-01 00:28:26 457
原创 稳定排序问题,要求O(n)时间,O(1)空间
问题:微软: 给定一个 Integer Array,只有正数和负数。使让所有正数排在所有负数后面,所有正数间相对位置不变,所有负数间相对位置不变。要求 In-Place,空间复杂度 O(1)。Facebook:一个记录数组,每个记录的关键字是0,1,2三个数中的一种,要求将数组按关键字排序。要求算法是稳定排序,O(n)时间,常数空间。Amazon:一个数组,包含positive
2012-03-21 13:28:35 1563
原创 Longest Subarray with Equal "1" and "0"
Problem: Given an array that only contains "1" and "0", find the longest subarray which contains equal number of "1" and "0".Solution: With hash table, we can have a O(N) solution. The detail is a
2012-03-21 10:37:20 747
原创 Backtrack 4: Crack WPA2
Normal 0 7.8 pt 0 2 false false false EN-US ZH-CN X-NONE
2010-04-05 09:10:00 1890 2
转载 用wine实现MS-Office2007安装
原帖地址: http://forum.ubuntu.org.cn/viewtopic.php?f=35&t=145516&p=902735&hilit=+wine+office#p902735 先说说闲话: 其实早在2004年就开始接触ubuntu,可是直到昨天才在xiooli帮助下,真正把她安到我的电脑上。哈哈:lol:
2009-02-12 01:35:00 5530
原创 Some phrases on Sept. 25, 2008
1. sb. have played an increasing role both in A and B.2. it is our belief however that ... 3. concrete examples of this are provided by ...
2008-09-26 05:25:00 483
转载 JAVA获取随机数
在Java中我们可以使用java.util.Random类来产生一个随机数发生器。它有两种形式的构造函数,分别是Random()和Random(long seed)。Random()使用当前时间即System.currentTimeMillis()作为发生器的种子,Random(long seed)使用指定的seed作为发生器的种子。 随机数发生器(Random)对象产生以后,
2007-04-12 14:21:00 910
转载 hibernate 带条件外关联检索的方法
原文地址: http://blog.csdn.net/jxc/archive/2006/12/29/1467550.aspx想在hibernate里实现如下SQL:select * from t_join_a a left outer join t_join_a_b c on a.a_id = c.a_id and c.b_id = b2 where a.a_name is n
2007-01-16 15:44:00 1781 1
转载 List元素的几种for循环方式及其点评
编码中经常碰到for语句遍历List并处理其中每个元素的情况,此时有以下几种写法,每种写法各有优缺。第一种写法......for (int i=0 ; i//循环体}......第二种写法......int listSize=list.size();for (int i=0 ; i//循环体}......第三种写法......for (int i=0,int listSize=list.size(
2007-01-05 15:45:00 1424
转载 字符集编码问题研究
问题研究--字符集编码1. 概述本文主要包括以下几个方面:编码基本知识,java,系统软件,url,工具软件等。在下面的描述中,将以"中文"两个字为例,经查表可以知道其GB2312编码是"d6d0 cec4",Unicode编码为"4e2d 6587",UTF编码就是"e4b8ad e69687"。注意,这两个字没有iso8859-1编码,但可以用iso8859-1编码来"表示"。
2007-01-02 13:00:00 790
转载 解决中文乱码问题
由于近来在本站看见N人问中文问题,为了帮大家解决。现将解决中文问题方法列出如下,*注:并非原创,此乃平时用时收集*。一、中文问题的来源 计算机最初的操作系统支持的编码是单字节的字符编码,于是,在计算机中一切处理程序最初都是以单字节编码的英文为准进行处理。随着计算机的发展,为了适应世界其它民族的语言(当然包括我们的汉字),人们提出了UNICODE编码,它采用双字节编码,兼容英文字符和其它民族
2007-01-02 12:55:00 1035
转载 html:link中的name,paramId,paramName和paramProperty四个属性的使用心得
看了一些使用html:link的文章,大多只是说了paramId结合paramName和paramProperty的使用。下面将会用到name,paramId,paramName和paramProperty一起使用的效果。首先是先解释简单的应用paramId,paramName和paramProperty点击链接假设在scope范围中,有一个bean叫beanName,beanNa
2006-12-30 20:03:00 3623
转载 [JSP+Struts]文本内容的换行显示问题
1、直接保存,然后当从数据库中取出来时用过滤方法过滤一遍再送回页面即可,给一段代码,看了就明白了,可以自己扩充public static String filter(String value) ...{ if (value == null) return (null); StringBuffer result = new StringBu
2006-12-30 01:21:00 2274
转载 Hibernate操作视图实例
开发环境:Eclipse3.2+MyEclipse5.01GA;框架使用:Struts+Spring+Hibernate在Employee数据库中有三个表:EmployeeInfo(员工信息表)、Depts(部门表)、Business(职务表)EmployeeInfo表结构:emp_id主键emp_nameemp_sexemp_ageemp_dept存储dept_idemp_business存储b
2006-12-28 13:09:00 1856
原创 NS2 Data Collections by mitkook
原发表在偶的Opera Blog: http://my.opera.com/mitkook/blog/show.dml/354188Collected by mitkook!NS2在Windows下的安装,参看该页面(最好Cygwin也在此页面上下载):http://140.116.72.80/~smallko/ns2/setup_en.htm有什么疑问多看看这个论坛上的帖子:http://w
2006-12-22 10:50:00 3281 2
原创 JSP/Struts中文乱码问题
问题描述:JSP页面:html:form method="GET" action="Search.do"> html:text property="name" /> html:submit />html:form>Form类: ... public String getName() ...{ return name; } public vo
2006-12-21 19:42:00 1265
原创 一些有用的JADE代码
Naming a new containerRuntime rt = Runtime.instance(); // Get a hold on JADE runtime Profile p = new ProfileImpl(); // Create a default profile p.setParameter(Profile.CONTAINER_NAME, "your-cont
2006-12-13 17:12:00 2443
转载 去掉右键显卡选项
810、815[maybe 845]芯片组主板集成显卡安装驱动后,右键点击桌面时菜单显示迟缓的问题 去掉Intel集成显卡的桌面右键菜单: 运行里输入:regsvr32 /u igfxpph.dll 恢复使用运行里输入:regsvr32 igfxpph.dll
2006-12-13 12:34:00 1857
原创 Non-Agent与Agent之间的通信
作者:Kelemen Viktor 原帖地址:http://avalon.tilab.com/pipermail/jade-develop/2006q4/009553.html原文如下:Dear JadersI made a short description about how i used the JadeGateway class.It covers a quite simple s
2006-12-08 20:11:00 1455
转载 JADE Development Plug-in for Eclipse (EJADE)
源地址:http://dit.unitn.it/~dnguyen/ejade.htmlEJADE provides the following features: Deploy JADE agents, just select (multiple selections allowed) JAVA agent files anywhere in your project, rig
2006-12-08 10:36:00 2493
原创 有关JADE开发技术的新闻组
官网: http://avalon.tilab.com/pipermail/jade-develop/ 加入讨论组地址:http://avalon.cselt.it/mailman/listinfo/jade-developNabble 新闻组:http://www.nabble.com/JADE-%28Java-Agent-DEvelopment-Framework%29-f2619.htm
2006-12-08 10:14:00 1161
转载 Start remote agent
// create the containerid of this containerContainerID myContainerID; for(ContainerID cid:getContainerIDs())...{ try ...{ if (cid.getName().equals( getContain
2006-12-08 09:55:00 956
转载 Struts中Logic逻辑标签的作用及用法
数值比较标签集简单比较变量是否不等于指定的常量:简单比较变量是否大于或等于指定的数值:比较变量是否大于指定的数值:比较变量是否小于或等于指定的数值:比较变量是否小于指定的数值:以上六个标签都是用于比较数值的标签字符串比较的标签:判断变量中是否包含指定的字符串常量判断变量中是否不包含指定的字符串常量这两个标签中有一个location属性,其值有二:start,end。说明了指定的字符串是在变量的起始
2006-12-06 20:02:00 1539
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人