现在位置: 首页 > calmly发表的所有文章
  • 11月
  • 13日
综合 ⁄ 共 3761字 评论关闭
        Sigar(全称System Information Gatherer And Reporter,即系统信息收集报表器),它提供了一个开源的跨平台的收集计算机硬件和操作系统信息的API(该API底层接口用C语言编写),本文将演示如何借助Sigar API获取网络信息: package com.ghj.packageoftest; import org.hyperic.sigar.NetFlags; import org.hyperic.sigar.NetInterfaceConfig; import org.hyperic.sigar.NetInterfaceStat; import org.hyperic.sigar.Sigar; import org.hyperic.sigar.SigarException; /** * 借助Sigar API获取网络信息 * * @author......
阅读全文
如果网络出现异常,TCP连接中断,那么计算机要多久才能够检测出来呢? 最佳答案 这个问题得分情况来说: 1、双方只建立了一个连接,然后就再也没有任何数据通信,这完全是可能的。这时,tcp有一个保活定时器,它的作用就是确认对端是否存活,通常它没2个小时发送一个数据包给对方,以查看是否有响应。 2、tcp中断,此时发送端发送数据,但是由于收不到ACK,它会一直尝试,通常的时间间隔为1s, 3s, 6s, 12s ..... 64s,这个间隔被称为"指数退避",到最后,通常在9分钟后放弃(这个值看实现有可能不同)。 3、tcp中断,在这个过程中,路由......
阅读全文
  • 10月
  • 24日
综合 ⁄ 共 539字 评论关闭
When I compiling the caffe by make all, then the system show me an error that a function from boost::joinunexception() undefined, my solution for this is to remove the boost library by sudo apt-get autoremove libboostall-dev(I installed the boost-1.53 by source code), then this error gone. So I successfully finished the make test, but when I try make runtest, another error occurs!  Its say cudnn not initilize, this confusing me.  Luckly I heard some suggestions from the caffe user group,......
阅读全文
  • 07月
  • 13日
综合 ⁄ 共 5字 评论关闭
         
阅读全文
  • 06月
  • 06日
综合 ⁄ 共 7404字 评论关闭
Qt configure 在编译QT前,可加各种参数来定制自己想要的QT库。这对需要裁减QT库的朋友来说非常重要。对于如何编译QT,可以参考:http://hi.baidu.com/agassi%5Fp/blog/item/455833601e4eb14ceaf8f866.html 配置参数选项:   前面是*号的表示默认参数. +号表示该功能要求被评估,评估成功后才能被接受.   -release ........... 调试关闭.没有调试库,自己的项目只能发布,不能调试(没有调试库的缘故),如果你硬要编译debug版本的话,会提示找不到xxxxxd.dll   * -debug ............. 只有调试库,没有释放库,也就是说以后自......
阅读全文
  • 04月
  • 18日
综合 ⁄ 共 1464字 评论关闭
在struts2里一般用标签struts-tags可以取得action里的List,只需要在jsp的属性和action属性映射起来就可以了。 但对于list的映射还是有一点需要注意到地方。 1. Action里List定义要用泛型   如: ShoppingCartAction的orderDetails,         public class ShoppingCartAction extends ActionSupport {             private Collection<OrderDetail> orderDetails;      Jsp取     <s:iterator value="orderDetails">          <tr>            <td><input type="......
阅读全文
  • 04月
  • 01日
综合 ⁄ 共 717字 评论关闭
void CPUSin() { const int SAMPLE_COUNT = 100; const double PI = 3.1415926536; const int SAMPLE_TIME = 400; double radian = 0.0; double radian_delta = 2 * PI / double(SAMPLE_COUNT); DWORD Sample_Value[SAMPLE_COUNT]; for(int i = 0; i < SAMPLE_COUNT; ++i){ Sample_Value[i] = sin(radian) * SAMPLE_TIME / 2 + SAMPLE_TIME/2; radian += radian_delta; } int j = 0; while(true) { DWORD startTime = GetTickCount(); while((Get......
阅读全文
  • 03月
  • 31日
综合 ⁄ 共 671字 评论关闭
Integer to Roman Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 思路: 没有思路。 题解: class Solution { public: string intToRoman(int num) { static const string SYMBOLS=" MDCLXVI"; string ret; int start_divisor = 1000; int iter = 0; while(start_divisor != 0) { // digit separation int quotient = num / start_divisor; num -= quot......
阅读全文
  • 03月
  • 20日
综合 ⁄ 共 2135字 评论关闭
http://www.cnblogs.com/rayray/p/3413673.html   主要功能清除内/外缓存,清除数据库,清除sharedPreference,清除files和清除自定义目录   /* * 文 件 名: DataCleanManager.java * 描 述: 主要功能有清除内/外缓存,清除数据库,清除sharedPreference,清除files和清除自定义目录 */ import java.io.File; import android.content.Context; import android.os.Environment; /** * 本应用数据清除管理器 */ public class DataCleanManager { /** * 清除本应用内部缓存(/data/data/com.xxx.xxx/cache)......
阅读全文
  • 03月
  • 18日
综合 ⁄ 共 1486字 评论关闭
最近在看Steven Skiena写的The Algorithm Design Manual,第二章遇到一个习题,想了一个naive的方法,在网上也没有查到解答。想到这个题是不是会有更一般的解法,希望路过的大神如果有insight的话给点指导  这个题是这样描述的: We have 1,000 data items to store on 1,000 nodes. Each node can store copies of exactly three different items. Propose a replication scheme to minimize data loss as nodes fail. What is the expected number of data entries that get lost when three random nodes fail? 初看这个问......
阅读全文
  • 02月
  • 04日
综合 ⁄ 共 341字 评论关闭
原因 在我们做exp的过程中可能经常会遇到EXP-00091: Exporting questionable statistics.这样的EXP信息,其实它就是exp的error message,它产生的原因是因为我们exp工具所在的环境变量中的NLS_LANG与DB中的NLS_CHARACTERSET不一致。 解决步骤 1. 查看DB中的NLS_CHARACTERSET的值 select * from nls_database_parameters t where t.parameter='NLS_CHARACTERSET';  如果查出的结果为ZHS16GBK 2. 设置环境变量 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK 3.查看环境变量的值  echo $NLS_LANG
阅读全文
  • 01月
  • 17日
综合 ⁄ 共 2003字 评论关闭
有 N 个比赛队(1<=N<=500) ,编号依次为 1,2,3, 。 。 。 。 ,N 进行比赛,比赛结束后, 裁判委员会要将所有参赛队伍从前往后依次排名, 但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即 P1 赢 P2,用 P1,P2 表示,排名时 P1 在 P2 之前。试编写程序,输出各队的排名顺序。 1. 需求规格说明 2. 有 N 个比赛队(1<=N<=500) ,编号依次为 1,2,3, 。 。 。 。 ,N 进行比赛,比赛结束后, 裁判委员会要将所有参赛队伍从前往后依次排名, 但现在裁判委员会不能直接获得每个队的比赛......
阅读全文