This file contains 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
struct RowView: View { | |
var coin: Coins | |
var body: some View { | |
VStack() { | |
let _ = print("\((Double("\(coin.paymentThreshold)")!.dynamicDrecimalFormat())) ") | |
HStack(alignment: .bottom) { | |
Spacer() | |
Text("\((Double("\(coin.paymentThreshold)")!.dynamicDrecimalFormat())) ") |
This file contains 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
struct RowView: View { | |
var coin: Coins | |
var body: some View { | |
HStack(alignment: .bottom) { | |
Spacer() | |
Text("\((dynamicDrecimalFormat(dynamicDrecimal: Double(coin.paymentThreshold))))") | |
Text(coin.symbol ?? "") | |
.font(.footnote) | |
} | |
} |
This file contains 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
func whereIsMySQLite() { | |
let path = FileManager | |
.default | |
.urls(for: .applicationSupportDirectory, in: .userDomainMask) | |
.last? | |
.absoluteString | |
.replacingOccurrences(of: "file://", with: "") | |
.removingPercentEncoding | |
print(path ?? "Not found") |
This file contains 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
# EDIT THIS CODE TO YOUR SPECIFIC NEEDS | |
# THIS CODE REQUIRES SPECIFIC HTML CODE TO BE PLACED | |
# INSIDE THE TEMPLATE EXAMPLE FOUND BELOW | |
from flask import Flask, flash | |
def some_method(): |
This file contains 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
# # PYTHON LIST COMPENSATION | |
# compare single list of numbers | |
# in two text files extracting the matching numbers into a single list | |
# NOTE: in file1 & file2 the numbers are a single column in each list. | |
with open('file1.txt') as f: | |
file1 = [int(n) for n in f] |
This file contains 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
# COMBINING DICTIONARY AND LIST COMPREHENSION | |
# python 3.9, | |
# Find a matching value in a dictionary from values found in a list. | |
# you can choose to match on the key or the value with the conditional test | |
# depending the type of dictionary | |
a_list = [1, 2, 3] | |
b_dict = {1: "Bill", 2: "Joe", 3: "Oscar", 4: "Paul", 5: "Sally"} | |
new_dict = dict((key, value) for key, value in b_dict.items() if key in a_list) |
This file contains 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
# pandas library, | |
# python 3.9, | |
# using the following format : | |
# dictionary_comprehension = {NEW_KEY: NEW_VALUE for (INDEX, ROW) in DATA.iterrows()} | |
# list_comprehension = [NEW_ITEM for ITEM in LIST] | |
import pandas | |
new_dict = { | |
'letter': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', |
This file contains 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 sys | |
import os | |
import pkg_resources | |
from pprint import pprint | |
pprint({ | |
'sys.version_info': sys.version_info, | |
'sys.prefix': sys.prefix, | |
'sys.path': sys.path, |
This file contains 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 SwiftUI | |
import Combine | |
class TextCountMgr: ObservableObject { | |
@Published var counted = "0" | |
@Published var text = "" { | |
didSet { | |
counted = String(text.count) | |
} |
NewerOlder