Tutorial by Examples: 1

It is obvious to assume that the percentage value of margin to margin-left and margin-right would be relative to its parent element. .parent { width : 500px; height: 300px; } .child { width : 100px; height: 100px; margin-left: 10%; /* (parentWidth * 10/100) => 50px ...
// 1. Base example not using language support for covariance, dynamic type checking. class Top { public: virtual Top* clone() const = 0; virtual ~Top() = default; // Necessary for `delete` via Top*. }; class D : public Top { public: Top* clone() const override ...
In order to get the official I18N Plugin into your CLI Project we need to install it by following the next steps. First you want to install the plugin via npm: npm install aurelia-i18n Since Aurelia-I18N is backed by i18next, you should install it and a backend plugin of your choice. As an exampl...
The summation 1/1 + 1/2 + 1/3 + 1/4 + ... + 1/n is equal to the nth harmonic number, denoted Hn. The nth harmonic number obeys the inequalities ln (n + 1) ≤ Hn ≤ (ln n) + 1 and therefore Hn = Θ(log n). The harmonic numbers often arise in the analysis of algorithms, with randomized quicks...
The summation 1/1 + 1/4 + 1/9 + 1/16 + ... out to infinity converges to π2 / 6, and therefore any summation of the form 1/1 + 1/4 + 1/9 + 1/16 + ... + 1/n2 is Θ(1).
You can use a filter to log only messages "lower" than e.g. ERROR level. But the filter is not supported by PropertyConfigurator. So you must change to XML config to use it. See log4j-Wiki about filters. Example "specific level" <appender name="info-out" class=&quo...
Open Android Studio Open Your Project Click on Gradle (From Right Side Panel, you will see Gradle Bar) Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project) Click on Your Project (Your Project Name form List (root)) Click on Tasks Click on andr...
Scoped enumerations: ... enum class Status; // Forward declaration Status doWork(); // Use the forward declaration ... enum class Status { Invalid, Success, Fail }; Status doWork() // Full declaration required for implementation { return Status::Success; } Unscoped enumerations:...
Include using System.Numerics and add a reference to System.Numerics to the project. using System; using System.Numerics; namespace Euler_25 { class Program { static void Main(string[] args) { BigInteger l1 = 1; BigInteger l2 = 1; ...
Sometimes it can be useful to test your Powershell data files and iterate through the nodes and servers. Powershell 5 (WMF5) added this neat little feature for doing this called Import-PowerShellDataFile . Example: $data = Import-PowerShellDataFile -path .\MydataFile.psd1 $data.AllNodes
Use vectors to calculate incremental [x,y] from [startX,startY] to [endX,endY] // dx is the total distance to move in the X direction var dx = endX - startX; // dy is the total distance to move in the Y direction var dy = endY - startY; // use a pct (percentage) to travel the total distance...
HTML: <div ng-app="myApp" ng-controller="Controller"> <some-chart data="data"></some-chart> </div> Javascript: angular.module('myApp', []) .directive('someChart', function() { return { restrict: 'E', scope: {dat...
Suppose that you have the following text file: jekyll_hyde.txt How do we convert it to a PDF that looks like this: Note the page numbers at the bottom of each page. These are added using an IEventHandler implementation: protected class Footer implements IEventHandler { @Override pub...
Suppose that we wanted to create a simple Hello World document: In iText 7, we could do that like this: public void createPdf(String dest) throws IOException { PdfDocument pdf = new PdfDocument(new PdfWriter(dest)); Document document = new Document(pdf); document.add(new Paragraph...
In the .bashrc or .bash_profile, adding: export MYSQL_PS1="\u@\h [\d]>" make the MySQL client PROMPT show current user@host [database].
def get_autocomplete(text): query = """ start n = node(*) where n.name =~ '(?i)%s.*' return n.name,labels(n) limit 10; """ query = query % (text) obj = [] for res in graph.cypher.execute(query): # print res[0],res[1] obj.a...
Log on to the Azure classic portal. In the left navigation pane of the portal, click Service Bus. In the lower pane of the portal, click Create. In the Add a new namespace dialog, enter a namespace name. The system immediately checks to see if the name is available. After...
1. Install GLFW First step is to create an OpenGL window. GLFW is an Open Source, multi-platform library for creating windows with OpenGL, to install GLFW first download its files from www.glfw.org Extract the GLFW folder and its contents will look like this Download and install CMake to buil...
Use the analytical function row_number(): with t as ( select col1 , col2 , row_number() over (order by col1, col2) rn from table ) select col1 , col2 from t where rn between N and M; -- N and M are both inclusive Oracle 12c handles this more easily with OFFSET and FETCH.
invoke("", somePrivateMethodName, {argument1='one'});

Page 7 of 16