0
votes
0answers
8 views

Comparing two objects having two nullable date fields

ExpiryDates has two properties PSL_ExpiryDate and MNL_ExpiryDate of type nullable date. I am ...
0
votes
0answers
7 views

Skip sending for all that return no results but still send to others [on hold]

PHP below checks person's preferences in the database then pulls relevant jobs that match their preferences from another database table. It then compiles it into an email... I can't get it to stop ...
4
votes
0answers
15 views

Gravity problem solver in Factor

After answering a question about Factor, I decided that it looked interesting. To get the hang of the syntax and such, I decided to write some basic physics code to "solve" the three-body problem. ...
1
vote
0answers
15 views

Single button use to create light box that brings up different content based on the div

My goal is: when you click on the button "word" it will turn into a lightbox. The button will bring up another content box that holds the same profile image as before with a small bio with image ...
0
votes
1answer
36 views

The 101 Pictures Gallery

I am working on a website for a group of artists and want to know of a way to make my code cleaner and my website run faster. I am working on the gallery page, and there are over 100 pictures I want ...
0
votes
0answers
32 views

Using recursion schemes to avoid explicit corecursive unfolding

The code is self-contained and self-explaining. I want to improve the goal function. You can change everything below the ...
1
vote
1answer
14 views

Inserting a node at a specific position in a linked list

Given a node class like class Node { int data; Node next; } Provide an implementation to Insert a node at a specific position in a linked list ...
0
votes
0answers
4 views

JOptionPane in MVC and Checkbox for don't show this message again [on hold]

I thought about using static factors since I will have at least 5 error messages for the entire application. It could possibly grow to easily 10 error messages if I decide to. The error messages would ...
-3
votes
0answers
6 views

What's wrong with this code (Python)? [on hold]

import turtle t = turtle.Pen() for x in range(0,1000) t.forward(100) t.left(179) turtle.done()
4
votes
1answer
24 views

Handling an invalid SQL query exception

This is my DAO object that takes the Cypher query as a string, and returns a JSON representation of the graph it returns. Because it's using a Spring JdbcTemplate ...
-1
votes
0answers
12 views

Faulty end of game [on hold]

Making another simple game, and this time my problem is the final number. The basis of the game is two players choose a number between 10-50, and have to take it in turns deducting either 1,2, or 3 to ...
1
vote
1answer
17 views

LRU cache design using dict and doubly linked list

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the ...
2
votes
0answers
17 views

Lua binding for C++ render engine

I've been recently working on a Lua API for my C++ (11) render library. It really has grown at the point that I think scripting would make things much easier. I've implemented a Lua interface for some ...
1
vote
1answer
14 views

Basic survey app

I am learning MVC 5 .NET and this is a bit different than Rails activerecord when creating relations. I have created a basic survey app that has a Survey class and this relates to the questions and ...
0
votes
1answer
16 views

Separate business logic from Data Access Logic in the repository

I have a PupilService which is calling the PupilRepository.AttachPupil() method. I have an N to M relation between ...
3
votes
0answers
18 views

Abstract syntax tree for simple Lisp-like language interpreter

A week or so ago, I wrote a binary expression calculator with the hope of better understanding how interpreters and compilers work. In the same vein, I've tried to write a lisp like language ...
7
votes
6answers
462 views

Readability and Goto

I've always been told "never use goto, there's always a better way" and for the longest time I just accepted it. Lately though, I've been running into such scenarios in which I have to repeat this bit ...
1
vote
1answer
16 views

Parsing JSON string from HTTP request

HTTP request is made, and a JSON string is returned, which needs to be parsed. Example response: ...
1
vote
1answer
20 views

Find allele frequencies at each site for each iteration for each population from FASTA file

I am new to BioPython. Below is my first script. It works but it is quite ugly and not really performant. The script takes a FASTA format file in input and outputs the frequencies of each amino acid ...
1
vote
0answers
15 views

Implementing a JMS consumer

I need a standalone client that consumes messages from the queue every time a message exists. I already have set-up an ActiveMQ queue named hello.world. ...
8
votes
3answers
347 views

Trying to determine why a slight code change caused a large performance gain

I'm currently refactoring some old code of mine that I had done a few years ago, where it takes in two Lists to compare their contents, and then return the mapped contents that were matched. With 750 ...
5
votes
3answers
61 views

“Critter Tracking: When does it cross its own path?”

Minor Update/Additonal information: This question is based on a Codility question similar to this one. The input (an int array), the outpout (an integer) and the method signature (...
5
votes
1answer
30 views

Enumerating Chess Piece Moves

There was a question asked recently here that went through enumerating moves for a chess piece. I was going to write an answer for this question, but while I was bashing out some code to throw into an ...
-2
votes
0answers
8 views

DICOM Image Orientation evaluation in Java

I have been trying to find this out since a long time, but due to lack of any experience in Java, I am totally lost. I want to do some operations in DICOM in Java. I have used ImageJ library to simply ...
4
votes
1answer
37 views

Tic-Tac-Toe command line

I created a simple Tic-Tac-Toe. I'm looking for any critiques from a code standpoint: general structure / style / efficiency. Unfortunately I couldn't get a live demo working because of the ...
1
vote
0answers
26 views

Favicon Downloading Script

I use this file to download favicons and was wondering why it seems to be so complicated. I've noticed that people seem to save their favicons in many different types of ways. On top of that, PHP ...
1
vote
0answers
21 views

Play Market In App Billing

I want to add In App purchases to my application. In App in test mode works great, but there is no check on their authenticity. While googling some info about making server-side of In App I found out ...
3
votes
2answers
110 views

Checking if an array is initialized and allocated in VB.NET

I am creating an add-in for a piece of software our company uses, so I'm working pretty extensively with that program's API. There are many COM object members which return or contain an array that I ...
3
votes
3answers
175 views

Engineering a minimalist image interface without templates

I'm practicing different ways of class design, so I'd like feedback on the design characteristics. Of course code practice comments are also welcome. It was a conscious decision to omit templates. My ...
2
votes
1answer
23 views

Replace an element of a List with a concrete ID

I want to replace an object of a List with another one. To find the item to replace I need to check the field ID of the object to find what item is the same. ...
2
votes
1answer
24 views

SQL Nested Selects

I was wondering if there is a better way to do the nested selects so that the firstname and surname is only doing one select ...
0
votes
0answers
21 views

Custom ListAdapter with ViewHolder Pattern

I wrote this class for a custom list adapter for my list view. I use the view holder pattern to make the list view move smoother. Could anyone advice tell me if I did something wrong, or some way to ...
8
votes
1answer
505 views

Layered Neural Network in Swift

I am designing a very basic layered neural network in Swift as an exercise. I currently got the network evaluating the response for a given stimulus by propagating the stimulus forwards through the ...
1
vote
1answer
43 views

Colorful OOP in PHP

Is it better to have only one class color and include the functions from the second class in the 1st one? Or let them apart? Why is one better than the other or ...
0
votes
0answers
22 views

Custom capacity aware stream grouping

This is the code to make a capacity aware stream grouping for Storm topologies. Please review this. The summary method has to be called every ten minutes once. Future task - This method and fields ...
0
votes
0answers
25 views

Is my solution to this Java concurrency Bank exercise with multiple accounts correct?

I am doing an exercise in Java concurrency. The problem statement is as follows: Bank holds an array of Accounts. Client do (in a loop) the following operations: (1) work, then sleep for random ...
3
votes
1answer
29 views

Validating a credit card number using Luhn's algorithm

I implemented Luhn's algorithm explained on Wikipedia to validate a credit card number, in Bash. Does this code follow good practices? ...
-1
votes
0answers
7 views
0
votes
1answer
38 views

Insect combinatorics challenge

Below is the problem taken from here Question 9: Insect Combinatorics* Consider an insect in an M by N grid. The insect starts at the bottom left corner, (0, 0), and wants to end up at the ...
-1
votes
1answer
22 views

methods with variable names and alias methods [on hold]

I'm writing a javascript code that runs functions depending on a variable let's assume that there are two domains called (example.com and foo.com), "example.com" has subdomains (a.example.com and ...
0
votes
0answers
11 views

Handling ManagedBeans and their data

I have the following Use-Case: On a Page(page1), a name of a Customer is entered and saved. The saved entity is displayed in a DataTable on the same page. The DataTable has the customers name in ...
4
votes
1answer
34 views

A closed exception system

I am working on yet another toy project that I named SGL (for "Standard Generic Library" since it mimics some features of C++'s STL as well as a few more utilities from the C++ standard library). ...
1
vote
4answers
553 views

Percentage of digits in n that are even

Question 7 from Lab 3 of Berkeley's CS61A course says: The following examples of recursive functions show some examples of common recursion mistakes. Fix them so that they work as intended. [...] ...
3
votes
0answers
25 views

IntModulus long addition and subtraction

One of the remarks in this answer to my question concerning IntModulus says What's more problematic is that you don't have matching argument symmetry for add ...
4
votes
1answer
50 views

Mangling the words of a sentence

Original Problem Statement Problem Analysis Task: Given a sentence, mangle each word and output the result. Clarifications: Mangling will be defined as a word with its ...
1
vote
0answers
27 views

Calculating the average of all grades [on hold]

I'm attempting to write a simple program for teacher. It is simply a program that calculates the average of all the grades entered by the teacher. However, I attempted to make it a little more ...
3
votes
5answers
364 views

Insert k copies of each element in ArrayList

This method takes an ArrayList<String> s and int k , then creates k copies of each ...
4
votes
1answer
67 views

Attribute container

I made this really simple "attribute container" class that allows you to store arbitrary data to an object at will, sorta like in python how you can just assign attributes to arbitrary objects, but in ...
-2
votes
0answers
11 views

15 30 50 per page