??xml version="1.0" encoding="utf-8" standalone="yes"?>久久电影在线,福利在线视频导航,91精品久久久久久http://www.aygfsteel.com/alinglau36/one platform thousands thinkingzh-cnSat, 17 May 2025 01:36:55 GMTSat, 17 May 2025 01:36:55 GMT60Stackoverflowl典Python问答http://www.aygfsteel.com/alinglau36/archive/2018/05/30/433247.htmllaulauWed, 30 May 2018 10:26:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2018/05/30/433247.htmlhttp://www.aygfsteel.com/alinglau36/comments/433247.htmlhttp://www.aygfsteel.com/alinglau36/archive/2018/05/30/433247.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/433247.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/433247.html

That said, if you're aiming for something like Java's StringBuilder, the canonical Python idiom is to add items to a list and then use str.join to concatenate them all at the end:

l = [] 
l
.append('foo')
l.append('bar')
l
.append('baz')

s
= ''.join(l)



以下是{?https://github.com/qiwsir/StackOverFlowCn/blob/master/README.md
 

如果你是一名自诩ؓE序员的Q那么,必ȝ道stackoverflow.comq个|站。因为它是一个非常好的技术问{网站,里面不仅有高手,更重要的是有寚w题进行详l耐心解答的高手?/p>

q里我抽I翻译了一些典型的问答Q当Ӟ只能译Python语言斚w的,其它语言Q唯恐因知之甚少而漏z百出,即便是PythonQ也会因为才疏学,在翻译过E中感到惶恐。所以,读者如果看到错误之处,请不吝赐教?/p>

Ƣ迎讉KQ?a rel="nofollow" style="box-sizing: border-box; color: #0366d6; text-decoration-line: none;">www.itdiffer.comQ加入学习Python的群l?/p>

#目录

##基本对象和语?/p>

##文g

##函数和类

##pȝ

##|络



lau 2018-05-30 18:26 发表评论
]]>
gerrit (n/a (unpacker error))异常解决http://www.aygfsteel.com/alinglau36/archive/2018/05/10/433206.htmllaulauThu, 10 May 2018 08:36:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2018/05/10/433206.htmlhttp://www.aygfsteel.com/alinglau36/comments/433206.htmlhttp://www.aygfsteel.com/alinglau36/archive/2018/05/10/433206.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/433206.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/433206.html

用如下命令push
git push --no-thin origin HEAD:refs/for/
XXX


error: The following untracked working tree files would be overwritten by checkout 
通过错误提示可知Q是׃一些untracked working tree files引v的问题。所以只要解决了q些untracked的文件就能解册个问题?br />
解决方式Q? 打开SourceTree通过命o行,q入本地版本仓库目录下,直接执行git clean -d -fx卛_。可能很多h都不明白-dQ?fx到底是啥意思,其实git clean -d -fx表示Q删?一?没有 git add ?文gQ? git clean 参数 -n 昄要删除的文件和目录Q? -x -----删除忽略文g已经对git来说不识别的文g -d -----删除未被d到git的\径中的文? -f -----强制q行 git clean -n git clean -df git clean -f



lau 2018-05-10 16:36 发表评论
]]>
http://java.dzone.com/articles/immutability-with-builder-design-patternhttp://www.aygfsteel.com/alinglau36/archive/2013/01/25/394783.htmllaulauFri, 25 Jan 2013 10:16:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2013/01/25/394783.htmlhttp://www.aygfsteel.com/alinglau36/comments/394783.htmlhttp://www.aygfsteel.com/alinglau36/archive/2013/01/25/394783.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/394783.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/394783.htmlhttp://java.dzone.com/articles/immutability-with-builder-design-pattern

lau 2013-01-25 18:16 发表评论
]]>
jQuery.template()http://www.aygfsteel.com/alinglau36/archive/2011/11/02/362514.htmllaulauWed, 02 Nov 2011 02:41:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/11/02/362514.htmlhttp://www.aygfsteel.com/alinglau36/comments/362514.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/11/02/362514.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/362514.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/362514.htmlhttp://api.jquery.com/jQuery.template/

lau 2011-11-02 10:41 发表评论
]]>
jQuery hoverIntenthttp://www.aygfsteel.com/alinglau36/archive/2011/11/02/362513.htmllaulauWed, 02 Nov 2011 02:40:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/11/02/362513.htmlhttp://www.aygfsteel.com/alinglau36/comments/362513.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/11/02/362513.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/362513.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/362513.htmlhttp://cherne.net/brian/resources/jquery.hoverIntent.html

What is hoverIntent?

hoverIntent is a plug-in that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before making the call.

Why? To delay or prevent the accidental firing of animations or ajax calls. Simple timeouts work for small areas, but if your target area is large it may execute regardless of intent.

Download hoverIntent r6 (fully-commented, uncompressed)

Download hoverIntent r6 (minified)

hoverIntent r6 (2011) has all the same functionality of r5 (2007) except that the Google Chrome defect (known defects) is fixed once you upgrade to jQuery 1.5.1.

Translations

Беxарусaая courtesy Martha Ruszkowski

Examples

jQuery's hover (for reference)

$("#demo1 li").hover( makeTall, makeShort )
  •  
  •  
  •  
  • hover ignores over/out events from children

jQuery's built-in hover calls onMouseOver/onMouseOut functions immediately.

hoverIntent as hover replacement

$("#demo2 li").hoverIntent( makeTall, makeShort )
  •  
  •  
  •  
  • hoverIntent also ignores over/out events from children

hoverIntent is interchangeable with jQuery's hover. It can use the same exact onMouseOver and onMouseOut functions and it passes the same this and event objects to those functions.

hoverIntent with configuration object

var config = {    
over: makeTall, // function = onMouseOver callback (REQUIRED)
timeout: 500, // number = milliseconds delay before onMouseOut
out: makeShort // function = onMouseOut callback (REQUIRED)
};

$("#demo3 li").hoverIntent( config )
  •  
  •  
  •  
  •  

To override the default configuration of hoverIntent, pass it an object as the first (and only) parameter. The object must contain "over" and "out" functions, in addition to any other options you'd like to override.

Basic Configuration Options

The "timeout" delay (by default set to 0) will mostly likely be the one you'll want to override. The "over" and "out" functions are required but nothing prevents you from sending an empty function(){} to either.

over:

Required. The function you'd like to call onMouseOver. Your function receives the same "this" and "event" objects as it would from jQuery's hover method.

timeout:

A simple delay, in milliseconds, before the "out" function is called. If the user mouses back over the element before the timeout has expired the "out" function will not be called (nor will the "over" function be called). This is primarily to protect against sloppy/human mousing trajectories that temporarily (and unintentionally) take the user off of the target element... giving them time to return. Default timeout: 0

out:

Required. The function you'd like to call onMouseOut. Your function receives the same "this" and "event" objects as it would from jQuery's hover method. Note, hoverIntent will only call the "out" function if the "over" function has been called on that same run.

Advanced Configuration Options

When choosing the default settings for hoverIntent I tried to find the best possible balance between responsiveness and frequency of false positives. Modify these if you are brave, test tirelessly, and completely understand what you are doing.

sensitivity:

If the mouse travels fewer than this number of pixels between polling intervals, then the "over" function will be called. With the minimum sensitivity threshold of 1, the mouse must not move between polling intervals. With higher sensitivity thresholds you are more likely to receive a false positive. Default sensitivity: 7

interval:

The number of milliseconds hoverIntent waits between reading/comparing mouse coordinates. When the user's mouse first enters the element its coordinates are recorded. The soonest the "over" function can be called is after a single polling interval. Setting the polling interval higher will increase the delay before the first possible "over" call, but also increases the time to the next point of comparison. Default interval: 100

Notice of DOM Manipulation

hoverIntent adds two custom attributes to every DOM element it's assigned to. For example: <li hoverIntent_t="" hoverIntent_s="">

  • hoverIntent_t is the polling interval timer, or the mouseOut timer.
  • hoverIntent_s stores the state to prevent unmatched function calls.

Timers are stored as integers, so there should not be any trouble with memory leaks. hoverIntent state is also stored as an integer.

Known Defects

hoverIntent r5 suffers from a defect in Google Chrome that improperly triggers mouseout when entering a child input[type="text"] element. hoverIntent r6 uses the same mouseenter/mouseleave special events as jQuery's built-in hover, and jQuery 1.5.1 patched this issue. Thanks to Colin Stuart for tipping me off about this and for providing isolated code to demonstrate/test.

This page uses jQuery 1.5.1+ and hoverIntent r6, so when your cursor goes over the text input nothing should change (it should continue to read "enter parent" because you are still over this paragraph).

However, if you were using Google Chrome and if this page were using an older version of jQuery or hoverIntent, moving the cursor over the text input would improperly trigger the mouseout event, and the value would change to "leave parent".

If you place an element with onMouseOut event listeners flush against the edge of the browser chrome, sometimes Internet Explorer does not trigger an onMouseOut event immediately if your mouse leaves the document. hoverIntent does not correct for this.

jQuery's hover can take both a handlerIn and a handlerOut or just a handlerIn. The current version of hoverIntent requires both handlerIn and handlerOut or a single configuration object. It was not designed to take just a handlerIn like hover. This will be addressed in a future release.

Please email me ( brian@cherne.net ) if you have questions or would like to notify me of any defects. I will tweet about any updates from @briancherne using the tags #hoverIntent #jQuery.

The Future of hoverIntent

hoverIntent r7 (in development) will be backwards compatible with all current implementations and include hoverIntent custom events.

Release History

  • r7 = In development. Adding custom events.
  • r6 = Current stable release. Updated to correct for Google Chrome defect.
  • r5 = Added state to prevent unmatched function calls. This release (and previous releases) suffers from a defect in Google Chrome that improperly triggers mouseout when entering a child input[type=text] element.
  • r4 = Fixed polling interval timing issue (now uses a self-calling timeout to avoid interval irregularities).
  • r3 = Developer-only release for debugging.
  • r2 = Added timeout and interval references to DOM object -- keeps timers separate from each other. Added configurable options. Added timeout option to delay onMouseOut function call. Fixed two-interval mouseOver bug (now setting pX and pY onMouseOver instead of hardcoded value).
  • r1 = Initial release to jQuery discussion forum for feedback.


lau 2011-11-02 10:40 发表评论
]]>
IE9 Only CSS Hackhttp://www.aygfsteel.com/alinglau36/archive/2011/11/01/362433.htmllaulauTue, 01 Nov 2011 03:49:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/11/01/362433.htmlhttp://www.aygfsteel.com/alinglau36/comments/362433.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/11/01/362433.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/362433.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/362433.htmlhttp://blog.vervestudios.co/blog/post/2011/05/13/IE9-Only-CSS-Hack.aspx

#element {
    color:orange;
}
#element {
    *color: white;    /* IE6+7, doesn't work in IE8/9 as IE7 */
}
#element {
    _color: red;     /* IE6 */
}
#element {
    color: green\0/IE8+9; /* IE8+9  */
}
:root #element { color:pink \0/IE9; }  /* IE9 */


lau 2011-11-01 11:49 发表评论
]]>
The Essentials of Writing High Quality JavaScript http://www.aygfsteel.com/alinglau36/archive/2011/09/16/358793.htmllaulauFri, 16 Sep 2011 06:38:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/09/16/358793.htmlhttp://www.aygfsteel.com/alinglau36/comments/358793.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/09/16/358793.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/358793.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/358793.htmlgood stuff:

http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/

lau 2011-09-16 14:38 发表评论
]]>
hack css in safari and operahttp://www.aygfsteel.com/alinglau36/archive/2011/08/11/356312.htmllaulauThu, 11 Aug 2011 08:16:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/08/11/356312.htmlhttp://www.aygfsteel.com/alinglau36/comments/356312.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/08/11/356312.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/356312.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/356312.html

@media all and (min-width: 0px){ }opera和safari都支?br /> @media screen and (-webkit-min-device-pixel-ratio:0){}
q个只支持safariQ以前做表单l一样式的时候研I过?br /> 如果惛_分opera和safari的话先写
@media all and (min-width: 0px){
}
然后?br /> @media screen and (-webkit-min-device-pixel-ratio:0){}
O(jin)K?/p>

div{ width:100px; height:200px;}
@media all and (min-width: 0px){ div{ background:red} }
@media screen and (-webkit-min-device-pixel-ratio:0){div{background:#000}}

可以试下



lau 2011-08-11 16:16 发表评论
]]>
freemarker数字格式化带来的操作问题http://www.aygfsteel.com/alinglau36/archive/2011/07/13/354284.htmllaulauWed, 13 Jul 2011 09:37:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/07/13/354284.htmlhttp://www.aygfsteel.com/alinglau36/comments/354284.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/07/13/354284.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/354284.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/354284.html    1、在模板中直接加.toString()转化数字为字W串Q如Q?{languageList.id.toString()}Q?
    2、在freemarker配置文gfreemarker.properties?lt;#setting number_format="#">或?nbsp;     <#setting number_format="0">Q?
    3、在模板中直接加<#setting number_format="#">或?lt;#setting number_format="0">Q如Q?lt;#if AdminLanguagePaginationMsg?exists>
<#setting number_format="#">

lau 2011-07-13 17:37 发表评论
]]>
newInstance() ?new 有什么区别?(?http://www.aygfsteel.com/alinglau36/archive/2011/04/14/348306.htmllaulauThu, 14 Apr 2011 09:37:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/04/14/348306.htmlhttp://www.aygfsteel.com/alinglau36/comments/348306.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/04/14/348306.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/348306.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/348306.html 用newInstance与用new是区别的Q区别在于创建对象的方式不一P前者是使用cd载机Ӟ那么Z么会有两U创建对象方式?q个p从可伸羃、可扩展Q可重用{Y件思想上解释了?
Java中工厂模式经怋用newInstance来创建对象,因此从ؓ什么要使用工厂模式上也可以扑ֈ具体{案?
例如Q?
Class c = Class.forName(“A”);factory = (AInterface)c.newInstance();
其中AInterface是A的接口,如果下面q样写,你可能会理解Q?
String className = "A";Class c = Class.forName(className);factory = (AInterface)c.newInstance();
q一步,如果下面写,你可能会理解Q?
String className = readfromXMlConfig;//从xml 配置文g中获得字W串Class c = Class.forName(className);factory = (AInterface)c.newInstance();
上面代码消灭了AcdUͼ优点Q无论AcL么变化Q上qC码不变,甚至可以更换A的兄弟类B , C , D....{,只要他们l承Ainterface可以?
从jvm的角度看Q我们用new的时候,q个要new的类可以没有加蝲Q?
但是使用newInstance时候,必M证:1、这个类已经加蝲Q?、这个类已经q接了。而完成上面两个步骤的正是class的静态方法forNameQ)Ҏ(gu)Q这个静态方法调用了启动cd载器Q就是加载j(lu)ava API的那个加载器Q?/span>?
有了上面jvm上的理解Q那么我们可以这栯QnewInstance实际上是把newq个方式分解Z?卻I首先调用class的加载方法加载某个类Q然后实例化?
q样分步的好处是显而易见的。我们可以在调用class的静态加载方法forName时获得更好的灉|性,提供l了我们降耦的手段?

[补充:]
newInstance: q型。低效率。只能调用无参构造?
new: 强类型。相寚w效。能调用Mpublic构造?
newInstance()是实现IOC、反、面Ҏ(gu)口编E??依赖倒置 {技术方法的必然选择Qnew 只能实现具体cȝ实例化,不适合于接口编E?
里面是通过q个cȝ默认构造函数构Z一个对象,如果没有默认构造函数就抛出InstantiationException, 如果没有讉K默认构造函数的权限抛出IllegalAccessException

lau 2011-04-14 17:37 发表评论
]]>
关于JavaScript中apply与call的用法意义及区别(?http://www.aygfsteel.com/alinglau36/archive/2011/04/11/348038.htmllaulauMon, 11 Apr 2011 02:27:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/04/11/348038.htmlhttp://www.aygfsteel.com/alinglau36/comments/348038.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/04/11/348038.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/348038.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/348038.html 关于JavaScript中apply与call的用法意义及区别(?

JavaScript中有一个call和applyҎ(gu)Q其作用基本相同Q但也有略微的区别?br />
先来看看JS手册中对call的解释:

call Ҏ(gu)
调用一个对象的一个方法,以另一个对象替换当前对象?br />
call([thisObj[,arg1[, arg2[,   [,.argN]]]]])

参数
thisObj
可选项。将被用作当前对象的对象?br />
arg1, arg2,  , argN
可选项。将被传递方法参数序列?br />
说明
call Ҏ(gu)可以用来代替另一个对象调用一个方法。call Ҏ(gu)可将一个函数的对象上下文从初始的上下文改变为由 thisObj 指定的新对象?br />
如果没有提供 thisObj 参数Q那?Global 对象被用?thisObj?br />

说明白一点其实就是更改对象的内部指针Q即改变对象的this指向的内宏V这在面向对象的js~程q程中有时是很有用的?br />
引用|上一个代码段Q运行后自然明白其道理?br />

<input type="text" id="myText"   value="input text">
<script>
    
function Obj(){this.value="对象Q?/span>";}
    
var value="global 变量";
    
function Fun1(){alert(this.value);}

    window.Fun1();   
//global 变量
    Fun1.call(window);  //global 变量
    Fun1.call(document.getElementById('myText'));  //input text
    Fun1.call(new Obj());   //对象Q?/span>
</script>

call函数和applyҎ(gu)的第一个参数都是要传入l当前对象的对象Q及函数内部的this。后面的参数都是传递给当前对象的参数?br /> q行如下代码Q?br />
<script>
   
var func=new function(){this.a="func"}
    
var myfunc=function(x){
        
var a="myfunc";
        alert(
this.a);
        alert(x);
    }
    myfunc.call(func,
"var");
</script>

可见分别弹出了func和var。到q里对call的每个参数的意义有所了解了?br />
对于apply和call两者在作用上是相同的,但两者在参数上有区别的?br /> 对于W一个参数意义都一P但对W二个参敎ͼ
apply传入的是一个参数数l,也就是将多个参数l合成ؓ一个数l传入,而call则作为call的参C入(从第二个参数开始)?/span>
?func.call(func1,var1,var2,var3)对应的apply写法为:func.apply(func1,[var1,var2,var3])

同时使用apply的好处是可以直接当前函数的arguments对象作ؓapply的第二个参数传入


lau 2011-04-11 10:27 发表评论
]]>
Freemarker操作字符?/title><link>http://www.aygfsteel.com/alinglau36/archive/2011/02/23/344970.html</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Wed, 23 Feb 2011 06:04:00 GMT</pubDate><guid>http://www.aygfsteel.com/alinglau36/archive/2011/02/23/344970.html</guid><wfw:comment>http://www.aygfsteel.com/alinglau36/comments/344970.html</wfw:comment><comments>http://www.aygfsteel.com/alinglau36/archive/2011/02/23/344970.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alinglau36/comments/commentRss/344970.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alinglau36/services/trackbacks/344970.html</trackback:ping><description><![CDATA[<p>1、substringQstart,endQ从一个字W串中截取子?br /> start:截取子串开始的索引Qstart必须大于{于0Q小于等于end<br /> end: 截取子串的长度,end必须大于{于0Q小于等于字W串长度Q如果省略该参数Q默认ؓ字符串长度?br /> 例子Q?br /> ${‘str’?substring(0)}àl果为str<br /> ${‘str’?substring(1)}àl果为tr<br /> ${‘str’?substring(2)}àl果为r<br /> ${‘str’?substring(3)}àl果?br /> ${‘str’?substring(0,0)}àl果?br /> ${‘str’?substring(0,1)}àl果为s<br /> ${‘str’?substring(0,2)}àl果为st<br /> ${‘str’?substring(0,3)}àl果为str</p> <p>2、cap_first 字W串中的W一个单词的首字母变为大写?br /> ${‘str’Qcap_first}àl果为Str<br /> 3、uncap_first字W串中的W一个单词的首字母变为小写?br /> ${‘Str’Qcap_first}àl果为str<br /> 4?capitalize字W串中的所有单词的首字母变为大?br /> ${‘str’Q?capitalize}àl果为STR</p> <p>5?date,timeQdatetime字W串转换为日?br /> 例如Q?br /> <#assign date1=”2009-10-12”?date(“yyyy-MM-dd”)><br /> <#assign date2=”9:28:20”?time(“HH:mm:ss”)><br /> <#assign date3=” 2009-10-12 9:28:20”?time(“HH:mm:ss”)><br /> ${date1}àl果?009-10-12<br /> ${date2}àl果?:28:20<br /> ${date3}àl果?009-10-12 9:28:20<br /> 注意Q如果指定的字符串格式不正确引发错误?/p> <p>6、ends_with 判断某个字符串是否由某个子串l尾Q返回布?yu)倹{?br /> ${“string”?ends_with(“ing”)?string} q回l果为true<br /> 注意Q布?yu)值必{换ؓ字符串才能输?/p> <p>7、html 用于字W串中的<?gt;?amp;?#8220;替换为对应得&lt;&gt;&quot:&amp</p> <p>8、index_ofQsubstring,startQ在字符串中查找某个子串Q返回找到子串的W一个字W的索引Q如果没有找到子Ԍ则返?1?br /> Start参数用于指定从字W串的那个烦引处开始搜索,start为数字倹{?br /> 如果start大于字符串长度,则start取值等于字W串长度Q如果start于0Q?则start取gؓ0?br /> ${“string”?index_of(“in”) àl果?<br /> ${“string”?index_of(“ab”) àl果?1</p> <p>9、lengthq回字符串的长度 ${“string”?length}àl果?</p> <p>10、lower_case字W串转ؓ写<br /> ${“STRING”?lower_case}àl果为string</p> <p>11、upper_case字W串转ؓ大写<br /> ${“string”?upper_case}àl果为STRING</p> <p>12、contains 判断字符中是否包含某个子丌Ӏ返回布?yu)?br /> ${“string”?contains(“ing”)?string} àl果为true<br /> 注意Q布?yu)值必{换ؓ字符串才能输?/p> <p>13、number字W串转换为数?br /> ${“111.11”?number}àl果?11.11</p> <p>14、replace用于字W串中的一部分从左到右替换为另外的字符丌Ӏ?br /> ${“strabg”?replace(“ab”,”in”)} àl果为string</p> <p>15、split使用指定的分隔符一个字W串拆分Zl字W串</p> <p><#list “This|is|split”?split(“|”) as s><br /> ${s}<br /> </#list><br /> l果?<br /> This<br /> is<br /> split</p> <p>16?trim 删除字符串首?${“ String ”?trim} àl果为String<br /> <br /><strong> 如果本文Ҏ(gu)有帮助ƈ且要鼓励我的话,h描如下二l码支持本h的劳动成果,多谢了!</strong><br /><br /><img src="http://www.aygfsteel.com/images/blogjava_net/alinglau36/wcpay.jpg" width="500" height="685" alt="" /><br /> </p><img src ="http://www.aygfsteel.com/alinglau36/aggbug/344970.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alinglau36/" target="_blank">lau</a> 2011-02-23 14:04 <a href="http://www.aygfsteel.com/alinglau36/archive/2011/02/23/344970.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The project cannot be built until build path errors are resolved ?Error in Eclipse IDEhttp://www.aygfsteel.com/alinglau36/archive/2011/02/22/344843.htmllaulauTue, 22 Feb 2011 05:59:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/02/22/344843.htmlhttp://www.aygfsteel.com/alinglau36/comments/344843.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/02/22/344843.html#Feedback0http://www.aygfsteel.com/alinglau36/comments/commentRss/344843.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/344843.htmlFollowing content is referenced from

http://www.scottdstrader.com/blog/ether_archives/000921.html

Opening a workspace with several projects, I was presented with the following error for two of the projects:
To resolve this error in eclipse do the following steps.

The resolution was to force a resave of the selected projects (and their .classpath files):

Open the project properties
Select Java Build Path > Libraries
Add a new, arbitrary library (to be deleted later) > OK
Wait for the workspace to refresh (or force a refresh of the project)
The error(s) will go away
Remove the dummy library
The only other references I could find were to make minor alterations of contents of the .classpath file.



lau 2011-02-22 13:59 发表评论
]]>
你不知道?JavaScript - “this?/title><link>http://www.aygfsteel.com/alinglau36/archive/2011/02/09/344000.html</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Wed, 09 Feb 2011 15:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/alinglau36/archive/2011/02/09/344000.html</guid><wfw:comment>http://www.aygfsteel.com/alinglau36/comments/344000.html</wfw:comment><comments>http://www.aygfsteel.com/alinglau36/archive/2011/02/09/344000.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/alinglau36/comments/commentRss/344000.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/alinglau36/services/trackbacks/344000.html</trackback:ping><description><![CDATA[http://www.yaosansi.com/post/1263.html<br /> <br /> pretty good, worth reading. <br /> <br /> <img src ="http://www.aygfsteel.com/alinglau36/aggbug/344000.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/alinglau36/" target="_blank">lau</a> 2011-02-09 23:25 <a href="http://www.aygfsteel.com/alinglau36/archive/2011/02/09/344000.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>YAHOO.util.Dom之寻找节??http://www.aygfsteel.com/alinglau36/archive/2011/02/01/343835.htmllaulauTue, 01 Feb 2011 00:55:00 GMThttp://www.aygfsteel.com/alinglau36/archive/2011/02/01/343835.htmlhttp://www.aygfsteel.com/alinglau36/comments/343835.htmlhttp://www.aygfsteel.com/alinglau36/archive/2011/02/01/343835.html#Feedback1http://www.aygfsteel.com/alinglau36/comments/commentRss/343835.htmlhttp://www.aygfsteel.com/alinglau36/services/trackbacks/343835.htmlYAHOO.util.Dom之寻找节?/h2>

YUI的DomҎ(gu)一共有45个,在这里谈一下我学习q程遇到的问题和l验Q先介绍17个寻找节点类型的DomҎ(gu)?/p>

get(el)Q记得初学JavaScript的时候,最先认识的两个Ҏ(gu)是getElementById? getElementsByTagNameQ这两个东东也基本上能够扑ֈ大多C需要找的东西啦。YUI里的getҎ(gu)跟getElementByIdc? |但是它的能力却要强很多了Qel可以是String、HTMLElement或者Array?/p>

getElementsBy ( method , tag , root , apply , o , overrides )Q这个会和getElementsByTagName比较像一点点吧,但是功能差好q,基本上getElementsBy应该可以扑ֈ一切你x的元 素,method是定义一个校验目标元素的Ҏ(gu)Q返回一个boolean|tag是目标元素的nodeNameQroot是指在哪个元素中q行LQ也 可以说成是一个范围吧。applyQ我必须要说下它。。当初它困扰我了半天QYUIl出的解释是“A function to apply to each element when found ”Q可以理解ؓ一个回调函数吧Q再看看YUI的代码,其中有这么一D:

if (apply) {
Y.Dom.batch(nodes, apply, o, overrides);
}

我当时的理解是,因ؓ最l返回的是一个节点的数组嘛,我就以ؓ执行完前边的校验后得到的l果再在apply中进行一ơ,也就是我在apply中再? l果元素q行下一步的节点LQ那么最后返回的应该是apply执行后得到的所有节炚w合。。。可是无论我怎么试,最l返回的都是通过methodҎ(gu)所 得到数组Qƈ没有再次通过apply获得更多的元素,嘿嘿Q不要见W哈Q当时就是这么想的。。。后来发玎ͼ实际上不是这样子Q我理解错误的原因只要就在那 个batch上,当时的错误在于,我把batch放进getElementsBy里了Q那么在batch里边return后应该不会再l箋执行 return nodes了,但是实际上这里的Y.Dom.batch(nodes, apply, o, overrides)只是一个最l的l果而已Q所以return nodesq是会执行的。那么这个apply的作用在何处呢?其实作用是执行一ơ回调嘛哈,它是可以实现我之前的x的,但是不是直接q回的,举个? 子:

var uls = YAHOO.util.Dom.getElementsBy(function(el){
return el.className === 'J_tab';
},'ul','content');

q是Lid为content的容器下className为J_tab的节点,那么如果我同时还需要获取每个ul下的所有li节点该怎么做呢QM能再来一ơ@环吧Q当然也可以啦,不过要好好利用下YUI吧,那就是让它获取ul的同时获取liQ?/p>

var lis = [];
function getli(obj) {
lis.push(obj.getElementsByTagName('li'));
}
var uls = YAHOO.util.Dom.getElementsBy(function(el){
return el.className === 'J_tab';
},'ul','content',getli);

OKQ这样子׃举两得了哈~后边的作用域和上下文׃多说啦,关于batch的神奇,下次再说哈,真的很神奇。。?/p>

getElementBy ( method , tag , root )Q这个就是通过method校验的第一个元素?/p>

getElementsByClassName ( className , tag , root , apply , o , overrides )Q是通过classNameq行元素LQ其实这个方法是getElementsBy的一个特D方法?/p>

getChildren ( node )Q这个与Dom中的childNodecM?/p>

getChildrenBy ( node , method )Q通过methodҎ(gu)qo子元素,注意参数的顺序以及node不可为id?/p>

getFirstChild ( node )Q寻扄一个子元素Q跟Dom中的firstChild有些cM?/p>

getFirstChildBy ( node , method )Q寻扄一个通过method校验的子元素Q注意参数的序以及node不可为id。其实这个等同于getChildrenBy得到的第一个元素?/p>

getLastChild ( node )Q寻找最后一个子元素Q与Dom中的lastChild有些cM?/p>

getLastChildBy ( node , method )Q与getFirstChildBy相反Q倒着L?/p>

getAncestorBy ( node , method )Q寻扄节点Q可以无限的往上LQ直到找Cؓ止,node不能为idQ跟Dom中的parentNodecMQ不q这里不用反复的parentNode啦?/p>

getAncestorByClassName ( node , className )Q通过classNameL父节点,是getAncestorBy的一个特D方法?/p>

getAncestorByTagName ( node , tagName )Q通过tagNameL父节点,是getAncestorBy的一个特D方法?/p>

getNextSibling ( node )Q寻扄挨的下一个同U非文本节点的节点,与Dom中的nextSiblingcMQ省M判断文本节点ȝ?/p>

getNextSiblingBy ( node , method )Q无限的往下找直到扑ֈ通过method校验的同U非文本节点Qnode不能为idQ有了这个方法就不用无限的nextSibling啦?/p>

getPreviousSibling ( node )Q寻扄挨的上一个同U非文本节点的节点,与Dom中的previousSiblingcMQ可以省d断文本节点的ȝ?/p>

getPreviousSiblingBy ( node , method )Q无限的往前找直到扑ֈ通过method校验的同U非文本节点Qnode不能为id?/p>

lau 2011-02-01 08:55 发表评论
]]>
վ֩ģ壺 | Դ| ̨| | | ̨| ʡ| | | | | | | | ̨| | | | | | ٽ| | ˫| | ʩ| | | Ӱ| Ҷ| ˮ| ˳| ԫ| | | | | Ȫ| | | | ǭ|