Tutorial by Examples: ada

C# allows user-defined types to overload operators by defining static member functions using the operator keyword. The following example illustrates an implementation of the + operator. If we have a Complex class which represents a complex number: public struct Complex { public double Real ...
public class MyActivity extends Activity { private static final String PREFS_FILE = "NameOfYourPrefrenceFile"; // PREFS_MODE defines which apps can access the file private static final int PREFS_MODE = Context.MODE_PRIVATE; // you can use live template "key"...
When desired XML format differs from Java object model, an XmlAdapter implementation can be used to transform model object into xml-format object and vice versa. This example demonstrates how to put a field's value into an attribute of an element with field's name. public class XmlAdapterExample { ...
Dropbox.authorizedClient!.files.getMetadata(path: "/test.jpg", includeMediaInfo: true).response { response, error in if let result = response as? Files.FileMetadata { print(result.name) if result.mediaInfo != nil { switch result.mediaInfo! as Files.Med...
curl -X POST https://api.dropboxapi.com/2/files/get_metadata \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Content-Type: application/json" \ --data "{\"path\": \"/test.jpg\",\"include_media_info\": true}&quot...
Using the strtotime() function combined with date() you can parse different English text descriptions to dates: // Gets the current date echo date("m/d/Y", strtotime("now")), "\n"; // prints the current date echo date("m/d/Y", strtotime("10 September 2...
By default, a Date object is created as local time. This is not always desirable, for example when communicating a date between a server and a client that do not reside in the same timezone. In this scenario, one doesn't want to worry about timezones at all until the date needs to be displayed in lo...
This example uses the Dropbox .NET library to try to get the metadata for an item at a particular path, and checks for a NotFound error: try { var metadata = await this.client.Files.GetMetadataAsync("/non-existant path"); Console.WriteLine(metadata.Name); } catch (Dropbox.Api.A...
Create a snapshot of a whole database: mysqldump [options] db_name > filename.sql Create a snapshot of multiple databases: mysqldump [options] --databases db_name1 db_name2 ... > filename.sql mysqldump [options] --all-databases > filename.sql Create a snapshot of one or more tables...
mysql [options] db_name < filename.sql Note that: db_name needs to be an existing database; your authenticated user has sufficient privileges to execute all the commands inside your filename.sql; The file extension .sql is fully a matter of style. Any extension would work. You cannot spe...
Syntax for accessing rows and columns: [, [[, and $ This topic covers the most common syntax to access specific rows and columns of a data frame. These are Like a matrix with single brackets data[rows, columns] Using row and column numbers Using column (and row) names Like a list: Wi...
The Basics The simplist way to convert one date format into another is to use strtotime() with date(). strtotime() will convert the date into a Unix Timestamp. That Unix Timestamp can then be passed to date() to convert it to the new format. $timestamp = strtotime('2008-07-01T22:35:17.02'); $new_...
A database snapshot is a read-only, static view of a SQL Server database (the source database). It is similar to backup, but it is available as any other database so client can query snapshot database. CREATE DATABASE MyDatabase_morning -- name of the snapshot ON ( NAME=MyDatabase_data, -- l...
If data in a source database becomes damaged or some wrong data is written into database, in some cases, reverting the database to a database snapshot that predates the damage might be an appropriate alternative to restoring the database from a backup. RESTORE DATABASE MYDATABASE FROM DATABASE_SNAP...
This query will return the number of tables in the specified database. USE YourDatabaseName SELECT COUNT(*) from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' Following is another way this can be done for all user tables with SQL Server 2008+. The reference is here. SELECT COUNT(...
The following Go file can be compiled into a continuous external collector that will query a MSSQL server database that uses the StackExchange.Exceptional schema. It will query multiple servers/databases for all exceptions since UTC 00:00 to convert the raw entries into a counter. It also uses the b...
A data.table is an enhanced version of the data.frame class from base R. As such, its class() attribute is the vector "data.table" "data.frame" and functions that work on a data.frame will also work with a data.table. There are many ways to create, load or coerce to a data.table....
Each migration should have an up() method and a down() method. The purpose of the up() method is to perform the required operations to put the database schema in its new state, and the purpose of the down() method is to reverse any operations performed by the up() method. Ensuring that the down() me...
<script> $( ".inclas").datepicker({ minDate: new Date(2007, 1 - 1, 1) maxDate: new Date(2008, 1 - 1, 1) }); </script> <input type ="text" id="datepick" class="inclas">
use std::fs::File; use std::io::Read; fn main() { let filename = "src/main.rs"; // Open the file in read-only mode. match File::open(filename) { // The file is open (no error). Ok(mut file) => { let mut content = String::new(); ...

Page 1 of 12