标签存档: coder

Google Map API V3 加入可拖动的路径功能

到目前还没有在API文档中体现, 不过已经在官方实例中给DirectionsRendererOptions加入了draggable属性,例子如下:


var directionDisplay;

directionsDisplay = new google.maps.DirectionsRenderer({

draggable: true,

suppressPolylines:false,markerOptions:{visible : false}

});

如果要监听路径改变,可以监听DirectionsRenderer对象的directions_changed时间, 例子如下:

google.maps.event.addListener(directionsDisplay, 'directions_changed', function() {
     alert(directionsDisplay.getDirections());
});

Web.xml 中 CompressingFilter 定义的位置也会导致文件加载异常

如果碰到加载js / css / images 等文件出现莫名奇妙问题(如:类加载错误$符号未定义图片显示不了css引用有的行有的不行等等等等)的时候,在你检查过文件引用路径,审视过相关文件的引用顺序,吐着鲜血在google hk 上挠头皮的时候,不要忘记检查下你的Filter的解析顺序,尤其是在你引用了 SpringSecurity 并想通过 UrlRewrite 实现简化路径的目的时,切记,谨记,铭记在心。
片段:

<filter-mapping>
    	<filter-name>CompressingFilter</filter-name>
    	<url-pattern>/*</url-pattern>
    	<dispatcher>REQUEST</dispatcher>
    	<dispatcher>FORWARD</dispatcher>
</filter-mapping>

一定要放在

<filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
	<filter-name>rewriteFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

之后,btw springSecurityFilterChain 要在 rewriteFilter 之前解析。

我说我的rss格式那么恶心呢!

wp-includes 下面的 feed-rss2.php 文件的

<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>

替换为:

<description><![CDATA[<?php the_content() ?>]]></description>

替换前,rss格式简直是一陀……

替换后,天空都晴朗了,畅快。

How to make better code from Joel

Do you use source control?
Can you make a build in one step?
Do you make daily builds?
Do you have a bug database?
Do you fix bugs before writing new code?
Do you have an up-to-date schedule?
Do you have a spec?
Do programmers have quiet working conditions?
Do you use the best tools money can buy?
Do you have testers?
Do new candidates write code during their interview?
Do you do hallway usability testing?
继续阅读 »