码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
PHP操作SQLITE
一直以来,我们操作SQLITE,都是基于PHP默认的SQLITE操作模块。 今天介绍一个可以操作SQLITE2,和SQLITE3的PHP类,此为我封装的。 <?php abstract class Db{ public static function factory($type){ return call_user_func(array($type , 'getInstanc...
分类:数据库   时间:2014-10-10 11:56:24    阅读次数:283
Jquery 取得页面所有 input 属性为text的id 和input里面的值
var inputid=""; var inputArray=$("input[type='text']");//取到所有的input text 并且放到一个数组中 inputArray.each(//使用数组的循环函数 循环这个input数组 function (){ var input =$(this);//循环中的每一个input元素...
分类:Web程序   时间:2014-10-10 11:23:34    阅读次数:218
砸金蛋概率
function getRand($proArr) { $result = ''; //概率数组的总概率精度 $proSum = array_sum($proArr); //概率数组循环 foreach ($proArr as $key => $proCur) { $randNu...
分类:其他好文   时间:2014-10-10 10:16:54    阅读次数:232
poj 1579 Function Run Fun
题目链接:http://poj.org/problem?id=1579思路: 题目给出递归公式,使用动态规划的记忆搜索即可解决。代码:#include #include const int MAX_N = 20 + 5;int dp[MAX_N][MAX_N][MAX_N];int w( in...
分类:其他好文   时间:2014-10-10 03:37:53    阅读次数:189
jquery-实现全选与不全选
jquery代码:省略引用jquery代码。<scripttype="text/javascript">//全选$(function(){$("#selectAll").click(function(){if(this.checked){$("#chapterlist:checkbox").each(function(){this.checked=true;});$("#selectAll").attr("value","反选");}else{$("#chapterli..
分类:Web程序   时间:2014-10-10 02:27:54    阅读次数:172
jQuery plugin items filter
最近在Github上找到一款不错的过滤/筛选插件,类似jQuery UI的slider组件,不多说,上例子。 ##jQuery UI app.js function showProducts(minPrice, maxPrice) { $("#products li").hide().filter(function() { va...
分类:Web程序   时间:2014-10-09 23:51:28    阅读次数:290
leetcode 1.Two Sum
Two Sum Problem:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indic...
分类:其他好文   时间:2014-10-09 23:05:37    阅读次数:273
math2407_Euler's function
定义:对于正整数n,φ(n)是小于或等于n的正整数中,与n互质(互质意思为两者公约数只有一个1)的数的数目;例如:φ(8)=4,因为1,3,5,7均和8互质。性质:1.若p是质数,φ(p)=p-1.2.若n是质数p的k次幂,φ(n)=(p-1)p^(k-1)n=p*p*p*p...(共K个P),P是...
分类:其他好文   时间:2014-10-09 22:37:39    阅读次数:188
一个简单的sel server 函数的自定义
创建自定义函数:use 数据库名gocreate function 函数名(@pno int)returns intasbegin declare @a int if not exists(select * from person where pno=@pno) set @a=-1 else set...
分类:其他好文   时间:2014-10-09 21:49:17    阅读次数:187
js获取URL参数
function getUrlParam(name) { //构造一个含有目标参数的正则表达式对象 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //匹配目标参数 var...
分类:Web程序   时间:2014-10-09 21:21:47    阅读次数:162
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!