Tutorial by Examples: arch

Unzipping a zip archive is done with unzip function from the utils package (which is included in base R). unzip(zipfile = "bar.zip", exdir = "./foo") This will extract all files in "bar.zip" to the "foo" directory, which will be created if necessary. Tilde...
Listing files in a zip archive is done with unzip function from the utils package (which is included in base R). unzip(zipfile = "bar.zip", list = TRUE) This will list all files in "bar.zip" and extract none. Tilde expansion is done automatically from your working directory. ...
Listing files in a tar archive is done with untar function from the utils package (which is included in base R). untar(zipfile = "bar.tar", list = TRUE) This will list all files in "bar.tar" and extract none. Tilde expansion is done automatically from your working directory. ...
Extracting files from a tar archive is done with untar function from the utils package (which is included in base R). untar(tarfile = "bar.tar", exdir = "./foo") This will extract all files in "bar.tar" to the "foo" directory, which will be created if nece...
The next function is useful even without iterating. Passing a generator expression to next is a quick way to search for the first occurrence of an element matching some predicate. Procedural code like def find_and_transform(sequence, predicate, func): for element in sequence: if predi...
Let's say we have type ENUM('fish','mammal','bird') An alternative is type VARCHAR(20) COMENT "fish, bird, etc" This is quite open-ended in that new types are trivially added. Comparison, and whether better or worse than ENUM: (same) INSERT: simply provide the string (worse?)...
Introduction Binary Search is a Divide and Conquer search algorithm. It uses O(log n) time to find the location of an element in a search space where n is the size of the search space. Binary Search works by halving the search space at each iteration after comparing the target value to the middle ...
To create a search form, enter the following code <%= form_tag("/search", method: "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> form_tag: This is t...
USE AdventureWorks2012; GO CREATE FULLTEXT INDEX ON Production.Document ( Title Language 1033, DocumentSummary Language 1033, Document TYPE COLUMN FileExtension Language 1033 ) KEY INDEX PK_Document_DocumentID ...
SELECT product_id FROM products WHERE CONTAINS(product_description, ”Snap Happy 100EZ” OR FORMSOF(THESAURUS,’Snap Happy’) OR ‘100EZ’) AND product_cost < 200 ; SELECT candidate_name,SSN FROM candidates WHERE CONTAINS(candidate_resume,”SQL Server”) AND candidate_division ...
To list local branches that contain a specific commit or tag git branch --contains <commit> To list local and remote branches that contain a specific commit or tag git branch -a --contains <commit>
System.IO.Compression.ZipFile.CreateFromDirectory("myfolder", "archive.zip") Create archive.zip file containing files which are in myfolder. In example paths are relative to program working directory. You can specify absolute paths.
System.IO.Compression.ZipFile.ExtractToDirectory("archive.zip", "myfolder") Extracts archive.zip to myfolder directory. In example paths are relative to program working directory. You can specify absolute paths.
' Create filestream to file Using fileStream = New IO.FileStream("archive.zip", IO.FileMode.Create) ' open zip archive from stream Using archive = New System.IO.Compression.ZipArchive(fileStream, IO.Compression.ZipArchiveMode.Create) ' create file_in_archive.txt in arch...
To print a test field (TestField) from a test feature class (TestFC) in a test file geodatabase (Test.gdb) located in a temporary folder (C:\Temp): with arcpy.da.SearchCursor(r"C:\Temp\Test.gdb\TestFC",["TestField"]) as cursor: for row in cursor: print row[0]
In Emacs, basic search tool (I-Search) allows you to search after or before the location of your cursor. To search for sometext after the location of your cursor (search-forward) hit C-s sometext. If you want to go to the next occurence of sometext, just press C-s again (and so on for the ne...
To search for text foo within a {} block surrounding the cursor use the following command (<ESC> - escape key, <CR> - enter key) : vi{<ESC>/\%Vfoo<CR> now you can jump between the matches within the block by pressing n and p. If you have hlsearch option enabled this will ...
build.gradle: dependencies { compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0' } menu/menu.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.c...
A common and task of someone using the Linux Command Line (shell) is to search for files/directories with a certain name or containing certain text. There are 2 commands you should familiarise yourself with in order to accomplish this: Find files by name find /var/www -name '*.css' This will...
Custom Setting Custom Setting Field Custom Setting Field Value When the field is checked the validation rule will be disabled, for the running user or in this example, their profile - The rule can also be disabled for a whole Salesforce org - Validation Rule AND( /* the below is the...

Page 5 of 11