Tutorial by Examples

Step 1: Creating Custom Error Logging Filter which will write Errors in Text Files According to DateWise. public class ErrorLogger : HandleErrorAttribute { public override void OnException(ExceptionContext filterContext) { string strLogText = ""; Excepti...
SimpleXML is a powerful library which converts XML strings to an easy to use PHP object. The following assumes an XML structure as below. <?xml version="1.0" encoding="UTF-8"?> <document> <book> <bookName>StackOverflow SimpleXML Example&lt...
package main import ( "fmt" "log" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) type Person struct { Name string Phone string } func main() { session, err := mgo.Dial("server1.example....
FormComponent.ts import {Component} from "@angular/core"; import {FormBuilder} from "@angular/forms"; @Component({ selector: 'app-form', templateUrl: './form.component.html', styleUrls: ['./form.component.scss'], providers : [FormBuilder] }) export class FormComp...
Implemented in a router: export const MainRoutes: Route[] = [{ path: '', children: [ { path: 'main', component: MainComponent , canActivate : [CanActivateRoute] }] }]; The canActivateRoute file: @Injectable() export class CanActivateRoute implements CanActi...
service I created post service with postRequest method. import {Injectable} from '@angular/core'; import {Http, Headers, Response} from "@angular/http"; import {PostModel} from "./PostModel"; import 'rxjs/add/operator/map'; import {Observable} from "rxjs"; ...
First lets create basic navbar.html with 3 options. (Home, List , Create) <nav class="navbar navbar-default" role="navigation"> <ul class="nav navbar-nav"> <li> <a id="home-navbar" routerLink="/home">Home</a> ...
run the follows commands at cmd npm install -g protractor webdriver-manager update webdriver-manager start **create protractor.conf.js file in the main app root. very important to decleare useAllAngular2AppRoots: true const config = { baseUrl: 'http://localhost:3000/', s...
;; returns 3 (+ 1 2) ;; returns 300 (+ 50 210 40) ;; returns 2 (/ 8 4)
let url = "https://path-to-media" let request = URLRequest(url: url) let downloadTask = URLSession.shared.downloadTask(with: request) { (location, response, error) in guard let location = location, let response = response, let documentsPath = NSSearchPathForDirectori...
let url = "https://path-to-media" guard let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first, let searchQuery = url.absoluteString.components(separatedBy: "/").last else { return nil } do { let directoryContents = try F...
Detailed instructions on getting kendo-asp.net-mvc set up or installed.
In the IF THEN ELSE statement the result can be either a single statement: DEFINE VARIABLE i AS INTEGER NO-UNDO. IF i = 0 THEN MESSAGE "Zero". ELSE MESSAGE "Something else". Or a block, for instance by adding a DO-block: DEFINE VARIABLE i AS INTEGER NO...
The CASE-statement is a lot more strict than the IF/ELSE-conditional. It can only compare a single variable and only equality, not larget/smaller than etc. DEFINE VARIABLE c AS CHARACTER NO-UNDO. CASE c: WHEN "A" THEN DO: RUN procedureA. END. WHEN "B" ...
IF THEN ELSE can also be used like a function to return a single value. This is a lot like the ternary ?-operator of C. DEFINE VARIABLE i AS INTEGER NO-UNDO. DEFINE VARIABLE c AS CHARACTER NO-UNDO. /* Set c to "low" if i is less than 5 otherwise set it to "high" c...
The DICOM Image file is a tagged image file; the file contains both an image (most of the time) and a collection of data about the image. The data in a DICOM image file is stored as a sequence of individual elements. Each element contains one item of information about the image or the image itself. ...
Installing Heroku Scheduler heroku addons:create scheduler:standard
Tweepy can be installed from its PyPI repository using pip or easy_install: pip install tweepy or easy_install tweepy You can also download the source from GitHub and install it using setup.py: python setup.py install See the tweepy documentation for more.
Here's a basic example of how to do a very simple class system Class = {} local __instance = {__index=Class} -- Metatable for instances function Class.new() local instance = {} setmetatable(instance, __instance) return instance -- equivalent to: return setmetatable({}, __instance)...
Having local Class = {} Class.__meta = {__index=Class} function Class.new() return setmetatable({}, Class.__meta) Assuming we want to change the behavior of a single instance object = Class.new() using a metatable, there are a few mistakes to avoid: setmetatable(object, {__call = table.conca...

Page 1118 of 1336