All Questions
0
votes
0answers
1 views
Conversion Between Units
I have created a java program that should take a list of conversions and be able to convert one unit to another. My main goals are maintainability and readability, but speed would be nice as well.
...
0
votes
0answers
2 views
Unit of work + repository + service layer with dependency injection
I am designing a web application and a windows service and want to use the unit of work + repository layer in conjunction with a service layer, and I am having some trouble putting it all together so ...
-4
votes
0answers
12 views
How to Check Array for 3 Numbers that Add to a Specific value in Java? [on hold]
Alright guys, I've been stuck on this problem for a while now and have not been able to get past it. This is for Java. I'd appreciate any help at this point.
I need it to sum to 225. Here are the ...
0
votes
0answers
11 views
Updating a config file
This script updates a settings in ssl config file for Nginx. I generate DHEC key and then update the Nginx SSL file to that location. I also give an option for the user through arguments if they want ...
1
vote
1answer
35 views
0
votes
0answers
7 views
Function to divide a string for seperate lines for output [on hold]
I'm a huge fan of command line programs. Most of my programs are command line ones, they're relatively easier to use and implement without any GUI overhead. The problem is, I want my output to be ...
2
votes
1answer
44 views
Determining average of integers using quicksort
I was attempting an online problem given on a programming website which asked us to tell us the number of integers in a given list which can be obtained as an average of any two other integers in that ...
0
votes
0answers
14 views
Speed up Pandas DataFrame expansion to include time-lagged information about events
Using pandas and Python 3, information about a simple timeseries data set is being processed. Within the span of .5 seconds, 3 names are being said. We record the onset of each utterance, the length ...
3
votes
3answers
86 views
Object Interaction in OOP (especially Python) [on hold]
Say you have a number of similar objects (e.g. instances of the class Person). Each of these instances can belong to a number of Groups, also represented by a class.
To stick with the examples of ...
-4
votes
0answers
18 views
Project Euler problem 8, I don't know what is going wrong [on hold]
I did a course on C programming 2 years ago and I was trying to get back into it with the project Euler problems. My code is quite sloppy, sorry for that.
Problem 8 has you calculate the biggest ...
3
votes
1answer
78 views
Managing “Jobs” data in a Database
I've been working in a small page with some easy CRUD.
The data I get from the database is getting shown on the page.
But the way how i show the data feels a bit off. I guess it can be done in a much ...
2
votes
0answers
10 views
RESTful API parsing DBF data HSET in Redis
I have this working code, but would like your review:
sync.coffe
...
2
votes
2answers
29 views
Simple key-value store in C
I needed a simple key-value store. Here's what I came up with.
Usage
Use kvs_create and kvs_destroy to create stores and clean ...
-2
votes
0answers
6 views
Segmentation fault while running on multiple processors [on hold]
The following code perfectly runs when, I try to run it on a single processor, but when I try to run it on multiple processors I am getting segmentation fault.
...
0
votes
2answers
18 views
Idiomatic and Conventional F#
As of late I have been learning F#. Today I accumulated what I have learned so far to develop my first program - a script that counts the number of lines of code in a given Visual Studio project.
...
3
votes
0answers
18 views
Helper class to send emails with attachments on Android
I use this EmailTools helper class inside an Android app to send data as an email attachment, by calling ...
2
votes
3answers
81 views
-3
votes
1answer
17 views
Using a for loop to get multiple values that mean the same thing
How would I clean up this code? Would I put it in a for loop and make it loop through and set the rand2, rand3, ...
0
votes
0answers
22 views
Detect image in viewpoint of browser window then show image
I am working on a web project and am trying to create a way to detect when an image is in viewpoint of the browser window then load/show the image. Since there are some rather large image that are ...
-3
votes
0answers
12 views
Repeat…Until Type a python code [on hold]
PrintedTotal 0
AudioBookTotal 0
EBookTotal 0
REPEAT
READ next record
IF BookType = “printed”
THEN PrintedTotal PrintedTotal + 1
ELSE
IF BookType = “audio-book”
THEN AudioBookTotal ...
4
votes
3answers
115 views
Implementing Conway's Game of Life
Here is an implementation of Conway's Game of Life. My code is working fine but I want you to review and give me your suggestions of how to improve it.
These are the steps of my code:
Initialize ...
2
votes
0answers
13 views
Computing values with several large numeric vectors
I have several large numeric vectors (close to 1e6 entries each) and I need to make some computations with their values:
...
2
votes
1answer
22 views
Format a number to include commas
This is my attempt to format a number and put commas where appropriate. I was wondering if this could be done in a simpler way.
It's used by calling ...
7
votes
2answers
47 views
Quicksort in Python
This is my first actual attempt at writing a Python program. I have a background in C++, so it was a big change (where's my iterators?), and I'm looking for criticism on my use of Python and its ...
3
votes
1answer
41 views
SQL result to JSON
I am trying to return a JSON object to an Ajax call. Is this the best way to build a JSON object with PHP JSON encode?
...
6
votes
2answers
137 views
Follow up to Top Active Answerers on Stack Exchange site
This is a follow up to Top Active Answerers on a Stack Exchange site
Actual SEDE Query --> Top Active Answerers on site
Do I have a good understanding of the ...
2
votes
1answer
37 views
Binary HeapSort and Ternary HeapSort implementation
This is my take on binary and ternary heapsort implementation for a university assignment. The code works but I wonder if there are any mistakes or things to improve.
...
6
votes
2answers
58 views
OpenGL text rendering library for Lua built on freetype-gl
FTGL wasn't making me happy, so I decided to try something else. This isn't completely finished; I plan to work more on layouts and alignment, and add a few other things. It should be far enough along ...
4
votes
1answer
46 views
Tic-Tac-Toe game using the minimax algorithm
I have written a Tic-Tac-Toe game in Python that contains, among others, a player that uses the minimax algorithm. I am not exactly a beginner at Python, but I'm not very experienced with it - so I ...
3
votes
2answers
253 views
Top Active Answerers on a Stack Exchange site
I created this query back in January to find the top active answerers on Code Review and thought that it might be a good idea to get other opinions on my SQL coding using a database that we can all ...
2
votes
2answers
45 views
AJAX call to make an HTTP request
I am using node.js with express. There is a button that the user can click, and doing so calls this method on the server:
...
3
votes
1answer
52 views
Fictional Hotel Website
I've made a fictional hotel website that shows you hotel details when you click on a button.
jsFiddle
...
4
votes
1answer
29 views
Cron expression validator for Apache Quartz
Not too long ago, I had to create a cron expression for a route in Apache Camel. I had a bit of a struggle to find the right expression. So I made a small program to output the n next valid dates ...
-1
votes
0answers
16 views
Pass more than one value in event parameter on jQuery On method [on hold]
I´m doing a code to make <p:rowEditor> in Primefaces have a hint.
I did it
...
2
votes
0answers
21 views
DRY my rake import from external database tasks
The application I'm working on runs import tasks each night to get information from an external database and processes and writes it to the local PostgreSQL database. This is so it can be viewed in ...
0
votes
0answers
49 views
Is there any reason for copying a byte[] before writing it to OutputStream? [on hold]
This is not my code but I was trying to evaluate code quality of an open source project and one of the first things I encountered is this:
...
3
votes
1answer
47 views
Deserialize an email header into key-value pairs
I've created a function that will deserialize an email header into a list of key-value pairs. I've run numerous tests using MS Office Outlook 2010 and MS Office 14.0 Object Library, all of which were ...
3
votes
2answers
45 views
Traversing and printing complex Dictionary types (Scripting.Dictionary) - Dictionary inside of a Dictionary
Based on this SO post - also reposted on vba4all.com with a few more details and explanations.
Please notice there currently is no error handling whatsoever as I didn't analyse and consider any traps ...
2
votes
1answer
20 views
Query of attributes of mobile phone models, using several UNIONs to find distinct values
I'd like to know if there's any room to improve the following query which is to find distinct values from multiple tables when someone searches for a model name. Two of the tables are storing phones' ...
3
votes
1answer
31 views
n-layered application structure in asp.net mvc
I've been trying to set up an n-layered application in ASP.NET MVC 5. I've "converted" my account controller to look like this.
I would like some feedback as to whether this is in the right ...
2
votes
1answer
43 views
Index of letter removed to make string palindrome
This code finds the index in the string and removes the one which will make the string a palindrome. If the string is already a palindrome, it should return -1.
This code works correct, but I am ...
0
votes
1answer
49 views
2
votes
1answer
26 views
Fuzzy matching dict keys
What do you think of this idea? It's supposed to be a dict that makes a reasonable guess at the key you were trying to access for getters and deleters. Setters should be untouched.
Similar to how ...
1
vote
1answer
45 views
Auto-populating user info from database
Auto populate user info from database when user inputs employee number. The same applies when the user inputs name/extension/mobile/email/
Some code is duplicated. Is there any way to make it ...
-5
votes
0answers
42 views
Java very slow execution of A* Pathfinding Algorithm [on hold]
I am creating a Maze game in java and wants to add a smarty ghost (like Pacman) that move towards user location to catch him. For smarty ghost I chose A* PathFinding Algorithm and found below links ...
3
votes
1answer
79 views
Examining programming laboratory exercise for faculty
I'm developing software for examining programming laboratory exercise for faculty. I have an Error object that can be attached to students work. It can be attached ...
-2
votes
0answers
15 views
Javascript: How do I append a string to search query only once? [on hold]
In this case, Let's take Google as example:
The code is JScript .NET, which is basically a .NET version of Javascript.Regardless of language, Anyone with appending type of skill can answer my ...
5
votes
3answers
649 views
Efficiently generating HTML CSS table using Java
I am trying to generate an HTML table using Java. I have an object which I am iterating to make an HTML table.
...
1
vote
1answer
30 views
Finding the largest repeating substring
Here's my code that takes a large string, and searches for the longest reoccurring substring. It compares the first letter with every other until it finds a match, then saves it. Then it compares the ...
2
votes
1answer
69 views
Fractions in Java
Part I-IV recommend code changes as mentioned in link 1, for the initial code given at link 2.
Can you please review the code changes for Part I-IV?
Part I: Constructors (1 point)
Modify the ...