Tutorial by Examples: an

std::ends - inserts a null character '\0' to output stream. More formally this manipulator's declaration looks like template <class charT, class traits> std::basic_ostream<charT, traits>& ends(std::basic_ostream<charT, traits>& os); and this manipulator places charact...
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...
Here can be found the most comprehensive math library that emulates pen and paper calculations and allows working with bigger numbers. Here are another examples of pen and paper emulations: ADD , Comparison , Multiply Some math functions implementations can be found here.
#include <opencv2/opencv.hpp> #include using namespace cv; using namespace std; int main(int argc, char** argv) { Mat image; image = imread("C:\Users\Development\Documents\Visual Studio 2013\Projects\ImageIn.bmp", CV_LOAD_IMAGE_GRAYSCALE); // Read the file if (!image.data)...
Following example will help to give equal space to an item in GridLayout. ItemOffsetDecoration.java public class ItemOffsetDecoration extends RecyclerView.ItemDecoration { private int mItemOffset; private int spanCount = 2; public ItemOffsetDecoration(int itemOffset) { ...
This example will help to have the Edit text with the icon at the right side. Note: In this just I am using setCompoundDrawablesWithIntrinsicBounds, So if you want to change the icon position you can achieve that using setCompoundDrawablesWithIntrinsicBounds in setIcon. public class MKEditTe...
Here we can find some useful method using PackageManager, Below method will help to get the app name using package name private String getAppNameFromPackage(String packageName, Context context) { Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATE...
Docs: 1.x -> 2.x upgrade guide, registering an element, shared style modules. <link rel="import" href="bower_components/polymer/polymer-element.html"> <dom-module id="element-name"> <template> <!-- Use one of these style declaration...
Docs: extending elements, inherited templates. Instead of Polymer.Element, a custom element can extend a different element: class ParentElement extends Polymer.Element { /* ... */ } class ChildElement extends ParentElement { /* ... */ } To change or add to the parent's template, over...
Using the POWERSHELL command, we can execute a 1-line command directly from a batch script, without any temporary file. Here's the syntax. powershell.exe -Command <yourPowershellCommandHere> You may also want to include other flags, like -Nologo to improve the actual outcome.
While adding the beamerposter package, provide the required parameters. \usepackage[orientation=landscape,size=a1]{beamerposter} You can also customize the size of the poster. \usepackage[orientation=portrait,size=custom,height=110,width=80,scale=1.4]{beamerposter} The height and width dimension...
Listing services systemctl To list running services systemctl --failed To list failed services Managing Targets (Similar to Runlevels in SysV) systemctl get-default To find the default target for your system systemctl set-default <target-name> To set the default target for your syst...
\documentclass[12pt]{article} \usepackage{titleps} \usepackage{fancyhdr} \usepackage{graphicx} \usepackage{lipsum} % for dummy text \pagestyle{myheadings} \pagestyle{fancy} \fancyhf{} \setlength{\headheight}{30pt} \renewcommand{\headrulewidth}{4pt} \renewcommand{\footrulewidth}{2pt...
#include opencv2/opencv.hpp> #include vector> using namespace std; using namespace cv; int main() { Mat3b img = imread("test.jpg"); imshow("Original", img); // Cluster int K = 8; int n = img.rows * img.cols; Mat data = img.reshape(1, n); data.convertTo(data, CV_32F); ...
To create a NSUserActivity object, your app must declare the types of activities it supports in its Info.plist file. Supported activities are defined by your application and should be unique. An activity is defined using a reverse-domain style naming scheme (i.e. "com.companyName.productName.ac...
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 static void main( String[] args ) throws IOException { // good idea to print the version number, 1.2.0 as of this writing System.out.println(TensorFlow.version()); final int NUM_PREDICTIONS = 1; // load the model Bundle try (SavedModelBundle b = SavedModelB...
Like list, simplest function over iolist and bitstring is: -spec loop(iolist()) -> ok | {ok, iolist} . loop(<<>>) -> ok; loop(<<Head, Tail/bitstring>>) -> loop(Tail); loop(<<Rest/bitstring>>) -> {ok, Rest} You can call it like this: lo...
Recursive function use their states to loop. When you spawn new process, this process will be simply a loop with some defined state.
Here 2 examples of recursive anonymous functions based on previous example. Firstly, simple infinite loop: InfiniteLoop = fun R() -> R() end. Secondly, anonymous function doing loop over list: LoopOverList = fun R([]) -> ok; R([H|T]) -> R(T) end. These two func...

Page 299 of 307