03 2011 档案
摘要:from:http://msdn.microsoft.com/en-us/library/3dasc8as(VS.80).aspxusing System;using System.Threading;public class Fibonacci{ public Fibonacci(int n, ManualResetEvent doneEvent) { _n = n; _doneEvent = doneEvent; } // Wrapper method for use with thread pool. public void ThreadPoolCallback(Object threa
阅读全文
摘要:Module SummaryLet's now examine the functionality that Spring offers in more detail. It is divided into a number of separate modules.There are two main categories of functionality in Spring:An IoC container and AOP framework, which handle configuration and application of services to objects.A se
阅读全文
摘要:java code:package test.el.function;public class ArithmaticOP { public static int AddInt(int a,int b){ return a+b; }}mytags.tld<?xml version="1.0" encoding="UTF-8"?><taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://
阅读全文
摘要:<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"><Context path="/a" docBase="E:\Projects\MyEclipse6_6\TestFirst\WebRoot" reloadable="true" /> <Valve className="org.apache.catalina.va
阅读全文
摘要:Introduction:http://tomcat.apache.org/tomcat-7.0-doc/apr.htmlTomcat Native Downloads:http://tomcat.apache.org/download-native.cgiIndex of //tomcat/tomcat-connectors/native/1.1.20/binarieshttp://labs.renren.com/apache-mirror/tomcat/tomcat-connectors/native/1.1.20/binaries/win32/
阅读全文
摘要:if(ev.preventDefault) { // Firefox ev.preventDefault(); ev.stopPropagation(); } else { // IE ev.cancelBubble=true; ev.returnValue = false; }
阅读全文
摘要:http://download.oracle.com/javase/tutorial/essential/concurrency/locksync.htmlSynchronization is built around an internal entity known as theintrinsic lockormonitor lock. (The API specification often refers to this entity simply as a "monitor.") Intrinsic locks play a role in both aspects
阅读全文
摘要:from:http://www.java-samples.com/showtutorial.php?tutorialid=306//Q.java 代表队列,存数据package com.test.threadcooperate;//A correct implementation of a producer and consumer. public class Q { int n; volatile boolean valueSet = false; public synchronized int get() { if (!valueSet) try { wait(); // 无限等待 //
阅读全文
该文被密码保护。
摘要:转自:http://www.ibm.com/developerworks/cn/java/j-jtp06197.html简介:Java™ 语言包含两种内在的同步机制:同步块(或方法)和 volatile 变量。这两种机制的提出都是为了实现代码线程的安全性。其中 Volatile 变量的同步性较差(但有时它更简单并且开销更低),而且其使用也更容易出错。在这期的Java 理论与实践中,Brian Goetz 将介绍几种正确使用 volatile 变量的模式,并针对其适用性限制提出一些建议。Java 语言中的 volatile 变量可以被看作是一种 “程度较轻的synchronized”;与sync
阅读全文
摘要:from csdn:http://files.cnblogs.com/wucg/csdn%E4%B8%8B%E8%BD%BDpartitionmagic8%C2%B70.rar确实可用。硬盘分区大小重新调整。
阅读全文
摘要://TestLock.javapackage com.test.thread;import java.util.ArrayList;import java.util.List;import java.util.concurrent.ExecutionException;import java.util.concurrent.ExecutorService;import java.util.concurrent.Executors;import java.util.concurrent.Future;import java.util.concurrent.TimeUnit;import java
阅读全文
摘要:ConcurrencyThe issue that can make a difference is blocking. If one task in your program is unable to continuebecause of some condition outside of the control of the program(typically I/O), we say that the taskor the thread blocks. Without concurrency, the whole program comes to a stop until the ext
阅读全文
摘要:@@TRANCOUNT 函数记录当前事务的嵌套级别。每个 BEGIN TRANSACTION 语句使 @@TRANCOUNT 增加 1。每个 COMMIT TRANSACTION 或 COMMIT WORK 语句使 @@TRANCOUNT 减去 1。没有事务名称的 ROLLBACK WORK 或 ROLLBACK TRANSACTION 语句将回滚所有嵌套事务,并使 @@TRANCOUNT 减小到 0。使用一组嵌套事务中最外部事务的事务名称的 ROLLBACK TRANSACTION 将回滚所有嵌套事务,并使 @@TRANCOUNT 减小到 0。在无法确定是否已经在事务中时,可以用 SELEC
阅读全文
摘要:I/OCreateing a good input/ouput (I/O) system is one of the most difficult tasks for alanguage designer. This is evidenced by the number of different approaches.The challenge seems to be in covering all possibilities. Not only are there differentsources and sinks of I/O that you want to communicate w
阅读全文
摘要:AnnotationAnnotaions (also known as metadata) provide a formalized way to add information to yourcode so that you can easily use that data at some later point.Defining annotationsHere is the definition of the annotation above. You can see that annotation definitionslook a lot like interface definiti
阅读全文
摘要:Anytime you want to use type information at runtime, you must first get a reference to the appropriate Class object. Class.forName() is one convenient way to do this, because you don't need an object of that type in order to get the Class reference.However, if you already have an object of the t
阅读全文
摘要:package dynamicproxy;public interface SimpleInterface { void doSth(); void doSthElse(String s);}package dynamicproxy;public class RealObject implements SimpleInterface { @Override public void doSth() { System.out.println("Real Object do sth"); } @Override public void doSthElse(String s) {
阅读全文
摘要:Scanner scan=new Scanner("11, " + "22, 33, 44"); scan.useDelimiter("\\s*,\\s*"); while(scan.hasNextInt()){ System.out.println(scan.nextInt()); }
阅读全文
摘要:最后推荐一些文章和书,这些文章和书大部分都与技术细节无关,它们讨论的是基于编程的令人心醉的文化,也适合非技术人员阅读。1.如何成为一名黑客。所有学习编程的都应该多看几遍这篇文章,至少把 Hacker 和 Cracker 的区别弄清楚。2.大教堂和市集。这是一篇关于 Linux 的经典文章。这里需要声明一下,我对那些 Windows 程序员没有偏见,只是我觉得作为一个以编程为职业的人,如果不参观一下 Linux/Unix 的深邃世界,未免太过狭隘。3.UNIX编程艺术。 这本书虽然名字叫做“编程艺术”,但里面并不讲授如何编程,而是全面展示了迷人的 Unix 哲学和文化。看完之后你会发现,那些看上
阅读全文
摘要:http://blogold.chinaunix.net/u/2925/showart_34179.html全名:埃里克·雷蒙德 任何一场革命或者运动都需要一个理论家,需要一份纲领性的文献,起到真正的"画龙点睛"的神效。除了架构极具思辩力和逻辑性的理论体系,更需要 激发起人们对美好理想的向往,为同行者的士气传递极具煽动性的烈焰。目前,这场正在颠覆软件业传统商业模式的自由软件运动也不例外。自由软件精神领袖当然 是理查德·斯托尔曼(Richard Stallman),但他太超凡脱俗,而且,除了提出核心理念外,斯托尔曼缺乏著书立作的能力。这些局限,使得埃里克&
阅读全文
摘要:Where storage lives1.Registers2.The stack3.The heap4.Constant storage5.Non-RAM storagejava Primitive type: Wrapper type1.boolean Boolean2.char 16 bits Character3.byte 8 bits Byte4.short 16 bits Short5.int 32 bits Integer6.long 64 bits Long7.float 32 bits Float8.double 64 bits Double9.void VoidHigh-p
阅读全文
该文被密码保护。
摘要:http://www.intel.com/products/processor/manuals/Intel® 64 and IA-32 Architectures Software Developer's ManualVolume 1: Basic ArchitectureDescribes the architecture and programming environment of processors supporting IA-32 and Intel® 64 Architectures.DownloadIntel® 64 and IA-32 A
阅读全文
摘要:#include <stdio.h>#include <stdlib.h>//在#define中,标准只定义了#和##两种操作。//#用来把参数转换成字符串,//##则用来连接两个前后两个参数,把它们变成一个字符串。#define parser(n) printf("token"#n"=%d\n",token##n)int main(){ int token9=10; parser(9); return 0;}//output://token9=10
阅读全文
摘要:复制构造函数, 赋值操作符 operator = ,析构函数 总称为复制控制 (Copy Control)e.g.:Code:#include <iostream>using namespace std;class T{public: T(){ cout<<"T constructor."<<endl; } T(const T& tobj){ cout<<" T copy construct from T:"<<&tobj<<endl; t=tobj.t; } //若
阅读全文
摘要:Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提供动态、数据库驱动网站的速度。Memcached基于一个存储键/值对的hashmap。其守护进程(daemon )是用C写的,但是客户端可以用任何语言来编写,并通过memcached协议与守护进程通信。但是它并不提供冗余(例如,复制其hashmap条目);当某个服务器S停止运行或崩溃了,所有存放在S上的键/值对都将丢失。Memcached官方:http://danga.com/memcached/关于Memcached的介绍请参考:Memca.
阅读全文