There are several ways interact with an Xml file.
Xml Document
XDocument
XmlReader/XmlWriter
Before LINQ to XML we were used XMLDocument for manipulations in XML
like adding attributes, elements and so on. Now LINQ to XML uses
XDocument for the same kind of thing. Syntaxes are much easie...
Django REST Framework has some authentication methods already built in, one of them is Token based, so first thing to do is to tell our project we’re going to use rest framework’s authentication.
Open settings.py file and add the highlighted line.
INSTALLED_APPS = (
'django.contrib.admin',
...
Components let you split the UI into independent, reusable pieces. This is the beauty of React; we can separate a page into many small reusable components.
Prior to React v14 we could create a stateful React component using React.Component (in ES6), or React.createClass (in ES5), irrespective of wh...
use Time::HiRes qw( time );
my $start = time();
#Code for which execution time is calculated
sleep(1.2);
my $end = time();
printf("Execution Time: %0.02f s\n", $end - $start);
This will print execution time of Code in seconds
If you installed Laravel via Composer or the Laravel installer, below configuration you will need.
Configuration for Apache
Laravel includes a public/.htaccess file that is used to provide URLs without the index.php front controller in the path. Before serving Laravel with Apache, be sure to enabl...
In this example we define a package header and a package body wit a function.
After that we are calling a function from the package that return a return value.
Package header:
CREATE OR REPLACE PACKAGE SkyPkg AS
FUNCTION GetSkyColour(vPlanet IN VARCHAR2)
RETURN VARCHAR2;
...
This examples uses the AES algorithm for encrypting passwords. The salt length can be up to 128 bit.
We are using the SecureRandom class to generate a salt, which is combined with the password to generate a secret key. The classes used are already existing in Android packages javax.crypto and java....
Scala packages should follow the Java package naming conventions.
Package names are written in all lower case to avoid conflict with the names of classes or interfaces.
Companies use their reversed Internet domain name to begin their package names—for example,
io.super.math
// How many Items does a Sales Order have...
// ... if we're in the context of a Sales Order record
var itemCount = nlapiGetLineItemCount("item");
// ... or if we've loaded the Sales Order
var order = nlapiLoadRecord("salesorder", 123);
var itemCount = order.getLineItemC...
// How many lines in a sublist in SuiteScript 2.0...
require(["N/record"], function (r) {
var rec = r.load({
"type": r.Type.SALES_ORDER,
"id": 123
});
// How many lines are on the Items sublist?
var itemCount = rec.getLineCount...
Import needed libraries:
from gcloud import storage
Define needed variables:
Client: Bundles the configuration needed for API requests
client = storage.Client()
Optional params for Client():
project: the project which the client acts on behalf of. Will be passed when creating a topic. If...
To add additional restriction to the poReceiptLinesSelection data view, you should invoke Select method on base view and inspect each item in returned PXResultSet independently to decide if it complies with additional restriction(s):
public class APInvoiceEntryExt : PXGraphExtension<APInvoiceEn...
Accessed through including <stdio.h>, the function printf() is the primary tool used for printing text to the console in C.
printf("Hello world!");
// Hello world!
Normal, unformatted character arrays can be printed by themselves by placing them directly in between the parenthes...
Use Enum.chunk/2 to group elements into sub-lists, and Map.new/2 to convert it into a Map:
[1, 2, 3, 4, 5, 6]
|> Enum.chunk(2)
|> Map.new(fn [k, v] -> {k, v} end)
Would give:
%{1 => 2, 3 => 4, 5 => 6}