Tutorial by Examples

Microsoft doesn't officially support APIs but with some research more declarations can be found online Office 2016 for Mac is sandboxed Unlike other versions of Office apps that support VBA, Office 2016 for Mac apps are sandboxed. Sandboxing restricts the apps from accessing resources outside the...
A minimal setup for camera output preview (Swift 2, Swift 3) import UIKit import AVFoundation class ViewController: UIViewController { var session: AVCaptureSession? var cameraPreviewLayer: AVCaptureVideoPreviewLayer? override func viewDidLoad() { super.viewDidLoad() ...
Valgrind provides you with the lines at which the error occurred at the end of each line in the format (file.c:line_no). Errors in valgrind are summarised in the following way: ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) The most common errors include: Illegal read/write er...
One can use the following methods in order to import a Mercurial Repo into Git: Using fast export: cd git clone git://repo.or.cz/fast-export.git git init git_repo cd git_repo ~/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo git checkout HEAD Using Hg-Git: A very deta...
We can use typedef to simplify the usage of function pointers. Imagine we have some functions, all having the same signature, that use their argument to print out something in different ways: #include<stdio.h> void print_to_n(int n) { for (int i = 1; i <= n; ++i) printf(...
Sometimes we need to join multiple tables to get aggregate data in return. here is how we can achieve the same using CodeIgniter Query Builder / Active Records. public function getStudentInfo($studentid){ $query = $this->db->select("st.id, st.name, st.class, mk.maths, mk.science&quo...
<?php namespace App\Http\Controllers; use App\User; use App\Http\Controllers\Controller; class UserController extends Controller { /** * Show the profile for the given user. * * @param int $id * @return Response */ public function show($id) ...
Web Api 2 - Hello World example We are going to create a new Web Api simple application which return to us Json with message and user name. Lets start! First create new Web Api project using Visual Studio and select Empty Template. Be sure to check "Web Api" folder: NOTE I didn't choo...
As we can add multiple elements in Cart array and then add it to cart session, but there are 4 basic elements which Cart class requires to add data successfully in cart session. id (string) qty (number) price (number, decimal) name (String) And if you want to add more options regardin...
<nav aria-label="Page navigation example"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">Previous</a></li> <li class="page-item"><a class="page-lin...
Usually, the routes in a controller have the same prefix connected somehow with functionality of this controller. For example: public class ProductsController : ApiController { [Route("api/products")] public IEnumerable<Product> GetProducts() { ... } [Route("a...
You can show cart items by loop through cart or you can display single item from cart. $cartContents = $this->cart->contents(); This will return an array of cart items so you can loop through this array using foreach loop. foreach ($cartContents as $items){ echo "ID : ". ...
Rowid : The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a unique ID is created is so that identical products with different options can be managed by the cart. Every item in cart has a rowid element and by rowid you can update cart ...
By using rowid element you can delete an item from cart. you just have to set item's qty to 0 $deleteItem = array( 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', 'qty' => 0 ); $this->cart->update($data); this will delete item with this rowid.
You can also add same custom created taxonomy into post type page using below code. function add_taxonomies_to_pages() { register_taxonomy_for_object_type( 'genre', 'page' ); } add_action( 'init', 'add_taxonomies_to_pages' ); Add above code into your theme's functions.php file. Same way...
Detailed instructions on getting nfc set up or installed.
First of all you need to create AVAssetWriter NSError *error = nil; NSURL *outputURL = <#NSURL object representing the URL where you want to save the video#>; AVAssetWriter *assetWriter = [AVAssetWriter assetWriterWithURL:outputURL fileType:AVFileTypeQuickTimeMovie error:&error]; if (!...
Django Views are simply the functions that get called when a request is made to a certain URLs. URL patterns are written in urls.py file, each URL regex is given a function(Django view) from a views.py, so when a request is made, that function gets the call, with the HTTP request object, and then y...
Let's first recap how to initialize a 1D ruby array of integers: my_array = [1, 1, 2, 3, 5, 8, 13] Being a 2D array simply an array of arrays, you can initialize it like this: my_array = [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ]
You can go a level further down and add a third layer of arrays. The rules don't change: my_array = [ [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ], [ ['a', 'b', 'c', 'd', 'e'], ['z', 'y', 'x', 'w', 'v'] ], [ [] ...

Page 1290 of 1336