Recent Notes

Displaying keyword search results 1 - 10
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="...
Created by freyo on September 09, 2011 11:43:36    Last update: September 09, 2011 11:45:45
When you run automated Android tests with Eclipse or from the command line, you get text output, which isn't good for reporting purposes. If you run a large set of test cases with automated build, the text report isn't very helpful. Fortunately, Android CTS generates test reports in XML with accompanying XSL to make it look nice in a browser. To run your own tests with Android CTS: Download Android CTS Make a new directory MyRepository under android-cts , alongside the existing repository directory. Copy host_config.xml from repository to MyRepository Create directory plans under MyRepository , add a test plan ( MyTests.xml ): <?xml version="1.0" encoding="UTF-8"?> <TestPla... Create directory testcases under MyRepository . Copy TestDeviceSetup.apk from repository/testcases to MyRepository/testcases Under MyRepository/testcases , create a test...
Created by freyo on August 17, 2011 12:29:46    Last update: August 17, 2011 12:29:46
In Android.mk , you can define LOCAL_JARJAR_RULES like this: LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.t... and in jarjar-rules.txt define a rule like this: rule org.bouncycastle.** com.android.@0 The build will change all org.bouncycastle to com.android.org.bouncycastle . Therefore, in your classes which are dependent on the library produced, the import statements should look like: import com.android.org.bouncycastle... Help for the jarjar utility (in prebuilt/common/jarjar/ ): $ java -jar jarjar-1.0rc8.jar Jar Jar Links - ...
Created by jinx on May 18, 2011 20:09:05    Last update: May 18, 2011 20:09:05
The PHP function file_get_contents reads the entire contents of a file into a string, while the function file reads a file into an array. file_get_contents('filename') is equivalent to implode('', file('filename')) : <?php // reads entire file into array, one elem...
Created by James on October 15, 2010 20:10:26    Last update: October 15, 2010 20:10:26
Download the Cufon Javascript and save it as cufon-yui.js . Generate the font JavaScript and save it as myfont.js (upload the font file through http://cufon.shoqolate.com/generate/ ). Add these lines to the header element: <script type="text/javascript" src="cufon-yui.js">... Replace selected elements with JavaScript like this: <script type="text/javascript"> Cufon.rep... Full HTML page: <!DOCTYPE html> <html> <head> <title>C... Reference: Cufonize Your Pages – How to add Cufon to your Web Design
Created by James on September 10, 2010 23:01:14    Last update: September 10, 2010 23:01:14
By default, heights for jQuery UI tab panels expand or contract depending on the height of each tab. The code snippet here sets the height of all tabs to be equal to that of the container. <!DOCTYPE html> <html> <head> <title>jQu...
Created by Dr. Xi on August 03, 2010 16:29:35    Last update: August 03, 2010 16:36:50
This utility converts unicode escape strings in a file to UTF-8 encoded. Suppose you received a properties file with contents like: # @(#)codepoint_zh_CN.properties 1.4 05/09/27 #... You can use this utility to convert it to UTF-8 and view or edit. import java.io.*; /** * Reads file with... This utility is equivalent to: native2ascii -reverse -encoding utf-8 using the standard Java native2ascii utility.
Created by voodoo on July 11, 2009 15:14:55    Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. It's really easy to see HTTP headers with curl: C:\>curl --head http://www.google.com HTTP/1.0 ... or, headers and page together (dump headers to stdout): $ curl --dump-header - http://www.google.com HTTP/... Download openssl from openssl.org: curl http://www.openssl.org/source/openssl-0.9.6m.... C:\>curl --help Usage: curl [options...] <url> ...
Created by Dr. Xi on June 11, 2010 19:04:18    Last update: June 11, 2010 19:06:35
The caret ^ is DOS command line escape character. Example 1: echo < and > as is, not interpreting them as input/output redirect. @rem sign an XML file. Requires Java class utils.x... Example 2: treat & literally, not as the special character to combine two commands. @rem search "dos command line" in Google. curl ... Add switch -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" to make curl look like Firefox.
Created by Fang on April 01, 2010 22:24:58    Last update: April 02, 2010 02:49:38
In this note I'll show you how to create and package a JSP custom tag. The purpose of this tag is to display a random splash image for a home page, among a set of images. We should be able to add or delete candidate splash images from the WAR archive without the need to change the JSP. This is the intended use of the tag: <%@ taglib uri="http://custom.tag.com/demo" prefix... In the above example you provide a set of images named splash*.png (e.g., splash1.png, spalsh2.png, ...), and the tag will pick a random one to display when the JSP is rendered. Let's get started. I'll use Maven for this purpose. Create the standard Maven directory structure ./pom.xml ./src ./src/main ./src/main/jav... pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0"... SplashTag.java package tagdemo; import java.util.ArrayList......
Previous  1 2 Next