Tutorial by Examples: ant

This example deals with one of the most fundamental aspects of the VHDL language: the simulation semantics. It is intended for VHDL beginners and presents a simplified view where many details have been omitted (postponed processes, VHDL Procedural Interface, shared variables...) Readers interest...
!process - list user mode processes .process - set process context !peb - show process environment block !teb - show thread environment block !locks - deadlock analysis .dump - save a crash dump file to disk
Using the Swift class Mirror works if you want to extract name, value and type (Swift 3: type(of: value), Swift 2: value.dynamicType) of properties for an instance of a certain class. If you class inherits from NSObject, you can use the method class_copyPropertyList together with property_getAttrib...
We may forget to apply the Antiforgery attribute for each POST request so we should make it by default. This sample will make sure Antiforgery filter will always be applied to every POST request. Firstly create new AntiForgeryTokenFilter filter: //This will add ValidateAntiForgeryToken Attribute t...
The descendant and descendant-or-self axes can be used to find all descendant elements of a node at any depth. In contrast, the child axis only traverses immediate children. /child::html/descendant::span /child::html/descendant-or-self::* The double slash // is a shortcut for /descendant-or-sel...
You must always unregister scopes other then your current scope as shown below: //always deregister these $rootScope.$on(...); $scope.$parent.$on(...); You don't have to deregister listners on current scope as angular would take care of it: //no need to deregister this $scope.$on(...); $r...
First off you create the form @using (Html.BeginForm()) { @Html.AntiForgeryToken() } Action Method [HttpPost] [ValidateAntiForgeryToken] public ActionResult Test(FormViewModel formData) { // ... } Script <script src="https://code.jquery.com/jquery-1.12.4.min.js"&g...
defmodule MyModule do @my_favorite_number 13 @use_snake_case "This is a string (use double-quotes)" end These are only accessible from within this module.
Declare: defmodule MyApp.ViaFunctions.Constants do def app_version, do: "0.0.1" def app_author, do: "Felix Orr" def app_info, do: [app_version, app_author] def bar, do: "barrific constant in function" end Consume with require: defmodule MyApp.ViaFuncti...
Declare: defmodule MyApp.ViaMacros.Constants do @moduledoc """ Apply with `use MyApp.ViaMacros.Constants, :app` or `import MyApp.ViaMacros.Constants, :app`. Each constant is private to avoid ambiguity when importing multiple modules that each have their own copies of th...
ConstantExpression must be the same type of the MemberExpression. The value in this example is a string, which is converted before creating the ConstantExpression instance. private static ConstantExpression GetConstant(Type type, string value) { // Discover the type, convert it, and create Co...
Let's say we have two tables (A and B) and some of their rows match (relative to the given JOIN condition, whatever it may be in the particular case): We can use various join types to include or exclude matching or non-matching rows from either side, and correctly name the join by picking the cor...
Let's say that we're given const string input as a phone number to be validated. We could start by requiring a numeric input with a zero or more quantifier: regex_match(input, regex("\\d*")) or a one or more quantifier: regex_match(input, regex("\\d+")) But both of those really f...
// Must enable the feature to use associated constants #![feature(associated_consts)] use std::mem; // Associated constants can be used to add constant attributes to types trait Foo { const ID: i32; } // All implementations of Foo must define associated constants // unless a defaul...
Using the IntDef#flag() attribute set to true, multiple constants can be combined. Using the same example in this topic: public abstract class Car { //Define the list of accepted constants @IntDef(flag=true, value={MICROCAR, CONVERTIBLE, SUPERCAR, MINIVAN, SUV}) //Tell the compi...
Checking the Existence of Keys Sometimes you may need to check if a key already exists and proceed accordingly. To do so you can use exists() function as shown below: client.exists('key', function(err, reply) { if (reply === 1) { console.log('exists'); } else { cons...
An instantiation error is thrown if an argument is not sufficiently instantiated. Critically, an instantiation error cannot be replaced by silent failure: Failing in such cases would mean that there is no solution, whereas an instantiation error means that an instance of the argument may participat...
#include <iostream> #include <map> #include <string> using namespace std; class A { public: map<string, string> * mapOfStrings; public: A() { mapOfStrings = new map<string, string>(); } void insertEntry(string const & key, st...
Using the PhantomData type like this allows you to use a specific type without needing it to be part of the Struct. use std::marker::PhantomData; struct Authenticator<T: GetInstance> { _marker: PhantomData<*const T>, // Using `*const T` indicates that we do not own a T } imp...
// Let's take an arbitrary piece of data, a 4-byte integer in this case let some_data: u32 = 14; // Create a constant raw pointer pointing to the data above let data_ptr: *const u32 = &some_data as *const u32; // Note: creating a raw pointer is totally safe but dereferencing a raw pointe...

Page 9 of 11