Tutorial by Examples: ti

When an exception is thrown from within a Future, you can (should) use recover to handle it. For instance, def runFuture: Future = Future { throw new FairlyStupidException } val itWillBeAwesome: Future = runFuture ...will throw an Exception from within the Future. But seeing as we can predic...
Using @import allows you to split up your files into multiple smaller files. This makes sense, as you are able to keep better structure for your stylesheets and avoid very large files. Example Let's say you have a few files. - application.scss - header.scss - content |-- article.scss '-- ...
.message color: white .important background-color: red .message-important @extend .message, .important In the above code @extend is used in one line to add multiple classes' code to .message-important, however, it is possible to use one extend per line like this: .message-importan...
Sometimes, you may want an @extend to be optional, and not require the specified class to exist in your code. .message-important @extend .message !optional background: red This will result in the following CSS: .message-important { background: red; } Disclaimer: This is useful duri...
You can install ServiceStack in 3 ways: Complete Visual studio templates (Self hosted) Start from scratch run ServiceStack Self hosted (Console App) Run ServiceStack inside Asp.net MVC. Complete visual studio templates You can find info about these here: https://github.com/ServiceStack/Ser...
generate sample data frames: In [57]: df3 = pd.DataFrame({'col1':[211,212,213], 'col2': [221,222,223]}) In [58]: df1 = pd.DataFrame({'col1':[11,12,13], 'col2': [21,22,23]}) In [59]: df2 = pd.DataFrame({'col1':[111,112,113], 'col2': [121,122,123]}) In [60]: df3 = pd.DataFrame({'col1':[211,2...
import os, time import pyodbc import pandas.io.sql as pdsql def todf(dsn='yourdsn', uid=None, pwd=None, query=None, params=None): ''' if `query` is not an actual query but rather a path to a text file containing a query, read it in instead ''' if query.endswith('.sql') and o...
Natively, Jenkins runs on port 8080. We can establish a proxy from port 80 -> 8080 so Jenkins can be accessed via: http://<url>.com instead of the default http://<url>.com:8080 Begin by installing Nginx. sudo aptitude -y install nginx Remove the default settings for Nginx c...
The ANSI CL standard uses an extended EBNF syntax notation. The documentation duplicated on Stackoverflow should use the same syntax notation to reduce confusion. Example: specialized-lambda-list::= ({var | (var parameter-specializer-name)}* [&optional {var | (var [initform [supp...
To create a human-readable presentation of a model object you need to implement Model.__str__() method (or Model.__unicode__() on python2). This method will be called whenever you call str() on a instance of your model (including, for instance, when the model is used in a template). Here's an exampl...
itertools.combinations will return a generator of the k-combination sequence of a list. In other words: It will return a generator of tuples of all the possible k-wise combinations of the input list. For Example: If you have a list: a = [1,2,3,4,5] b = list(itertools.combinations(a, 2)) print ...
+currentCalendar returns the logical calendar for the current user. NSCalendar *calender = [NSCalendar currentCalendar]; NSLog(@"%@",calender); +autoupdatingCurrentCalendar returns the current logical calendar for the current user. NSCalendar *calender = [NSCalendar autoupdat...
- initWithCalendarIdentifier: Initializes a newly-allocated NSCalendar object for the calendar specified by a given identifier. NSCalendar *calender = [[NSCalendar alloc]initWithCalendarIdentifier:@"gregorian"]; NSLog(@"%@",calender); - setFirstWeekday: Sets the index of the...
- components:fromDate: Returns a NSDateComponents object containing a given date decomposed into specified components NSCalendar *calender = [NSCalendar autoupdatingCurrentCalendar]; [calender setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; NSLog(@"%@",[calender components:NSCale...
The HTML attribute contenteditable provides a simple way to turn a HTML element into a user-editable area <div contenteditable>You can <b>edit</b> me!</div> Native Rich-Text editing Using JavaScript and execCommandW3C you can additionally pass more editing features to th...
This book is known as CLtL2. This is the second edition of the book Common Lisp the Language. It was published in 1990, before the ANSI CL standard was final. It took the original language definition from the first edition (published in 1984) and described all changes in the standardization process...
To start tinkering with Roslyn you will need the following NuGet packages: The C# and VB compilers - Microsoft.Net.Compilers. To install it you can run the following command in the Package Manager Console: nuget install Microsoft.Net.Compilers The Language APIs and Services - Microsoft.Co...
XSD, XML Schema Definition, is a language which describes the structure of XML documents. XSD files can be used to validate an XML file. The process of doing this will depend on what you choose to implement it with. Care should be taken to ensure the validation engine you use is compatible with the ...
On CLiki, a Wiki for Common Lisp and free Common Lisp software, a list of Proposed ANSI Revisions and Clarifications is being maintained. Since the Common Lisp standard has not changed since 1994, users have found several problems with the specification document. These are documented on the CLiki p...

Page 144 of 505