Tutorial by Examples

Add ts-node to your TypeScript project: npm i ts-node Add a script to your package.json: "start:debug": "ts-node --inspect=5858 --debug-brk --ignore false index.ts" The launch.json needs to be configured to use the node2 type and start npm running the start:debug script: ...
Add this script to your package.json: "start:idea": "ts-node %NODE_DEBUG_OPTION% --ignore false index.ts", Right click on the script and select Create 'test:idea'... and confirm with 'OK' to create the debug configuration: Start the debugger using this configuration:
Scala supports lazy evaluation for function arguments using notation: def func(arg: => String). Such function argument might take regular String object or a higher order function with String return type. In second case, function argument would be evaluated on value access. Please see the example...
create Dynamic web project in sts/eclipse download the eclipse paho jar from click here to download and paste jar file in webcontent->webinf->folder->lib Publish Example String broker = "tcp://localhost:1883"; String topicName = "test/topic"; int qos = 1; Mqt...
Even though colorblind people can recognize a wide range of colors, it might be hard to differentiate between certain colors. RColorBrewer provides colorblind-friendly palettes: library(RColorBrewer) display.brewer.all(colorblindFriendly = T) The Color Universal Design from the University ...
These instructions are for a base install of Community Edition for local development purposes. Mac (Official documentation is maintained here) 1. Install Dependencies: Homebrew brew install arangodb If you don't want Homebrew or otherwise prefer a binary, you can download it instead here. 2...
Following points are to be kept in mind always: Take the PRD (Product Requirement Document from Business Analyst/Project Manager). If they don't have it, insist on a documentation since that will be the bible for your testing Once you get it, make sure to read it thoroughly. You will get comple...
Behat/Mink Install using composer (for other methods check ) behat.org If you using linux, please go sure that you have installed php-curl (normal curl installation won't work) Linux sudo apt-get install php5-curl If you are using Windows, make sure you have PHP, Curl and Git installed. You...
This example will cover creating a custom error page for 404 Page Not Found and 500 Server Error. You can extend this code to capture any error code you need to. Web.Config If you are using IIS7 and above, ignore the <CustomError.. node and use <httpErrors... instead. Add in the following i...
Suppose you have a file that looks like this John Smith 31 Robert Jones 27 ... This file has 3 columns separated by spaces. To select only the first column, do the following. cut -d ' ' -f1 filename Here the -d flag, specifies the delimiter, or what separates the records. The -f flag speci...
Sometimes, it's useful to display a range of columns in a file. Suppose you have this file Apple California 2017 1.00 47 Mango Oregon 2015 2.30 33 To select the first 3 columns do cut -d ' ' -f1-3 filename This will display the following output Apple California 2017 Mango Oregon 2015 ...
To make your script pause simply use the PAUSE command. PAUSE This will display the text Press any key to continue . . ., then add a newline on user input. Let's say we want to create a "Hello World" program and after we click something on our keyboard, we want it to exit the program ...
Internally, Django uses the Python logging system. There is many way to configure the logging of a project. Here is a base: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'default': { 'format': "[%(asctime)s] %(levelname)s [%(n...
struct UnsafeMutablePointer<Pointee> A pointer for accessing and manipulating data of a specific type. You use instances of the UnsafeMutablePointer type to access data of a specific type in memory. The type of data that a pointer can access is the pointer's Pointee type. UnsafeMutable...
In this example, we create an empty index (we index no documents in it) by defining its mapping. First, we create an ElasticSearch instance and we then define the mapping of our choice. Next, we check if the index exists and if not, we create it by specifying the index and body parameters that cont...
extension UIView { func shake() { let animation = CAKeyframeAnimation(keyPath: "transform.translation.x") animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) animation.duration = 0.6 animation.values = [-10.0, 10.0, ...
Deconstructing the use of an unsafe pointer in the Swift library method; public init?(validatingUTF8 cString: UnsafePointer<CChar>) Purpose: Creates a new string by copying and validating the null-terminated UTF-8 data referenced by the given pointer. This initializer does not try to rep...
extension Dictionary { func merge(dict: Dictionary<Key,Value>) -> Dictionary<Key,Value> { var mutableCopy = self for (key, value) in dict { // If both dictionaries have a value for same key, the value of the other dictionary is used. mu...
public static void applyFontToMenu(Menu m, Context mContext){ for(int i=0;i<m.size();i++) { applyFontToMenuItem(m.getItem(i),mContext); } } public static void applyFontToMenuItem(MenuItem mi, Context mContext) { if(mi.hasSubMenu()) for(int i=0;i<mi.getSubMenu...
See Ellie for a working example. This example uses the NoRedInk/elm-decode-pipeline module. Given a list of JSON objects, which themselves contain lists of JSON objects: [ { "id": 0, "name": "Item 1", "transactions": [ { "id&quo...

Page 1148 of 1336