Tutorial by Examples: am

std::ws - consumes leading whitespaces in input stream. It different from std::skipws. #include <sstream> ... std::string str; std::istringstream(" \v\n\r\t Wow!There is no whitespaces!") >> std::ws >> str; std::cout << str; // Output: Wow!There is n...
The same URl for different http methods acts differently. Below is a table depicting the same. HTTP VERBURLDESCRIPTIONGET/api/studentsReturns all studentsGET/api/students/5Returns details of Student Id =5POST/api/studentsAdd a new studentPUT/api/students/5Update student with Id=5DELETE/api/students...
For example: FOR SAVING: NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; // saving an NSString [prefs setObject:txtUsername.text forKey:@"userName"]; [prefs setObject:txtPassword.text forKey:@"password"]; [prefs synchronize]; FOR RETRIEVING ...
In landscape orientation \documentclass[final,t]{beamer} \mode<presentation> { \usetheme{Berlin} } \usepackage[orientation=landscape,size=a1,scale=1,debug]{beamerposter} \usepackage{lipsum} % for dummy text \title[]{\huge Awesome title} \author[]{\large \textbf{Author Name...
\documentclass[final,t]{beamer} \mode<presentation> { \usetheme{Berlin} } \usepackage[orientation=landscape,size=a1,scale=1,debug]{beamerposter} \usepackage{lipsum} % for dummy text \usepackage{graphicx} % for dummy image \usepackage{tikz} % for tikzpicture \usepackage{pgfplot...
Docs: mixins, hybrid elements. Defining a class expression mixin to share implementation between different elements: <script> MyMixin = function(superClass) { return class extends superClass { // Code that you want common to elements. // If you're going to override a...
import tensorflow as tf # good idea tf.reset_default_graph() # DO MODEL STUFF # Pretrained weighting of 2.0 W = tf.get_variable('w', shape=[], initializer=tf.constant(2.0), dtype=tf.float32) # Model input x x = tf.placeholder(tf.float32, name='x') # Model output y = W*x y = tf.multiply(W,...
public enum BookCode { _10A("Simon Haykin", "Communication System"), _42B("Stefan Hakins", "A Brief History of Time"), E1("Sedra Smith", "Electronics Circuits"); private String author; private String title; ...
The tokio-signal crate provides a tokio-based solution for handling signals. It's still in it's early stages though. extern crate futures; extern crate tokio_core; extern crate tokio_signal; use futures::{Future, Stream}; use tokio_core::reactor::Core use tokio_signal::unix::{self as unix_si...
A simple example would be for a library management application; you would have 2 models, for example, student and book in models.py: from django.db import models class student(models.Model): roll_no = models.IntegerField(primary_key=True) first_name = models.CharField(max_length=30) ...
import pip command = 'install' parameter = 'selenium' second_param = 'numpy' # You can give as many package names as needed switch = '--upgrade' pip.main([command, parameter, second_param, switch]) Only needed parameters are obligatory, so both pip.main(['freeze']) and pip.main(['freeze'...
Interfacing of DS18B20 with Raspberry pi Connection of DS18B20 with Raspberry pi You can see there are three terminal Vcc Gnd Data (One wire protocol) R1 is 4.7k ohm resistance for pulling up the voltage level Vcc should be connected to any of the 5v or 3.3v pins of Raspberry pi (PI...
Code Block TypeGlobal NamespaceLocal NamespaceModulen.s. for the modulesame as globalScript (file or command)n.s. for __main__same as globalInteractive commandn.s. for __main__same as globalClass definitionglobal n.s. of containing blocknew namespaceFunction bodyglobal n.s. of containing blocknew na...
Prerequisites: Setting up the Development Environment Before we get started, we have to setup our environment. Install Node.js and npm if they are not already on your machine. Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console wi...
if object_id('tempdb.dbo.#temp') is not null drop table #temp create table #temp ( dateValue datetime, category varchar(3), amount decimal(36,2) ) insert into #temp values ('1/1/2012', 'ABC', 1000.00) insert into #temp values ('2/1/2012', 'DEF', 500.00) insert into #temp value...
Example shows 5 items per row: <div *ngFor="let item of items; let i = index"> <div *ngIf="i % 5 == 0" class="row"> {{ item }} <div *ngIf="i + 1 < items.length">{{ items[i + 1] }}</div> <div *ngIf="i + 2 &l...
The service describes the operations it performs in a service contract that it exposes publicly as metadata. // Define a service contract. [ServiceContract(Namespace="http://StackOverflow.ServiceModel.Samples")] public interface ICalculator { [OperationContract] dou...
This sample demonstrates the use of AD B2C for securing an AngularJS based web and mobile app. Refer https://github.com/NewtonJoshua/Azure-ADB2C-Angularjs-sample Azure AD B2C Azure AD B2C is a cloud identity management solution for your web and mobile applications. It is a highly available global...
The problem with type arguments being implicit becomes obvious once we have more than one. Which order do they come in? const :: a -> b -> a Does writing const @Int mean a is equal to Int, or is it b? In case we explicitly state the type parameters using a forall like const :: forall a b....
Say you're introducing a class of types that have a size in bytes. class SizeOf a where sizeOf :: a -> Int The problem is that the size should be constant for every value of that type. We don't actually want the sizeOf function to depend on a, but only on it's type. Without type applica...

Page 126 of 129