常量可以理解为值不变的量,常量被定义后,在脚本的其他任何地方都不能改变,一个常量由英文字母,下划线,和数字组成,但是数字不能作为常量的首字母。
在php中使用#define()函数来定义常量,该函数的语法格式如下:
define(string constant_name,mixed value,case_sensitive=true)
获取常量的值的方法有两种,一种方法是:使用常量的...
分类:
Web程序 时间:
2015-03-18 09:02:35
阅读次数:
149
高级迭代器可以实现多种有价值功能。本节将展示如何利用高级迭代器和标准Thrust算法处理一个更广泛的类问题。对于那些熟悉的Boost C ++库的开发者,他们会发现Thrust的高级迭代器与Boost迭代器库非常相似。constant_iterator常量迭代器最明显的特点,是每次解引用时,都会返回...
分类:
其他好文 时间:
2015-03-17 19:53:48
阅读次数:
258
Sort a linked list in O(n log n) time using constant space complexity.
这道题是要求对单链表进行排序,有个O(nlogn)的时间复杂度的要求。我的想法是采取类似头插法的方式,遍历链表结点,设3个指针,min指向当前链表中的最小值,max指向当前链表中的最大值,cur指向前一插入的值。
min , max , cur 初始时都指向第...
分类:
其他好文 时间:
2015-03-17 15:58:02
阅读次数:
181
题目:Sort a linked list in O(n log n) time using constant space complexity.
思路:要求时间复杂度O(nlogn)
知识点:归并排序,链表找到中点的方法
存在的缺点:边界条件多考虑!!!
/**
* LeetCode Sort List Sort a linked list in O(n log n) time us...
分类:
编程语言 时间:
2015-03-16 23:14:12
阅读次数:
260
自动共享内存管理从Oracle 10g开始,Oracle提供了自动SGA的管理(简称ASMM,即Automatic Shared Memory Management)新特性。所谓ASMM,就是指我们不再需要手工设置shared pool、buffer pool等若干内存池的大小,而是为SGA设置一个...
分类:
其他好文 时间:
2015-03-16 12:51:19
阅读次数:
183
Min Stack问题:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop(...
分类:
其他好文 时间:
2015-03-15 12:05:19
阅读次数:
136
1.访问网站所涉及环节简单说就是重复相同的请求首先看看访问流程所设计的每个环节User -> Browse -> CDN/Proxy Cache -> Web Server -> App Server / fastcgi pool -> Cache -> Database大部分网站都是这样的结构:用...
分类:
Web程序 时间:
2015-03-15 00:38:46
阅读次数:
191
What is shared pool? Shared pool是SGA中的一部分,由于它是SGA的一部分,这意味着它可以被所有的进程所访问。Shared pool物理层面上由许多内存块组成,这些内在块称为chunk。但是chunk是大小不一的,在内存中一个chunk是连续的。 按逻辑结构划分:.....
分类:
系统相关 时间:
2015-03-14 18:28:08
阅读次数:
166
hadoop-root-datanode-ubuntu.log中:2015-03-12 23:52:33,671 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool ....
分类:
其他好文 时间:
2015-03-14 06:11:25
阅读次数:
7165
public static String DEPLOY_PATH = null;
static
{
String CurrentClassFilePath = Constant.class.getResource("").getPath();
int lastpath = CurrentClassFilePath.lastIndexOf("WEB-INF/");
DEPLOY_PA...
分类:
编程语言 时间:
2015-03-13 18:45:02
阅读次数:
146