Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
Advice
4 votes
14 replies
281 views

I currently have a block of code looking like this: if (StateA) { DoSomething(); } else if (StateB) { DoSomething(); DoSomethingElse(); } I was thinking there must be an elegant way ...
lenny's user avatar
  • 793
-1 votes
1 answer
61 views

I've applied for the Luau role on the HiddenDevs website five times, but I keep getting rejected. I'm feeling really frustrated and would love some guidance on how to overcome this obstacle. Each time,...
0 votes
0 answers
27 views

Good day, I'm trying to improve my OOP competence and trying to create a code to generate a single window(gui) which hold n checkboxes based on the files the code finds in a specific folder. The idea ...
0 votes
2 answers
103 views

Im currently trying to optimize my code for readability and have run into issues when I'm indexing an array but also need to use negative number. Here's the example: Example Case Explanation since its ...
0 votes
2 answers
122 views

I'm currently trying to build a string parser for an AVR based stepper motor controller. The idea is to observe some input string over UART, then breaking apart this string into several sub-buffers ...
-2 votes
1 answer
58 views

I'm building a REST api which take some inputs like id,customer_id,firstname,lastname,contact,email,updated_time,created_time. Before processing these inputs, i have added validations to check if id ...
1 vote
5 answers
155 views

I have the Enum A, B, C. In a method, I am given two different Enum and must return the remaining Enum. Example: I receive A and C I must return B The solution that I have is to use if elseif else: ...
0 votes
2 answers
359 views

Here is a hypothetical example: I have a market.service.ts with 2 functions called buy() and sell() which are each 100 lines of code export class ShopService { public async buy() { // 100 lines ...
-1 votes
1 answer
249 views

I was wondering if it is better to use directly "content = {}" parameter instead of "{}" despite I see more often people using "{}". Is the code cleaner or does the code ...
0 votes
1 answer
139 views

I'm trying to create a "pixel" layout and manage movements over there for an exercise, and I would love to know a simple/creative way to name and use all the variables without doing terribly ...
0 votes
2 answers
94 views

I'm learning the basic of Python dictionaries and am having an exercise on nesting dictionaries in a list. It basically told me to make 3 dictionaries about 3 people, nest them inside a list, loop ...
-3 votes
2 answers
651 views

I'm following a data structures and algorithms course taught in Python at the moment and the instructor always opts to unpack arrays (well, lists) using a range functions (method 2 below) instead of ...
1 vote
2 answers
118 views

In C, I am calling many functions having to check if they worked. The code gets ~3x bigger because of it! An example: char *myStr = malloc(sizeof(char)); if (!myStr) return NULL; Is there a more ...
-1 votes
1 answer
519 views

A colourful number is one that includes no duplicates in the list of it digits + the products of the subsets of its digits. For example, the products of 263 are [2, 6, 3, 2x6, 6x3, 2x6x3]. These are ...
0 votes
2 answers
596 views

I am trying to import legacy_round from textstat as follows: from textstat.textstat import textstatistics,legacy_round But I get following error: ImportError: cannot import name 'legacy_round' from '...

15 30 50 per page
1
2 3 4 5
...
49

AltStyle によって変換されたページ (->オリジナル) /