ChoiceDialog allows the user to pick one item from a list of options.
List<String> options = new ArrayList<>();
options.add("42");
options.add("9");
options.add("467829");
options.add("Other");
ChoiceDialog<String> dialog = new Choice...
PDO is a universal database connection command in PHP, it support 12 different database type e.g MySQL, MongoDB, NoSQL. A big bonus about PDO is that it calculate your code to support the database type, so you don't need to make any chance when moving over to another database system.
Summary
PDO...
When a function doesn't preserve units automatically due to lower-level operations, the LanguagePrimitives module can be used to set units on the primitives that support them:
/// This cast preserves units, while changing the underlying type
let inline castDoubleToSingle (x : float<'u>) : fl...
The [<Measure>] attribute can be used on type parameters to declare types that are generic with respect to units of measure:
type CylinderSize<[<Measure>] 'u> =
{ Radius : float<'u>
Height : float<'u> }
Test usage:
open Microsoft.FSharp.Data.UnitSystems...
For example, types for SI units have been standardized in the F# core library, in Microsoft.FSharp.Data.UnitSystems.SI. Open the appropriate sub-namespace, UnitNames or UnitSymbols, to use them. Or, if only a few SI units are required, they can be imported with type aliases:
/// Seconds, the SI uni...
class User {
String name
int age
}
def users = [
new User(name: "Bob", age: 20),
new User(name: "Tom", age: 50),
new User(name: "Bill", age: 45)
]
// sort by age
users.sort { a, b -> a.age <=> b.age }
If you don't have permissions to install perl modules, you may still install them manually, indicating a custom path where you've got writing permissions.
Fist, download and unzip module archive:
wget module.tar.gz
tar -xzf module.tar.gz
cd module
Then, if the module distribution contains a M...
All values in Rust have exactly one owner. The owner is responsible for dropping that value when it goes out of scope, and is the only one who may move the ownership of the value. The owner of a value may give away references to it by letting other pieces of code borrow that value. At any given time...
All values in Rust have a lifetime. A value's lifetime spans the segment of code from the value is introduced to where it is moved, or the end of the containing scope
{
let x = String::from("hello"); // +
// ... :
let y = S...
Most of the questions around ownership come up when writing functions. When you specify the types of a function's arguments, you may choose how that value is passed in. If you only need read-only access, you can take an immutable reference:
fn foo(x: &String) {
// foo is only authorized to...
Some Rust types implement the Copy trait. Types that are Copy can be moved without owning the value in question. This is because the contents of the value can simply be copied byte-for-byte in memory to produce a new, identical value. Most primitives in Rust (bool, usize, f64, etc.) are Copy.
let x...
After Successfully installing Xamarin Studio on OS X.
It's time for the first Hello World Application.
Hello World Application: Xamarin.Forms
What is Xamarin Forms :
Xamarin.Forms is a new library that enables you to build native UIs for iOS, Android and Windows Phone from a single, shared C# c...
def honestlyNoParam = { ->
"I Don't have it"
}
// The following all throw IllegalArgumentException
honestlyNoParam.curry('whatever')
honestlyNoParam.rcurry('whatever')
honestlyNoParam.ncurry(0, 'whatever')
The volatile modifier is used in multi threaded programming. If you declare a field as volatile it is a signal to threads that they must read the most recent value, not a locally cached one. Furthermore, volatile reads and writes are guaranteed to be atomic (access to a non-volatile long or double i...
This example shows how to establish a connection to an SSL-enabled POP3 email server and send a simple (text only) email.
// Configure mail provider
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.mymailprovider.com");
props.put("ma...
Because generating documentation is based on markdown, you have to do 2 things :
1/ Write your doctest and make your doctest examples clear to improve readability (It is better to give a headline, like "examples" or "tests"). When you write your tests, do not forget to give 4 s...