Tutorial by Examples: al

Castle Windsor is available via NuGet Use the "Manage NuGet Packages" and search for "castle windsor" To download for Visual Studio 2015 To download for previous versions Use Package Manager Console to execute: Install-Package Castle.Windsor Now you can us...
Use the double negation syntax to check for truthiness of values. All values correspond to a boolean, irrespective of their type. irb(main):001:0> !!1234 => true irb(main):002:0> !!"Hello, world!" (irb):2: warning: string literal in condition => true irb(main):003:0> !...
You do not need to use double negation in if-else statements. if 'hello' puts 'hey!' else puts 'bye!' end The above code prints 'hey!' on the screen.
Accessing the array of calendars To access the array of EKCalendars, we use the calendarsForEntityType method: Swift let calendarsArray = eventStore.calendarsForEntityType(EKEntityType.Event) as! [EKCalendar] Iterating through calendars Just use a simple for loop: Swift for calendar in cale...
This is an example to show how to change the allowed choices on a subCategory select field depending on the value of the category select field. To do that you have to make your subCategory choices dynamical for both client and server side. 1. Make the form dynamic on the client side for display / ...
In Ruby, there is always an implicit receiver for all method calls. The language keeps a reference to the current implicit receiver stored in the variable self. Certain language keywords like class and module will change what self points to. Understanding these behaviors is very helpful in mastering...
Setup variables JUSERID=$[ ( $RANDOM % 100 ) + 1 ] JUSERNAME="admin" JUSEREMAIL="[email protected]" JUSERPASS="qweasd" DB="joomla_3" DBUSER="jdbuser" DBPASS="dbupass" DBPREFIX="prfx_" JOOMLAVERSION="3.6.2" ...
sudo docker stats $(sudo docker inspect -f "{{ .Name }}" $(sudo docker ps -q)) Shows live CPU usage of all running containers.
In MySQL and other SQL dialects, NULL values have special properties. Consider the following table containing job applicants, the companies they worked for, and the date they left the company. NULL indicates that an applicant still works at the company: CREATE TABLE example (`applicant_id` INT, `...
SELECT 1,22,44 UNION SELECT 2,33,55 SELECT 1,22,44 UNION SELECT 2,33,55 UNION SELECT 2,33,55 The result is the same as above. use UNION ALL when SELECT 1,22,44 UNION SELECT 2,33,55 UNION ALL SELECT 2,33,55
The correct invocation of helper modules and functions can be intimidating because these are generated dynamically (e.g., when creating a new project or adding a new resource) they are not documented explicitly (e.g., MyApp.ErrorHelpers.error_tag) the documentation does not cover all examples (...
To automatically reload vimrc upon save, add the following to your vimrc: if has('autocmd') " ignore this section if your vim does not support autocommands augroup reload_vimrc autocmd! autocmd! BufWritePost $MYVIMRC,$MYGVIMRC nested source % augroup END endif a...
The Ruby Version Manager is a command line tool to simply install and manage different versions of Ruby. rvm istall 2.3.1 for example installs Ruby version 2.3.1 on your machine. With rvm list you can see which versions are installed and which is actually set for use. user@dev:~$ rvm li...
The push notification plugin requires an init an initialization which tells the plugin to start running using the sender id provided. let push = Push.init({ android: { senderID: "------------", }, ios: { alert: "true", badge: tru...
The sample content used here is Tears of Steel, by Blender Foundation. Specifically, we will use the download titled "HD 720p (~365MB, mov, 2.0)". This is a single file that ends with the extension "mov" and will play in just about any modern media player. Note that the download...
Mongoose connect has 3 parameters, uri, options, and the callback function. To use them see sample below. var mongoose = require('mongoose'); var uri = 'mongodb://localhost:27017/DBNAME'; var options = { user: 'user1', pass: 'pass' } mongoose.connect(uri, options, function(err){...
There exist cases in which it is necessary to put data of different types together. In Azure ML for example, it is necessary to pass informations from a R script module to another one exclusively throught dataframes. Suppose we have a dataframe and a number: > df name height team...
Log on to the Azure classic portal. In the left navigation pane of the portal, click Service Bus. In the lower pane of the portal, click Create. In the Add a new namespace dialog, enter a namespace name. The system immediately checks to see if the name is available. After...
Log on to the Azure classic portal. In the left navigation pane of the portal, click Service Bus. Select the namespace that you would like to create the queue in. In this case, it is “mytestns1.” Select Queues. Select New in the bottom left corner, then select Quick Creat...
@IBAction func axisChange(sender: UISwitch) { UIView.animateWithDuration(1.0) { self.updateConstraintsForAxis() } } The updateConstraintForAxis function just sets the axis of the stack view containing the two image views: private func updateConstraintsForAxis() { if (axi...

Page 161 of 269