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 plotter = (payload) => { | |
const { title, xtitle, ytitle, items } = payload | |
const titleWidth = title.length | |
const ytitleWidth = ytitle.length | |
let tableHeight = 0 | |
let maxColumnWidth = 0 | |
let restructruedItems = [] |
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
# I relied on ChatGPT for this. However, I understand what each line does and can debug it as needed. | |
FROM ubuntu:focal | |
# Install build tools | |
RUN apt-get update && apt-get install -y \ | |
g++-10 \ | |
cmake \ | |
ninja-build | |
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
30: move the string literal out to a util and pass it in as a variable. Also, remove the force unwrap. | |
35: make `self` weak to avoid a retain cycle. | |
50: isLoading is a boolean. No need for comparison with `!false`. `if isLoading` should do. | |
61: Declare showDetailView as a @State variable and pass $showDetailView into isActive. | |
67: You may want to move all string literals out to somewhere central, to ease localization in the future | |
90: after fetching the albums, I see no where `isLoading` is toggled back, to hide the `ProgressView`. Pass the responsibility of managing the loading state (`isLoading`) to the view model, and make it a @Published variable. That way you can easily toggle it when the API call is completed. | |
107: Did you mean to map the response from the API call? URL does not have a map function, or does it? Did you mean to declare `coverArtUrl` as an array? There will be an error there. | |
126: You're not checking to see if if UIImage(data:) resolves to nil. That force unwrap may cause a crash. |
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
// Protocols | |
protocol Toggleable { | |
var selected: Bool { get } | |
} | |
protocol Toggler: AnyObject { | |
var selectedProperty: ToggledProperty? { get set} | |
func toggleTo(toggleProperty: ToggledProperty?) | |
} |