All Questions
-2
votes
0answers
12 views
Storing more than one information into one Node in a singly linked list [on hold]
I'm trying to add several information into one Node in a singly linked list... How do I do that?
After asking the user for several vehicle information: plateNo(String), vehicleType(String), ...
2
votes
0answers
6 views
Simple inbox functionality using Javascript and Ajax
So I've been developing a simple CMS both for practical use and learning about Laravel, and I decided to implement a simple service that makes it possible for the administrators to send messages to ...
1
vote
1answer
13 views
C# Linq Split IEnumerable by Predicate
In order to divide an IEnumerable in C# by a predicate, I implemented the following (in a static class):
...
1
vote
0answers
5 views
MVC - One userprofile for company and person
I would appreciate if you tell me your opinion on this solution. The point is that I'm creating a web page which has two types of users with very similar permissions. Person and Company. The main ...
3
votes
1answer
42 views
Guess the chocolate box
I'm new to this competitive programming world. This morning I came across this question, which required the time to be less than 1 sec. But my code runs for 1.000069 sec, thereby rejecting my solution....
-1
votes
0answers
7 views
C++ code compiles successfully in ideone but gives Compilation error in Spoj EC_CONB [on hold]
Here is the code https://ideone.com/JwjssZ which is my solution of http://www.spoj.com/problems/EC_CONB.
If there is a compilation error in the code, it should appear in ideone also but it doesn't.
...
2
votes
0answers
16 views
Guess how many are in the jar game in Java - Take 2
Original question can be found here
I took the advice I got to heart, and re-wrote it. Once again I'd appreciate any advice as to how I can improve this using best practices.
Jar.java
...
-5
votes
0answers
19 views
homework c assignment [on hold]
Question (15 marks)
You’re required to build a game ‘Boom-The-Battleship’ in C program that fulfil the below requirements/rules:
• The mission of the player that plays the game is to find the ...
0
votes
0answers
11 views
Calling TWITCH API and displaying online/offline users of a channel
I've got this working almost to where I want it. The part I can't get right may be due to the programming so I'd like to get a review.
I'm making JSON calls to ...
0
votes
0answers
22 views
Bilingual code for removing a specific character and its neighbors from a string
Assume we have an string that contains the character 'c'. This character can be located anywhere within the string. The exercise ...
0
votes
0answers
11 views
Multi Producer - Single Consumer
I have written multi producer single consumer code with bounded buffer. Please review the code for any improvements or mistakes.
...
-4
votes
0answers
11 views
Newbie, crashes with error. Why? [on hold]
This code is from a tutorial and it says it should run but it does not. I get these errors. Why? Does this have something to do with python 2 VS 3? How do I fix it?
BTW this is a complete and working ...
-7
votes
0answers
9 views
4
votes
2answers
21 views
Python Tabletop Initiative Tracker
I wrote my first Python program today after working through a few books. I decided to build a group initiative tracker for our D&D group and was hoping to get some feedback. Critiques on code ...
1
vote
0answers
5 views
Mail service implementation using Razor engine a MailMessage
This is a very basic Mailer service that I put together after finding out that MVC Mailer doesn't play nice with MVC 5.
...
5
votes
1answer
38 views
nonstd:: non standard classes
I am looking for people's opinions on my use of a set of non standard "standard classes". Basically I am working on a 'modern' C++ Lexical Analyser and Parser Generator duo to replace flex and GNU ...
4
votes
0answers
15 views
Using argparse module within cmd interface
I've created an application that uses a cmd interface. It has multiple levels, and the number of available commands and their complexity is growing. As such, I need to generalise argument parsing - of ...
0
votes
0answers
10 views
Parallel Sum Scan using CUDA
I'm learning CUDA (and C to some extent), and one of the algorithms that I am learning is the Hillis-Steele scan algorithm. I wrote a program that performs a simple scan with adding.
I don't really ...
-2
votes
0answers
12 views
How to exclude tweets beginning with RT when scraping twitter [on hold]
please is ist possible to remove tweets begining with RT when scraping for tweets?
...
3
votes
1answer
46 views
Find a value in a comma delimited String
Here is a simple WPF converter method designed, where the object is a string, and the parameters are a string, which contain a set of comma separated values. The program return true if the list has ...
-4
votes
0answers
32 views
Multiplayer game MOBA [on hold]
I want your help in my project.
I want to create a simple MOBA game in Unity.
I have created the login server base C# with sockets connected with MySQL.
I have created the game server base C# with ...
0
votes
0answers
11 views
USACO Mixing Milk [on hold]
Problem description:
The Merry Milk Makers company buys milk from farmers, packages it into
attractive 1- and 2-Unit bottles, and then sells that milk to grocery
stores so we can each start ...
-4
votes
0answers
10 views
login of two tables with one procedure in asp.net [on hold]
I have 2 tables one is passengers and second is driver but am confuse how to make one login page for both users, i can not write stored procedure of login for both tables.
...
2
votes
1answer
45 views
Algorithm for two languages that merges and sorts two arrays without mutating one
This algorithm, which I have included its flowchart as well, takes an array of A[n], which is unsorted and unmutatable and an array of ...
-3
votes
0answers
20 views
5
votes
1answer
25 views
Comparing algorithms for computing binomial coefficients in Java
I have these 3 different algorithms for computing binomial coefficients (I also had the 4th recursive one, yet I discarded it since it is super slow). The first uses the factorial formula, the second ...
6
votes
1answer
28 views
Python App that parses file for lines that match a format
I recently wrote some code that was dinged on not having well defined tests and poor modularity. Was hoping someone could review my code and give me pointers on how to create more well-defined tests (...
11
votes
2answers
421 views
Beep-beep I'm a car factory
I have implemented to following generic factory in C++11 using smart pointers and I would like to get some feedback about it.
(Please note that I can't use C++14)
Due to company policies I have to ...
5
votes
2answers
71 views
Converting a decimal into a fraction
I have written a small program that converts a decimal number into a reduced fraction representation. I also designed this little program to be fairly robust, so that it can give the correct output ...
-2
votes
0answers
10 views
ASP.Net architecture problem or memory leak? [on hold]
Please review the following question and find flaws if there are any in the architecture (C# code).
http://stackoverflow.com/questions/36311852/asp-net-applications-memory-leak-and-architecture-...
2
votes
0answers
21 views
Easily add Accessibility to your app as an afterthought. Yes, as an afterthought
Accessible apps allow more users to use your app; however, it is usually an afterthought for developers, and it makes your XML layout files messy whether Accessibility was a forethought or ...
-1
votes
0answers
14 views
Is this the correct way to annotate a JSON extending to JSON-LD?
I am relatively new to extending regular JSON to JSON-LD. I am currently working on a project where our Mongo Collections will be available as open data and at the same time want to add semantic ...
2
votes
0answers
4 views
Exporting unread mail details for further processing
As the result of some expert procrastination I have over 4000 unread mail in my gmail box. While that does not hold a candle to what some people likely have I wanted to try and do something about it. ...
1
vote
1answer
37 views
5
votes
4answers
208 views
Custom list to avoid out of memory exceptions
The following class is a helper to avoid OutOfMemoryException exceptions being thrown when the list is to large so that it is added onto the large objects heap. To ...
2
votes
1answer
18 views
String building attribute selectors
I'm dynamically selecting elements in jQuery, how can I make it more resilient?
$('[data-example="' + exampleData + '"]').each(...);
I'm concerned that the data ...
1
vote
1answer
46 views
Guess how many are in the jar game in Java
I'm reading up on java and have completed a fairly simple console game.
I'm unsure on my own structure when considering maintainability, separation of concerns and best practices.
Any tips or ...
5
votes
3answers
42 views
CopyOf2DArray (Values Only)
Purpose:
Given a 2-Dimensional Array, return a copy of the Array. In VBA, if I just
Set newArray = oldArray
then newArray is ...
1
vote
0answers
11 views
auto_increment composite primary key with MySQL InnoDB
The intent is to have an auto_increment composite primary key on a InnoDB table which mimics the behavior as on a MyISAM table. The following assumes (3) InnoDB tables all with an auto_increment ...
4
votes
2answers
37 views
Implemetation of a queue for digicode-like system
What it is about
I created an application where you need to push invisible buttons in a certain order to unlock the advanced mode. To handle this, I wanted to use a queue (FIFO) of my own, adapted to ...
-3
votes
0answers
19 views
How to pass data on html page with wget? [on hold]
I want to send "6294" data on this web html page : "http://www.banquept.fr/2016_res_admiss/resultats_concours.php" for example.
I try to do it with this unix command :
wget ‐‐post-data ‘submit=6294’ ...
2
votes
1answer
54 views
Dynamic Programming: Optimal Solution for Number of Ways to get n
A cricketer can score 1, 2, 4 or 6 in a ball. Find in how many ways the player can score a total of "n" runs without hitting 3 consecutive boundaries. Note: Scoring 4 or 6 is considered as a boundary. ...
16
votes
6answers
2k views
Check if a Sudoku board is filled out correctly
The code below takes a filled out Sudoku board of size NxN, with sub-blocks of nxn, and checks if the solution is correct.
main_function takes a board as input. ...
2
votes
1answer
38 views
Count character replacements needed to make string a palindrome
Problem
Count the number of character replacements necessary to convert an input String to a palindrome.
Each character replacement must replace the given ...
1
vote
2answers
34 views
Code in patched Cygwin for calculating path to command interpreter
I'm working on a fork of Cygwin for native Windows development.
In this commit, I'm trying to improve the security of code that spawns cmd.exe, used by functions ...
13
votes
3answers
801 views
On-the-fly destructors
Due to my needing to use C libraries inside C++, I kept finding myself wanting to be able to ensure that the free function got called, even if an exception got ...
4
votes
1answer
23 views
Raspberry Pi headless server using bash and USB automounting
Revised from: Bash scripts and udev rules to handle USB auto mounting / unmounting
Tested:
Uses USB insert/remove to control a headless Raspberry Pi 3 with Raspian Jessie Lite
Changes:
Implement ...
4
votes
2answers
593 views
Project Euler #5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 ...
0
votes
0answers
13 views
A function that calls a function with variable number of parameters passed to both [on hold]
I have javascript code that repeats this pattern many times (though the values of INSTRUCTIONS and "a" are different each time). The number of elements in "INSTRUCTIONS" varies.
...
0
votes
0answers
31 views
Custom Input split for unstructured data
I am planning to parse below file with Spark, so I have written a custom input split, I want the values from Hadoop to Spark as ...