Tutorial by Examples: o

function test($x) { return $x; } $server = new SoapServer(null, array('uri' => "http://test-uri/")); $server->addFunction("test"); $server->handle();
The summation 1/1 + 1/2 + 1/3 + 1/4 + ... + 1/n is equal to the nth harmonic number, denoted Hn. The nth harmonic number obeys the inequalities ln (n + 1) ≤ Hn ≤ (ln n) + 1 and therefore Hn = Θ(log n). The harmonic numbers often arise in the analysis of algorithms, with randomized quicks...
The summation 1/1 + 1/4 + 1/9 + 1/16 + ... out to infinity converges to π2 / 6, and therefore any summation of the form 1/1 + 1/4 + 1/9 + 1/16 + ... + 1/n2 is Θ(1).
ABCD1penred5002penblue-503penred04pencilblue175pencilgreen-1.5 To sort by column D with "order by": =QUERY("A1:D6","select * order by D desc",1)
Create an empty directory somewhere ... mkdir HelloWorld cd HelloWorld Then use the built in scaffolding technology to create a Hello World sample dotnet new console -o This command creates two files: HelloWorld.csproj describes the project dependencies, settings, and Target Framework ...
You can add hours, minutes, seconds and nanoseconds: LocalTime time = LocalTime.now(); LocalTime addHours = time.plusHours(5); // Add 5 hours LocaLTime addMinutes = time.plusMinutes(15) // Add 15 minutes LocalTime addSeconds = time.plusSeconds(30) // Add 30 seconds LocalTime addNanoseconds = ti...
This basic example shows how an application can instantiate a classloader and use it to dynamically load a class. URL[] urls = new URL[] {new URL("file:/home/me/extras.jar")}; Classloader loader = new URLClassLoader(urls); Class<?> myObjectClass = loader.findClass("com.exampl...
You can use other operators besides $set when updating a document. The $push operator allows you to push a value into an array, in this case we will add a new nickname to the nicknames array. db.people.update({name: 'Tom'}, {$push: {nicknames: 'Tommy'}}) // This adds the string 'Tommy' into the n...
If two pointers are compared using <, >, <=, or >=, the result is unspecified in the following cases: The pointers point into different arrays. (A non-array object is considered an array of size 1.) int x; int y; const bool b1 = &x < &y; // unspecified int ...
If the underlying type is not explicitly specified for an unscoped enumeration type, it is determined in an implementation-defined manner. enum E { RED, GREEN, BLUE, }; using T = std::underlying_type<E>::type; // implementation-defined However, the standard does require th...
A reference is not an object, and unlike an object, it is not guaranteed to occupy some contiguous bytes of memory. The standard leaves it unspecified whether a reference requires any storage at all. A number of features of the language conspire to make it impossible to portably examine any storage ...
This example combines multiple variants of MonoBehaviour singletons found on the internet into one and let you change its behavior depending on global static fields. This example was tested using Unity 5. To use this singleton, all you need to do is extend it as follows: public class MySingleton ...
If a function has multiple arguments, it is unspecified what order they are evaluated in. The following code could print x = 1, y = 2 or x = 2, y = 1 but it is unspecified which. int f(int x, int y) { printf("x = %d, y = %d\n", x, y); } int get_val() { static int x = 0; r...
C++11 All standard library containers are left in a valid but unspecified state after being moved from. For example, in the following code, v2 will contain {1, 2, 3, 4} after the move, but v1 is not guaranteed to be empty. int main() { std::vector<int> v1{1, 2, 3, 4}; std::vector&l...
These attributes are used when the layout is rendered in Android Studio, but have no impact on the runtime. In general you can use any Android framework attribute, just using the tools: namespace rather than the android: namespace for layout preview. You can add both the android: namespace attribu...
To use additional packages within the Rcpp ecosystem, the correct header file may not be Rcpp.h but Rcpp<PACKAGE>.h (as e.g. for RcppArmadillo). It typically needs to be imported and then the dependency is stated within // [[Rcpp::depends(Rcpp<PACKAGE>)]] Examples: // Use the RcppAr...
Most printable characters can be included in string or regular expression literals just as they are, e.g. var str = "ポケモン"; // a valid string var regExp = /[Α-Ωα-ω]/; // matches any Greek letter without diacritics In order to add arbitrary characters to a string or regular expression,...
This is a basic project that uses FXML, created with NetBeans (New Project -> JavaFX -> JavaFX FXML Application). It contains just three files: Main Application class package org.stackoverflow; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Par...
You can make code run asynchronously from the main thread using runTaskAsynchronously. This is useful for doing intensive math or database operations, as they will prevent the main thread from freezing (and the server from lagging). Few Bukkit API methods are thread-safe, so many will cause undefin...

Page 578 of 1038