Tutorial by Examples: n

# This uses the 'sample.xml' given in the XML::Twig example. # Module requirements (1.70 and above for use of load_xml) use XML::LibXML '1.70'; # let's be a good perl dev use strict; use warnings 'all'; # Create the LibXML Document Object my $xml = XML::LibXML->new(); # Where ...
Standalone Common Lisp binaries can be built with buildapp. Before we can use it to generate binaries, we need to install and build it. The easiest way I know how is using quicklisp and a Common Lisp (this example uses [sbcl], but it shouldn't make a difference which one you've got). $ sbcl Thi...
One example per topic may be pinned by clicking the pin icon in the bottom left corner of the example. So long as a topic is pinned, it will stay at the top of a topic's example collection.
HTML Form Use a file type input and the browser will provide a field that lets the user select a file to upload. Only forms with the post method can send file data. Make sure to set the form's enctype=multipart/form-data attribute. Otherwise the file's name will be sent but not the file's data...
Uploaded files are available in request.files, a MultiDict mapping field names to file objects. Use getlist — instead of [] or get — if multiple files were uploaded with the same field name. request.files['profile'] # single file (even if multiple were sent) request.files.getlist('charts') # li...
WTForms provides a FileField to render a file type input. It doesn't do anything special with the uploaded data. However, since Flask splits the form data (request.form) and the file data (request.files), you need to make sure to pass the correct data when creating the form. You can use a Combine...
An enumerations value in no way needs to be unique: #include <stdlib.h> /* for EXIT_SUCCESS */ #include <stdio.h> /* for printf() */ enum Dupes { Base, /* Takes 0 */ One, /* Takes Base + 1 */ Two, /* Takes One + 1 */ Negative = -1, AnotherZero /* Takes Negativ...
SQL Server 2008 R2 SET TRANSACTION ISOLATION LEVEL SNAPSHOT Specifies that data read by any statement in a transaction will be the transactionally consistent version of the data that existed at the start of the transaction, i.e., it will only read data that has been committed prior to the transa...
We can create it by two way. First from database properties designer mode: And by sql scripts: USE master; GO -- Create the database with the default data -- filegroup and a log file. Specify the -- growth increment and the max size for the -- primary data file. CREATE DATABASE TestDB ON...
CROSS APPLY enables you to "join" rows from a table with dynamically generated rows returned by some table-value function. Imagine that you have a Company table with a column that contains an array of products (ProductList column), and a function that parse these values and returns a set ...
CROSS APPLY enables you to "join" rows from a table with collection of JSON objects stored in a column. Imagine that you have a Company table with a column that contains an array of products (ProductList column) formatted as JSON array. OPENJSON table value function can parse these values...
This section describes some basic DDL (="Data Definition Language") commands to create a database, a table within a database, a view and finally a stored procedure. Create Database The following SQL command creates a new database Northwind on the current server, using pathC:\Program Fi...
Bashdb is a utility that is similar to gdb, in that you can do things like set breakpoints at a line or at a function, print content of variables, you can restart script execution and more. You can normally install it via your package manager, for example on Fedora: sudo dnf install bashdb Or ...
Detailed instructions on getting azure-active-directory set up or installed.
It is well known that you cannot use the same file for input and ouput in the same command. For instance, $ cat header.txt body.txt >body.txt doesn’t do what you want. By the time cat reads body.txt, it has already been truncated by the redirection and it is empty. The final result will be th...
In Julia, when looping through an iterable object I is done with the for syntax: for i = I # or "for i in I" # body end Behind the scenes, this is translated to: state = start(I) while !done(I, state) (i, state) = next(I, state) # body end Therefore, if you wan...
On Julia, you can define more than one method for each function. Suppose we define three methods of the same function: foo(x) = 1 foo(x::Number) = 2 foo(x::Int) = 3 When deciding what method to use (called dispatch), Julia chooses the more specific method that matches the types of the argument...
JSON is a popular data interchange format. The most popular JSON library for Julia is JSON.jl. To install this package, use the package manager: julia> Pkg.add("JSON") The next step is to test whether the package is working on your machine: julia> Pkg.test("JSON") I...
JSON that has been encoded as a string can easily be parsed into a standard Julia type: julia> using JSON julia> JSON.parse("""{ "this": ["is", "json"], "numbers": [85, 16, 12.0], "and": [t...
The JSON.json function serializes a Julia object into a Julia String containing JSON: julia> using JSON julia> JSON.json(Dict(:a => :b, :c => [1, 2, 3.0], :d => nothing)) "{\"c\":[1.0,2.0,3.0],\"a\":\"b\",\"d\":null}" julia>...

Page 619 of 1088