代码改变世界

sudo

2011-09-19 23:52 by wildboar, 191 阅读, 0 推荐, 收藏, 编辑
摘要:the system sometimes shows the message “xxx is not in the sudoers file. This incident will be reported” when we use sudo command. XXX is your username We could use ‘visudo’ command to resolve this is... 阅读全文

SQLSTATE[HY000] [2002] Can't connect to local MySQL server

2011-08-02 22:41 by wildboar, 2643 阅读, 0 推荐, 收藏, 编辑
摘要:Just need to use 127.0.0.1 instead of 'localhost' in the configuration fileI just know the solution above, but I dont know the reason, I google this issue and find the url belowhttp://forums.zend.com/viewtopic.php?f=69&t=1832It gives me more details about this issue, but I still didn' 阅读全文

Utime failed: Permission denied in Smarty/sysplugins/smarty_internal_template.php on line xxx

2011-08-02 22:38 by wildboar, 1331 阅读, 0 推荐, 收藏, 编辑
摘要:Just change the source code followingsif ($saved_timestamp = $this->getCompiledTimestamp()) {to the below$saved_timestamp = $this->getCompiledTimestamp();if (saved_timestamp) { there is an useful article for this issue on smarty forumhttp://www.smarty.net/forums/viewtopic.php?p=69488 阅读全文

Add Reference

2011-07-10 14:45 by wildboar, 1228 阅读, 0 推荐, 收藏, 编辑
摘要:We use ‘using’ key word to add the namespace in the application, but the system still give us the message that it could not find the specific class. As usually, we forgot to add the reference in the a... 阅读全文

Mysql Error Code : 1436 Thread stack overrun

2011-07-02 23:15 by wildboar, 4786 阅读, 0 推荐, 收藏, 编辑
摘要:I meet with the error while calling stored procedures from the MySql in my Mac. It similar as the description below:ERRNO: 256TEXT: SQLSTATE[HY000]: General error: 1436 Thread stack overrun: 4904 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld -O thread_stack=#' to sp 阅读全文

Aggregate Functions - How to handle NULL

2011-06-27 10:38 by wildboar, 172 阅读, 0 推荐, 收藏, 编辑
摘要:I use the sql scripts above to insert some data into another table, the system show the 'warning' message (inside the red rectangle) to me. I found the 'aggregation function' would eliminate the 'NULL' .For example:count(id), the value you will get is 4, but count(createuser) 阅读全文

Parallel World 5 – Concurrent Collections (1)

2011-06-14 17:01 by wildboar, 351 阅读, 0 推荐, 收藏, 编辑
摘要:从本节开始,我们将要重点介绍如何解决并行运算中的哪两个问题。竞态问题其实就是一个共享数据的问题,所以许多资料也干脆把这个问题称为Share Data. 在多线程环境中我们知道很多解决这个问题的方法; .NET Framework 4 提供了System.Collections.Concurrent一个新的命名空间来解决这个问题。 当开发人员在开发并行程序的过程中,需要在多个并行Task之间共享一个... 阅读全文

Parallel World 3 – Parallel Task (2)

2011-06-08 15:18 by wildboar, 281 阅读, 0 推荐, 收藏, 编辑
摘要:I. 监控Task是否取消1. 监控CancellationToken的IsCancellationRequested属性并抛出System.OperationCanceledException如果IsCancellationRequested是true, 系统需要中断task,释放它所使用的资源,同时要抛出OperationCanceledException,注意如果你在代码中不抛出这个异常,task就不会被正确设置状态;同时最好把CancellationToken做为这个异常的一个参数放到此异常中。 1: if (token.IsCancellationRequested) 2: { 3: 阅读全文

Javascript Tips

2011-06-08 11:41 by wildboar, 143 阅读, 0 推荐, 收藏, 编辑
摘要:You will encounter the issue below, you could not debug the javascripts, when you use the following systax; You could successfully debug the scripts when you change the scripts to the followings: 阅读全文

Parallel World 4 – Parallel Task (1)

2011-06-03 14:53 by wildboar, 260 阅读, 0 推荐, 收藏, 编辑
摘要:I. 概述在.NET Framework 4之前,如果我们要使用多核或者多CPU的优势,我们需要使用多线程的方式(大家感兴趣可以参考我的另一篇关于线程方面的文章)。在.NET Framework 4中,微软提供了一个新的命名空间System.Threading.Tasks来实现并行,通常被称为TPL。TPL引入了一种新的基于task的编程模型,我们使用它可以很轻松的实现并行,使开发人员从跟底层的Thread打交道的方式解放出来。但是注意task并没有取代thread, 而实际上task是基于thread的,这一系列文章之后我会写一篇关于二者之间关系的文章。II. 创建和启动Task 1: st 阅读全文