Tutorial by Examples

You can access the exact same context as the method you override. class Boat def initialize(name) @name = name end def name @name end end puts Boat.new("Doat").name # => "Doat" class Boat def name "⛵ #{@name} ⛵" end end ...
class String def fancy "~~~{#{self}}~~~" end end puts "Dorian".fancy # => "~~~{Dorian}~~~"
public class UserModel { [Required] [StringLength(6, MinimumLength = 3)] [RegularExpression(@"(\S)+", ErrorMessage = "White space is not allowed")] public string UserName { get; set; } [Required] [StringLeng...
<appSettings> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings>
<package id="jQuery" version="1.10.2" targetFramework="net452" /> <package id="jQuery.Validation" version="1.11.1" targetFramework="net452" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3....
@model WebApplication4.Models.UserModel @{ ViewBag.Title = "Register"; } <h2>@ViewBag.Title.</h2> @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Htm...
public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.A...
public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes);...
These events can be used to communicate between 2 or more controllers. $emit dispatches an event upwards through the scope hierarchy, while $broadcast dispatches an event downwards to all child scopes.This has been beautifully explained here. There can be basically two types of scenario while comm...
Modules can be split across many .js files in the same folder. An example in a my_module folder: function_one.js module.exports = function() { return 1; } function_two.js module.exports = function() { return 2; } index.js exports.f_one = require('./function_one.js'); exports.f_two...
TStringList is a descendant of the TStrings class of the VCL. TStringList can be used for storing and manipulating of list of Strings. Although originally intended for Strings, any type of objects can also be manipulated using this class. TStringList is widely used in VCL when the the purpose is t...
Create a new application here: create application Choose standalone applicaton and confirm app creation via SMS. Fill Package namefor Android as your current package name. You can get your package name inside android manifest file, at the very begginning. Get your Certificate fingerprint by exe...
1. Install GLFW First step is to create an OpenGL window. GLFW is an Open Source, multi-platform library for creating windows with OpenGL, to install GLFW first download its files from www.glfw.org Extract the GLFW folder and its contents will look like this Download and install CMake to buil...
The Sieve of Eratosthenes generates all the primes from 2 to a given number n. Assume that all numbers (from 2 to n) are prime. Then take the first prime number and removes all of its multiples. Iterate the step 2 for next prime. Continue until all numbers till n have been marked. Pseudocode...
Module is a container for various parts of your applications - controller, services, filters, directive, etc. Why to use Modules Most applications have a main method that instantiates and wires together the different parts of the application. Angular apps don't have main method. But in AngularJ...
Here's how to Handle a popup alert in Java with Selenium: There are 3 types of popups. Simple alert : alert("This is a simple alert"); Confirmation alert : var popuResult = confirm("Confirm pop up with OK and Cancel button"); Prompt alert : var person = prompt(&...
In Unity Editor, open Player Settings (Edit > Project Settings > Player). Under Other Settings, check Virtual Reality Supported. Add or remove VR devices for each build target in the Virtual Reality SDKs list under the checkbox.
What is an exception? Exception in PL/SQL is an error created during a program execution. We have three types of exceptions: Internally defined exceptions Predefined exceptions User-defined exceptions What is an exception handling? Exception handling is a possibility to keep o...
The general syntax for exception section: declare declaration Section begin some statements exception when exception_one then do something when exception_two then do something when exception_three then do something when others then ...
An internally defined exception doesn't have a name, but it has its own code. When to use it? If you know that your database operation might raise specific exceptions those which don't have names, then you can give them names so that you can write exception handlers specifically for them. Otherwis...

Page 836 of 1336