Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
Here are 10 one-liners which show the power of scala programming, impress your friends and woo women; ok, maybe not. However, these one liners are a good set of examples using functional programming and scala syntax you may not be familiar with. I feel there is no better way to learn than to see real examples.
Updated: June 17, 2011 - I'm amazed at the popularity of this post, glad everyone enjoyed it and to see it duplicated across so many languages. I've included some of the suggestions to shorten up some of my scala examples. Some I intentionally left longer as a way for explaining / understanding what the functions were doing, not necessarily to produce the shortest possible code; so I'll include both.
The map
function takes each element in the list and applies it to the corresponding function. In this example, we take each element and multiply it by 2. This will return a list of equivalent size, compare to o
This explains how to setup for GitHub projects which automatically generates Doxygen code documentation and publishes the documentation to the gh-pages
branch using Travis CI.
This way only the source files need to be pushed to GitHub and the gh-pages branch is automatically updated with the generated Doxygen documentation.
Get an account at Travis CI. Turn on Travis for your repository in question, using the Travis control panel.
To create a clean gh-pages
branch, with no commit history, from the master branch enter the code below in the Git Shell. This will create a gh-pages branch with one file, the README.md
in it. It doesn't really matter what file is uploaded in it since it will be overwritten when the automatically generated documentation is published to th
type Rect = | |
{ Left:int; Top:int; Width:int; Height:int } | |
with | |
static member create(w, h) = { Left=0; Top=0; Width=w; Height=h } | |
static member create(l,t,r,b) = { Left=l; Top=t; Width=(r-l)+1; Height=(b-t)+1 } | |
static member shrink n r = { Left=r.Left+n; Top=r.Top+n; Width=r.Width-2*n; Height=r.Height-2*n } | |
static member scan r = | |
seq { | |
for y = r.Top to r.Top+r.Height-1 do | |
for x = r.Left to r.Left+r.Width-1 do |
#include <SFML/Graphics.hpp> | |
#include <thread> | |
int main() | |
{ | |
sf::RenderWindow window({1920, 1080}, "Screenshot!"); | |
sf::Texture tex; | |
tex.create(1920, 1080); | |
sf::Clock cl; |
from __future__ import absolute_import, division, print_function, unicode_literals | |
import sqlite3 | |
import logging | |
import time | |
__version__ = "0.1.0" | |
initial_sql = """CREATE TABLE IF NOT EXISTS log( |
public abstract class ValueObject<T> : IEquatable<T> where T : ValueObject<T> | |
{ | |
private List<PropertyInfo> Properties { get; } | |
protected ValueObject() | |
{ | |
Properties = new List<PropertyInfo>(); | |
} | |
public override Boolean Equals(object obj) |
#lang racket | |
(require net/http-client) | |
(require net/url) | |
(require json) | |
(require net/uri-codec) | |
(require racket/cmdline) | |
(define lg (make-logger 'currency-logger)) | |
(current-logger lg) |