码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
js:深入闭包(作用域:下)
function fn1(){   //创建了一个数组   var fns = new Array();   //i这个变量是保存在fn1这个作用域中   for(var i=0;i     //数组中的值是一组函数     fns[i] = function(){       return i;      }    }   return fns; } var fs =...
分类:Web程序   时间:2014-05-12 14:37:20    阅读次数:264
正则表达式匹配URL——给URL地址加上<a> 链接
<?php function replace_url ($content) { if (empty($content)) return; //给URL地址加上 链接 $preg = '/(?:http:\/\/)?([\w.]+[\w\/]*\.[\w.]+[\w\/]*\??[\w=\&\+\%]*)/is'; $content = preg_replace($preg, '\1',...
分类:其他好文   时间:2014-05-12 07:17:12    阅读次数:316
clang 简单的str_replace实现
自己写的一段://goolchar* str_replace(char* source, const char* find, const char* replace){ if (source == NULL || find == NULL || find == "") return strdup.....
分类:其他好文   时间:2014-05-12 02:42:20    阅读次数:418
并发 错误 java.lang.IllegalMonitorStateException: current thread not owner 分析
public class ThreadTest implements Callable { public String call() throws Exception { // TODO Auto-generated method stub wait(10000); return "hello"; } }调用代码: public static void main(Stri...
分类:编程语言   时间:2014-05-11 21:27:24    阅读次数:533
【LeetCode】Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:其他好文   时间:2014-05-11 18:15:52    阅读次数:300
数论模版
//求gcd(a, b) LL gcd(LL a, LL b) { return b ? gcd(b, a%b) : a; }     //求整数x和y,使得ax+by=d, 且|x|+|y|最小。其中d=gcd(a,b) void gcd(LL a, LL b, LL& d, LL& x, LL& y) { if(!b) { d = a; x = 1; y = 0...
分类:其他好文   时间:2014-05-11 14:45:32    阅读次数:240
Leetcode | Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:其他好文   时间:2014-05-11 14:35:13    阅读次数:270
LeetCode--Search Insert Position
Search Insert Position  Total Accepted: 14091 Total Submissions: 41005My Submissions Given a sorted array and a target value, return the index if the target is found. If not, return the in...
分类:其他好文   时间:2014-05-11 05:53:03    阅读次数:241
java 接口 继承 的有趣现象
public class TestA { private String ta="我是类TestA"; public String fiall() {//System.out.println(this.ta);return ta; }} 上面第一个类,作为父类 ------------------------------------------------------------------...
分类:编程语言   时间:2014-05-11 03:37:10    阅读次数:358
LeetCode Insertion Sort List
class Solution {public: ListNode *insertionSortList(ListNode *head) { if (head == NULL) return NULL; ListNode* sorted_head = head; ...
分类:其他好文   时间:2014-05-10 20:39:14    阅读次数:419
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!