Skip to main content

Questions tagged [programming-logic]

According to Wikipedia, Logic (from the Ancient Greek: λογική, logike)[1] has two meanings: first, it describes the use of valid reasoning in some activity; second, it names the normative study of reasoning or a branch thereof.[2][3] In the latter sense, it features most prominently in the subjects of philosophy, mathematics, and computer science.

1 vote
2 answers
931 views

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node. I understand the asynchronous features are useful in many situations, but when I debug my code,...
SupaCowaFraja's user avatar
3 votes
3 answers
574 views

I work on a survey that has a lot of questions. This means we have a lot of columns/variables to work with. This translates to a lot of conditionals that have to be done a certain way according to a ...
SunflowerLuau's user avatar
-1 votes
1 answer
1k views

I have a function to fetch data from remote API and store it in local database. Its logic is: Is network available, if yes proceed to next step, if no show error massage. Is app launched for first ...
Abdelaziz Faki's user avatar
1 vote
1 answer
161 views

I have a question and answer trivia game app which randomly picks questions from a database and prompts the user to answer the question correctly. The total number of correct answers, the total number ...
user1527613's user avatar
-2 votes
1 answer
818 views

I have the below default method in an interface and it seems to be pretty complex because of the many if-else conditions. default void validate() { Application application = application().get(); ...
AnOldSoul's user avatar
  • 173
-3 votes
2 answers
130 views

I am writing a paper trading system, and what I have works, but I can't help but feel that there's a better way to partially close a stock position; what I currently have seems a little overboard. ...
Taco's user avatar
  • 1,175
2 votes
1 answer
421 views

Consider the following example in a CRUD application. A user can select their favourite food from a dropdown list ("Burgers", "Pies", "Chips"). This is an optional field i.e. not mandatory. Thus a ...
Aveer28's user avatar
  • 131
6 votes
2 answers
2k views

Absolutely academic context question- I found countless articles listing the order of operator precedence in all languages, but what is the logical reasoning behind that specific order? For clarity ...
Benson's user avatar
  • 79
0 votes
1 answer
117 views

Software I'm working on requires simulation of logic circuits, both combination and sequential. Now the simulation doesn't need to be too detailed, in fact it could be detrimental to the function of ...
user1561358's user avatar
66 votes
16 answers
16k views

I was recently writing a small piece of code which would indicate in a human-friendly way how old an event is. For instance, it could indicate that the event happened “Three weeks ago” or “A month ago”...
Arseni Mourzenko's user avatar
0 votes
3 answers
223 views

I am developing a website to store books info such (title, book_no, author, edition, container...). I have two types of insert insert series of books (Eg: harry porter series: chapter 1, 2,3...) ...
Sam's user avatar
  • 113
1 vote
1 answer
221 views

I have a function that creates a new object by passing to it's constructor integer ids primarily with values of 0. This function is called when saving a newly created record (not an edit). public ...
samus's user avatar
  • 475
4 votes
2 answers
7k views

In reference to one interface control document, I found difficulty in understanding this concept. There is one parameter having LSB of 0.0625 and MSB of 2048 that should be transmitted from one piece ...
Master shifu's user avatar
3 votes
3 answers
828 views

In a generic sense, my question goes something like this: if (p) { if (q) { a(); } else { b(); } } else { if (q) { c(); } else { d(); } } There ...
Kyle Delaney's user avatar
12 votes
3 answers
3k views

We all know De Morgan's Laws !(a && b) === (!a || !b) !(a || b) === (!a && !b) Is there a community consensus around which one of these representations is easier to reason about (and ...
Abraham P's user avatar
  • 289

15 30 50 per page