Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts by aghast‭

9 posts
71%
+3 −0
Q&A What guarantees does Bash make about order of :- Parameter Expansion when it is not in POSIX mode?

I tried to check info bash but only got a copy of the man page. This is when I learned that I could apt install bash-doc to get the "full" Bash manual. After checking both the info pages and the m...

1 answer  ·  posted 9mo ago by aghast‭  ·  last activity 8mo ago by Quasímodo‭

Question bash
66%
+2 −0
Q&A How do I (compactly) initialize a 2-d array of structs with the same value?

I learned about the ** operator for array-repeat, and I love it. I have a struct that contains a 2-d array of inner structs, like const D1 = 30; const D2 = 40; const Inner = struct { .a: u32, ....

0 answers  ·  posted 2y ago by aghast‭

66%
+2 −0
Q&A When should I parenthesize macro arguments in C?

With macros, you are better off using parens at any time you use one of the parameters in an expression context. The problem with operator precedence is not limited to + and *. Did you know that c...

posted 12mo ago by aghast‭  ·  edited 12mo ago by aghast‭

Answer
66%
+4 −1
Q&A What is the difference between hashing and encryption?

I would say the difference is one of intent. In encryption, the objective is to hide the information contained in such a way that third parties cannot get it, but approved second parties can retri...

posted 9mo ago by aghast‭

Answer
66%
+2 −0
Q&A How would I display the first line of all files matching a glob?

The first line of a file is head -1. But you probably also want the file name. So something like: for file in glob do first_line="$(head -1 "$file")" printf "%s: %s\n" "$file" "$first_l...

posted 6mo ago by aghast‭

Answer
66%
+2 −0
Q&A How do I trim a sorted list in Python?

The library module itertools provides a function called dropwhile(). The example they give is: dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8 So, to get a list of numbers greater than 4, d...

posted 5mo ago by aghast‭  ·  edited 5mo ago by aghast‭

Answer
60%
+1 −0
Q&A What is the purpose of having underscored names and then defining a non-underscored alias to it?

Quoting here the 1999 C standard, as being close enough to "this century" while also being hella old. Source: ISO/IEC 9899:1999 7.19 Input/output <stdio.h> 7.19.1 Introduction 1...

posted 11mo ago by aghast‭

Answer
60%
+1 −0
Q&A What does the static keyword do in C?

static is an unfortunately heavily overloaded keyword. At "file scope" Symbols are said to be at "file scope" if their definition is not inside a function. When the static keyword appears at fil...

posted 5mo ago by aghast‭

Answer
57%
+2 −1
Q&A How to pass in a readable file (stream) to a Zig function?

Most of the example code in the Zig online docs is in the form of test blocks. Sadly, this means there aren't quite enough examples of how to write functions. Given that one has a readable file, p...

0 answers  ·  posted 2y ago by aghast‭