<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BNW/sourcecodes/add_inv.php, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>http://git.genenetwork.org/BNW/atom?h=main</id>
<link rel='self' href='http://git.genenetwork.org/BNW/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/'/>
<updated>2026-08-17T19:53:08+00:00</updated>
<entry>
<title>Guard fopen() results with a false-check before fwrite/fprintf/fclose</title>
<updated>2026-08-17T19:53:08+00:00</updated>
<author>
<name>Claude Sonnet 5</name>
</author>
<published>2026-08-17T19:26:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=9cae7ea19c7c744a1ed2bd997571ec1b516a0d32'/>
<id>urn:sha1:9cae7ea19c7c744a1ed2bd997571ec1b516a0d32</id>
<content type='text'>
On PHP 7.4, calling fwrite()/fprintf()/fclose() with a false handle
(a failed fopen(), e.g. from a bad path, missing directory, or
permissions issue) just emits a warning and no-ops. On PHP 8.0+, these
functions require a resource argument and throw an uncaught TypeError
instead, turning what used to be a silent degradation into a fatal
crash of the whole request.

This patch wraps every fopen()-then-write call site in the codebase
(18 files) with an `if ($handle !== false) { ... }` check, matching
the existing pattern used elsewhere in the codebase. Where the same
$fpvar handle is threaded through shared helper functions
(enter_ban_list/banlist/whitelist, duplicated across
remove_variables_processing.php, remove_variables_processing_default.php,
modify_structure_learning.php and tier_description_processing_gom.php),
the guard was added inside those functions too for consistency, even
though the call sites are currently dead/commented-out in three of the
four files — so the same landmine doesn't reappear if that code is
ever re-enabled.

Verified empirically against PHP 8.3.28: fopen() on an unwritable path
followed by fwrite() on the resulting `false` throws
  TypeError: fwrite(): Argument #1 ($stream) must be of type resource, false given
without the guard; with the guard, the call is skipped instead of
crashing. The normal (successful fopen) path was also re-run through
mat_structure.php's structure_change() and still produces identical
output to before the change.

Reviewed by: Frederick M Muriithi &lt;fredmanglis@gmail.com&gt;
</content>
</entry>
<entry>
<title>Moving final GENENET8 version to master</title>
<updated>2021-02-24T21:19:03+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2021-02-24T21:19:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0'/>
<id>urn:sha1:1427e9bf4f85823164b4573a3bcf1ba3ba6b04d0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>GENENET8 update</title>
<updated>2021-02-24T20:36:59+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2021-02-24T20:36:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=25b843f6bbacb1937bdb960777b73acbece64115'/>
<id>urn:sha1:25b843f6bbacb1937bdb960777b73acbece64115</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Jan 28 2019 update</title>
<updated>2019-01-28T22:31:54+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2019-01-28T22:31:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=bb9d93322abf825368dedaafc2376ef8fdfc1e2f'/>
<id>urn:sha1:bb9d93322abf825368dedaafc2376ef8fdfc1e2f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>New parameter learning options</title>
<updated>2018-09-14T04:59:20+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2018-09-14T04:59:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=e3f7237ffcb19f19db3b68777b5a94b89e07f66a'/>
<id>urn:sha1:e3f7237ffcb19f19db3b68777b5a94b89e07f66a</id>
<content type='text'>
The main change here is in the parameter learning methods.  The parameters that are learned at first (i.e., if there is no evidence) are the distributions that are found directly in the data. I had to create or significantly modify several BNT files for this.

If there is evidence, the parameters are learned using a Dirichlet prior. This only required a couple of small changes to the BNW parameter learning files.
</content>
</entry>
<entry>
<title>Bug fixes, code comments, and minor changes</title>
<updated>2018-04-25T21:43:19+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2018-04-25T21:43:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=74b673ba4a706085201a5610b938ff98f08f641d'/>
<id>urn:sha1:74b673ba4a706085201a5610b938ff98f08f641d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Separating Octave and php calculations</title>
<updated>2018-03-15T04:19:16+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2018-03-15T04:19:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=c80226899f5cdd9f11c163817d59445213f5bef0'/>
<id>urn:sha1:c80226899f5cdd9f11c163817d59445213f5bef0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>BNW using Octave instead of Matlab.</title>
<updated>2017-09-28T20:04:40+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2017-09-28T20:04:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=8070dc963753142bb86c4ed698d91fd623ed28e7'/>
<id>urn:sha1:8070dc963753142bb86c4ed698d91fd623ed28e7</id>
<content type='text'>
This version of BNW should perform the same as the original version. The only difference is that it uses Octave instead of Matlab when running BayesNet Toolbox during parameter learning.

I am calling this BNW_1.02. It can be accessed at:
compbio.uthsc.edu/BNW_1.02
</content>
</entry>
<entry>
<title>Add files via upload</title>
<updated>2017-09-14T20:57:50+00:00</updated>
<author>
<name>ziejd2</name>
</author>
<published>2017-09-14T20:39:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/BNW/commit/?id=c4f926438dcb8abe805e910399940f79ff643c4b'/>
<id>urn:sha1:c4f926438dcb8abe805e910399940f79ff643c4b</id>
<content type='text'>
</content>
</entry>
</feed>
