现在位置: 首页 > dreadlock发表的所有文章
  • 11月
  • 10日
综合 ⁄ 共 943字 评论关闭
看懂题目基本可做,水题 #include <iostream> using namespace std; int weight[4],rate[4],w; int main(int argc, char const *argv[]) { int t = 1; while(cin >> weight[0] >> rate[0]) { cin >> weight[1] >> rate[1] >> weight[2] >> rate[2] >> rate[3]; cout << "Set number " << t++ << ":" << endl; while(cin >> w && w) { int cost, add = 0; if(w <= weight[0]) {......
阅读全文
  • 10月
  • 01日
综合 ⁄ 共 2035字 评论关闭
转自:https://developer.apple.com/library/mac/#documentation/General/Conceptual/DevPedia-CocoaCore/ObjectCopying.html Object Copying Copying an object creates a new object with the same class and properties as the original object. You copy an object when you want your own version of the data that the object contains. If you receive an object from elsewhere in an application but do not copy it, you share the object with its owner (and perhaps others), who might change the encapsulated con......
阅读全文
  • 06月
  • 18日
综合 ⁄ 共 5798字 评论关闭
很多J2EE应用都是基于Spring的,一些比较复杂的测试用例,如果用基于TestCase比较难满足全部的测试场景。 所以,我们会用到一些Mock工具,如PowerMockito: <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>1.4.10</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito</artifactId> &......
阅读全文
  • 05月
  • 30日
综合 ⁄ 共 3484字 评论关闭
(1)在服务端配置snmpd.conf:      #       sec.name  source          community         com2sec readonly  default         oneread         com2sec readwrite default         onewrite (2)重新启动snmpd /usr/sbin/snmpd -c /conf/snmpd.conf -L udp:161 (3)在客户端发送snmpwalk命令: snmpwalk -v 2c -c onecread 10.53.11.22 .1.3.6.1.2.1.1 snmpwalk  -c SNMP读密码 -v 1或2(代表SNMP版本) 交换机或路由器IP地址 OID(对象标示符) OID值表示的意义(中文) .1.3.6.1.2.1.1操作系统相关的信息,其下包含很多的系统信息: .1......
阅读全文
  • 05月
  • 05日
综合 ⁄ 共 110字 评论关闭
删除某个项目中所有的.svn文件:find . -name ".svn" | xargs rm -Rf 上传项目svn中:svn import -m "New import" myproj http://xxxx.xxxx.xxx.com/misc
阅读全文
  • 04月
  • 20日
综合 ⁄ 共 775字 评论关闭
一次crash可能会造成虚拟机锁死的情况发生,这时点击take ownership 可能会提示如下字眼: Taking ownership of this virtual machine failed. The virtual machine is in use by an application on your host computer. 解决方法是删除虚拟机目录下的所有.lck文件夹。 This Virtual Machine Appears To Be In Use… When I clicked on the lock button (which had replaced VMWare Fusion’s normal “play” button), I got an error message indicating “The virtual machine appears to be in use”: Seeing as how I was ......
阅读全文
  • 01月
  • 18日
综合 ⁄ 共 1123字 评论关闭
没有截图不要紧。只要您仔细对照我的文字描述,一定可以解决问题。 第一种情况: adb.exe丢失 请按照如下地址的叙述解决: 地址: http://hi.baidu.com/azhangdeng/item/bcdbcd9ed95edddfb72531e3 补充:以上博客的更新时间是 2012-03-06 而我发表此博客的时间为 2013-02-16,中间间隔了11个月,由于时间上的关系,我们所使用的SDKManager.exe界面与以上博客截图有所差异,但不影响我们的升级或下载操作。 第二种情况: ADT 过时,系统要求对ADT升级,否则无法使用SDKManager.exe 和 AVDManager.exe。 这种情况比较罕见,我也是......
阅读全文
  • 12月
  • 21日
综合 ⁄ 共 297字 评论关闭
android需要引入iconv,但是貌似编译什么的都很麻烦 不过既然是开源的,就直接把源代码拖进去用不就可以了。。。。。。。 下好源码,cyg下configure一下(因为没有linux环境)。 在项目mk里面,加入下面几个源文件路径和头文件路径: $(LOCAL_PATH)/iconv/include \ $(LOCAL_PATH)/iconv/libcharset \ $(LOCAL_PATH)/iconv/lib \ $(LOCAL_PATH)/iconv/libcharset/include \ $(LOCAL_PATH)/iconv/srclib/ \ $(LOCAL_PATH)/iconv  然后就好了
阅读全文
  • 12月
  • 20日
综合 ⁄ 共 5083字 评论关闭
在上文中,我们在QEMU中已经成功的虚拟了一个PCI桥和一个PCI设备,接下来我们就来给他们分配固定的IO基地址。   要给PCI设备分配固定的IO基地址,那么就需要先了解PCI设备是如何刷新和分配IO基地址的。  1. PCI设备的重置与刷新 PCI在需要的时候,如第一次启动,IO重叠等就需要重置PCI设备,并且清空PCI bar上面的地址信息。主要调用函数pci_device_reset   void pci_device_reset(PCIDevice *dev) {     int r;     ... ...     ... ...     dev->config[PCI_CACHE_LINE_SIZE] = 0x0;     dev->config[PCI_INTERRUPT_LINE] ......
阅读全文
  • 12月
  • 12日
综合 ⁄ 共 1207字 评论关闭
      最近写了一段这样的代码。代码的功能是,通过函数function()返回的错误代码,生成一段说明该代码错误的log。       最开始我的代码是这样写的: enum error_t{ ERROR0=0, ERROR1, ERROR2, ERROR3 }; error_t function() { //...... } int main() { error_t err_code; err_code = function(); switch(err_code) { case ERROR0: printf("Success."); break; case ERROR1: printf("Error1 occured."); break; ......
阅读全文
  • 11月
  • 10日
综合 ⁄ 共 394字 评论关闭
js中的日期计算           var dateNow = new Date();//取当前时间           var year =dateNow.getYear();//取当前年           var month =dateNow.getMonth();//当前月-1           var day =dateNow.getDate();//取今天(昨天的24点今天的0点)                      var date = new Date(2011,8,16);//时间为2011年9月16日,月份计算从0开始           date.setYear(date.getYear()+1);//2012年9月16日           date.setDate(date.getDate()+15);//2011年10月1号           date.setHours(date.getHours()+1);//加一个小时 2......
阅读全文
  • 10月
  • 06日
综合 ⁄ 共 82字 评论关闭
http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000
阅读全文