上一章我们共同研究了for循环以及变种。这章我们围绕比较常用的几个其他控制语句学习。首先,对for进行补充,For-Comprehensions格式:for(s)yielde举例:varrange=0.until(10)
varm=for(p<-rangeifp>5)yieldp
println(m);结果:Vector(6,7,8,9)下面我们根据官方例子来先..
分类:
其他好文 时间:
2014-05-27 03:40:59
阅读次数:
287
function isMobile() { //sniff a mobile browser
if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS...
分类:
其他好文 时间:
2014-05-23 22:21:26
阅读次数:
246
假设给我们一个泛型对象List,T为int类型,要求我们使用该对象方法FindAll(Predicate match)从中找出该List中的偶数,您如何实现?
说明一下:Predicate是一个泛型委托,它的原型为public delegate bool Predicate(T obj),该委托传....
分类:
其他好文 时间:
2014-05-23 10:04:08
阅读次数:
350
注意两点
1.通过android:checkedButton="@+id/lunch"而不是item中的 android:checked="true"设置的某人被选中状态
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
a...
分类:
其他好文 时间:
2014-05-23 00:04:35
阅读次数:
344
转:适有修改并调试OKvar Sys = (function (ua) { var s = {};
s.IE = ua.match(/msie ([\d.]+)/) ? true : false; s.Firefox =
ua.match(/firefox\/([\d.]+)/) ...
分类:
其他好文 时间:
2014-05-22 15:24:55
阅读次数:
227
典型错误案例:
经常我们会通过addView方法,动态添加一些子布局,比如下面的一段代码.
LinearLayout linParent = (LinearLayout) findViewById(R.id.aty_slider_linParent);View vChild = mInflater.inflate(R.layout.view_loding, null);linP...
分类:
移动开发 时间:
2014-05-22 09:41:22
阅读次数:
553
function
is_mobile(){$regex_match="/(nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|";$regex_match.="htc|dopod|bl...
分类:
移动开发 时间:
2014-05-21 19:02:55
阅读次数:
302
function getServiceUrl() { var serverUrl =
Xrm.Page.context.getServerUrl(); if (serverUrl.match(/\/$/)) { serverUrl =
serverUrl.substring(0, server...
分类:
其他好文 时间:
2014-05-20 07:40:00
阅读次数:
250
上篇说道,tokenize方法会把selector分割成一个个selector逻辑单元(如div a是两个逻辑单元)并为之片段赋予对应类型的过滤函数。
for ( type in Expr.filter ) {
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||...
分类:
Web程序 时间:
2014-05-18 13:42:59
阅读次数:
393
比较两个字符串1. 题目:比较字符串是否相等2.
要求:写一程序,比较两个字符串String1和String2所含的字符是否相同;若相同则显示’Match’,否则显示’NoMatch’。输入两个字符串之后,将串操作所必须的寄存器等参数设置好,然后使用串操作指令进行从头到尾的比较,两个字符串相等的条件...
分类:
编程语言 时间:
2014-05-17 23:40:34
阅读次数:
409