get

Making a web service request with a timeout from a Play Framework Controller

My original "Day 1 with Play web services" code is shown a few paragraphs below, but on Day 2, the following code looks like an easier solution to the problem, courtesy of this web page:

Mutable Scala arrays (adding elements to arrays)

Just a quick note today that if you want to create a mutable Scala array -- particularly an array that can grow in size after you first declare it -- you need to use the Scala ArrayBuffer class instead of the Array class, which can't grow.

Here's a short example of how to instantiate an ArrayBuffer object, then add elements to the array:

Java Apache HttpClient REST (RESTful) client examples

I've started writing some Java REST (RESTful) clients lately, and in doing so, I've been looking at several different ways to do this, including using the Apache HttpClient project, the Jersey project, Apache CXF, and more.

A simple PHP form example

PHP form FAQ: Can you share an example of a very simple PHP form (a self-processing PHP form)?

Still trying to catch up on a lot of PHP examples I've written but never published, here's the source code for a simple PHP form example. This form posts back to itself, and while I'm generally not a fan of that coding approach, I have used it from time to time for simple tasks.

A simple PHP form example

Here's the source code for this simple PHP form example:

Perl CGI cookies - How to get and set cookies in Perl CGI programs

In Part 1 of this series, we provided some background information about cookies, discussing the problem of state maintenance in web applications. We discussed how cookies can help solve this problem, and outlined the drawbacks and limitations of cookies. We even discussed a few examples of how you might use cookies in a customizable web site or e-commerce site.

How do I set environment variables in Perl programs?

Perl environment FAQ: How do I set environment variables in Perl programs?

In several other articles, we've demonstrated how you can access the value of environment variables from your Perl programs. For example, to determine the setting of your "PATH" environment variable, you can just do something like this:

$path = $ENV{'PATH'};

As you may remember, %ENV is a special hash in Perl that contains the value of all your environment variables.

Java FAQ: How to determine the Java version running your application

A frequently asked Java question is, "How can I tell what version of Java is running my program?"

Answer: Just use this line of source code to determine the version of Java that is running your program:

How to put an object on the request in a servlet

Many times when you're working with Java servlets and JSP's, you'll want to forward some piece of information from your servlet to your JSP without having to put that piece of information into the session. For instance, in many applications you may not have a user session, and in other cases where you do have a session, you may just not want to put a bunch of junk in there.

How to use anonymous CVS to access a CVS repository

I can never remember the command-line syntax to access a remote CVS repository via anayonymous CVS access, so just as a reminder to myself, here are the commands I used recently to access an OpenBSD CVS repository:

Syndicate content