The URLVariables class allows you to define data to be sent along with a URLRequest.
Example:
var variables:URLVariables = new URLVariables();
variables.prop = "hello";
variables.anotherProp = 10;
var request:URLRequest = new URLRequest('http://someservice.com');
request.data = v...
The URLRequestMethod class contains constants for the various request types you can make. These constants are to be allocated to URLRequest's method property:
var request:URLRequest = new URLRequest('http://someservice.com');
request.method = URLRequestMethod.POST;
Note that only GET and POST...
If you need to roll for a true or false in an "x% chance" situation, use:
function roll(chance:Number):Boolean {
return Math.random() >= chance;
}
Used like:
var success:Boolean = roll(0.5); // True 50% of the time.
var again:Boolean = roll(0.25); // True 25% of the time.
...
To get started with Thymeleaf visit official download page.
Maven dependency
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>
Gradle dependency
compile gr...
std::sort, found in the standard library header algorithm, is a standard library algorithm for sorting a range of values, defined by a pair of iterators. std::sort takes as the last parameter a functor used to compare two values; this is how it determines the order. Note that std::sort is not stable...
Simple example of how to create a custom plugin and DSL for your gradle project.
This sample uses one of the three possible ways of creating plugins.
The three ways are:
inline
buildSrc
standalone plugins
This example shows creating a plugin from the buildSrc folder.
This sample will crea...
Detailed instructions on getting openerp set up or installed in Debian/Ubuntu.
To install from source code, we need Python 2.7, Git and a PostgreSQL database:
$ sudo apt-get install git python-pip python2.7-dev -y
$ sudo apt-get install postgresql -y
$ sudo su -c "createuser -s $(whoami)&qu...
The Flex compiler (mxmlc) is one of the most important parts of the Flex SDK. You can edit AS3 code in any text editor you like. Create a main class file that extends from DisplayObject.
You can trigger builds at the command line as follows:
mxmlc -source-path="." -default-size [width in...
To round a value to the nearest multiple of x:
function roundTo(value:Number, to:Number):Number {
return Math.round(value / to) * to;
}
Example:
roundTo(8, 5); // 10
roundTo(17, 3); // 18
To make a Haskell program executable you must provide a file with a main function of type IO ()
main :: IO ()
main = putStrLn "Hello world!"
When Haskell is compiled it examines the IO data here and turns it into a executable. When we run this program it will print Hello world!.
If y...
List all the existing remotes associated with this repository:
git remote
List all the existing remotes associated with this repository in detail including the fetch and push URLs:
git remote --verbose
or simply
git remote -v
The static method Date.now returns the number of milliseconds that have elapsed since 1 January 1970 00:00:00 UTC. To get the number of milliseconds that have elapsed since that time using an instance of a Date object, use its getTime method.
// get milliseconds using static method now of Date
co...
In a Service Provider register method we can bind an interface to an implementation:
public function register()
{
App::bind( UserRepositoryInterface::class, EloquentUserRepository::class );
}
From now on, everytime the app will need an instance of UserRepositoryInterface, Larave...