All Questions
-1
votes
0answers
4 views
Create a very simple four function integer calculator
Create a very simple four function integer calculator with buttons for Add, Subtract, Multiply, and Divide, and with two text-type input fields. When the user enters two numbers and clicks one of the ...
-2
votes
0answers
8 views
About C# merge sort on linked-list [on hold]
Maybe someone can help me out with writing main(); I wanna check if this merge-sort works with linked-list, started out c# just today and having problems with ...
0
votes
0answers
13 views
Refactor legacy code to spring
I am refactoring a legacy codebase to use spring. I am newish to spring and was wondering if you have any suggestions for the following code I refactored. Specifically about providing the ...
2
votes
0answers
11 views
Time Limit Exceeded with shortest path algorithm
The problem:
SHPATH
You are given a list of cities. Each direct connection between two
cities has its transportation cost (an integer bigger than 0). The
goal is to find the paths of ...
0
votes
1answer
27 views
File archiver, archive files into a zip file
I've created a simple little file archiver that will run through a given directory and extract your files into an archive folder. It's pretty cool if I do so say myself, I would like some critique on ...
0
votes
0answers
7 views
Condense JSON for bandwidth efficiency
JSON is quickly becoming the formatting standard of choice for quick, convenient, and reliable machine to machine communications. It is flexible and widely supported but it has some drawbacks when it ...
0
votes
0answers
3 views
1
vote
0answers
8 views
Handling GetTickCount() overflow in timeouts
This is code which must run on XP, so no GetTickCount64, and which should correctly handle the value wrapping around after 49 days. Can it be improved?
...
0
votes
0answers
5 views
-2
votes
0answers
21 views
Understanding about clean code [on hold]
I am struggling to write a clean code. I read lot of articles about clean code. I have written a small project to demonstrate my understanding. Can Someone review my code.
advice to improve the ...
1
vote
2answers
17 views
Binary string to decimal conversion
Problem Statement:
Write a program that will convert a binary number, represented as a
string (e.g. '101010'), to its decimal equivalent using first
principles
Implement binary to decimal ...
3
votes
1answer
23 views
Guess a number, any number, between 1 and 10
I am learning Ruby and would like to know how I am doing as far as writing the actual code.
Please keep in mind that this is my first Ruby script program, but I am trying to learn ruby in a very ...
3
votes
0answers
16 views
Building blocks of Life
I'm learning Clojure, and decided to write a Conway's Game of Life clone as my starting project. I ended up dicking around for a bit before diving in, and came up with a few functions that I'd like ...
3
votes
7answers
180 views
Rotate an array to the right by a given number of steps
Recently, I encountered this coding exercise on codility and the idea is
A zero-indexed array A consisting of N integers is given. Rotation of the array means that each element is shifted right by ...
3
votes
1answer
13 views
Re-arranging data on a worksheet based on contents of Column A
The following Macro sorts through a worksheet, copying and removing lines based on what appears in column A. If ("A" & i) is not a number, it triggers and moves the data to the appropriate place. ...
6
votes
0answers
10 views
Circumference and Area of a Circle in COBOL
I recently started Learning COBOL from Lynda and this is my code for the first challenge .
The Objective is that the user will provide the radius and we have to calculate the Circumference and the ...
3
votes
2answers
14 views
Avoiding misuse of optional unwrapping: LinkedList
Below is my implementation of a generic linked list in swift. Unfortunately, Swift playgrounds won't run until the compiler is totally happy - often, that involves clang making me explicitly unwrap ...
0
votes
0answers
11 views
Class for serializing generic gson objects
I realized I had just created two classes that were virtually identical for simply saving objects to their own json files, so I've attempted to make it more generic. My only noticeable problem is ...
-3
votes
0answers
19 views
Performance: Randomly selecting items from list of k size [on hold]
I am using numpy random choice np.random.choice(m, k, replace=False) to select k items randomly from a list and this is very time consuming if I have to run this step for 1 million transactions. I ...
0
votes
0answers
9 views
How can I make this code smaller or without a table? [on hold]
I have this code that I am trying to make it smaller, or don't use the tables to handle the aligns.
http://jsbin.com/yavikohuvo/1/edit
1
vote
1answer
14 views
Slow Filtering Method on DataGrid
Sometime ago I asked a question regarding a slow Filtering method for my DataGrid. Months later and I have a relatively quick method, though I am still looking to ...
1
vote
0answers
9 views
Unexpected result when trying to optimize code
I'm writing a module to procedurally generate a map of islands.
What it does is choosing for each chunk some points inside that chunk that work as the center of each island, then for each tile on the ...
0
votes
0answers
10 views
Process bulk update actions
It's using four sections of code block, I just want it to be reduced to one contiguous set that does either a or b with the two sections not a copy/pasted approach as done here:
...
3
votes
1answer
44 views
Simple code-golf programming language written in Python
I've written a "simple" interpreter for a programming language in Python, called Tellurium (named after the element of the same name). So far, it's working pretty well, but there are some things I'd ...
2
votes
1answer
27 views
Transition from old style to functional programming
I'm trying to transition myself from my old coding-style (if-else, for.. in) to functional programming. I've tried to update the ...
0
votes
1answer
15 views
Crawling SPOJ through cURL and C++
I am trying to write industry standard code.
https://www.quora.com/How-do-I-follow-a-user-on-Spoj-for-solving-problems-Refer-Details
Someone gave me this A2A.
And I wrote this code for it
...
3
votes
0answers
95 views
Is Pokemon exception handling ever acceptable? [migrated]
Normally, I don't anticipate exceptions and if I get them, its something that I can't fix in my code - bad user input or connectivity issues with the database.
But errors do occur so at the very ...
-4
votes
0answers
29 views
HOW to write a code for string palidrome using Recursive function [on hold]
Write a recursive function that returns 1 if a given string is palindrome in c#?
2
votes
2answers
35 views
Exposing a data member in a class
I have a class a which has some methods(geti, seti) which I want to have in all classes b, b1, b2,...b100
I can only think of using a macro right now and it makes debugging a pain, is there a better ...
1
vote
0answers
8 views
ChiSquare test Code in Python
I was trying to write a code from scratch for Chi-square test.This is the code that I had written in python using pandas.I had a doubt whether the code can produce the desired output or can be written ...
0
votes
0answers
11 views
Responsive horizontal scroll on mouse position
I am testing out a responsive horizontal scroll UI. The horizontal scroll position is calculated according to the mouse horizontal position:
codepen
...
15
votes
1answer
1k views
Charmander Brainfuck interpreter in Haskell
I just started learning Haskell and this is my first big project (ie not factorials, fibonacci or graphers). This is kind of a gift for somebody so the language is a bit different. The program works, ...
1
vote
2answers
31 views
C++11 Blocking Queue learning exercise
As part of my own C++11 learning exercise I have implemented this Blocking Queue using the new C++11 thread API. One of the aspects I would like to improve is efficiency i.e. in the ...
1
vote
0answers
17 views
An [InternalCopyArray] by any other name
So I'm building a 2D Array class.
I want to have CopyArray and RemoveIndexes functions. However, in both cases, the method ...
2
votes
2answers
39 views
C# SerialPort implementation
I'm writing a C# WPF project built with a MVVM pattern.
This software is written to use a medical diagnostic device, so in our planning it will be certified IEC 62304. Since I've been mainly writing ...
2
votes
0answers
23 views
Calculate the arclength
I am trying to estimate a good approximation for sqrt(1-x^2) for x ∈ [0, 1]. I did this using a bezièr curve, and made it so ...
-3
votes
0answers
25 views
How do I avoid the runtime error in the following code? [on hold]
INTEST - Enormous Input Test
no tags
The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous ...
2
votes
1answer
14 views
Simple pool of threads which calculate the sum of a given number from the main process
I have to make a program which creates a number of threads that are waiting at the beginning, then the main process creates a doubly linked list where random numbers are put and then a signal tells ...
0
votes
0answers
33 views
How to optimize this java code to accept any object and return the object
I have been tinkering with generic methods in java but still haven't figured out a way to optimize this code.
...
2
votes
0answers
26 views
Sort stack using two stacks
My program is supposed to sort a stack such that the smallest item are on the top. I can use a temporary stack, but you may not copy the elements into any other data structure. The program works ...
2
votes
1answer
26 views
Calculate the lattice paths in an n*n lattice (Project Euler #15)
Project Euler #15 is to find out all the distinct possible ways there are to move from the first point (1,1) to point (n,n) in an n*n lattice.
...
1
vote
0answers
19 views
2
votes
0answers
23 views
JavaScript Audio Player
Looking for feedback on any bad practices and general advice on how I might better structure my code.
...
2
votes
0answers
27 views
Testing different implementations of malloc()
Can you help me verify my test result? I'm testing different malloc() implementations with a small program that allocates gigabytes many times:
...
7
votes
1answer
87 views
Basic C# calculator code
I have not had any experience with coding before, and after beginning to learn I stated working on this calculator which runs different functions on the console. I'd like to hopefully be taught what I ...
3
votes
1answer
17 views
Code to copy, paste and summarize a data set
The code currently works as it should and seems to work dynamically as I need it to but I am pretty new to Excel so I think there is probably a better way to do some of the things I have set up. I ...
0
votes
0answers
13 views
SQL query to include one column value for one condition and exclude other columns
I am learning writing T-SQL queries can any help me writing the query for below scenario
I have columns im.mfg with values(R, K, I ,Z) and ...
-4
votes
0answers
10 views
argument of type “const char *” is incompatible with parameter of type “LPCWSTR” [on hold]
http://i.stack.imgur.com/3rbmo.jpg
The link to the image is above
I need help with the error in the image i just put on Please need help.
1
vote
0answers
23 views
Optimizing a Java solution to Project Euler Problem 23
I've tried to make something optimized for the Project Euler problem 23, named "Non-abundant sums".
I've fine-tuned my solution to the following:
I added divisors to the slots of each number to ...
-1
votes
0answers
7 views
Delaying Jquery CSS Animation using mousemove [on hold]
I've been trying to put 10 seconds delay on this jquery css animation which is dependent on mousemove. I've tried unsuccesfully utilizing both .delay and .setInterval right before like so:
...