Tutorial by Examples: el

git difftool -t meld --dir-diff will show the working directory changes. Alternatively, git difftool -t meld --dir-diff [COMMIT_A] [COMMIT_B] will show the differences between 2 specific commits.
If someone else wrote the code you are committing, you can give them credit with the --author option: git commit -m "msg" --author "John Smith <[email protected]>" You can also provide a pattern, which Git will use to search for previous authors: git commit -m &quo...
The job of the linker is to link together a bunch of object files (.o files) into a binary executable. The process of linking mainly involves resolving symbolic addresses to numerical addresses. The result of the link process is normally an executable program. During the link process, the linker wi...
Common mobile-optimized sites use the <meta name="viewport"> tag like this: <meta name="viewport" content="width=device-width, initial-scale=1"> The viewport element gives the browser instructions on how to control the page's dimensions and scaling based...
You can use the reversed function which returns an iterator to the reversed list: In [3]: rev = reversed(numbers) In [4]: rev Out[4]: [9, 8, 7, 6, 5, 4, 3, 2, 1] Note that the list "numbers" remains unchanged by this operation, and remains in the same order it was originally. To r...
Create a XIB file Xcode Menu Bar > File > New > File. Select iOS, User Interface and then "View": Give your XIB a name (yes, we are doing a Pokemon example 👾). Remember to check your target and hit "Create". Design your view To make things easier, set:...
There are several R packages to read excel files, each of which using different languages or resources, as summarized in the following table: R packageUsesxlsxJavaXLconnectJavaopenxlsxC++readxlC++RODBCODBCgdataPerl For the packages that use Java or ODBC it is important to know details about your s...
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 () ...
if let Combines a pattern match and an if statement, and allows for brief non-exhaustive matches to be performed. if let Some(x) = option { do_something(x); } This is equivalent to: match option { Some(x) => do_something(x), _ => {}, } These blocks can also have e...
Simple LOOP form without special keywords: (loop forms...) To break out of the loop we can use (return <return value>) ` Some examples: (loop (format t "Hello~%")) ; prints "Hello" forever (loop (print (eval (read)))) ; your very own REPL (loop (let ((r (read))) ...
You should implement SFSafariViewControllerDelegate so that your class is notified when the user hits the Done button on the SafariViewController and you can dismiss it as well. First declare your class to implement the protocol. class MyClass: SFSafariViewControllerDelegate { } Implement th...
Run the command below in a shell after installing Ruby. This shows how you can execute simple Ruby programs without creating a Ruby file: ruby -e 'puts "Hello World"' You can also feed a Ruby program to the interpreter's standard input. One way to do that is to use a here document in...
This is the code for a simple console project, that prints "Hello, World!" to STDOUT, and exits with an exit code of 0 [<EntryPoint>] let main argv = printfn "Hello, World!" 0 Example breakdown Line-by-line: [<EntryPoint>] - A .net Attribute that m...
The following program says hello to the user. It takes one positional argument, the name of the user, and can also be told the greeting. import argparse parser = argparse.ArgumentParser() parser.add_argument('name', help='name of user' ) parser.add_argument('-g', '--greeting', ...
Use os.path.abspath: >>> os.getcwd() '/Users/csaftoiu/tmp' >>> os.path.abspath('foo') '/Users/csaftoiu/tmp/foo' >>> os.path.abspath('../foo') '/Users/csaftoiu/foo' >>> os.path.abspath('/foo') '/foo'
unique drops duplicates so that each element in the result is unique (only appears once): x = c(2, 1, 1, 2, 1) unique(x) # 2 1 Values are returned in the order they first appeared. duplicated tags each duplicated element: duplicated(x) # FALSE FALSE TRUE TRUE TRUE anyDuplicated(x) >...
Imagine you have the following HTML: <div> <label>Name:</label> John Smith </div> And you need to locate the text "John Smith" after the label element. In this case, you can locate the label element by text and then use .next_sibling property: from ...
BeautifulSoup has a limited support for CSS selectors, but covers most commonly used ones. Use select() method to find multiple elements and select_one() to find a single element. Basic example: from bs4 import BeautifulSoup data = """ <ul> <li class="item&quo...
Note: you need to install Boot before trying this example out. See the Installation and Setup section if you haven't installed it yet. Boot allows making executable Clojure files using shebang (#!) line. Place the following text into a file of your choice (this example assumes it's in the "cur...
SELECT FIND_IN_SET('b','a,b,c'); Return value: 2 SELECT FIND_IN_SET('d','a,b,c'); Return value: 0

Page 18 of 145