This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.bjansen.gyokuro { ... } | |
import ceylon.net.http.server { ... } | |
import ceylon.html { ... } | |
import ceylon.collection { ... } | |
import ceylon.math.float { ... } | |
class Book(author, title) { | |
shared variable String author; | |
shared variable String title; | |
string => "Title: ``title`` \nAuthor: ``author``"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.bjansen.gyokuro { ... } | |
import ceylon.net.http.server { ... } | |
import ceylon.net.http { Header } | |
import ceylon.collection { ... } | |
import ceylon.math.float { ... } | |
class Book(author, title) { | |
shared variable String author; | |
shared variable String title; | |
string => "Author: ``author`` Title: ``title``"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ceylon.net.uri { parseURI=parse,... } | |
import ceylon.json { parseJSON=parse,... } | |
shared void run() { | |
value base = "http://api.icndb.com/jokes/random?"; | |
value params = { "limitTo"->"[nerdy]", "firstName"->"Francois", "lastName"->"Green" }; | |
value query = params.map((e) => "``e.key``=``e.item``").interpose("&").reduce(plus); | |
value contents = parseURI(base+query).get().execute().contents; | |
value json = parseJSON(contents); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ceylon.file { | |
... | |
} | |
import ceylon.regex { | |
... | |
} | |
import java.util.concurrent { | |
CompletableFuture { supplyAsync } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.Map; | |
import java.util.regex.Pattern; | |
import java.util.stream.*; | |
public class RegexRedux { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Dispatch | |
let input = FileHandle.standardInput.readDataToEndOfFile() | |
var sequence = String(data: input, encoding: .utf8)! | |
let inputLength = input.count | |
let regex: (String) -> NSRegularExpression = { pattern in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate regex; | |
use std::io::{self, Read}; | |
use std::thread; | |
macro_rules! regex { ($re:expr) => { ::regex::bytes::Regex::new($re).unwrap() } } | |
fn main() { | |
let mut input = Vec::with_capacity(51 * (1 << 20)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.regex.Pattern; | |
import java.util.stream.*; | |
public class RegexRedux { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop view if exists normal.contact_information; | |
create or replace view normal.contact_information as | |
select normal.person.first_name || ' ' || normal.person.last_name as full_name, | |
normal.person.id as person_id, | |
array_agg(distinct normal.email.address) as emails, | |
array_agg(distinct normal.telephone.number) as telephones, | |
row_number() over () as id | |
from normal.person, normal.email, normal.telephone | |
where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///Scan function that starts with the first element of the Sequence, like fold | |
extension Sequence { | |
func scan(_ combiner: (Element, Element) throws -> Element) rethrows -> [Element] { | |
var iterator = makeIterator() | |
guard let initial = iterator.next() else { | |
return [] | |
} | |
var firstIteration = true | |
var accumulator = initial | |
return try map { element in |
OlderNewer