摘要:start.sh#!/bin/shJAVA_HOME="/root/app/jdk1.8.0_25"CATALINA_BASE="/root/app/apache-tomcat-8.0.15"CATALINA_HOME="/root/app/apache-tomcat-8.0.15"JRE_HOME...
阅读全文
摘要:最简单的方式 var t = new Task(() => { throw new Exception("unknow excption"); }); t.Start(); try ...
阅读全文
摘要:var nums = Enumerable.Range(1,4).ToArray(); int total = 0; Parallel.For( fromInclusive: 0, toExclu...
阅读全文
摘要:TheadPool的问题不支持线程的取消、完成、失败通知等交互性操作不支持线程执行先后次序using System;using System.Diagnostics;using System.Threading;using System.Threading.Tasks;namespace Conso...
阅读全文
摘要:线程的空间开销线程内核对象。包含上下文信息。32位系统占用700字节线程环境块。包括线程的异常处理链。32位系统占用4KB用户模式栈。保存方法的参数、局部变量和返回值内核模式栈。调用操作系统的内核模式函数时,系统会将函数参数从用户模式栈复制到内核模式栈。32位系统占用12KB线程的时间开销创建时,系...
阅读全文
摘要:using System;using System.Threading;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { va...
阅读全文
摘要:using System;using System.Threading;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { va...
阅读全文
摘要:多线程会有一个工作线程,占用更多的CPU。异步将使用DMA模式的IO操作using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text...
阅读全文
摘要:Year.NET FrameworkC# 200211 20031.11 200522泛型200632WPF\WCF\WF20073.53LINQ201044DLR20124.55async
阅读全文
摘要:假设class S { }class A : S { }class B : S { }下面的代码是可以编译通过的S[] array = new A[5];array[0] = new B();List list = new List();运行结果:第一行代码是可以编译通过的第二行代码运行时报错第三行...
阅读全文
摘要:int s = 5;int? s_null;long t;long? t_null;t = s; //隐式转换 S -> Ts = (int)t; //显示转换 T -> Ss_null = s; //隐式转换 S -> S?s = (int)s_null; //显示转换 S? -> Tt_null...
阅读全文
摘要:1 //null 只在肯定返回null值时才使用null比较 2 var element = document.getElementById("my-div"); 3 if (element === null) { 4 5 }; 6 //string number boolean undefined 7 var num = 123; 8 if (typeof num === "number") { 9 10 };11 12 /*13 检查引用值14 Date RegExp Error15 跨域的检查会有问题16 */17 if (value instan
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Text;using System.Threading;using System.Threading.Tasks;namespace ConsoleApplication1{ public class Download { object LockObject = new object(); public static void Main(string[] args) ...
阅读全文
摘要:1 在goodspeed.web.model下建立*类(空的构造,属性访问与设置),同时配置*.hbm.xml文件与数据库挂起来2 在goodspeed.web.dao建立*Dao和*Daoimpl类(继承HibernateDaoSupport),实现数据库操作*Daoimpl可以直接返回List等3 在applicationContext.xml中建一个bean 4 相应Service如果需要*Dao只需要高架对*Dao的引用即可
阅读全文
摘要:struts如果实现了CookiesAware了,还需要引用org.apache.struts2.interceptor.CookieInterceptor过滤器,否则拿不到值同时还要能看到这样的错误No object in the CompoundRoot has a publicly accessible property named 'JSESSIONID'解决办法是1 把struts.devMode设为false2 增加一个setJSESSIONID(String value)的空方法spring自动加载想按名称加载写成struts.objectFactory.spri
阅读全文
摘要:1 在action中写了interceptor-ref就不会用defaultStack啦。得自己补上2 继承CookiesAware是不够的,得在action中配置一下 cookiename * 3 mysql要改my.cnf才能接受对外链接,只改个user表是不够的4 mysql在创建数据库时最好指定为utf-8。否则中文乱码
阅读全文
摘要:using System;using System.Collections.Generic;using System.Diagnostics;using System.Linq;using System.Threading;namespace MyConsole.ThreadDemo{ class Lock { static int Storeage { get; set; } static object LockObject = new object(); static void Main(string[] args) { ...
阅读全文