tagged [logic]
How to create a method to return 1 or 0 without using conditions?
How to create a method to return 1 or 0 without using conditions? I was asked a question in an interview to return 1 if provided 0 and return 0 if provided 1 without using conditions i.e if, ternary e...
- Modified
- 7 Aug at 08:21
Where are micro orm tools positioned in the application architecture
Where are micro orm tools positioned in the application architecture Simple statements like this: "Select x,y,z From Customer" are in the Data Access Layer. If there would be logic in the query like f...
- Modified
- 28 Jul at 12:54
C# bitwise equal bool operator
C# bitwise equal bool operator Boolean in C# are 1 byte variables. And because bool are shortcuts for the Boolean class, I would expect that the , operations have been overridden to let them work with...
- Modified
- 31 Jul at 09:45
Why doesn't the C# compiler throw for logical comparisons of null?
Why doesn't the C# compiler throw for logical comparisons of null? I was eating lunch with a friend yesterday and they were complaining about `null` in C#. He stated that `null` was illogical. I decid...
C# Windows Forms App: Separate GUI from Business Logic
C# Windows Forms App: Separate GUI from Business Logic I would like some advice on how to separate the UI and business logic in a simple C# Windows Forms Application. Let's take this example: The UI c...
- Modified
- 18 Jul at 17:54
Looking for simple rules-engine library in .NET
Looking for simple rules-engine library in .NET Does anyone know of a good .NET library rules library (ideally open-source)? I need something that can do nested logic expressions, e.g., (A AND B) AND ...
- Modified
- 2 Feb at 06:34
&& operator behaves like || operator
&& operator behaves like || operator I am a beginner and I've been trying to run a program that prints all the numbers from 1 to N (user input) except for those that are divisible by 3 and 7 at the sa...
How to use LINQ to find all combinations of n items from a set of numbers?
How to use LINQ to find all combinations of n items from a set of numbers? I'm trying to write an algorithm to select all combinations of n values from a set of numbers. For instance, given the set: `...
How to convert "0" and "1" to false and true
How to convert "0" and "1" to false and true I have a method which is connecting to a database via Odbc. The stored procedure which I'm calling has a return value which from the database side is a 'Ch...
- Modified
- 10 Jun at 20:56
MVC: Where to put business logic?
MVC: Where to put business logic? I have taken a look at, for example, [this](https://stackoverflow.com/questions/534233/in-mvc-mvp-mvpc-where-do-you-put-your-business-logic) and a 45+ voted up answe...
- Modified
- 23 May at 11:47
pandas: multiple conditions while indexing data frame - unexpected behavior
pandas: multiple conditions while indexing data frame - unexpected behavior I am filtering rows in a dataframe by values in two columns. For some reason the OR operator behaves like I would expect AND...
- Modified
- 13 Sep at 19:3
Moving MVC-style service layer under WCF
Moving MVC-style service layer under WCF Recently I've been working with MVC4 and have grown quite comfortable with the View > View Model > Controller > Service > Repository stack with IoC and all. I ...
- Modified
- 23 May at 02:18
Check string content of response before retrying with Polly
Check string content of response before retrying with Polly I'm working with a very flaky API. Sometimes I get `500 Server Error` with `Timeout`, some other time I also get `500 Server Error` because ...
- Modified
- 30 Jul at 09:40
PostAsJsonAsync doesnt seem to post body parameters
PostAsJsonAsync doesnt seem to post body parameters I have created an Azure logic app that exposes a REST endpoint. The following JSON body works fine when I call it through postman. I'm able to see t...
- Modified
- 14 Dec at 15:9
What is the optimal algorithm for the game 2048?
What is the optimal algorithm for the game 2048? I have recently stumbled upon the game [2048](http://gabrielecirulli.github.io/2048/). You merge similar tiles by moving them in any of the four direct...
- Modified
- 22 Feb at 03:52
Help with understanding what goes in Controller vs. View in MVC
Help with understanding what goes in Controller vs. View in MVC I'm new to MVC and I'm introducing myself through the Codeigniter framework. As a practice application I'm creating a simple blog applic...
- Modified
- 25 Dec at 03:13
How to implement decision matrix in c#
How to implement decision matrix in c# I need to make a decision based on a rather large set of 8 co-dependent conditions. Each of the conditions from A to H can be true
- Modified
- 3 Jun at 15:58
Select Poorly Used Start and End Dates From Facility Table
Select Poorly Used Start and End Dates From Facility Table I'm using DB2, although a solution using any flavor of SQL would likely be easy enough for me to convert. I didn't design this database, or t...
Elegant way of reading a child property of an object
Elegant way of reading a child property of an object Say you are trying to read this property Somewhere along the chain a null could exist. What would be the best way of reading Town? I have been expe...
- Modified
- 12 Dec at 13:23
Why does ReSharper tell me this expression is always true?
Why does ReSharper tell me this expression is always true? I have the following code which will tell me whether or not a certain property is used elsewhere in the code. The idea behind this is to veri...
- Modified
- 8 Jun at 03:27
C# convert a string for use in a logical condition
C# convert a string for use in a logical condition Is it possible to convert a string to an operator for use in a logical condition. For example or I appreciate that this might not be standard practic...
MVVM - Validation
MVVM - Validation We're trying to figure out validation in the mvvm doing validation in the business logic or model. I've implemented the validate by exception type in our business logic - a simplifie...
- Modified
- 16 Nov at 12:50
Trying to optimise fuzzy matching
Trying to optimise fuzzy matching I have 2,500,000 product names and I want to try and group them together, i.e. find products that have similar names. For example, I could have three products: - - - ...
- Modified
- 15 Apr at 13:24