Tutorial by Examples: al

Download and install Visual Studio. Visual Studio can be downloaded from VisualStudio.com. The Community edition is suggested, first because it is free, and second because it involves all the general features and can be extended further. Open Visual Studio. Welcome. Go to File → New ...
The function in_array() returns true if an item exists in an array. $fruits = ['banana', 'apple']; $foo = in_array('banana', $fruits); // $foo value is true $bar = in_array('orange', $fruits); // $bar value is false You can also use the function array_search() to get the key of a specifi...
Govendor is a tool that is used to import 3rd party packages into your code repository in a way that is compatible with golang's vendoring. Say for example that you are using a 3rd party package bosun.org/slog: package main import "bosun.org/slog" func main() { slog.Infof(&quo...
A flags-style enum value needs to be tested with bitwise logic because it may not match any single value. [Flags] enum FlagsEnum { Option1 = 1, Option2 = 2, Option3 = 4, Option2And3 = Option2 | Option3; Default = Option1 | Option3, } The Default value is actually a ...
Although not strictly required, it is highly recommended to start your project in a "virtual environment." A virtual environment is a container (a directory) that holds a specific version of Python and a set of modules (dependencies), and which does not interfere with the operating system'...
Detailed instructions on getting emacs set up or installed. Official instructions are available on the GNU Emacs website. Debian systems On systems with the Debian package manager (such as Debian, Ubuntu, and Mint) Emacs can be installed via the simple command: sudo apt-get install emacs For ...
Tkinter comes pre-installed with the Python installer binaries for Mac OS X and the Windows platform. So if you install Python from the official binaries for Mac OS X or Windows platform, you are good to go with Tkinter. For Debian versions of Linux you have to install it manually by using the foll...
The internal keyword makes a class (including nested classes), property, method or field available to every consumer in the same assembly: internal class Foo { internal string SomeProperty {get; set;} } internal class Bar { var myInstance = new Foo(); internal string SomeField ...
The ternary operator is used for inline conditional expressions. It is best used in simple, concise operations that are easily read. The order of the arguments is different from many other languages (such as C, Ruby, Java, etc.), which may lead to bugs when people unfamiliar with Python's "s...
def welcome_guests(*guests) guests.each { |guest| puts "Welcome #{guest}!" } end welcome_guests('Tom') # Welcome Tom! welcome_guests('Rob', 'Sally', 'Lucas') # Welcome Rob! # Welcome Sally! # W...
Let's say we have an interface for logging: interface Logger { function log($message); } Now say we have two concrete implementations of the Logger interface: the FileLogger and the ConsoleLogger. class FileLogger implements Logger { public function log($message) { // Append...
foo.h #ifndef FOO_DOT_H /* This is an "include guard" */ #define FOO_DOT_H /* prevents the file from being included twice. */ /* Including a header file twice causes all kinds */ /* of interesting problems.*/ /** * This is a functi...
Use of global variables is generally discouraged. It makes your program more difficult to understand, and harder to debug. But sometimes using a global variable is acceptable. global.h #ifndef GLOBAL_DOT_H /* This is an "include guard" */ #define GLOBAL_DOT_H /** * This tells ...
While static constructors are always called before the first usage of a type it's sometimes useful to be able to force them to be called and the RuntimeHelpers class provide an helper for it: using System.Runtime.CompilerServices; // ... RuntimeHelpers.RunClassConstructor(typeof(Foo).TypeHand...
To prepare your web site or web application to use Kendo UI, simply add the style and script files in the <head> section of your page. CDN services are provided for the minified versions of official Kendo UI releases, for both HTTP and HTTPS protocols. JQuery is also required to use Kendo UI...
A common pattern in C, to easily imitate returning multiple values from a function, is to use pointers. #include <stdio.h> void Get( int* c , double* d ) { *c = 72; *d = 175.0; } int main(void) { int a = 0; double b = 0.0; Get( &a , &b ); pr...
Executable File Download the .exe from http://dev.sitecore.net/ and double-click to start. This .exe will do everything for you - attach databases, modify host file, and set folder permissions. The only downside is that it leaves an entry in the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\Sitecore...
A Java object may declare a finalize method. This method is called just before Java releases the memory for the object. It will typically look like this: public class MyClass { //Methods for the class @Override protected void finalize() throws Throwable { // Cleanup co...
You can manually trigger the Garbage Collector by calling System.gc(); However, Java does not guarantee that the Garbage Collector has run when the call returns. This method simply "suggests" to the JVM (Java Virtual Machine) that you want it to run the garbage collector, but does not ...
Setting a default value can be done by using Initializers (C#6) public class Name { public string First { get; set; } = "James"; public string Last { get; set; } = "Smith"; } If it is read only you can return values like this: public class Name { pu...

Page 25 of 269