Tutorial by Examples: l

A live example for this can be found here.
Objective-C NSMutableAttributedString *mutAttString = @"string goes here"; NSRange range = NSMakeRange(0, mutAttString.length); [mutAttString setAttributes:@{} range:originalRange]; As per Apple Documentation we use, setAttributes and not addAttribute. Swift mutAttString.setAttribu...
As of Jekyll 3.2, you can use the filter where_exp to filter a collection by any of its properties. Say you have the following collection item in an "albums" collection: --- title: My Amazing Album --- ... You can combine the where_exp and first filters to grab just that one item: ...
Given an 'albums' collection, you can loop through and output each item: {% for album in site.albums %} {{ album.content }} {% endfor %} Any custom front matter variables are also available within the loop. {% for album in site.albums %} {{ album.title }} {{ album.content }} {%...
Given an 'albums' collection, an item can be added by creating a file in the <source>/_albums directory. Note that files not including frontmatter will be ignored. For instance, adding a file called my_album.md to the _albums directory would add it to the collection: --- title: "My Alb...
# Define the txt which will be in the email body $Txt_File = "c:\file.txt" function Send_mail { #Define Email settings $EmailFrom = "[email protected]" $EmailTo = "[email protected]" $Txt_Body = Get-Content $Txt_File -RAW $Body = $Body_...
For this example, an Ordered Collection will be used to show the different messages that can be sent to an OrderedCollection object to loop over the elements.The code below will instantiate an empty OrderedCollection using the message new and then populate it with 4 numbers using the message add: a...
The code snippet below shows the various ways you can filter on an array of objects using lodash. let lodash = require('lodash'); var countries = [ {"key": "DE", "name": "Deutschland", "active": false}, {"key": "ZA&qu...
triples = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] triples.each { |(first, second, third)| puts second } # 2 # 5 # 8 triples.map { |(first, *rest)| rest.join(' ') } # => ["2 3", "5 6", "8 9"]
Detailed instructions on getting rebol set up or installed. The most mature and stable version of Rebol is the official Rebol2, available from the downloads page for multiple platforms. There are 2 flavors: Rebol/View (version with gui, ~ 0.6 MB) Rebol/Core (no gui, for servers, ~ 0.3 MB) ...
For Example: echo Hello! pause >nul :Name echo What Is Your Name set /p Input=Name: echo so %Input% Is Your Name, right? echo Rename? echo 1 For Yes echo 2 For No set /p Input=Rename: if %Input%=1 goto Name Another Example: @echo off echo 1 or 2? set /p input=Choice: if %input...
Going to its roots, Logstash has the ability to parse and store syslog data. This example shows a basic configuration that gets you to that. input { file { path => [ "/var/log/syslog", "/var/log/auth.log" ] type => "syslog" } }...
Sometimes, you need to output to more than one index in ElasticSearch, or have a custom mapping you want to apply to new indices as they roll in. There are two ways to apply a custom mapping. One way, is to upload an ElasticSearch template. See the ElasticSearch documentation for that. The other ...
Always use Named Arguments to optional parameters, to avoid potential bugs when the method is modified. class Employee { public string Name { get; private set; } public string Title { get; set; } public Employee(string name = "<No Name>", string title = "&lt...
Detailed instructions on getting c#-4.0 set up or installed.
As of the C 2011 Standard, listed in §5.1.1.2 Translation Phases, the translation of source code to program image (e.g., the executable) are listed to occur in 8 ordered steps. The source file input is mapped to the source character set (if necessary). Trigraphs are replaced in this step. Contin...
Get a list of plugins $ wp plugin list List active plugins on the site. $ wp plugin list --status=active --format=json List plugins on each site in a network. $ wp site list --field=url | xargs -I % wp plugin list --url=% Activate plugin $ wp plugin activate hello-dolly Deactivate p...
You can customize the appearance of the TextInputLayout and its embedded EditTextby defining custom styles in your styles.xml. The defined styles can either be added as styles or themes to your TextInputLayout. Example for customizing the hint appearance: styles.xml: <!--Floating label text st...
# Read a text file and replace the IPv4 and IPv6 by fake IP Address # Describe all variables $SourceFile = "C:\sourcefile.txt" $IPv4File = "C:\IPV4.txt" $DestFile = "C:\ANONYM.txt" $Regex_v4 = "(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" $Anonym_v4 = &quo...
To deploy an Ember application simply transfer the output from ember build to a web server. This can be done with standard Unix file transfer tools such as rsync or scp. There are also services that will let you deploy easily. ember build scp -r dist/* myserver.com:/var/www/public/ normally we ...

Page 738 of 861