Tutorial by Examples: o

The hash codes produced by GetHashCode() method for built-in and common C# types from the System namespace are shown below. Boolean 1 if value is true, 0 otherwise. Byte, UInt16, Int32, UInt32, Single Value (if necessary casted to Int32). SByte ((int)m_value ^ (int)m_value << 8); Char...
The java command supports a wide range of options: All options start with a single hyphen or minus-sign (-): the GNU/Linux convention of using -- for "long" options is not supported. Options must appear before the <classname> or the -jar <jarfile> argument to be recog...
Fluent methods in Kotlin can be the same as Java: fun doSomething() { someOtherAction() return this } But you can also make them more functional by creating an extension function such as: fun <T: Any> T.fluently(func: ()->Unit): T { func() return this } Which the...
Enable the module by typing: sudo a2enmod ssl Restart the web server (apache2) so the change is recognized: sudo service apache2 restart Optional (but a good idea): Create a directory that will contain our new certificate files: sudo mkdir /etc/apache2/ssl Create the key and self-signed ...
Pointers can be dereferenced by adding an asterisk * before a pointer. package main import ( "fmt" ) type Person struct { Name string } func main() { c := new(Person) // returns pointer c.Name = "Catherine" fmt.Println(c.Name) // prints: Cathe...
A question that occasionally on StackOverflow is whether it is appropriate to use assert to validate arguments supplied to a method, or even inputs provided by the user. The simple answer is that it is not appropriate. Better alternatives include: Throwing an IllegalArgumentException using cust...
You can have a config.yml file that loads directly from your jar file. It must be added to your project's folder, the same way as the plugin.yml file is. In this file you have the default values for your configuration. Example config: # This is an YML comment adminName: "Kerooker" mod...
What can happen in your config file is having a path to a variable that goes through multiple sections. Example Config admins: first-tier: "Kerooker" second-tier: "Mordekaiser" third-tier: "Yesh4" The name "Kerooker" is from section "first-tier...
The WMI type provider allows you to query WMI services with strong typing. To output the results of a WMI query as JSON, open FSharp.Management open Newtonsoft.Json // `Local` is based off of the WMI available at localhost. type Local = WmiProvider<"localhost"> let data = ...
Some of the simplest kinds of classes are POCOs. // C# public class Person { public string FirstName { get; set; } public string LastName { get; set; } public DateTime Birthday { get; set; } } In F# 3.0, auto-properties similar to C# auto-properties were introduced, // F# typ...
A Receiver Operating Characteristic (ROC) curve plots the TP-rate vs. the FP-rate as a threshold on the confidence of an instance being positive is varied Algorithm for creating an ROC curve sort test-set predictions according to confidence that each instance is positive step through ...
If you need to check if your testing method takes too long to execute, you can do that by mentioning your expected execution time using timeout property of @Test annotation. If the test execution takes longer than that number of milliseconds it causes a test method to fail. public class StringConca...
Function contracts allow the programer to check for inconsistencies. Inconsistencies include invalid parameters, checks for the correct return value or an invalid state of the object. The checks can happen before and after the body of the function or method is executed. void printNotGreaterThan42(...
For example if an method is invoked the state of the object may not allow that a method is called with specific parameters or not at all. class OlderThanEighteen { uint age; final void driveCar() in { assert(age >= 18); // variable must be in range } body { ...
Before running this sample, you must: Download and install the Java SE Development Kit (JDK): Download JDK Download Apache Maven version 3.3.9 or greater: Install and configure Maven for your local development environment.
We've created a simple Hello World app for Java so you can quickly get a feel for deploying an app to Google Cloud Platform. Follow these steps to download Hello World to your local machine. Clone the Hello World sample app repository to your local machine: git clone https://github.com/GoogleCloud...
Test the application using the development web server, which is included with the App Engine SDK. Run the following Maven command from within your helloworld directory, to compile your app and start the development web server: mvn appengine:devserver The web server is now listening for re...
To deploy your app to App Engine, you will need to register a project to create your project ID, which will determine the URL for the app. In the Cloud Platform Console, go to the Projects page and select or create a new project. Note the project ID you created above, and enter it in src/m...
Detailed instructions on getting sybase set up or installed.
Slices are pointers to arrays, with the length of the segment, and its capacity. They behave as pointers, and assigning their value to another slice, will assign the memory address. To copy a slice value to another, use the built-in copy function: func copy(dst, src []Type) int (returns the amount o...

Page 712 of 1038