Tutorial by Examples: st

When we created our project, Activator told us how we can run our application To run "HelloWorld" from the command line, "cd HelloWorld" then: /home/YourUserName/HelloWorld/activator run There is a small pitfall here: activator executable is not in our project root, but ...
Calling the function string InvoiceHtml = myFunction.RenderPartialViewToString("PartialInvoiceCustomer", ToInvoice); // ToInvoice is a model, you can pass parameters if needed Function to generate HTML public static string RenderPartialViewToString(string viewName, object model) { ...
From the Control Flow tab in your SSIS package, look in the SSIS Toolbox in the common section for the File System Task, drag this onto your design surface where you want the file move to happen in your package. Once you've placed the task, double click to open it. From here you'll want to fir...
Assume having a method returning IEnumerable<T>, f.e. private IEnumerable<T> GetData() { try { // return results from database } catch(Exception exception) { throw; } } Creates an Observable and starts a method asynchronously. Sel...
/* The result can be use for fast way to use columns on Insertion/Updates. Works with tables and views. Example: eTableColumns 'Customers' ColumnNames ------------------------------------------------------ Id, FName, LName, Email, PhoneNumber, PreferredContact INSERT INTO Customers (Id, ...
R-markdown code chunks R-markdown is a markdown file with embedded blocks of R code called chunks. There are two types of R code chunks: inline and block. Inline chunks are added using the following syntax: `r 2*2` They are evaluated and inserted their output answer in place. Block chunks hav...
Preemptive basic authentication is the practice of sending http basic authentication credentials (username and password) before a server replies with a 401 response asking for them. This can save a request round trip when consuming REST apis which are known to require basic authentication. As descr...
To get Nightwatch working, you'll need a local copy of selenium which is a command-and-control server which manages automated browser instances. You'll also need a web browser which selenium can control, such as chromedriver or phantomjs. Add the following devDependencies to your package.json: { ...
A basic Nightwatch installation for Meteor will have the following directories and files installed. /myapp /myapp/.meteor/nightwatch.json /client/main.html /client/main.js /client/main.css /tests /tests/nightwatch /tests/nightwatch/assertions /tests/nightwatch/commands /tests/nightwatch/da...
Nightwatch accepts a second globals.json configuration file which injects data into the test runner itself, very similar to how Meteor.settings makes data from the command line available throughout the app. globals.json { "default" : { "url" : "http://localhost:300...
Readable streams can be "piped," or connected, to writable streams. This makes data flow from the source stream to the destination stream without much effort. var fs = require('fs') var readable = fs.createReadStream('file1.txt') var writable = fs.createWriteStream('file2.txt') rea...
Let's say the second RadioButton out of three is pre-selected with setSelected(Boolean), the focus is still at the first RadioButton by default. To change this use the requestFocus() method. radioButton2.setSelected(true); radioButton2.requestFocus();
Sometimes we need a visual hint to indicate the return status of previous command. The following snippet make put it at the head of the PS1. Note that the __stat() function should be called every time a new PS1 is generated, or else it would stick to the return status of last command of your .bashr...
Open Storyboard where you have your ViewController with TableView: Add prototype cell (if there is no cell added before): Customize cell as you want (in my case there is custom UIImage and Label): Remember to set height of the cell. To do it select your whole TableView and from the Properties...
Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any .row. <div class="row"> ...
To nest your content with the default grid, add a new .row and set of .col-sm-* columns within an existing .col-sm-* column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns). <div class="row"> <di...
Regex to match postcodes in UK The format is as follows, where A signifies a letter and 9 a digit: FormatCoverageExampleCellCellAA9A 9AAWC postcode area; EC1–EC4, NW1W, SE1P, SW1EC1A 1BBA9A 9AAE1W, N1C, N1PW1A 0AXA9 9AA, A99 9AAB, E, G, L, M, N, S, WM1 1AE, B33 8THAA9 9AA, AA99 9AAAll other postco...
The following is a simple example Perl test script, that gives some structure to allow for testing of other methods in the class/package under test. The script produces standard output with simple "ok" / "not ok" text, which is called TAP (Test Anything Protocol). Typically the...
#!/usr/bin/env perl use Dancer2; get '/' => sub { "Hello World!" }; dance;
Type below command: instmodsh It'll show you the guild as below: Available commands are: l - List all installed modules m <module> - Select a module q - Quit the program cmd? Then type l to list all the installed modules, you can also use command m &l...

Page 226 of 369