Skip to content

Instantly share code, notes, and snippets.

View NF1198's full-sized avatar

Nicholas Folse NF1198

  • Albuquerque, NM
View GitHub Profile
@NF1198
NF1198 / StAXObjectBuilder.java
Last active May 11, 2020 14:41
An object builder for StAX
/*
* Copyright 2017 Nicholas Folse <https://github.com/NF1198>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
use std::sync::mpsc::SendError;
use std::sync::mpsc::{self};
use std::thread;
use std::time::Duration;
#[derive(Debug)]
enum MonitorCommand {
Stop,
}
@NF1198
NF1198 / timer.cpp
Created January 19, 2023 03:01
Timer Class for Arduino or other Embedded System
/*
* Copyright (c) 2022, 2023 Nicholas Folse
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@NF1198
NF1198 / tag_db.sql
Last active January 19, 2023 04:17
A simple tag database with logging backed by MySQL
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.6-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5611
-- Author: Nicholas Folse
-- Copyright (c) 2020-2023 Nicholas Folse
-- --------------------------------------------------------
@NF1198
NF1198 / README.md
Last active August 27, 2023 11:11
Simultaneously read from multiple subprocesses in Python 3 using {select, threads} (select, epoll, thread, subprocess, PIPE)

Reading from multiple subprocesses in Python: epoll vs threads

The following performance results were generated using a 2300 line file with output piped directly to a file instead of the console. (All awk delays were set to 0 for the benchmark) Processor Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz, 1992 Mhz, 4 Core(s), 8 Logical Processor(s)

The epoll solution is the clear winner, but is only available on Unix and Linux.

Approach 1: epoll

  • real 0m24.954s