Tutorial by Examples

Node.js is a Javascript engine (Google's V8 engine for Chrome, written in C++) that allows to run Javascript outside the browser. While numerous libraries are available for extending Node's functionalities, the engine comes with a set of core modules implementing basic functionalities. There's curr...
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...
#include <mutex> #include <condition_variable> class Semaphore { public: Semaphore (int count_ = 0) : count(count_) { } inline void notify( int tid ) { std::unique_lock<std::mutex> lock(mtx); count++; cout <...
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, ...
So first we will create rails project and setup device create a rails application rails new devise_example now add devise to gem list you can find a file named 'Gemfile' at the root of rails project Then run bundle install Next, you need to run the generator: rails generate devise:insta...
What is it? BuildTools.jar is a solution to building Bukkit, CraftBukkit, Spigot, and the Spigot-API. All of which is done on your computer! A few prerequisite programs are necessary, but the instructions below will guide you through everything you need to do. Prerequisites There are two applicat...
If you have a lot of commands, you shouldn't put them all in the main class. Make a new class and have it implement CommandExecutor Add the following to the class: @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { } In your...
MultiTrigger is not needed frequently but there are some situations where it is very handy. MultiTrigger behaves similarly to Trigger or DataTrigger but it has multiple conditions. All the conditions must be true for a Setters to fire. Here is a simple example: <!-- Text field needs to be initia...
The following function adds four threads. Three threads compete for the semaphore, which is set to a count of one. A slower thread calls notify_one(), allowing one of the waiting threads to proceed. The result is that s1 immediately starts spinning, causing the Semaphore's usage count to remain be...
Installing lxml is very easy, had become an easy jobs since Python 2.7.9 (because it comes with an utility which helps developers to download install dependency in an easy manner like Maven for Java) at first you have to run the command then start coding. pip install lxml The second way is to in...
Introduction Julia uses the following syntax for dictionaries: Dict({k₁ => v₁, k₂ => v₂, …, kₙ₋₁ => vₙ₋₁, kₙ => vₙ) While Python and JSON looks like this: {k₁: v₁, k₂: v₂, …, kₙ₋₁: vₙ₋₁, kₙ: vₙ} For illustrative purposes we could also use this syntax in Julia and add new seman...
For loops can be really useful in TWIG, allowing the creation of data-dynamic web pages. Say we create a simple array of numbers: {% set array = "3,1,2" %} We can then iterate over the array and print out whatever we want. Any data within the array block will be outputted in relation ...
JavaScript uses reference counting technique to detect unused objects. When reference count to an object is zero, that object will be released by the garbage collector. Weakmap uses weak reference that does not contribute to reference count of an object, therefore it is very useful to solve memory l...
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...
public static class Res { /// <summary> /// URL: https://www.behance.net/gallery/2846011/Manteka /// </summary> public static FontFamily Maneteke = GetResourceFontFamily(Properties.Resources.manteka); public static FontFamily GetRes...
Signals are only available to GObject classes. They can only be public, which means that any part of the code can connect handlers and trigger them. public class Emitter : Object { // A signal is declared like a method, // but with the signal keyword. public signal void my_signal ();...
You can write detailed signals with the [Signal (detailed = true)] attribute. public class Emitter : Object { [Signal (detailed = true)] public signal void detailed_signal (); public void emit_with_detail (string detail) { this.detailed_signal[detail] (); } } void...

Page 1228 of 1336