Tutorial by Examples: at

cljs-time gives us option to add/subtract date-times to other date-times. The date times added subtracted should be in form of days, months, years, hours etc. (require '[clj-time.core :as t]) (def example-date (t/date-time 2016 1 1)) ;; #<DateTime 2016-01-01T00:00:00.000Z> ;; Addition ...
Model: public class User { public int ID { get; set; } public string FirstName { get; set; } public DateTime DateOfBirth { get; set; } } If we want to display the users in different Views, it would be better to create a standardized layout for these users wherever they need...
Factory pattern decouples object creation and allows creation by name using a common interface: class Animal{ public: virtual std::shared_ptr<Animal> clone() const = 0; virtual std::string getname() const = 0; }; class Bear: public Animal{ public: virtual std::shared_ptr...
Display Templates can be used to standardize the layout of an object, so let's now see how we can do the same thing for these objects when editing them. Just like display templates, there's two ways to call editor templates for a given type: Html.EditorFor() Html.EditorForModel() Editor templat...
Sometimes you need to create your own Event, one that other plugins can listen to (Vault, among other plugins, does this) and even cancel. Bukkit's Event API allows this to be possible. All you need to do is make a new class, have it extend Event, add the handlers and the attributes your event needs...
Follow these steps to remove public from the url Copy .htaccess file from /public directory to Laravel/project root folder. Rename the server.php in the Laravel/project root folder to index.php. Cheers you will be good now. Please Note: It is tested on Laravel 4.2, Laravel 5.1, Laravel 5.2, ...
To create our own MessageBox control simply follow the guide below... Open up your instance of Visual Studio (VS 2008/2010/2012/2015/2017) Go to the toolbar at the top and click File -> New Project --> Windows Forms Application --> Give the project a name and then click ok. O...
public FontFamily Maneteke = GetResourceFontFamily(Properties.Resources.manteka);
public static FontFamily GetResourceFontFamily(byte[] fontbytes) { PrivateFontCollection pfc = new PrivateFontCollection(); IntPtr fontMemPointer = Marshal.AllocCoTaskMem(fontbytes.Length); Marshal.Copy(fontbytes, 0, fontMemPointer, fontbytes.Length); pfc.AddMemoryFont(fontMemPo...
The Builder Pattern decouples the creation of the object from the object itself. The main idea behind is that an object does not have to be responsible for its own creation. The correct and valid assembly of a complex object may be a complicated task in itself, so this task can be delegated to anoth...
Use top command to exam CPU time allocation between user space and kernel space. Explanation: 24.8 us (user space): 24.8% of CPU time is spent on user process. 0.5 sy (system): 0.5% of CPU time is spent on kernel space. ni (niceness): the ratio of CPU time spent on low priority processes. i...
Steps to copy heroku database to local database: 1. Run copy process in terminal: heroku pg:pull DATABASE_URL change_to_your_data_base_name --app change_to_your_app_name 2. Change db owner using this query: GRANT ALL PRIVILEGES ON DATABASE change_to_your_data_base_name to change_to_your_user; A...
Disabling calculation of the worksheet can decrease running time of the macro significantly. Moreover, disabling events, screen updating and page breaks would be beneficial. Following Sub can be used in any macro for this purpose. Sub OptimizeVBA(isOn As Boolean) Application.Calculation = IIf(...
You can define the signing configuration to sign the apk in the build.gradle file. You can define: storeFile : the keystore file storePassword: the keystore password keyAlias: a key alias name keyPassword: A key alias password You have to define the signingConfigs block to create a signin...
var a = 11, b = 22; a = a ^ b; b = a ^ b; a = a ^ b; console.log("a = " + a + "; b = " + b);// a is now 22 and b is now 11
We can create dynamic component and get the instances of component into an array and finally rendered it on template. For example, we can can consider two widget component, ChartWidget and PatientWidget which extended the class WidgetComponent that I wanted to add in the container. ChartWidget.ts ...
Postman is an API Development Environment that helps people to build, test, document, monitor and publish documentation for their APIs. The main features of Postman are Sending requests (with support for different authentication schemes, Cookies, certificates, headers, query parameters, request ...
Detailed instructions on getting caliburn.micro set up or installed.
This is especially useful if we have a class that we want to extend in the rule. See example below for a more convenient method. import org.junit.rules.TestRule; import org.junit.runners.model.Statement; public class AwesomeTestRule implements TextRule { @Override public Stateme...
# States are read using the 'state' method, and updated using 'mutate' # when states change they cause re-render of all dependent dom elements class StateExample < Hyperloop::Component state count: 0 # by default states are initialized to nil render do DIV do SPAN { "H...

Page 405 of 442