Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
9 replies
142 views

In python 3.12 I have a dictionary of which the keys are 2-tuples of integers and of which the values are integers (as in the function f:N × N → N for which f(n, m) = n + m). What I need is those keys ...
PaulTanenbaum's user avatar
1 vote
0 answers
80 views

I would like to ask if there is a Pythonic way to do dependency injection. I know that most of the ansewrs will be depending on the project. Therefore, let's put a clear example: I am trying to ...
Alex Abades Grimes's user avatar
0 votes
2 answers
107 views

I have a project written in C on STM32 platform. My project source code will be available for multiple hardware. I use CMakeLists For example I have 2 header for the moment hardware1.h and hardware2....
simon's user avatar
  • 1,234
-1 votes
1 answer
57 views

I was trying to implement in a .cpp file the definition of setColor(), which was correctly compiled before within the .h file from Sphere class, but now I get the next linker error: Starting build... ...
Sergio Delgado's user avatar
1 vote
1 answer
305 views

How to fold subroutines in VScode? I am reading Fortran code in VScode, which contain the main program and many subroutines. The VScode can also fold codes but seem randomly. How to make VScode ...
drink water's user avatar
2 votes
1 answer
312 views

What to do in lua if I want to pass a value to foo(), pass it's return to bar(), pass it's return to baz() etc? Exhibit A (pseudocode): backwards(code(reading(like(not(do(I)))))) Exhibit B (...
Andrey Bienkowski's user avatar
1 vote
1 answer
97 views

Let's consider that I have a .NET project and that I have to use a library that is not provided through NuGet but as a dll. folder tree: -> SLN -> Project 1 -> Project 2 Let's say ...
Dimitris Karagiannis's user avatar
0 votes
0 answers
60 views

I am working on a word puzzle game solver that needs to determine whether or not some candidate word is valid. I am storing all of the valid words in a trie data structure, after they have been loaded ...
dg0802's user avatar
  • 3
0 votes
1 answer
194 views

I am a fairly new developer in Python and was getting accustomed to the idea of "Duck Typing". I have a class I used in another module to do particular things with it, for example, access it'...
Parikshit's user avatar
0 votes
0 answers
248 views

I am creating a Nuxt.js frontend/Express backend environment that will house multiple "sub" applications, for instance the structure currently looks like - \-APP \--Backend \---public \---...
Sean McMullen's user avatar
-1 votes
2 answers
363 views

In my C# (.Net 6) backend (but also in other languages) I often face the problem, that I get an object which I need to validate and convert before using it. Currently I handle this by creating two ...
DerOta's user avatar
  • 167
1 vote
0 answers
51 views

Question Summary Hi Folks, This is a kind of opinion question, I've built a Django library for my company and I keep swithering and changing my mind on how to structure it. Possible strategies I've ...
MajorFailz's user avatar
0 votes
1 answer
132 views

I'm making a application in javascript (Nodejs), I'm kinda new to it. My code needs to do multiple congruent requests, I organized my code in async functions so I can linearly call them my first code ...
Mirco0's user avatar
  • 321
7 votes
1 answer
2k views

I have a local swift package Foo which provides two different libraries Foo and FooB. Now I would like to use them in another local package Bar. I am only able to get the whole package by path ...
Quambadeur's user avatar
1 vote
2 answers
107 views

I received feedback: "code test is not at the expected level there's a lack of understanding of async, HTTP clients, and just software development patterns in general. Poor structure and testing&...
Sasa Jovanovic's user avatar
-1 votes
1 answer
674 views

I have two classes: Menu_Buttons, in which there are definitions for methods executed on clicking different buttons in the menu, and PauseMenu, which defines what happens when the Menu key is pressed ...
Marcin Pagórek's user avatar
0 votes
1 answer
89 views

I have currently done with my code transformation on my api data by its roleId. However, I need to display another view which will group the data according to which projectId the users are in. I can ...
Jing c's user avatar
  • 63
7 votes
4 answers
1k views

Suppose I have a list/tuple of strings, COLOURS = [ "White", "Black", "Red" "Green", "Blue" ] for c in COLOURS: # rest of the ...
Shiva's user avatar
  • 2,878
0 votes
2 answers
89 views

I am brand new to React and only semi familiar with JS. I starting making an application using React/Flask/Mongodb, but I am getting tripped up on some of the best way to structure my function calls/...
David Raitzyk's user avatar
0 votes
1 answer
147 views

Different people have told me that in order to improve my Python programming skills, it helps to go and look how existing projects are implemented. But I am struggeling a bit to navigate through the ...
ilja's user avatar
  • 163
0 votes
1 answer
161 views

I want to take my Python (currently Version 3.9.7) programming skills to a next level. Up to now I just wrote some small scripts for myself, that no one hat to review or reuse. Now, I want to write ...
ilja's user avatar
  • 163
0 votes
1 answer
492 views

I have a problem with the structure of my project and i wanted to know what is the best way to solve my problem. I have three components and two level of nesting: my grand parent component: function ...
benyamin nayudi's user avatar
-1 votes
1 answer
163 views

Debugging old code in dynamically typed languages like Python, Ruby, JavaScript, etc. is often a struggle. For example, below Ruby function extracts only the key:val pairs from the result (hash) if a ...
Dante's user avatar
  • 537
2 votes
0 answers
866 views

I'm new to TypeScript and starting development in React/TypeScript in Visual Studio 2022. Is there any tool or extension that could be used to visually browse the structure of TypeScript project or ...
janrovner's user avatar
1 vote
2 answers
360 views

For example, if I want to find 1085912312763120759250776993188102125849391224162 = a^9+b^9+c^9+d the code needs to brings a=3456 b=78525 c=217423 d=215478 I do not need specific values, only that they ...
Mencey's user avatar
  • 69
-1 votes
1 answer
98 views

There are multiple ways of declaring a link with a title or without. I'm wondering whether there is a preferred way of doing it, either official or widely used in the community. Taken from ...
tigerros's user avatar
  • 129
0 votes
1 answer
153 views

I'm wondering how I should structure my code for the pin declarations of my MCP23017 (an I/O expander microchip) and whether I should put that in a function or not. So currently I got the below script ...
MrRaggamuffin's user avatar
2 votes
1 answer
359 views

After have read Clean Architecture by Uncle Bob i have been thinking about the concept of screaming architecture and the last chapter around organizing code. I have generally liked working with layers ...
CEH's user avatar
  • 39
0 votes
1 answer
133 views

I tried to create a function that does the following things. (dont know if its worth mentioning but this function is invoked by another function) connects to aws resources using boto3 gets a the ...
Flo Flo's user avatar
  • 29
-2 votes
2 answers
889 views

The problem set : Letter combinations of a phone The solution I had in mind: def letterCombinations(self, digits: str) -> List[str]: if not digits: return [] digit_map = {'2': 'abc', '3': '...
Jerry's user avatar
  • 426
0 votes
0 answers
152 views

To convert any object into a JSON, we have foo.to_json helper in ruby which returns a string. Similarly, to convert it back to its original datatype, we have to use JSON.parse(json_string), which does ...
Shankar Thyagarajan's user avatar
1 vote
1 answer
1k views

I'm currently designing a discord bot that scrapes a web page that is constantly updating for patches related to a PBE server. I have the bot running through Heroku successfully right now. The issue ...
triplecute's user avatar
0 votes
0 answers
114 views

my Goal is to structure my code with this. The Idea is to outsource an inplementation to elsewhere, so that your main class is not so overloaded with way to much methods. Mixins seamed to be perfect ...
puaaaal's user avatar
  • 340
0 votes
1 answer
77 views

I have kind of a mess in my code. In a parameter tab there are three sliders and maybe in the future there can be even more sliders. let slider1 = document.getElementById("hello_interval_input&...
Aalexander's user avatar
  • 4,984
0 votes
2 answers
138 views

I am currently doing the exercices in Bjarne Stroustup "Programming Principles and Practice Using C++" and I finished the 8th chapter, where he talks about headers and namespaces. Using this ...
PeePeePooPoo's user avatar
2 votes
1 answer
5k views

I have had a look at several different topics on this matter but can't work out how to apply it to my situation. I don't have an init.py in my test folder and I have tried to use conftest. I have a ...
Lucy's user avatar
  • 231
1 vote
1 answer
56 views

For better structure of my script I want to eliminate .then() blocks. I.E. turn callAsyncFunction().then( (result) => { console.log("done"); callAnotherAsyncFunction().then( (...
Colonel Panic's user avatar
4 votes
4 answers
790 views

I have a question, a little bit theoretical: Assume, I have the following classes : interface ReportInterface { void execute(); } class Report implements ReportInterface { private final ...
Dr1231's user avatar
  • 43
2 votes
1 answer
1k views

I am new to git and now facing a git repo 'housekeeping' challenge after deciding to clean up the code structure. There are two dimensions to my challenge: Need to rename suboptimally titled REPO, ...
PeterO's user avatar
  • 43
0 votes
1 answer
316 views

For my software design class we were tasked to make a piece of software that would be designed using Domain driven design. My team and I chose to make a web app where coaches can input statistical ...
Samuel Diaz Bidot's user avatar
0 votes
1 answer
1k views

Under my framework directory, I have the codes organized into groups like- myFramework- (git repository root folder) .git LICENSE README.md myFramework - ...
Natasha's user avatar
  • 6,913
0 votes
3 answers
248 views

In this example I faced the problem of copying the code: void BadExample1() { if (!Initialize1()) return; if (!Initialize2()) { Finalize1(); return; } if (!Initialize3()) { ...
urbanzz's user avatar
  • 147
0 votes
1 answer
41 views

I have a fairly complex-looking (about 50 chars when typed out) equation that is all basic algebra (*, /, +, -, ^). How would I best style it for readability? Condensed, it looks difficult to read and ...
user760900's user avatar
1 vote
2 answers
273 views

In short: I have a console application with a static Dictionaries, which work fine in the project they were written in. How do I reference to this project correctly, so that I can do the same from a ...
Alex Janse's user avatar
1 vote
1 answer
2k views

i got two noob questions about destructure an array: 1st question: when destructuring an object, I can define a new value or a new key or both. On array, can I add a new value without add a new key? ...
nishi's user avatar
  • 550
1 vote
1 answer
802 views

There are two programming approaches: EAFP (Easier to Ask Forgiveness than Permission) and LBYL (Look Before You Leap). First approach presumes doing something that can cause an exception, then ...
Vlad Havriuk's user avatar
  • 1,483
1 vote
0 answers
254 views

I wrote a module that has sorting methods. I also tried to make it more flexible and destructure parameters to sort anything i will set creating object (more or less) but I don't know how to do it ...
Michal's user avatar
  • 11
0 votes
1 answer
578 views

I have the following CSS selector: #AllContextMenus :not(.menu-iconic-left):not(.menu-accel):not(.menu-accel-left):not(.menu-accel-container):not(.menu-accel-container-left):not(.menu-iconic-accel):...
Amazon Dies In Darkness's user avatar
1 vote
3 answers
588 views

Is there a way to use multiple code files in dm-script to structure the code? Something like: import "path/to/utility_functions.s"; utility_functions.do_something_general(); Note that I do not want ...
miile7's user avatar
  • 2,533
0 votes
1 answer
218 views

Reading the instructions here: https://pep8speaks.com/ and here: https://github.com/OrkoHunter/pep8speaks?installation_id=6398017&setup_action=update#configuration I am a bit confused on how to ...
Leockl's user avatar
  • 2,190

1
2 3 4 5