0
votes
0answers
8 views

Is the following code SOLID? [on hold]

I found the following code, which is used to write and parse CSV files, on the web. However, it seems it cannot handle the cases such as "|" delimited CSV file. Also does it violate any SOLID ...
1
vote
1answer
8 views

Blackjack game with classes instead of functions

To try out the concepts and tools I've been learning, I decided to write a Blackjack game. I wrote it entirely with functions, so it hasn't helped me at all with the concept I really lack ...
1
vote
1answer
16 views

Simple python script to shorten URLs in specified text files

A recent question inspired me to write a script for this task: Shorten URLs in specified text files using googleapis.com Handle multiple URLs, whether on the same line or multiple lines The ...
0
votes
0answers
8 views

Case of the Hidden Memory Leak

Somewhere in the code below seems to be a memory leak. A couple of users were exceeding 512Mb and I'm not sure how. Adapted the following SO code to try and test memory usage of each function on the ...
1
vote
0answers
6 views

Calculating Luhn-algorithm checksum digit

Today I decided to learn some basic Haskell, and for starters I made a program for calculating the checksum of a Swedish personal identification number. It uses the Luhn-algorithm, aka. ...
1
vote
1answer
30 views

Update Map in Haskell

I wrote a function that inserts or updates a Map key value depending on whether the key is already in the ...
1
vote
1answer
16 views

Convert international datestring to ISO-format

The function below takes a datestring in the form d-mmm-yyyy and converts it to ISO date format (yyyy-mm-dd). Delimiters may be hyphen, space or /, and Dutch or ...
3
votes
0answers
16 views

Trampoline Interceptor

Aim In C#, the following method will cause a StackOverFlowException if called with parameter 0: ...
0
votes
0answers
8 views

Problems with fixed nav menu with mobile devices [on hold]

Need some advice to fix an issue that a former staff left me with. On my site, http://www.mooremedical.com there is a red fixed nav bar at the very top. I just noticed that on my Android phone when I ...
0
votes
0answers
6 views

Working with Class, properties and Initialization

I'm working on this Objective C programming assignment I found online. I'm not sure if I have met all the requirements. Any help or suggestion will be appreciated. Part 6 a) Implement class ...
1
vote
0answers
9 views

Connected components algorithm does not scale past 10,000 nodes

I found a connected components algorithm posted here on SO and modified it for my own purposes. It runs well for small input sets, but doesn't scale as well as I would like. The largest set I've ...
11
votes
1answer
90 views

Blackjack Strategy

I am creating a Blackjack simulator in Java in order to better understand the language. I have written the basic strategy section for a player and it is terribly long. Is there a better way to do ...
2
votes
0answers
21 views

Better option than “errno” for file IO error handling

I have the following method for opening a file: ...
2
votes
1answer
20 views

Return a List<MyObject> based on very similar data

I am rewriting an old VB.NET app in C#. I will not subject you to the old VB.NET code that I am writing (the original method that I have already refactored was over 700 lines long). The following is ...
2
votes
2answers
34 views

Tic-Tac-Toe Game

I want recommendations on how to improve this code. JSFiddle for you to play in (It's laggy, so it would be better if you download the images and try it in your own PC). ...
3
votes
1answer
12 views

Data Access Layer method with transaction handling

I just want to know whether I've done transaction handling well. Also what about the other types of transactions available in .NET with regard to this code snippet? Also are there any redundant ...
1
vote
0answers
13 views

Service class for Archiving and Mirroring Files and Directories

I am writing an application that either mirrors a file/directory into another location or creates a zip file "snap shot" of a file or directory and stores it in another location. The user is able to ...
0
votes
0answers
9 views

Trying to convert what I currently have into a new Javascript powered section [on hold]

I am currently building a site in Drupal, and have setup an article page to look as I want it. ...
0
votes
0answers
7 views

LL1 Parsing Table Output Not Showing [on hold]

I tried my best what I can do to show this output table, but having hard time showing it. the code runs fine but when i try to enter the following output of table for validation, a lot of errors ...
5
votes
3answers
104 views

Adding two sides of an array

The purpose of the program is to add 2 sides of an array starting from the bottom and top of both ends and to find the lowest difference at equal decrements of iteration. The program functions but ...
0
votes
0answers
4 views

Getting a list of all fines in a local disk

I wanted to get a list of all files in a local disk like C:\, so I wrote the Python script below to check the performance: ...
5
votes
1answer
29 views

Best way to create a daemon in a JavaWeb application

I have a purpose for an application to run a daemon in my web application. The application is running with Struts1 on a tomcat7 server using Java7. This is what it does: Launch itself when the ...
3
votes
3answers
76 views

WPF Calculator Code

I've coded a calculator in C# with WPF as the UI. I wish to know mainly about these points: Ways of optimizing Better techniques, tactics and ways of coding this All flaws on the surface as well as ...
1
vote
0answers
12 views

Website parsing optimizations: cleaner way to deal with special cases and improving data transfer between classes

I have a DiningHall class that has the 3 properties: openingTime, closingTime, and ...
2
votes
2answers
36 views

Validate multiple regexes without a for loop in JavaScript

For a project, I need to validate a VAT number against the correct algorithm. I found a library for this here (freeware, so I should be able to reuse it) that I'm grateful exists. However, I feel like ...
5
votes
2answers
338 views

Animal choir simulator

I got a PHP developer interview test to solve for a company. I didn't get the job but I would like to know where I was wrong. Did I understand the test completely? ...
5
votes
2answers
625 views

Reducing this code to the minimum possible

I have an API with the following code ...
3
votes
2answers
39 views

Multiple loops versus multiple stringbuilders

I've come across the following piece of code in a Razor view ...
8
votes
3answers
430 views

Finding largest prime factor from inputted number

This is my first C# console application. This program asks for an input of a number, and finds the highest prime factor of that number. Please review my code. Have I used things right? Is my code ...
6
votes
1answer
44 views

Chat using commands

I have been learning Python and was trying to make a chat system which can be run by commands. This is my first attempt to write the code. Does this make sense or is it wrong usage of classes? There ...
10
votes
3answers
79 views

More German overengineering™ - Class mappings and factories

Goals: So the plan was simple: Provide a factory to instantiate implementations of a certain interface (ModelConverter<T>), depending on what model-class you ...
3
votes
1answer
33 views

Selenium Java: errorRecovery

I have the following code to select an image using Selenium, only now I have added an errorRecovery. Is there is a better way to right the code in the ...
7
votes
1answer
53 views

Mapping enum to function - request / response library encapsulation

I'm writing code for an embedded device - specifically, a camera. The idea is different camera manufacturers can implement the code so it properly works with their camera. Here, I'm encapsulating the ...
4
votes
0answers
14 views

Open AL/LWJGL quesitons

Sorry if this is kind of 'Full' of information, I am new to the Open AL API, I have used Open GL and have a good understanding of how the rendering pipeline works and just want to make sure I don't ...
2
votes
0answers
33 views

Base generic DAO optimizations

I have base abstract GenericDAO class that executes CRUD operations with different kind of objects. Customer and ...
8
votes
1answer
99 views

Good performance when predicting future game states

This question is about my answer to this king-of-the-hill challenge on Code Golf. In short, the purpose of the challenge is to code a slime that, trough various possible moves gains control over an ...
5
votes
1answer
42 views

Sending SMS to mobile number

I am trying to send SMS using Twilio with Scala 2.10 in Playframework 2.2, but this code is looking odd to me, maybe due to lots of conditions. I'm sure it needs some important reviews. ...
0
votes
0answers
26 views

Whats the best approach to report exceptions to the caller? [on hold]

I have the following code that return integer values to report type of the raised exception to the caller of the method and eventually user of the application. I suppose it is not the best way to do ...
3
votes
0answers
22 views

Rotating Text in Circular Pattern Using JavaFX

Just wanted to see what you all thought about my program, I basically have two different classes that I designed to allow for automated wrapping of text in a circular pattern. This is my first bit of ...
1
vote
0answers
26 views

Deepest left leaf node in a binary tree

Given a Binary Tree, find the deepest leaf node that is left child of its parent. This question is attributed to GeeksForGeeks. Looking for code-review, optimizations and best practices. ...
5
votes
3answers
74 views

Advice needed in refactoring/cleaning up my javascript code

I am fairly new to Javascript. I have written a website that works as designed. However, I have a strong feeling that my code could be heavily refactored. Can anyone see anything, besides line ...
11
votes
2answers
446 views

Checking conditions before allowing a play button to become visible

I have this code to check a couple conditions before allowing a play button to become visible. Is there anything to do to consolidate this code, possibly shrink it down some? ...
17
votes
2answers
2k views

Tired of FizzBuzz yet?

There have been many FizzBuzz questions lately, and here is one more! Granted, it is pretty straightforward to do FizzBuzz with SQL using calculations. So instead, I'm going to do a FizzBuzz which ...
0
votes
0answers
9 views

Organizing Business and Presentation entities [migrated]

Background I am developing a WPF project using the Microsoft Extensibility Framework. This is the basic structure: User Interface (WPF Project) MEF Interfaces (class library, contains all the ...
8
votes
1answer
55 views

Abusing Excel VBA… to maintain data stored in a database

I need to build a little UI to allow easy maintenance of some data stored in a MySQL database, and the end user wants to do that in Excel (I know, I know). The code I came up with comes pretty close ...
3
votes
1answer
19 views
1
vote
0answers
11 views

vQmod - die(), offset specific or exceed offset to replace most of core page

Designed for OpenCart, VQMOD places or replaces bits of code based on XML files. The following three versions of the code achieve the same goal, which is to ...
1
vote
0answers
11 views

Determining encoding for a file in Ruby [migrated]

I have come up with a method to determine encoding (or at least a guess at it) for a file that I pass in: ...
2
votes
2answers
128 views

Efficient way to iterate over elements of array for matching contents of another array

Using jQuery I'm trying to find an efficient way to iterate through an array excludeMe and check if elements from another array ...
5
votes
1answer
46 views

Flatten a multilevel linked list

Given such a structure the output should be ...

15 30 50 per page