Displaying keyword search results 1 - 10
Created by Dr. Xi on December 03, 2013 09:14:45 Last update: December 03, 2013 09:14:45
To test the effects of proxy settings http.proxyHost and http.proxyPort , I set these values to a non-existing proxy server:
java -Dhttp.proxyHost=example.com -Dhttp.proxyPort...To my surprise, the Google is retrieved successfully! Is Java ignoring these settings? It turns out that Java tries to fetch the URL directly after the proxy connection fails. If a working proxy is found at proxyHost:proxyPort , then the request is routed through the proxy, otherwise a direct connection is tried. The settings are documented here: http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html . For HTTPS use these properties: htttps.proxyHost htttps.proxyPort
Created by Dr. Xi on September 23, 2013 09:00:22 Last update: September 23, 2013 09:17:55
Tsung is an open-source multi-protocol distributed load testing tool. It's written in Erlang , but don't let that dissuade you. Here are some simple steps to get started. Install Tsung. On Ubuntu, this is simply: sudo apt-get install tsung . Create a config file ( tsung.xml ):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYP...Beware of the dumptraffic attribute. You might want to set it to false for a real load test. Run the test:
$ tsung -f tsung.xml start Starting Tsung "L...Generate the reports:
$ cd /home/drxi/.tsung/log/20130923-1031 $ /usr...Open the report file in your browser: file:///home/drxi/.tsung/log/20130923-1031/report.html . For HTTPS testing change the server line to:
<servers> <server host="192.168.80.160" port="...
Spring MVC 3.2 JSON @ResponseBody produces status 406 "not acceptable according to the request accept headers"
Created by Fang on April 17, 2013 08:50:04 Last update: April 17, 2013 08:50:04
I got HTTP status 406 even with explicit Accept header like this:
curl -x localhost:8088 -H 'Accept: application/jso...The root cause was that I forgot to include Jackson JSON lib in the dependencies. Solution: add this to pom.xml
Created by Fang on January 04, 2013 09:02:44 Last update: January 04, 2013 09:02:44
This snippet sets system properties from Maven surefire test plugin. This is useful when you want to set logging (for example, log4j) properties based on Maven project properties. Example that sets system property testlog.dir :
<plugins> <plugin> <groupId>org.apach...Example log4j.xml that uses system property testlog.dir :
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYP...
Created by Fang on January 04, 2013 08:00:37 Last update: January 04, 2013 08:00:37
This is a Maven POM that prints out some built-in project properties:
$ mvn validate [INFO] Scanning for projects.....
Created by magnum on August 15, 2012 11:34:53 Last update: August 15, 2012 11:34:53
I was scared the first time I saw a bunch of random URL requests from Chrome on my proxy server. Was the copy of Chrome on my machine hacked? It turned out that there was a "deep" reason for the behavior. From Nico Weber : If you type in a single-word search query, chrome needs to send a DNS request to check if this might be a single-word host name: For example, "test" might be a search for "test" or a navigation to "http://test". If the query ends up being a host, chrome shows an infobar that asks "did you mean to go to 'test' instead". For perf reasons, the dns query needs to be asynchronous. Now some ISPs started showing ads for non-existent domain...
Created by Captain on November 22, 2010 04:34:37 Last update: July 22, 2012 20:36:26
HDTV modeline example:
1920x1080 148.5 1920 2008 2052 2200 1080 1084 1088...MythTV modeline database: http://www.mythtv.org/wiki/Modeline_Database
<!DOCTYPE html> <html> <head> <style ...Reference: Custom Resolutions on Intel Graphics
Created by James on April 24, 2012 14:01:39 Last update: April 24, 2012 14:01:39
This is the Mathias Bynens placeholder plugin with several bug fixes of my own.
/*! http://mths.be/placeholder v2.0.7 by @mathias ...
Created by Fang on April 16, 2012 13:32:10 Last update: April 16, 2012 13:32:10
There are two steps to create a custom function for JSP: Declare the function in the TLD:
<?xml version="1.0" encoding="UTF-8" ?> <taglib...Implement the function (must be static):
package com.example; public class UrlTransl...To use the function:
<%@ taglib uri="http://www.example.com/jsp/tags" p...
Created by Fang on March 15, 2012 10:24:35 Last update: March 15, 2012 10:24:35
Suppose that I have an email field annotated with:
@NotEmpty(message="Please enter email address") ...Bean validation will trigger two errors when no email address is entered: the email field is empty an empty email field is not a valid email address Displaying both errors to the user with <form:errors> would be redundant and confusing:
<%@ taglib uri="http://www.springframework.org/tag...This is how to display the first error only:
<spring:bind path="emailAddress"> <c:if test="$...