Tutorial by Examples

Returns the value of any OS environment variable. MESSAGE OS-GETENV ("OS") VIEW-AS ALERT-BOX. On a Windows machine: MESSAGE OS-GETENV ("SHELL") VIEW-AS ALERT-BOX. Result on a Linux machine with Bash as current shell: ┌────── Message ───────┐ ...
Copy a file COPY source-file target-file Copy c:\temp\source-file.txt to c:\temp\target-file.txt. You need to check OS-ERROR for success or lack thereof. OS-COPY VALUE("c:\temp\source-file.txt") VALUE("c:\temp\target-file.txt"). IF OS-ERROR <> 0 THEN DO: MESS...
Deletes a file, or a file-tree. As with many other OS-* utilities, you have to check status in OS-ERROR. OS-DELETE file-or-dir-to-delete [ RECURSIVE ] Delete the entire /tmp/dir tree: OS-DELETE VALUE("/tmp/dir") RECURSIVE. Delete the file called c:\dir\file.txt OS-DELETE VALUE...
Creates a directory, status is in OS-ERROR OS-CREATE-DIR directory Create a directory called /usr/local/appData OS-CREATE-DIR VALUE("/usr/local/appData").
Append one file to another. Status is checked in OS-ERROR OS-APPEND source target Appends targetfile.txt with sourcefile.txt: OS-APPEND VALUE("sourcefile.txt") VALUE("targetfile.txt").
Rename a file or directory. Status is in OS-ERROR. Can also be used to move files (or move and rename). OS-RENAME oldname newname Rename /tmp/old-name to /tmp/new-name: OS-RENAME VALUE("/tmp/old-name") VALUE("/tmp/new-name"). Move file c:\temp\old.txt to c:\new-dir\old....
Returns a list of all drives on a system. MESSAGE OS-DRIVES VIEW-AS ALERT-BOX. Result with four drives, C through F: On Linux the list will simply be empty as there by definitions are no "drives" connected. Listing directories is done in another way (INPUT FROM OS-DIR)
Client metrics cover the traffic between the client and the Varnish cache. sess_conn - Cumulative number of connections. client_req - Cumulative number of client requests. sess_dropped - Dropped connections because of a full queue. Monitor sess_conn and client_req to keep track of traffic vo...
Perhaps the most important performance metric is the hitrate. Varnish routes it's incoming requests like this: Hash, a cacheable request. This might be either hit or miss depending on the state of the cache. Hitpass, a not cacheable request. A hash with a miss and a hitpass will be fetched f...
You monitor the cached objects to see how often they expire and if they are "nuked". n_expired - Number of expired objects. n_lru_nuked - Last recently used nuked objects. Number of objects nuked (removed) from the cache because of lack of space. varnishstat -1 | grep "n_expire...
You need to keep track of some threads metrics to watch your Varnish Cache. Is it running out of OS resources or is it functioning well. threads - Number of threads in all pools. threads_created - Number of created threads. threads_failed - Number of times Varnish failed to create a thread. th...
There are a number of metrics describing the communication between Varnish and it's backends. The most important metrics here might be these: backend_busy - Number of http 5xx statuses recieved by a backend. With VCL you can configure Varnish to try another backend if this happens. backend_fail...
TypeScript catches type errors early through static analysis: function double(x: number): number { return 2 * x; } double('2'); // ~~~ Argument of type '"2"' is not assignable to parameter of type 'number'.
TypeScript enables editors to provide contextual documentation: You'll never forget whether String.prototype.slice takes (start, stop) or (start, length) again!
TypeScript allows editors to perform automated refactors which are aware of the rules of the languages. Here, for instance, Visual Studio Code is able to rename references to the inner foo without altering the outer foo. This would be difficult to do with a simple find/replace.
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Aeson main :: IO () main = do let example = Data.Aeson.object [ "key" .= (5 :: Integer), "somethingElse" .= (2 :: Integer) ] :: Value print . encode $ example
In foo.vala: void main (string[] args) { stdout.printf ("Hello world!"); } To compile the source into the foo binary: valac foo.vala To compile and run the source: vala foo.vala
project('Vala Project') glib_dep = dependency('glib-2.0') gobject_dep = dependency('gobject-2.0') executable('foo', 'foo.vala', dependencies: [glib_dep, gobject_dep]) Note: both glib-2.0 and gobject-2.0 dependencies are required unless --nostdpkg is explicitly given.
project('Posix-based Project', 'vala') add_project_arguments(['--nostdpkg'], language: 'vala') posix_dep = meson.get_compiler('vala').find_library('posix') executable('foo', 'foo.vala', dependencies: [posix_dep])
project('Mixed sources Project', 'vala') glib_dep = dependency('glib-2.0') gobject_dep = dependency('gobject-2.0') executable('foo', 'foo.vala', 'bar.c', dependencies: [glib_dep, gobject_dep]) In foo.vala: namespace Foo { public extern int bar (); public int main (string[] arg...

Page 1140 of 1336