Tutorial by Examples: er

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...
When you define a class or module, the implicit receiver becomes a reference to the class itself. For example: puts "I am #{self}" class Example puts "I am #{self}" end Executing the above code will print: "I am main" "I am Example"
BEGIN TRY -- start error handling BEGIN TRANSACTION; -- from here on transactions (modifictions) are not final -- start your statement(s) select 42/0 as ANSWER -- simple SQL Query with an error -- end your statement(s) COMMIT TRANSACTION; -- finalize all transa...
sudo docker stats $(sudo docker inspect -f "{{ .Name }}" $(sudo docker ps -q)) Shows live CPU usage of all running containers.
The NodeIterator interface provides methods for iterating over nodes in a DOM tree. Given a document like this one: <html> <body> <section class="main"> <ul> <li>List Item</li> <li>List Item</li> <li>Li...
class IPrototype { public: virtual ~IPrototype() = default; auto Clone() const { return std::unique_ptr<IPrototype>{DoClone()}; } auto Create() const { return std::unique_ptr<IPrototype>{DoCreate()}; } private: virtual IPrototype* DoClone() const = 0; virt...
You may want to re-seed your database without affecting your previously created seeds. For this purpose, you can use firstOrCreate in your seeder: EmployeeType::firstOrCreate([ 'type' => 'manager', ]); Then you can seed the database: php artisan db:seed Later, if you want to add a...
Here is an example of a pipeline script that builds a Docker container, then runs the tests inside of it. The entrypoint is assumed to be either manage.py or invoke/fabric with a runtests command available. #!/usr/bin/groovy node { stage 'Checkout' checkout scm sh 'git submodule update ...
Most of linux distros stores its version info in the /etc/lsb-release (debian) or /etc/redhat-release (RPM based) file. Using below generic command should get you past most of the Debian and RPM derivatives as Linux Mint and Cent-Os. Example on Ubuntu Machine: cat /etc/*release DISTRIB_ID=Ubuntu ...
val allowedUsers = users.filter { it.age > MINIMUM_AGE }
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...
This example will explore how to see the layout of a video track and how to extract the individual pictures within it. 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 t...
DASH is the most widely deployed adaptive streaming technology in modern solutions, used to deliver video in a wide variety of scenarios. The best way to understand DASH presentations is to observe the network activity that takes place during playback. This example uses Fiddler to capture and analy...
I.Overview A significant difference between MongoDB & RDBMS is MongoDB has many kinds of operators. One of them is update operator, which is used in update statements. II.What happen if we don't use update operators? Suppose we have a student collection to store student information(Table view...
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...
@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...
To restore a file to the latest updated svn version, i.e. undo the local changes, you can use revert: svn revert file To restore a file to an older version (revision XXX) use update: svn update -r XXX file Warning: in both cases you will lose any local changes in the file because it will be ...
A shader program, in the OpenGL sense, contains a number of different shaders. Any shader program must have at least a vertex shader, that calculates the position of the points on the screen, and a fragment shader, that calculates the colour of each pixel. (Actually the story is longer and more co...
This sample demonstrates how to import the worksheet Azure Excel file blob to DB on the Azure SQL Server and how to export it from DB to Azure Excel blob. Prerequisites: Microsoft Visual Studio 2015 version Open XML SDK 2.5 for Microsoft Office An Azure storage account Azure SQL Server Add...
Julia supports regular expressions1. The PCRE library is used as the regex implementation. Regexes are like a mini-language within a language. Since most languages and many text editors provide some support for regex, documentation and examples of how to use regex in general are outside the scope of...

Page 257 of 417