首先可以给js的数组对象定义一个函数,用于查找指定的元素在数组中的位置,即索引,代码为:Array.prototype.indexOf = function(val) {for (var i = 0; i -1) {this.splice(index, 1);}}; 这样就构造了这样一个函数,比.....
分类:
Web程序 时间:
2014-07-07 00:32:08
阅读次数:
242
$val) { $gstr = str_replace("&","&",$val); $str.= "$key -> ".$gstr."\r\n"; } Return $str;}/*** 函数名称: getUA* 函数功能...
分类:
移动开发 时间:
2014-07-06 18:39:18
阅读次数:
247
.html(),.text(),.val(),.html()用为读取和修改元素的HTML标签,包括标签内的内容.text()用来读取或修改元素的纯文本内容,去除 html 标签.val()用来读取或修改表单元素的value值as:hiclickjs脚本:$(document).ready(funct...
分类:
Web程序 时间:
2014-07-06 15:54:04
阅读次数:
208
一.DICT主要有两个问题:1.散列冲突,解决办法是拉链法typedef struct dictEntry { void *key; union { void *val; uint64_t u64; int64_t s64; } v; ...
分类:
其他好文 时间:
2014-07-06 13:53:52
阅读次数:
161
把一个排好序的vector转换为一颗二分查找树。很简单的题目,递归即可,保证边界不要出错。 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; ...
分类:
其他好文 时间:
2014-07-06 12:53:50
阅读次数:
174
NSString *tempA = @"123";NSString *tempB = @"456";1,字符串拼接NSString *newString = [NSString stringWithFormat:@"%@%@",tempA,tempB];2,字符转intint intString =...
分类:
其他好文 时间:
2014-07-05 22:33:48
阅读次数:
239
浅谈jquery关于select框的取值和赋值jQuery("#select_id").change(function(){}); // 1.为Select添加事件,当选择其中一项时触发 var checkValue = jQuery("#select_id").val(); // 2.获取Sele...
分类:
Web程序 时间:
2014-07-05 18:09:07
阅读次数:
175
$(function(){$('#send').click(function(){$.ajax({type: "GET",url: "test.json",data: {username:$("#username").val(), content:$("#content").val()},dataT...
分类:
Web程序 时间:
2014-07-05 17:09:40
阅读次数:
275
1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNo...
分类:
其他好文 时间:
2014-07-05 16:53:34
阅读次数:
177
row_number() OVER (PARTITION BY COL1 ORDER BY COL2)
--表示根据COL1分组,在分组内部根据 COL2排序,而此函数返回的值就表示每组内部排序后的顺序编号(组内连续的唯一的)
例子一: create table student (id int ,classes int ,score int);
insert into student val...
分类:
其他好文 时间:
2014-07-03 18:33:50
阅读次数:
213