Tutorial by Examples: o

def hello puts "Hello readers" end hello # => "Hello readers" def hello puts "Hell riders" end hello # => "Hell riders"
puts "Hello readers".reverse # => "sredaer olleH" class String def reverse "Hell riders" end end puts "Hello readers".reverse # => "Hell riders"
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 ...
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>
@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);...
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...
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...
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...
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...
Predefined exceptions are internally defined exceptions but they have names. Oracle database raise this type of exceptions automatically. Example create or replace procedure insert_emp is begin insert into emp (emp_id, ename) values ('1','Jon'); exception when dup_val_on_index then ...
As the name suggest user defined exceptions are created by users. If you want to create your own exception you have to: Declare the exception Raise it from your program Create suitable exception handler to catch him. Example I want to update all salaries of workers. But if there are no work...
using CLI: $ opennlp SentenceDetector ./en-sent.bin < ./input.txt > output.txt using API: import static java.nio.file.Files.readAllBytes; import static java.nio.file.Paths.get; import java.io.IOException; import java.util.Objects; public class FileUtils { /** * Get file data as...
Sometimes there will be properties that aren't available in jQuery event. To access the underlying properties use Event.originalEvent Get Scroll Direction $(document).on("wheel",function(e){ console.log(e.originalEvent.deltaY) // Returns a value between -100 and 100 depending o...

Page 640 of 1038