自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(30)
  • 收藏
  • 关注

原创 执行计划中参数解析

id:SELECT识别符。这是SELECT的查询序列号。select_type:SELECT类型。1、SIMPLE: 简单SELECT(不使用UNION或子查询)2、PRIMARY: 最外面的SELECT3、UNION:UNION中的第二个或后面的SELECT语句4、DEPENDENT UNION:UNION中的第二个或后面的SELECT语句,取决于外面的查

2013-05-22 16:54:07 492

原创 查询性能优化(高性能mysql读书笔记三)

1、是否存在查询多余数据的情况简单的开销指标:     响应时间     扫描的行数     返回的行数解决方案:     使用索引覆盖扫描(需要的数据都来自索引)     该表库表结构     重构查询方式2、重构查询方式(1)切分查询          比如使用limit、通过时间节点变化(2)分解关联查询

2013-05-22 16:49:05 650

原创 创建高性能索引(高性能mysql读书笔记二)

1、索引类型(1)B-Tree索引(MyISAM、InnoDB使用)          所有值按照顺序排放          每一个叶子节点到根节点的距离相同          树的深度和表的大小相关          (说明:MyISAM使用前缀压缩技术是索引更小,InnoDB采用原数据存储。MyISAM索引通过存储数据的物理地址来引用数据,InnoDB通过主键引用数

2013-05-22 16:43:00 460

原创 Schema与数据优化(高性能mysql读书笔记一)

1、数据类型的选择1)尽量使用能够存储数据的最小类型2)尽量使用Mysql提供的数据类型存储相应的结构,例如用date存储时间,用int unsigned来存储ipe.g.SELECT INET_ATON ('192.168.23.4' );得到这个IP的值为: 3232241412SELECT INET_NTOA (3232241412);得到这个值对

2013-05-22 16:41:30 428

转载 Tomcat6.0配置及分析

Tomcat6.0 连接池的配置1.本人当前使用的Tomcat版本为:6.0.20,oracle为稳定的9i版本2.下文为方便起见,依习惯以%Tomcat_Home%表示Tomcat安装的目录,本人安装目录为“E:\Program Files\WindowsXP\tomc

2011-10-13 17:09:16 391

原创 输入两个整数 n 和 m,从数列1,2,3.......n 中 随意取几个数, 使其和等于 m ,要求将其中所有的可能组合列出来.

/** * 输入两个整数 n 和 m,从数列1,2,3.......n 中 随意取几个数, 使其和等于 m ,要求将其中所有的可能组合列出来. e.g n=6,m=6 1,2,3 2,4 1,5 n= * @author wangxm */p

2011-07-11 17:28:14 1954

转载 struts1与struts2的比较

一.MVC的特点:— 多个视图可以对应一个模型。按MVC设计模式,一个模型对应多个视图,可以减少代码的复制及代码的维护量,一旦模型发生改变,也易于维护。 — 模型返回的数据与显示逻辑分离。模型数据可以应用任何的显示技术,例如,使用JSP页面、Velocity模板或者直接产生Excel文档等。— 应用被分隔为三层,降低了各层之间的耦合,提供了应用的可扩展性。 — 控制层的概念也很有效,由于它把不同的

2011-06-30 15:51:00 265

原创 Problem58

原题:Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length 7 is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 39 18 5 4 3 12 29 40 19 6 1 2

2011-06-23 16:22:00 281

原创 Problem57

原题:It is possible to show that the square root of two can be expressed as an infinite continued fraction. 2(开方) = 1 + 1/(2 + 1/(2 + 1/(2 + ... ))) = 1.414213... By expanding this for the first fou

2011-06-22 14:54:00 285

原创 Problem56

原题:A googol (power(10,100)) is a massive number: one followed by one-hundred zeros;  power(100,100) is almost unimaginably large: one followed by two-hundred zeros.  Despite their size, the sum of t

2011-06-22 14:53:00 205

原创 Problem 46

原题: //合数是与质数(也叫素数)相对应的概念,即除了1和本身之外,还可以被其它正整数整除的数称为合数。 //奇合数:既是合数又是奇数的数称为奇合数。例如:9,15,21等等都是奇合数。 It was proposed by Christian Goldbach that every odd composite number can be written as   the sum of a

2011-06-14 17:15:00 256

原创 Problem45

原题:Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: * Triangle T(n)=n(n+1)/2 1, 3, 6, 10, 15, ... Pentagonal P(n)=n(3n-1)/2 1, 5, 12, 22, 35, ... Hexagon

2011-06-13 15:33:00 265

原创 Problem44

原题:Pentagonal numbers are generated by the formula, Pn=n(3n-1)/2.  The first ten pentagonal numbers are: 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ... It can be seen that P4 + P7 = 22 + 70 = 92 = P8.

2011-06-13 15:32:00 282

原创 Problem42

原题:The nth term of the sequence of triangle numbers is given by, t(n) = 1/2*n(n+1); so the first ten triangle numbers are: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...  By converting each letter in a wo

2011-06-09 16:38:00 255

原创 电梯问题

问题描述:一部电梯只能停一层,电梯上的人都从这层下去,然后走到自己的楼层,计算停到哪层所有人的路途之和最短。问题扩展:(1)如果下楼和上楼消耗的能量不同,求所有消耗能量之和的最小值               (2)条件增加,如果电梯可以停K层 分析:1、可以将电梯停在每层的情况分别求总路径,然后对总路径比较,求出最小值。二重循环。 2、以其中一层(i,可以从i=1开始

2011-06-09 16:36:00 919

原创 Problem41

原题:We shall say that an n-digit number is pandigital  if it makes use of all the digits 1 to n exactly once.  For example, 2143 is a 4-digit pandigital and is also prime. What is the largest n-digit

2011-06-08 17:48:00 264

原创 Problem40

原题:An irrational decimal(无理小数) fraction is created by concatenating the positive integers: 0.123456789101112131415161718192021... It can be seen that the 12(th) digit of the fractional part is 1. If

2011-06-08 14:14:00 218

原创 Problem39

原题:If p is the perimeter of a right angle triangle with integral length sides,  {a,b,c}, there are exactly three solutions for p = 120.{20,48,52}, {24,45,51}, {30,40,50} For which value of p分析:由

2011-06-08 13:32:00 222

原创 Problem38

原题:Take the number 192 and multiply it by each of 1, 2, and 3: 192*1 = 192 192*2 = 384 192*3 = 576 By concatenating each product we get the 1 to 9 pandigital, 192384576. We will call 192384576 the

2011-06-08 08:52:00 229

原创 Problem37

原题:The number 3797 has an interesting property. Being prime itself,   it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly w

2011-06-08 08:50:00 195

原创 Project Euler 36

原题:The decimal number, 585 = 1001001001 (binary), is palindromic in both bases. Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2. (Please note that the

2011-06-03 09:11:00 339

原创 Project Euler 35

原题:The number, 197, is called a circular prime because all rotations of the digits:   197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31,

2011-06-03 09:09:00 330

原创 Project euler 34

原题:145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they

2011-06-03 09:07:00 245

原创 Problem32

<br />We shall say that an n-digit number is pandigital if it makes use of  all the digits 1 to n exactly once; for example, the 5-digit number,  15234, is 1 through 5 pandigital.<br /><br /> The product 7254 is unusual, as the identity, 39*186 = 7254, con

2011-06-01 16:52:00 268

转载 connect by prior... start with的使用

<br /><br />假设我们现在有如下结构的数据(T_Topic) <br />TopicID ParentID TopicTitle <br /> <br />1          null          请教Oracle 选取树状数据<br />2            1            re:请教Oracle 选取树状数据<br />3            1            其实只要这样就可以<br />4            1            我也有同样的问题

2011-06-01 14:55:00 306

原创 范式

<br /><br />在任何一个关系数据库中,第一范式(1NF)是对关系模式的基本要求,不满足第一范式(1NF)的数据库就不是关系数据库。<br />第二范式(2NF)要求实体的属性完全依赖于主关键字。数据库表中不存在非关键字段对任一候选关键字段的部分函数依赖(部分函数依赖指的是存在组合关键字中的某些字段决定非关键字段的情况),也即所有非关键字段都完全依赖于任意一组候选关键字。<br />简而言之,第三范式就是属性不依赖于其它非主属性。在第二范式的基础上,数据表中如果不存在非关键字段对任一候选关键字段的传

2011-06-01 14:52:00 203

原创 组合、聚合和关联的关系

<br />组合和聚合是有很大区别的,这个区别不是在形式上,而是在本质上:<br />比如A类中包含B类的一个引用b,当A类的一个对象消亡时,b这个引用所指向的对象也同时消亡(没有任何一个引用指向它,成了垃圾对象),这种情况叫做组合,反之b所指向的对象还会有另外的引用指向它,这种情况叫聚合。<br />在实际写代码时组合方式一般会这样写:<br />A类的构造方法里创建B类的对象,也就是说,当A类的一个对象产生时,B类的对象随之产生,当A类的这个对象消亡时,它所包含的B类的对象也随之消亡。<br />聚合方

2011-05-31 19:15:00 386

转载 有关rowNum

<br /><br />对于rownum来说它是oracle系统顺序分配为从查询返回的行的编号,<br />返回的第一行分配的是1,第二行是2,依此类推,这个伪字段可以用于限制查询返回的总行数,而且rownum不能以任何表的名称作为前缀。<br />所以上面几条能够查到记录。<br />select * fromproductwhererownumbetween1and30  <br />select * fromproductwhererownum<20<br />select * fromproduct

2011-05-31 17:56:00 193

原创 Problem 28

 Starting with the number 1 and moving to the right in a clockwise  direction a 5 by 5 spiral is formed as follows: 21 22 23 24 25   20 7 8 9 10   19 6 1 2 11   18 5 4 3 12 17 16 15 14 13 It can be verified that the sum of the numbers on th

2011-05-31 15:54:00 288

原创 Problem 29

<br />package cn.javass.mytest.java.euler;import java.util.Set;import java.util.TreeSet;/** * a(b) 表示 a的b次方 * * Consider all integer combinations of ab for 2<=a<=5 and 2<=b<=5: 2(2)=4, 2(3)=8, 2(4)=16, 2(5)=32 3(2)=9, 3(3)=27,

2011-05-31 15:46:00 212

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除