Tutorial by Examples: c

class Node(object): def __init__(self, val): self.l_child = None self.r_child = None self.val = val class BinarySearchTree(object): def insert(self, root, node): if root is None: return node if root.val < node.val: ...
Comparisons are functions in clojure. What that means in (2>1) is (> 2 1) in clojure. Here are all the comparison operators in clojure. Greater Than (> 2 1) ;; true (> 1 2) ;; false Less Than (< 2 1) ;; false Greater Than or Equal To (>= 2 1) ;; true (>= 2 ...
Below is a non-tail-recursive function to compute the sum of a list of integers. let rec sum = function | [] -> 0 | h::t -> h + (sum t) The last operation the function performs is the addition. Thus, the function isn't tail-recursive. Below is a tail-recursive version of the same fu...
An example configuration for a hub: java -jar selenium-server-standalone-<version>.jar -role hub -hubConfig hubConfig.json { "_comment" : "Configuration for Hub - hubConfig.json", "host": ip, "maxSessions": 5, "port": 4444...
The advantage of using vim over a simple text editor like notepad or gedit is that it allows the user to customize it's almost everything about itself. If you ever find yourself doing some kind of action over and over again, vim has a multitude of features that will help you do this action faster a...
The easiest way to get up and running with vue-router is to use the version provided via CDN. HTML: <script src="https://unpkg.com/vue/dist/vue.js"></script> <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script> <div id="rou...
For this example, let model be a Keras model for classifying video inputs, let X be a large data set of video inputs, with a shape of (samples, frames, channels, rows, columns), and let Y be the corresponding data set of one-hot encoded labels, with a shape of (samples, classes). Both datasets are s...
To create a customization package replacing images on the login page, follow the steps below on your local Acumatica instance: Create a new folder in the Acumatica instance folder. For this example I added a folder called IconsCustomized in my local LoginImages instance: Add your custom ...
Using yield break as opposed to break might not be as obvious as one may think. There are lot of bad examples on the Internet where the usage of the two is interchangeable and doesn't really demonstrate the difference. The confusing part is that both of the keywords (or key phrases) make sense only...
For this example, let's assume that the inputs have a dimensionality of (frames, channels, rows, columns), and the outputs have a dimensionality of (classes). from keras.applications.vgg16 import VGG16 from keras.models import Model from keras.layers import Dense, Input from keras.layers.pooling...
Creating app project When creating an Android app ready for the app store it's important when using ionic start that we add --appname|-a and --id|-i flags which is used for google play to identify your app from other apps. If you're starting a new mobile app project you can use the cli example b...
using System; using System.Collections.Generic; using System.Linq; using DocumentFormat.OpenXml; using A = DocumentFormat.OpenXml.Drawing; using DW = DocumentFormat.OpenXml.Drawing.Wordprocessing; using PIC = DocumentFormat.OpenXml.Drawing.Pictures; using DocumentFormat.OpenXml.Drawing.Wordpr...
Now open the document using OpenXML, you must add an imagePart that references the picture object to the MainDocumentPart object by using a file stream, and get the ID of the image string temp; MainDocumentPart mainPart = document.MainDocumentPart; ImagePart ima...
In office OpenXML, a picture that is inserted into a word document is considered a "Blip" Object or element. The class is derived from the DocumentFormat.OpenXml.Drawing the Blip must have an Embed value that is an imagePart ID. The Blip object then goes inside a BlipFill Object/element, a...
Now you have a reference of the image. Insert the image into the shapes in the template document. To do this, you will have to use some LINQ to iterate through the document and get a reference to all the shapes in the document. The wps:spPr element you see in the above XML code is the xml element fo...
Now that you have a collection of all the shape references in the document. Loop through the collection with a foreach, and through each iteration create a Blip object. Set the Blip object embed value to the picture ID reference you captured earlier from the image part. Also create a Stretch object...
rails new my_app cd my_app Gemfile gem 'friendly_id', '~> 5.1.0' # Note: You MUST use 5.0.0 or greater for Rails 4.0+ rails generate friendly_id rails generate scaffold user name:string slug:string:uniq rake db:migrate edit app/models/user.rb class User < ApplicationRecord exten...
For a class-less React component: function SomeComponent(props){ const ITEMS = ['cat', 'dog', 'rat'] function getItemsList(){ return ITEMS.map(item => <li key={item}>{item}</i>); } return ( <ul> {getItemsList()} ...
Getting started with Ext JS 6. Prerequisite steps: Download Sencha Cmd 6 and install it with sencha command set in environment path variables. Download trail version of Sencha SDK (ext-6.2.1.zip) and unzip it.(on location D:\ext-6.2.1) System is ready to create Extjs 6 application. Create ...
Since you need to sort & rename the fields, the best option will be the Sort Component in the Data Flow task (like you mentioned) . If you only want to rename columns, then use the "Derived Column" component. The Sort component should look as follows: In my example, you can see the ...

Page 751 of 826