Skip to content

Instantly share code, notes, and snippets.

View duanebester's full-sized avatar

Duane Bester duanebester

View GitHub Profile
@duanebester
duanebester / Arduino-Tracker.ino
Created July 29, 2020 22:41
Arduino Tracker Datalogger Code
#include <SparkFun_Ublox_Arduino_Library.h>
#include <Arduino_LSM9DS1.h>
#include <Arduino_APDS9960.h>
#include <SPI.h>
#include <SD.h>
//
// ---- For Arduino Nano 33 BLE Sense board ----
// Connected to MKR Mem Shield & MKR GPS Shield
// ~ Note: GPS Module connected by UART
@duanebester
duanebester / ArduinoImports.ino
Created May 6, 2020 02:53
Arduino Imports for Surftracker
#include <SparkFun_Ublox_Arduino_Library.h>
#include <Arduino_LSM9DS1.h>
#include <Arduino_APDS9960.h>
#include <ArduinoBLE.h>
#include <SPI.h>
#include <SD.h>
@duanebester
duanebester / bester-2020.md
Last active March 31, 2020 19:22
About | Duane Bester

Duane Bester

Resume

Profile

I graduated with a degree in Electrical Engineering and a minor in Math from Texas A&M University. I am a well-rounded engineer with professional experience in hardware, firmware, and full-stack software development. I always enjoy a challenge and desire a career where I’m constantly outside of my comfort zone. I am an effective team member as well as a strong leader who is comfortable making key decisions.

@duanebester
duanebester / extractDates.scala
Last active February 12, 2020 01:54
Extract Dates Flow
def extractDates = Flow[OcrSuggestionsPersons].map(ocr => {
val sentences = sentenceDetector.sentDetect(ocr.ocr.replaceAll("\n", " ")).toList
import scala.collection.JavaConverters._
val dates = sentences.map(sentence => parser.parse(sentence))
.flatMap(dateGroups => dateGroups.asScala.toList)
.map(dateGroup => (dateGroup.getDates().asScala.toList.map(_.toString()), dateGroup.getText()))
OcrSuggestionsPersonsDates(ocr.ocr, ocr.suggestions, ocr.persons, dates)
})
@duanebester
duanebester / Natty.scala
Created February 12, 2020 01:50
Natty trait
import com.joestelmach.natty.Parser
trait Natty {
lazy val parser = new Parser()
}
@duanebester
duanebester / extractPersonsFlow.scala
Last active February 12, 2020 01:48
Extract Persons Flow
def extractPersons = Flow[OcrSuggestions].map(ocr => {
val tokens = tokenizer.tokenize(ocr.ocr)
val spans:Array[Span] = personFinderME.find(tokens)
val persons = spans.toList.map(span => tokens(span.getStart()))
OcrSuggestionsPersons(ocr.ocr, ocr.suggestions, persons)
})
// Update OCR Flow
val ocrFlow = imageOcr.via(spellCheck).via(extractPersons)
@duanebester
duanebester / NLP.scala
Created February 11, 2020 19:39
NLP Trait
trait NLP {
lazy val tokenModel = new TokenizerModel(getClass.getResourceAsStream("/en-token.bin"))
lazy val tokenizer = new TokenizerME(tokenModel);
lazy val sentenceModel = new SentenceModel(getClass.getResourceAsStream("/en-sent.bin"))
lazy val sentenceDetector = new SentenceDetectorME(sentenceModel);
lazy val personModel = new TokenNameFinderModel(getClass.getResourceAsStream("/en-ner-person.bin"))
lazy val personFinderME = new NameFinderME(personModel);
}
@duanebester
duanebester / ContentView2.swift
Created January 28, 2020 03:40
Content View
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
SongListView()
InfoPaneView()
}.navigationBarTitle("Music")
}
}
}
@duanebester
duanebester / InfoPaneView.swift
Created January 28, 2020 03:28
Info Pane View
import SwiftUI
struct InfoPaneView: View {
var body: some View {
VStack(alignment: .trailing, spacing: 0.0) {
Spacer()
ZStack {
VisualEffectView()
VStack {
NowPlayingView()
@duanebester
duanebester / VisualEffectView.swift
Created January 28, 2020 03:15
Visual Effect View
struct VisualEffectView: UIViewRepresentable {
var effect: UIVisualEffect = UIBlurEffect(style: .systemThinMaterial)
func makeUIView(context: UIViewRepresentableContext<Self>) -> UIVisualEffectView { UIVisualEffectView() }
func updateUIView(_ uiView: UIVisualEffectView, context: UIViewRepresentableContext<Self>) { uiView.effect = effect }
}
struct VisualEffectView_Previews: PreviewProvider {
static var previews: some View {
VisualEffectView()
}