Tutorial by Examples: alt

HAML (HTML abstraction markup language) is a beautiful and elegant way to describe and design the HTML of your views. Instead of opening- and closing tags, HAML uses indentation for the structure of your pages. Basically, if something should be placed within another element, you just indent it by us...
require 'json' data = JSON '{"test":23}' # => {"test"=>23} or require 'json' data = JSON['{"test":23}'] # => {"test"=>23}
require 'json' document = JSON 'test' => 23 # => "{\"test\":23}" or require 'json' document = JSON['test' => 23] # => "{\"test\":23}"
Sub TransposeRangeValues() Dim TmpArray() As Variant, FromRange as Range, ToRange as Range set FromRange = Sheets("Sheet1").Range("a1:a12") 'Worksheets(1).Range("a1:p1") set ToRange = ThisWorkbook.Sheets("Sheet1").Range("a1")...
This examples uses the AES algorithm for encrypting passwords. The salt length can be up to 128 bit. We are using the SecureRandom class to generate a salt, which is combined with the password to generate a secret key. The classes used are already existing in Android packages javax.crypto and java....
Note: For brevity, the commands use here-strings (<<<) and ANSI C-quoted strings ($'...'). Both these shell features work in bash, ksh, and zsh. # GNU Sed $ sed '1 a appended text' <<<'line 1' line 1 appended text # BSD Sed (multi-line form) sed '1 a\ appended text'...
SET v_column_definition := CONCAT( v_column_name ,' ',v_column_type ,' ',v_column_options ); SET @stmt := CONCAT('ALTER TABLE ADD COLUMN ', v_column_definition); PREPARE stmt FROM @stmt; EXECUTE stmt; DEALLOCATE PREPARE stmt;
The Roslyn Quoter A tool for converting an sample C# program to syntax tree API calls. The tool itself can be found here. Enhanced source viewer An easy way to view the Roslyn source code can be found here.
Integral type ranges ( IntRange , LongRange , CharRange ) have an extra feature: they can be iterated over. The compiler takes care of converting this analogously to Java's indexed for-loop, without extra overhead for (i in 1..4) print(i) // prints "1234" for (i in 4..1) print(i) // pri...
int i, space, rows, k=0, count = 0, count1 = 0; row=5; for(i=1; i<=rows; ++i) { for(space=1; space <= rows-i; ++space) { printf(" "); ++count; } while(k != 2*i-1) { if (count <= rows-1) { printf("...
One can use the following methods in order to import a Mercurial Repo into Git: Using fast export: cd git clone git://repo.or.cz/fast-export.git git init git_repo cd git_repo ~/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo git checkout HEAD Using Hg-Git: A very deta...
if you want to see component's individual coverage of tests follow these steps. npm install --save-dev karma-teamcity-reporter Add `require('karma-teamcity-reporter')` to list of plugins in karma.conf.js ng test --code-coverage --reporters=teamcity,coverage-istanbul note that l...
This calculate current device time and add/subtract difference between real and device time public static Calendar getCurrentRealTime() { long bootTime = networkTime - SystemClock.elapsedRealtime(); Calendar calInstance = Calendar.getInstance(); calInstance.setTimeZone(getUTCTimeZo...
In the most straightforward implementation, the Onboarding flow can simply be presented in a modal context, since semantically the User is on a single journey. [Apple Human Interface Guidelines – Modality][1]: Consider creating a modal context only when it’s critical to get someone’s attention, ...
Let's assume you got an html after selecting with soup.find('div', class_='base class'): from bs4 import BeautifulSoup soup = BeautifulSoup(SomePage, 'lxml') html = soup.find('div', class_='base class') print(html) <div class="base class"> <div>Sample text 1</div...

Page 6 of 6