Tutorial by Examples: amp

CREATE TABLE mytable (number INT); INSERT INTO mytable VALUES (1); CREATE MATERIALIZED VIEW myview AS SELECT * FROM mytable; SELECT * FROM myview; number -------- 1 (1 row) INSERT INTO mytable VALUES(2); SELECT * FROM myview; number -------- 1 (1 row) REFRESH ...
Java code: public class StdioApplication { public static void main(String[] args) { new ClassPathXmlApplicationContext("classpath:spring/integration/stackoverflow/stdio/stdio.xml"); } } Xml config file <?xml version="1.0" encoding="UTF-8"?&...
using System; using System.Speech.Synthesis; using System.Windows; namespace Stackoverflow.SpeechSynthesisExample { public partial class SpeechSynthesisSample : Window { public SpeechSynthesisSample() { InitializeComp...
We will follow the official guide for spring-boot and spring-data-jpa. We will be building the application using gradle. Create the gradle build file build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframework....
We will create a simple "Hello World!" app with Angular2 2.4.1 (@NgModule change) with a node.js (expressjs) backend. Prerequisites Node.js v4.x.x or higher npm v3.x.x or higher or yarn Then run npm install -g typescript or yarn global add typescriptto install typescript globally ...
Create a file ckeditor-inline.html with the following content: <!DOCTYPE html> <html> <head> <title>CKEditor Inline Demo!</title> </head> <body> <script src="//cdn.ckeditor.com/4.6.1/basic/ckeditor.js"></script> <...
pthread_mutex_t queueMutex; pthread_cond_t queueCond; Queue queue; void Initialize() { //Initialize the mutex and the condition variable pthread_mutex_init(&queueMutex, NULL); pthread_cond_init(&queueCond, NULL); } void Producer() { //First we get some new data ...
λ> :t 1 1 :: Num t => t λ> :t pi pi :: Floating a => a In the examples above, the type-checker infers a type-class rather than a concrete type for the two constants. In Haskell, the Num class is the most general numerical one (since it encompasses integers and reals), but pi must...
What's the type of (+) ? λ> :t (+) (+) :: Num a => a -> a -> a What's the type of sqrt ? λ> :t sqrt sqrt :: Floating a => a -> a What's the type of sqrt . fromIntegral ? sqrt . fromIntegral :: (Integral a, Floating c) => a -> c
This example uses the main procedure as the producer task. In Ada the main procedure always runs in a task separate from all other tasks in the program, see minimal example. ------------------------------------------------------------------ -- Sampling Consumer -- --------------------------------...
This example creates a simple window with a button and a line-edit in a layout. It also shows how to connect a signal to a slot, so that clicking the button adds some text to the line-edit. import sys from PyQt5.QtWidgets import QApplication, QWidget if __name__ == '__main__': app ...
Say you have the string s = 'AAAABBBCCDAABBB' and you would like to split it so all the 'A's are in one list and so with all the 'B's and 'C', etc. You could do something like this s = 'AAAABBBCCDAABBB' s_dict = {} for i in s: if i not in s_dict.keys(): s_dict[i] = [i] els...
This example illustrates how the default key is chosen if we do not specify any c = groupby(['goat', 'dog', 'cow', 1, 1, 2, 3, 11, 10, ('persons', 'man', 'woman')]) dic = {} for k, v in c: dic[k] = list(v) dic Results in {1: [1, 1], 2: [2], 3: [3], ('persons', 'man', 'woman'): [('...
Notice in this example that mulato and camel don't show up in our result. Only the last element with the specified key shows up. The last result for c actually wipes out two previous results. But watch the new version where I have the data sorted first on same key. list_things = ['goat', 'dog', 'do...
In this example we see what happens when we use different types of iterable. things = [("animal", "bear"), ("animal", "duck"), ("plant", "cactus"), ("vehicle", "harley"), \ ("vehicle", "speed b...
The basic example Open routes/web.php file and paste the following code in file: Route::get('helloworld', function () { return '<h1>Hello World</h1>'; }); here 'helloworld' will act as page name you want to access, and if you don't want to create blade file and still want to ...
Open routes file. Paste the following code in: Route::get('helloworld', function () { return '<h1>Hello World</h1>'; }); after going to route http://localhost/helloworld it displays Hello World. The routes file is located /routes/web.php
Accessing pages and outputting data is fairly easy in Laravel. All of the page routes are located in app/routes.php. There are usually a few examples to get you started, but we're going to create a new route. Open your app/routes.php, and paste in the following code: Route::get('helloworld', functi...
function Add { [CmdletBinding()] param ( [int] $x , [int] $y ) return $x + $y } Export-ModuleMember -Function Add This is a simple example of what a PowerShell script module file might look like. This file would be called MyCoolModule.psm1, and is referenced from the mod...
workflow DoSomeWork { Get-Process -Name notepad | Stop-Process } This is a basic example of a PowerShell Workflow definition.

Page 32 of 46