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 ajv‭

13 posts
87%
+12 −0
Q&A How do I support tab completion in a python CLI program?

I spend a lot of time writing CLI tools in Python, and I would like to support tab-completion in a style similar to Git. For example, subcommands should be tab-completable, options should expand ba...

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by hkotsubo‭

86%
+11 −0
Q&A What is malloc's standard-defined behavior with respect to the amount of memory it allocates?

I recently told a friend that malloc(n) allocates and returns a pointer to a block of at least N bytes of memory, as opposed to exactly N; that it is allowed to allocate 'extra' memory to meet e.g....

2 answers  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by bta‭

85%
+10 −0
Q&A Different behavior with relative imports when using flask vs py

I don't have a py command on my system; for purposes of this answer I assume it's an alias to the python executable. Running a script from a file is not quite the same as importing it. A script giv...

posted 4y ago by ajv‭  ·  edited 4y ago by ajv‭

Answer
84%
+9 −0
Q&A Is it dangerous to use json.loads on untrusted data?

I manage a wsgi application that accepts JSON data via POST from potentially untrusted sources. Normally it is treated as a text blob and never parsed, but there is a value in the expected input th...

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by hkotsubo‭

Question python json security
81%
+7 −0
Q&A How do I customize merge behavior for a shared git repo?

I often find it useful to arrange things so that each commit on master's first-parent is a discrete change. It allows git log --first-parent --oneline to be used as a concise, automatically-generat...

1 answer  ·  posted 4y ago by ajv‭  ·  last activity 1y ago by GrantMoyer‭

Question git git-merge
81%
+7 −0
Q&A How do I ask git-show-branch to display a commit range?

For some tasks, I find git show-branch easier to follow than git log. For example, inspecting the history on someone's PR before merging it. git show-branch master topic stops at the first common ...

1 answer  ·  posted 3y ago by ajv‭  ·  edited 3y ago by Alexei‭

80%
+6 −0
Q&A How are integers interpreted in contexts that expect a date?

I found a confusing construction in several stored procs in an MS SQL 2008 R2 database: DATEADD(dd, 0, DATEDIFF(dd, 0, some_date)) As I understand it, these are the relevant function signatures: D...

1 answer  ·  posted 4y ago by ajv‭  ·  edited 4y ago by Alexei‭

Question sql tsql sql-server
75%
+4 −0
Q&A Fixing vertical discrepancies with CSS

I'm not familiar with Drupal, but I would do this with CSS Grid. One possible example looks like this: <html> <head> <style> .menu-container { display: gr...

posted 3y ago by ajv‭

Answer
71%
+3 −0
Q&A What options can be set via swing.properties?

The default Swing look and feel can be set in $JAVA_HOME/conf/swing.properties What else can be set in this file? I can't find any other documentation of it.

1 answer  ·  posted 4y ago by ajv‭  ·  last activity 4y ago by Stephen C‭

Question java swing
71%
+3 −0
Q&A How do I redact values when Save()ing a yaml structure with YamlDotNet?

I handle several projects that use yaml files for configuration, and load them with YamlDotNet. It is sometimes useful to log the effective configuration when the program starts, to aid future debu...

0 answers  ·  posted 3y ago by ajv‭  ·  edited 3y ago by Troy‭

Question c# .net yaml yamldotnet
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 1y ago by ajv‭  ·  last activity 1y ago by r~~‭

Question python python-3
70%
+5 −1
Q&A How do I get the error message out of a requests exception?

I'm trying to log error messages from Requests exceptions. Example: try: make_web_request() except RequestException as ex: logging.error(ex) Example output: ERROR : ('Connection abo...

2 answers  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by hoverhell‭

Question python http-request
66%
+2 −0
Q&A How do I configure log4net from an arbitrary data structure?

I'm used to working in Python, but my current project is in C#/.NET and uses log4net for logging. Out of the box, log4net uses an XML file for configuration. I dislike XML and want to use something...

1 answer  ·  posted 3y ago by ajv‭  ·  last activity 3y ago by Peter Taylor‭

Question .net log4net