日志计算驱动业务增长 让天下没有难分析的日志
<span style="color:rgb(55,55,55); font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; line-height:24px; background-color:rgb(255,255,255)">主线程在写 syslog,同时在信号处理函数中也在写syslog,当主线
<div> <p style="orphans:2; widows:2; border:0px; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; margin-top:0px; margin-bottom:1.625em; outline:0px; padding-top:0px; padd
<br><br> 一个string对象的读操作是线程安全的么?答案是否定的。读取一个string在某些情况下是线程不安全的。这是为什么呢?原因就是string在优化存储空间时采用的策略cow。<br><br><br> 什么是cow<br><p> Cow 是copy on write的缩写。String 为了减少内存拷贝,当两个string对象的内容相同时,他们指向同一块内
<p>rpmbuild 可以把源文件或者二进制文件打包成rpm包,rpm包可以放到源上进行分发。</p> <p>执行rpmbuild --showrc |grep topdir,可以找到rpmbuild 执行的根目录,<br></p> <p>如果仅仅希望给把二进制文件打包成rpm包,那么把二进制文件放到 $topdir/BUILD/ 目录下。</p> <p>编写${binary}
<p>最近有个项目,一个deamon进程,一个干活进程。deamon 进程会捕获SIGCHLD信号如果干活进程down掉了,deamon会收到这个信号并且重新fork干活进程。</p> <p>最近发现一个问题是 deamon进程fork了好几个干活进程。团队的人调查问题,一度怀疑是不同的linux内涵对信号处理不同。后来我发现如果干活进程调用了system函数,system会fork一个
<p>error: is private<br></p> <p>如果添加了friend之后,还是报错的话。不妨看看是不是名字空间搞错了。</p>
kindle的显示器采用e-ink技术,相对于液晶屏而言,其最大的好处是不伤眼。<br> 本文把kindle dxg作为电脑的显示器。<br> 基本步骤<br> 1:越狱。<br> 越狱的文件在:<br> http://www.mobileread.com/forums/showpost.php?p=973688&postcount=1<br> 把越狱用的文件放在kin
<p>for some reason , the java can not be installed like before.</p> <p>in this version of ubuntu, java should be installed like this:</p> <p>1:sudo apt-add-repository ppa:flexiondotorg/java<br><
<p>这个错误,一般是重复引用造成的。</p> <p>可以考虑两点。</p> <p>1:</p> <p>头文件是否有#ifndef控制</p> <p><br></p> <p>2:</p> <p>头文件中是否有函数的定义或者全局变量的定义。</p> <p><br></p>
囧。scons陷入了死循环
因为,成员函数有一个隐含的this指针。
<p>在类中声明友元函数,如果类和友元函数不在同一个名字空间中的话,声明时必须指明是哪个名字空间的函数。</p> <p><br></p> <p>namespace oa</p> <p>{</p> <p>class c{</p> <p> friend void :: func();</p> <p>};</p> <p>}</p> <p>void func()();</p>
<p></p> <p> 好久没作usaco了。过了个年,人都懒了。</p> <p><br> Betsy's Tour<br> Don Piele <br> A square township has been divided up into N2 square plots (1 <= N <= 7). The Farm is located in the upper
偶然发现了这么一个反编译的插件:jadeclipse。
<p>最近在做一个项目,要求程序在后台运行是能够拦截到按键信息。</p> <p>但是,在ddl里边给对话框发送消息总是不成功。检查了一天,看了很多人写过的程序,还是不得要领。最后突然想到,sendmessage和postmessage的作用是一样的,只不过前者是阻塞,后者异步而已。于是换成了后者,果然成功了。</p>
面向对象的几个问题。<br> 1.如果是虚函数override的话,两个函数的原型必须完全的一致,包括函数名字,参数数目和类型,还有返回类型以及是否是const。<br> 如果两个函数,除了返回类型之外都完全一致的话,那么会出想编译错误。如果参数或者const不一致,那么就是两个函数。父类指针查找的时候是不会找到子类的。<br> 2.如果不是虚函数,当子类的某个函数和父类的函数名
<p>5<br> <br> Big Barn</p> <p>A Special Treat<br> Farmer John wants to place a big square barn on his square farm. He hates to cut down trees on his farm and wants to find a location for his
<p>c++和java的区别<br> 一群写机顶盒程序的人在用c++写程序的时候感觉C++太过于琐碎,于是发明了java<br> 1:c+程序直接运行于OS上;java程序运行于jvm上<br> 2:执行效率,c++明显比java要快很多,因为java是通过运行在虚拟机上的。<br> 具体事例请查看上一篇博客,那个程序是java写的。<br> 3:java一次编译,处处运行。c
<p> <br> Network of Schools<br> IOI '96 Day 1 Problem 3 <br> A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a
<p> <br> Milk Measuring<br> Hal Burch <br> Farmer John must measure Q (1 <= Q <= 20,000) quarts of his finest milk and deliver it in one big bottle to a customer. He fills that bottle wit
<p> <br> Pollutant Control<br> Hal Burch <br> It's your first day in Quality Control at Merry Milk Makers, and already there's been a catastrophe: a shipment of bad milk has been sent out. Unfo
<p> <br> Shuttle Puzzle<br> Traditional <br> The Shuttle Puzzle of size 3 consists of 3 white marbles, 3 black marbles, and a strip of wood with 7 holes. The marbles of the same color are place
<p>Buy Low, Buy Lower</p> <p>The advice to "buy low" is half the formula to success in the stock market. But to be considered a great investor you must also follow this problems' advice: </p> <
<p>The Perfect Stall<br> Hal Burch <br> Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all the st
<pre class="cpp" name="code"> </pre> <p><br> Drainage Ditches<br> Hal Burch <br> Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that
<p> Fence Rails<br> Burch, Kolstad, and Schrijvers <br> Farmer John is trying to erect a fence around part of his field. He has decided on the shape of the fence and has even already installed t
<p>Cryptcowgraphy<br> Brian Dean <br> The cows of Farmer Brown and Farmer John are planning a coordinated escape from their respective farms and have devised a method of encryption to protect th
<p>hadoop 入门:</p> <p>0hadoop的简要介绍<br> google之所以能够成功,一个重要的技术就是map-reduce。map-reduce是google为大规模的、分布式数据进行处理的一种编程模式。<br> 而本文介绍的hadoop是apache的开源map-reduce实现。本文不过多的介绍map-reduce,主要精力放在hadoop的配置和编写一个简单
<p>Electric Fence<br> Don Piele <br> In this problem, `lattice points' in the plane are points with integer coordinates.</p> <p>In order to contain his cows, Farmer John constructs a triangular
<p><a href="http://hi.baidu.com/leokan/blog/item/3f69222ebfdbea544ec226fb.html">http://hi.baidu.com/leokan/blog/item/3f69222ebfdbea544ec226fb.html</a><br> 原文我就不贴了,直接贴另一个博客,感兴趣的可以看看这位大神的解法。<br> 上
<p>引言</p> <p>将 Java 对象序列化为二进制文件的 Java 序列化技术是 Java 系列技术中一个较为重要的技术点,在大部分情况下,开发人员只需要了解被序列化的类需要实现 Serializable 接口,使用 ObjectInputStream 和 ObjectOutputStream 进行对象的读写。然而在有些情况下,光知道这些还远远不够,文章列举了笔者遇到的一些真实情
<p>Stamps</p> <p>Given a set of N stamp values (e.g., {1 cent, 3 cents}) and an upper limit K to the number of stamps that can fit on an envelope, calculate the largest unbroken list of postages
<p>写spring的时候,使用SqlMapClientDaoSupport,结果报出异常:</p> <p><span style="font-size:16px"><strong><span style="color:#333399">The type org.springframework.dao.support.DaoSupport cannot be resolved. It i
<p>Agri-Net<br> Russ Cox <br> Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of cou
<p>Kolstad & Burch <br> It's dinner time, and the cows are out in their separate pastures. Farmer John rings the bell so they will start walking to the barn. Your job is to figure out which o
<p>Cow Pedigrees<br> Silviu Ganceanu -- 2003</p> <p>Farmer John is considering purchasing a new herd of cows. In this new herd, each mother cow gives birth to two children. The relationships amo
这是我做过的题目中用时间最长的一个 题目原文: -------------------------------------------- Party Lamps IOI 98 To brighten up the gala dinner of the IOI'98 we have a...
<p>Preface Numbering</p> <p>A certain book's prefaces are numbered in upper case Roman numerals. Traditional Roman numeral values use a single letter to represent a certain subset of decimal numb
<p>Hamming Codes<br> Rob Kolstad <br> Given N, B, and D: Find a set of N codewords (1 <= N <= 64), each of length B bits (1 <= B <= 8), such that each of the codewords is at least Ha
<p>IOI'94 - Day 1 <br>In a stroke of luck almost beyond imagination, Farmer John was sent a ticket to the Irish Sweepstakes (really a lottery) for his birthday. This ticket turned out to have only t
<p>偶也,纪念一次成功,首先发测试结果</p> <p>USER: Ma yunlei [yunleis2]<br>TASK: sprime<br>LANG: C++</p> <p>Compiling...<br>Compile: OK</p> <p>Executing...<br> Test 1: TEST OK [0.000 secs, 3028 KB]<br> Test 2: T
<p>题目给出一个下限,一个上限,要求求出之间的所有既是回数又是素数的数。</p> <p>下边是原文描述:</p> <center><h1>Prime Palindromes</h1></center> <p>The number 151 is a prime palindrome because it is both a prime number and a palindrome (it i
<p>c++中有这样一个特性,即对于与、或运算,如果能够通过第一个表达式计算出整个表达式的真值,那么就不会再去计算第二个表达式。</p> <p>比如或运算</p> <p>a || b,如果a的值是true,那么整个表达式也肯定是true,程序不会去计算第二个表达式。</p> <p>与运算</p> <p>a&&b,如果a的值是false,那么整个表达式也肯定是false,程序不会
<center><h1>Number Triangles</h1></center> <p>Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the to
<p>环境minix3.1.8</p> <p>打印进程的vm信息:</p> <p>添加系统调用分为三个部分:</p> <p>1,库函数向用户提供接口;</p> <p>2,pm接受消息处理信息;</p> <p>3,vm接收消息处理信息。</p> <p> </p> <p>1库函数添加:</p> <p> 1.1 posix/下添加print_vmmap函数,文件名命名为_print