A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
| extension CGRect | |
| { | |
| /** Creates a rectangle with the given center and dimensions | |
| - parameter center: The center of the new rectangle | |
| - parameter size: The dimensions of the new rectangle | |
| */ | |
| init(center: CGPoint, size: CGSize) | |
| { | |
| self.init(x: center.x - size.width / 2, y: center.y - size.height / 2, width: size.width, height: size.height) |
| //Override in your touch-enabled view (this can be differen than the view you use for displaying the cam preview) | |
| @Override | |
| public boolean onTouch(View view, MotionEvent motionEvent) { | |
| final int actionMasked = motionEvent.getActionMasked(); | |
| if (actionMasked != MotionEvent.ACTION_DOWN) { | |
| return false; | |
| } | |
| if (mManualFocusEngaged) { | |
| Log.d(TAG, "Manual focus already engaged"); | |
| return true; |
| package com.mtsahakis.mediaprojectiondemo; | |
| import android.app.Activity; | |
| import android.app.Service; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.graphics.Bitmap; | |
| import android.graphics.PixelFormat; | |
| import android.graphics.Point; | |
| import android.hardware.display.DisplayManager; |
| // | |
| // Source code recreated from a .class file by IntelliJ IDEA | |
| // (powered by Fernflower decompiler) | |
| // | |
| package com.google.firebase.provider; | |
| import android.content.ContentProvider; | |
| import android.content.ContentValues; | |
| import android.content.Context; |
| /* | |
| * Copyright 2016 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright 2016 Google Inc. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
| $ git clone https://github.com/iizukanao/node-rtsp-rtmp-server | |
| $ coffee -c . | |
| $ node server.js | |
| $ ffmpeg -f avfoundation -i "0" -vcodec libx264 -tune zerolatency -s 320x480 -vf crop=320:480:0:0 -f flv rtmp://0.0.0.0/live/desktop | |
| # stream on ios device | |
| $ git clone https://github.com/iMoreApps/ffmpeg-avplayer-for-ios-tvos | |
| $ open AVPlayerDemo.xcodeproj (change rtmp stream to rtmp://<LOCAL_IP>/live/desktop, build and run) |
| final class Completion<R> { | |
| private let closure: (R) -> Void | |
| private var cancelled = false | |
| /// `closure` is called upon completion, if not cancelled. | |
| init(closure: (R) -> Void) { | |
| self.closure = closure | |
| } | |