35 个最好的 Ajax jQuery 自动完成插件,带例子

In this article,We are providing the best tutorials of Autocomplete in jQuery , ajax autocomplete and autosuggest with examples. jQuery Autocomplete an input field to enable users quickly finding and selecting some value, leveraging searching and filtering.In these days every body want fast and instant search,for this reason many popular search engines like google are using this feature ajax autocomplete.Combination of Php,ajax and jQuery autocomplete gives some extra feature to autosuggest.

1. Ajax AutoComplete for jQuery

Ajax Autocomplete for jQuery allows you to easily create autocomplete/autosuggest boxes for text input fields. Built with focus on performance – results for every query are cached and pulled from …
Ajax AutoComplete for jQuery

Read More Demo 阅读全文 >>

Varnish 的安装使用,及简单配置

Varnish 是一个开源的反向代理软件,所以可做缓存服务器进行 Web 加速,类似的有 Squid, Nginx, 和  HAProxy。但 Varnish 与其他三个相比性能更优,例如 Squid 的成名是它可作为上网代理服务器, Nginx 是一个优秀 Web 服务器,这两都非专业的 Web 加速器,而 HAProxy 与  Varnish 有的一比。

实际上 Varnish 的表现如何了,网上找来找去都讲这么一个实证:挪威最大的在线报纸 Verdens Gang 使用3台Varnish代替了原来的12台Squid,性能比以前更好。并且要知道 Varnish 的作者Poul-Henning Kamp是FreeBSD的内核开发者之一,牛人一个。

Varnish 有什么特点呢?

VCL 进行配置,正则表达式条件判定进行规则设置
支持负载均衡和健康检查,多种条件请求分分
支持 ESI( Edge Side Include),即页面局部组件的缓存
URL 地址重写,响应头改写 阅读全文 >>

由 TextMate 2 重回 TextMate 1.5.11, 附注册方法

我最爱在 Mac 下用 TextMate 了,2.0 后 TextMate 可免费使用了。在 http://macromates.com/download 上目前提供有 1.5.10, 1.5.11 和 2.o alpha。而且还开源了,见 https://github.com/textmate/textmate。但 2.0 之前的版本要用的话仍是需要注册,TextMate 2.0 还是自动更新的,可在 http://macromates.com/download,也可在 https://github.com/textmate/textmate/downloads 下载。

本来可以用  TextMate 2.0 挺好的,可是在 2.0 安装 Scala 的 Bundle 后,即使为它设置了 SCALA_HOME 仍是无法在 TextMate 中运行 Scala 程序,于是不得已为这个还得用 TextMate 1.5.11 了。

在此附上 Scala 和 Play2 的 Bundle 的下载安装方法:

$  git clone git://github.com/mads379/scala.tmbundle.git; open scala.tmbundle
$  git clone git://github.com/drewhjava/Play2.tmbundle.git; open Play2.tmbundle

使用 TextMate 是必须注册的,否则只能试用 30 天,从网上找来注册方法: 阅读全文 >>

XSLT 调用 Java 的类方法 -- Tomcat 环境

很早很久以前写过一篇 在 xslt 调用 java 方法的日志 XSLT 调用 Java 的类方法, 其中介绍是使用 org.apache.xalan.processor.TransformerFactoryImpl 实现的例子,JDK 本身就是用这个的。但是在 Tomcat 环境下,它有它自己的 XSLT 默认实现是 net.sf.saxon.TransformerFactoryImpl,这时候 XSLT 中的内容略有不同,而且显示更简便一些。

这么说吧, xalan 支持以下两种调用 java 方法的方式,而 saxon 只认得第二种

1. 声明到包,调用时带上类名

阅读全文 >>

Using Network Link Conditioner in iOS 6

来到芝加哥后好久没写博客了,有些文章本想翻译后介绍给大家,可如今越发没先前那翻译的意愿了,所以不妨直接贴出原文如下:

I previously covered using Network Link Conditioner to test how your app does in less-than-ideal network scenarios. One of the inconveniences of using it is in order to test your app on a device, you have to take the extra steps to configure a proxy on your computer that your device can connect to over a wi-fi connection. Well, not anymore. With iOS 6, Apple has given us Network Link Conditioner right on the device.

To get started with Network Link Conditioner, first your device must be set up as a developer device. If you haven’t done this yet, you’ll need to go to Xcode, open Organizer (Shift-Command-2), select your device, and click the button that says Use for Development to add the device your developer account. Once you’ve done that, you should be able to open Settings on your device and see a Developer menu near the bottom, just above the apps list. Tapping on that reveals some helpful settings, Network Link Conditioner Status obviously being the one relevant to our interests here. 阅读全文 >>

扩展 JUnit 4,使用定制的 Runner

JUnit 的测试用例总是由 Runner 去执行,JUnit 提供了 @RunWith 这个测试类的 Annotation, 可来指定自定义的 Runner。如果未指定特别的  Runner,那么会采用默认的 Runner,可能不同的环境,如 Eclipse,控制台下会有不同的默认 Runner。

如果不清楚 Runner 是什么,那么可能见过 @RunWith(SpringJUnit4ClassRunner.class) 这个东西,它有助你加载 Spring 的配置文件,及与 Spring 相关的事物。

那么自定义的 Runner 有什么用呢?它可以截获到 @BeforeClass, @AfterClass, @Before, @After 这些事件,也就是能在测试类开始和结束执行前后,每个测试方法的执行前后处理点事情。

比如说从外部读取内容进行初始化测试数据,而且 JUnit 本身就提供了 @RunWith(Parameterized.class)  这个参数化 Runner,用了为带参数测试方法循环填充数据进行测试。JUnit 的参数化测试比 C# 还是要笨拙一些,C# 直接用方法注解一行行设置参数,我想 JUnit 稍加定制的话也行的。 阅读全文 >>

使用 JDK 5 后的线程并发,Callable, Future, ExecutorServie ...

被问及 Java 多线程,多会想到 Thread, Runnable,更通常是用 new Thread(){public void run(){...}}.start() 来启动一个线程。那都是 JDK 1.5 之前的年代了,现在还这么回答就 Out 了。用用  JDK 1.5 给我们带来的  java.util.concurrent 吧,更酷了。这里不涉及它的并发集合类,同步互斥机制,只说线程及线程池的应用举例。

1. 新的启动线程的方式:

阅读全文 >>

正则表达式之环视(Lookaround)[转]

1       环视基础

环视只进行子表达式的匹配,不占有字符,匹配到的内容不保存到最终的匹配结果,是零宽度的。环视匹配的最终结果就是一个位置。

环视的作用相当于对所在位置加了一个附加条件,只有满足这个条件,环视子表达式才能匹配成功。

环视按照方向划分有顺序和逆序两种,按照是否匹配有肯定和否定两种,组合起来就有四种环视。顺序环视相当于在当前位置右侧附加一个条件,而逆序环视相当于在当前位置左侧附加一个条件。

表达式

说明

(?<=Expression)

逆序肯定环视,表示所在位置左侧能够匹配Expression

(?<!Expression)

逆序否定环视,表示所在位置左侧不能匹配Expression

(?=Expression)

顺序肯定环视,表示所在位置右侧能够匹配Expression

(?!Expression)

顺序否定环视,表示所在位置右侧不能匹配Expression

  阅读全文 >>

Scala 的学习笔记系列(持续更新中)

最近学习 Scala,因它是灵活的函数式编程,还有就是能为 PlayFramework 2.0 服务,看的是 《Programming in Scala》 那本书,并记下自己认为值得记录的东西,列举

  1. Scala 用元组/列表类型实现多返回值的函数
  2. Scala 无参数方法和统一访问原则
  3. Scala 的 apply 和 update 方法的应用
  4. Scala 特质(trait) 的 super 方法调用是动态绑定的 
  5. Scala 的 yield 例子 (for 循环和 yield 的例子)
  6. Scala 中 ensuring 方法的使用说明
  7. Scala 2.10.0 新特性之使用隐式类进行类型隐式转换
  8. Scala 2.10.0 新特性之动态属性、方法
  9. Scala 2.10.0 新特性之字符串插值
  10. 使用 sbt 的 np 插件自动创建目录结构和 build.sbt 文件

关于 PlayFramework 2.0 的应用请参考我的另一个系列:

Play 2.0 中文资料--翻译附注解(持续更新中)

Play 2.0 中文资料--翻译附注解(持续更新中)

最近在研究 PlayFramework 2.0,主要关注在使用 Scala 来写 Play 2.0 的应用,下面是从官方文档进行的翻译,并加入了大量的自己的理解与备注( Unmi 注: 起头的蓝色文字)

  1. Play 2.0 中文资料 - 开篇
  2. Play 2.0 中文资料 - 安装 
  3. Play 2.0 中文资料 - 创建一个新的应用 
  4. Play 2.0 中文资料 - 剖析 Play 2.0 应用 
  5. Play 2.0 中文资料 - 使用 Play 2.0 控制台 
  6. Play 2.0 中文资料 - HTTP 编程 
  7. Play 2.0 中文资料 - 搭建你偏爱的 IDE 
  8. Play 2.0 中文资料 - Action, Controller 和 Result 
  9. Play 2.0 中文资料 - HTTP 路由 
  10. Play 2.0 中文资料 - 操控 Result  阅读全文 >>