Tutorial by Examples: 5

RVM is a great tool to manage your ruby versions and set up your working environment. Assuming you already have RVM installed, to get the latest version of ruby, which is needed for these examples, open a terminal and run: $ rvm get stable $ rvm install ruby --latest Check your ruby version by...
Below are the PHP5 SuperGlobals $GLOBALS $_REQUEST $_GET $_POST $_FILES $_SERVER $_ENV $_COOKIE $_SESSION $GLOBALS: This SuperGlobal Variable is used for accessing globals variables. <?php $a = 10; function foo(){ echo $GLOBALS['a']; } //Which will print 10 Glo...
Note: Before upgrading your Rails app, always make sure to save your code on a version control system, such as Git. To upgrade from Rails 4.2 to Rails 5.0, you must be using Ruby 2.2.2 or newer. After upgrading your Ruby version if required, go to your Gemfile and change the line: gem 'rails', '...
'use strict'; // This is an example of a /api/controllers/HomeController.js module.exports = { // This is the index action and the route is mapped via /config/routes.js index(req, res) { // Return a view without view model data // This typically will return the view defined at /v...
'use strict'; const co = require('co'); module.exports = { // This is the index action and the route is mapped via /config/routes.js index(req, res) { co(function* index() { // Return a view without view model data // This typically will return the view defined at /vie...
perl -ne'print if 5..10' file.txt
Create a Dictionary<TKey, TValue> from an IEnumerable<T>: using System; using System.Collections.Generic; using System.Linq; public class Fruits { public int Id { get; set; } public string Name { get; set; } } var fruits = new[] { new Fruits { Id = 8 , Nam...
This error occurs when tables are not adequately structured to handle the speedy lookup verification of Foreign Key (FK) requirements that the developer is mandating. CREATE TABLE `gtType` ( `type` char(2) NOT NULL, `description` varchar(1000) NOT NULL, PRIMARY KEY (`type`) ) ENGINE=InnoD...
Suggested max len First, I will mention some common strings that are always hex, or otherwise limited to ASCII. For these, you should specify CHARACTER SET ascii (latin1 is ok) so that it will not waste space: UUID CHAR(36) CHARACTER SET ascii -- or pack into BINARY(16) country_code CHAR(2) CHAR...
public void ConfigureServices(IServiceCollection services) { services.AddCors(o => o.AddPolicy("MyPolicy", builder => { builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); })); // ... } public void Configur...
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddCors(); services.ConfigureCors(options => options.AddPolicy("AllowSpecific", p => p.WithOrigins("http://localhost:1233") ...
This example will call the windows calculator. It's important to notice that the exit code will vary accordingly to the program/script that is being called. package process.example; import java.io.IOException; public class App { public static void main(String[] args) { try { ...
HTML5 is not based on SGML, and therefore does not require a reference to a DTD. HTML 5 Doctype declaration: <!DOCTYPE html> Case Insensitivity Per the W3.org HTML 5 DOCTYPE Spec: A DOCTYPE must consist of the following components, in this order: A string that is an ASCII case-inse...
Introduction Play has several plugins for different IDE-s. The eclipse plugin allows to transform a Play application into a working eclipse project with the command activator eclipse. Eclipse plugin may be set per project or globally per sbt user. It depends on team work, which approach should be u...
This can be used in various chat applications, rss feeds, and social apps where you need to have latest feeds with timestamps: Objective-C - (NSString *)getHistoricTimeText:(NSDate *)since { NSString *str; NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:since]; if(in...
This tutorial will guide you through the process from scratch. Please note some preliminary notes about this particular setup, useful in case that you already have some requested package: Is needed a version of php >=5.0 (I had troubles with php 7.0) Is requested any version of perl Is need...
See discussions in "GRANT" and "Recovering root password".
When you try access the records from MySQL database, you may get these error messages. These error messages occurred due to corruption in MySQL database. Following are the types MySQL error code 126 = Index file is crashed MySQL error code 127 = Record-file is crashed MySQL error code 134 = Recor...
(taking a break) With the inclusion of those 4 error numbers, I think this page will have covered about 50% of the typical errors users get. (Yes, this 'Example' needs revision.) 24 Can't open file (Too many open files) open_files_limit comes from an OS setting. table_open_cache needs to be les...
Hi everyone! This is a demo I love running for people that get started with BigQuery. So let's run some simple queries to get you started. Setup You will need a Google Cloud project: Go to http://bigquery.cloud.google.com/. If it tells you to create a project, follow the link to create a proje...

Page 2 of 6