Tutorial by Examples: f

Suppose we have the following JSON data: { "TESTS": [ { "YEAR": "2017", "MONTH": "June", "DATE": "28" } ] } import groovy.json...
You can view more information about a remote repository by git remote show <remote repository alias> git remote show origin result: remote origin Fetch URL: https://localserver/develop/myrepo.git Push URL: https://localserver/develop/myrepo.git HEAD branch: master Remote branches: ...
Out of the box Acumatica allows to create and maintain the list of shipping terms in the system. Shipping terms are used to define the shipping, packaging and handling costs, depending on the shipment amount. In this example I will show how to calculate freight amount for a shipment based on sales ...
The following is a full example of using XHTML with JavaScript served by PHP as a single-file. <?php if (isset($_SERVER['HTTP_ACCEPT']) && stristr($_SERVER['HTTP_ACCEPT'],'application/xhtml+xml')) { // Client header isset` and explicitly declares XHTML parser support. header('Conte...
Using XHTML you should avoid methods such as document.write and innerHTML as they treat XML as text and do not properly serialize code; an id attribute in HTML is essentially dumped in to the DOM and the id attribute is not serialized which means when trying to reference to it with something such as...
# Get two numbers from STDIN, separated by a newline, and output the result number1 = gets number2 = gets puts number1.to_i + number2.to_i ## run with: $ ruby a_plus_b.rb ## or: $ echo -e "1\n2" | ruby a_plus_b.rb
number1 = ARGV[0] number2 = ARGV[1] puts number1.to_i + number2.to_i ## run with: $ ruby a_plus_b.rb 1 2
Failing to load a file The first possible error is failing to load the library. In that case an OSError is usually raised. This is either because the file doesn't exists (or can't be found by the OS): >>> cdll.LoadLibrary("foobar.so") Traceback (most recent call last): File &...
In some cases, a C function accepts a function pointer. As avid ctypes users, we would like to use those functions, and even pass python function as arguments. Let's define a function: >>> def max(x, y): return x if x >= y else y Now, that function takes two arguments and r...
By convention elementFormDefault is always set to qualified, but lets look at what it actually does. First with elementFormDefault set to qualified. <?xml version="1.0" encoding="utf-8" ?> <!--Created with Liquid Studio 2017 (https://www.liquid-technologies.com)--&g...
One of the simpler ways of implementing an authorization system is using the flask-login extension. The project's website contains a detailed and well-written quickstart, a shorter version of which is available in this example. General idea The extension exposes a set of functions used for: log...
Consider the following code to copy one file to another: import java.io.*; public class FileCopy { public static void main(String[] args) throws Exception { try (InputStream is = new FileInputStream(args[0]); OutputStream os = new FileOutputStream(args[1])) { ...
Add this text to appsettings.json { "key1": "value1", "key2": 2, "subsectionKey": { "suboption1": "subvalue1" } } Now you can use this configuration in your app, in the way like this public class Program { sta...
Create class like a class below public class MyOptions { public MyOptions() { // Set default value, if you need it. Key1 = "value1_from_ctor"; } public string Key1 { get; set; } public int Key2 { get; set; } } Then you need to add this code ...
This used the flex layout with the sortable to create a grid of responsive boxes that can be moved around by dragging and dropping. HTML <div id="sortable"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div&gt...
#include <string.h> #include <gst/gst.h> #include <gst/app/gstappsrc.h> /* * an example application of using appsrc in push mode to create a file. * from buffers we push into the pipeline. */ /* S16LE 10ms frame audio */ #define BUFFER_SIZE 160 /* 300 frames =...
<?php function wpshout_register_widgets() { register_widget( 'Favorite_Song_Widget'); } add_action( 'widgets_init', 'wpshout_register_widgets' ); class Favorite_Song_Widget extends WP_Widget { function Favorite_Song_Widget() { // Instantiate the parent object parent:...
This example has been taken from here package com.reborne.SmartHibernateConnector.utils; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class LiveHibernateConnector implements IHiber...
/** * An example of nlapiLookupField to retrieve a single field from a related record */ // Get the Sales Rep record ID var repId = nlapiGetFieldValue("salesrep"); // Get the name of the Sales Rep var repName = nlapiGetFieldText("salesrep"); // Retrieve the email...
/** * An example of nlapiLookupField to retrieve multiple fields from a related record */ // Get the Sales Rep record ID var repId = nlapiGetFieldValue("salesrep"); // Retrieve multiple fields from the associated Sales Rep var repData = nlapiLookupField("employee", ...

Page 388 of 457