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.

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
 
71%
+3 −0
Q&A How to add vertical lines for visual separation in pandas plot

One possibility with axvline: import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.DataFrame(np.random.rand(9, 4), columns=['a', 'b', 'c', 'd']) df.plot.bar() plt....

posted 3y ago by samcarter‭  ·  edited 3y ago by samcarter‭

Answer
71%
+3 −0
Q&A What are disadvantages of static functions (ie functions with internal linkage) in C?

Besides what Olin already said, I guess too many people were taught C using K&R book, which was great at the time, but it completely neglects modern SW engineering best practices (encapsulation...

posted 2y ago by Lorenzo Donati‭

Answer
71%
+3 −0
Q&A When using the compare function in Array.prototype.sort, how to avoid an element to be processed more than once?

Create a hash map and precalculate the sort key in it: // Set up: Create mock input let u = ['4', '16', '8', '2', '6']; function expensive_key_fn(x) { console.log("Doing expensive operation...

posted 2y ago by matthewsnyder‭

Answer
71%
+3 −0
Q&A Program freezing in `post_comments_to_lemmy` function due to potential infinite loop

There is no infinite loop. If the dictionary is a string, it is simply skipped. If all dictionaries are strings, than all elements of the finite list are skipped, and the function returns without...

posted 2y ago by __blackjack__‭

Answer
71%
+3 −0
Q&A How to use function composition for applying a function to first elements of a list?

The quick fix is: map (subtract 1) . take n $ l When I put your function in my own Haskell compiler, I get: Possible cause: ‘take’ is applied to too many arguments Remember that in Haskell,...

posted 2y ago by FractionalRadix‭  ·  edited 2y ago by FractionalRadix‭

Answer
71%
+3 −0
Q&A How to solve the "Cannot call from this context" error?

Temporary notice: this is part of an ongoing project of transferring and splitting my canonical from Stack Overflow on common errors in Google Apps Script. As soon as the Q&As are finalized, ...

1 answer  ·  posted 2y ago by Oleg Valter‭  ·  last activity 2y ago by Oleg Valter‭

Question google-apps-script
71%
+3 −0
Q&A How to resolve the mypy error "Returning Any from function declared to return 'Dict[str, Any]'" in Python?

I have a function that loads JSON data and is declared to return a dictionary with string keys and values of any type (Dict[str, Any]). However, mypy is raising an error stating that I am returning...

1 answer  ·  posted 2y ago by ShadowsRanger‭  ·  last activity 2y ago by Moshi‭

Question python mypy
71%
+3 −0
Q&A Problems with Google Apps Script API JavaScript "How to... Execute function"

As this is the first question about Google Apps Script, here is a very brief description: it is a platform that helps people easily get programmatic access to Google apps data like Gmail messages, ...

1 answer  ·  posted 2y ago by Wicket‭  ·  last activity 2y ago by Wicket‭

Question javascript google-apps-script google-cloud-platform
71%
+3 −0
Q&A What are disadvantages of static functions (ie functions with internal linkage) in C?

There are some reasons why a function would intentionally not be declared static. (In the following I use the term 'module', but in contrast to others, I use it not to describe a file or translati...

posted 2y ago by Dirk Herrmann‭  ·  edited 2y ago by Dirk Herrmann‭

Answer
71%
+3 −0
Code Reviews Health checks with caching in ASP.NET Core

Context I noticed that an application was flooding the database with simple SELECTs. The investigation revealed some bugs in the health check which theoretically implemented caching (to avoid quer...

1 answer  ·  posted 2y ago by Alexei‭  ·  edited 2y ago by Alexei‭

Question asp.net-core caching health-check
71%
+3 −0
Q&A Python Parallel plotting and and input reading

Hello everyone, I am seeking help with understanding why multithreading does not work correctly in this example: import time import matplotlib.pyplot as plt import concurrent.futures voltage...

1 answer  ·  posted 2y ago by kek‭  ·  edited 2y ago by kek‭

Question python multithreading concurrency matplotlib
71%
+3 −0
Code Reviews Health checks with caching in ASP.NET Core

private readonly int _checkInterval; What are the units? I have to search for usages to find out. I strongly favour using TimeSpan instead of int. private static readonly SemaphoreS...

posted 2y ago by Peter Taylor‭

Answer
71%
+3 −0
Q&A How to inject environment configuration values when deploying an Angular application in Kubernetes or similar infrastructure?

Context I am currently migrating a Web application from on-prem infrastructure to K8s. The legacy infrastructure relies on defining some tokens in the configuration files and these are replaced d...

2 answers  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by Derek Elkins‭

Question angular configuration deployment
71%
+3 −0
Q&A Adding elements to wrapper after calling wrap doesn't work

I'm trying to do some DOM manipulation in jQuery, but am having issues with creating wrapper elements. For some reason, prepending to the wrapper doesn't work after I call wrap. Code <html>...

1 answer  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by Mithical‭

Question javascript jquery dom-manipulation jquery-wrap
71%
+3 −0
Q&A How to programmatically get current wallpaper file path?

This answer will use Python 3 for code examples. I encourage people to post other answers for other languages. I'll continue to update this answer, as I'm able, based on comments with tested/verifi...

posted 2y ago by ghost-in-the-zsh‭  ·  edited 2y ago by ghost-in-the-zsh‭

Answer
71%
+3 −0
Q&A Strict aliasing rules and function boundaries

Assuming that there are no alignment problems between the two pointer types (impl-defined), the code is otherwise well-defined. As per the quoted 6.3.2.3 C allows pretty much any form of wild and c...

posted 2y ago by Lundin‭

Answer
71%
+3 −0
Q&A How to compress columns of dataframe by function

Problem 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]} ...

2 answers  ·  posted 2y ago by mcp‭  ·  last activity 2y ago by mr Tsjolder‭

Question python pandas
71%
+3 −0
Q&A Strict aliasing rules and function boundaries

Let's analyze this code, assuming an architecture where the alignment of int64_t is the same as that of double: void bar(double *f, int64_t *j) { *(int64_t *)f = *j; } void foo(void) ...

1 answer  ·  posted 2y ago by alx‭  ·  edited 2y ago by Lundin‭

Question c strict-aliasing type-punning language-lawyer
71%
+3 −0
Q&A How do I get something similar to dictionary views, but for sequences?

The dictionary methods .keys(), .values(), and .items() all return view objects. Said objects reflect any changes to the underlying dictionary. This is often useful. Is there a way to get such a v...

1 answer  ·  posted 2y ago by ajv‭  ·  last activity 2y ago by r~~‭

Question python python-3
71%
+3 −0
Q&A memcmp(3) memory containing invalid values

MEMCMP simply compares the memory bits between two locations. This has nothing to do with whatever those bits might mean. Your first example, on the other hand, compares the contents of variable ...

posted 2y ago by Olin Lathrop‭  ·  edited 2y ago by Olin Lathrop‭

Answer
71%
+3 −0
Q&A How do I return ISO day of week in Redshift?

Quick answer (DATE_PART(dayofweek, my_datetime) + 6) % 7 Slow answer For avoidance of doubt, here is what I believe you currently have (assuming an input called my_datetime): DATE_PART(dayofw...

posted 2y ago by trichoplax‭

Answer
71%
+3 −0
Q&A How do I return ISO day of week in Redshift?

I have a query summarizing some transaction data that I'd like to summarize by day of week. For my use case, I need to return weekdays formatted according to ISO 8601, so Monday must be the first d...

1 answer  ·  posted 2y ago by Sigma‭  ·  last activity 2y ago by trichoplax‭

Question sql format redshift
71%
+3 −0
Q&A Is it possible to get the current function in a trace function?

I'm trying to subclass pdb to have a debugger that, in case of a call to a decorated function, can "step in" the decorated function directly and skip the decorator content altogether. A well-behave...

1 answer  ·  posted 2y ago by luser‭  ·  last activity 2y ago by r~~‭

Question python debugging
71%
+3 −0
Q&A Updating the database reverses previous changes

The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...

2 answers  ·  posted 2y ago by Moshi‭  ·  last activity 2y ago by FoggyFinder‭

Question c# entity-framework-core sqlite
71%
+3 −0
Q&A Can Matlab packages have subdirectories?

Well, minutes after posting my question, I found the disappointing answer: no. Original answer found on https://www.mathworks.com/matlabcentral/answers/184191-can-i-have-subdirectories-in-a-packag...

posted 2y ago by zaen‭

Answer