DFdou's Blog Life is short,Be yourself.

1002/100

Lazyer – 寻视觉设计师一枚

09年即将成为历史,在新的一年里,车间需要新生力量的加入。
寻找视觉设计师一枚,要求很简单,MM,36D+就可以了
呵呵,开个玩笑,言归正传,需求如下:
1.对手机终端UI开发有兴趣滴。
2.有手机 and 电脑 ?
3.每周有2天+空闲时间。
4.在杭州优先.
5.MM优先。
6.单身优先。
7.36D+优先。。。
8.党员不考虑。
-------------------------------------------------------------------------------------------
2009 will become history in the new year, we need new members next year.
Looking for a visual designer to require very simple, MM, 36D + could be a good choice.
Ha,just a joke, get on, demand is as follows:
1. For developers interested in mobile terminals UI drops.
2. Have a mobile phone and a computer?
3. Week 2 days + idle time.
4. In Hangzhou priority.
5.MM priority.
6. Single priority.
7.36D + priority. . .
8. Party members are not considered.

Tagged as: No Comments
1901/100

mklink 简单用法

mklink是 链接文件命令,具体用途是连接文件夹,或者说引用更来的直接?
什么时候会用到这个命令,以及在什么环境下可以用?
Windows平台下需要Vista或者更高版本,比如目前的Win7。
在非Windows下边基本都可以用。
Windows下的命令行如下,记得用管理员帐号运行cmd。

mklink "F:\目标文件夹" "E:\源文件夹" /j
Tagged as: No Comments
1301/100

Google-New Approach To China

真是每天都有新闻,今天比昨天的baidu被干掉还要厉害。Google官方博文如下(被xxx的党和谐了):

Like many other well-known organizations, we face cyber attacks of varying degrees on a regular basis. In mid-December, we detected a highly sophisticated and targeted attack on our corporate infrastructure originating from China that resulted in the theft of intellectual property from Google. However, it soon became clear that what at first appeared to be solely a security incident--albeit a significant one--was something quite different.

First, this attack was not just on Google. As part of our investigation we have discovered that at least twenty other large companies from a wide range of businesses--including the Internet, finance, technology, media and chemical sectors--have been similarly targeted. We are currently in the process of notifying those companies, and we are also working with the relevant U.S. authorities.

Second, we have evidence to suggest that a primary goal of the attackers was accessing the Gmail accounts of Chinese human rights activists. Based on our investigation to date we believe their attack did not achieve that objective. Only two Gmail accounts appear to have been accessed, and that activity was limited to account information (such as the date the account was created) and subject line, rather than the content of emails themselves.

Third, as part of this investigation but independent of the attack on Google, we have discovered that the accounts of dozens of U.S.-, China- and Europe-based Gmail users who are advocates of human rights in China appear to have been routinely accessed by third parties. These accounts have not been accessed through any security breach at Google, but most likely via phishing scams or malware placed on the users' computers.

2212/090

CSS-区分IE6,IE7,Firefox Hack

以下内容来自http://www.div-css.com/html/XHTML-CSS/hack/1136667.html

区别IE6与FF:
background:orange;*background:blue;

区别IE6与IE7:
background:green !important;background:blue;

区别IE7与FF:
background:orange; *background:green;

区别FF,IE7,IE6:
background:orange;*background:green !important;*background:blue;
注:IE都能识别*;标准浏览器(如FF)不能识别*;

IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;

另外再补充一个,下划线"_",
IE6支持下划线,IE7和firefox均不支持下划线。

于是大家还可以这样来区分IE6,IE7,firefox:
background:orange;
*background:green;
_background:blue;

注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。

Tagged as: , No Comments
2112/090

Js-复制到粘贴板

兼容FF和IE:

<script type="text/javascript">
function copyToClipboard(txt) {
	if(window.clipboardData) {
		 window.clipboardData.clearData();
		 window.clipboardData.setData("Text", txt);
	} else if(navigator.userAgent.indexOf("Opera") != -1) {
	  window.location = txt;
	} else if (window.netscape) {
	  try {
		   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
	 } catch (e) {
		  alert("被浏览器拒绝!\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
	 }
	 var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
	 if (!clip)
		  return;
	 var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
	 if (!trans)
		  return;
	 trans.addDataFlavor('text/unicode');
	 var str = new Object();
	 var len = new Object();
	 var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
	 var copytext = txt;
	 str.data = copytext;
	 trans.setTransferData("text/unicode",str,copytext.length*2);
	 var clipid = Components.interfaces.nsIClipboard;
	 if (!clip)
		  return false;
	 clip.setData(trans,null,clipid.kGlobalClipboard);
	 alert("复制成功!")
	}
}
</script>
3011/090

iPhone-Adobe Flash和Microsoft SliverLight

先牢骚下,早上打电话给it部门说win7的系统不提供技术支持,所以我要向上内网,先得把系统换成xp,无语。。
还好开短会的时候同事说可以解决,弄了下,使用802.1X可以直接验证,唉。。
OK,下边说正题,微软推iPhone版SL是在开会时候鸽子给的信息,来源是cnbeta,我估计Adobe看到这个消息会泪流满面,跟苹果交涉了那么久,最后还是被苹果拒绝。
从短文内容来看,似乎微软只是做了视频流的转换,我估计SL的虚拟机是无法撞到iPhone里去的,除非,,,除非微软用iPhone的sdk做一个虚拟机,当然这个以微软和adobe的实力都没什么问题,最重要的问题是,这个需要苹果说"OK"。不然啥都没的谈~~
从苹果做事的一贯做法和APP STORE和Flash的巨大竞争来看,我猜是没戏~~
不然adobe官方也不会无奈的给出这么一张图:
adobe flash

3011/090

CSS-CSS Sprite 图片合并技术

文章来自:http://www.51jquery.com/2009-03/css-sprite/
作为一个前段开发人员,还是需要知道一下的哈。

一,关于CSS Sprite
CSS Sprites是一种网页图片应用处理方式。它允许你将一个页面涉及到的所有零星图片都包含到一张大图中去,这样一来,当访问该页面时,载入的图片就不会 像以前那样一幅一幅地慢慢显示出来了。对于当前网络流行的速度而言,不高于200KB的单张图片的所需载入时间基本是差不多的,所以无需 顾忌这个问题。
按照yahoo的rules for high performance web sites的原则,应当较少Client与Server端间 的HTTP Request次数。通过CSS Sprites方法将多张图片组装成单独的一张图片,可以有效减少HTTP请求 的次数。
当整幅图片载入完成后,你就可以使用CSS方法通过设置背景位置的方式完成所需图片的准确调用。

加速的关键,不是降低重量,而是减少个数。传统切图讲究精细,图片规格越小越好,重量越小越好,其实规格大小无所谓,计算机统一都按byte计算。客户端每显示一张图片都会向服务器发送请求,所以,图片越多请求次数越多,造成延迟的可能性也就越大。

二,CSS Sprite的使用

有几篇关于CSS Sprites的文章,基本上把其原理和机制说明得很清楚。

What Are CSS Sprites?

How to create CSS sprites

Creating Rollover Effects with CSS Sprites

Building a Dynamic Banner with CSS Sprites

High Performance Web Sites中关于CSS Sprites的内容3.2. CSS Sprites

2511/090

记得关注你的竞争对手

browser
换了工作之后对工作工具的接触多了起来,上一个工作办公室Mac和Windows是5,5开,但是浏览器大家几乎都是Firefox,虽然要做下IE6,7的兼容,但是基本上不用去管IE8,Safari,理由很简单,国内客户基本用不到。这也算是个节约成本的做法,不过现在想想其实IE8和Safari相对IE6来说对CSS支持算很规范了(顺便呼吁一下"请升级您的IE6,thx")。至于Chrome,刚出来时候没发现自带调式工具,就一直放着,而且,习惯了Firefox,插件数量多嘛。
现在工作的地方Mac,Ubuntu差不多是55开,只有为数不多的人装了Windows,恩,我就是为数不多的其中一个哈哈。浏览器方面,IE6,7,8,Firefox,Chrome分布的很不均衡,只有为数不多的那群人装的是IE…
接触了一段时间才发现,原来Firebug类似的功能IE8,Chrome都是自带的,于是"豆腐你out,很out。" 现在是同时对我的评价,555啊~
flash vs sliverlight
因为主要在做Flash的工作,所以平时一般只关注Flash方面的新闻,Sliverlight在我看来一直是鸡肋,出了之后一直没当回事儿,国内对SL支持最多的估计就是腾讯,QQ安装包里有捆绑SL虚拟机,不知道MS这个单子付了多少米哈。MS自然也不是省油的灯,于是SL之后,SL3,SL4来了,有一天,忽然就发现SL已经完全不是当年的SL了,呵呵,谁叫平时不够关注哪。
怎么说呢,平时还是多关注点东西吧,尤其是竞争对手的产品,不然没法体现自己的优势的。
这就好比你和某人同时在追一个MM,你首先必须得了解MM(或者说消费者?),接着还要了解那个该死的情敌,这样才能做到知己知彼,百战不殆。
----------------------------------------------------------------------------------------------
最近打算装个Ubuntu,手痒吧,看隔壁,前后都是Ubuntu。
另外,在同学的影响下看了下Java,才发现说原来AS是这么繁琐的语法,Java简洁很多啊。

1811/090

Apache-mod_rewrite重定向模块的一些问题

应隔壁师傅要求,卸载了WAMP,重新下载PHP,Mysql,Apache,,说是要重新配置。
还好,也没有想象中那么麻烦,配置都还挺顺利。
不过在启用Apache的mod_rewrite模块的时候发现了点问题,虽然启用了,但是页面一直没有正确的重定向。
还原.htaccess,还是同样的问题,到底是哪里出了问题呢?
师傅指导:可能是目录权限配置问题,找了下,发现是httpd.conf配置里的Directory的AllowOverride None属性(有多层文件夹权限可以设置,搜索AllowOverride All比较容易找到)导致.htaccess配置被屏蔽。
把AllowOverride None改成AllowOverride All就可以了。

511/090

Validatious 2.0-表单验证JS

官方网站:http://validatious.org/learn/getting_started
一个方便易用的表单验证JS,话说网上此类JS非常多,这个是无需类库支持的一个,看了下还是比较方便的:

Include script

Download and include the script, preferably just before the closing body tag:

<script src="/design/js/validatious.min.js" type="text/javascript"></script>

Mark forms for validation

Default behaviour is for Validatious to validate all your forms with the class name validate:

<form class="validate" action="#" method="get"><!-- ... --></form>

You can change the class name through v2.Form.autoValidateClass.

Add validators

Adding validators is as simple as adding validator names as class names to input/select/textarea elements:

<input id="email" class="required email" name="email" type="text" />

* Prefix class names through v2.Validator.prefix.
* Available validators.
* Create your own validator.

Reasonable default error messages

Validatious guesses field names from label elements to make default error messages more usable:

<label for="name">Name</label>
<input name="name" id="name" class="required" type="text"/>

...yields "Name is required". So does this:

<label for="name" title="Name">Enter name:</label>
<input name="name" id="name" class="required" type="text"/>

More on field names
etc.,更多内容大家自己在官方看getting_started哈。

Tagged as: , No Comments
311/090

说说搜狗云输入法

官方地址:http://pinyin.sogou.com/cloud/
什么是搜狗输入法呢?

搜狗云输入法是基于搜狗拼音输入法,依托云计算技术的一个概念性输入法产品。与一般输入法最明显的区别在于,完全靠服务器运算,具有更强大语言模型和词库,能大幅提升输入准确率,特别是长句输入准确率。作为演示性的概念产品,目前搜狗云输入法只能在网页上使用,需要更完整丰富的输入体验,请下载并安装搜狗拼音输入法4.3版。

呵呵,应该说是JS应用的很妙的一个范例,我们来看下这是如何实现的:

简单的使用方法,不简单的技术含量。云输入法是依托于云计算技术的输入法,其与一般输入法最明显的区别在于,没有本地输入法文件,完全靠服务器支持。
搜狗云输入法是如何实现的
搜狗云输入法是基于JavaScript技术,利用Ajax通信原理,采用B/S架构。具有免安装,跨平台的优点,兼容Windows,Linux,Mac 等各个操作系统,兼容各个主流浏览器(IE,搜狗浏览器,Firefox )。实现了随时随地享受搜狗输入法的流畅输入体验。

当然因为是基于Ajax,如果你网速慢的话,那就死翘翘了,呵呵。另外,目前的版本似乎没有做用户习惯同步,以后的版本可能会支持的,用搜狗输入法的童鞋们期待吧。

Tagged as: , No Comments
2910/090

常用的几个正则表达式

以下内容来自网络,版权不明哈哈。
^\d+$  //匹配非负整数(正整数 + 0)
^[0-9]*[1-9][0-9]*$  //匹配正整数
^((-\d+)|(0+))$  //匹配非正整数(负整数 + 0)
^-[0-9]*[1-9][0-9]*$  //匹配负整数
^-?\d+$    //匹配整数
^\d+(\.\d+)?$  //匹配非负浮点数(正浮点数 + 0)
^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$  //匹配正浮点数
^((-\d+(\.\d+)?)|(0+(\.0+)?))$  //匹配非正浮点数(负浮点数 + 0)
^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$  //匹配负浮点数
^(-?\d+)(\.\d+)?$  //匹配浮点数
^[A-Za-z]+$  //匹配由26个英文字母组成的字符串
^[A-Z]+$  //匹配由26个英文字母的大写组成的字符串
^[a-z]+$  //匹配由26个英文字母的小写组成的字符串
^[A-Za-z0-9]+$  //匹配由数字和26个英文字母组成的字符串
^\w+$  //匹配由数字、26个英文字母或者下划线组成的字符串
^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$    //匹配email地址
^[a-zA-z]+://匹配(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$  //匹配url

匹配中文字符的正则表达式: [\u4e00-\u9fa5]
匹配双字节字符(包括汉字在内):[^\x00-\xff]
匹配空行的正则表达式:\n[\s| ]*\r
匹配HTML标记的正则表达式:/< (.*)>.*< \/>|< (.*) \/>/
匹配首尾空格的正则表达式:(^\s*)|(\s*$)
匹配Email地址的正则表达式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
匹配网址URL的正则表达式:^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$
匹配帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线):^[a-zA-Z][a-zA-Z0-9_]{4,15}$
匹配国内电话号码:(\d{3}-|\d{4}-)?(\d{8}|\d{7})?
匹配腾讯QQ号:^[1-9]*[1-9][0-9]*$

2310/090

13+ CSS Editor Help You Create Perfect Website

Learned from http://ntt.cc/2009/10/29/13-hand-picked-css-editor-help-you-create-perfect-website.html
我只用过Firebug呵呵,针对CSS的编辑器还真么用过,个人觉得Firebug+手写比较方便=。=
下边是作者介绍的13+个编辑器,总的来说嘛就是傻瓜式样式选择,我也没测试过,不知道生成的CSS代码规范性如何。
Astyle CSS editor


Astyle is a visual CSS editor. Features:

  • Visual easy-to-use interface
  • Graphic tree-type view of attachment files and the CSS structure
  • Grouped view of properties and selectors
  • Automatic selection and grouping of CSS selectors from a markup language document
  • Source CSS, HTML, XML highlight code editor
  • Active preview current selectors and documents with IE and Mozilla supportAstyle
    不推荐,没别的,界面难看嘿嘿。
  • 2010/090

    Icons-地图程序标记素材分享

    具体下载地址如下:http://code.google.com/p/google-maps-icons/
    这看名字哪,是给Google Map用的标记,下边是几个示例:

    Administration, Office & Industry

    All the icons in this Icon Category described and tagged.

    Culture & Entertainment

    All the icons described and tagged.

    Education & Kids

    All the icons described and tagged.

    Events & Weather

    All the icons described and tagged.

    Tagged as: No Comments
    1410/090

    JS Bin

    JS Bin是一个在线DebugJavascript和CSS的地方,大伙儿自己看吧奥~
    JS Bin is a webapp specifically designed to help JavaScript and CSS folk test snippets of code, within some context, and debug the code collaboratively.

    JS Bin allows you to edit and test JavaScript and HTML. Once you’re happy you can save, and send the URL to a peer for review or help. They can then make further changes saving anew if required.

    The original idea spawned from helping developers debugging an Ajax issue. The original aim was to build it using Google’s app engine, but in the end, it was John Resig’s Learning app that inspired Remy Sharp to build the whole solution in JavaScript with liberal dashes of jQuery and a tiny bit of LAMP for the saving process.

    javascript-online

    Tagged as: No Comments
    Page 1 of 712345...Last »