All Questions
0
votes
0answers
4 views
Project Euler 29 logic
I just finished Project Euler #29. And it worked successfully. But after comparing my answers to those from other folks, i realize my answer is wrong. Now it seemed to give me the correct example when ...
0
votes
0answers
2 views
React Native - Rendering different scenes based on application state
I am using react-native-router-flux to organize the routes for my application. Using Firebase, I am able to call ...
0
votes
0answers
4 views
Getting the last post of all threads
My MySQL query is loading very slowly (over 30 secs) and I was wandering what tweaks I can make to optimize it.
The query should return the last post with the string "?" of all threads.
...
0
votes
0answers
6 views
Swift Hackerrank Maximum Element in a Stack
I solve this problem in Swift. I'm not sure if using an array was the right way to approach it since the problem was on stacks. Any feedback on my code is appreciated:
You have an empty sequence, ...
0
votes
0answers
5 views
Makefile and object file directory
Ok this is the first makefile I've ever written. I it works and that's about it. Things that I was wondering if if I can specify where the object files go. It looks really bad with all the .o files ...
0
votes
0answers
8 views
Copy and paste to different worksheets
This code:
Copies a value from "Sheet1"
Pastes special (as a number) in another sheet "Sheet2"
Jumps to the next line
I ...
0
votes
0answers
12 views
Project Euler #29 [on hold]
I just finished Project Euler #29. And it worked successfully. But after comparing my answers to those from other folks, i realize my answer is wrong. Now it seemed to give me the correct example when ...
2
votes
0answers
12 views
Two versions of Sudoku
I have written two versions of a sudoku solver. Both can solve 9x9 sudoku boards in <200 ms. One of the implementations uses numpy. I am looking for feedback on both, but particularly on why my ...
2
votes
3answers
44 views
Simple Chaining Implementation of HashMap
I'm practicing writing my own simple version of a Java HashMap. I don't have much experience with generics in Java.
...
0
votes
0answers
5 views
Laravel controller to update appointment requests
My question/refactor is similar to what is found here:
Laravel controller for form validation skinny
However I feel that the answer is for 5.0 and not 5.2.
This question does not pertain only to one ...
2
votes
1answer
14 views
Django Create Profile Example
this is my first post here so I apologize if this already exists as I haven't gotten acclimated to the nuances of this website yet. I was creating a view with Django that would create a user profile ...
2
votes
2answers
45 views
Print numbers in a concentric square pattern
I am trying to solve a programming problem on a coding platform. When I execute it on my PC, it works perfectly, but when I submit the code on the coding platform, it throws a "Time Limit Exceeded" ...
1
vote
0answers
20 views
Facet for simple math expressions
I've built simple math expression facet which ignores any character except numbers and operators listed below:
plus, minus, multiply, divide, degree, left bracket, right bracket, assignment
I'm ...
4
votes
0answers
8 views
Script to record an inventory of a backup
This is a script designed to make an inventory file which records the
contents of a directory allowing verification that a backup has the
same data. The same script can also
A full github repo is ...
1
vote
0answers
24 views
Solving the Mining algorithm from HackerRank
I was working on this problem for a few hours last night and finally came up with a brute-force solution. The task is to report the minimum work necessary (sum of weight × distance) to relocate gold ...
2
votes
0answers
15 views
Library system manager
I'm new to JavaScript OOP and still playing around with it. I have put together a few specific questions over specific details throughout the code that are bothering me.
I wanted my ...
1
vote
0answers
16 views
“Similar Destinations” challenge
I am currently solving a challenge that I found on Hackerrank and am in need of some assistance in the code optimization/performance department. I've managed to get my code working and returning the ...
2
votes
1answer
27 views
Programming challenge “Friend Request in Social Network”
I am trying to solve a programming problem on a coding platform. When I execute it on my PC, it works perfectly, but when I submit the code on the coding platform, it throws a "Time Limit Exceeded" ...
1
vote
1answer
23 views
Sort the characters in a UnicodeString
The task: sort the characters in a string, as provided by the ICU UnicodeString. This is because I want to be able to find anagrams using the suggestion from "...
3
votes
1answer
17 views
Statistical Analysis of X-Wing Game Dice
I was in a discussion about mechanics of the X-Wing miniatures game where we were discussing a couple of the ways to improve attacks and I put together this small C# console application to determine ...
2
votes
1answer
16 views
Image-processing filters using decorator pattern in Java
This is a follow-up question of this other one, where I was trying to use the Decorator Pattern in a Python example. I figured, that Java might be a better language for this exercise, so I ported my ...
-1
votes
0answers
10 views
MVC and use of partial class for Controller [on hold]
This is more conceptual question but I have a webpage and frontend contains for example this pages
Customer modul
Search customer and show its detail
Create or update a customer
Migrate selected ...
5
votes
2answers
273 views
First simple multithreaded application
It's been quite some time since I got my eye on the multi-threading, today I decided to create a really simple application which runs 2 while loops simultaneously and prints the current progress of ...
1
vote
1answer
51 views
Dynamic Routing PHP MVC
I'm creating a simple MVC framework for a new version of my website I'm working on. Currently I have simple routing, such as /about-us etc ...
I've just implemented 'my version' of dynamic routing. I ...
4
votes
2answers
87 views
Printing an N*N array in the rectangular/circular/spiral fashion
The problem is to print an N*N array and fill it with numbers(starting from 1 at (0,0)) in the rectangular/circular/spiral fashion, going inwards, ending at the N*N value.
Also find and count the ...
0
votes
1answer
64 views
Find if a part of the integer from another integer is divisible by 7?
The question states:
Given an integer A, and two indices Li, Ri. Find if the number from A which is bounded by the two indices is divisible by 7?
For example if A = 357753
indices Li = 3, ...
6
votes
1answer
71 views
Cipher text using a 2D array
I have a simple program which ciphers text using a 2D array. You specify what letters to replace with what and it does it.
I understand the code is very repetitive and that I should probably use ...
0
votes
0answers
13 views
Is there an appropriate name for a “middle” table that only stores foreign keys of other tables? [on hold]
Right now I am designing a new database for our family business. I have a few tables like in the image above, where the table only contains two foreign keys in order to represent an association ...
2
votes
0answers
26 views
Calculate and plot expected value involving summations and products
I wrote a code to calculate a series of summations and products for a maths assignment I'm doing. The equation is shown below.
$$E(\sigma)=[1-(P(\text{$1^{st}$ rejects}) \times P(\text{$2^{nd}$ ...
1
vote
2answers
49 views
Google Foobar Challenge: Spy Snippets in Python [on hold]
I am getting all the answers correct. But still the solution is not accepted as only 4/5 tests cases are passed.
I have not posted the whole problem statement but the problem is similar to this.
I ...
6
votes
3answers
63 views
9x9 Sudoku solver
I wrote this in C++ in February and am planning on adding a generator to it. Before I do that, I'd like to get input on how to improve what I've done thus far.
The goal was to be able to solve every ...
2
votes
0answers
38 views
Replace EOL in stream
I need to replace the windows EOL "\r\n" with just "\n", and I want to this in the fastest way possible, as the software will have a lot of files to upload, many of them with a few thousands lines. ...
4
votes
2answers
165 views
Person Info Manager
In the process of teaching myself JavaScript. Starting to branch off into OOP designs and did not want to continue until I knew I was doing it correctly.
Is this a common or accepted way of ...
0
votes
1answer
16 views
Using the BBC iPlayer API for managing TV programs
I have been learning Ruby by reading books and tutorials, and practising some problems on Codewars to level-up my new skills, when I had an idea for a little Ruby code project. It will store ...
0
votes
1answer
31 views
Getting all the master nodes in an elasticsearch cluster
I am trying to get all the master nodes in an elasticsearch cluster using this code. Can I reduce/simply this or optimize further?
...
7
votes
0answers
43 views
Fighting f̶i̶r̶e̶ regex with f̶i̶r̶e̶ regex
So someone requested a Regex Builder / Assistant for Rubberduck and since my CS class had been covering the topic only recently I was thinking to myself: "This sounds interesting, you should do this".
...
0
votes
0answers
17 views
Morse Code Translator in a GUI [on hold]
I made a morse code translator with a GUI which I made in eclipse's WindowBuilder. It works, but I feel like things are very wrong, because things don't show up until I click in it or hover over where ...
3
votes
0answers
12 views
jQuery modal dialog plugin
I'm working on creating a new jQuery modal plugin. I'm pretty good at jQuery but still pretty new to the whole object oriented plug-and-play style of plugins so I used a different plugin I found ...
11
votes
2answers
927 views
Tetris in C, in 200 lines
I aimed at making fully functional (real) Tetris, in the shortest way possible in C. The result is a terminal game for Linux, that uses ncurses. I made it for my friend, who wanted to play it on his ...
0
votes
0answers
20 views
A very basic inventory app with search in Angular2
So, I have been learning TypeScript and Angular2 and I came up with this:
...
2
votes
1answer
22 views
Emulating super() in Python 3.x using Python 2.7
Depending on the name of the first argument, self.__sup or cls.__sup behaves like super() in ...
-2
votes
0answers
21 views
Asynchronous DB data retrieval and asynchronously posting it to Queue using RxJava [on hold]
I am testing an operation where I read data from DB and sent it asynchronously while I also post the received data to a Queue asynchronously using RxJava. I have ...
1
vote
0answers
40 views
Moving a div inside p by to the body element
I get malformed HTML input with divs inside other HTML elements like the ...
7
votes
1answer
37 views
Steganography with AES encryption
I created a small program that hides arbitrary files in png images using steganography - it encodes the files in the two least significant bits of every channel, so using a 4-channel png we can encode ...
1
vote
2answers
21 views
Check if an Array of Arrays contains a value in node js
In C#, I could check if any of the nested List collection has a value. Example of such structure Check a List[]> contains a value using Linq
...
-1
votes
0answers
26 views
Implemeting strategy pattern with multiple variables? [on hold]
I am trying to implement Strategy Pattern for handling my content serialization and deserialization.
So I have four kind of requests namely CREATE, RETRIEVE, UPDATE, DELETE and for each request I want ...
0
votes
1answer
14 views
RAILS: preventing the duplicate submission of an object.
I have a rails app where doctors score patients on diagnosis - their score is the model Baseline. Each Baseline has a user id and a patient id and there should only be one baseline for each patient by ...
4
votes
0answers
30 views
Recursive vs non-recursive file/folder copy functions with optional replacement
Would someone else reading my code wish it wasn't recursive?
I'm writing a function to report file and folder copy errors. For now exceptions are being printed but they will be eventually sent to a ...
1
vote
1answer
14 views
Extract specified field value from filename using positional indexing
I have some filenames, and they each have data contained in them at specific locations in the string. I want a function that returns the value of the data specified by ...
-3
votes
0answers
17 views
Wilson Primes Calculator [on hold]
I've been trying to get my c code to calculate all wilson primes which are all numbers that answer the equation ((p-1)! + 1)/(p^2) with a whole number. I didn't think that there was a preexisting math ...