0
votes
0answers
6 views

Best way to comment regex [on hold]

Regular expressions are one of the worst aspects of debugging hell. Since they are contained in string literals, It's hard to comment how they work when the expressions are fairly long. Say I have ...
3
votes
0answers
15 views

Searching for files in a specified directory

I am currently writing a program that allows me to search for files in a user-specified directory. My current code is as follows: ...
1
vote
2answers
18 views

Java implementation of the Factory Method pattern

I am working on a very simple game and thought it would be a good opportunity to learn and use the Factory Method pattern for creating game objects. I studied the pattern but I'm a bit confused about ...
0
votes
0answers
13 views

Solving sudoku in C [on hold]

After hearing about backtracking , i wrote this piece of code to solve sudoku , but it seems to give wrong solutions , what exactly i am doing wrong here ? ...
1
vote
1answer
16 views

Parsing httpline

I have an HTTP server class (.hpp & cpp). I am trying to improve reserve data from the socket class because I have s.getline() to get HTTP call. My ...
1
vote
1answer
17 views

Does the class have unnecessary and violating Single responsibility principle method?

I encountered with the following code in the work. The MyItemCoordinator should receive MyItem objects, process them, add them ...
2
votes
1answer
17 views

Python Email Program

I've written this email program in Python, and I would like to get some feedback on it. (i.e. closing the server twice after the raw input, etc.) ...
1
vote
0answers
16 views

Building a dict/list of lists?

I have code which is matching features within regions. The first thing it does it matches features from one region to an entire database of region features. So I have a mapping from query feature ...
1
vote
1answer
11 views

Cleaning up repeated calls to NSMakeRange()

In Objective-C, many of the NSString or NSMutableString methods for comparing or manipulating strings require a range argument--that is, an argument of data type ...
1
vote
0answers
12 views

DiagnosticAnalyzer for Roslyn that guards against catch-all exception clauses

Dabbling around with Roslyn and made a small analyzer just now. This one will show a warning in Visual Studio when you have a try-catch statement that only has a ...
4
votes
3answers
98 views

Find Minimum Number of coins

Please be brutal, and treat this as a top 5 technical interview. I am trying to follow Google's way of writing Java code, as per their .pdf file online of code review. (Side note: do any of you see ...
2
votes
0answers
34 views

Using an int variable as index in an array

I am putting together a fairly simple server that listens for a connection then creates this thread - textbook Java code - then accepts data on that connection. I am following a protocol that the ...
5
votes
1answer
29 views

Tree Template Class Implementation for C++

I have not done any parameter checking, however I think the meat of the class is there. Let me know what you think. ...
2
votes
0answers
22 views

node.js Passport Wrapper 3

First attempt was done here Second attempt was done here Huge comment at top ...
1
vote
1answer
15 views

Aggregation of a collection of object's nested array-properties

Use Case So our lead programmer loves to follow the NIH Anti-Pattern and consequently I'm not allowed to use Underscore.js and can only use Vanilla JS... and we have to support IE8. The goal is to ...
8
votes
2answers
133 views

Reading text from 2 files

I've got 2 simple text files: besede.txt To je vsebina datoteke z besedami. V njej so razlicne besede ki imajo lahko pomen ali pa tudi ne. skrivno.txt 4 3 19 2 3 2 4 3 I wrote a ...
3
votes
1answer
22 views

More efficient way to make a Tweeter status in a string of just words

I am making an application where I will be fetching tweets and storing them in a database. I will have a column for the complete text of the tweet and another where only the words of the tweet will ...
2
votes
1answer
14 views

jQuery for image swapping and some JS for text swapping

I am designing a website for a company that manages buildings/real estate. I did not have much use for a CSS library like Bootstrap or Foundation, except on one page of the website. This page ...
6
votes
3answers
215 views

Looping through an Excel document in C#

Before looping through an Excel document using a library I found, and wanted to know how long it would take to loop through the whole thing. There are 40k rows. I looped through only the first 5k ...
2
votes
2answers
42 views

Recursive function for listing directories [on hold]

The below code is recursive function that list directories in 2 levels: ...
8
votes
1answer
30 views

Sort function to sort item numbers separated by colon

Below is my code. This is a function that will be applied as a sorting method to a grid based data set. The data in the column to be sorted can be stuff like: ...
7
votes
1answer
41 views

Making line by line replacements using values from multiple arrays

I currently have a Python script that parses a file (in this case an XML file) and makes line by line replacements as necessary, depending on the values of multiple arrays. As it stands now the script ...
4
votes
2answers
85 views

Project Euler Problem 11: Largest product in a grid

Here is my implementation to project Euler Problem 11. I did this problem a bit later, when I learned how to input from a txt file. The problem context can be seen here. I did add "\n" to the end of ...
3
votes
2answers
51 views

Is there a “prettier” way of forming this query, or a more efficient way of joining the tables?

Yesterday I posted a question involving multiple nested queries. The queries pulled information from the database and created a directory listing of all employees. There are two many-to-many ...
3
votes
0answers
17 views

Echo Server with CompletableFuture

I recently wrote a simple echo server in Java 7 using the NIO APIs so it was asynchronous and non-blocking. Then I decided, as a learning experience, to redo it with Java 8 hoping to use a more ...
8
votes
6answers
352 views

Binary search use in simple guessing game

I'm making a simple guessing game in C. Basically what I need is some help double-checking my work, more specifically a verification that the my binary search in my case statements look okay. The goal ...
8
votes
2answers
59 views

Concurrent task processing queue

I can have a maximum of three concurrent threads processing tasks. Each of these threads can process 1 to 100 tasks simultaneously (by connecting to an external system). The time taken to process 100 ...
3
votes
1answer
64 views

OOP between projects

So, I wanted a separate project to act as the data layer for my website project. Classes in the website should reference the data layer after getting input from the user and should get back ...
1
vote
0answers
23 views

Follow-up: Timer utilizing std::future

The previous code (as displayed in Timer utilizing std::future) is now: ...
3
votes
1answer
42 views

Hackerrank - Sherlock and the Beast

I am trying to solve the Sherlock and The Beast HackerRank challenge. Most tests timeout, however when I try a custom stretch test case (T = 20 and all N = 100000), it returns successfully, so I'm not ...
1
vote
0answers
19 views

Optimized Form fields generating class

I am building an application full of forms and so I thought it is good idea to create a class to populate form fields. Here is my class and I am sure it can be optimized more than now and could be ...
1
vote
0answers
24 views

Basic templating engine in F# using F# syntax

I've been working on a rough idea for a templating engine (mostly as a learning project) using the F# syntax. How "correct" is my code in terms of being idiomatic F#? Are there F# features which would ...
7
votes
3answers
257 views

Generate sequence in linq

I want to generate a sequence using linq that goes form 10 to 100 with a step size of 10. The sequence also must contain a custom value (in the correct order). This is what I have now, and Im ...
0
votes
0answers
19 views

provisionary polymorphism or cast? [on hold]

I have interpreter, which passes the values through the stack. The procedure expects that value is of specific type. It looks something like ...
1
vote
5answers
76 views

Find the value nearest to k in the sorted array

Given a sorted array returns the 'closest' element to the input 'x'. Note, I do understand merits of unit testing in separate files. But deliberately added it to main method for personal convenience, ...
2
votes
0answers
30 views

Sprite drawing class improvement

I have written a very Xna spritebatch like interface for drawing sprites in opengl. When begin is called the vertex data buffer is mapped to a float*. The index buffer and vertex buffer are bound in ...
3
votes
2answers
35 views

C# with Oracle ODP.NET

...
0
votes
0answers
29 views

Captcha Maker program in python [on hold]

I have written a program to create an image consisting of randomly generated numbers using PIL. I have stored the numbers generated and compared it with user's input. ...
5
votes
2answers
77 views

Creating date strings and setting dates

I've created a Java class, Date, in which I basically create date strings and set dates. Is there anything I can do besides adding comments to improve/shorten my ...
0
votes
0answers
34 views

Group By And Two Counts

I'd like to know if there's any better way to write this query: ...
1
vote
1answer
44 views

Simple SAT Solver In Python

I am interested in improving my coding standards in Python so I decided to post one my more recent and smaller "for fun" projects here for review. The code below implements a rather simple ...
1
vote
1answer
30 views

A source Code Counter

This is from my project codecount I use personally that is very similar to cloc.exe or SLOCCount. The part that I am questioning is where I am calculating when I am in a comment block and have deep ...
1
vote
1answer
25 views

Kings Cup drinking game

I'm working on a card game in Java that simulates the drinking game Kings Cup for a school project. I'm having trouble putting the pieces together, and was wondering if someone could tell me what I ...
2
votes
2answers
39 views

Transfer the format of an old string to a new string

First, I've extended the String class to detect uppercase and lowercase characters: ...
6
votes
3answers
192 views

Conditional statements relating to hospital management

It works just fine, but is there any other way to write this shorter? Nurses are only available to intensive care patients (room I) and TV's and telephones are only available to non intensive care ...
-1
votes
0answers
23 views

Program Settings using Adapter pattern [on hold]

I'm working on a program at work that is both a keyboard wedge and keyboard hook. I may have made a mistake on the two wedge configurations, but I have 1 wedge as a base which just takes a com port, ...
-3
votes
0answers
33 views

99 bottles of beer on the wall [on hold]

I am going through Chris Pine's Learn to Program Ruby Book. One of his chapter 6 exercises is to write a program for the 99 bottles of beer on the wall song. I was struggling so I googled for some ...
0
votes
0answers
7 views

Confused about unsigned in C [migrated]

#include <stdio.h> #include <stdlib.h> int main(void) { unsigned int i; i = -12; printf("%d\n" , i); system("pause"); return 0; } ...
0
votes
1answer
41 views

Would multiple joins boost performance, or are the nested queries an acceptable way to handle the situation?

I'm working on a directory that lists employee information. Each employee can belong to multiple departments and each employee can have multiple job titles. I have 5 ...
0
votes
0answers
19 views

Python for loop [on hold]

I have a basic for loop in python that I'm wanting to run whereby I call a function and pass in a parameter that is varying from 480 to 6000 in increments of one...thus... ...

15 30 50 per page