update table_all a set a.phoneNo=b.phoneNo from table_new b where a.name =b.name
update table_all set table_all.phoneNo = (select table_new.phoneNo from table_new where table_all.name = table_new.name)
update table_all a set a.phoneNo=b.phoneNo from table_new b where a.name =b.name
update table_all set table_all.phoneNo = (select table_new.phoneNo from table_new where table_all.name = table_new.name)
以下是他回忆当时的笔试题
一、
1、有如下HTML:<img title=’aaaa’ sina_title=’bbbb’ id=’img1′>
1)用js取得________方法取得该对象;
2)用________属性取得属性title的属性值;
3)用________方法取得属性sina_title的属性值;
2、php中对数组序列化和反序列化的函数分别是______和_______;
3、rawurlencode和urlencode函数的区别是__________________;
4、php中过滤HTML的函数是_______,转义的函数是____________;
5、写出用正则把HTML中的js脚本过滤掉;
6、SQL中LEFT JOIN的含义是______________;
如果有一个表tl_user存储学生ID和名字name,另外一个表tl_score存储学生ID、科目subject和成绩score(有的学生没有考试成绩),写出sql语句打印出学生名字和各科总成绩;
7、写出三个调用系统命令的函数; Continue reading
/**
* ThumbHandler
* @access public
*/
/*
使用方法:
自动裁切:
程序会按照图片的尺寸从中部裁切最大的正方形,并按目标尺寸进行缩略
$t->setSrcImg(“img/test.jpg”);
$t->setCutType(1);//这一句就OK了
$t->setDstImg(“tmp/new_test.jpg”);
$t->createImg(60,60);
手工裁切:
程序会按照指定的位置从源图上取图
$t->setSrcImg(“img/test.jpg”);
$t->setCutType(2);//指明为手工裁切
$t->setSrcCutPosition(100, 100);// 源图起点坐标
$t->setRectangleCut(300, 200);// 裁切尺寸
$t->setDstImg(“tmp/new_test.jpg”);
$t->createImg(300,200);
*/ Continue reading
PHP生 成word文档的代码,这个是用来生产试卷的简单PHP代码
以下为引用的内容:
<?php
//初始化session
session_start();
// 包含数据库连接文件和头文件
?> Continue reading
有朋友问到淘宝是怎么压缩js和css的,这里分享下。
我们使用的是YUI Compressor:
The YUI Compressor is a JavaScript compressor which, in addition to removing comments and white-spaces, obfuscates local variables using the smallest possible variable name. This obfuscation is safe, even when using constructs such as ‘eval’ or ‘with’ (although the compression is not optimal is those cases) Compared to jsmin, the average savings is around 20%.
The YUI Compressor is also able to safely compress CSS files. The decision on which compressor is being used is made on the file extension (js or css)
淘宝前端的开发环境以Windows居多。为了方便使用,对YUICompressor做了层简单的封装,称之为TBCompressor. 安装和使用方法如下: Continue reading
SCWS 是 Simple Chinese Words Segmentation 的缩写,即简易中文分词系统。
这是一套基于词频词典的机械中文分词引擎,它能将一整段的汉字基本正确的切分成词。词是汉语的基本语素单位,而书写的时候不像英语会在词 之间用空格分开,所以如何准确而又快速的分词一直是中文分词的攻关难点。
SCWS 在概念上并无创新成分,采用的是自行采集的词频词典,并辅以一定程度上的专有名称、人名、地名、数字年代等规则集,经小范围测试大概准确率在 90% ~ 95% 之间,已能基本满足一些中小型搜索引擎、关键字提取等场合运用。 SCWS 采用纯 C 代码开发,以 Unix-Like OS 为主要平台环境,提供共享函数库,方便植入各种现有软件系统。此外它支持 GBK,UTF-8,BIG5 等汉字编码,切词效率高。 Continue reading
比较IN()里面的数据
许多数据库服务器都只把IN()看作多个OR的同义词,因为它们在逻辑上是相等的。MYSQL不是这样的,它会对IN()里面的数据进行排序,然后用二分法查找个是否在列表中,这个算法的效率是O(Logn),而等同的OR子句的查找效率是O(n)。在列表很大的时候,OR子句就会变得慢得多。
这里的语句和Oracle数据库里是一样的。
一个内存释放的实例
CollectGarbage, 是IE的一个特有属性,用于释放内存的使用方法嘛应该是,将该变量或引用对象,设置为null或delete然后在进行释放动作
在 做CollectGarbage前,要必需清楚的两个必备条件:
function cleanAndPaste(html) …{
// Remove all SPAN tags
html = html.replace(/</?SPAN[^>]*>/gi, “” );
// Remove Class attributes
html = html.replace(/<(w[^>]*) class=([^ |>]*)([^>]*)/gi, “<$1$3″) ;
// Remove Style attributes
html = html.replace(/<(w[^>]*) style=”([^”]*)”([^>]*)/gi, “<$1$3”) ;
// Remove Lang attributes
html = html.replace(/<(w[^>]*) lang=([^ |>]*)([^>]*)/gi, “<$1$3”) ;
// Remove XML elements and declarations
html = html.replace(/<\??xml[^>]*>/gi, “”) ;
// Remove Tags with XML namespace declarations: <o:p></o:p>
html = html.replace(/</?w+:[^>]*>/gi, “”) ;
// Replace the
html = html.replace(/ /, ” ” );
// Transform <P> to <DIV>
var re = new RegExp(“(<P)([^>]*>.*?)(</P>)”,”gi”) ; // Different because of a IE 5.0 error
html = html.replace( re, “<div$2</div>” ) ;
return html;
}