Tutorial by Examples

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...
Given this object: var obj = { a: "hello", b: "this is", c: "javascript!", }; You can convert its values to an array by doing: var array = Object.keys(obj) .map(function(key) { return obj[key]; }); console.log(array); // [&quot...
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...
Lets say we have a class as (defclass person () (name email age)) To obtain the names of the slots of the class we use the function class-slots. This can be found in the closer-mop package, provided by the closer-mop system. To load it the running lisp image we use (ql:quickload :closer-mop)....
CREATE DATABASE stackoverflow; USE stackoverflow; Create table stack( id_user int NOT NULL, username varchar(30) NOT NULL, password varchar(30) NOT NULL ); ALTER TABLE stack ADD COLUMN submit date NOT NULL; -- add new column ALTER TABLE stack DROP COLUMN submit; -- drop col...
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 ...
import java.io.*; import java.net.Socket; public class Main { public static void main(String[] args) throws IOException {//We don't handle Exceptions in this example //Open a socket to stackoverflow.com, port 80 Socket socket = new Socket("stackoverflow.com",8...
+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...
Like slices, maps hold references to an underlying data structure. So by assigning its value to another variable, only the reference will be passed. To copy the map, it is necessary to create another map and copy each value: // Create the original map originalMap := make(map[string]int) originalM...
ob_start is especially handy when you have redirections on your page. For example, the following code won't work: Hello! <?php header("Location: somepage.php"); ?> The error that will be given is something like: headers already sent by <xxx> on line <xxx>. In or...
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...
data.table extends reshape2's melt & dcast functions (Reference: Efficient reshaping using data.tables) library(data.table) ## generate some data dt <- data.table( name = rep(c("firstName", "secondName"), each=4), numbers = rep(1:4, 2), value = rnorm(8) ) ...
library(tidyr) ## example data set.seed(123) df <- data.frame( name = rep(c("firstName", "secondName"), each=4), numbers = rep(1:4, 2), value = rnorm(8) ) df # name numbers value # 1 firstName 1 -0.56047565 # 2 firstName 2 -0.2301...
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...
When PyInstaller is used without any options to bundle myscript.py , the default output is a single folder (named myscript) containing an executable named myscript (myscript.exe in windows) along with all the necessary dependencies. The app can be distributed by compressing the folder into a zip fi...
pyinstaller myscript.py -F The options to generate a single file are -F or --onefile. This bundles the program into a single myscript.exe file. Single file executable are slower than the one-folder bundle. They are also harder to debug.
For the sake of this example, it is assumed the user is running Jetty as a distribution. For information on how to run Jetty as an embedded web server, please refer to the official documentation. Jetty can be downloaded from here and is available in both .zip and .gzip formats. Current versions of ...

Page 374 of 1336