Tutorial by Examples: l

# encode/decode UTF-8 for files and standard input/output use open qw( :encoding(UTF-8) :std ); This pragma changes the default mode of reading and writing text ( files, standard input, standard output, and standard error ) to UTF-8, which is typically what you want when writing new application...
#include <iostream> #include <vector> #include <string> #include <boost/algorithm/string.hpp> using namespace std; int main() { // String to split string str = "You're supposed to see this!|NOT THIS!!!!!!"; // Line container vec...
boost::replace_all(): #include <iostream> #include <string> #include <boost/algorithm/string.hpp> using namespace std; int main() { // String to replace characters in string str = "Darn you, Darn you to the 5th power!!!"; // Replace "Da...
Detailed instructions on getting networking set up or installed.
// Create the request. NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]]; // Specify that it will be a POST request request.HTTPMethod = @"POST"; // This is how we set header fields [request setValue:@&...
// Create the request. NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]]; // Specify that it will be a POST request request.HTTPMethod = @"POST"; // Setting a timeout request.timeoutInterval = 20.0; //...
So you want to add material design to your business or career portfolio.huh? You Just can not resist using a Modal? which pops upon a click on those crisp cards you intend to design, for each of your projects/products! Let us say, for each project, you have done, or for each product you have design...
Note I assume you know Webcomponent Specifications Polymer from Google What if, we could just have one custom element, say <tool-bar></tool-bar> and it magically did everything that messy Modal markup could? Tempting eh! How do you specify which Modal belongs to which project...
So far, we defined how easy it is to write a custom element that hides the messy html behind it and gives the user, an easy to write and brief markup. Time to code it! Our custom element, to display the bar below the hero image should Accept a Link to be shared Accept a Link to the Repo to be ...
<link rel="import" href="../bower_components/iron-icon/iron-icon.html"> <link rel="import" href="../bower_components/iron-icons/iron-icons.html"> <link rel="import" href="../bower_components/iron-icons/social-icons.html"&gt...
On whichever page you want to display your product / project portfolio, invoke the custom element like so: <article id="project-neighbourhood"> <div class="row"> <div class="col-12 hero"> <img src="path-to-hero-image...
Empty string Empty string is not null but has zero length: string emptyString = ""; // an empty string is not null... assert(emptyString !is null); // ... but it has zero lenght assert(emptyString.length == 0); Null string string nullString = null; a null string is null (De ...
Catching exceptions in Kotlin looks very similar to Java try { doSomething() } catch(e: MyException) { handle(e) } finally { cleanup() } You can also catch multiple exceptions try { doSomething() } catch(e: FileSystemException) { handle(e) } catch(e: Network...
IF you are using simple categories, with each physics body belonging to only one category, then this alternative form of didBeginContact may be more readable: func didBeginContact(contact: SKPhysicsContact) { let contactMask = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask ...
Here is a simple Sprite-Kit GameScene.swift. Create a new, empty SpriteKit project and replace the GameScene.swift with this. Then build and run. Click on any of the objects on screen to give make them move. Check the logs and the comments to see which ones collide and which ones make contact. // ...
If the tables use InnoDB, MySQL automatically uses row level locking so that multiple transactions can use same table simultaneously for read and write, without making each other wait. If two transactions trying to modify the same row and both uses row level locking, one of the transactions waits f...
Bubble sort is also known as Sinking Sort. It is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. Bubble sort example Implementation of Bubble Sort I used C# language to implement ...
Fetching or loading data can be primarily classified into two types: eager and lazy. In order to use Hibernate make sure you add the latest version of it to the dependencies section of your pom.xml file: <dependency> <groupId>org.hibernate</groupId> <artifactId>hi...
The Problem: Given a set of items where each item contains a weight and value, determine the number of each to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. Pseudo code for Knapsack Problem Given: Values(arr...
Cycle Sort is sorting algorithm which uses comparison sort that is theoretically optimal in terms of the total number of writes to original array, unlike any other in-place sorting algorithm. Cycle sort is unstable sorting algorithm. It is based on idea of permutation in which permutations are facto...

Page 612 of 861