Skip to content

Instantly share code, notes, and snippets.

View jralls's full-sized avatar

John Ralls jralls

View GitHub Profile
mtr -rw4 code.gnucash.org
Start: 2023-09-28T11:12:33-0700
HOST: jeeves Loss% Snt Last Avg Best Wrst StDev
1.|-- _gateway 0.0% 10 0.7 0.7 0.6 0.8 0.1
2.|-- 100.92.203.195 0.0% 10 11.7 12.7 10.6 19.5 2.8
3.|-- po-326-358-rur202.sanjose.ca.sfba.comcast.net 0.0% 10 10.6 11.8 10.4 18.4 2.6
4.|-- 96.108.99.69 40.0% 10 12.5 12.8 11.3 13.6 0.9
5.|-- 68.85.86.173 0.0% 10 12.0 12.0 10.4 12.7 0.6
6.|-- ae-199-rar01.santaclara.ca.sfba.comcast.net 0.0% 10 12.8 14.2 10.7 34.1 7.0
7.|-- be-39931-cs03.sunnyvale.ca.ibone.comcast.net 70.0% 10 11.1 16.0 11.1 19.0 4.3
@jralls
jralls / test-resave.gnucash
Created June 27, 2023 20:52
Sample file for read/save testing.
<?xml version="1.0" encoding="utf-8" ?>
<gnc-v2
xmlns:gnc="http://www.gnucash.org/XML/gnc"
xmlns:act="http://www.gnucash.org/XML/act"
xmlns:book="http://www.gnucash.org/XML/book"
xmlns:cd="http://www.gnucash.org/XML/cd"
xmlns:cmdty="http://www.gnucash.org/XML/cmdty"
xmlns:price="http://www.gnucash.org/XML/price"
xmlns:slot="http://www.gnucash.org/XML/slot"
xmlns:split="http://www.gnucash.org/XML/split"
@jralls
jralls / gist:bb3723e46679d37dba39cf01d2465640
Created September 6, 2022 01:08
gnc_g_list_stringjoin: Ignore nulls and empties in string list.
index 7bb2ba5333..fb3602a73d 100644
--- a/libgnucash/core-utils/gnc-glib-utils.c
+++ b/libgnucash/core-utils/gnc-glib-utils.c
@@ -328,6 +328,12 @@ void gnc_gpid_kill(GPid pid)
#endif /* G_OS_WIN32 */
}
+static inline gboolean
+has_string (GList* item)
+{
@jralls
jralls / 0002-MinGW-doesn-t-do-signals.patch
Created June 12, 2020 19:25
Patches already built into guile-2.2.7.4-9d7759
From fd719dd9456d7ebd1674fc019d1955f40875c286 Mon Sep 17 00:00:00 2001
From: John Ralls <jralls@ceridwen.us>
Date: Tue, 23 Apr 2019 15:06:48 -0700
Subject: [PATCH 1/4] Fix build on MinGW-w64
Fixes bug 35405
* lib/poll.h: MinGW provides struct pollfd in winsock2.h and
lib/threads.h includes it so disable declaring it in poll.h and
get the declaration from winsock2.h. Otherwise gcc complains that
Added:
(define (template-export report template export-type output-file dry-run?)
(begin
(format #t "Template export ~a ~a ~a ~a ~a~%" report template export-type output-file dry-run?)
(let* ((report-guid (gnc:report-template-report-guid template))
Which printed
Template export Balance Sheet #<<report-template> version: 1 name: Balance Sheet report-guid: c4173ac99b2b448289bf4d11c731af13 parent-type: #f options-generator: #<procedure 1161d2df0 at standard/balsheet-pnl.scm:1294:20 ()> options-cleanup-cb: #f options-changed-cb: #f renderer: #<procedure 1161d2e00 at standard/balsheet-pnl.scm:1295:11 (rpt)> in-menu?: #t menu-path: (_Assets & Liabilities) menu-name: #f menu-tip: #f export-types: #f export-thunk: #f> #t
Backtrace:
2 (apply-smob/1 #<catch-closure 112e2bd80>)
Backtrace:
4 (apply-smob/1 #<catch-closure 10f80cda0>)
In ice-9/boot-9.scm:
2312:4 3 (save-module-excursion #<procedure 10f81b5c0 at ice-9/e…>)
In ice-9/eval-string.scm:
38:6 2 (read-and-eval #<input: string 10ffa6000> #:lang _)
In ice-9/eval.scm:
223:20 1 (proc #<directory (guile-user) 10f7d9140>)
In unknown file:
0 (%resolve-variable (7 . gnc:cmdline-run-report) #<direc…>)
@jralls
jralls / gist:8a2afd5993b96fa5834ed014d0861b55
Created October 5, 2019 17:54
Change GnuCash CMakeLists.txt for C++17
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -532,18 +532,22 @@ endif()
add_definitions(-D_GNU_SOURCE)
# Also, set the C++ version to c++11
-set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}") # FIXME: should be -std=c++11
-
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
@jralls
jralls / gist:12eb12adf9535cb47847cd901a9d324d
Created July 21, 2019 17:11
Sample SWIG unit test source and sink functions
test_engine_swig.h:
AccountValueList* test_account_value_list_source();
gboolean test_account_value_list_sink();
test_engine_swig.c:
AccountValueList*
test_account_value_list_source()
{
AccountValueList *avl = NULL;
QofBook* book = qof_book_new();
@jralls
jralls / gist:3c7a0420574be5d8b8e084c3f04a0d36
Created April 29, 2019 19:08
Saved report scheme options from book.gcm
(let ((options (gnc:report-template-new-options/report-guid "c4173ac99b2b448289bf4d11c731af13" "Balance Sheet")))
(let ((option (gnc:lookup-option options "General" "Report Title")))
((lambda (option)
(if option ((gnc:option-setter option) "佳匯旅行社有限公司"))) option))
(let ((option (gnc:lookup-option options "General" "Report name")))
((lambda (option)
(if option ((gnc:option-setter option) "佳匯旅行社有限公司"))) option))
(if (defined? 'gnc:restore-report-by-guid-with-custom-template)
(gnc:restore-report-by-guid-with-custom-template 0 "c4173ac99b2b448289bf4d11c731af13" "Balance Sheet" "" options)
(gnc:restore-report-by-guid 0 "c4173ac99b2b448289bf4d11c731af13" "Balance Sheet" options)) )
@jralls
jralls / gist:39105f5c258e3be89362d97d7c68feae
Created July 22, 2018 23:54
Backtrace from compiling and-let-star.scm
make[2]: Entering directory '/c/gcdev64/gnucash/maint/build/guile-git/module'
GUILE_AUTO_COMPILE=0 \
../meta/build-env \
guild compile --target="i686-w64-mingw32" -Wunbound-variable -Wmacro-use-before-definition -Warity-mismatch -Wformat \
-L "/c/gcdev64/gnucash/maint/src/guile/module" -L "/c/gcdev64/gnucash/maint/build/guile-git/module" \
-L "/c/gcdev64/gnucash/maint/src/guile/guile-readline" \
-o "ice-9/and-let-star.go" "/c/gcdev64/gnucash/maint/src/guile/module/ice-9/and-let-star.scm"
Backtrace:
In ice-9/boot-9.scm:
152:2 19 (with-fluid* _ _ _)