0
votes
0answers
4 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 ...
1
vote
0answers
9 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 ...
0
votes
0answers
5 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 ...
0
votes
0answers
7 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 ...
2
votes
3answers
20 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 ...
4
votes
3answers
70 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 ...
2
votes
0answers
21 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
20 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 ...
-1
votes
2answers
41 views

static factory method alternative to nested switch statements?

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
29 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
69 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 ...
14
votes
5answers
498 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. ...
6
votes
3answers
269 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
34 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: ...
4
votes
1answer
52 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
23 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
29 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 ...
0
votes
0answers
22 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
210 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
35 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 ...
0
votes
0answers
22 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 ...
-4
votes
3answers
40 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
32 views

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

Given list of pairs (email-date): ...
12
votes
7answers
739 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
42 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
375 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
520 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 ...
0
votes
0answers
15 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
13 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
322 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
32 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 ...
0
votes
0answers
16 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
36 views

Insertion sorting an int array

I'd like to improve this Insertion sort code ...
5
votes
4answers
103 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 ...
0
votes
1answer
27 views

Basic User Interaction in Python - syntax, docstrings, performance

Hoping for input on the clarity of the docstrings, syntax and performance of these two functions both of which should be self-explanatory: ...
2
votes
1answer
21 views
3
votes
1answer
28 views

Erlang pattern matching excersise

I recently started my first project with Erlang. I've been skimming documentation and various books to get the information I need, and it's going well, but now that I have something that works I want ...
-5
votes
0answers
44 views

how to use this code? [on hold]

I am a newbie,and I want to store passwords in a database encrypted, but I can't understand what goes here: ...
0
votes
0answers
15 views

Simplifying Rails routes [on hold]

I have next routes: resources :books do get 'page/create_page' => 'pages#create_page' get 'page/new_page' => 'pages#create_page' end That compiles ...
7
votes
3answers
107 views

MySQL update with PHP; MySQLi prepared statement in loop

I'm going to develop an Android application that performs simple MySQL operations by invoking server-sided PHP scripts. PHP-MySQL communication is done by MySQLi extension. Each operation that I'd ...
10
votes
3answers
335 views

Efficiency of this constantly running time processor for an HTML5 video control bar

I built a custom HTML5 video control bar, and for each second, it updates two readings: Time Elapsed Time Remaining in hh:mm:ss notation, like so: Because of how often this function runs, I ...
2
votes
3answers
70 views

Finding Pythagorean Triple that sums to 1000

I am doing this project euler question #9. https://projecteuler.net/problem=9 I have implemented the code but I feel like it runs slow and doesn't perform well enough. Here is the code for the ...
6
votes
2answers
159 views

Forum Sign up and Sign in software

I would love to have your reviews of this sign in and sign up system. You can see the main structure: For now, I have a total of 13 files (index.php, ...

15 30 50 per page