Tutorial by Examples: a

// this function add custom interval (5 minutes) to the $schedules function five_minutes_interval( $schedules ) { $schedules['five_minutes'] = array( 'interval' => 60 * 5, 'display' => '5 minutes'; ); return $schedules; } // add a custom in...
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...
Generally, it's not a good idea to use a regular expression to parse a complex structure. But it can be done. For instance, you might want to load data into hive table and fields are separated by comma but complex types like array are separated by a "|". Files contain records with all fiel...
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...
The BukkitRunnable is a Runnable found in Bukkit. It's possible to schedule a task directly from a BukkitRunnable, and also cancel it from inside itself. Important: The time on the tasks is measured in Ticks. A second has 20 ticks. Non-RepeatingTask: JavaPlugin plugin; //Your plugin instance ...
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 ...
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...
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...
Instead of getting a reference to the DOM you can simply change the index of the tab using the selectedIndex attribute on the ion-tabs HTML: <ion-tabs [selectedIndex]="tabIndex" class="tabs-icon-text" primary > <ion-tab tabIcon="list-box" [root]=&qu...
Sometimes it is needful to backtrack after reading. # identify current position in file, in case the first line isn't a comment my $current_pos = tell; while (my $line = readline $fh) { if ($line =~ /$START_OF_COMMENT_LINE/) { push @names, get_name_from_comment($line); ...
Classes implement an interface to meet the interface's contract. For example, a C# class may implement IDisposable, public class Resource : IDisposable { private MustBeDisposed internalResource; public Resource() { internalResource = new MustBeDisposed(); } ...
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 { ...
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...
You can leave the web server running while you develop your application. When you make a change, use the mvn clean package command to build and update your app. Try it now: Leave the web server running, then edit HelloServlet.java to change Hello, world to something else. Run mvn clean package,...
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 756 of 1099