Tutorial by Examples

The first program one typically writes in any language is the "hello world" script. This example demonstrates how to write this program and debug it using Visual Studio Code (I'll refer to Visual Studio Code as VS Code from now on). Create The Project Step 1 will be to create a new proje...
This example introduces you to the basic functionality of VS Code by demonstrating how to write a "hello world" program in C++. Before continuing, make sure you have the "ms-vscode.cpptools" extension installed. Initialize the Project The first step is to create a new project. ...
Let's assume you got an html after selecting with soup.find('div', class_='base class'): from bs4 import BeautifulSoup soup = BeautifulSoup(SomePage, 'lxml') html = soup.find('div', class_='base class') print(html) <div class="base class"> <div>Sample text 1</div...
String myStr = convert("Lê Minh Thoại là người Việt Nam"); converted: "Le Minh Thoai la nguoi Viet Nam"
public static String convert(String str) { str = str.replaceAll("à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ", "a"); str = str.replaceAll("è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ", "e"); str = str.replaceAll("ì|í|ị|ỉ|ĩ", "i"); str = str.replaceAl...
First, Lets create a dummy dataframe We assume that a customer can have n orders, an order can have m items, and items can be ordered more multiple times orders_df = pd.DataFrame() orders_df['customer_id'] = [1,1,1,1,1,2,2,3,3,3,3,3] orders_df['order_id'] = [1,1,1,2,2,3,3,4,5,6,6,6] orders_df['...
Using transform functions that return sub-calculations per group In the previous example, we had one result per client. However, functions returning different values for the group can also be applied. # Create a dummy dataframe orders_df = pd.DataFrame() orders_df['customer_id'] = [1,1,1,1,1,2,...
[-1, 0, 2, 4, 7, 9].where((x) => x > 2) --> [4, 7, 9]
On every generated model classes there are no documentation comments added by default. If you want to use XML documentation comments for every generated entity classes, find this part inside [modelname].tt (modelname is current EDMX file name): foreach (var entity in typeMapper.GetItemsToGenerate&l...
Swift: mapView.showAnnotations(mapView.annotations, animated: true) Objective-C: [mapView showAnnotations:mapView.annotations animated:YES]; Demo:
#include "cuda_runtime.h" #include "device_launch_parameters.h" #include "cuda.h" #include <device_functions.h> #include <cuda_runtime_api.h> #include<stdio.h> #include <cmath> #include<stdlib.h> #include<iostream> #include...
Let's consider situation when you parse number of pages and you want to collect value from element that's optional (can be presented on one page and can be absent on another) for a paticular page. Moreover the element itself, for example, is the most ordinary element on page, in other words no spec...
The npm scripts are commands that npm will run for you when called with the proper arguments. The power and sense of this is to NOT install the npm packages globally poluting your environment. The difference between pre-recognized and custom scripts relies on the run word between the tags, custom s...
Catch is a header only library that allows you to use both TDD and BDD unit test style. The following snippet is from the Catch documentation page at this link: SCENARIO( "vectors can be sized and resized", "[vector]" ) { GIVEN( "A vector with some items" ) { std::vector v( 5 ); ...
import tensorflow as tf FLAGS = None def main(_): ps_hosts = FLAGS.ps_hosts.split(",") worker_hosts = FLAGS.worker_hosts.split(",") # Create a cluster from the parameter server and worker hosts. cluster = tf.train.ClusterSpec({"ps": ps_hosts,...
// this sets the configuration option for your environment ini_set('display_errors', '1'); //-1 will allow all errors to be reported error_reporting(-1);
Using Line Numbers ... and documenting them in case of error ("The importance of seeing Erl") Detecting which line raises an error is a substantial part of any debugging and narrows the search for the cause. To document identified error lines with a short description completes a successf...
Detailed instructions on getting cron set up or installed.
Detailed instructions on getting openstreetmap set up or installed.
Edit crontab using command crontab -e Add this line to the end of file. * * * * * /fullpath/mycron Exit Verify by command crontab -l

Page 1335 of 1336