Jquery.Linq用法
下载:http://linqjs.codeplex.com/
LINQ Pad
Enumerable.Range(0, 20) |
0:0 |
Generating Methods
method name | return type | arguments | example (click code) |
Choice | Enumerable | params T obj |
Enumerable.Choice("a","b","c","d").Take(10) Enumerable.Choice(["a","b","c","d"]).Take(10) |
Cycle | Enumerable | params T obj |
Enumerable.Cycle(1,"foo",true).Take(10) Enumerable.Cycle([1,"foo",true]).Take(10) |
Empty | Enumerable | () |
Enumerable.Empty() |
From | Enumerable | Array obj |
var arr = [1,124,"aaa",function(){},false]; |
Object obj |
var obj = {a:3,b:"3",z:function(){},d:true}; |
||
NodeList obj |
var node = document.getElementsByTagName("h2"); |
||
Number obj |
Enumerable.From(5) |
||
String obj |
Enumerable.From("foobar") |
||
IEnumerable(WSH) obj |
// using with Windows Script Host |
||
Return | Enumerable | T element |
Enumerable.Return("foobar") |
Matches | Enumerable | string input, RegExp pattern |
Enumerable.Matches("xbcyBCzbc", /(.)bc/i) |
string input, string pattern |
Enumerable.Matches("xbcyBCzbc", "(.)bc") |
||
string input, string pattern, string flags |
Enumerable.Matches("xbcyBCzbc", "(.)bc", "i") |
||
Range | Enumerable | int start, int count |
Enumerable.Range(10,5) |
int start, int count, int step |
Enumerable.Range(10,5,3) |
||
RangeDown | Enumerable | int start, int count |
Enumerable.RangeDown(10,5) |
int start, int count, int step |
Enumerable.RangeDown(10,5,3) |
||
RangeTo | Enumerable | int start, int to |
Enumerable.RangeTo(10,18) Enumerable.RangeTo(3,-5) |
int start, int to, int step |
Enumerable.RangeTo(1,9,3) Enumerable.RangeTo(1,-9,3) |
||
Repeat | Enumerable | T obj |
Enumerable.Repeat(3).Take(5) |
T obj, int count |
Enumerable.Repeat("foo",10) |
||
RepeatWithFinalize | Enumerable | T initializer(), void finalizer(T) |
// example for WScript(Text EnumerateLines and Finally Close) |
Generate | Enumerable | T func() |
Enumerable.Generate("Math.random()").Take(5) |
T func(), int count |
Enumerable.Generate("Math.random()", 5) |
||
ToInfinity | Enumerable | () |
Enumerable.ToInfinity().Take(5) |
int start |
Enumerable.ToInfinity(1000).Take(5) |
||
int start, int step |
Enumerable.ToInfinity(1000,5).Take(5) |
||
ToNegativeInfinity | Enumerable | () |
Enumerable.ToNegativeInfinity().Take(5) |
int start |
Enumerable.ToNegativeInfinity(1000).Take(5) |
||
int start, int step |
Enumerable.ToNegativeInfinity(1000,5).Take(5) |
||
Unfold | Enumerable | T seed, T func(T) |
Enumerable.Unfold(5, "$+3").Take(10) |
Projection and Filtering Methods
method name | return type | arguments | example (click code) |
CascadeBreadthFirst | Enumerable | T[] func(T) |
Enumerable.Return(1).CascadeBreadthFirst("$+$").Take(5) |
T[] func(T), T resultSelector(T) |
Enumerable.Return(1).CascadeBreadthFirst("$+$","$*$").Take(5) |
||
T[] func(T), T resultSelector(T, int) |
Enumerable.Return(document.body) |
||
CascadeDepthFirst | Enumerable | T[] func(T) |
Enumerable.Return(1).CascadeDepthFirst("$+$").Take(5) |
T[] func(T), T resultSelector(T) |
Enumerable.Return(1).CascadeDepthFirst("$+$","$*$").Take(5) |
||
T[] func(T), T resultSelector(T, int) |
Enumerable.Return(document.body) |
||
Flatten | Enumerable | () |
var array = [1,[234,2,[62,3]],[234,5],3]; |
Pairwise | Enumerable | T selector(T, T) |
Enumerable.Range(1,10) |
Scan | Enumerable | T func(T, T) |
Enumerable.Range(1,10).Scan("a,b=>a+b") |
T seed, T func(T, T) |
Enumerable.Range(1,10).Scan(100,"a,b=>a+b") |
||
T seed, T func(T, T), T resultSelector(T) |
Enumerable.Range(1,10).Scan(100,"a,b=>a+b","$*10") |
||
Select | Enumerable | T selector(T) |
Enumerable.Range(1,10).Select("$*10") |
T selector(T, int) |
Enumerable.RangeDown(10,10).Select("value,index=>index + ':' + value") |
||
SelectMany | Enumerable | T[] collectionSelector(T) |
Enumerable.Range(1,3).SelectMany("Enumerable.Repeat($,3)") |
T[] collectionSelector(T, int) |
Enumerable.Range(5,5) |
||
T[] collectionSelector(T), resultSelector(T, T) |
Enumerable.Range(1,3) |
||
T[] collectionSelector(T, int), resultSelector(T, T) |
Enumerable.Range(5,5) |
||
Where | Enumerable | bool predicate(T) |
Enumerable.Range(1,10).Where("$%2==0") |
bool predicate(T, int) |
Enumerable.Range(1,10).Where("value,index=>value*index>10") |
||
OfType | Enumerable | Class type |
Enumerable.From([1,"a",2,"b","c",3]).OfType(Number) Enumerable.From([1,"a",2,"b","c",3]).OfType(String) function ClassA(v){this.v = v} |
Zip | Enumerable | T[] second,T selector(T, T) |
Enumerable.RangeDown(10,10) |
T[] second,T selector(T, T, int) |
Enumerable.RangeDown(10,10) |
Join Methods
method name | return type | arguments | example (click code) |
Join | Enumerable | T[] inner, T outerKeySelector(T), T innerKeySelector(T), T resultSelector(T, T) |
var array1 = [13,413,5,135,61,631,13,61,3]; |
T[] inner, T outerKeySelector(T), T innerKeySelector(T), T resultSelector(T, T), T compareSelector(T) |
var array1 = [10,405,50,135]; |
||
GroupJoin | Enumerable | T[] inner, T outerKeySelector(T), T innerKeySelector(T), T resultSelector(T, Enumerable) |
var array1 = [13,413,5,135,61,631,13,61,3]; |
T[] inner, T outerKeySelector(T), T innerKeySelector(T), T resultSelector(T, Enumerable), T compareSelector(T) |
var array1 = [10,405,50,135]; |
Set Methods
method name | return type | arguments | example (click code) |
All | Boolean | bool predicate(T) |
Enumerable.Range(1,10).All("$<5") Enumerable.Range(1,10).All("$<15") |
Any | Boolean | () |
Enumerable.Range(1,0).Any() Enumerable.Range(1,10).Any() |
bool predicate(T) |
Enumerable.Range(1,10).Any("$==5") Enumerable.Range(1,10).Any("$==15") |
||
Concat | Enumerable | T[] second |
Enumerable.Range(1,5).Concat(Enumerable.Repeat("foo",5)) |
Insert | Enumerable | int index, T[] second |
Enumerable.Range(1,5).Insert(3,Enumerable.Repeat("foo",5)) |
Alternate | Enumerable | T value |
Enumerable.Range(1,5).Alternate(-1) |
Contains | Boolean | T value |
Enumerable.Range(1,5).Contains(3) Enumerable.Range(1,5).Contains(10) |
T value, T compareSelector(T) |
Enumerable.Range(1,5).Select("{test:$}").Contains(3) Enumerable.Range(1,5).Select("{test:$}").Contains(3,"$.test") |
||
DefaultIfEmpty | Enumerable | T defaultValue |
Enumerable.Range(1,5).DefaultIfEmpty("default") Enumerable.Range(1,0).DefaultIfEmpty("default") |
Distinct | Enumerable | () |
var array = [1,412,5,3,5,412,7]; |
T compareSelector(T) |
var seq = Enumerable.Range(1,10).Select("{test:$%3}"); |
||
Except | Enumerable | T[] second |
var array1 = [1,412,5,3,5,412,7]; |
T[] second, T compareSelector(T) |
var seq1 = Enumerable.Range(1,10).Select("{test:$%5}"); |
||
Intersect | Enumerable | T[] second |
var array1 = [1,412,5,3,5,412,7]; |
T[] second, T compareSelector(T) |
var seq1 = Enumerable.Range(1,10).Select("{test:$%5}"); |
||
SequenceEqual | Boolean | T[] second |
Enumerable.Range(1,5).SequenceEqual(Enumerable.Range(1,5)) Enumerable.Range(1,5).SequenceEqual(Enumerable.Range(1,6)) |
T[] second, T compareSelector(T) |
Enumerable.Range(1,10).Select("{test:$%5}") |
||
Union | Enumerable | T[] second |
var array1 = [1,412,5,3,5,412,7]; |
T[] second, T compareSelector(T) |
var seq1 = Enumerable.Range(1,5).Select("{test:$}"); |
Ordering Methods
method name | return type | arguments | example (click code) |
OrderBy | OrderedEnumerable | () |
var array = [1,51,61,75,8,35,43]; |
T keySelector(T) |
var array = [{a:"a"},{a:"z"},{a:"k"},{a:"l"},{a:"m"},{a:"c"}]; |
||
OrderByDescending | OrderedEnumerable | () |
var array = [1,51,61,75,8,35,43]; |
T keySelector(T) |
var array = [{a:"a"},{a:"z"},{a:"k"},{a:"l"},{a:"m"},{a:"c"}]; |
||
ThenBy | OrderedEnumerable | T keySelector(T) |
var list = [ |
ThenByDescending | OrderedEnumerable | T keySelector(T) |
var list = [ |
Reverse | Enumerable | () |
Enumerable.Range(1,10).Reverse() |
Shuffle | Enumerable | () |
Enumerable.Range(1,10).Shuffle() |
Grouping Methods
method name | return type | arguments | example (click code) |
GroupBy | Enumerable<Grouping> | T keySelector(T) |
Enumerable.Range(1,5).GroupBy("$%2==0") |
T keySelector(T), T elementSelector(T) |
Enumerable.Range(1,5).GroupBy("$%2==0","$*10") |
||
Enumerable | T keySelector(T), T elementSelector(T), T resultSelector(T, Enumerable) |
Enumerable.Range(1,5) |
|
TK keySelector(T), TE elementSelector(T), TR resultSelector(T, Enumerable),TC compareSelector(TK) |
Enumerable.From([{d:new Date(2000,1,1),i:0},{d:new Date(2000,1,1),i:1}]) |
||
PartitionBy | Enumerable<Grouping> | T keySelector(T) |
Enumerable.From([1,2,2,3,3,2,1,1]).PartitionBy("i=>i") |
T keySelector(T), T elementSelector(T) |
Enumerable.From([1,2,2,3,3,2,1,1]).PartitionBy("i=>i","i=>i*100") |
||
Enumerable | T keySelector(T), T elementSelector(T), T resultSelector(T, Enumerable) |
Enumerable.From([1,2,2,3,3,2,1,1]) |
|
TK keySelector(T), TE elementSelector(T), TR resultSelector(T, Enumerable), TC compareSelector(TK) |
Enumerable.From([{d:new Date(2000,1,1),i:0},{d:new Date(2000,1,1),i:1}]) |
||
BufferWithCount | Enumerable<Array> | int count |
Enumerable.Range(1,10).BufferWithCount(4) |
Aggregate Methods
method name | return type | arguments | example (click code) |
Aggregate | T | T func(T, T) |
Enumerable.Range(1,5).Aggregate("a,b=>a*b") |
T seed, T func(T, T) |
Enumerable.Range(1,10).Aggregate(100,"a,b=>a+b") |
||
T seed, T func(T, T), T resultSelector(T) |
Enumerable.Range(1,10).Aggregate(100,"a,b=>a+b","$*10") |
||
Average | Number | () |
Enumerable.Range(1,10).Average() |
Number selector(T) |
Enumerable.From([{a:"foo",b:5},{a:"bar",b:20},{a:"foobar",b:10}]) |
||
Count | Number | () |
Enumerable.Range(1,10).Count() |
bool predicate(T) |
Enumerable.Range(1,10).Count("$>7") |
||
Max | Number | () |
Enumerable.Range(1,10).Max() |
Number selector(T) |
Enumerable.From([{a:"foo",b:5},{a:"bar",b:20},{a:"foobar",b:10}]) |
||
Min | Number | () |
Enumerable.Range(1,10).Min() |
Number selector(T) |
Enumerable.From([{a:"foo",b:5},{a:"bar",b:20},{a:"foobar",b:10}]) |
||
MaxBy | T | Number selector(T) |
Enumerable.From([{a:"foo",b:5},{a:"bar",b:20},{a:"foobar",b:10}]) |
MinBy | T | Number selector(T) |
Enumerable.From([{a:"foo",b:5},{a:"bar",b:20},{a:"foobar",b:10}]) |
Sum | Number | () |
Enumerable.Range(1,10).Sum() |
Number selector(T) |
Enumerable.From([{a:"foo",b:5},{a:"bar",b:20},{a:"foobar",b:10}]) |
Paging Methods
method name | return type | arguments | example (click code) |
ElementAt | T | int index |
Enumerable.Range(1,10).ElementAt(3) |
ElementAtOrDefault | T | int index, T defaultValue |
Enumerable.Range(1,10).ElementAtOrDefault(15,-1) |
First | T | () |
Enumerable.Range(1,10).First() |
bool predicate(T) |
Enumerable.Range(1,10).First("$>4") |
||
FirstOrDefault | T | T defaultValue |
Enumerable.Empty().FirstOrDefault(-1) |
T defaultValue, bool predicate(T) |
Enumerable.Range(1,10).FirstOrDefault(-1,"$>15") |
||
Last | T | () |
Enumerable.Range(1,10).Last() |
bool predicate(T) |
Enumerable.Range(1,10).Last("$<4") |
||
LastOrDefault | T | T defaultValue |
Enumerable.Empty().LastOrDefault(-1) |
T defaultValue, bool predicate(T) |
Enumerable.Range(1,10).LastOrDefault(-1,"$>15") |
||
Single | T | () |
Enumerable.From("a").Single() |
bool predicate(T) |
Enumerable.Range(1,10).Single("$==4") |
||
SingleOrDefault | T | T defaultValue |
Enumerable.Empty().SingleOrDefault(-1) |
T defaultValue, bool predicate(T) |
Enumerable.Range(1,10).SingleOrDefault(-1,"$==15") |
||
Skip | Enumerable | int count |
Enumerable.Range(1,10).Skip(5) |
SkipWhile | Enumerable | bool predicate(T) |
Enumerable.Range(1,10).SkipWhile("$<=5") |
bool predicate(T, int index) |
Enumerable.Range(1,10).SkipWhile("value,index=>value+index<=5") |
||
Take | Enumerable | int count |
Enumerable.Range(1,10).Take(5) |
TakeWhile | Enumerable | bool predicate(T) |
Enumerable.Range(1,10).TakeWhile("$<=5") |
bool predicate(T, int index) |
Enumerable.Range(1,10).TakeWhile("value,index=>value+index<=5") |
||
TakeExceptLast | Enumerable | () |
Enumerable.Range(1,10).TakeExceptLast() |
Number count |
Enumerable.Range(1,10).TakeExceptLast(3) |
||
TakeFromLast | Enumerable | Number count |
Enumerable.Range(1,10).TakeFromLast(3) |
IndexOf | int | T item |
Enumerable.Range(1,10).IndexOf(3) Enumerable.Range(1,10).IndexOf(15) |
LastIndexOf | int | T item |
Enumerable.From([1,2,3,2,5]).LastIndexOf(2) Enumerable.From([1,2,3,2,5]).LastIndexOf(20) |
Convert Methods
method name | return type | arguments | example (click code) |
ToArray | Array | () |
Enumerable.Range(1,10).ToArray() |
ToLookup | Lookup | TKey keySelector(T) |
var lookup = Enumerable.From(["temp.xls", "temp.pdf", "temp.jpg", "temp2.pdf"]) |
TKey keySelector(T), TElement elementSelector(T) |
var lookup = Enumerable.From(["temp.xls", "temp.pdf", "temp.jpg", "temp2.pdf"]) |
||
TKey keySelector(T), TElement elementSelector(T), TCompare compareSelector(TKey) |
var lookup = Enumerable.From(["temp.xls", "temp.pdf", "temp.jpg", "temp2.pdf"]) |
||
ToObject | Object | String keySelector(T), T elementSelector(T) |
var obj = Enumerable.Range(1,10).Select("value,index=>{id:'id_' + index,value:value}") |
ToDictionary | Dictionary | TKey keySelector(T), TElement elementSelector(T) |
var dict = Enumerable.Range(1,10).Select("value,index=>{id:'id_' + index,value:value}") |
TKey keySelector(T), TElement elementSelector(T), TCompare compareSelector(TKey) |
var dict = Enumerable.Range(1,10).Select("value,index=>{id:'id_' + index,value:value}") |
||
ToJSON | String | () |
// ToJSON only work Native JSON support browser or include json2.js |
TResult replacer(TKey, TValue) |
Enumerable.From(["a","b","c"]) |
||
TResult replacer(TKey, TValue), Number space |
Enumerable.Range(1, 5).ToJSON(null, 4) |
||
ToString | String | () |
Enumerable.Range(0,10).ToString() |
String separator |
Enumerable.Range(0,10).ToString("-") |
||
String separator, T selector(T) |
Enumerable.From([{k:"foo"},{k:"bar"}]).ToString("-","$.k") |
Action Methods
method name | return type | arguments | example (click code) |
Do | Enumerable | void action(T) |
Enumerable.Range(1,10).Do(function(i){ |
void action(T, index) |
Enumerable.Range(1,10).Do(function(value,index){ |
||
ForEach | void | void action(T) |
Enumerable.Range(1,10).ForEach(function(i){ |
void action(T, index) |
Enumerable.Range(1,10).ForEach(function(value,index){ |
||
bool func(T) |
Enumerable.Range(1, 10).ForEach(function(i) |
||
bool func(T, index) |
Enumerable.Repeat("aaa", 10).ForEach(function(s,index) |
||
Write | void | () |
Enumerable.Range(1,10).Write() |
String separator |
Enumerable.Range(1,10).Write("-") |
||
String separator, T selector(T) |
Enumerable.From([{a:"foo",b:1},{a:"bar",b:3}]) |
||
WriteLine | void | () |
Enumerable.Range(1,10).WriteLine() |
T selector(T) |
Enumerable.From([{a:"foo",b:1},{a:"bar",b:3}]) |
||
Force | void | () |
Enumerable.Range(1,10).Trace().Force() |
Functional Methods
method name | return type | arguments | example (click code) |
Let | Enumerable | Enumerable<TR> func(Enumerable<T>) |
Enumerable.Range(1,10).Let(function(x){return x.Zip(x.Skip(1),"x,y=>x + ':' + y")}) |
Share | Enumerable | () |
var share = Enumerable.Range(1,10).Share(); |
MemoizeAll | Enumerable | () |
var mem = Enumerable.Range(1,10) |
Error Handling Methods
method name | return type | arguments | example (click code) |
Catch | Enumerable | void handler(Error) |
Enumerable.Range(1,10).Select(function(i){ |
Finally | Enumerable | void finallyAction() |
Enumerable.Range(1,5).Finally(function(){document.write("finally")}) |
For Debug Methods
method name | return type | arguments | example (click code) |
Trace | Enumerable | () |
// Trace is output to console.log |
String message |
Enumerable.Range(1,10).Trace("Gen").Where("$%3==0").Trace("Filtered").Force() |
||
String message, T selector(T) |
Enumerable.From([{a:"foo",b:1},{a:"bar",b:3}]) |
IEnumerator
method name | return type | arguments | example (click code) |
GetEnumerator | IEnumerator | () |
Enumerable.Range(1,10).GetEnumerator() |
MoveNext | Boolean | () |
Enumerable.Range(1,10).GetEnumerator().MoveNext() |
Current | T | () |
Enumerable.Range(1,10).GetEnumerator().Current() |
Dispose | void | () |
Enumerable.Range(1,10).GetEnumerator().Dispose() |
Dictionary
method name | return type | arguments | example (click code) |
Add | void | TKey key, TValue value |
Enumerable.Empty().ToDictionary().Add(1, 'aaa') |
Get | TValue | TKey key |
Enumerable.Empty().ToDictionary().Get(1) |
Set | Boolean | TKey key, TValue value |
Enumerable.Empty().ToDictionary().Set(1, 'zzz') |
Contains | Boolean | TKey key |
Enumerable.Empty().ToDictionary().Contains(1) |
Clear | void | () |
Enumerable.Empty().ToDictionary().Clear() |
Remove | void | TKey key |
Enumerable.Empty().ToDictionary().Remove(1) |
Count | Number | () |
Enumerable.Empty().ToDictionary().Count() |
ToEnumerable | Enumerable | () |
var dict = Enumerable.Empty().ToDictionary(); |
Lookup
method name | return type | arguments | example (click code) |
Get | Enumerable<TElement> | TKey key |
Enumerable.From([{x:1,s:'a'},{x:1,s:'z'}]) |
Contains | Boolean | TKey key |
Enumerable.From([{x:1,s:'a'},{x:1,s:'z'}]) |
Count | Number | () |
Enumerable.Range(1,5).ToLookup().Count() |
ToEnumerable | Enumerable<Grouping> | () |
Enumerable.From([{a:1,s:'foo'},{a:1,s:'bar'},{a:2,s:'zzzzz'}]) |
Grouping(inherit Eunmerable)
method name | return type | arguments | example (click code) |
Key | TKey | () |
Enumerable.From([{id:"foo",x:10},{id:"bar",x:20},{id:"foo",x:100}]) |
All Enumerable Methods | - | - |
var grouping = Enumerable.From([{id:"foo",x:10},{id:"foo",x:25},{id:"foo",x:100}]) |
jQuery plugin
method name | return type | arguments | example (click code) |
TojQuery | jQuery | () |
// Enumerable.Repeat("foo",10).TojQuery() |
toEnumerable | Enumerable<jQuery> | () |
// $("div").toEnumerable() |
RxJS Binding
method name | return type | arguments | example (click code) |
ToObservable | Rx.Observable | () |
// Enumerable.Range(1,10).ToObservable() |
ToEnumerable | Enumerable | () |
// Rx.Observable.Range(1,10).ToEnumerable() |
Jquery.Linq用法的更多相关文章
- jQuery $.each用法[转]
jQuery $.each用法 以下内容非原创,来自百度文库http://wenku.baidu.com/view/4796b6145f0e7cd18425368e.html 通过它,你可以遍历对象. ...
- jQuery 事件用法详解
jQuery 事件用法详解 目录 简介 实现原理 事件操作 绑定事件 解除事件 触发事件 事件委托 事件操作进阶 阻止默认事件 阻止事件传播 阻止事件向后执行 命名空间 自定义事件 事件队列 jque ...
- jquery cookie 用法
jquery cookie 用法 $.cookie("name","value","options") 当不设置options时,此coo ...
- [转]Jquery Ajax用法
原文地址:http://www.php100.com/html/program/jquery/2013/0905/6004.html jQuery学习之jQuery Ajax用法详解 来源: 时间 ...
- JQuery datepicker 用法
JQuery datepicker 用法 jQuery UI很强大,其中的日期选择插件Datepicker是一个配置灵活的插件,我们可以自定义其展示方式,包括日期格式.语言.限制选择日期范围.添加 ...
- jquery.cookie用法详细解析,封装的操作cookie的库有jquery.cookie.js
jquery.cookie用法详细解析 需要注意存入cookie前,对数据进行序列化, 得到后在反序列化: 熟练运用:JSON.stringify();和JSON.parse(): 通常分为如下几个步 ...
- jquery.post用法补充(type设置问题)
jquery.post用法 http://blog.csdn.net/itmyhome1990/article/details/12578275 当使用ajax获取data数据的时候,直接data.f ...
- linq用法整理
linq用法整理 普通查询 var highScores = from student in students where student.ExamScores[exam] > score se ...
- jQuery -- 光阴似箭(一):初见 jQuery -- 基本用法,语法,选择器
jQuery -- 知识点回顾篇(一):初见jQuery -- 基本用法,语法,选择器 1. 使用方法 jQuery 库位于一个 JavaScript 文件中,其中包含了所有的 jQuery 函数. ...
随机推荐
- android 操蛋的gradle
首先看语法: -include {filename} 从给定的文件中读取配置参数 -basedirectory {directoryname} 指定基础目录为以后相对的档案名称 -injars {cl ...
- Tomcat server.xml UTF-8配置
Tomcat server.xml UTF-8配置 <Connector port="8080" maxThreads="150" minSpareThr ...
- [妙味DOM]第四课:Event-事件详解2
知识点总结 事件捕获 obj.addEventListener('click',fn,true) 从外往里 obj.addEventListener('click',fn,false) 从里往外(冒泡 ...
- LINQ里的“equals”和“==”的区别
对于值类型,如果对象的值相等,则相等运算符 (==) 返回 true,否则返回 false.对于string 以外的引用类型,如果两个对象引用同一个对象,则 == 返回 true.对于 string ...
- PAT 团体程序设计天梯赛-练习集 L1-023. 输出GPLT
给定一个长度不超过10000的.仅由英文字母构成的字符串.请将字符重新调整顺序,按“GPLTGPLT....”这样的顺序输出,并忽略其它字符.当然,四种字符(不区分大小写)的个数不一定是一样多的,若某 ...
- Eclipse desktop
Ubuntu解压Eclipse IDE后并不会在侧边栏显示启动图标,为了能在侧边栏显示,方便启动,可以新建一个desktop文件,具体步骤如下: # switch to root account su ...
- php基础(三)超全局变量
超全局变量 在 PHP 4.1.0 中引入,是在全部作用域中始终可用的内置变量. PHP 全局变量 - 超全局变量 PHP 中的许多预定义变量都是“超全局的”,这意味着它们在一个脚本的全部作用域中都可 ...
- Java 反射 Class对象
Java 反射 Class对象 @author ixenos 关键字:RTTI.动态绑定.动态加载.获得Class引用.泛型Class引用.newInstance的坑.JVM中的泛型类型信息 RTTI ...
- 浙大pat 1037
1037. Magic Coupon (25) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The magi ...
- FTP服务添加用户及设置权限
CentOS下安装vsftpd省略. 添加ftp账户: useradd ahaii -d /home/ftp/ -s /sbin/nologin 添加密码: passwd ahaii 限制该用户只能访 ...