Tutorial by Examples: am

This is a slightly more advanced example that shows a few more features of common lisp. We start with a simple Hello, World! function and demonstrate some interactive development at the REPL. Note that any text from a semicolon, ;, to the rest of the line is a comment. CL-USER> (defun hello () ...
A few modules in the standard library have been renamed: Old nameNew name_winregwinregConfigParserconfigparsercopy_regcopyregQueuequeueSocketServersocketserver_markupbasemarkupbasereprreprlibtest.test_supporttest.supportTkintertkintertkFileDialogtkinter.filedialogurllib / urllib2urllib, urllib.pars...
Dim filename As String = "c:\path\to\file.txt" If System.IO.File.Exists(filename) Then Dim writer As New System.IO.StreamWriter(filename) writer.Write("Text to write" & vbCrLf) 'Add a newline writer.close() End If
using System.Text; using System.IO; string filename = "c:\path\to\file.txt"; //'using' structure allows for proper disposal of stream. using (StreamWriter writer = new StreamWriter(filename")) { writer.WriteLine("Text to Write\n"); }
Histograms allow for a pseudo-plot of the underlying distribution of the data. hist(ldeaths) hist(ldeaths, breaks = 20, freq = F, col = 3)
docopt turns command-line argument parsing on its head. Instead of parsing the arguments, you just write the usage string for your program, and docopt parses the usage string and uses it to extract the command line arguments. """ Usage: script_name.py [-a] [-b] <path> ...
To count how many elements of two sets overlap, one could write a custom function: xtab_set <- function(A, B){ both <- union(A, B) inA <- both %in% A inB <- both %in% B return(table(inA, inB)) } A = 1:20 B = 10:30 xtab_set(A, B) # inB ...
Have a table NameAgeCityBob10ParisMat20BerlinMary24Prague select Name from table where Age>10 AND City='Prague' Gives NameMary select Name from table where Age=10 OR City='Prague' Gives NameBobMary
For if you have to fine-tune what is published. import { Mongo } from 'meteor/mongo'; import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; if (Meteor.isClient) { // established this collection on the client only. // a name is required (first parameter) and this...
Swift 3 let stackView = UIStackView() stackView.axis = .horizontal stackView.alignment = .fill // .leading .firstBaseline .center .trailing .lastBaseline stackView.distribution = .fill // .fillEqually .fillProportionally .equalSpacing .equalCentering let label = UILabel() label.text = "...
Swift let stackView = UIStackView() stackView.axis = .Vertical stackView.alignment = .Fill // .Leading .FirstBaseline .Center .Trailing .LastBaseline stackView.distribution = .Fill // .FillEqually .FillProportionally .EqualSpacing .EqualCentering let label = UILabel(frame: CGRectZero) label....
Using the dateutil library as in the previous example on parsing timezone-aware timestamps, it is also possible to parse timestamps with a specified "short" time zone name. For dates formatted with short time zone names or abbreviations, which are generally ambiguous (e.g. CST, which coul...
C++11 inline namespace includes the content of the inlined namespace in the enclosing namespace, so namespace Outer { inline namespace Inner { void foo(); } } is mostly equivalent to namespace Outer { namespace Inner { void foo(); } u...
Lambda expressions can be used to handle events, which is useful when: The handler is short. The handler never needs to be unsubscribed. A good situation in which a lambda event handler might be used is given below: smtpClient.SendCompleted += (sender, args) => Console.WriteLine("Ema...
When you want to use user generated content in the SQL, it with done with parameters. For example for searching user with the name aminadav you should do: var username = 'aminadav'; var querystring = 'SELECT name, email from users where name = ?'; connection.query(querystring, [username], functi...
You send the query as a string and in response callback with the answer is received. The callback gives you error, array of rows and fields. Each row contains all the column of the returned table. Here is a snippet for the following explanation. connection.query('SELECT name,email from users', fu...
In case you have a Named Range in your Sheet, and you want to dynamically get the last row of that Dynamic Named Range. Also covers cases where the Named Range doesn't start from the first Row. Sub FindingLastRow() Dim sht As Worksheet Dim LastRow As Long Dim FirstRow As Long Set sht =...
Take any list and add an identifier to the outer wrapper (ul, div) <ul id="sortable"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul> In your jquery: $(function(){ $('#sortable').sortable({ ...
A request for the top 10 most recently active StackOverflow posts using the Stack Exchange API. package main import ( "encoding/json" "fmt" "net/http" "net/url" ) const apiURL = "https://api.stackexchange.com/2.2/posts?" ...
To get a value from the map, you just have to do something like:00 value := mapName[ key ] If the map contains the key, it returns the corresponding value. If not, it returns zero-value of the map's value type (0 if map of int values, "" if map of string values...) m := map[string]s...

Page 15 of 129