Tutorial by Examples: v

Up navigation is done in android by adding android:parentActivityName="" in Manifest.xml to the activity tag. Basically with this tag you tell the system about the parent activity of a activity. How is it done? <uses-permission android:name="android.permission.INTERNET" ...
The following example is tested on Windows 8 pro 64-bit operating system with python 2.7 and scrapy v 1.2. Let assume that we have already installed the scrapy framework. MySQL database that we will use in the following tutorial CREATE TABLE IF NOT EXISTS `scrapy_items` ( `id` bigint(20) UNSIGN...
Implementation of the Caesar cipher. This implementation performs the shift operation only on upper and lower case alphabets and retains the other characters (such as space as-is). The Caesar cipher is not secure as per current standards. Below example is for illustrative purposes only ! Refer...
Basic reading image from java import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; //Load native library System.loadLibrary(Core.NATIVE_LIBRARY_NAME); //Mat object used to host the image Mat imageArray; //Read image file from vile system ima...
Where we came from Sometimes we can't provide all of the required metadata needed for the XmlSerializer framework in attribute. Suppose we have a base class of serialized objects, and some of the derived classes are unknown to the base class. We can't place an attribute for all of the classes which...
Unary operators are operators with only one operand. Unary operators are more efficient than standard JavaScript function calls. Additionally, unary operators can not be overridden and therefore their functionality is guaranteed. The following unary operators are available: OperatorOperationExampl...
XmlView: <mvc:View controllerName="sap.m.sample.ListCounter.List" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"> <List headerText="Products" items="{products>/Products}"> <!-- Template of ...
What is tidyverse? tidyverse is the fast and elegant way to turn basic R into an enhanced tool, redesigned by Hadley/Rstudio. The development of all packages included in tidyverse follow the principle rules of The tidy tools manifesto. But first, let the authors describe their masterpiece: The t...
Below there is the implementation in Java using a generics approach. It is the same algorithm, which is presented above. public interface InPlaceSort<T extends Comparable<T>> { void sort(final T[] elements); } public class MergeSort < T extends Comparable < T >> implem...
Laravel is a well-known PHP Framework. Here, you will learn all-about Laravel. Starting from as-simple-as knowing what Object-Oriented Programming is, to the advanced Laravel package development topic. This, like every other Stackoverflow documentation tag, is community-driven documentation, so if ...
1. $_ : The default input and pattern-searching space. Example 1: my @array_variable = (1 2 3 4); foreach (@array_variable){ print $_."\n"; # $_ will get the value 1,2,3,4 in loop, if no other variable is supplied. } Example 2: while (<FH>){ chomp($_); # $_ re...
import AVFoundation class QRScannerViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate { func viewDidLoad() { self.initCaptureSession() } private func initCaptureSession() { let captureDevice = AVCaptureDevice .defa...
Use the quotestar register to copy/paste between Vim and system clipboard "*yy copies the current line into the system clipboard "*p pastes the content of the system clipboard into Vim
Method Overriding and Overloading are two forms of polymorphism supported by Java. Method Overloading Method overloading (also known as static Polymorphism) is a way you can have two (or more) methods (functions) with same name in a single class. Yes its as simple as that. public class Shape{ ...
In general, we tend to back up the DB with the pgAdmin client. The following is a sh script used to save the database (under linux) in two formats: SQL file: for a possible resume of data on any version of PostgreSQL. Dump file: for a higher version than the current version. #!/bin/sh...
Minimum Vertex Cover is a classic graph problem. Let's say, in a city we have a few roads connecting a few points. Let's represent the roads using edges and the points using nodes. Let's take two example graphs: We want to set watchmen on some points. A watchman can guard all the roads connected ...
Controller is an entry point to our application. However, it’s not the only possible entry point. I would like to have my logic accessible from: Rake tasks background jobs console tests If I throw my logic into a controller it won’t be accessible from all these places. So let’s try “skinny ...
If you click on export icon, you will given options to choose like on which format you need to export the data. Just click on anything you wish. You can see that the data is being send to the server http://export.highcharts.com/ in the top left side. exporting: { chartOptions: { ...
Install the package: $ pip install pymssql import pymssql SERVER = "servername" USER = "username" PASSWORD = "password" DATABASE = "dbname" connection = pymssql.connect(server=SERVER, user=USER, password=PASSWORD, database=DATABASE...
Let's start with a simple algorithm to see how recursion could be implemented in Ruby. A bakery has products to sell. Products are in packs. It services orders in packs only. Packaging starts from the largest pack size and then the remaining quantities are filled by next pack sizes available. For ...

Page 229 of 296