现在位置: 首页 > vaguely发表的所有文章
  • 05月
  • 15日
综合 ⁄ 共 1628字 评论关闭
定义: In cryptography and computer science a hash tree or Merkle tree is a tree in which every non-leaf node is labelled with the hash of the labels of its children nodes. 一棵树,它的非叶节点总是子节点内容的hash值。一个递归的定义。 比特币中应用 比特币中交易transactions是放置在块block中的,每一个tx可以看作一个叶子节点,对这样一个tx的序列计算hash(每2个一组)并构建merkle树,来简化校验块的一致性。 uint256 CBlock::BuildMerkleTree() const { vMerkleTree.clear(); BOOST_FOREACH(co......
阅读全文
  • 05月
  • 03日
综合 ⁄ 共 3428字 评论关闭
from:http://www.infoq.com/cn/articles/scalability-principles  作者 Simon Brown 译者 王丽娟 发布于 2008年7月25日 下午8时25分 从最简单的水平来看,可伸缩性就是做更多的事情。更多的事情可以是响应更多的用户请求,执行更多的工作,或处理更多的数据。设计软件这件事本身是复杂的,而让软件做更多的工作也有其特有的问题。这篇文章针对构建可伸缩软件系统提出了一些原则和方针。 1. 减少处理时间 增加应用所做工作数量的一个方法就是减少完成单项工作所花费的时间。举例来说,减少处理一个用户请求所需的时间......
阅读全文
  • 10月
  • 09日
综合 ⁄ 共 2191字 评论关闭
//#include <Windows.h> #include <tchar.h> #include <ObjBase.h> #include <MsXml2.h> #include <stdio.h> void dprintf(char* format,...) { static char buf[1024]; va_list args; va_start(args,format); vsprintf_s(buf,format,args); va_end(args); OutputDebugStringA(buf); printf("%s",buf); } #define HRCALL(a,errmsg) / do{ / hr = (a); / if(FAILED(hr)) / { dprintf("%s:%d HRCALL Failed:%s/n 0x%.8x = %s/n", / __FILE__,__LINE__,errmsg,hr,#a); / g......
阅读全文
  • 10月
  • 05日
综合 ⁄ 共 453字 评论关闭
示例代码:     1. lexical_cast转换。     2. 如果不能转换抛出bad_lexical_cast异常。 #include <iostream> #include <string> using namespace std; #include <boost/lexical_cast.hpp> using namespace boost; void g_lexical_cast(const string &str) { try { int num = lexical_cast<int>(str); cout<<num<<" lexical_cast success. "<<endl; } catch (bad_lexical_cast &) { cout<<str.c_str()<<" throw exception."<<endl; } } int ......
阅读全文
  • 05月
  • 20日
综合 ⁄ 共 2498字 评论关闭
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd" ><struts>     <!-- include节点是struts2中组件化的方式 可以将每个功能模块独立到一个xml配置文件中 然后用include节点引用 -->     <include file="struts-default.xml"></include>               <!-- package提供了将多个Action组织为一个模块的方式         package的名字必须是唯一的 package可以扩展 当一个package扩展自         另一个pa......
阅读全文
  • 02月
  • 22日
综合 ⁄ 共 927字 评论关闭
Problem Description A DFS(digital factorial sum) number is found by summing the factorial of every digit of a positive integer. For example ,consider the positive integer 145 = 1!+4!+5!, so it's a DFS number. Now you should find out all the DFS numbers in the range of int( [1, 2147483647] ). There is no input for this problem. Output all the DFS numbers in increasing order. The first 2 lines of the output are shown below. Input no input Output Output all the DFS number in increasing o......
阅读全文
  • 02月
  • 10日
综合 ⁄ 共 1489字 评论关闭
1.初始化 本节描述OpenMax组件初始化的时序。组件可以直接被IL client操作,或者组件之间建立隧道化,或者两者皆可。 1.1 非隧道化初始化 首先,IL client通过调用OMX_GetHandle函数触使OpenMax core创建一个真正的组件实体,与此同时组件的配置信息也被加载到内存中。core把IL client的callback函数通过 SetCallbacks函数设置给组件。如果这些步骤都成功了,那么会返回一个组件句柄给IL client,同时组件进入OMX_StateLoaded状态。 IL client可以调用一次或者多次OMX_SetParameter 函数来配置组件和它的端口。 配置完成后,IL c......
阅读全文
  • 02月
  • 02日
综合 ⁄ 共 887字 评论关闭
打印份数 dw_print.object.datawindow.print.copies=lstr_param.prn_printcopies //纸张大小 dw_print.object.datawindow.print.paper.size=lstr_param.prn_papersize //打印方向 dw_print.object.datawindow.print.orientation=lstr_param.prn_orientation //页边距 dw_print.object.datawindow.print.margin.left=string(lstr_param.prn_margin_left) dw_print.object.datawindow.print.margin.top=string(lstr_param.prn_margin_top) dw_print.object.datawindow.print.margin.bottom=string(lstr_param.prn_margin_bottom) dw_......
阅读全文
  • 01月
  • 28日
综合 ⁄ 共 1232字 评论关闭
知识重点:一.有关MBR、分区表、DBR的基本知识 1.硬盘MBR(硬盘主引导记录)及硬盘分区表介绍 硬盘MBR就是我们经常说的硬盘主引导记录,它是在对硬盘进行分区的时候写入硬盘的。以下是MBR的组成: 这3部分的.. 一.有关MBR、分区表、DBR的基本知识 1.硬盘MBR(硬盘主引导记录)及硬盘分区表介绍 硬盘MBR就是我们经常说的“硬盘主引导记录”,它是在对硬盘进行分区的时候写入硬盘的。以下是MBR的组成: 这3部分的大小加起来正好是512字节=1个扇区(硬盘每扇区固定为512个字节),因此,人们又形象地把MBR称为“硬盘主引导扇区”。 2.硬......
阅读全文
  • 12月
  • 24日
综合 ⁄ 共 142字 评论关闭
自定义listview的时候,当你不使用android:cacheColorHint=“#00000000”会出现下面选中一个空间黑色底色的情况,破坏整体美观度:   当你不使用android:listSelector属性,默认会显示选中的item为橙黄底色,有时候我们需要去掉这种效果:
阅读全文
  • 12月
  • 24日

ORM

综合 ⁄ 共 990字 评论关闭
Object/Relation Mapping 当你开发一个应用程序的时候(不使用O/R Mapping),你可能会写不少数据访问层的代码,用来从数据库保存,删除,读取对象信息,等等。你在DAL中写了很多的方法来读取对象数据,改变状态对象等等任务。而这些代码写起来总是重复的。 我们以保存对象的方法为例,你传入一个对象,为SqlCommand对象添加SqlParameter,把所有属性和对象对应,设置SqlCommand的CommandText属性为存储过程,然后运行SqlCommand。对于每个对象都要重复的写这些代码。 一个O/R Mapping会为你生成DAL。与其自己写DAL代码,不如用O/R Ma......
阅读全文
  • 12月
  • 20日
综合 ⁄ 共 7427字 评论关闭
环境:源主机hostname:localhost  平台:rhel X86_64   数据库版本:11g R2   数据位置:/home/oracle/app/oracle/oradata            目标主机:主机名standby    平台:rhel X86_64   数据库版本:11g R2   数据位置:/home/oracle/app/mydata 一、首先在源主机进行备份   1、这里用rman进行压缩备份,压缩可以大大的节省空间 RMAN> run {2> backup as compressed backupset full tag 'full_for_transfer' database3> include current controlfile format '/home/oracle/full_%d_%T_%s'4> plus archivelog fo......
阅读全文