All Questions

0
votes
1answer
5 views

Dijkstra in C++ to find shortest path for every vertex of a directed graph

I am trying to implement the Dijkstra algorithm in c++ that finds the shortest path for a graph from a text file. The text file contains a matrix that represents a directed graph. What I am trying ...
0
votes
0answers
7 views

I'm copying fields to the partner on saving an order in Odoo, is there a nicer way than what I'm doing?

Currently I'm overriding create and write to copy the fields onto the partner, is there a cleaner way of updating the partner on save? ...
1
vote
0answers
6 views

Noob implemtation of TicTacToe in Haskell

I want to learn Haskell and figured the best way to do it is to write a simple TicTacToe implementation. However the result feels very unelegant and I think it might be the best playground for your ...
2
votes
2answers
65 views

Random Quote in java

Problem Statement: Create a class diagram and Java code for the following system and scenario, taking into account the possibility of future extensions. "The system is a command line utility ...
0
votes
0answers
16 views

Data Access Layer and Business Objects

This is my first cut at separating the data access layer out of my very old spaghetti codebase. I have tried to keep this a simple as possible , it is for a small project, so I am not really ...
0
votes
0answers
9 views

nodejs readers/writers concurrency [on hold]

Here's some simple code that demonstrates what I'm trying to do ...
1
vote
1answer
21 views

Does RunLengthEncoding class provide abstraction and encapsulation?

This review is in continuation with Part I mentioned in query. As part of the assignment given in Part II from this link, here is the solution: Ocean ...
1
vote
1answer
18 views

Using both setInterval and setTimeout for simple image carousel

I have a really basic image carousel that I just wrote. Basically I'm trying to keep it as small and light weight as possible, but I get the feeling that I've gotten way off the beaten path of how ...
-3
votes
0answers
15 views

getline(cin, s1) in a IF statement [on hold]

The getline(cin, s1) function is not prompting me to input a string. it appears as if it is being skipped over even when the if condition is being met. any help? code is below. the problem is in the ...
-1
votes
0answers
15 views

Calculator using python for school [on hold]

I am trying to use this program for a project for school. I try this code and it gives me a ...
0
votes
1answer
15 views

Auto-update server

Yesterday and today I've been working on an auto-update system for a game project. I've just pushed the server-side script to the server, and it seems to work great. Since this is public-facing code, ...
2
votes
0answers
24 views

Hearthstone Style Deck Stats for TCG

Right now I have this messy method to collect the deck statistics while building a window that will display those statistics. These statistics are things like the type and mana cost of the card. I ...
1
vote
1answer
35 views

Playing “craps” for the win v0.3

Continud from Playing “craps” for the win v0.2 You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots, respectively. After the dice have come to ...
1
vote
1answer
38 views

Simple TCP Client Server application with receive side only

I wrote simple TCP Client Server application, I was wonder could you please review my code. I would be grateful for any hints and tips regarding to logic of app, coding style or naming convention. ...
2
votes
0answers
18 views

Unmarshaling dynamic JSON

I have JSON object response returned from the server which is similar to this one: ...
2
votes
0answers
15 views

2D Convex hull exercise

I'm reading Real World Haskell, and this is my first try with the language. This is the result of the exercises of chapter 3: Consider three two-dimensional points a, b, and c. If we look at ...
1
vote
1answer
20 views

Counting business days in a month, ignoring holidays

In the past, I have worked mostly in MySQL and SQL Server. Almost everything at my current job is Oracle, though. I could have written this instantly for MySQL but I could barely google what I ...
0
votes
0answers
17 views

Reading data from a file reads last line twice [on hold]

I have a small problem reading files. When I try to read a file I always get the last line twice. Why is that and how can I avoid this? This is the working minmal I use: ...
3
votes
0answers
13 views

Copying files in Haskell

I recently watched a video in which the speaker said that Haskell is not suited for real-world tasks, such as copying files from one folder to another. So I tried to write a program that copies a ...
1
vote
2answers
80 views

Playing “craps” for the win v0.2

Continued from Playing "craps" for the win You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots, respectively. After the dice have come ...
1
vote
0answers
11 views

Python Multiprocess Dictionary Selector [on hold]

I am attempting to select devices via telnet based on a key I get from pinging the telnet device. Basically it selects to use only the devices with the given key. I am running into issues when a ...
10
votes
5answers
440 views

What's in your file?

Another more simple project from my CS1 class that I didn't upload while I was sick last week: Write a program that computes all of the following statistics for a file and outputs the statistics ...
7
votes
3answers
229 views

Deviating from the norm

Back on track with my C++ saga: The standard deviation of a list of numbers is a measure of how much the numbers deviate from the average. If the standard deviation is small, the numbers are ...
1
vote
0answers
11 views

General application log

In my Node.js applications, I often find it helpful to have an application log so that should something go wrong in production, I can have more information than I get from a crash stack trace to track ...
-1
votes
0answers
16 views

Data Encapsulation / OO Principles [on hold]

In order to have good data encapsulation, I understand you generally use getters/setters so the underlying data structure can change at any time without changing the public interface. Should this also ...
0
votes
2answers
44 views

“Random Quote Of The Day” program [on hold]

Problem Statement: Create a class diagram and Java code for the following system and scenario, taking into account the possibility of future extensions. "The system is a command line utility ...
3
votes
0answers
27 views

Elementwise iterator adaptor

There are many C++ implementations of the Euclidean vector. I.e., a vector in what is typically a 3- or 4-dimensional space. Something along the lines of ...
4
votes
2answers
41 views

Bats Challenge from CodeEval.com

I am going through coding challenges and I would like to get feedback on one of them. I am not sure if i can post the link to the challenge but here it is. CodeEval Challenge Outside of your ...
2
votes
1answer
42 views

Script for a multi-user webapp database connection

I have the following working script which I use for my database connection for a multi-user webapp. I use a different database for the login, this script is called only after the user is successfully ...
1
vote
0answers
15 views

Utility Library and Underscore Mixin - 2

After addressing all issues in the previous post I've re-factored the code. I'm looking for a code review on the code below. ...
6
votes
2answers
321 views

Playing “craps” for the win

No specific question here. I am beginning with Java and here is an exercise. The rules of game: You roll two dice. Each die has six faces, which contain one, two, three, four, five and six ...
2
votes
2answers
32 views

Change the navigation ul li based on the clicked country

I'm trying to create a very simple jQuery plugin in the object-oriented way. Now, I'm not sure whether the code I produced is correct and efficient OO programming. The plugin's aim is to change the ...
4
votes
2answers
49 views

Too little in common to use superclass?

Is there something as "they have too little in common to use a superclass"? In my case, doing iOS programming, in a project, every screen has the same background. So I created a superclass which only ...
7
votes
4answers
522 views

Counting occurrences of each word in a sentence

I have been doing this test task for C# Developer role at UBS.London recently and have been rejected. No reason stated yet. Was wondering if you can take a look and provide feedback on what I can do ...
0
votes
0answers
22 views

Shorten repetitive js code [on hold]

Is it possible to do a each. function for this repetitive code? This is a highcharts plotline generator, it consists of 9 plots each of them shares nearly the same code, there has to be a way to ...
0
votes
1answer
28 views

Reduce/Optimize repetitive code

I have 3 repetitive sections in my code, how do I refactor them? The differences are only in SQL query and in the foreach loops. ...
3
votes
2answers
51 views

Chess Architecture

I am currently developing a chess game but have made the mistake of putting all my Java code in one .java file. I need help cutting up my code into more manageable chucks. Could someone show me how ...
16
votes
2answers
2k views

Someone thinks poorly of my server log parser

I have just been informed that the following code written by me is extremely poor. I have absolutely no idea why. It is memory efficient, and looks clean to me. But still the feedback is very poor. I ...
3
votes
2answers
287 views

Class design for a student class

Problem Statement: Design a STUDENT class to store roll, name, course, admission date and marks in 5 subjects taken from user. Create an array of STUDENT objects. Provide methods ...
1
vote
1answer
17 views

Multiple if statement check

This is called from a VF page, styleClass="{!IF(isWindows8Device, 'windows', 'not_windows')}" So if it's a windows device, return true. The best thing to do ...
1
vote
1answer
26 views

Calculating set difference of lists with or without intermediate variables

Which form of the method do you find more readable? Version with local variables: ...
0
votes
2answers
31 views

Monte Carlo dice [on hold]

For this lab you should re-use your Dice class from the previous week. The user inputs a number n which determines the number of groups of 6 dice to be rolled. The program should output x, ...
-3
votes
0answers
25 views

Code feedback for functions in C++ [on hold]

I just need some feedback why I am not able to display the result or why its not compiling. I trying to work with function in c++ to compute a formula. Thanks for your time. here is the code ...
3
votes
2answers
90 views

Parenthesis checker

I am working on a parenthesis checker program in Java that reads in a text stream from standard input and uses a stack to determine whether or not its parentheses are properly balanced. For example, ...
3
votes
3answers
233 views

DateTime-like class implementation in modern C++

In modern C++, there is no class like datetime in the standard which can be used in the program. However, with additional of modules like ...
3
votes
0answers
40 views

Dumping database table structure information into text and MySQL format [on hold]

I just wonder if my code will fail in certain situations. It seems to work properly and I hope to get some points on how this could fail or any issues I might encounter with it. Am I missing ...
2
votes
1answer
51 views

Efficiently packing the header and data in one Byte Array in a single class

I have a header and data which I need to represent in one Byte Array. And I have a particular format for packing the header in a Byte Array and also a different format to pack the data in a Byte ...
0
votes
1answer
19 views

My jQuery Form Plugin

Long story short, I wrote this jQuery form plugin as an exercise to better understand how other form plugins work. If you have any suggestions about how to improve this (or my coding style in general) ...
3
votes
1answer
53 views

Finding a word ladder using Breadth First Search

This is a LeetCode problem called Word Ladder: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, where only one letter can ...
-2
votes
0answers
17 views

pass a lot of arguments to a (python) script [on hold]

I have a Python script which requires lots of arguments to be passed each time. My preference is to have all this information stored in (global) variables at the top of the script. Another option ...

15 30 50 per page