Tutorial by Examples

Place a file like the following in your top level directory. It defines which components to render for which paths import React from 'react'; import { Route, IndexRoute } from 'react-router'; import New from './containers/new-post'; import Show from './containers/show'; import Index from './c...
# A line used mostly as the first one, imports App class # that is used to get a window and launch the application from kivy.app import App # Casual Kivy widgets that reside in kivy.uix from kivy.uix.label import Label from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayo...
Twitter Bootstrap supports icons called glyphicons and they can be used with all tags of HTML. All icons require a base class and individual icon class. Keep in mind that icon classes cannot be directly combined with other components, so always use inner <span></span> tag. If your HTM...
Let's take a look at a quick example of using REST framework to build a simple model-backed API. We'll create a read-write API for accessing information on the users of our project. Any global settings for a REST framework API are kept in a single configuration dictionary named REST_FRAMEWORK. Sta...
The Canny algorithm is a more recent edge detector designed as a signal processing problem. In OpenCV, it outputs a binary image marking the detected edges. Python: import cv2 import sys # Load the image file image = cv2.imread('image.png') # Check if image was loaded improperly and exit i...
import cv2 import numpy as np img = cv2.imread('<your_image>') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cv2.imshow('image', img) cv2.imshow('gray', gray) cv2.waitKey(0) cv2.destroyAllWindows()
django-filter is generic system for filtering Django QuerySets based on user selections. The documentation uses it in a function-based view as a product model: from django.db import models class Product(models.Model): name = models.CharField(max_length=255) price = models.DecimalField(...
We have a table that includes of countries so we create a model that called countrylist model <?php namespace app\models; use Yii; /** * This is the model class for table "countrylist". * * @property integer $id * @property string $iso * @property string $name * @p...
Salesforce Navigator (Google Chrome) Force.com Logins (Google Chrome, Firefox) Salesforce Developer Tool Suite (Google Chrome) Salesforce Lighting Components Inspector (Google Chrome) Salesforce Developer Tool Suite (Google Chrome) Salesforce Schema Builder Expander (Google Chrome) Boostr fo...
The following procedure is a generic one which will be used to log all errors in an application to a common error log table. CREATE OR REPLACE PROCEDURE log_errors ( p_calling_program IN VARCHAR2, p_error_code IN INTEGER, p_error_description IN VARCHAR2 ) IS PRAGMA AUTONOMOUS_TRANSAC...
Atomic types are the building blocks of lock-free data structures and other concurrent types. A memory ordering, representing the strength of the memory barrier, should be specified when accessing/modifying an atomic type. Rust provides 5 memory ordering primitives: Relaxed (the weakest), Acquire (f...
Put the following code in functions.php: function themify_custom_excerpt_length( $length ) { return 50; } add_filter( 'excerpt_length', 'themify_custom_excerpt_length', 999 ); Use 999 as the priority to ensure that the function runs after the default WordPress filter, otherwise it would ov...
To do this, put the following code in functions.php: function custom_excerpt_more($more) { return '<a href="'. get_permalink($post->ID) . '">Read More</a>'; } add_filter('excerpt_more', 'custom_excerpt_more'); The results should look like this:
In our functions.php function new_excerpt_more( $more ) { return '.....'; } add_filter('excerpt_more', 'new_excerpt_more'); We should get this:
Open a new command line or terminal window and create a clean folder for testing. Protractor needs two files to run, a spec file and a configuration file. Let's start with a simple test that navigates to the todo list example in the AngularJS website and adds a new todo item to the list. Copy the...
Use the analytical function row_number(): with t as ( select col1 , col2 , row_number() over (order by col1, col2) rn from table ) select col1 , col2 from t where rn between N and M; -- N and M are both inclusive Oracle 12c handles this more easily with OFFSET and FETCH.
TestNG allows defining groups which can include other groups. MetaGroups logically combine one or more group(s) and control the execution of the @Testmethods belonging to those groups. In below example there are various @Test methods belonging to different group(s). Few are specific to particular s...
Create a new browser bookmark, for example, in Chrome click the star icon at the right in the address bar, make sure the Folder is Bookmarks Bar, and then click the Edit... button: In the edit box that opens paste the following code as the URL: javascript:(function(){var root=(window.location.pa...
If you were to hide a link by setting display: none in the CSS then screen readers wouldn’t find it. Instead, we position it absolutely, with clipping. CSS .offscreen { position: absolute; clip: rect(1px 1px 1px 1px); /* for Internet Explorer */ clip: rect(1px, 1px, 1px, 1px); padding: 0; b...
There are a few way's to install WebSocket's to your project. Here are some example's: npm install --save ws or inside your package.json using: "dependencies": { "ws": "*" },

Page 843 of 1336