Tutorial by Examples: e

enum SomeEnum { A, B } let enumValues:Array<string>= []; for(let value in SomeEnum) { if(typeof SomeEnum[value] === 'number') { enumValues.push(value); } } enumValues.forEach(v=> console.log(v)) //A //B
The IsHighResolution property indicates whether the timer is based on a high-resolution performance counter or based on the DateTime class. This field is read-only. // Display the timer frequency and resolution. if (Stopwatch.IsHighResolution) { Console.WriteLine("Operations timed ...
This code requires that you use the PDFlib library for it to function properly. <?php $pdf = pdf_new(); //initialize new object pdf_begin_document($pdf); //create new blank PDF pdf_set_info($pdf, "Author", "John Doe"); //Set info about your PDF pdf_set_info($pd...
The tabular environment is the most basic way to create a table in LaTeX and doesn't require any other packages. \begin{tabular}{|lcr||} left aligned column & center column & right column \\ \hline text & text & text \\ text & text & text \\ \end{tabular} T...
The following C code uses the OpenMP parallel programming model to write the thread ID and number of threads to stdout using multiple threads. #include <omp.h> #include <stdio.h> int main () { #pragma omp parallel { // ID of the thread in the current team ...
HTML <div> Even if this div is too small to display its contents, the content is not clipped. </div> CSS div { width:50px; height:50px; overflow:visible; } Result Content is not clipped and will be rendered outside the content box if it exceeds its co...
DisplayName sets display name for a property, event or public void method having zero (0) arguments. public class Employee { [DisplayName(@"Employee first name")] public string FirstName { get; set; } } Simple usage example in XAML application <Window x:Class="WpfA...
EditableAttribute sets whether users should be able to change the value of the class property. public class Employee { [Editable(false)] public string FirstName { get; set; } } Simple usage example in XAML application <Window x:Class="WpfApplication.MainWindow" ...
First of all we need to add SQLite support to our application. There are two ways of doing that Download DLL suiting your system from SQLite download page and then add to the project manually Add SQLite dependency via NuGet We'll do it the second way First open the NuGet menu and search f...
You can use a method annotated with @testSetup to write code that will have been executed before each test run: public class AccountService { public static Account fetchAccount() { return [ SELECT Id, Name FROM Account LIMIT 1 ]; } } @isTest public class AccountServiceTest { priv...
using (SQLiteConnection conn = new SQLiteConnection(@"Data Source=data.db;Pooling=true;FailIfMissing=false")) { conn.Open(); using (SQLiteCommand cmd = new SQLiteCommand(conn)) { cmd.CommandText = "query"; using (SqlDataReader dr = cmd.ExecuteReade...
The two mapAccum functions combine the operations of folding and mapping. -- A Traversable structure -- | -- A seed value | ...
Although GameplayKit (which is introduced with iOS 9 SDK) is about implementing game logic, it could also be used to generate random numbers, which is very useful in apps and games. Beside the GKRandomSource.sharedRandom which is used in the following chapters there are three additional types of GK...
A model can also be added to the partial view : @model Solution.Project.Namespace.MyModelClass <p>@Model.Property</p> In the View you can now just use: <div> @Html.Partial("PartialViewExample", new MyModelClass(){Property="my property value"}) <...
Charts can be created by working directly with the Series object that defines the chart data. In order to get to the Series without an exisitng chart, you create a ChartObject on a given Worksheet and then get the Chart object from it. The upside of working with the Series object is that you can s...
The starting point for the vast majority of charting code is to create an empty Chart. Note that this Chart is subject to the default chart template that is active and may not actually be empty (if the template has been modified). The key to the ChartObject is determining its location. The syntax...
For complete control over a new Chart and Series object (especially for a dynamic Series name), you must resort to modifying the SERIES formula directly. The process to set up the Range objects is straightforward and the main hurdle is simply the string building for the SERIES formula. The SERIES ...
If a type t is Traversable then values of t a can be split into two pieces: their "shape" and their "contents": data Traversed t a = Traversed { shape :: t (), contents :: [a] } where the "contents" are the same as what you'd "visit" using a Foldable insta...
pyquery is a jquery-like library for python. It has very well support for css selectors. from pyquery import PyQuery html = """ <h1>Sales</h1> <table id="table"> <tr> <td>Lorem</td> <td>46</td> </tr> &l...
Please note that continued use of Sublime Text requires that you purchase a license and you are asked to note the terms and conditions. The process of installing Sublime Text is different for each platform, but in each case you need to visit the download page. After installing ST3, it is common to...

Page 601 of 1191