摘要: 通过一个实例简述数据库查询里FIND_IN_SET() 和IN()区别问题:数据库中有两个表: Orders 和 CompaniesOrders的表结构: OrderID | attachedCompanyIDs ------------------------------------ 1 1,2,3 2 2,4Campany表结构:CompanyID | name -------------------------------------- 1 ... 阅读全文
posted @ 2013-07-12 15:29 bus driver 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 通过php代码调用mail函数发送邮件, 一个原本很简单的功能, 几小时就写完了, 但调试却花了我一天的时间. 现在把这个过程记录下来, 供以后参考.问题描述: php mail 函数发送邮件, 头和内容分别为,$header = "MIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\nFrom: test"; $body = get_email_body($an_array);其中, 参数$an_array 是从数据库中读出的数据, 函数get_email_body将数组中的内容拆分出来,以table 阅读全文
posted @ 2013-06-07 17:06 bus driver 阅读(970) 评论(0) 推荐(0) 编辑
摘要: 通常情况下,当我们在程序里需要判断条件时,总会用到if else或是switch case,再或者for,while等等,这些都是编程语言内置好的,我们用就可以了。但是今天看到一篇文章,描述了一种不用任何条件语句,只用表达式做判断。原文链接地址http://www.cnblogs.com/westfly/archive/2011/10/11/2206844.html感觉挺有意思的,拿来分享。题目:求n的累加值 (1+2+3+......+n)代码如下:#include int sum(int n) { int tmp = 0; (n)&&(tmp = sum(n-1)); .. 阅读全文
posted @ 2013-01-21 14:27 bus driver 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 最近公司在搞security audit,项目里的applet被Fortify扫描后报了一个安全隐患,具体信息如下:Abstract: Non-final methods that perform security checks can be overridden in ways that bypass security checks. Explanation: If a method is overriden by a child class, the child class can bypass security checks in the parent class. Example: I 阅读全文
posted @ 2013-01-10 15:11 bus driver 阅读(1065) 评论(0) 推荐(0) 编辑
摘要: 在 JAVA中使用拖拽功能sun在java2中引入了一些新的方法来帮助实现拖拽功能,这些新的类在java.awt.dnd包中实现一个D&D操作一般包括三个步骤:首先实现一个拖拽源,这个拖拽源和相应的组件是关联起来的第二步实现一个拖拽目标,这个目标用来实现拖拽物的接收第三步实现一个数据传输对象,该对象封装拖动的数据 ______________________ ______________________ | | | ... 阅读全文
posted @ 2012-11-03 18:48 bus driver 阅读(823) 评论(0) 推荐(0) 编辑
摘要: Cross Site Request Forgery (CSRF) is one of the most common vulnerabilities in websites and web applications. As announced, CodeIgniter 2.0 will feature a built-in CSRF protection, which I’d like to analyze for you.In this year’sTop 10 of the Most Critical Security Risks in Web Applications, which i 阅读全文
posted @ 2012-10-22 16:21 bus driver 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 原谅我懒....英文调查记录实在不想翻译了....IntroductionThis document states the details of the changes from PHP5.1.6 to the latest version 5.4.5 and the impact on SORT web codes and otherlibraries.Currently, the basic environment for SORT site is likebelow:-RedHat Enterprise Linux Server release 5.5 (Tikanga) x86_64- 阅读全文
posted @ 2012-10-10 10:50 bus driver 阅读(475) 评论(0) 推荐(0) 编辑
摘要: 最近工作中遇到了关于cookie 的secure及httponly属性的问题, 所以关注并学习了一段时间,这里做一下简要记录。关于secure和httponly标志的用途可以参考wikipedia.Secure cookieA secure cookie has the secure attribute enabled and is only used via HTTPS, ensuring that the cookie is always encrypted when transmitting from client to server. This makes the cookie les 阅读全文
posted @ 2012-10-10 10:25 bus driver 阅读(590) 评论(0) 推荐(0) 编辑
摘要: 通常在网络上可以找到的方法是sed -i "s/oldString/newString/g" `grep oldString -rl /path`但是其中有太多的限制,比如 无法筛选哪些文件是你不想要的,你只能替换所有grep出来的文件,我在项目里遇到的一种情况是,这样的替换会同时影响到.svn文件,导致update的时候出现checksum error 错误,所有我又想到一种更好的方法,如下:Linux 下批量替换文件内容grep -rl "old string" ./ | grep -v "excluded string"| xa 阅读全文
posted @ 2012-09-26 18:01 bus driver 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 通常情况下,.Net环境下利用COM组件对MS Office进行操作就已经足够,但是有些时候com又显得不那么灵光,为了实现不同版本Office间的兼容问题,微软提供了office primary interop assemblies。但在实际运用中发现虽然他能够支持大部分的Office版本间的转换,但在Office 2010 Starter下,运用COM组件写好的代码却无法正常运行,所以为了操作的灵活性,我便引入了OpenXML2.0, 不调用Office组件,直接创建docx文档。 阅读全文
posted @ 2012-07-17 13:13 bus driver 阅读(215) 评论(0) 推荐(0) 编辑
Hello world