Goodspeed

导航

随笔分类 -  Web技术

1 2 3 4 5 下一页

canvas时钟
摘要:Clock 阅读全文

posted @ 2015-03-11 22:56 Goodspeed 阅读(363) 评论(0) 推荐(0) 编辑

火箭起飞
摘要:Rock ... 阅读全文

posted @ 2015-01-21 23:25 Goodspeed 阅读(379) 评论(0) 推荐(1) 编辑

让图标转起来
摘要:Rock Rock 阅读全文

posted @ 2015-01-21 23:01 Goodspeed 阅读(433) 评论(0) 推荐(0) 编辑

Tomcat启动脚本
摘要: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... 阅读全文

posted @ 2014-11-26 14:32 Goodspeed 阅读(2220) 评论(0) 推荐(0) 编辑

Task中的异常处理
摘要:最简单的方式 var t = new Task(() => { throw new Exception("unknow excption"); }); t.Start(); try ... 阅读全文

posted @ 2014-11-02 21:16 Goodspeed 阅读(1900) 评论(0) 推荐(0) 编辑

Parallel的陷阱
摘要:var nums = Enumerable.Range(1,4).ToArray(); int total = 0; Parallel.For( fromInclusive: 0, toExclu... 阅读全文

posted @ 2014-11-02 12:44 Goodspeed 阅读(367) 评论(0) 推荐(0) 编辑

用Task代替TheadPool
摘要:TheadPool的问题不支持线程的取消、完成、失败通知等交互性操作不支持线程执行先后次序using System;using System.Diagnostics;using System.Threading;using System.Threading.Tasks;namespace Conso... 阅读全文

posted @ 2014-11-02 10:52 Goodspeed 阅读(510) 评论(0) 推荐(0) 编辑

使用ThreadPool代替Thread
摘要:线程的空间开销线程内核对象。包含上下文信息。32位系统占用700字节线程环境块。包括线程的异常处理链。32位系统占用4KB用户模式栈。保存方法的参数、局部变量和返回值内核模式栈。调用操作系统的内核模式函数时,系统会将函数参数从用户模式栈复制到内核模式栈。32位系统占用12KB线程的时间开销创建时,系... 阅读全文

posted @ 2014-11-02 10:29 Goodspeed 阅读(659) 评论(0) 推荐(0) 编辑

正确停止线程
摘要:using System;using System.Threading;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { va... 阅读全文

posted @ 2014-11-02 10:02 Goodspeed 阅读(533) 评论(0) 推荐(0) 编辑

线程同步中使用信号量AutoResetEvent
摘要:using System;using System.Threading;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { va... 阅读全文

posted @ 2014-11-02 09:54 Goodspeed 阅读(362) 评论(0) 推荐(0) 编辑

异步和多线程的区别
摘要:多线程会有一个工作线程,占用更多的CPU。异步将使用DMA模式的IO操作using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text... 阅读全文

posted @ 2014-11-02 09:26 Goodspeed 阅读(917) 评论(0) 推荐(0) 编辑

C#和.NET Framework的关系
摘要:Year.NET FrameworkC# 200211 20031.11 200522泛型200632WPF\WCF\WF20073.53LINQ201044DLR20124.55async 阅读全文

posted @ 2014-07-24 17:43 Goodspeed 阅读(300) 评论(0) 推荐(0) 编辑

为什么泛型不支持协变性?
摘要:假设class S { }class A : S { }class B : S { }下面的代码是可以编译通过的S[] array = new A[5];array[0] = new B();List list = new List();运行结果:第一行代码是可以编译通过的第二行代码运行时报错第三行... 阅读全文

posted @ 2014-06-29 23:38 Goodspeed 阅读(463) 评论(0) 推荐(0) 编辑

可空值类型与值类型这间的转换
摘要: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... 阅读全文

posted @ 2014-06-29 23:21 Goodspeed 阅读(935) 评论(0) 推荐(0) 编辑

JS中的各种检测
摘要: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 阅读全文

posted @ 2014-01-26 11:08 Goodspeed 阅读(434) 评论(0) 推荐(0) 编辑

WebClient的异步处理
摘要: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) ... 阅读全文

posted @ 2014-01-07 16:46 Goodspeed 阅读(3288) 评论(0) 推荐(0) 编辑

SSH集成步骤
摘要:1 在goodspeed.web.model下建立*类(空的构造,属性访问与设置),同时配置*.hbm.xml文件与数据库挂起来2 在goodspeed.web.dao建立*Dao和*Daoimpl类(继承HibernateDaoSupport),实现数据库操作*Daoimpl可以直接返回List等3 在applicationContext.xml中建一个bean 4 相应Service如果需要*Dao只需要高架对*Dao的引用即可 阅读全文

posted @ 2013-11-21 10:49 Goodspeed 阅读(332) 评论(0) 推荐(0) 编辑

今天踩过的坑——structs和spring
摘要: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 阅读全文

posted @ 2013-11-19 18:01 Goodspeed 阅读(396) 评论(0) 推荐(0) 编辑

今天踩过的坑——structs和mysql
摘要:1 在action中写了interceptor-ref就不会用defaultStack啦。得自己补上2 继承CookiesAware是不够的,得在action中配置一下 cookiename * 3 mysql要改my.cnf才能接受对外链接,只改个user表是不够的4 mysql在创建数据库时最好指定为utf-8。否则中文乱码 阅读全文

posted @ 2013-11-14 17:38 Goodspeed 阅读(158) 评论(0) 推荐(0) 编辑

线程与并发系列一:Lock、Monitor、UserSpinLock
摘要: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) { ... 阅读全文

posted @ 2013-06-19 22:48 Goodspeed 阅读(567) 评论(0) 推荐(0) 编辑

1 2 3 4 5 下一页