Tutorial by Examples: al

Consider using Extension Methods as Functions which wrap other code, here's a great example that uses both a static method and and extension method to wrap the Try Catch construct. Make your code Bullet Proof... using System; using System.Diagnostics; namespace Samples { /// <summary&g...
If you want to make internal classes or functions of an assembly accessable from another assembly you declare this by InternalsVisibleTo and the assembly name that is allowed to access. In this example code in the assembly MyAssembly.UnitTests is allowed to call internal elements from MyAssembly. ...
Virtual Methods are methods in Java that are non-static and without the keyword Final in front. All methods by default are virtual in Java. Virtual Methods play important roles in Polymorphism because children classes in Java can override their parent classes' methods if the function being overriden...
Consider the following struct definitions: struct Foo { my_bool: bool, my_num: isize, my_string: String, } struct Bar (bool, isize, String); struct Baz; Constructing new structure values for these types is straightforward: let foo = Foo { my_bool: true, my_num: 42, my_string: ...
C.I.A.s are intended as a simple way of getting attributes from whatever is calling the targeted method. There is really only 1 way to use them and there are only 3 attributes. Example: //This is the "calling method": the method that is calling the target method public void doProcess() ...
Detailed instructions on getting reflection set up or installed.
Data saved to TempData is stored in the session and will be automatically removed at the end of the first request where the data is accessed. If never read, it will be kept until finally read or the session times out. The typicaly usage looks like the following sequence (where each line is invoked ...
This converter will chain multiple converters together. public class ValueConverterGroup : List<IValueConverter>, IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return this.Aggregate(value, (current, converte...
In the root of your project, make sure Bower is installed (npm install -g bower) and run bower init. This will create a bower.json file in your project's directory. Create a new file called .bowerrc to your root directory. It should contain the following: { "directory": "public/b...
The following technique allows you to add your content to an HTML element and center it both horizontally and vertically without worrying about its height or width. The outer container should have display: table; The inner container should have display: table-cell; should have vertical-al...
Similar to partial classes the new version of Visual Basic is now able to handle partial modules and partial interfaces. The syntax and behaviour is exactly the same as it would be for partial classes. A partial module example: Partial Module Module1 Sub Main() Console.Write("Ping -&g...
Go to Help → About Eclipse → Check if the m2e feature is there: .
For the common case of having one Flask application all you have to do is to create your Flask application, load the configuration of choice and then create the SQLAlchemy object by passing it the application. Once created, that object then contains all the functions and helpers from both sqlalchem...
Sometimes it happens that a file was being tracked by git, but in a later point in time was added to .gitignore, in order to stop tracking it. It's a very common scenario to forget to clean up such files before its addition to .gitignore. In this case, the old file will still be hanging around in th...
impl<K, V> Serialize for MyMap<K, V> where K: Serialize, V: Serialize { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer { let mut state = serializer.serialize_map(Some(self.len()))?; ...
// A Visitor is a type that holds methods that a Deserializer can drive // depending on what is contained in the input data. // // In the case of a map we need generic type parameters K and V to be // able to set the output type correctly, but don't require any state. // This is an example of a...
git log --pretty=oneline |wc -l
Create a basic application with single view application template with swift as language Add SWRevealViewController.h and SWRevealViewController.m then click on Create Bridging Header button and add #import "SWRevealViewController.h" on the Bridging header Then select viewControll...
LINQ provides a method that makes it easy to create a collection filled with sequential numbers. For example, you can declare an array which contains the integers between 1 and 100. The Enumerable.Range method allows us to create sequence of integer numbers from a specified start position and a num...
The JAXB Reference Implementation (JAXB-RI) has been included with the Java Development Kit since JDK 6 update 3. Refer to the Unofficial JAXB Guide for additional details on which JAXB-RI version is included with specific versions of the JDK.

Page 121 of 269