Tutorial by Examples: ad

Strict-Transport-Security: max-age=31536000; includeSubDomains Strict-Transport-Security is a promise to the browser that all future requests to this domain will be secure. For the future time period max-age: All outgoing HTTP requests from the browser will be converted to HTTPS on the client...
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload HSTS is activated only after a successful HTTPS request to the server with a valid certificate. There is still a risk of a first-time user accessing the site, at which point a Man-in-the-Middle attack is possible. To make th...
Note: Before upgrading your Rails app, always make sure to save your code on a version control system, such as Git. To upgrade from Rails 4.2 to Rails 5.0, you must be using Ruby 2.2.2 or newer. After upgrading your Ruby version if required, go to your Gemfile and change the line: gem 'rails', '...
Basic Radios export class MyViewModel { favoriteColor = null; colors = ['Red', 'Yellow', 'Pink', 'Green', 'Purple', 'Orange', 'Blue']; } <template> <label repeat.for="color of colors"> <input type="radio" name="colors" value.bind=&q...
Unlike show.bind when using if.bind the element will be removed from the page if the supplied binding value is false or added into the page if the value is true. export class MyViewModel { isVisible = false; } <template> <div if.bind="isVisible"><strong>If ...
Everything you need to get started with Django admin is already setup in Django's default project layout. This includes: # settings.py # `django.contrib.admin` and its dependancies. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',...
Sample Data: CREATE TABLE table_name ( value VARCHAR2(50) ); INSERT INTO table_name ( value ) VALUES ( 'A,B,C,D,E' ); Query: WITH items ( list, item, lvl ) AS ( SELECT value, REGEXP_SUBSTR( value, '[^,]+', 1, 1 ), 1 FROM table_name UNION ALL SELECT value, ...
Appearance : Happens when your script tries to send a HTTP header to the client but there already was output before, which resulted in headers to be already sent to the client. Possible Causes : Print, echo: Output from print and echo statements will terminate the opportunity to send HTTP hea...
What is XAMPP? XAMPP is the most popular PHP development environment. XAMPP is a completely free, open-source and easy to install Apache distribution containing MariaDB, PHP, and Perl. Where should I download it from? Download appropriate stable XAMPP version from their download page. Choose the ...
The below code example will give you an adjusted version of that color where a higher percentage will be brighter and a lower percentage will be darker. Objective-C + (UIColor *)adjustedColorForColor:(UIColor *)c : (double)percent { if (percent < 0) percent = 0; CGFloat r, g, b...
When performing tasks asynchronously there typically becomes a need to ensure a piece of code is run on the main thread. For example you may want to hit a REST API asynchronously, but put the result in a UILabel on the screen. Before updating the UILabel you must ensure that your code is run on th...
public class MyDataExporterToExcell { public static void Main() { GetAndExportExcelFacade facade = new GetAndExportExcelFacade(); facade.Execute(); } } public class GetAndExportExcelFacade { // All services below do something by themselves, determine l...
Assume you have a application that administers rooms. Assume further that your application operates on a per client basis (tenant). You have several clients. So your database will contain one table for clients, and one for rooms. Now, every client has N rooms. This should mean that you have...
Another way to hide admin bar is to add if ( !current_user_can( 'manage_options' ) ) { add_filter( 'show_admin_bar', '__return_false' , 1000 ); } The users who don't have privileges to access Settings page, won't be able to see the admin bar.
Input.acceleration is used to read the accelerometer sensor. It returns Vector3 as a result which contains x,y and z axis values in 3D space. void Update() { Vector3 acclerometerValue = rawAccelValue(); Debug.Log("X: " + acclerometerValue.x + " Y: " + acclerometerV...
You can use the DataExtension mechanism to add extra database fields to an existing DataObject: class MyMemberExtension extends DataExtension { private static $db = [ 'HairColour' => 'Varchar' ]; } And apply the extension: # File: mysite/_config/app.yml Member: exten...
You can add public methods to a DataObject using the extension mechanism, for example: class MyMemberExtension extends DataExtension { public function getHashId() { return sha1($this->owner->ID); } } When applied to the Member class, the example above would return...
You can create a set of radio buttons used to select an item from a list. It's possible to change the settings : selected : The initially selected value (character(0) for no selection) inline : horizontal or vertical width It is also possible to add HTML. library(shiny) ui <- fluidPa...
To copy nested objects, a deep copy must be performed, as shown in this example. import java.util.ArrayList; import java.util.List; public class Sheep implements Cloneable { private String name; private int weight; private List<Sheep> children; public Sheep(Str...
Using raw values directly from the accelerometer sensor to move or rotate a GameObject can cause problems such as jerky movements or vibrations. It is recommended to smooth out the values before using them. In fact, values from the accelerometer sensor should always be smoothed out before use. This ...

Page 39 of 114