The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
125 views

Understanding bitmap logic

I was going though this blog and it says You can represent a list of distinct integers no larger than N using exactly N bits: if the integer i appears in your list, you set the i th bit to true. ...
7
votes
5answers
297 views

In retrospect, has it been a good idea to use three-valued logic for SQL NULL comparisons?

In SQL, NULL means "unknown value". Thus, every comparison with NULL yields NULL (unknown) rather than TRUE or FALSE. From a conceptional point of view, this three-valued logic makes sense. From a ...
2
votes
3answers
405 views

Is “code that generates code” really all that great?

I was looking through CodePen's "popular pens" and I noticed this cool little spiral animation somebody made with a seemingly ridiculously small amount of code. This is quite impressive until you ...
0
votes
1answer
107 views

Calculating WPM given a variable stream of input

I'm creating an application that sits in the background and records all key presses (currently this is done and working; an event is fired every keydown/keyup). I want to offer a feature for the user ...
1
vote
2answers
385 views

C# Logic - gaps & Islands

I am looking for help designing the display of available times for appointments (for example a hairdresser's appointment book). Currently I have a query that returns a collection of periods that are ...
4
votes
2answers
693 views

Logic design question for SQL query

Was wondering if you could help me on a SQL problem I’m having. I have a set of records of events where each event has a start time and end time. No event has the same start time, and the end time ...
1
vote
1answer
179 views

Finding possible positions for rectangle in a 2-d array

Well, the title is not very appropriate, please read on (I couldn't get a better one). Note: Using Python 2.7, but an algorithm will help too. I'm making a side scroller game, in which I am ...
-1
votes
2answers
240 views

How to remove data redundancy in a table? [closed]

F1 F2 F3 C1 C2 C3 ------------------------------------------------ A B C 1 D E F 2 A B C 3 D E F 4 A B C 5 D E F 6 ...
3
votes
1answer
82 views

Tests for emptiness vs tests for nothingness

Is there any consensus between languages how tests for emptiness are distinct from tests for noneness? In python the following expression is false: {} is {} However this expression evaluates to True ...
9
votes
2answers
1k views

How to unit test method that returns a collection while avoiding logic in the test

I am test-driving a method that is to generate a collection of data objects. I want to verify that the properties of the objects are being set correctly. Some of the properties will be set to the same ...
5
votes
4answers
347 views

In which order should I do comparisons? [duplicate]

I'm a strong proponent of writing if statements like this: variable == constant Because to me it just makes sense, it is more readable than the inverted: constant == variable Which seems to be ...
1
vote
2answers
303 views

How Do Computers Process Conditional/Input/ Event Based Code?

I understand that computers are basically a complex system of electrical signatures that can calculate based on logic boards, and some sort of gate mechanism, but how do computers process something ...
3
votes
3answers
220 views

Matching up articles with similar ones

I am creating a site where people can write on a niche topic. It is almost like a blog, however the area as I mentioned is a small niche with (hopefully) passionate users. I want a functionality ...
2
votes
1answer
2k views

Mobile number validation

I am trying to find best way to validate a mobile number with in a country. Currently my understanding is: User can enter whatever format they want in mobile numbers and its a waste of time and ...
5
votes
4answers
6k views

How do I improve my logic in general and programming in particular? [closed]

I'm good with understanding technology and implementing it. At least that is what I feel. But it seems that when I come across experienced programmers they point out that my logic is weak. I feel that ...
-1
votes
4answers
137 views

Identifier for the “completed” stage of a process: 0, 99, something else?

Say, that you are handling a multi-step process (like a complex registration form, with a number of steps the user has go through in order). You need to be able to save the current state of the ...
15
votes
8answers
3k views

Teaching logical/analytical thinking

I have been trial running a club in which I teach programming for the past year and while they have progressed what they really lack is the most fundamental concept to programming, analytical ...
6
votes
5answers
2k views

Why is there both a short-circuit OR as well as unshort-circuited variation of that operator in C#?

Periodically, I wonder about this: The short-circuit OR would always return the same value that the unshort-circuited OR operator would? I expect that the short-circuit OR would always evaluate ...
12
votes
8answers
14k views

Techniques to increase logic at programming [closed]

I am into programming since last 3 years. But I seems to be lost in it. I am not able to get good at it even though I code everyday. suppose I solve one problem, I will wander from solution to ...