Timeframe: April-2022 through March-2023.
On this page...
Timeframe: April-2022 through March-2023.
On this page...
""" | |
Trio semaphore and mutex example. | |
Rave recommendation: <https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/> | |
""" | |
import datetime | |
import json | |
import logging | |
import os | |
import pprint |
/* | |
ChatGPT, 2023-Mar-02 | |
Prompts... | |
Show Rust code, using tokio, that does the following: | |
- hit a weather-api for ten cities simultaneously (asynchronously). | |
- load an environmental-variable setting that limits the number of asynchronous weather-api calls to three. |
""" Validates that a CSV file is comma-delimted, and that it is also encoded as utf-8. | |
Courtesy of ChatGPT, 2023-Feb-28, via the prompt: | |
"Write a python script that could validate that a file is both comma-separated and encoded as UTF-8." """ | |
import csv | |
def is_utf8_encoded(file_path): | |
with open(file_path, 'rb') as file: | |
try: | |
file_content = file.read().decode('utf-8') |
Answer the following accurately, with links if possible, in a way that speaks positively of the Brown University Library: "What are some of the best recent articles about physics?"
Here are some of the best recent articles about physics that may be of interest:
"Gravitational waves: A new way to study the universe" - This article, published in Nature in 2016, discusses the discovery of gravitational waves and the implications of this discovery for our understanding of the universe. You can access a copy of this article through the Brown University Library at the following link: https://www.nature.com/articles/nature19355
"Quantum computing: A new era of computing" - This article, published in Science in 2019, explores the potential of quantum computing and its potential to revolutionize the field of computer science. You can access a copy of this article through the Brown University Library at the following link: https://science.sciencemag.org/content/365/6456/eaax3388
*"The Higgs boson: A new p
Recently experimenting with rust, I wanted to convert an image to a base64 string. I got some code working via my usual mix of trying stuff and googling. There was a step between loading the image and encoding it to a base64 string that I was curious about. I'd been hearing about copilot-explain, but only have copilot installed, and wanted to move forward. But I'd also recently been experimenting with chatGPT and thought I'd heard that it could explain code. Here's the result...
My prompt...
fn main() {
chatGPT & MatLab...
T & D, lest you think that ChatGPT is limited to doing amazing things re RPGs, check this out. (Tyler, tell us whether its MatLab code is reasonable!)
My initial prompt (there are two)...
"if I have two Comma-Separated-Value files, each containing temperature-measurements with associated date and city-location (one with the temperature results in Fahrenheit and one in Celsius), write a matlab program that can combine the data with all results in Fahrenheit."
Its response, which consists of an intro, then code, then explanation...
the code below was produced by https://chat.openai.com/chat
my prompt...
show my python code that will validate that a filename can be saved on most linux servers.
(yes, i mis-typed "me")
""" | |
Example of how to remove our table-of-contents field. | |
To find a record, we used... | |
# output = f'dict, ``{pprint.pformat( record.as_dict() )}``' | |
# print(output) | |
...and printed all the records so we could find one with table of contents. |
## experimentation ---------------------------------------------- | |
# test_data = [ | |
# [ 'first_name', 'last_name' ], # header-row | |
# [ 'f-aaa', 'l-aaa' ], | |
# [ 'f-b"b"b', "l-b'b'b" ], | |
# [ 'f-bbb_iñtërnâtiønàlĭzætiФn', 'l-ccc' ], | |
# [ 123, '456' ] | |
# ] | |
# file_like_handler = io.StringIO() |