Tutorial by Examples: cs

import pandas as pd df = pd.DataFrame(np.random.randn(5, 5), columns=list('ABCDE')) To generate various summary statistics. For numeric values the number of non-NA/null values (count), the mean (mean), the standard deviation std and values known as the five-number summary : min: minimum (smal...
While there are many parameters that can be changed and variations that can be added depending on the desired functionality, this example lays out the basic framework for launching PowerPoint. Note: This code requires that the PowerPoint reference has been added to the active VBA Project. See th...
Spacemacs is a distribution of emacs that comes with a lot of packages preconfigured and easily installed. Also, it is very friendly for those who are familiar with vim style of editing. Spacemacs provides a CIDER-based Clojure layer. To install and configure it for use with Clojure, first install ...
In addition to the default set of directives shipped in core, Vue.js also allows you to register custom directives. Custom directives provide a mechanism for mapping data changes to arbitrary DOM behavior. You can register a global custom directive with the Vue.directive(id, definition) method, pas...
When you request the url yourSite/Home/Index through a browser, the routing module will direct the request to the Index action method of HomeController class. How does it know to send the request to this specific class's specific method ? there comes the RouteTable. Every application has a route ta...
Save with default parameters: df.to_csv(file_name) Write specific columns: df.to_csv(file_name, columns =['col']) Difault delimiter is ',' - to change it: df.to_csv(file_name,sep="|") Write without the header: df.to_csv(file_name, header=False) Write with a given head...
;; package.el is available since emacs 24 (require 'package) ;; Add melpa package source when using package list (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) ;; Load emacs packages and activate them ;; This must come before configurations o...
Prerequisites In order to run Elasticsearch, a Java Runtime Environment (JRE) is required on the machine. Elasticsearch requires Java 7 or higher and recommends Oracle JDK version 1.8.0_73. Install Oracle Java 8 sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update echo "or...
Public Module Usage Public Sub LikeThis() Dim iCount As Integer Dim sCount As String iCount = 245 sCount = iCount.PadLeft(4, "0") Console.WriteLine(sCount) Console.ReadKey() End Sub End Module Public Module Padding <Extension> Pub...
In comparison to regular classes – case classes notation provides several benefits: All constructor arguments are public and can be accessed on initialized objects (normally this is not the case, as demonstrated here): case class Dog1(age: Int) val x = Dog1(18) println(x.age) // 18 (success!...
[^0-9a-zA-Z] This will match all characters that are neither numbers nor letters (alphanumerical characters). If the underscore character _ is also to be negated, the expression can be shortened to: [^\w] Or: \W In the following sentences: Hi, what's up? I can't wait for 2017!...
Dynamic scoping means that variable lookups occur in the scope where a function is called, not where it is defined. $ x=3 $ func1 () { echo "in func1: $x"; } $ func2 () { local x=9; func1; } $ func2 in func1: 9 $ func1 in func1: 3 In a lexically scoped language, func1 would alway...
The type constructor for lists in the Haskell Prelude is []. The type declaration for a list holding values of type Int is written as follows: xs :: [Int] -- or equivalently, but less conveniently, xs :: [] Int Lists in Haskell are homogeneous sequences, which is to say that all elements mus...
Apply will be used when when table valued function in the right expression. create a Department table to hold information about departments. Then create an Employee table which hold information about the employees. Please note, each employee belongs to a department, hence the Employee table has ref...
Creating and configuring Sprite and TextField objects at runtime can be costly if you are creating hundreds of thousands of these on a single frame. Therefore a common trick is "pooling" these objects for later reuse. Remember we are not just trying to optimize the creation time (new Sprit...
Most functions in F# are created with the let syntax: let timesTwo x = x * 2 This defines a function named timesTwo that takes a single parameter x. If you run an interactive F# session (fsharpi on OS X and Linux, fsi.exe on Windows) and paste that function in (and add the ;; that tells fsharpi ...
Date always have a different format, they can be parsed using a specific parse_dates function. This input.csv: 2016 06 10 20:30:00 foo 2016 07 11 19:45:30 bar 2013 10 12 4:30:00 foo Can be parsed like this : mydateparser = lambda x: pd.datetime.strptime(x, "%Y %m %d %H:%M:%S...
Mixins are a flexible way to distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be “mixed” into the component’s own options. // define a mixin object var myMixin = { created: fun...
C++11 NOTE: std::auto_ptr has been deprecated in C++11 and will be removed in C++17. You should only use this if you are forced to use C++03 or earlier and are willing to be careful. It is recommended to move to unique_ptr in combination with std::move to replace std::auto_ptr behavior. Before we ...
Add the following code (known as the "JavaScript tracking snippet") to your site's templates. The code should be added before the closing tag, and the string 'UA-XXXXX-Y' should be replaced with the property ID (also called the "tracking ID") of the Google Analytics property yo...

Page 6 of 24