0
votes
0answers
3 views

C# exception handling

I am catching exceptions to provide better information for the logs to make debugging easier in production, I was wondering if this code follows best practices as I'm not really handling the error but ...
-1
votes
0answers
7 views

Cache with a Mutable? [on hold]

I'm wondering if I can get an opinion on this paradigm. It seems functional but the mutable feels redundant. ...
0
votes
0answers
6 views

Best practices for implementing MVVM and MVC in delphi Pascal [on hold]

I'm a Delphi pascal programmer, I use the latest Embarcadero delphi XE, and I would like to take advantage of design patterns such as Model view controller and model view view-model. However, there ...
0
votes
0answers
11 views

Building tree structure based on flat objects

Related classes and enums ...
4
votes
2answers
40 views

Relational schema and query for multiplayer tabletop game

As an exercise, I was asked to design a database schema (for MS SQL Server) for a tabletop game. The requirements were simple: players compete in matches and there are specific match types (e.g. 1v1 ...
1
vote
3answers
45 views

Java sort by selection: which is better in regards to readability and efficiency?

Which algorithm do you think is better in regards to readability and efficiency? selection(): ...
0
votes
1answer
23 views

Dependency injection/dependency injection containers in MVC web app

I just learned about dependency injection/dependency injection containers, and I realize that the controller in my MVC web application is hard to test. My original controller class: ...
3
votes
1answer
43 views

Class refactoring including changing instance methods to class methods and adding singletons

My main goal with this refactor was to change instance methods that should have been class methods in the first place into class methods. My secondary goal was to add singletons to these classes ...
1
vote
1answer
13 views

Checking if an associated object has failed to save/create

I smell something wrong here, but am not quite sure what the most idiomatic way to solve the problem. I have a controller for (job)listings and it has a method ...
2
votes
1answer
26 views

Optimization/speed up of reduction function

I'm working on an implementation of Rainbow tables as part of a project. I understand the main principles behind it had have a working solution. Unfortunately the reduction function portion of my ...
-1
votes
0answers
8 views

MongoDB aggregation pipeline with node.js and php [on hold]

I am trying to run the same query in both node and php. The query works fine in node but gives me a cursor timeout issue in php. I suspect I translated the pipeline wrong. Could someone please take a ...
1
vote
0answers
12 views

Modification of the headline line-height in the Compass vertical rhythm module

One thing nagged me about the compass vertical rhythm module; in the case the headline is too long and it occupies more than one line the line-height between the two lines looks way too massive and ...
3
votes
3answers
153 views

Loading dictionary using trie in C very slow with large data set

The code below works for very small dictionary files I used to test (two words). However when I run this using a more typical dictionary file, my machine slows to the point of near crash. I would ...
0
votes
0answers
6 views

Passing Anonymous Type to a Bound Control [migrated]

Generally speaking, I'm fairly opposed to the use of anonymous types in real-world code (except in LINQ and some other specific scenarios), but I'm looking right now at a situation where I need to ...
-1
votes
0answers
5 views

Passing configuration to a handler [migrated]

I'm building my own JET Parser and one of the things I am trying to do as per the JET specifications is to allow changing of the start and end tags from the default ...
7
votes
3answers
236 views

Ticket management system

I am building a ticket management system for a state server we use at work. Back end is node.js with multiple front ends. I am rewriting my back end to be more maintainable as the scope grows. For ...
5
votes
0answers
32 views

Berlin clock kata in Elixir

I'm starting with Elixir and as exercise I wrote the Berlin Clock kata: The clock is made up of 5 rows. On the very top of the clock is a lamp that blinks to show the seconds. It turns on for one ...
2
votes
0answers
21 views

Type dispatch based on runtime value

Suppose we're implementing an interpreter for the bytecode of some stack machine. Let every element of the stack be a Word8, and let the stack be represented by a ...
-3
votes
2answers
54 views

static factory method alternative to nested switch statements? [on hold]

At first I liked the idea of nested switch statements, but on a second-look, it seems a bit confusing to read. I'm iterating through two enum's as so: ...
0
votes
1answer
31 views

Multiple assignment operations in one statement [on hold]

As I was writing a pretty straightforward loop to map the boundaries of a box, I found that I was doing this a lot: ...
2
votes
3answers
88 views

Another permutator

This is a solution to this problem. The problem statement: write a program to display all possible permutations of a given input string--if the string contains duplicate characters, you may have ...
15
votes
5answers
717 views

Average time to first answer

Just trying out my T-SQL foo. Wrote a script to get the average time (in seconds) to first answer for a specified language. ...
9
votes
4answers
524 views

Using C# properties for simple operations, where should I draw the line?

Should I be putting Linq statements inside of an objects properties? Is that a best practice or is that a no no? Also if that is ok, where do I draw the line with this? I assume db access is ...
-3
votes
0answers
17 views

Linked List pointer [on hold]

I know this is a simple doubt but can anyone explain me how does this line works? Node* newNode = new Node();
2
votes
1answer
37 views

Convert Extension methods to generic methods

I was looking at some Linq queries with multiple join statements. I was thinking that they could be cleaned up using extension methods that hide away the join / where statements. For example: ...
5
votes
1answer
56 views

Do I have too many regexes in my validation logic?

The below function uses Javascript to validate a Belgian telephone number and format it according to the guidelines for phone number formatting. ...
0
votes
1answer
25 views

Update a field in a list of dictionaries [on hold]

I have a piece of code which follows this form. Is this correct or is there a better way? ...
1
vote
1answer
30 views

Is there a better way to handle multiple join statements in a linq query?

I am rewriting a VB.NET app into C#. I won't subject you to the original code. I am mainly looking for a better way to handle all the join statements that are being done. I am dealing with a legacy ...
-1
votes
0answers
25 views
-1
votes
0answers
11 views

using intermediate files for login and other files is secure? [on hold]

i am developing web application. at some point i am using intermediate files. for ex for ex. login user loads login page after submit it redirect to direct.asp or direct.php file. after that direct ...
5
votes
3answers
214 views

Extracting certain records

The purpose of this SQL query would be to extract the record 10192 only, because the end_time is both in the past and its foreign counterpart in the Node table ...
2
votes
1answer
27 views

Reusing select statement

I am checking if there are any rows in a table with some conditions. If there are more than 1 row, it should filter again with some more conditions. ...
4
votes
1answer
36 views

FormBuilder Code Make More Genereic

I want to construct a form builder for an internal project in mvc4. I am using partial views to load the various controls. However I feel that having ten or 20 action-results in my HomeController ...
-1
votes
0answers
23 views

DbManager helper class for Entity Framework [on hold]

I'm trying to do a generic Db cotext helper\manager so I can use it as a dll in many projects with different data bases. I tried to use it with one of my projects but I got confused with the attach ...
-6
votes
3answers
50 views

A good name for exception class [on hold]

In my application there are multiple rules that get executed and because they are mutually exclusive I am expecting only one of them to run and send back the response. In a case where more than 1 ...
4
votes
3answers
35 views

Faster way to group email-date pairs by date without many nested for loops?

Given list of pairs (email-date): ...
12
votes
7answers
852 views

Console application for providing detailed error messages

I'm writing a console application where I need to provide detailed error messages in case anything goes wrong. As a result of this, I find myself splitting up my code into many pieces and making sure ...
3
votes
3answers
43 views

EmailSession in Java Webapp

I have written an EmailSession class to connect and get (unread) mail messages. It is all working, but I would like to see your opinions on any enhancements or ...
2
votes
3answers
378 views

Efficiency of Project Euler problem 35

The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, ...
5
votes
4answers
529 views

PHP OOP Login Class

This is a login class I made for my personal website. What I don't care about, is how secure this login class is, because I know it's not. But it keeps out the rare unwanted guests because I do not ...
-1
votes
0answers
17 views

Correctly calling methods from another C# file in Unity3D [on hold]

so i've seen tons of different ways to call methods from other files, but I'm still really confused at which one is the correct one to use in my case. The way I have it set up right now doesn't work ...
2
votes
1answer
14 views

Find and select image files from webpage

For some reason, I feel like this is a bit messy and could be cleaner. Any suggestions? I'm selecting any image files ending in .png or ...
8
votes
4answers
329 views

Moving character in Unity3D based on accelerometer input

I am building a infinite vertical platformer for mobile platforms using Unity3D. I am using the accelerometer to move the character left and right on the screen. ...
2
votes
1answer
18 views

Generating Cartesian product of strings in R

Sometimes I need to create character vectors like this one: ...
6
votes
1answer
34 views

Unix 'sleep' clone - unsure of safety

I decided to try making some simple clones of the various user-space Unix utilities in an effort to learn the system-specific headers and improve my C skills. The code that follows is a clone of ...
-1
votes
0answers
18 views

C#.net- I how to insert into sql database [on hold]

Using c#.net wpf xaml. Have a form that has borrower information on one side and co-borrower information on other side. The sql database table tblborrowersinfo has the column names ...
1
vote
1answer
38 views

Insertion sorting an int array

I'd like to improve this Insertion sort code ...
5
votes
4answers
107 views

Add-to-cart method has too many conditions

I have a method that seems to be too much for one method. I might be validating programming methodology. I just don't know what to do with it. Would a switch statement be better? Should I break it up ...

15 30 50 per page