Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
scons: Reading SConscript files ...
SCons 4.6.0 is using the following Python interpreter:
/home/bryan/GitHub/cantera/.venv/bin/python (Python 3.11)
INFO: Compiling on '12th Gen Intel(R) Core(TM) i5-1240P'
INFO: Building Cantera from git commit '2c08b0089'
INFO: Configuration variables read from 'cantera.conf' and command line:
python_package = 'full'
f90_interface = 'n'
doxygen_docs = True
sphinx_docs = True
# /opt/python/cp39-cp39/bin/python -m build --wheel Cantera-2.6.0b1/ --config-setting=-vvv
* Creating venv isolated environment...
* Installing packages in isolated environment... (Cython>=0.29.12, oldest-supported-numpy, setuptools>=43.0.0, wheel)
* Getting dependencies for wheel...
Compiling cantera/_cantera.pyx because it changed.
[1/1] Cythonizing cantera/_cantera.pyx
/tmp/build-env-qlge0pi3/lib/python3.9/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'extra_objects'
warnings.warn(msg)
running egg_info
writing Cantera.egg-info/PKG-INFO
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude -Iinclude/cantera/ext -Isrc -I/tmp/build-env-70rxi_zq/lib/python3.9/site-packages/numpy/core/include -I/project/include -I/tmp/build-env-70rxi_zq/include -I/opt/python/cp39-cp39/include/python3.9 -c cantera/_cantera.cpp -o build/temp.linux-aarch64-3.9/cantera/_cantera.o -std=c++11 -g0
src/base/AnyMap.cpp: In function ‘std::string {anonymous}::formatDouble(double, long int)’:
src/base/AnyMap.cpp:202:52: warning: ‘log10x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
202 | s1 = fmt::format("{:.{}f}", x, precision - log10x - 2);
| ^~~~~~
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Iinclude -Iinclude/cantera/ext -Isrc -I/tmp/build-env-70rxi_zq/lib/python3.9/site-packages/numpy/core/include -I/project/include -I/tmp/build-env-70rxi_zq/include -I/opt/python/cp39-cp39/include/python3.9 -c src/base/A
@bryanwweber
bryanwweber / precession-of-march-equinox.ssc
Created August 4, 2021 00:46
The precession of the March equinox, from 1550 to 2649, using Stellarium
//
// Name: Precession of the March Equinox
// Author: Bryan Weber
// License: Public Domain
// Version: 1.0
// Description: The precession of the March equinox, from 1550 to 2649
//
var dates = [
'1550-03-21T06:06:32',
@bryanwweber
bryanwweber / sun-on-ecliptic.ssc
Created August 4, 2021 00:40
A demo in Stellarium of the sun's motion along the ecliptic over a year.
//
// Name: Sun following the Ecliptic
// Author: Bryan Weber
// License: Public Domain
// Version: 1.0
// Description: A demo of the sun's motion along the ecliptic over a year.
//
LabelMgr.deleteAllLabels();
LandscapeMgr.setFlagLandscape(false);
@bryanwweber
bryanwweber / brute-force-word-solver.py
Created December 29, 2020 01:54
Brute-force solve for words in a set of letters using the enchant dictionary library
import enchant
from itertools import permutations
my_dict = enchant.Dict("en_US")
def words(letters, length, known_letters=None):
words = set()
l = list(letters)
for k in known_letters:
l.remove(k[0])
@bryanwweber
bryanwweber / julian.js
Created December 9, 2020 01:45
Julian Day Number Calculator from NASA
<html>
<head>
<title>Julian Day Number Calculations</title>
<script>
<!-- hide script from old browsers. See Copyright Notice at end of file.
var IGREG = (14+31*(10+12*1582));
var JGREG = 2299160;
var civcheck = new Civil(5,23,1948,1);
var istwo = false;
function Initialize() {
[
 {
 "instanceId": "7876f29c",
 "installDate": "2020-02-04T16:37:05Z",
 "installationName": "VisualStudio/16.6.0+30114.105",
 "installationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise",
 "installationVersion": "16.6.30114.105",
 "productId": "Microsoft.VisualStudio.Product.Enterprise",
 "productPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\devenv.exe",
 "state": 4294967295,
 "isComplete": true,
 "isLaunchable": true,
 "isPrerelease": false,
 "isRebootRequired": false,
 "displayName": "Visual Studio Enterprise 2019",
 "description": "Scalable, end-to-end solution for teams of any size",
 "channelId": "VisualStudio.16.Release",
 "channelUri": "https://aka.ms/vs/16/release/channel",
 "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
 "releaseNotes": "https://go.microsoft.com/fwlink/?

Work With Dates and Times Using dateutil

If you have ever had to do any programming with time, you know the crazy knots that it can tie you into. First, there are time zones, where a given instant is not at the same hour for two different points on Earth. Then you find daylight saving time, the hour that doesn't exist (or else exists twice), twice a year. You have to account for leap years and leap seconds, to keep human clocks in sync with the Earth's revolutions around the Sun. You have to program around the Y2K and Y2038 bugs. The list goes on and on.

{% alert %} Note: If you want to keep going down this manic rabbit hole, I highly recommend [The Problem with Time & Timezones](https://www.youtube.com/watch?v=-5wpm

@bryanwweber
bryanwweber / add_pdf_bookmarks.py
Last active April 13, 2020 13:50
Add bookmarks to a PDF document using pdfrw
from collections import namedtuple
from pdfrw.pdfwriter import (
PdfWriter,
IndirectPdfDict,
PdfName,
PdfOutputError,
PdfDict,
user_fmt,
)