This file contains hidden or 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
| #!/usr/bin/env python | |
| from flask import Flask, render_template, Response | |
| import cv2 | |
| import time | |
| import io | |
| import threading | |
| import picamera | |
| class Camera(object): |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import cv2 | |
| import time | |
| from flask import Flask, render_template, Response | |
| # emulated camera | |
| # from camera import Camera | |
| # Raspberry Pi camera module (requires picamera package) |
This file contains hidden or 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
| names := rivers.FromData("Diego", "Hernando", "Bianca") | |
| ages := rivers.FromData(30, 29, 21) | |
| combined := rivers.Combine(myCustomCombiner, []*rivers.Pipeline{ | |
| names, | |
| ages, | |
| }) |
This file contains hidden or 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
| grep :: S.ByteString -> FilePath -> IO () | |
| grep pattern file = withFile file ReadMode $ \h -> do | |
| is <- Streams.handleToInputStream h >>= | |
| Streams.lines >>= | |
| Streams.filter (S.isInfixOf pattern) | |
| os <- Streams.unlines Streams.stdout | |
| Streams.connect is os |
This file contains hidden or 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
| List<Integer> transactionsIds = | |
| transactions.parallelStream() | |
| .filter(t -> t.getType() == Transaction.GROCERY) | |
| .sorted(comparing(Transaction::getValue).reversed()) | |
| .map(Transaction::getId) | |
| .collect(toList()); |
This file contains hidden or 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
| type Employee struct { | |
| appx.Model | |
| Name string | |
| Area string | |
| Role string | |
| } | |
| func ScheduleManagersOrDirectorsUSMeeting(context appengine.Context) { | |
| employeesByArea := datastore.NewQuery("Employee").Filter("Area =", "US") | |
| err :=appx.NewDatastore(context).Query(employeesByArea). |
This file contains hidden or 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
| func main() { | |
| messages := make(chan string, 2) | |
| messages <- "Hello " | |
| messages <- "World!" | |
| msg1 := <- messages | |
| msg2 := <- messages | |
| print(msg1) | |
| print(msg2) |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/drborges/demo-app/go/sweet" | |
| "net/url" | |
| ) | |
| var ( | |
| SessionURL = "https://github.com/session" |
This file contains hidden or 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
| public interface Movable { | |
| public void moveTo(Point position); | |
| } | |
| public class Car implements Movable { | |
| public void moveTo(Point position) { | |
| // Omitted code | |
| } | |
| } |
This file contains hidden or 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
| package main | |
| import logger from log | |
| // Function inline definition | |
| fn hello(name string) string = "Hello {name}" | |
| // Pattern matching | |
| fn fib(n int) int = match n { | |
| case n < 0: panic("Negative values not allowed") |