Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 235743

Questions about problem solving and planning for a solution through software design.

1 vote

Is it okay to have a class where some attributes won't always be used?

TBH this is just awful. The additional slots are used as a kind of context-specific cache, but this cache is not invalidated when another context is used. Unsetting the rules slot is not really necess …
Hans-Martin Mosner's user avatar
3 votes

Create a reporting service with no fixed pre defined reports

You've already mentioned the options and their pros/cons. You might also want to look at commercially available options for comparison. In any case, the decision should likely be one of economy - how …
Hans-Martin Mosner's user avatar
4 votes

To what extent should you program by "sketching"?

"Sketching" and "Upfront Design" don't necessarily contradict but complement each other. They are somewhat related to bottom-up and top-down approaches. …
Hans-Martin Mosner's user avatar
4 votes

Use the type returned by a function as information

In strongly/statically typed languages, this is generally discouraged, as the static type information is used to determine the legal operations on the results, with opportunities to do type inference …
Hans-Martin Mosner's user avatar
1 vote
Accepted

What do i call a 'Mutable configuration'

Config, or maybe Configuration or Settings. A name doesn't need to convey everything about its functionality and intended usage. The documentation should state that it's mutable and that the program …
Hans-Martin Mosner's user avatar
4 votes

Prevent users cheating a view count

Some people will cheat when the reward is high enough in comparison to the effort and the risk/consequences of getting caught. You've described some ways of cheating, now think like your users and try …
Hans-Martin Mosner's user avatar
4 votes
Accepted

REST API noun vs verb and client vs server responsibility

I would favor a PUT verb on the transaction endpoint to manually set the transaction category, as @keelerjr12 suggests.. However, you need to have a clear understanding about the transaction categoriz …
Hans-Martin Mosner's user avatar
3 votes

How to manage 2 libraries that do mostly the same things in a project?

You already listed two solutions - removing luxon, and removing date-fns - which are unacceptable to you. The simplest remaining option, as ugly as it is, would be to use both libraries side by side a …
Hans-Martin Mosner's user avatar
2 votes

Algorithm for Parking Space Allocator System

The Parking Space Auction Auctions are often used to regulate access to scarce resources, and they are considered a fair mechanism by many people. I'll try to separate mechanism (which is relatively …
Hans-Martin Mosner's user avatar
0 votes
Accepted

A RESTful API for internal company system accessing peripheral devices

There are two aspects: how to handle device access in a RESTful environment, and how to deal with internal versus public services. I don't see any big issues with the first aspect, of course you can …
Hans-Martin Mosner's user avatar
1 vote

Create object(s) to cater for two data sets that are the same entity but one has an addition...

would work for a knowledgeable client even though it is not really HATEOAS (note I'm not a true believer or proponent of HATEOAS, it's just a mental model that allows me to think clearer about RESTful design
Hans-Martin Mosner's user avatar
1 vote

Preventing double submissions using PRG pattern

A simple approach is to embed a unique token in the form which gets sent back with the PUT request, and refuse to process a second PUT with the same token. Of course, nothing prevents the user from l …
Hans-Martin Mosner's user avatar
4 votes
Accepted

How to design a class holding information about a relationship between two interchangable ob...

You just define hash() and equals() for Match such that it is independent of the ordering of thingA and thingB. This can be done like so (pseudo-python): class Match: def hash(self, other): …
Hans-Martin Mosner's user avatar
2 votes

Loop outside method or method with internal loop?

First of all, what you're writing in your examples are not methods but standalone functions. You can write them with any parameters of your choice, although the clarity arguments in Killian's answer s …
Hans-Martin Mosner's user avatar
1 vote
Accepted

Showing posts by their time-decayed score

To expand on my comment: Likes are weighted by an exponential function of t_like - t_ref. To achieve a half-life of one week, you multiply this difference by weight_factor = LN(2)/d_week where d_week …
Hans-Martin Mosner's user avatar

15 30 50 per page