Skip to content

Instantly share code, notes, and snippets.

View jb-apps's full-sized avatar

Jonathan Benavides jb-apps

View GitHub Profile
@jb-apps
jb-apps / SortedArray.swift
Last active January 6, 2020 19:00
Keep track of a Sorted array using Binary Search
/// Solves the problem https://leetcode.com/problems/count-of-smaller-numbers-after-self/
/// keeping track of elements in sorted order.
/// Ex: A: [4,2,3,1] -> [3,1,1,0]
/// We traverse A in reversed order keeping track of each element in a sorted manner.
/// using the index where the new element was inserted as a counter for the elements after Self.
///
/// 0 1 2 3
/// A: [1,3,2,4]
/// i
/// i | sortedArray | result
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jb-apps
jb-apps / backprojection.ipynb
Created January 9, 2021 17:19
Computin a CT Sinogram
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jb-apps
jb-apps / FaceDetector.swift
Created March 17, 2022 20:16
A Face Detector using Vision
import Vision
import AppKit
final class FaceDetector {
private enum Error: Swift.Error {
case couldNotFindFace
case couldNotGetCIImage
case couldNotProcessImageRequest
case didNotGetAnyObservation
//
// ImageDraggableModifier.swift
// Pictura
//
// Created by Jonathan Benavides Vallejo on 25.08.23.
//
import SwiftUI
import AppKit