Tutorial by Examples

PHP

In php.ini (this is the default after PHP 5.6): default_charset UTF-8 When building a web page: header('Content-type: text/plain; charset=UTF-8'); When connecting to MySQL: (for mysql:) Do not use the mysql_* API! (for mysqli:) $mysqli_obj->set_charset('utf8mb4'); (for PDO:) $db...
A basic implementation for singly-linked-list in java - that can add integer values to the end of the list, remove the first value encountered value from list, return an array of values at a given instant and determine whether a given value is present in the list. Node.java package com.example.so....
Following setup ensures that testing framework (PHPUnit) uses :memory: database. config/database.php 'connections' => [ 'sqlite_testing' => [ 'driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '', ], . . . ./phpun...
As with everything in Windows Azure, You have to have a Windows Azure account and an Azure Subscription. After you have both, go to https://portal.azure.com. From here, you can add new resources to your Azure subscription. Click New on the left menu.A new blade will be added to the right of you...
PERFORM VARYING TALLY FROM 1 BY 1 UNTIL TALLY > 5 DISPLAY TALLY END-PERFORM
PERFORM some-paragraph
There are three ways to quote something using a Julia function: julia> QuoteNode(:x) :(:x) julia> Meta.quot(:x) :(:x) julia> Expr(:quote, :x) :(:x) What does "quoting" mean, and what is it good for? Quoting allows us to protect expressions from being interpreted as sp...
This is a contrived sample. It sorts records based on an ALPHABET that has upper and lower case characters together, with A and a swapped compared to the other letters. This was done on purpose to demonstrate the possibilities. The SORT algorithm reader retrieves records using RELEASE in the INPU...
This is a seedwork sample. The SORT OUTPUT PROCEDURE could manipulate the sorted records before they are returned to the write portion of the internal COBOL sort algorithm. In this case, no transformation is done, work-rec is directly moved to out-rec. GCobol >>SOURCE FORMAT IS FIXED ...
You may want to read a DataFrame from a CSV (Comma separated values) file or maybe even from a TSV or WSV (tabs and whitespace separated files). If your file has the right extension, you can use the readtable function to read in the dataframe: readtable("dataset.CSV") But what if your ...
Data sets often contain comments that explain the data format or contain the license and usage terms. You usually want to ignore these lines when you read in the DataFrame. The readtable function assumes that comment lines begin with the '#' character. However, your file may use comment marks like ...
Assuming you have a model that looks like the following, we will get up an running with a simple barebones read-only API driven by Django REST Framework ("DRF"). models.py class FeedItem(models.Model): title = models.CharField(max_length=100, blank=True) url = models.URLField(b...
This example show how one may create a simple "Hello World" in Gtk3, setting up a window and button widgets. The sample code will also demonstrate how to set different attributes and actions on the widgets. module Main (Main.main) where import Graphics.UI.Gtk main :: IO () main = d...
For Navigate to any url : driver.navigate().to("http://www.example.com"); For move backwards : driver.navigate().back(); For move forwards : driver.navigate().forward(); For refresh the page : driver.navigate().refresh();
Method overriding is the way of using polymorphism between classes. if one class is inherited from another, the former (sub class) can override the latter's (super class's) methods, and change the implementation. this is used where the super class defines the more general implementation of the meth...
To separate API logic from the component, we are creating the API client as a separate class. This example class makes a request to Wikipedia API to get random wiki articles. import { Http, Response } from '@angular/http'; import { Injectable } from '@angular/core'; import { Observabl...
Since defining all of the authorization logic in the AuthServiceProvider could become cumbersome in large applications, Laravel allows you to split your authorization logic into "Policy" classes. Policies are plain PHP classes that group authorization logic based on the resource they autho...
Selecting data with condition $query = $this->db->select('*') ->from('table_name') ->where('column_name', $value) // Condition ->get(); return $query->result(); Selecting data with multiple conditions $conditions =...
with Ada.Text_IO; use Ada.Text_IO; procedure Main is task My_Task; task body My_Task is begin Put_Line ("Hello from My_Task"); end; begin Put_Line ("Hello from Main"); end; Result The order of Put_Line can vary. Hello from My_Task Hello from ...

Page 977 of 1336