Tutorial by Examples: sin

type Grade is range 0 .. 15; B : Grade := 11; C : Grade := 8; Avg : Grade := (B + C) / 2; -- Avg = 9
If you're accepting user input for folder paths, you might need to check for trailing backslashes (\) before building a file path. The FSO.BuildPath method makes this simpler: Const sourceFilePath As String = "C:\Temp" '<-- Without trailing backslash Const targetFilePath As Strin...
In this example you will explore how to export the following data from Acumatica ERP in a single call via the REST Contract-Based API: all stock items existing in the application all sales order of the IN type If you need to export records from Acumatica ERP, use the following URL: http://&l...
This example implements a linked list with many of the same methods as that of the built-in list object. class Node: def __init__(self, val): self.data = val self.next = None def getData(self): return self.data def getNext(self): return self.ne...
Once using is used to introduce the name cout from the namespace std into the scope of the main function, the std::cout object can be referred to as cout alone. #include <iostream> int main() { using std::cout; cout << "Hello, world!\n"; }
import time def timer(func): def inner(*args, **kwargs): t1 = time.time() f = func(*args, **kwargs) t2 = time.time() print 'Runtime took {0} seconds'.format(t2-t1) return f return inner @timer def example_function(): #do stuff exa...
// gets the Class objects from the net.mminecraft.server package with the given name public Class<?> getNmsClass(String name) throws ClassNotFoundException { // explode the Server interface implementation's package name into its components String[] packageArray = Bukkit.getServer()....
If you bind a buffer to GL_PIXEL_UNPACK_BUFFER then the data parameter in glTexImage2D is a offset into that buffer. This means that the glTexImage2D doesn't need to wait for all the data to be copied out of the application's memory before it can return, reducing overhead in the main thread. glGen...
Using Oracle SQL’s NVL2() function, you can create a display column which contains one value if a field contains data and another value if a field does not contain data. For example, in an Entity search, turn the presence of a primary e-mail address into a text display column: NVL2( {email} , 'YES...
C++11 The syntax of using is very simple: the name to be defined goes on the left hand side, and the definition goes on the right hand side. No need to scan to see where the name is. using I = int; using A = int[100]; // array of 100 ints using FP = void(*)(int); // pointer to...
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="${http.port}" doc:name="HTTP Listener Configuration"/> <db:mysql-config name="MySQL_Configuration" host="${db.host}" port="${db.port}"...
Go to the DOWNLOAD ANACONDA NOW page. Beneath the “Graphical Installer” buttons for Anaconda for macOS, there are command-line text links for Python versions 2.7 and 3.6. Download the command line installer for Anaconda with Python 2.7 or Anaconda with Python 3.6. Optional: Verify data integrity w...
Link function is best way in custom directives to manipulate DOM. It takes three attributes as input (scope, element, attribute) in sequence scope: its local scope object of directive. element: html element on which directive is used. attribute: it gives access to all attributes used in element ...
Because Boxes implement the Deref<Target=T>, you can use boxed values just like the value they contain. let boxed_vec = Box::new(vec![1, 2, 3]); println!("{}", boxed_vec.get(0)); If you want to pattern match on a boxed value, you may have to dereference the box manually. struct...
If you try and create a recursive enum in Rust without using Box, you will get a compile time error saying that the enum can't be sized. // This gives an error! enum List { Nil, Cons(i32, List) } In order for the enum to have a defined size, the recursively contained value must be in...
json_util provides two helper methods, dumps and loads, that wrap the native json methods and provide explicit BSON conversion to and from json. Simple usage from bson.json_util import loads, dumps record = db.movies.find_one() json_str = dumps(record) record2 = loads(json_str) if record is:...
python-bsonjs does not depend on PyMongo and can offer a nice performance improvement over json_util: bsonjs is roughly 10-15x faster than PyMongo’s json_util at decoding BSON to JSON and encoding JSON to BSON. Note that: to use bsonjs effectively, it is recommended to work directly with Ra...
If all you need is serializing mongo results into json, it is possible to use the json module, provided you define custom handlers to deal with non-serializable fields types. One advantage is that you have full power on how you encode specific fields, like the datetime representation. Here is a ha...
new Vue({ el:"#app", data:{ foo: "bar" }, methods:{ doSomethingAsynchronous(){ setTimeout(function(){ // This is wrong! Inside this function, // "this" refers to the window object. this.foo = "baz"; ...
new Vue({ el:"#star-wars-people", data:{ people: null }, mounted: function(){ $.getJSON("http://swapi.co/api/people/", function(data){ // Again, this is wrong! "this", here, refers to the window. this.people = data.results; }) ...

Page 142 of 161