Tutorial by Examples: ada

Example uses basic HTTP syntax. Any <#> in the example should be removed when copying it. You can use the _cat APIs to get a human readable, tabular output for various reasons. GET /_cat/health?v <1> The ?v is optional, but it implies that you want "verbose" output. _...
In Oracle a DATE data type does not have a format; when Oracle sends a DATE to the client program (SQL/Plus, SQL/Developer, Toad, Java, Python, etc) it will send 7- or 8- bytes which represent the date. A DATE which is not stored in a table (i.e. generated by SYSDATE and having "type 13" ...
import pandas as pd # Save dataframe to pickled pandas object df.to_pickle(file_name) # where to save it usually as a .plk # Load dataframe from pickled pandas object df= pd.read_pickle(file_name)
reference : NetConnection , NetStream , Video related topics : Working with Sound Basic example of playing an external video file (FLV, MP4, F4V). Code will also play M4A audio files. var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); va...
To read the contents to a file into a string variable: Dim fileContents As String = System.IO.File.ReadAllText("filename.txt") ReadAllText will open the specified file, read data to the end, then close the file. To read a file, separating it into an array element for each line: Dim f...
Useful if your program is outputting web pages along the way. from http.server import HTTPServer, CGIHTTPRequestHandler import webbrowser import threading def start_server(path, port=8000): '''Start a simple webserver serving path on port''' os.chdir(path) httpd = HTTPServer((''...
go() method The go() method loads a specific URL from the history list. The parameter can either be a number which goes to the URL within the specific position (-1 goes back one page, 1 goes forward one page), or a string. The string must be a partial or full URL, and the function will go to the f...
Using the calendar module import calendar from datetime import date def monthdelta(date, delta): m, y = (date.month+delta) % 12, date.year + ((date.month)+delta-1) // 12 if not m: m = 12 d = min(date.day, calendar.monthrange(y, m)[1]) return date.replace(day=d,month=m, year=...
A common task is to convert all columns of a data.frame to character class for ease of manipulation, such as in the cases of sending data.frames to a RDBMS or merging data.frames containing factors where levels may differ between input data.frames. The best time to do this is when the data is read ...
Add the AppWidgetProviderInfo metadata in res/xml: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="40dp" android:minHeight="40dp" android:updatePeriodMillis="86400000" android:previewImag...
use std::fs::File; use std::io::Read; fn read_a_file() -> std::io::Result<Vec<u8>> { let mut file = try!(File::open("example.data")); let mut data = Vec::new(); try!(file.read_to_end(&mut data)); return Ok(data); } std::io::Result<T>...
Rails is shipped by default with ActiveRecord, an ORM (Object Relational Mapping) derived from the pattern with the same name. As an ORM, it is built to handle relational-mapping, and more precisely by handling SQL requests for you, hence the limitation to SQL databases only. However, you can stil...
In PaaS sites such as Heroku, it is usual to receive the database information as a single URL environment variable, instead of several parameters (host, port, user, password...). There is a module, dj_database_url which automatically extracts the DATABASE_URL environment variable to a Python dictio...
Downloading a file from the internet is a very common task required by almost every application your likely to build. To accomplish this, you can use the "System.Net.WebClient" class. The simplest use of this, using the "using" pattern, is shown below: using (var webClient = n...
docker run -d --name "mysql-1" -v "/var/lib/mysql" mysql This command creates a new container from the mysql image. It also creates a new data volume, which it then mounts in the container at /var/lib/mysql. This volume helps any data inside of it persist beyond the lifetime o...
Although it is very tempting to use BETWEEN ... AND ... for a date range, it is problematical. Instead, this pattern avoids most problems: WHERE x >= '2016-02-25' AND x < '2016-02-25' + INTERVAL 5 DAY Advantages: BETWEEN is 'inclusive' thereby including the final date or second. 2...
Another way you can generate a range of dates is by utilizing a Tally Table to create the dates between the range: Declare @FromDate Date = '2014-04-21', @ToDate Date = '2014-05-02' ;With E1(N) As (Select 1 From (Values (1), (1), (1), (1), (1), (1), (1), (1), (1), (1)) DT...
SOAP services can publish metadata that describes the methods that may be invoked by clients. Clients can use tools such as Visual Studio to automatically generate code (known as client proxies). The proxies hide the complexity of invoking a service. To invoke a service, one merely invokes a metho...
Download your preferred version from Lightbend with curl: curl -O http://downloads.lightbend.com/scala/2.xx.x/scala-2.xx.x.tgz Unzip the tar file to /usr/local/share or /opt/bin: unzip scala-2.xx.x.tgz mv scala-2.xx.x /usr/local/share/scala Add the PATH to ~/.profile or ~/.bash_profile or ...
It's also possible to use data binding within your RecyclerView Adapter. Data model public class Item { private String name; public String getName() { return name; } } XML Layout <TextView android:layout_width="wrap_content" android:layou...

Page 3 of 12