All Questions
0
votes
0answers
8 views
Binary search tree implementation. in C#
I have implemented a BST for an assignment in C#. I am still in the process of implementing IEnumerable and ToList functions but the core of this is done. Please review and critique this code.
...
0
votes
0answers
11 views
A simple pocket calculator
I was searching the internet for some Python exercises, and I've found a lab assignment from University of Toronto. Here's the major of it:
Question 1. Welcome Message In the if name == "main" ...
0
votes
0answers
4 views
Button not showing in android app [on hold]
Hello I have created six buttons in an app in android studio inside the Relative Layout. The buttons show OK in the preview mode of android studio but they second last one does not show when I install ...
0
votes
0answers
8 views
My web application in Spring [on hold]
I am learning Spring and I wanted to show you what I'v done so far.
In this project I am using: Spring, Twitter Bootstrap, Apache Tiles, Hibernate.
Code:
https://github.com/siejajedrzej/quick
...
0
votes
0answers
8 views
Managing documents with manager
So I have a program that visualizes data from files (csv,txt,etc.). These files are saved to database as individual tables. In my application I have DocumentExplorer...
0
votes
0answers
7 views
1
vote
0answers
5 views
Laravel 5.3 model for mapping pages to multilingual translations
I have a Many To Many Polymorphic Relation like this:
...
0
votes
0answers
10 views
Creating a Backbon.js autoloader
I'm learning backbone and i have written following code to always start my apps with it.
The code is for auto loading any item that wants connect itself to the app. Exactly i can auto load all my ...
1
vote
0answers
14 views
PopupMenu implementation that hacks inflating a @MenuRes
Summary
Usage will ask for a Context and a @MenuRes and then use the ...
0
votes
0answers
7 views
Unique values of an array
I'm curious if there is another way to code this? Let's say with a While loop?
...
0
votes
0answers
6 views
React.js components for Players and Playlists
I have two classes in React that have their own methods but also share the exact same methods as seen below. I can't seperate them in to another file and do ...
2
votes
0answers
4 views
jQuery Mobile Menu plugin
I would like some opinions on this Mobile Menu plugin I wrote for work. We develop custom WordPress themes, nothing too advanced or anything. I would like if anyone could just take a look and provide ...
0
votes
0answers
3 views
AngularJs ui-router ui-sref not generating href from nested state with parameter [on hold]
I'm new to angular (and an aspiring junior dev), and I can't get ui-router's ui-sref to generate an href.
The code isn't pretty, but it works without .state('names.new'). I'm getting from .state('...
-1
votes
0answers
11 views
The vending machine program
Requirements:
The vending machine program will be able to :
Set the name of each of the 4 phones
The amount of each phone in stock
Give the option to buy one of the four different mobile phones (e.g.,...
1
vote
2answers
16 views
Implementing my own shared-ownership double-indirecting smart-pointer
I am implementing my own double-indirecting shared-ownership smart-pointer because I needed a way to replace the managed object a group of smart-pointers is pointing to with a new object (it's the ...
0
votes
0answers
7 views
efficiently use functional call for set of function with very similar argument list [on hold]
I've implemented set of function under specific workflow, where all functions tested with real data set efficiently. While I am brainstorming on efficiency of this pipeline with the helping of ...
1
vote
0answers
14 views
Concurrent SSH session pool
In my application I need to perform several SSH commands from Windows to a Linux machine.
Since I need to reduce as much as possible the SSH calls overhead and also limit the number of concurrent ...
1
vote
0answers
3 views
Launch and place application depending on screen resolution
I got fed up off opening a set of applications when I wanted to code. So I decided to read up on AppleScript and came up with the following task for myself.
Open a application of choice on a given ...
5
votes
2answers
172 views
Huffman compressor in Java
I have this Java program that can en-/decode files, both text and binary. What comes to critique I want to hear anything regarding these points:
Performance,
Modularity,
Coding conventions,
Naming ...
-3
votes
0answers
13 views
Update or set values for a record collection [on hold]
If this is a wrong place to ask this, please let me know.
Hello.
I'm given the following problem.
This is my code: My Code
I'm having issues determining the problem in my code. I can't figure out ...
5
votes
0answers
24 views
Unit-testing friendly singleton
In my project we have a few singletons, which tends to be problematic in unit tests. So I wanted to find solution for the problem. Here is what I came with so far:
smart_singleton.h
...
0
votes
0answers
9 views
Iterative “counting change” implementation in mit-scheme
Here is my iterative implementation of the Counting change example in SICP. Please note that I'm a beginner, which means I only know the basic syntax for the time being.
Requirement:
How many ...
-4
votes
0answers
14 views
compute the weekly hours of each employee in c++ [on hold]
compute the weekly hours for each employee) suppose the weekly hours for all employees are stored in a two dimensional array.each row records an employee's seven day work hours with seven columns. ...
5
votes
2answers
157 views
Reduce as many adjacent chars as possible in string
This code is meant to reduce a given string as much as possible by deleting adjacent characters. Here are some examples:
...
3
votes
1answer
21 views
ISO 8601 dates & times format into a more human readable format
I wrote from the ground up this small piece of code which transforms dates and times formatted in ISO 8601 format into a more human readable format, client-side. The main goal is that you can create ...
-2
votes
0answers
12 views
Difference between Python and C++ code for Finding the minimum lcm of list of numbers [on hold]
I am trying to solve this problem:
https://www.codechef.com/problems/ALEXTASK
and I have two solutions for this. One in C++
...
3
votes
1answer
14 views
Finding black and white images
I am looking to speed up the search for black and white images. I have about 150,000 images that I need to check but this is taking so long. How can I speed up the code?
...
3
votes
1answer
30 views
MarsRover in Scala
This is my first attempt at Scala programming. I tried to be functional but I'm not sure if I have achieved that.
DataTypes.scala
...
2
votes
1answer
25 views
Compute the probabilities of getting each of the possible sums when throwing 2 dice, n times
I'm struggling with some coding-inexperience. The code I've written below, is extremely inconvenient and ugly to look at.
My question to you is:
How can this be done more efficiently? The way I've ...
0
votes
0answers
9 views
Array Menu Switch Options, Black Executing Program [on hold]
This is some code put together using an array to store numbers using a menu to let the user input, delete, and sort data. The compiler doesn't seem to have any issues, but executing the program ...
2
votes
1answer
30 views
HackerRank Strange Counter
I wrote a solution to HackerRank Strange Counter:
The counter counts down in cycles. At t = 1, the counter displays the number 3. At each subsequent second, the number displayed by the counter ...
4
votes
1answer
39 views
Text-based Adventure-Game Engine
I wanted to create some kind of generic text-based adventure-game
engine to see if I could build an interesting puzzle out of it.
The idea was to define a mini-language to be able to define the
...
5
votes
0answers
32 views
Battleships Player vs Computer Algorithm
I am a Year 12 student studying CS for my A-Levels. I have had previous Python experience but it is obviously not to professional/industry standard. Therefore, my goal for this review is for my code ...
3
votes
1answer
44 views
Code that uses reflection to validate arguments
I wrote an answer to this question on the Software Engineering SE site and was hoping to get it critiqued. (I'm told that it's acceptable to do so).
Essentially, this code uses reflection to check to ...
5
votes
1answer
40 views
Slot Machine Simulator with JAVA
I'm studying alone, so I don't know if I'm writing efficiently. Could this SLOT MACHINE SIMULATOR code be improved? How?
...
1
vote
0answers
15 views
How to make query run faster when using sub-query
First part of the query grabs Policy's Premiums, Effective and ...
0
votes
0answers
20 views
2
votes
0answers
13 views
REST API integration test
We have a (Spring) REST API that I was tasked to write integration tests for. I wrote various ways to test our REST API and then just decided to make 1 integration test class that processes all JSON ...
2
votes
1answer
43 views
Simple class to mimic a dynamic array
for my c++ class I was asked to write a class with the following characteristics:
Implement a vector replacement that operates only on integers (you don't need to use templates like the normal STL)...
3
votes
1answer
41 views
List abstraction using array
Following this reference, below is the list abstraction implementation using array,
...
0
votes
1answer
15 views
Sort the input file text by most frequent and alphabetically [on hold]
The input file is a long .txt file that is indicated by a path. The program should be able to find the most frequent words in the file. As well as the output should be sorted, if 2 words appear the ...
0
votes
0answers
12 views
Delete Matching Records in Fact Table [on hold]
My question is, can this query be simplified so that I don't have to change the unique ID the tables join on each time I reuse this package? I would like to simply replace the table names with a ...
1
vote
1answer
36 views
Python program for testing the Collatz Conjecture
This is a simple program to test if integers will follow an interesting, improvable statement that if disproven, calls for a bravo.
But, ignoring the pretentious poetry, this code allows the user to ...
-2
votes
0answers
19 views
What is better rejected promise or throw an error when you perform a async request [on hold]
Hey guys was discussing with my team this two approaches we wonder what would be the best for this function that performs a request. First example it will gracefully return a rejected promised. The ...
2
votes
0answers
11 views
Parallel and Sequential array looping with async/await
Are these good implementations of parallel and sequential "extension" methods, and do they accomplish what I think they do?
My understanding is that the first one is parallel because the await ...
4
votes
0answers
27 views
Parsing cron expression
I'm building my own scheduler and I took the first step by creating a cron expression parser.
To test it I used this expression to cover each case. (I guess the 52W is wrong but this doesn't matter ...
3
votes
0answers
15 views
Code for neuroscientific testing
I have written the code below for the following experiment:
Subjects get simultaneous stimulation of left and right thumb and have to tell which one was stimulated "stronger" (with higher intensity, ...
1
vote
1answer
53 views
Random number guessing game in python
I just started learning Python this week and put this together for my first program (outside of a Hello World one). Does anyone have any feedback/suggestions for improvement for this? I've tried to ...
0
votes
1answer
15 views
Print Connected Components Scala
Given a file containing adjacent IDs:
i1, i2, i5
i3, i4
i2, i6, i7
i4, i8
i9, i3
I would like to print each of the connected components:
...
-1
votes
0answers
11 views
How to create dynamic excel VBA range using integers in a fill down line? [on hold]
I'm trying to fill down a column but it's a looped operation and has to be dynamic. In a simplified sence
Works:
Cells(3, 8).AutoFill Destination:=Range("H3:H" & 30)
How do I change "H3:H" so ...