Tutorial by Examples

Detailed instructions on getting symfony-forms set up or installed.
Encoded URL http%3A%2F%2Fwww.foo.com%2Findex.php%3Fid%3Dqwerty Use this command to decode the URL echo "http%3A%2F%2Fwww.foo.com%2Findex.php%3Fid%3Dqwerty" | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e Decoded URL (result of command) http://www.foo...
To remove whitespace (spaces, tabs, newlines…) between HTML tags use spaceless tag: {% spaceless %} <div> <span>foo bar </span> </div> {% endspaceless %} {# produces output <div><strong>foo bar </strong></div> #} If you need ...
This is an example to explain the variations of load events. onload event <body onload="someFunction()"> <img src="image1" /> <img src="image2" /> </body> <script> function someFunction() { console.log("Hi! I am l...
In order to use bootstrap, there are 2 cases. The electron app is connected to internet The electron app is not connected to internet For electron apps that are connected to internet, we can just make use of CDN links for bootstrap and include that in our html files. The problem comes when w...
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...
navigate to the desired file in a repository click the 'raw' button copy the url from the address bar See the following example from GitHub's gitignore repository: http://github.com/github/gitignore/raw/master/Node.gitignore You can quickly recognize a url that will work to download an indiv...
#!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 ...
Detailed instructions on getting metal set up or installed.
Consider Kotlin's Null Type system and WeakReference<T>. So let's say we have to save some sort of reference and we wanted to avoid memory leaks, here is where WeakReference comes in. take for example this: class MyMemoryExpensiveClass { companion object { var reference: WeakR...
Using Intents to Load the Image from Gallery. Initially you need to have the permission <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> Use the Following Code to have the layout as designed follows. <?xml version="1.0" enco...
<?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...
/***************************** login user @required : username and password via post method only @return user data if login successfull otherwise error message ****************************/ public function login(){ $username=$this->input->post('username'); $password=$this->input-...
/*************************** log out user ***************************/ public function logout(){ //delete all session session_destroy(); $this->output->set_output(json_encode(array('status'=>true,'msg'=>'log Out successfully'))); }
This API not accessible for public user, authentication is required /*************************** this is protected api this is not accessible if you are not loged in ***************************/ public function protectedapi(){ if($this->session->userdata('logged_in')){ //this secti...
ng-repeat is the built-in directive provided by AngularJS, mostly used for listing the array elements on UI dynamically as per the changes in our model. Official "ng-repeat" docs can be found at : https://docs.angularjs.org/api/ng/directive/ngRepeat Also the most common error faced whil...
There are times when the framework's Random() class may not be considered random enough, given that it is based on a psuedo-random number generator. The framework's Crypto classes do, however, provide something more robust in the form of RNGCryptoServiceProvider. The following code samples demonstr...
Suppose you have an E-commerce cloud having various Microservices as shopping cart service, Order service, Inventory service and so on. You need to have an API gateway as an Edge service to the outer world. The API gateway abstracts the details(host & port) about the underline Microservices. ...
Let's say a user wants to select data from different tables. A table is specified by the user. function get_value(p_table_name varchar2, p_id number) return varchar2 is value varchar2(100); begin execute immediate 'select column_value from ' || p_table_name || ...

Page 1329 of 1336