现在位置: 首页 > dilater发表的所有文章
  • 04月
  • 20日
综合 ⁄ 共 2393字 评论关闭
作者出处:http://www.cnblogs.com/york-hust/archive/2012/05/29/2524658.html C++中struct和class的区别 一、  C++中的struct对C中的struct进行了扩充,它已经不再只是一个包含不同数据类型的数据结构了,它已经获取了太多的功能。     struct能包含成员函数吗?   能!     struct能继承吗?          能!!     struct能实现多态吗?       能!!!        最本质的一个区别就是默认的访问控制,体现在两个方面:     1)默认的继承访问权限。struct是public的,class是private的。        写如下的代码:     struct A  ......
阅读全文
  • 04月
  • 20日
综合 ⁄ 共 1170字 评论关闭
今天接着上一节的内容,继续来了解uml剩下的几种的静态建模和动态建模。 三、对象图:主要用来表现对象的特征,展示多个对象的特征及对象之间的交互。就拿咱出行旅游使用交通工具为例,如图: 说明:对象图只在系统的某一段时间存在,可以被看作是类图在该时刻的实例,主要用来描述对象之间的行为。 四、组件图:也称为构件图,主要用来描述软件中组件之间的关系,同时也是系统设计的一个模块化元素。组件(构件)是系统中可替换的物理部分,它封装了类的实现以及对象提供一组接口,在软件开发过程中,满足相同接口的组件可以自由地......
阅读全文
  • 12月
  • 10日
数据库 ⁄ 共 8205字 评论关闭
http://www.infoq.com/cn/news/2011/01/relation-db-nosql-db http://www.infoq.com/cn/news/2011/01/nosql-why NoSQL概念 随着web2.0的快速发展,非关系型、分布式数据存储得到了快速的发展,它们不保证关系数据的ACID特性。NoSQL概念在2009年被提了出来。NoSQL最常见的解释是“non-relational”,“Not Only SQL”也被很多人接受。(“NoSQL”一词最早于1998年被用于一个轻量级的关系数据库的名字。) NoSQL被我们用得最多的当数key-value存储,当然还有其他的文档型的、列存储、图型数据库、xml数据库等。在NoSQL概念提出之前......
阅读全文
  • 06月
  • 10日
综合 ⁄ 共 4670字 评论关闭
Sketch: There are three kinds of character constants: Normal character constant; Multicharacter constant; wide-character constant; note:     Use wide-character constants in place of multicharacter constants to ensure portability.  examples:  char ch = 'y'; int    mch = 'ab'; wchar_t wch = L'ab'; Escape sequence:     nongraphic characters need to be specified using escape sequence. they include newline, backslash, single quote, double quote, carriage return, etc.     There are th......
阅读全文
  • 04月
  • 28日
综合 ⁄ 共 4736字 评论关闭
A题: Weighted Median Time Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 For n elements x1, x2, ..., xn with positive integer weights w1, w2, ..., wn. The weighted median is the element xk satisfying and  , S indicates  Can you compute the weighted median in O(n) worst-case?   输入 There are several test cases. For each case, the first line contains one integer n(1 ≤  n ≤ 10^7) — the number of elements in the sequence. The following line contains n integ......
阅读全文
  • 04月
  • 22日
综合 ⁄ 共 1050字 评论关闭
比较简单: #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <iostream> #include <queue> #include <stack> using namespace std; const int M = 9999; const int N = 109; const int INF = 0x3f3f3f3f; struct LT{ int to,nex,val; }L[M]; int F[N],cnt; void add(int f,int t,int d) { L[cnt].to = t; L[cnt].nex = F[f]; L[cnt].val = d; F[f] = cnt++; } int n,m,p,dis[N],inque[N],con[N]; int que[N*N]; void solve......
阅读全文
  • 04月
  • 18日
综合 ⁄ 共 1099字 评论关闭
Asp.net mvc3的“从客户端(content_v=\",<p>\n\t<imgalt=\"\" src...\")中检测到有潜在危险的Request.Form 值”解决方法  JS有时会还报出500的错误 实际应用:在提交有富文本编辑器(如CKEditor,UEditor)的页面时... 下面提供三种方法 1、在Controller调用的方法上添加[ValidateInput(false)] (MVC3的特性) [ValidateInput(false)] public ActionResult EventSave()    下面两种方法在传统的asp.net网站上一样适用 2、在对应的asp.net web页面上加上ValidateRequest="false" <%@ Page ValidateRequest="false"Title=......
阅读全文
  • 04月
  • 07日
综合 ⁄ 共 4412字 评论关闭
我们在自定义View 时,一般都会用到 TypedArray obtainStyledAttributes(                 AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes);  对于它的前面2个参数可能大家都知道, 对于后面两个参数一直不明白怎么用。 于是今天查了下。            context obtainStyledAttributes 最终会调到Resources.Theme.obtainStyledAttributes(AttributeSet set,                 int[] attrs, int defStyleAttr, int defStyleRes)  再看一下参数解释:          * @param set The base set of attribute values.  ......
阅读全文
  • 03月
  • 17日
综合 ⁄ 共 2676字 评论关闭
很不错的高精度模板,但这个模板只能算加、减、乘、除等基本运算,但操作减法的时候只能大数减小数,所以最重要的操作是 + 、 +=、*、*=、、/、/=、-=、==,>=,这些基本的运算,最近通过在UVA在刷的几道题,发现自己以前的模板存在一些BUG,现在贴上已经改正的模板,欢迎大家指出我的BUG。 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <algorithm> using namespace std; const int MAXN = 410; struct bign {......
阅读全文
  • 02月
  • 18日
综合 ⁄ 共 3873字 评论关闭
  Java认证:解析Spring中bean的scope,如何使用spring的作用域:   《bean id=“role” class=“spring.chapter2.maryGame.Role” scope=“singleton”/》   这里的scope就是用来配置spring bean的作用域,它标识bean的作用域。在spring2.0之前bean只有2种作用域即:singleton(单例)、non-singleton(也称prototype), Spring2.0以后,增加了session、request、global session三种专用于Web应用程序上下文的Bean.因此,默认情况下Spring2.0现在有五种类型的Bean.当然,Spring2.0对Bean的类型的设计进行了重构,并设计出灵活......
阅读全文
 = 问题 =   请问如何把16进制数转化为10进制数显示输出?谢谢!    --------------------------------------------------------------------------------  16进制数在内存INPUT处,使用大写字母,结果在OUTPUT中  最大为双字  大致如下:  input  db  "23AF ",0  w1     dw 1  w2     dw 0  output db 20 dup(0)      xor ax,ax      mov si,offset input      call h_to_b      mov di,offset output      mov cx,10      call b_to_d      xor ax,ax    ......
阅读全文
  • 01月
  • 31日
综合 ⁄ 共 1382字 评论关闭
1. 一定程度的懒惰是美德,它激励程序员采用最优秀的数据结构与算法,使用最精简的代码去完成任务,解决问题。 2. 最重要的是:解决问题,赢得认可。 3. 本质最重要,计算与通讯。Back_To_Basic,B2B. 4. 站在巨人的肩膀上,站在全球的视野,宇宙的视野。 5. 思想改变一切。 6. 你的大脑在欺骗你,改变你的习惯,改变你的认识,改变你的思想,和你的大脑做斗争。 7. 好的风格,好的哲学思维。 8. 完美,拥抱变化,注重实效,时刻学习,社会心理学问题,技术问题,管理问题。 9. 天赋,兴趣,坚持不懈的学习与训练。 10. 编码是一种......
阅读全文