Calendar

September 2010
S M T W T F S
« Jul    
 1234
567891011
12131415161718
19202122232425
2627282930  

How to set timeout in Apache HttpClient 4

HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, connectionTimeoutMillis);
HttpConnectionParams.setSoTimeout(httpParams, socketTimeoutMillis);
HttpClient httpClient = new DefaultHttpClient(httpParams)

How to set java Servlet timeout

Edit web.xml
Specified the timeout value in “minute” , enclose with “session-config” element.

<web-app …>
<session-config>
<session-timeout>20</session-timeout>
</session-config>
</web-app>

Creating Grails Custom Constraints

Now and than there is the requirement to create custom constraints. As you might already know, there are plenty of constraints that already are shipped with Grails. Those can be applied in the constraints closure of your domain or command classes:

Quick Red5 install on Mac OS X

These steps work fine with version 0.9.0 RC2 at least…

Download the latest dmg from http://code.google.com/p/red5/
Open the package, drag Red5 to your Applications folder, then start the app (nothing happens visually, it’s a server!)
Open http://127.0.0.1:5080/demos/ in a browser, which should hopefully now show you the demo page

The next step is to install the demos you want to [...]

Determining if a Date is a Weekday in T-SQL

create function fn_IsWeekDay
(
@date datetime
)
returns bit
as
begin

declare @dtfirst int
declare @dtweek int
declare @iswkday bit

set @dtfirst = @@datefirst – 1
set @dtweek = datepart(weekday, @date) – 1

if (@dtfirst + @dtweek) [...]