HashFlare
Tags Posts tagged with "置顶 TOP"

置顶 TOP

置顶到首页top block

Although this Articles simply collects and gathers links for all front-end developer’s or designer’s reference, but it’s really important to introduce or remind us about ‘Wireframing’.

Basics:
• What's Wireframes and why is it important

A website wireframe, also known as a page schematic or screen blueprint, is a visual guide that represents the skeletal framework of a website.

网站的线框 ,也被称作页面蓝图或页面原理图,是展现网站页面的结构的可视化指导。
Wireframes are created for the purpose of arranging elements to best accomplish a particular purpose. The purpose is usually being informed by a business objective and a creative idea.

创建的线框用于更好的布局页面元素以实现特定的设计目标,而设计目标则是通过业务目标和创新想法来引导。
The wireframe depicts the page layout or arrangement of the website’s content, including interface elements and navigational systems, and how they work together.

线框描绘了页面布局或布局了页面的内容,包含界面元素和导航元素以及他们如何一起工作。

The wireframe usually lacks typographic style, color, or graphics, since the main focus lies in functionality, behavior, and priority of content.In other words, it focuses on what a screen does, not what it looks like.

线框通常缺乏印刷风格、色彩和图形,由于主要是集中在功能性,行为和优先级。换句话说,它专注于屏幕的功能,而不是它的外观。
Wireframes can be pencil drawings or sketches on a whiteboard, or they can be produced by means of a broad array of free or commercial software applications. Wireframes are generally created by business analysts, user experience designers, developers, visual designers and other roles with expertise in interaction design, information architecture and user research.

线框可以是白板上的铅笔画或草图,或者可以通过广泛的免费或商业软件等应用程序制作生成。 线框通常由业务分析师,用户体验设计师,开发人员,视觉设计师和其他在交互设计,信息架构和用户研究方面具有专长的人员创建。

profilewireframe

Wireframes focus on:

The range of functions available
The relative priorities of the information and functions
The rules for displaying certain kinds of information
The effect of different scenarios on the display
The website wireframe connects the underlying conceptual structure, or information architecture, to the surface, or visual design of the website.
Wireframes help establish functionality, and the relationships between different screen templates of a website. An iterative process, creating wireframes is an effective way to make rapid prototypes of pages, while measuring the practicality of a design concept. Wireframing typically begins between “high-level structural work—like flowcharts or site maps—and screen designs.”
Within the process of building a website, wireframing is where thinking becomes tangible
–https://en.wikipedia.org/wiki/Website_wireframe

Course&Certificate/课程&认证:

UI/UX Design

why is it important?
http://45royale.com/blog/importance-wireframing/

• The Future of Wireframes

Time to re-assess and understand how to make good use of Wireframes:
https://madebymany.com/blog/the-future-of-wireframes

• Wireframing Is Not a Religion

Wireframing is an important design method, a digital design board, you can amend or wipe out anytime
http://52weeksofux.com/post/866406780/wireframing-is-not-a-religion

• Five Commandments for Wireframing

Paul Boag is a fan of Wireframing, he believes that it is one necessity part of design
https://boagworld.com/design/wireframing-rules/

• 20 Steps to Better Wireframing

Possibly the biggest mistake in any development project is failure to plan.
http://blog.teamtreehouse.com/20-steps-to-better-wireframing

Some Resources and Round-Ups
• Tools

Opensource: http://pencil.evolus.vn/Default.html

COTS: viso, etc.

• I Love Wireframing
 http://wireframes.tumblr.com/
 一个tumblog专注于线框,原型,实物设计。
• Wireframe Showcase
 http://www.wireframeshowcase.com/
 在这个网站可以查看一些基于线框设计的网站,可分析学习设计人员是如何将实体模型转化为设计的。因为线框和设计都是由设计者自己上传的,每个线框设计都包含了一个简短的说明。大部分的网站原来是数字实物模型,有容易修改和重新设计的优势。起结果是令人愉快的线框设计。
• Standard Screen Patterns for Web Interface Design

http://designingwebinterfaces.com/designing-web-interfaces-12-screen-patterns
一些互动设计的原则和模式

• 50 Free UI and Web Design Wireframing Kits and Resources

https://www.smashingmagazine.com/2010/02/50-free-ui-and-web-design-wireframing-kits-resources-and-source-files/
这篇文章关注一些线框工具和独立的应用程序,包括一些你可以用来制作自己线框图的一些工具:线框工具集,浏览器窗口,表单元素,网格,Mac OS X元素和手机元素,你可以在任何图形编辑器中使用他们,PS,AI,甚至纸笔工具。

• A Collection of Printable Sketch Templates and Sketch Books for Wireframing

http://www.geekchix.org/blog/2010/01/03/a-collection-of-printable-sketch-templates-and-sketch-books-for-wireframing/
20个资源,用于应用程序开发的草图阶段。

• A Collection of Printable Web Browser Sketching and Wireframe Templates

https://speckyboy.com/a-collection-of-printable-web-browser-sketching-and-wireframe-templates/
这些可打印的草图模板都是特意为web设计人员设计的。附加有浏览器的版本说明(Safari,Chrome甚至Firefox)

• Useful(Offline) Utensils and Tookits for Designers

http://www.hongkiat.com/blog/useful-offline-utensils-and-toolkits-for-designers/

Free Wireframing Kits, UI Design Kits, PDFs and Resources – Smashing Magazine_files
当你可以使用一个预制指南来节省时间,更好的发挥你的创造力,为什么还要从头开始设计呢?在这篇文章中,你将得到很多很棒的免费工具,一个笔记集合以及一些要购买的产品来帮助你线下设计。

emotion_icon

emotion source(partial):

[{"phrase":"[微笑]","type":"face","url":"/emotion/5c/huanglianwx_org.gif","hot":false,"common":true,"category":"","icon":"/emotion/5c/huanglianwx_thumb.gif","value":"[微笑]","picid":""},{"phrase":"[嘻嘻]","type":"face","url":"/emotion/0b/tootha_org.gif","hot":false,"common":true,"category":"","icon":"/emotion/0b/tootha_thumb.gif","value":"[嘻嘻]","picid":""},{"phrase":"[哈哈]","type":"face","url":"/emotion/6a/laugh.gif","hot":false,"common":true,"category":"","icon":"/emotion/6a/laugh.gif","value":"[哈哈]","picid":""},{"phrase":"[可爱]","type":"face","url":"/emotion/14/tza_org.gif","hot":false,"common":true,"category":"","icon":"/emotion/14/tza_thumb.gif","value":"[可爱]","picid":""}]

download icons to local using c# webclient:
The DownloadFileAsync/DownloadFileCompleted members of WebClient use the Event-based Asynchronous Pattern. If you want to use async and await, you should be using the Task-based Asynchronous Pattern.
In this case, you should use the DownloadFileTaskAsync member, as such(Please note that your Context.listOfLocalDirectories.Add and Errors.printError methods should be threadsafe.):

private async Task DownloadFileAsync(DocumentObject doc)
{
try
{
using (WebClient webClient = new WebClient())
{
string downloadToDirectory = @Resources.defaultDirectory + value.docName;
webClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
await webClient.DownloadFileTaskAsync(new Uri(value.docUrl), @downloadToDirectory);

//Add them to the local
Context.listOfLocalDirectories.Add(downloadToDirectory);
}
}
catch (Exception)
{
Errors.printError("Failed to download File: " + value.docName);
}
}

private async Task DownloadMultipleFilesAsync(List doclist)
{
await Task.WhenAll(doclist.Select(doc => DownloadFileAsync(doc)));
}

emotion.js:

/**
* Doc emotions
* @author LIU YUE
*/

//customize hashtable
function Hashtable() {
this._hash = new Object();
this.put = function(key, value) {
if (typeof (key) != "undefined") {
if (this.containsKey(key) == false) {
this._hash[key] = typeof (value) == "undefined" ? null : value;
return true;
} else {
return false;
}
} else {
return false;
}
}
this.remove = function(key) { delete this._hash[key]; }
this.size = function() { var i = 0; for (var k in this._hash) { i++; } return i; }
this.get = function(key) { return this._hash[key]; }
this.containsKey = function(key) { return typeof (this._hash[key]) != "undefined"; }
this.clear = function() { for (var k in this._hash) { delete this._hash[k]; } }
}

var emotions = new Array();
var categorys = new Array();
var uPeterEmotionsHt = new Hashtable();

$(function () {
var emotionsource="/content/js/" + "emotion_source.js"+ "?v=" + Math.random();
setTimeout(function () { $.getScript(emotionsource)}, 1E3);
});

function AnalyticEmotion(s) {
if(typeof (s) != "undefined") {
var sArr = s.match(/\[.*?\]/g);
if (sArr != null) {
for (var i = 0; i < sArr.length; i++) { if (uPeterEmotionsHt.containsKey(sArr[i])) { var src = "/content/image/" + uPeterEmotionsHt.get(sArr[i]); var reStr = "";
s = s.replace(sArr[i], reStr);
}
}
}
}
return s;
}

(function($){
$.fn.PeterEmotion = function(target){
var cat_current;
var cat_page;
$(this).click(function(event){
event.stopPropagation();

var eTop = target.offset().top + target.height() + 15;
var eLeft = target.offset().left - 1;

if($('#emotions .categorys')[0]){
$('#emotions').css({top: eTop, left: eLeft});
$('#emotions').toggle();
return;
}
$('body').append('

');
$('#emotions').css({top: eTop, left: eLeft});
$('#emotions').html('

正在加载,请稍候...

');
$('#emotions').click(function(event){
event.stopPropagation();
});

$('#emotions').html('

');
$('#emotions #prev').click(function(){
showCategorys(cat_page - 1);
});
$('#emotions #next').click(function(){
showCategorys(cat_page + 1);
});
showCategorys();
showEmotions();

});
$('body').click(function(){
$('#emotions').remove();
});
$.fn.insertText = function(text){
this.each(function() {
if(this.tagName !== 'INPUT' && this.tagName !== 'TEXTAREA') {return;}
if (document.selection) {
this.focus();
var cr = document.selection.createRange();
cr.text = text;
cr.collapse();
cr.select();
}else if (this.selectionStart || this.selectionStart == '0') {
var
start = this.selectionStart,
end = this.selectionEnd;
this.value = this.value.substring(0, start)+ text+ this.value.substring(end, this.value.length);
this.selectionStart = this.selectionEnd = start+text.length;
}else {
this.value += text;
}
});
return this;
}
function showCategorys(){
var page = arguments[0]?arguments[0]:0;
if(page < 0 || page >= categorys.length / 5){
return;
}
$('#emotions .categorys').html('');
cat_page = page;
for(var i = page * 5; i < (page + 1) * 5 && i < categorys.length; ++i){ $('#emotions .categorys').append($('' + categorys[i] + ''));
}
$('#emotions .categorys a').click(function(){
showEmotions($(this).text());
});
$('#emotions .categorys a').each(function(){
if($(this).text() == cat_current){
$(this).addClass('current');
}
});
}
function showEmotions(){
var category = arguments[0]?arguments[0]:'默认';
var page = arguments[1]?arguments[1] - 1:0;
$('#emotions .container').html('');
$('#emotions .page').html('');
cat_current = category;
var path = "/content/image/";
for(var i = page * 72; i < (page + 1) * 72 && i < emotions[category].length; ++i){ $('#emotions .container').append($('' + emotions[category][i].name + ''));
}
$('#emotions .container a').click(function(){
target.insertText($(this).attr('title'));
$('#emotions').remove();
});
for(var i = 1; i < emotions[category].length / 72 + 1; ++i){ $('#emotions .page').append($('' + i + ''));
}
$('#emotions .page a').click(function(){
showEmotions(category, $(this).text());
});
$('#emotions .categorys a.current').removeClass('current');
$('#emotions .categorys a').each(function(){
if($(this).text() == category){
$(this).addClass('current');
}
});
}
}
})(jQuery);

function loadSource(data) {
for (var i in data) {
if (data[i].category == '') {
data[i].category = '默认';
}
if (emotions[data[i].category] == undefined) {
emotions[data[i].category] = new Array();
categorys.push(data[i].category);
}
emotions[data[i].category].push({
name: data[i].phrase,
icon: data[i].icon
});
uPeterEmotionsHt.put(data[i].phrase, data[i].icon);
}
}

ref:
http://stackoverflow.com/questions/16514027/download-multiple-files-async-and-wait-for-all-of-them-to-finish-before-executin

the ocean cleanup
the ocean cleanup

16岁时,Boyan曾赴希腊潜水,却失望地发现水中的废弃物甚至比鱼还多。

自此,Boyan开始了长达两年的研究。

在研究的过程中,他发现每年约有8万吨塑料垃圾进入海洋。

目前在海洋中至少有52500亿件塑料制品,其中三分之一集中在臭名昭著的大太平洋垃圾带。

这种塑料污染会逐年持续带来伤害:

环境危机

每年至少100万只海鸟以及一十万海洋哺乳动物,死于塑料污染。

经济投入

从全球来看,美国每年要花至少$13亿用于包括渔业,航运,旅游和海岸线的清洁。美国西海岸花费每年约合$5亿清理自己的海滩。从海滩清除杂物的费用平均为US $1,500和高达US $25,000吨

健康

有毒的化学物质由塑料吸附,增加的上万倍的浓度。进入食物链后,这些持久性有机污染物的生物累积在食物链,导致鱼内部的污染物具有更高浓度,最终进入人体。这些化学物质对健康的影响主要有:癌症,畸形和生殖能力受损。

随着研究Boyan Slat再也坐不住了!

他开始尝试设计各种收集垃圾的模型,例如由两艘大船拖行的巨大耙子。但这一创意经测试耗资过大,且污染严重,因此作罢。

失败并没有困扰Boyan Slat,使命感召唤着这个1994年出生的年轻人。

 

终于,在19岁时,Boyan Slat提出“巨型漏斗”装置概念用以拦截和清理海洋白色污染。这一守株待兔的设备凭借洋流运动运转,因此可以节省昂贵的燃料费用,也可避免燃料污染。Boyan在网站上解释称:“与其浪费燃料追着垃圾跑,不如让垃圾自己跑进我们的装置里。”

 

这个设计大大提高了清理的理论时间,本来要上千年才能彻底清理,现在只要几年时间。

当时所有的零用钱只有200欧元

很快花得精光

于是他试图获得赞助

没人理他

“我记得有一天联系了300家公司,只有一个回应了我。”

他们不相信这个一脸稚气的孩子

竟然要改变整个海洋

“一年前我不确定它能否成功,可是,至少我得去试一试。”

在6个月的修改和测试后,Boyan将“The Ocean Cleanup”项目提交至非盈利民间机构TedXDelft,该机构一直致力于支持和推动令世界更加美好的项目计划。同年,该计划还荣获荷兰代尔夫特科技大学的“最佳工具设计奖”。

 

2013年2月他放弃了自己的航空航天工程的学习,转而开创了The Ocean Cleanup。

2014年6月,他已经领导由一群科学家和工程师组成的百人团队,他的清洁理论设计也已经变成具有技术可行性和经济可行性的方案,用来计划10年内清理半个太平洋。

Boyan经过初步测算,在太平洋垃圾带,用十年时间即可收集70320000公斤的塑料垃圾,清理每公斤垃圾的成本是4.53欧元

仅为现有清理海洋漂浮物垃圾成本的3%。

紧接着众筹募集了接近220万美元,让这个组织进入试点阶段。首个2000M系统预计2016年部署在日本海域。

与此同时,他的前校友们正过着无忧无虑的生活,而少年Boyan,每天至少工作15个小时

“我很久没见到朋友了,他们会调侃我说大学生活多有趣,然而,我却觉得,我现在做的事情,真正在帮助地球。”

 

 

 

Boyan Slat被评为全球最有前途的20个年轻企业家之一(Intel EYE50),并且获得联合国最高环境保护奖的荣誉,2015年,挪威国王陛下授予Boyan青年企业家奖,The Ocean Cleanup也被伦敦设计博物馆认可为年度最佳设计。

改变历史的时刻也许就是一个简单的初心+傻瓜式的乐观,最终爆发的能量会影响到每一个人。

“我一无所有,除了我的项目,我不担心。如果你也想做点什么,那就尽快去做。”

每当聊到环境问题时

人们总是说

太遥远

就让我们的孩子去担心吧

我说:“喂,我就在这里!”

——Boyan Slat

Source: 19岁 他开始拯救地球 如今他改变了人类的历史

正则表达式 Regex
个人感觉正则表达才是计算机高级语言,超越了人眼的匹配,直追人脑的匹配能力。
我们经常与正则表达打交道,多数情况下我们都是用基本的匹配,比如简单的javascript验证手机\email有效性等,但是遇到复杂的需求,每次都是苦战。

最近又完善了一个小工具,一个小小的爬虫,爬出来的文章里面经常有各种广告,以及分享代码,去除起来比较麻烦,比如

,去除起来如果是用html parser的匹配有时候又费力又慢,正则用起来很犀利,可是写出来很难,所以建议先用好搜索引擎,用适当的关键词获取类似的例子,改造一番。然后茶余饭后再阅读本文做进一步的学习理解。

免费书籍:

Regular Expressions Google Analytics.pdf
Regular Expressions Cookbook.pdf
regular expression pocket reference second edition.pdf
Regular Expressions the complete tutorial.pdf

书中代码请加群329586454群文件下载

免费工具:

在线工具:

专业工具 https://regex101.com/
站长简单工具 http://tool.chinaz.com/regex/ http://tool.oschina.net/regex

免费软件:正则表达式工具绿色版
收费软件: http://www.regular-expressions.info/tutorial.html

图文并茂讲解:

1. Matching a Username 匹配用户名
username
Pattern:
/^[a-z0-9_-]{3,16}$/
Description:
We begin by telling the parser to find the beginning of the string (^), followed by any lowercase letter (a-z), number (0-9), an underscore, or a hyphen. Next, {3,16} makes sure that are at least 3 of those characters, but no more than 16. Finally, we want the end of the string ($).
扩展思考:想下中文用户名怎么写?

2. Matching a Password 匹配密码
password
Pattern:/^[a-z0-9_-]{6,18}$/
Description:
Matching a password is very similar to matching a username. The only difference is that instead of 3 to 16 letters, numbers, underscores, or hyphens, we want 6 to 18 of them ({6,18}).
扩展思考:如何检测密码强度(是否有大写结合+特殊字符+数字)

3.Matching a Hex Value 匹配十六进制
hex-copy
Pattern:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
Description:
We begin by telling the parser to find the beginning of the string (^). Next, a number sign is optional because it is followed a question mark. The question mark tells the parser that the preceding character — in this case a number sign — is optional, but to be “greedy” and capture it if it’s there. Next, inside the first group (first group of parentheses), we can have two different situations. The first is any lowercase letter between a and f or a number six times. The vertical bar tells us that we can also have three lowercase letters between a and f or numbers instead. Finally, we want the end of the string ($).

The reason that I put the six character before is that parser will capture a hex value like #ffffff. If I had reversed it so that the three characters came first, the parser would only pick up #fff and not the other three f’s.

4.Matching a Slug 匹配短标签
slug
Pattern:/^[a-z0-9-]+$/
Description:
You will be using this regex if you ever have to work with mod_rewrite and pretty URL’s. We begin by telling the parser to find the beginning of the string (^), followed by one or more (the plus sign) letters, numbers, or hyphens. Finally, we want the end of the string ($).

5.Matching an Email 匹配邮箱
email
Pattern:/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
Description:
We begin by telling the parser to find the beginning of the string (^). Inside the first group, we match one or more lowercase letters, numbers, underscores, dots, or hyphens. I have escaped the dot because a non-escaped dot means any character. Directly after that, there must be an at sign. Next is the domain name which must be: one or more lowercase letters, numbers, underscores, dots, or hyphens. Then another (escaped) dot, with the extension being two to six letters or dots. I have 2 to 6 because of the country specific TLD’s (.ny.us or .co.uk). Finally, we want the end of the string ($).

6. Matching a URL 匹配URL
url
Pattern:/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
Description:
This regex is almost like taking the ending part of the above regex, slapping it between “http://” and some file structure at the end. It sounds a lot simpler than it really is. To start off, we search for the beginning of the line with the caret.

The first capturing group is all option. It allows the URL to begin with “http://”, “https://”, or neither of them. I have a question mark after the s to allow URL’s that have http or https. In order to make this entire group optional, I just added a question mark to the end of it.

Next is the domain name: one or more numbers, letters, dots, or hypens followed by another dot then two to six letters or dots. The following section is the optional files and directories. Inside the group, we want to match any number of forward slashes, letters, numbers, underscores, spaces, dots, or hyphens. Then we say that this group can be matched as many times as we want. Pretty much this allows multiple directories to be matched along with a file at the end. I have used the star instead of the question mark because the star says zero or more, not zero or one. If a question mark was to be used there, only one file/directory would be able to be matched.

Then a trailing slash is matched, but it can be optional. Finally we end with the end of the line.

7. Matching an IP Address 匹配IP地址
ip
Pattern:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
Description:
Now, I’m not going to lie, I didn’t write this regex; I got it from here. Now, that doesn’t mean that I can’t rip it apart character for character.

The first capture group really isn’t a captured group because(?:(?:was placed inside which tells the parser to not capture this group (more on this in the last regex). We also want this non-captured group to be repeated three times — the {3} at the end of the group. This group contains another group, a subgroup, and a literal dot. The parser looks for a match in the subgroup then a dot to move on.

The subgroup is also another non-capture group. It’s just a bunch of character sets (things inside brackets): the string “25” followed by a number between 0 and 5; or the string “2” and a number between 0 and 4 and any number; or an optional zero or one followed by two numbers, with the second being optional.

After we match three of those, it’s onto the next non-capturing group. This one wants: the string “25” followed by a number between 0 and 5; or the string “2” with a number between 0 and 4 and another number at the end; or an optional zero or one followed by two numbers, with the second being optional.

We end this confusing regex with the end of the string.

8.Matching an HTML Tag 匹配HTML标签

htmltag
Pattern:/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/
Description:
One of the more useful regexes on the list. It matches any HTML tag with the content inside. As usually, we begin with the start of the line.

First comes the tag’s name. It must be one or more letters long. This is the first capture group, it comes in handy when we have to grab the closing tag. The next thing are the tag’s attributes. This is any character but a greater than sign (>). Since this is optional, but I want to match more than one character, the star is used. The plus sign makes up the attribute and value, and the star says as many attributes as you want.

Next comes the third non-capture group. Inside, it will contain either a greater than sign, some content, and a closing tag; or some spaces, a forward slash, and a greater than sign. The first option looks for a greater than sign followed by any number of characters, and the closing tag. \1 is used which represents the content that was captured in the first capturing group. In this case it was the tag’s name. Now, if that couldn’t be matched we want to look for a self closing tag (like an img, br, or hr tag). This needs to have one or more spaces followed by “/>”.

The regex is ended with the end of the line.

扩展思考:如何匹配带有attribute的html标签,以及如何匹配多层嵌套的html标签?

快速入门:

正则表达式30分钟入门教程 http://www.jb51.net/tools/zhengze.html
Essential Guide To Regular Expressions: Tools and Tutorials http://www.smashingmagazine.com/2009/06/01/essential-guide-to-regular-expressions-tools-tutorials-and-resources/

不同语言下的正则表达式

1.JavaScript
RegExp Reference http://www.w3schools.com/jsref/jsref_obj_regexp.asp

2.MSDN
Regular Expression Language – Quick Reference http://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx
Best Practices for Regular Expressions in the .NET Frameworkhttp://msdn.microsoft.com/en-us/library/gg578045(v=vs.110).aspx

3.python
Regular Expression HOWTO https://docs.python.org/2/howto/regex.html
A collection of useful regular expressions http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/useful_regex.ipynb

4.java
http://www.mkyong.com/regular-expressions/how-to-extract-html-links-with-regular-expression/
http://www.mkyong.com/regular-expressions/10-java-regular-expression-examples-you-should-know/

常用正则表达式 useful regular expression

10+ Useful JavaScript Regular Expression Functions to improve your web applications efficiency
http://ntt.cc/2008/05/10/over-10-useful-javascript-regular-expression-functions-to-improve-your-web-applications-efficiency.html
里面有信用卡的验证 http://www.virtuosimedia.com/dev/php/37-tested-php-perl-and-javascript-regular-expressions

js常用正则表达式表单验证代码

文章内图文来源:code.tutsplus.com

0 2011

i could either watch it happen, or be part of it.

-Elon Musk

Steve Jobs的光环已经随着他的离去而淡褪,短期内世上恐怕再难有人像他这样惊世骇俗般的改变了世界。但是如果你了解到一个人,一个来自南非年仅40岁的企业家在短短的20年里在全世界最酷的三个领域:互联网、可持续能源和航天技术中所取得的辉煌成就,你恐怕不会再眷恋Steve Jobs带给你的震撼。这个人就是Elon Musk。

这哥们的神奇之处首先就在于,他在宾大读本科的时候,就预见到了未来对于全人类最有影响力的三个领域:互联网、可持续能源和航天技术。这其实并没什么了不起,谁不在本科的时候畅想畅想未来,发一发文青的牢骚?我相信我在清华读本科的时候见到的有这样远见的人多了去了。但是最令人发指的是,这哥们是个执行机器,要么不做,要做就做成历史性的。他发完牢骚之后的20年,先后创立了PayPal,SpaceX和Tesla Motors。现在看来,这几个公司对于他所说的这三个领域都起到了举足轻重的作用。Steve Jobs可能很伟大,他至少改变了数字娱乐、移动计算和智能手机等多个领域。但是就领域的跨度而言,和Elon Musk毫无可比性,这哥们简直就是神,玩嘛嘛酷。

Elon Musk在进入斯坦福大学的第二天就决定退学创业。听说过牛人读PhD或者本科一年或者两年退学创业的,比如Larry Page和Bill Gates之流。但是两天?!开什么玩笑!但是Elon Musk是认真的,他觉得当时的互联网商机无限。没错,仅仅三年,他当时创立的PayPal开创了网上第三方安全支付的先河,带着1亿1千万用户以15亿美元的价格被eBay收购。这桩买卖是无比成功的,在过去的10年内,PayPal为eBay带来了超过200亿美元的收入,也给Elon Musk带来了第一桶金,超过两亿美元的净收入。

一般人拿到这两亿美元应该就可以衣锦还乡以飨天年了。但是Elon Musk岂是凡人,他把这些钱当做实现自己空前抱负的筹码,先后创立了SpaceX和Tesla Motors。这两个都是奇迹一般的公司。先说Tesla Motors。

在Tesla Motors之前,电动车就是弱智的代名词,通用汽车公司的Chevy Volt跑40英里电池就宣告衰竭了,当然这种统计还关乎驾驶习惯,如果在市区开估计歇菜得会更快一些。所有最酷的车都是烧油的,尽管所有人都知道有朝一日地球上的油气资源会枯竭,但是电动车的发展状况却让人完全绝望。所有的这些都是在Tesla Motors推出第一款车型Roadster之前。在解决了高容量电池和高性能电机等关键技术问题之后,Tesla Roadster的推出让人眼前一亮。这款跑车从零加速到60英里(96公里)每小时只需要3.7秒!而保时捷911达到同样的速度则需要4.4秒!同时这怪物单次充电能够开244英里(393公里),彻底把同行甩在脑后。当然,在车型设计方面Roadster也绝不输给它的众多出身名门的竞争对手。尽管这车要价不菲,但是还是在北美被抢购一空。像我这种对于电动车的怀疑主义者在看了Roadster的资料后也不得不瞪大眼睛相信这才是汽车的未来,无可阻挡。我的一朋友在试驾了Roadster之后更是彻底成了它的粉丝,盛赞它“零迟滞的推背感”,决定以后绝对不买非电动的新车了。所有其他的汽车生产厂家都气疯了,一个黄毛小子抢在百年老号前面夺得了时代的制高点。但是发牢骚没有用,还得虚心学习赶上。Tesla Motors先后与丰田和奔驰等等著名品牌转让了若干电池和电机的关键技术帮助推动电动车革命。

如果你看到这里就觉得Elon Musk以及他的Tesla Motors很了不起了的话我只能说你太小看Elon了。Roadster在他眼里只是一个跳板而已。他真正的目标是大量生产高性能的电动车并以平民级的价格卖给每一个人。Roadster只是一个技术的实验品,但是初期的实验技术往往是异常昂贵的,只有极少数人能够问津。把最初的产品定位为高端车型,能够及早和市场接轨获得亟需的研发资金,以便于在将来技术成熟的时候推出更加平易近人的大众车型(家用车型Model S和Model X已经推出)。多么高明的商业策略!我不知道他是怎么想出这个商业模式的,但是我敢说他在宾大沃顿商学院拿的经济学位绝对不是吃干饭的。

如果你现在觉得他只是一个成功的商人的话,我只能说你想错了。早在他把PayPal卖掉的2002年,当他在里约热内卢的海滩上度假的时候,看的是这样的一本书:《火箭推进原理》。对于星际旅行的热爱源于他早年对于生命意义的探求。很多像我一样的文青到了三四十岁早已淡忘了这些理想主义的哲学空想,但是这对于Elon Musk来说是如此的自然和不可或缺。他把生命在地外行星的延续看成是生命进化史上继单细胞到多细胞以及从海洋到陆地的演化一样重要的进化阶段。但是Elon Musk之所以成为Elon Musk的原因,在于他是一个绝不空想的实践者。他很快发现,阻止人类进行星际探索的重要原因是因为星际旅行太昂贵了,尤其是火箭技术太昂贵了,单次火箭发射的成本动辄上亿美元,然而实际的燃料消耗只有20万美元,跟飞机的消耗差不了太多。换句话说,如果不在火箭的可复用技术上下功夫的话,星际航行根本就是天方夜谈。

于是,他拿出了卖PayPal赚来的一半的钱一亿美元,开天辟地的创立了SpaceX,旨在发展可复用火箭技术和星际航行技术。搞火箭,这可不是开玩笑,全世界只有屈指可数的几个国家有可靠的火箭技术,都是倾尽举国之力。而他,一个只有宾大物理和经济本科学位的人,任凭怎样天才和一亿美元都是杯水车薪。但是再次强调,Elon Musk不是凡人,他能吸引一大批美国的顶尖人才围绕在他周围从零开始研制火箭技术。很多NASA资深的工程师,深感于NASA自阿波罗登月计划以来雄心壮志被阉割眼瞅中国印度等国奋起赶上的惨淡现实,义不容辞地加入了SpaceX,就像是中国的航天人对于中国航天事业的崛起赴汤蹈火在所不辞一样,因为谁都清楚,航天事业不比其他,错过了机会就可能是一辈子的遗憾。于是一帮杂牌军兴致高昂的干了起来,因为他们知道,他们建造的火箭,会载着人类飞向太空,登陆火星,完成人类进化史上的大跨越,就像Elon Musk构想的一样。然而现实终究是现实,用Elon Musk自己的话来说:“It looks hard, it’s harder than it looks” 。接连三次Falcon 1的试射都失败了,公司面临着巨大的经济压力,如果第四次还是失败,他们将没有办法进行第五次发射。为此,曾经的亿万富翁也开始到处赊借,甚至连房租都付不起。所幸的是,第四次试射成功了,毫无差池。SpaceX的成功也惊动了美国政府,2010年Obama在参观完SpaceX的发射现场,彻底确定了扶持商业航天产业的决心。后来就有了NASA一系列的与SpaceX签订的国际空间站的货物运输协议。现在SpaceX的运载火箭服务定价透明,Falcon 9火箭单次发射5400万美元,比同等能力的中国长征三号乙火箭单次发射6000万美元还要便宜。

现在所有的电视节目在介绍Elon Musk的时候都会这样说:世界上只有四个国家掌握了卫星发射和回收技术,美国、俄罗斯、中国和Elon Musk。我不知道这样的褒奖对于一个个人来说是不是已经算是登峰造极,但是可以肯定的是,Elon Musk一定不满足于这一点点的成就,他所预见的可复用火箭技术还只是处于电脑模拟阶段,火星也仍然在遥不可及的距离。但是每次看到他坚毅的眼神,我总觉得,在我有生之年,或许可以看到火星殖民地的建立,如果那时候有钱,可以花上50万美元去火星遨游一番,那将是一个多么美妙的愿景。

什么?你说他像Iron Man(钢铁侠) Tony Stark?他就是Iron Man。殊不知Iron Man的导演Jon Favreau就是以他为原型去做这几部电影的,而且他也邀请了Elon Musk在Iron Man 2客串了一个角色。SpaceX里据说还有一个剧组赠送的Iron Man的全尺寸模型,上面有所有演员的签名。

最后,我想以他的一句话来结束我对于新偶像的崇拜:

“I am going to retire on Mars.”

注:针对众多读者对于Iron Man原型是Elon Musk的质疑,解释如下:原著Iron Man漫画发行始于1963年,作者Stan Lee创作的原型是Howard Hugues。在2008和2010年由Jon Favreau改编为同名电影系列,以Elon Musk作为创意来源: http://www.time.com/time/specials/packages/article/0,28804,1984685_1984745_1985495,00.html

天朝同胞可以看优酷

/****** Script for TEST BY ly ******/

首先我们先看下原始数据

SELECT * FROM [GroupData1].[dbo].[Group2]

然后我们筛选出email

SELECT t.QUNNum AS QUNNum,STUFF(
(SELECT ‘@qq.com,’ + CAST(s.QQNum as varchar(100))
FROM [GroupData1].[dbo].[Group2] s
WHERE s.QUNNum=t.QUNNum
FOR XML PATH(”)),1,8,”) + ‘@qq.com’ AS Email
FROM [GroupData1].[dbo].[Group2] t
group by t.QUNNum;

最后用bcp命令生成excel

bcp “SELECT t.QUNNum AS QUNNum,STUFF((SELECT ‘@qq.com,’ + CAST(s.QQNum as varchar(100)) FROM [GroupData1].[dbo].[Group2] s WHERE s.QUNNum=t.QUNNum FOR XML PATH(”)),1,8,”) + ‘@qq.com’ AS Email FROM [GroupData1].[dbo].[Group2] t group by t.QUNNum” queryout Email.xls -c -T -U ‘sa’ -P ‘123456’ -S localhost\sqlexpress

其实上面没有过滤掉重复的Email,稍微改下就可以了,自己动脑吧

0 2327
新加坡harborfront vivocity 海滨步行道走过去就看到,每晚9点,no charge,10分钟表演,开场前的音乐也挺好听的

您还没有安装flash播放器,请点击这里安装

回来的路上一个酒吧的人们突然自嗨起来,不知道是求婚还是什么

您还没有安装flash播放器,请点击这里安装

0 1944

如果你爱拍大灰机 这里绝对是理想的地点 可以躺在沙滩上享受飞机掠过头顶

可以搭巴士到达

RANDOM POSTS

0 1345
Although this Articles simply collects and gathers links for all front-end developer's or designer's reference, but it's really important to introduce or remind us...