Tutorial by Examples: co

PSR-1 is an accepted recommendation and outlines a basic standard recommendation for how code should be written. It outlines naming convetions for classes, methods and constants. It makes adopting PSR-0 or PSR-4 recommendations a requirement. It indicates which PHP tags to use: <?php and &lt...
This example requires MdDialogRef and MD_DIALOG_DATA. Please import them in the component module. import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material'; input-overview-example.html: <md-input-container> <input mdInput [(ngModel)]="id" ...
There are benefits to switching the root view controller, although the transition options are limited to those supported by UIViewAnimationOptions, so depending on how you wish to transition between flows might mean you have to implement a custom transition - which can be cumbersome. You can show t...
To generate json user model with username, password_hash, email_id, created_at, updated_at, type mix phoenix.gen.json User users username:string email_id:string password_hash:string timestamps()
This example grabs the Node.gitignore file from GitHub's gitignore repository, downloads it to your current working directory and renames it to .gitignore - all very typical actions for someone starting a new node.js project. $ curl http://github.com/github/gitignore/raw/master/Node.gitignore -o .g...
#!bin/bash $ string='Question%20-%20%22how%20do%20I%20decode%20a%20percent%20encoded%20string%3F%22%0AAnswer%20%20%20-%20Use%20printf%20%3A)' $ printf '%b\n' "${string//%/\\x}" # the result Question - "how do I decode a percent encoded string?" Answer - Use printf ...
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Api extends CI_Controller { //default value private $login_credential; function __construct() { parent::__construct(); //for user authentication $this->load->library('session'); ...
/***************************** @return all events ****************************/ public function getallevents(){ //get data from model $events = array( array('Event 1', '2015-04-03'), array('Event 2', '2015-04-03'), array('Event 3', '2015-06-16'), array('Event 4', '2015-0...
While building electron apps, usually the backend is in separate folder (js files) and front end is in a separate folder (html files). In the backend, in order to use the database, we have to include the nedb package with the require statement as follows. var Datastore = require('nedb'),db = new Da...
Commands are used for handling Events in WPF while respecting the MVVM-Pattern. A normal EventHandler would look like this (located in Code-Behind): public MainWindow() { _dataGrid.CollectionChanged += DataGrid_CollectionChanged; } private void DataGrid_CollectionChanged(object sender, S...
How comp, comp-1 ... comp-5 are implemented is implementation dependent. Format Normal Implementation Comp Big endian binary integer Comp-1 4 byte floating point Comp-2 8 byte floating point Comp-3 Packed decimal 123 is stored as x'123c' Comp-5 Binary In...
.container has one fixed width for each screen size in bootstrap (xs,sm,md,lg); .container-fluid expands to fill the available width. @media (min-width: 568px) { .container { width: 550px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1...
This is a simple example on how you can automate tests for a console application that interact with standard input and standard output. The tested application read and sum every new line and will provide the result after a single white line is provided. The power shell script write "pass"...
=> Original Post <= ASP.NET Core uses the ASPNETCORE_ENVIRONMENT environment variable to determine the current environment. By default, if you run your application without setting this value, it will automatically default to the Production environment. > dotnet run Project TestApp (.NETC...
Please me mindful of importing all necessary libraries required. This example uses InMemoryDbService from angular-in-memory-web-api to provide the JSON data from mock API. Live demo service.ts: import { Injectable } from '@angular/core'; import { Headers, Http } from '@angular/http'; import...
CoAP(Constrained Application Protocol) provides a request/response interaction model between application endpoints typically used along with REST.RFC
Open3.popen3 or Open3.capture3: Open3 actually just uses Ruby's spawn command, but gives you a much better API. Open3.popen3 Popen3 runs in a sub-process and returns stdin, stdout, stderr and wait_thr. require 'open3' stdin, stdout, stderr, wait_thr = Open3.popen3("sleep 5s && ls&q...
Exec: exec 'echo "hello world"' or exec ('echo "hello world"') The System Command: system 'echo "hello world"' Will output "hello world" in the command window. or system ('echo "hello world"') The system command can return a true if ...
Steps to create MYSQL database Login to amazon account and select RDS service Select Launch DB Instance from the instance tab By defaul MYSQL Community Edition will be selected, hence click the select button Select the database purpose, say production and click next step Provide the mysql ver...
Sometimes you'll need to execute synchronous code from within an asynchronous task. To do this, simply schedule a synchronous task from within the asynchronous block. Bukkit.getScheduler().runTaskTimerAsynchronously(VoidFlame.getPlugin(), () -> { Bukkit.getScheduler().runTask(VoidFlame.ge...

Page 247 of 248