Questions tagged [order]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers

Ordering keyword arguments in a function call

In some languages such as Python, the order of keyword arguments in function calls does not matter. But is there a best practice for it? For instance, suppose that a function's signature is def foo(...
Scarabee's user avatar
  • 121
21 votes
4 answers

What does function composition being associative even mean?

When we have a math problem such as 3 + 5 + 2, we say that it is associative. We can choose which step to pick first: 3 + (5 + 2); we know that brackets affect the order in which the operations are ...
pro100tom's user avatar
  • 449
0 votes
1 answer

Remember initial order of list while editing it

The table Let's say we are running a webapplication for the Superhero Association. In there, there is a table of 1 000 000 super villains which need to be watched. Everytime a super hero gathers new ...
sevic's user avatar
  • 109
0 votes
2 answers

Maintaining order of events with multiple consumers in a typical pub sub scenario

I am using Kafka. I am developing a simple e-commerce solution. I have a non-scalable catalog admin portal where products, categories, attributes, variants of products, channels, etc are updated. For ...
rohanagarwal's user avatar
-2 votes
1 answer

What should be the correct architecture in an e-commerce module

I'm new in development & just developing an e-commerce platform. I'm just confuse about the flow of payment. Suppose I have a checkout page where after logged in user has to press the payment ...
Codecraker's user avatar
5 votes
4 answers

Should you unit test order of operations? If so, how?

Imagine a psedo-code class like this which does name comparisons: public class NameComparer { public bool DoNamesMatch(Name name1, Name name2) { if(WholeNameMatch(name1, name2)) ...
Bob Tway's user avatar
  • 3,616
1 vote
1 answer

How to manage stock before to the shipping?

I have a problem with the handling of an order once it has been confirmed and has already been shipped to customers. Suppose our initial order is as follows, and we don't know which customers will ...
Lorenzo Belfanti's user avatar
4 votes
8 answers

Do you create an order before or after payment on an Ecommerce site?

I have a shopping cart with a checkout page. On the checkout page is a payment button which takes them to a stripe payment form. I've read some books on building eCommerce shopping carts in which ...
adam78's user avatar
  • 291
-2 votes
1 answer

Name for object to re-order events received in arbitrary order?

I have a program which generates events. They are ordered with a Lamport clock and sent over the network. They may arrive in a different order. On the receiving end I have an object which re-orders ...
marcv81's user avatar
  • 176
1 vote
2 answers

Binary Search O(log(n)) or O(n)

I see where most readings online derive that the Big-Oh notation of a Binary Search is O(log(n)), but doesn't this assume a balanced tree? What if the tree is completely unbalanced (i.e. similar to a ...
JBurk94's user avatar
  • 29
4 votes
1 answer

Maintain ordered collection by updating as few `order` fields as possible

I'm working on integrating a reorderable lists UI widget with a Meteor.js (MongoDB, in effect) collection: { order: ???, // what type to use here? property1: ..., ... propertyN: ... } Each ...
Dan Dascalescu's user avatar
1 vote
4 answers

Order by different Enum property each row

So I have a list of DefaultSearchModal items that have an enum called TypeSearch in every list item. I would like to order the list to have a different enum property each row. So if you have an ...
Jamie's user avatar
  • 149
3 votes
4 answers

Optimistic & Pessimistic Programming - Ensuring multiple tasks are called only once for specific record

Let's say you have 10 database records which you need to process in the following way: Start Pull 2 records from the database with the 'Processed' flag set to 'false' Call the external web service ...
HABJAN's user avatar
  • 171
2 votes
1 answer

Which layer should order the columns shown to the user when using MVC?

Say you want to render a table with five columns, but you want the order of the columns to be different depending on some specific parameter. This would be very easy to accomplish if the model sets ...
user1323245's user avatar
1 vote
4 answers

Checking for minimum number of command-line arguments, but allowing help switch

I just ran into an odd scenario. I’m sure that I must have run into the same situation in the past and yet somehow not noticed it until now. I am writing a program that requires at least two command-...
Synetech's user avatar
  • 395
10 votes
2 answers

What is the justification for Python's power operator associating to the right?

I am writing code to parse mathematical expression strings, and noticed that the order in which chained power operators are evaluated in Python differs from the order in Excel. From http://docs....
Pieter Müller's user avatar
1 vote
3 answers

Implicitly or explicitly sorted elements?

So, I've got the following problem: I have a number of ordered elements, ordered in the following way: Type 1: Must be the first element. (only one possible, always present) Type 2: Must be the ...
Max's user avatar
  • 2,039
9 votes
3 answers

Ordered enumeration: IEnumerable or Array (in C#)?

Typical context: I make an extension method for a collection which considers that the elements are ordered. The function starts at the beginning, at index 0, and the order has significance. Examples: ...
MPelletier's user avatar
  • 2,048
1 vote
3 answers

Is an assocative array ordered?

An associative array has many common similar names, hash, keymap, map, table, index. It's a map of keys and values but I cannot find a reputable definition of the phrase which tells me whether a map ...
Raynos's user avatar
  • 8,562
65 votes
14 answers

What is best practice on ordering parameters in a function?

Sometimes (rarely), it seems that creating a function that takes a decent amount of parameters is the best route. However, when I do, I feel like I'm often choosing the ordering of the parameters at ...
Casey Patton's user avatar
  • 5,211