Tutorial by Examples: sin

The most common way to add (and edit classes) in from the system browser In the Nautilus system browser have nothing selected or select a package (first column) or a class (second column). Depending on the selection, the code editor will display a slightly different class template: SelectionTemplat...
This code takes advantage of the Sort class in the Microsoft Excel Object Library. For further reading, see: Copy a range to a virtual range How to copy selected range into given array? Sub testExcelSort() Dim arr As Variant InitArray arr ExcelSort arr End Sub Private Su...
var s = "Hello"; // The string referenced by variable 's' is normally immutable, but // since it is memory, we could change it if we can access it in an // unsafe way. unsafe // allows writing to memory; methods on Syste...
String bucketName = "bucket"; List<String> nodes = Arrays.asList("node1","node2"); // IP or hostname of one or more nodes in the cluster Cluster cluster = CouchbaseCluster.create(nodes); Bucket bucket = cluster.openBucket(bucketName); //check for a documen...
Queue follow FIFO as it is mentioned in the introduction. Five major operations: Enqueue(x): pushes x to the back of the queue. Dequeue(): pops an element from the front of the queue. isEmpty(): Finds whether the queue is empty or not. isFull(): Finds whether the queue is full or not. frontV...
with Ada.Text_IO; procedure Image_And_Value is type Fruit is (Banana, Orange, Pear); X : Fruit := Orange; begin Ada.Text_IO.Put_Line (Boolean'Image (Fruit'Value (Fruit'Image (X)) = X and Fruit'Image (Fruit'Value ("ORANGE")) = "ORANGE"));...
Setup ActiveMQ Download a ActiveMQ distribution from activemq.apache.org and unpack it somewhere You can start the server immediately, running unsecured on localhost, using the script bin/activemq When it is running, you can access your local server's console on http://localhost:8161/admin/ Co...
// Create a new read-only List<String> val list = listOf("Item 1", "Item 2", "Item 3") println(list) // prints "[Item 1, Item 2, Item 3]"
// Create a new read-only Map<Integer, String> val map = mapOf(Pair(1, "Item 1"), Pair(2, "Item 2"), Pair(3, "Item 3")) println(map) // prints "{1=Item 1, 2=Item 2, 3=Item 3}"
// Create a new read-only Set<String> val set = setOf(1, 3, 5) println(set) // prints "[1, 3, 5]"
You can pass parameters by Bundle: Bundle myBundle = new Bundle(); myBundle.putString(MY_KEY, myValue); Get the value in onCreateLoader: @Override public Loader<String> onCreateLoader(int id, final Bundle args) { final String myParam = args.getString(MY_KEY); ... }
Usually, an HTML form element submitted to PHP results in a single value. For example: <pre> <?php print_r($_POST);?> </pre> <form method="post"> <input type="hidden" name="foo" value="bar"/> <button type="su...
One of the ways to think about the commands that should be executed, to edit a text in a certain manner, is as entire sentences. A command is an action performed on an object. Therefore it has a verb: :normal i " insert :normal a " append :normal c " overwrite :normal y ...
//MySingletonClass.h @interface MYSingletonClass : NSObject + (instancetype)sharedInstance; -(instancetype)init NS_UNAVAILABLE; -(instancetype)new NS_UNAVAILABLE; @end //MySingletonClass.m @implementation MySingletonClass + (instancetype)sharedInstance { static MySingleto...
This method allows non-implementation-specific code to be written and deployed across multiple jms platforms. Below basic example connects to activemq jms server and sends a message. import java.util.Properties; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.QueueConne...
# Print the working directory import os print os.getcwd() # C:\Python27\Scripts # Set the working directory os.chdir('C:/Users/general1/Documents/simple Python files') print os.getcwd() # C:\Users\general1\Documents\simple Python files # load pandas import pandas as pd # read a csv d...
DEFINE QUERY q1 FOR Customer. OPEN QUERY q1 FOR EACH Customer. GET FIRST q1. loop: REPEAT: IF AVAILABLE Customer THEN DO: DISPLAY Customer.NAME CustNum WITH FRAME frClient TITLE "Client data". DISPLAY "(P)revious" SKIP ...
A function can have multiple return statements and they can be placed in different parts of the actual function. They all need to return the same data type though. FUNCTION returning DATE ( dat AS DATE): IF dat < TODAY THEN DO: DISPLAY "<". RETURN dat - 200. ...
function getCombinations(params, combinationsResults){ if(params.length == 0) return combinationsResults; var head = params[0]; var tail = params.slice(1); var combinationsResultsCurrent = []; if(Array.isArray(head)){ _.uniq(head).forEach(function(item){ ...
Here is a simple example of how to use Bokeh in Jupyter Notebook: import numpy as np from bokeh.plotting import figure # Make Bokeh Push push output to Jupyter Notebook. from bokeh.io import push_notebook, show, output_notebook from bokeh.resources import INLINE output_notebook(resources=INLIN...

Page 135 of 161