Tutorial by Examples

One of the nicest features of flexbox is to allow optimally fitting containers to their parent element. Live demo. HTML: <div class="flex-container"> <div class="flex-item">1</div> <div class="flex-item">2</div> <div class=&q...
The pointer-events property allows for control over how HTML elements respond to mouse/touch events. .disabled { pointer-events: none; } In this example, 'none' prevents all click, state and cursor options on the specified HTML element [[1]] Other valid values for HTMl elements are: ...
Using outline: .div1{ border: 3px solid black; outline: 6px solid blue; width: 100px; height: 100px; margin: 20px; } Using box-shadow: .div2{ border: 5px solid green; box-shadow: 0px 0px 0px 4px #000; width: 100px; height: 100px; margin: 20px; } Using a ps...
Having a global allows for better DRYness, you need only put values that are different into AssemblyInfo.cs for projects that have variance. This use assumes your product has more than one visual studio project. GlobalAssemblyInfo.cs using System.Reflection; using System.Runtime.InteropServices...
2.12.2 You can use the minElement() and maxElement() methods to find the minimum or maximum element in a given sequence. For example, with an array of numbers: let numbers = [2, 6, 1, 25, 13, 7, 9] let minimumNumber = numbers.minElement() // Optional(1) let maximumNumber = numbers.maxElement()...
Often beginning MATLAB developers will use MATLAB's editor to write and edit code, in particular custom functions with inputs and outputs. There is a Run button at the top that is available in recent versions of MATLAB: Once the developer finishes with the code, they are often tempted to push th...
Explicite selection A plotting style is usually selected using the with keyword, like plot x with points This allows to use different plotting styles for every plot: plot x with points, 2*x with lines Typing help with in the gnuplot command window gives a list of all available plotting styl...
ActiveRecord with includes ensures that all of the specified associations are loaded using the minimum possible number of queries. So when querying a table for data with an associated table, both tables are loaded into memory. @authors = Author.includes(:books).where(books: { bestseller: true } ) ...
Here is typical error handler for a subform as a table: Public Const cErrCodeValueRequierd = 3162 Public Const cErrCodeDuplicateKey = 3022 Private Sub Form_Error(DataErr As Integer, Response As Integer) Select Case DataErr Case cErrCodeDuplicateKey MsgBox "Duplic...
Given a class as follows: class Cube attr_reader :height, :width, :depth def initialize(args) @height = args[:height] || args[:y] || 1 @width = args[:width] || args[:x] || 1 @depth = args[:depth] || args[:z] || 1 end def volume height * width * depth end ...
To create a most basic test with Jasmine go to your spec (tests) folder and add file named testSpec.js. In that file add following: var request = require("request"); describe("Hello World Test", function() { // This is your test bundle describe("GET SO", fu...
To build a Rails application that will be an API server, you can start with a more limited subset of Rails in Rails 5. To generate a new Rails API app: rails new my_api --api What --api does is to remove functionality that is not needed when building an API. This includes sessions, cookies, ass...
Sometimes you may need to validate record only under certain conditions. class User < ApplicationRecord validates :name, presence: true, if: :admin? def admin? conditional here that returns boolean value end end If you conditional is really small, you can use a Proc: class ...
In PHP, there are two versions of logical AND and OR operators. OperatorTrue if$a and $bBoth $a and $b are true$a && $bBoth $a and $b are true$a or $bEither $a or $b is true$a || $bEither $a or $b is true Note that the && and || opererators have higher precedence than and and or. S...
In cryptography, encryption is the process of encoding messages or information in such a way that only authorized parties can access it. Source: Encryption - Wikipedia
Imagine that we have a separate Google spreadsheet, and we need to get the B2 cell value to cell D5 on your current sheet. function copyValueandPaste() { var source = SpreadsheetApp.openById('spread sheet id is here'); //Separate spreadsheet book var sourcesheet = source.getSheetByName...
As with docopt, with [docopt_dispatch] you craft your --help in the __doc__ variable of your entry-point module. There, you call dispatch with the doc string as argument, so it can run the parser over it. That being done, instead of handling manually the arguments (which usually ends up in a high c...
Functions that are O(n) increase the number of operations linearly, as the input gets very large. A simple example of a function that is O(n) would be the linear search algorithm, which runs once for the size of the input. The following pseudo-code would be O(n), because it will always be bounded ...
We can add Kendo-UI grid in HTML5/Javascript, ASP.NET MVC, JSP and PHP project/application. Please follow below steps to add kendo-UI grid in HTML5 page. Create empty html5 page. Include kendo.common.min.css and kendo.default.min.css. Add a link tag within the head tag. Kendo-UI li...
The following example shows how to use a QTimer to call a slot every 1 second. In the example, we use a QProgressBar to update its value and check the timer is working properly. main.cpp #include <QApplication> #include "timer.h" int main(int argc, char *argv[]) { QApp...

Page 581 of 1336