Tutorial by Examples: l

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...
Code, to be saved in „helloworld.nsi“: Name "Hello World" OutFile "helloworld.exe" Section "Hello World" MessageBox MB_OK "Hello World!" SectionEnd Compile it with: <Path to NSIS>\makensis.exe <Path to script>\helloworld.nsi
The builder pattern is an object creation software design pattern. Unlike the abstract factory pattern and the factory method pattern whose intention is to enable polymorphism, the intention of the builder pattern is to find a solution to the telescoping constructor anti-pattern. The telescopi...
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])) { ...
The COMPILER system handle let's you look at information regarding a recent compile. Assuming ok-program.p is a program without any errors or warning: COMPILE ok-program.p SAVE NO-ERROR. DEFINE VARIABLE iError AS INTEGER NO-UNDO. MESSAGE "Errors: " COMPILER:ERROR SKIP ...
//hello.ts export function hello(name: string){ console.log(`Hello ${name}!`); } function helloES(name: string){ console.log(`Hola ${name}!`); } export {helloES}; export default hello; Load using directory index If directory contains file named index.ts it can be loaded using on...
Any declaration (variable, const, function, class, etc.) can be exported from module to be imported in other module. Typescript offer two export types: named and default. Named export // adams.ts export function hello(name: string){ console.log(`Hello ${name}!`); } export const answerToLi...
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...
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...
The underlying example is just the one given in the official pyspark documentation. Please click here to reach this example. # the first step involves reading the source text file from HDFS text_file = sc.textFile("hdfs://...") # this step involves the actual computation for reading...
public class Program { public static void Main(string[] args) { Console.WriteLine("\nWhat is your name? "); var name = Console.ReadLine(); var date = DateTime.Now; Console.WriteLine("\nHello, {0}, on {1:d} at {1:t}", name, date); ...
Based on a question. The following snippets Does not cache the expected emission and prevents further calls. Instead it re-subscribes to the realSource for every subscription. var state = 5 var realSource = Rx.Observable.create(observer => { console.log("creating expensive HTTP-based emis...
#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 =...
Executable C++ program code is usually produced by a compiler. A compiler is a program that translates code from a programming language into another form which is (more) directly executable for a computer. Using a compiler to translate code is called compilation. C++ inherits the form of its compi...
Selection of a Version Control System Of course many organisations or projects already have a preferred or selected version control system if this is the case for you just skip to client installation. There are a number of things to consider when selecting the version control system to use, given ...
/** * NetSuite will loop through each record in your search * and pass the record type and id for deletion * Try / Catch is useful if you wish to handle potential errors */ function MassDelete(record_type, record_id) { try { nlapiDeleteRecord(record_type, record_id...
1. Scrolling to target element ("BROWSE TEMPLATES" button at the bottom of page) with Actions from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains driver = webdriver.Chrome() driver.get('http://www.w3schools.com/') target = driver.find_elem...
RTE { classes { btn-lg { name = Button (large) requires = btn btn-default } btn-default { name = Button (default) requires = btn } } default { buttons.link.properties.class.allowedClas...
A version control system allows a developer or development team access to essentially I time machine. If the source code, settings, etc., that were used to build a program or system are under version control then the developers can step back in time to recover lost functionality, trace how errors we...
You would need to install ruby before you can install rails. Mac already comes with ruby installed based on how recent your macOS is? Depending on what ruby version you want for your development, the best way to install Ruby is to use RVM. In your terminal, type the command below listed in step...

Page 728 of 861