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
from shared import camera_producer, cpu_bound, display | |
def main(): | |
frames = camera_producer() | |
cpu_bound_op = cpu_bound() | |
for frame in frames: | |
cpu_bound_op(frame) | |
display(frame) |
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
// extension of classical overwriting ring buffer that holds an incremental counter that can be indexed | |
// this should not be used for read heavy write infrequent streams (as a map would be a much mor effective implementation) | |
// this could be used for write heavy read infrequent streams | |
export class OverwritingRingBuffer<T> { | |
private buffer: T[]; | |
private bufferLength: number; | |
private pointer: number; | |
private counter: number; |
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
import { google } from 'googleapis'; | |
import { auth } from 'google-auth-library' | |
export default class getModel { | |
modelName: string; | |
projectName: string; | |
constructor(attrs) { | |
this.modelName = attrs.modelName | |
this.projectName = attrs.projectName |
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
class APIFetch extends Component { | |
constructor(props){ | |
super(props) | |
this.state = { | |
data: null, | |
isError: false, | |
isFetching: true | |
} | |
} | |
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
const fetchHOC = (WrappedComponent, fetchPath, optionalHeader) => { | |
return class extends Component { | |
constructor(props){ | |
super(props) | |
this.state = { | |
data: null, | |
isError: false, | |
isFetching: true | |
} | |
} |
NewerOlder