Image

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 »
Q&A

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.

General Q&A about programming, scripting, software design & architecture, process, tools, testing, and more.

Filters (None)
66%
+2 −0
Is it UB to read value of heap pointer after freeing?

I've read in a guide that "the use of indeterminate memory for anything, including apparently harmless comparison or arithmetic, can have undefined behavior if the value can be a trap representatio...

3 answers  ·  posted 9d ago by Intel A80486DX2-66‭  ·  last activity 3h ago by Indi‭

c undefined-behavior pointers heap-memory standard
66%
+2 −0
Concise way to capture stderr output in an exception when calling a process from Python

I’d like to call an external executable from a Python script. If it exits with a nonzero code, I’d like an exception containing the return code and the stderr output. The exception will be caught...

0 answers  ·  posted 23h ago by Nick Alexeev‭  ·  edited 6h ago by trichoplax‭

python subprocess
76%
+8 −1
how do I get markdown to render # as a shell prompt and not a comment?

Note: This is a general question about Markdown formatting for any Markdown renderer (e.g., Gitlab, Github, Codidact). So this is not just a question about Codidact's renderer. When displaying she...

2 answers  ·  posted 1y ago by Trevor‭  ·  last activity 2d ago by Karl Knechtel‭

markdown syntax-highlighting
84%
+9 −0
Why is the new auto keyword from C++11 or C23 dangerous?

In older C and C++ standards, the auto keyword simply meant automatic storage duration. As in the compiler automatically handles where the variable is stored, typically on the stack or in a registe...

3 answers  ·  posted 2y ago by Lundin‭  ·  last activity 5d ago by Indi‭

c c++ storage-duration c23 c++11
71%
+3 −0
How to compress columns of dataframe by function

How can I compress each column of a dataframe to the output of a function (i.e., mean), preserving columns? MWE import pandas as pd data = {"A": [1, 2, 3, 4], "B": [5, 6, 7, 8]} df = pd.Data...

2 answers  ·  posted 3y ago by mcp‭  ·  last activity 8d ago by wjandrea‭

python pandas
75%
+4 −0
How to plot a table from a pandas dataframe

How do I generate a table in its own figure from a pandas dataframe? I can generate a bar plot with a table below it, like so: import pandas as pd import numpy as np import matplotlib.pyplot as...

1 answer  ·  posted 4y ago by mcp‭  ·  edited 8d ago by Karl Knechtel‭

python plot pandas matplotlib
80%
+6 −0
Choosing between multiple Python installations (environments) on the same computer

I have multiple installations of Python on my machine. When I run Python, what determines which installation is used? How can I control this?

1 answer  ·  posted 2y ago by Karl Knechtel‭  ·  last activity 8d ago by Moshi‭

python installation runtime-environment
71%
+3 −0
How do I make Phosh consider my app "mobile friendly"?

I'm working on an app for Linux phone operating systems like postmarketOS and publishing it as a Flatpak on Flathub. What steps do I need to take to make it appear as a "mobile friendly" app in the...

1 answer  ·  posted 16d ago by Newbyte‭  ·  last activity 16d ago by Michael‭

linux
22%
+0 −5
Create self-referencing many-to-many relation [closed]

I've turned the tables movies and scenes into media and now I don't know what to do with the movies_scenes relation. CREATE TABLE IF NOT EXISTS "movies_scenes" ( `movie_id` integer, `sce...

1 answer  ·  posted 3y ago by filosoful‭  ·  closed 17d ago by Karl Knechtel‭

database-schema
60%
+1 −0
Parallel execution with algorithms and execution policies

I've just learned about algorithms, ranges and views (from a book), including execution policy such as std::execution::par and I naively tried: import std; int main() { auto values {std::r...

2 answers  ·  posted 17d ago by dode‭  ·  last activity 17d ago by Indi‭

c++ algorithms multithreading
75%
+4 −0
How do I type something different at each cursor when using multi-cursor editing in VS Code?

For example, say I have this CSS: .ocean {} .land {} .sky {} I want to give each of them a background-color, so I use multi-cursors and type: .ocean { background-color: } .land { background...

2 answers  ·  posted 22d ago by wjandrea‭  ·  last activity 20d ago by user253751‭

vs-code multi-cursor
77%
+5 −0
Why is global evil?

Many languages discourage global variables. Why is this?

4 answers  ·  posted 2y ago by matthewsnyder‭  ·  last activity 20d ago by Indi‭

software-practices language-agnostic
71%
+3 −0
Extern keyword in C and proper way to use extern variables in embedded systems

I have an 8-bit microcontroller with 100 pins. Each pin belongs to a port with a unique address and each pin has a number from 0 to 7. I want to create a scheme where in the code each pin is a stru...

2 answers  ·  posted 2mo ago by Carl‭  ·  last activity 21d ago by Lundin‭

c embedded extern
71%
+3 −0
Can all compiler errors be caught by language server?

Here is the reasoning: Compiler error is syntax error Language server can catch all syntax error Therefore, all compiler errors can be caught by language server I have the feeling that this...

2 answers  ·  posted 26d ago by Ooker‭  ·  last activity 21d ago by Olin Lathrop‭

syntax-error compiler-errors ide language-server code-editor
66%
+2 −0
Avoiding checking opcode multiple times in state machine for embedded system

I am implementing a state machine for an electrical relay control board and am trying to follow the principles/structure presented by Lundin here for doing that in C. My machine has currently four...

1 answer  ·  posted 21d ago by Carl‭  ·  last activity 21d ago by Lundin‭

c state-machine embedded
80%
+6 −0
Rails 6.1, trouble with session management, sessions behave weirdly

I am at a complete dead end with Rails sessions. I have an old Rails project. It started with Rails 3 or 4, and it is now running on Rails 6.1.7.10, the code has been updated carefully. I use sess...

1 answer  ·  posted 6mo ago by plain_toast‭  ·  last activity 22d ago by plain_toast‭

ruby-on-rails
77%
+5 −0
Is there any reason not to use the latest version of MISRA C guidelines?

I am contemplating on purchasing a personal copy of the MISRA C guideline document. Looking at their website shows several different versions - MISRA C:2025, MISRA C:2012 3rd ed., MISRA C:2004, etc...

1 answer  ·  posted 1mo ago by Carl‭  ·  last activity 22d ago by Lundin‭

c misra-c
71%
+3 −0
Why can't I use a library I just installed with Pip?

I tried installing package-installation-test[1] using Pip, and it appeared to be successful. But I can't use it as advertised, either by itself or by importing it from my code: Failed attempts ...

1 answer  ·  posted 2y ago by Karl Knechtel‭  ·  last activity 27d ago by carmenelectra‭

python installation runtime-environment pip
80%
+6 −0
Any testimonials for any C++ units of measure library?

The question is about libraries that extend the data type system to ensure physically realistic computations. Think std::chrono but for distance and mass and other things as well as for time. Inste...

2 answers  ·  posted 4y ago by Fred Wamsley‭  ·  last activity 27d ago by Indi‭

c++ units-of-measurement
86%
+11 −0
What does the "\s" shorthand match?

I've seen some regular expressions (regex) using \s when they want to match a space, but I noticed that it also matches line breaks. Example: the regex [a-z]\s[0-9] (lowercase ASCII letter, follow...

1 answer  ·  posted 5y ago by hkotsubo‭  ·  last activity 29d ago by carmenelectra‭

regex whitespace
50%
+0 −0
Are memccpy(3) or strncpy(3) bad for copying and catenating strings with truncation?

I heard strncpy(3) is bad, and also heard that C23 added memccpy(3) to replace it. However, I also heard memccpy(3) is even more terrible than strncpy(3). Are these functions really bad? How so?...

2 answers  ·  posted 2mo ago by alx‭  ·  last activity 1mo ago by alx‭

c string.h
80%
+6 −0
How to parse a date with more than 3 decimal digits in the fractions of second?

I'm using SimpleDateFormat to parse a string containing a date/time, but the result has a different date, hour, minute, second and millisecond: SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM...

1 answer  ·  posted 5y ago by hkotsubo‭  ·  last activity 1mo ago by deleted user

java date simpledateformat date-parsing
90%
+17 −0
What compiler options are recommended for beginners learning C?

When reading questions about C programming from beginners, I very often see them describing peculiar run-time errors and crashes, segmentation faults and similar. They have spent a lot of time chas...

1 answer  ·  posted 5y ago by Lundin‭  ·  last activity 2mo ago by Carl‭

c compiler compiler-errors compiler-warnings compiler-options
71%
+3 −0
How to apply a unit constraint in SymPy

The solution to this is probably easy, but I haven't been able to find it. Using SymPy, I am trying to solve this equation: $$ {x_1}^2 + {x_2}^2 + {x_3}^2 + 3 = a $$ with this constraint: $$ ...

3 answers  ·  posted 2mo ago by Trevor‭  ·  last activity 2mo ago by wjandrea‭

sympy
84%
+9 −0
Can you ever assume that casting pointers is safe?

This was inspired by the SO question Can you ever assume typecasting pointers is safe? I started to write an answer there, but I realized I'd rather post it here instead, so here's a self-answered ...

1 answer  ·  posted 2mo ago by Lundin‭  ·  last activity 2mo ago by Lundin‭

c pointers implicit-conversion conversions
66%
+2 −0
How to link an existing Odysee web wallet to the local lbrynet daemon for automated video publishing?

I'm building an automated content pipeline that publishes daily video briefings from a headless Arch Linux server. The pipeline already works for other platforms (Bluesky, Mastodon, PieFed, Telegra...

0 answers  ·  posted 2mo ago by ShadowsRanger‭

automation odysee lbry api cli
28%
+0 −3
Why is the ground of my Dino game(in PDF) not moving and instead shrinking ?

I'm creating a Chrome Dino-style game inside a PDF using JavaScript form fields . The ground is implemented using two adjacent button widgets that should continuously scroll left to create an infin...

0 answers  ·  posted 2mo ago by Ted‭  ·  edited 2mo ago by Karl Knechtel‭

javascript pdf
60%
+1 −0
Download a PDF file in Playwright instead of opening it in a new tab when clicking on its link

My organisation uses Moodle as their online e-learning system on which teachers share resources, and oftentimes numerous documents that we need to view/download are posted there. The default way of...

2 answers  ·  posted 2mo ago by Elefy‭  ·  last activity 2mo ago by Elefy‭

javascript web-scraping automation playwright pdf
66%
+2 −0
How do I add tags to a PieFed post via the API?

I'm automating posts to PieFed and I can't get tags/labels to actually show up on the created post. What I'm doing I'm POSTing to create a post with a body that includes hash-style tags, somethin...

0 answers  ·  posted 2mo ago by ShadowsRanger‭

automation lemmy piefed webapi tags
60%
+1 −0
Playwright script to generate PDF of a page that requires scrolling (Khan Academy)

Currently I am using One Click Page to PDF to get the job done, although the lack of working open-source tools fit for this task has led me to creating my own; the web page "that won't print" is th...

1 answer  ·  posted 3mo ago by Elefy‭  ·  last activity 3mo ago by ggorlen‭

javascript web-scraping automation playwright html-to-pdf
66%
+2 −0
eclipse templates -- creating and setting a permanent variable

In eclipse (java) Window->Preferences->Java->New new templates can be created. In the field "Pattern" I entered System.out.println("DEBUG ${label}"); ${cursor} I like old-style debug...

1 answer  ·  posted 9mo ago by watchmaker‭  ·  last activity 3mo ago by skye‭

Eclipse
66%
+2 −0
How do authors of custom URI schemas prevent conflict with those registered with IANA in the future?

en.wikipedia.org/w/index.php?title=List_of_URI_schemes states that: Many URI schemes are registered with the IANA; however, there exist many unofficial URI schemes as well. Everyone knows how...

1 answer  ·  posted 3mo ago by Mr. Beedell, Roke Julian Lockhart (RJLB)‭  ·  edited 3mo ago by Karl Knechtel‭

standard uri
83%
+8 −0
Compile-time rounding with the pre-processor

When searching the Internet, I came across this SO post Rounding in C Preprocessor but immediately noted that none of the answers are showing a way to perform actual rounding - rather, they are doi...

3 answers  ·  posted 3mo ago by Lundin‭  ·  last activity 3mo ago by John C‭

c rounding floating-point c-preprocessor
75%
+4 −0
How do websites built by website builders defend security threats or follow secure coding?

There are SaaS providers for building and hosting websites made with WYSIWYG and LLM-prompt website builders, such as WordPress.com, Webflow, etc. I guess these services should be secure-by-default...

1 answer  ·  posted 3mo ago by Ooker‭  ·  last activity 3mo ago by John C‭

security hosting website-builder website
50%
+1 −1
Are metaframework and server-side framework the same?

I occasionally hear the split between framework and metaframework, and then the split between client-side framework and server-side framework. Are they just the same? Sources use "metaframework": ...

0 answers  ·  posted 3mo ago by Ooker‭

javascript metaframework server-side-framework
71%
+3 −0
Integrating a standalone database 'engine' into an OLAP database

I'm trying to build a proper understanding of what an OLAP[1] datastore vs an OLAP data engine is. I tend to put too much value on keywords like "engine" vs "data store." If it has "engine," I thin...

0 answers  ·  posted 2y ago by erjcan‭  ·  last activity 3mo ago by Alexei‭

database olap
80%
+6 −0
Configure Git branch to push to different remote than it pulls from

As a loose follow-up to Why force designation of a remote main branch?, is there a Git-native way to configure a branch for GitHub's so-called "triangular" workflow? The triangular workflow is mea...

1 answer  ·  posted 3mo ago by Michael‭  ·  last activity 3mo ago by r~~‭

git
81%
+7 −0
Why does a lack of object encapsulation constitute a security breach?

In the current version of OpenJDK's JEP 401: Value Classes and Objects (Preview), it is said that value classes can leak data stored in their fields, and that this is potentially a security concern...

2 answers  ·  posted 2y ago by Andreas‭  ·  last activity 3mo ago by roberto almdnde‭

java security encapsulation
81%
+7 −0
How to verify if a year is leap in Java?

How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?

1 answer  ·  posted 3y ago by hkotsubo‭  ·  last activity 3mo ago by roberto almdnde‭

java date
75%
+4 −0
Rails 6.1, unbelievable assets-precompile time for a smallish project

I have an old Ruby on Rails project currently running on Rails 6.1. It isn't very large. I have got the old asset pipeline, 2.7 MB of Javascript in a node_modules folder and 3.7 MB of files in the ...

1 answer  ·  posted 4mo ago by plain_toast‭  ·  last activity 4mo ago by plain_toast‭

ruby-on-rails
50%
+1 −1
JOptionPane doesn't show; application combines Swing and console.

What is wrong in the following code: package oren; import java.util.Scanner; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { double x,y,z...

1 answer  ·  posted 4mo ago by programAngel‭  ·  edited 4mo ago by FractionalRadix‭

java swing Eclipse
60%
+1 −0
Recommended Books on Node.js

I've gained responsibility for some services at work that run on Node.js. I am wondering if anyone could recommend a book on Node. The website documentation is pretty good but I like the structure ...

2 answers  ·  posted 6mo ago by fausty‭  ·  last activity 4mo ago by tsvt‭

javascript node.js
66%
+2 −0
Prevent Azure Synapse Serverless views from returning invalid data after source file schema change

I'm using Azure Synapse Serverless SQL to create views over Parquet files in a data lake. I have encountered an issue where views return invalid results if the source table schema changes. For exa...

1 answer  ·  posted 4mo ago by daviewales‭  ·  last activity 4mo ago by daviewales‭

azure-synapse
66%
+2 −0
How should I structure a growing Python project?

I’m working on a Python project that’s starting to grow, and the code is becoming harder to manage as different responsibilities are mixed together. Are there any recommended ways to organize modul...

3 answers  ·  posted 7mo ago by deleted user  ·  last activity 4mo ago by deleted user

python
83%
+8 −0
What's the difference between =, == and === operators in JavaScript?

While learning JavaScript, I started to see =, == and === operators. What's the difference between them?

4 answers  ·  posted 5y ago by Kevin M. Mansour‭  ·  last activity 4mo ago by deleted user

javascript operators
71%
+3 −0
Unset background colour in shell script

Inspired by the screenshots in this otherwise unrelated article https://itsfoss.com/tennis-csv-tool/ I'd like to highlight some lines in the terminal output of one of my zsh shell scripts. Here a ...

1 answer  ·  posted 5mo ago by samcarter‭  ·  last activity 4mo ago by Alexei‭

shell zsh
60%
+1 −0
How can I create a Typst document that adheres to the OS font?

I provide documents that must be accessible to the dyslexic and [my/hyper]opic. With CSS3, I am able to specify system-ui, where required. However, all browser stylesheets default to that, regardl...

0 answers  ·  posted 5mo ago by Mr. Beedell, Roke Julian Lockhart (RJLB)‭  ·  edited 4mo ago by Mr. Beedell, Roke Julian Lockhart (RJLB)‭

markup
89%
+15 −0
What is the general process for merging two git branches, reviewing edits on each branch?

Suppose you have a largish git repository with many files of different types (both text and images) distributed among a number of nested directories. Parallel development has occurred on two branc...

3 answers  ·  posted 2y ago by SystemExplorer‭  ·  last activity 5mo ago by Karl Knechtel‭

git
44%
+2 −3
i just want to print the data in postgresql database into a dictionary. [closed]

I'm new to python. I just want to print the data in postgresql database into a dictionary. The database consist of 3 column (name, department, overall_percentage) and I have 3 tables of class A, B...

0 answers  ·  posted 5mo ago by prem‭  ·  closed 5mo ago by Karl Knechtel‭

python postgresql dictionary
77%
+5 −0
Why does my regex "match" at the beginning of the string, but not at the end?

My impression is that the regexps behave a little bit odd: >>> import re >>> r=re.compile("test") >>> r.match("test") <re.Match object; span=(0, 4), match='test'&g...

2 answers  ·  posted 1y ago by peterh‭  ·  last activity 5mo ago by Karl Knechtel‭

regex python-3