Tutorial by Examples: cs

We have to create a view which will have a image prefix to a text. text could be of variable length.We have to achieve a result where in Image + text is always in center of a parent view. Step 1: First create a single view project and name it something of your choice and open the story board fist...
In case your project needs to be based on a specific Symfony version, use the optional second argument of the new command: # use the most recent version in any Symfony branch $ symfony new my_project_name 2.8 $ symfony new my_project_name 3.1 # use a specific Symfony version $ symfony new my_...
Consider this simple example: import QtQuick 2.7 import QtQuick.Controls 2.0 ApplicationWindow { visible: true width: 400 height: 640 Rectangle{ id: rect anchors.centerIn: parent height: 100 width: parent.width color: "blue...
If you're ever dealing with C Binary API's from Perl Code, via the syscall, ioctl, or fcntl functions, you need to know how to construct memory in a C Compatible way. For instance, if you were ever dealing with some function that expected a timespec, you'd look into /usr/include/time.h and find: s...
Large Multi-Line strings are burdensome to write. my $variable = <<'EOF'; this block of text is interpreted literally, no \'quotes matter, they're just text only the trailing left-aligned EOF matters. EOF NB: Make sure you ignore stack-overflows syntax highlighter: It is very wrong. A...
import pandas as pd import io temp=u"""index; header1; header2; header3 1; str_data; 12; 1.4 3; str_data; 22; 42.33 4; str_data; 2; 3.44 2; str_data; 43; 43.34 7; str_data; 25; 23.32""" #after testing replace io.StringIO(temp) to filename df = pd.read_csv(io....
Required modules npm install --save-dev webpack extract-text-webpack-plugin file-loader css-loader style-loader Folder structure . └── assets    ├── css     ├── images    └── js webpack.config.js const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webp...
With the shape-outside CSS property one can define shape values for the float area so that the inline content wraps around the shape instead of the float's box. CSS img:nth-of-type(1) { shape-outside: circle(80px at 50% 50%); float: left; width: 200px; } img:nth-of-type(2) { shape-ou...
While it might seem counterintuitive, you can use logical operators to determine whether or not a statement is run. For instance: File.exist?(filename) or STDERR.puts "#{filename} does not exist!" This will check to see if the file exists and only print the error message if it doesn't....
Descriptive statistics (mean, standard deviation, number of observations, minimum, maximum, and quartiles) of numerical columns can be calculated using the .describe() method, which returns a pandas dataframe of descriptive statistics. In [1]: df = pd.DataFrame({'A': [1, 2, 1, 4, 3, 5, 2, 3, 4, 1],...
Move semantics are a way of moving one object to another in C++. For this, we empty the old object and place everything it had in the new object. For this, we must understand what an rvalue reference is. An rvalue reference (T&& where T is the object type) is not much different than a norma...
Simple constraint: interface IRunnable { run(): void; } interface IRunner<T extends IRunnable> { runSafe(runnable: T): void; } More complex constraint: interface IRunnble<U> { run(): U; } interface IRunner<T extends IRunnable<U>, U> { runSafe...
If you are familiar with jQuery and Sizzle syntax, d3 selections should not be much different. d3 mimics the W3C Selectors API to make interacting with elements easier. For a basic example, to select all <p> and add a change to each of them: d3.selectAll('p') .attr('class','textClass') ...
Just as in Sass, SCSS variables are used to store a value which will be used multiple times throughout a SCSS document. Variables are mostly used to store frequently-used property values (such as fonts and colors), but can be used for any value of any property. SCSS uses the $ symbol to declare a ...
The bind attribute can also be applied to derived types: geese.h struct Goose { int flock; float buoyancy; } struct Goose goose_c; geese.f90 use, intrinsic :: iso_c_binding, only : c_int, c_float type, bind(C) :: goose_t integer(c_int) :: flock real(c_float) :: buoyancy e...
Vector based graphics are represented by a plethora of data that must be computed by the CPU (vector points, arcs, colors, etc). Anything other than simple shapes with minimal points and straight lines will consume vast amounts of CPU resource. There is a "Cache as Bitmap" flag that can b...
vim is a modal editor. This means that at any time inside a vim session, the user is going to be in one of the modes of operation. Each one of offers a different set commands, operations, key bindings... Normal mode (or Command mode) The mode vim starts in. From other modes, usually accessible ...
name:john Searches for a single term (joe) in a single field (name)
To convert NSString to const char use -[NSString UTF8String]: NSString *myNSString = @"Some string"; const char *cString = [myNSString UTF8String]; You could also use -[NSString cStringUsingEncoding:] if your string is encoded with something other than UTF-8. For the reverse path use...
This is the most basic version of a trait in Scala. trait Identifiable { def getIdentifier: String def printIndentification(): Unit = println(getIdentifier) } case class Puppy(id: String, name: String) extends Identifiable { def getIdentifier: String = s"$name has id $id" } ...

Page 5 of 24