码迷,mamicode.com
首页 >  
搜索关键字:return    ( 60766个结果
js小功能
1删除左右两端的空格//删除左右两端的空格function trim(str) { return str.replace(/(^\s*)|(\s*$)/g, "");}2 判断是否为空//判断是否为空function isEmpty(s) { return ((s == undefin...
分类:Web程序   时间:2014-10-15 18:33:21    阅读次数:131
python 函数
一,定义函数 def?functionname(?parameters?): ???"函数_文档字符串" ???function_suite ???return?[expression] 二,引用传递 or 值传递? 示例1: def?func1(name): ????name=name+"sun" ??...
分类:编程语言   时间:2014-10-15 16:38:11    阅读次数:229
leetcode - Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. /** * Definition for singly-link...
分类:其他好文   时间:2014-10-15 16:29:21    阅读次数:119
InputStream,String,File相互转化
1. String --> InputStream InputStream String2InputStream(String str){ ?? ByteArrayInputStream stream = new ByteArrayInputStream(str.getBytes()); ?? return stream; } 2. InputStream --> String S...
分类:其他好文   时间:2014-10-15 16:22:11    阅读次数:161
phpmyadmin 免登陆
第一步: 打开 phpmyadmin/libraries/plugins/auth/AuthenticationCookie.class.php 找到 authCheck 和 authSetUser 两个函数的定义,在函数体最前面直接加个 return true; 就是让这两个函数无论何时都只返回 true。 经过第一步后,你每次打开phpmyadmin 都可以不用登陆自动进入 da...
分类:Web程序   时间:2014-10-15 16:17:11    阅读次数:209
【转】ASP.NET MVC学习笔记-Controller的ActionResult
1. 返回ViewResult public ActionResult Index() { ViewData["Message"] = "Welcome to asp.net MVC!"; return View(); } public ActionResult Index(){ ViewData[...
分类:Web程序   时间:2014-10-15 15:59:00    阅读次数:209
leetcode - Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. class Solution { public: ListNode *mergeTwoLists(Li...
分类:其他好文   时间:2014-10-15 15:48:31    阅读次数:127
LeetCode——Copy List with Random Pointer(带random引用的单链表深拷贝)
问题: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep ...
分类:其他好文   时间:2014-10-15 15:40:50    阅读次数:262
Python的匿名函数的应用及大量例子
文章导读: 以前自己一直没搞明白Python中的匿名函数,现在拿这个问题基本上搞明白了,拿自己的理解整成一篇文章,附带大量例子,让其更加好理解。 ------- 在编程语言中,函数的应用: 1. 代码块重复,这时候必须考虑用到函数,降低程序的冗余度 2. 代码块复杂,这时候可以考虑用到函数,降低程序的可读性 在Python,有两种函数,一种是def定义,一种是lambda函数 #假如要求两个数之和,用普通函数或匿名函数如下: 1. def func(x,y):return x+y 2. lambda x,...
分类:编程语言   时间:2014-10-15 15:14:51    阅读次数:293
js获得URL超链接的参数值
/** * 获取指定URL的参数值 * @param url 指定的URL地址 * @param name 参数名称 * @return 参数值 */ function getUrlParam(url,name){ var pattern = new RegExp("[?&]"+n...
分类:Web程序   时间:2014-10-15 14:14:50    阅读次数:173
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!