Skip to content

Commit 1bfe684

Browse files
committed
fix html
1 parent 8189c17 commit 1bfe684

9 files changed

+107
-66
lines changed

impressum.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<!doctype html>
22
<title>Impressum</title>
3-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
44

55
<h2>Impressum und ViSdP</h2>
66

7-
<i>[Demanded by German law]</i><p>
7+
<i>[Demanded by German law]</i>
8+
<p>
89

910
Placeholder until E-Mail for contact.<br>
1011
Name<br>
1112
Street<br>
1213
City<br>
1314

14-
<p>
15+
</p>

index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ <h2>Posts</h2>
2626
</ul>
2727
</div>
2828

29-
<p>
30-
3129
<div style="text-align:left">Handwritten until there are more entries.
3230
<br><a href="impressum.html">Impressum, Datenschutz</a>
3331
</div>

post/ci_library.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
</style>
8181
<div id="contents">
82+
</div>
8283
<div style="text-align:left; padding up down: 1em">
8384
<h2>Towards an extensible continuos integration library.</h2>
8485
</div>

post/optimal_debugging.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ <h2>Towards an optimal debugging framework library.</h2>
208208
<!-- hw -> kernel -> user space resources -->
209209
<ol>
210210
<li>Debugging hard(ware) problems</li>
211-
<a href"https://interrupt.memfault.com/blog/schematic-review-checklist">
211+
<a href="https://interrupt.memfault.com/blog/schematic-review-checklist">
212212
Hardware design reviews</a> with extensive focus on core components
213213
(power, battery, periphery, busses, memory/flash and debug/test infrastructure)
214214
to enable debugging and component tests against product and assembling defects.
@@ -290,7 +290,22 @@ <h2>Towards an optimal debugging framework library.</h2>
290290
<li>incorrect protocol handling</li>
291291
<li>insufficient handling of or the software requirements themself</li>
292292
</ol>
293-
TODO: more things missing, unclear what to use ideally
293+
The source of these problems are usually
294+
<ol>
295+
<li> incorrect constrains on the design, meaning how the different
296+
parts should interact and work towards the goals for the use
297+
cases</li>
298+
<li> unclear, unspecified or incorrectly assumed hardware or software
299+
guarantees by components </li>
300+
<li> implementation oversights, unintended use cases, unfeasibility
301+
of a general solution due to time and/or money constrains</li>
302+
</ol>
303+
Formal modeling of the design, model checking, code review, writing
304+
tests for edge cases or runtime validation are typically used with
305+
best practice being to write code in a risk-aware, testable and
306+
debuggable way. The methods and scope are here very wide and very
307+
domain and use case specific, so no general or short recommendation
308+
can be made.
294309
</li>
295310
<!-- https://www.cprogramming.com/tutorial/memory_debugging_parallel_inspector.html -->
296311
</ol>
@@ -301,8 +316,11 @@ <h2>Towards an optimal debugging framework library.</h2>
301316
<li>minimal descriptions for C, Rust, Zig; Posix, Linux, Windows</li>
302317
</ol>
303318

304-
Overall, one can summarize that it is <b>good practice to have</b> a
305-
<b>system correctness and debugging strategy</b>.
319+
Ideally, only the system behavior and interactions with domain and
320+
use-case specific parts need cognitive load from the programmer, whereas
321+
the other error classes have standard approaches to isolate and eliminate.
322+
Unifying debug tooling simplifies usage for bigger developer productivity
323+
and exposing as library allows to automate this process.
306324

307325
<!-- <li>Verification</li> -->
308326
<li><a href="#uniform_execution_representation">Uniform execution representation.</a></li>
@@ -329,4 +347,5 @@ <h2>Towards an optimal debugging framework library.</h2>
329347
<!-- Section 3: Uniform execution representation and queries over program execution.<br> -->
330348
<!-- Section 4: Abstraction problems during problem isolation.<br> -->
331349
<!-- Section 5: Program modification and validation language, query language and alternatives.<br> -->
350+
</div>
332351
</html>

post/process_behavior.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979

8080
</style>
8181
<div id="contents">
82+
</div>
8283
<div style="text-align:left; padding up down: 1em">
8384
<h2>Process semantics and abstraction problems on Linux, MacOS, Posix, Windows.</h2>
8485
</div>

post/shennanigans_in_c.html

Lines changed: 51 additions & 39 deletions
Large diffs are not rendered by default.

post/shennanigans_in_cpp.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h2>Some C++ footgun avoidance.</h2>
113113
<span class="line">};</span>
114114
<span class="line"><span class="tok-kw">class</span> T2 {</span>
115115
<span class="line"><span class="tok-kw">public</span>:</span>
116-
<span class="line"> std::map<std::string, T1> mapex1;</span>
116+
<span class="line"> std::map&lt;std::string, T1&gt; mapex1;</span>
117117
<span class="line"> <span class="tok-kw">void</span> AddT1 (<span class="tok-kw">const</span> std::string &amp;t1str) {</span>
118118
<span class="line"> T1 t1obj(t1str);</span>
119119
<span class="line"> mapex1.emplace(t1str, t1obj);</span>
@@ -151,7 +151,7 @@ <h2>Some C++ footgun avoidance.</h2>
151151
<span class="line"> , 1, 0, 0, 0</span>
152152
<span class="line"> , 0, 0, 0, 0 };</span>
153153
<span class="line"> <span class="tok-comment">// clang-format: on</span></span>
154-
<span class="line"> <span class="tok-type">int64_t</span> val_mcpy;
154+
<span class="line"> <span class="tok-type">int64_t</span> val_mcpy;</span>
155155
<span class="line"> <span class="tok-comment">// val_mcpy = memcpy(&amp;val_mcpy, some_vals[1], <span class="tok-builtin">sizeof</span>(val_mcpy); // refusal to compile</span></span>
156156
<span class="line"> val_mcpy = <span class="tok-builtin">memcpy</span>(&amp;val_mcpy, &amp;some_vals[1], <span class="tok-builtin">sizeof</span>(val_mcpy); // refusal to compile</span>
157157
<span class="line"> <span class="tok-type">int64_t</span> val_wrong = *<span class="tok-builtin">reinterpret_cast</span>&lt;<span class="tok-type">int64_t</span>*&gt;(some_vals[1]); <span class="tok-comment">// runtime error</span></span>
@@ -162,7 +162,7 @@ <h2>Some C++ footgun avoidance.</h2>
162162
<span class="line"> <span class="tok-kw">if</span> (val != <span class="tok-number">INT64_MIN</span>) <span class="tok-kw">return</span> 1;</span>
163163
<span class="line"> <span class="tok-kw">return</span> 0;</span>
164164
<span class="line">}</span>
165-
</code></pre>
165+
</code></pre></figure>
166166
</li>
167167

168168
<li> <a href="https://stackoverflow.com/questions/11598990/is-stdstoi-actually-safe-to-use">
@@ -192,12 +192,12 @@ <h2>Some C++ footgun avoidance.</h2>
192192
<li> Checking, if typename is a string is complex (even with C++17 extension).
193193
<figure><figcaption class="cpp-cap"><cite class="file">is_typname_string.hpp</cite></figcaption>
194194
<pre><code><span class="line"><span class="tok-type">template</span>&lt;typename STR&gt;</span>
195-
<span class="line"><span class="tok-type">inline</span></span> <span class="tok-type">constexpr</span> bool is_string_class_decayed = false;</span>
195+
<span class="line"><span class="tok-type">inline</span> <span class="tok-type">constexpr</span> bool is_string_class_decayed = false;</span>
196196
<span class="line"><span class="tok-type">template</span>&lt;typename... STR&gt;</span>
197197
<span class="line"><span class="tok-type">inline</span> <span class="tok-type">constexpr</span> bool is_string_class_decayed&lt;std::basic_string&lt;STR...&gt;&gt; = true;</span>
198198
<span class="line"><span class="tok-comment">// decay_t will remove const, &amp; and volatile from the type</span></span>
199199
<span class="line"><span class="tok-type">template</span>&lt;typename STR&gt;</span>
200-
<span class="line"><span class="tok-type">inline</span></span> <span class="tok-type">constexpr</span> bool is_string_class = is_string_class_decayed&lt;std::decay_t&lt;STR&gt;&gt;</span>
200+
<span class="line"><span class="tok-type">inline</span> <span class="tok-type">constexpr</span> bool is_string_class = is_string_class_decayed&lt;std::decay_t&lt;STR&gt;&gt;</span>
201201
<span class="line"><span class="tok-type">template</span> &lt;typename TChar, typename TString&gt;</span>
202202
<span class="line"><span class="tok-type">inline</span> <span class="tok-type">constexpr</span> bool is_string = is_string_class&lt;TString&gt; &amp;&amp; std::is_same_v&lt;TChar, typename TString::value_type&gt;;</span>
203203
<span class="line"><span class="tok-kw">static_assert</span>(is_string_class&lt;std::string&gt;);</span>
@@ -221,7 +221,7 @@ <h2>Some C++ footgun avoidance.</h2>
221221
<pre><code><span class="line"><span class="tok-kw">void</span> cstring_string_interop() {</span>
222222
<span class="line"> <span class="tok-kw">const</span> <span class="tok-type">char</span> * cmd = <span class="tok-str">"ls"</span>;</span>
223223
<span class="line"> <span class="tok-type">char</span> <span class="tok-kw">const</span> * buffer[] = {<span class="tok-str">"ls"</span>, <span class="tok-str">"-l"</span>, NULL};</span>
224-
<span class="line"> <span class="tok-type">char</span> * <span class="tok-kw">const</span> * argv = <span class="tok-builtin">const_cast</span><<span class="tok-type">char</span> * <span class="tok-kw">const</span> *&gt;(buffer);</span>
224+
<span class="line"> <span class="tok-type">char</span> * <span class="tok-kw">const</span> * argv = <span class="tok-builtin">const_cast</span><span class="tok-type">char</span> * <span class="tok-kw">const</span> *&gt;(buffer);</span>
225225
<span class="line"> int execed = execve(cmd, argv, NULL);</span>
226226
<span class="line"> (<span class="tok-kw">void</span>)execed;</span>
227227
<span class="line">}</span>
@@ -246,7 +246,7 @@ <h2>Some C++ footgun avoidance.</h2>
246246
<span class="line"> <span class="tok-type">static</span> <span class="tok-type">constexpr</span> <span class="tok-kw">const</span> T value = v;</span>
247247
<span class="line"> };</span>
248248
<span class="line">}</span>
249-
<span class="line"><span class="tok-builtin">#define</span> FORCE_CONST_EVAL(exp) ::util_force_const_eval::const_expr_value<decltype(exp), exp>::value</span>
249+
<span class="line"><span class="tok-builtin">#define</span> FORCE_CONST_EVAL(exp) ::util_force_const_eval::const_expr_value&lt;decltype(exp), exp&gt;::value</span>
250250
<span class="line"><span class="tok-builtin">#define</span> LEAF(FN) (&amp;FN[FORCE_CONST_EVAL(fname_offs(FN))])</span>
251251
<span class="line"></span>
252252
<span class="line"><span class="tok-type">int</span> testEq(<span class="tok-type">int32_t</span> a, <span class="tok-type">int32_t</span> b) {</span>
@@ -303,7 +303,7 @@ <h2>Some C++ footgun avoidance.</h2>
303303
<span class="line"> fprintf(stdout, <span class="tok-str">"%x, "</span>, array[i]);</span>
304304
<span class="line"> fprintf(stdout, <span class="tok-str">"\n"</span>)</span>
305305
<span class="line">}</span>
306-
</code></pre>
306+
</code></pre></figure>
307307
</li>
308308

309309
<li> Incomplete type can not be instantiated in template:
@@ -327,7 +327,7 @@ <h2>Some C++ footgun avoidance.</h2>
327327
<span class="line"> <span class="tok-kw">public</span>:</span>
328328
<span class="line"> <span class="tok-type">int</span> SomeMethod() <span class="tok-kw">override</span> {</span>
329329
<span class="line"> <span class="tok-kw">return</span> 1;</span>
330-
<span class="line"> }
330+
<span class="line"> }</span>
331331
<span class="line"> <span class="tok-type">virtual</span> ~CSomeClass(); <span class="tok-comment">// missing virtual technical UB</span></span>
332332
<span class="line">};</span>
333333
<span class="line"><span class="tok-kw">class</span> CSomeDerivedClass : CSomeClass</span>
@@ -339,7 +339,7 @@ <h2>Some C++ footgun avoidance.</h2>
339339
<span class="line"> }</span>
340340
<span class="line"> <span class="tok-type">virtual</span> ~CSomeDerivedClass(); <span class="tok-comment">// optional virtual</span></span>
341341
<span class="line">};</span>
342-
</code></pre>
342+
</code></pre></figure>
343343
</li>
344344

345345
<li> Why exceptions do not scale.
@@ -386,7 +386,7 @@ <h2>Some C++ footgun avoidance.</h2>
386386
<span class="line"> }</span>
387387
<span class="line"> <span class="tok-kw">return</span> 0;</span>
388388
<span class="line">}</span>
389-
</code></pre>
389+
</code></pre></figure>
390390
</li>
391391

392392
<li><code>__STDC_VERSION__</code> <a href="https://github.com/open-mpi/ompi/pull/7817">is not necessary defined</a> by C++ compilers.

post/shennanigans_in_python.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,16 @@
8585
<div style="text-align:left; padding up down: 1em">
8686
<h2>Python shennanigans.</h2>
8787
</div>
88+
<p>
8889
The following shennanigans were collected during my work on creating a system
8990
integration library and framework for hardware and software tests including
9091
developer tasks like worktree management, building, target deployment and
9192
configuration. Therefore it should be representative for things one
9293
might want to do in absence of better tooling. The used Python version was
93-
3.8.2, but most problems still persist.<p>
94+
3.8.2, but most problems still persist.
95+
</p>
9496

97+
<p>
9598
My <b>tldr;</b> retrospection upfront, which you may be able to reproduce
9699
once you try to code long-running services, which recover from all failures,
97100
cleanly reset state or generally try to debug spurious problems. Please don't.<br>
@@ -104,7 +107,8 @@ <h2>Python shennanigans.</h2>
104107
different combination of traversal) becomes unreasonably verbose and error
105108
prone. The alternative is to use C-like error handling, which requires to figure out
106109
all possible exceptions of Python libstd methods, which language servers
107-
do not support (as of 20240404).<p>
110+
do not support (as of 20240404).
111+
</p>
108112

109113
Aside of these more fundamental limitations, here the list of shennanigans I have run into:
110114
<ul>
@@ -131,7 +135,7 @@ <h2>Python shennanigans.</h2>
131135
<span class="line"> <span class="tok-comment"># return big | small == big</span></span>
132136
<span class="line"> <span class="tok-comment"># also:</span></span>
133137
<span class="line"> <span class="tok-comment"># return {**big, **small} == big</span></span>
134-
<span class="line"> <span class="tok-kw">return</span> <span class="tok-type">dict</span>(big, **small) == big</span></span>
138+
<span class="line"> <span class="tok-kw">return</span> <span class="tok-type">dict</span>(big, **small) == big</span>
135139
</code></pre>
136140
</figure>
137141
</li>
@@ -272,9 +276,9 @@ <h2>Python shennanigans.</h2>
272276
<li>
273277
Generic module annotation is not allowed and mypy has no explicit docs for this.
274278
The following does not work and 'module: object' is the closest we can get as simple annotation.
275-
<figure><figcaption class="py-cap"><cite class="file">modle_annotation.py</cite></figcaption>
279+
<figure><figcaption class="py-cap"><cite class="file">module_annotation.py</cite></figcaption>
276280
<pre><code><span class="line"><span class="tok-fn">def</span> check_fn(module: ModuleType) -&gt; <span class="tok-type">int</span>:</span>
277-
<span class="line"> <span class="tok-kw">if</span> str(type(module)) != "<class 'module'>": <span class="tok-kw">return</span> 1</span>
281+
<span class="line"> <span class="tok-kw">if</span> str(type(module)) != "module": <span class="tok-kw">return</span> 1</span>
278282
<span class="line"> <span class="tok-kw">return</span> 0</span>
279283
</code></pre>
280284
</figure>

post/shennanigans_in_zig.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,19 @@
8686
<div style="text-align:left; padding down up: 1em">
8787
<h2>Zig shennanigans.</h2>
8888
</div>
89-
As of <strike>20240404 (zig version 0.12.0-dev.3562+96bc8f17c)</strike>
89+
As of <del>20240404 (zig version 0.12.0-dev.3562+96bc8f17c)</del>
90+
<p>
9091
20240701 (zig version 0.14.0-dev.4234+1e3fb4825), Zig provides
9192
one of the best possible semantics to optimize memory details, while
9293
offering widely portable source code with reasonable safety in a
93-
relative concise and readable way.<p>
94+
relative concise and readable way.
95+
</p>
96+
<p>
9497
Aside of signaling for toolings, I found personally no major annoying
9598
parts.<br>
9699
For example, picking up nested slices and some build system parts might be
97100
inconvenient, but those are one time things and no footguns.<br>
101+
</p>
98102
The rest of the language feels very smooth to me in contrast to the potential
99103
very flexible and cryptic syntax of C (see <a href="https://github.com/JadLevesque/PPMP-Iceberg">preprocessor iceberg</a>).
100104
<ul>
@@ -164,5 +168,6 @@ <h2>Zig shennanigans.</h2>
164168
</ol>
165169
(Updated 20240701)
166170
</li>
171+
</ul>
167172
</div>
168173
</html>

0 commit comments

Comments
 (0)