var foo = bar === 'xxx' ? true : false;
// 更好的代码是:
var foo = bar === 'xxx';两个和三个等号的判断,都是得到布尔值。
| <html> | |
| <body> | |
| <script> | |
| // @author: ideawu | |
| // @link: http://www.ideawu.net/blog/archives/1021.html | |
| var swap_count = 0; | |
| var cmp_count = 0; | |
| // https://gist.github.com/wintercn/c30464ed3732ee839c3eeed316d73253 | |
| function wintercn_qsort(arr, start, end){ |
| #!/usr/bin/env bash | |
| # Script to (selectively) save/load multiple Docker images to/from a directory. | |
| # Run ./save-load-docker-images.sh for help. | |
| set -e | |
| directory=$PWD | |
| filter="" | |
| compress=0 |
| 'use strict'; | |
| todomvc.controller('TodoCtrl', [ '$scope', 'todoFactory', 'filterFilter', | |
| function OtherCtrl($scope, todoFactory, filterFilter) { | |
| $scope.todos = todoFactory.getAllTodos('todos'); | |
| $scope.newTodo = ''; | |
| $scope.editedTodo = ''; | |
| $scope.addTodo = function() { | |
| todoFactory.addTodo($scope.newTodo); | |
| }; | |
| $scope.editTodo = function(todo) { |
| var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth"; | |
| str.match(/\w(ox)/g); // ["fox", "box", "sox"] | |
| // match (when used with a 'g' flag) returns an Array with all matches found | |
| // if you don't use the 'g' flag then it acts the same as the 'exec' method. | |
| str.match(/\w(ox)/); // ["fox", "ox"] | |
| /\w(ox)/.exec(str); // ["fox", "ox"] |
#The Great Firewall (GFW) Contributors List
注:数据来源为 dblp 和 cndblp, 下面括号中的数字表示 dblp 中显示的跟方滨兴合作论文的数量
###Binxing Fang (方滨兴)
中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网络方向首席科学家
http://en.wikipedia.org/wiki/Fang_Binxing
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
| #!/usr/bin/env php | |
| <?php | |
| $all = 'abba | |
| acdc | |
| ace | |
| acorn | |
| add | |
| adele | |
| africa |