1
vote
2answers
13 views
C++ Code : Overuse of functions?
I am currently learning C++ though Bjarne Stroustrup book 'Programming Principles and Practices using C++'.
Going through the drills I am trying to purposefully write efficient and readable code ...
0
votes
0answers
6 views
Quick way to write long hash
I've created a hash for a File Converter, the purpose of the hash will be, the file gets loaded into the program, from there the file goes to a hex editor and the user picks and chooses what they want ...
0
votes
0answers
11 views
BufferAggregate - reinventing the wheel?
In the ongoing saga of me rewriting functions that can be easily composed from existing Rx functions, I present my latest progeny: a bastard combination of Scan and Aggregate. The aim is to aggregate ...
1
vote
0answers
12 views
Removing spam from a database using NodeJS
I've written the following in NodeJS as I am trying to learn a bit more about that toolset. It 'works' but is not very robust. I am not concerned with security at this stage and the code will not be ...
8
votes
2answers
635 views
Hooked on Windows
The code that was just added to Rubberduck will allow us to set up hotkeys for our features, so that next release, Ctrl+Shift+R brings up the refactor/rename dialog, for example.
The requirements ...
4
votes
0answers
19 views
Editing Javascript and rendering HTML in one window v2
I wanted to revisit this site to post some recent work I put into this small project. I was able to add a console as suggested; but I thought I would ask here how my coding stying is before I work on ...
5
votes
3answers
768 views
Printing all primes < 1,000,000 to a text file
It takes a long time to execute and the CPU usage for the executable is about 25% while it is executing. Any ideas on how to make this faster?
primes.c:
...
-4
votes
0answers
13 views
8
votes
2answers
283 views
Scanning multiple huge files in Python
I'm trying to implement an algorithm able to search for multiple keys through ten huge files in Python (16 million of rows each one). I've got a sorted file with 62 million of keys, and I'm trying to ...
1
vote
0answers
39 views
Non-curses pager in C (revision 2)
In this revision (follow-up of this post) I've fixed reading from stdin, and also tried to minimise the damage caused by typing additional characters. You might want to see my original post on this.
...
2
votes
1answer
19 views
Bracket Pair Validation
Validate that the following bracket pairs [], {}, () open and close successfully in a ...
7
votes
1answer
327 views
Non-curses pager in C
I have written a pager in C that is supposed to be used in systems where curses is not installed (or broken). It can also be used as a system-wide pager, it works ...
1
vote
0answers
11 views
Rails conditional sorting based on params
The following code sorts the current users bid model items based on a param condition :bid_status. It starts to get messy when checking if the project space (...
2
votes
0answers
12 views
A closable footer bar with a floating info box
I wrote this page with the goal in mind of having a closable footer that runs along the bottom of the page that can be closed, and has a floating info box that appears when the footer is hovered over. ...
3
votes
2answers
40 views
Multiplayer BlackJack using Vector
This is a small program I wrote for GCSE computing, it operates using Vectors and that's pretty much it, wondering if you could tell me if there is anything I could do better.
BlackJackv2.cpp
...
2
votes
1answer
19 views
Making a grid of videos
In my single-work.php I have some code with slight variations that I feel could be more DRY. When there are only slight variations like this is it ok to repeat part ...
12
votes
3answers
497 views
Project Euler 6: Difference between sum of squares and square of sum
I've created a (very) simple solution for Project Euler problem 6:
Project Euler Problem 6: Sum square difference
The sum of the squares of the first ten natural numbers is,
$$ 1^2 + 2^2 ...
4
votes
0answers
14 views
Selecting time metadata off a calendar table
I have a report on SSRS (that's SQL Server Reporting Services) that I need to be able to parameterize so that it can run for..
Yesterday (scheduled every morning)
The week that just elapsed ...
-8
votes
0answers
25 views
how to write atm deposit function program in C [on hold]
At the start of every program run, the Customer.txt File should be read into an array of structures. All updates should be performed on this array. At the end of the program run, write the updated ...
3
votes
2answers
62 views
Check if divisible
Description
My program checks the sum of 2 numbers to determine if it is divisible by a certain number (5 in this case). Divisible numbers are deemed usable (for another program I am running). Next it ...
0
votes
0answers
28 views
Funds transfer authorization
I have the working code but it is pretty dirty. The goal is to input a number in an application. If it satisfies the min/max logic then jump to the authorization part. Afterwards we can confirm it or ...
7
votes
1answer
44 views
What an Enigma! (Machine Simulator)
I've made this some time ago for an assignment and I was wondering how it could be improved both in terms of performance and best practices for C code.
...
4
votes
1answer
22 views
Processing text messages from a GSM module
I have a Tiva TM4C ARM processor connected to a GSM modem (SIM900). When the GSM modem receives a new text message it sends a UART string to the MCU, where an interrupt routine increments a new ...
-6
votes
0answers
31 views
I keep getting <has_map deprecated> [on hold]
Implement an integer stack as a class using an array, and create a main function to test your implementation. This solution uses tos as the array index to define the stack. when you push you should ...
3
votes
1answer
48 views
ASCII art minesweeper clone
I wanted to code a small ASCII art minesweeper clone, to see what it looked like and how much code it needed.
The result is not so bad, under 80 new lines of code in total. It looks kinda readable to ...
0
votes
2answers
26 views
Command line google searching
I have a bash script that is meant to start a google search from the command line. I am also looking to implement a way of getting source code for the search page possibly through a subscript. This is ...
3
votes
3answers
456 views
Format of hexeditor
Is there a cleaner way to write this code? It's the start of a hexeditor I'm creating.
I'm aware that the variables aren't descriptive, this is just a test run for when I imbed it into a File ...
8
votes
2answers
107 views
Finding the busiest time-frame in a parking lot
The text file containing cars' arrival and departure time will upload stuff from the parking lot.
Text will be like this:
...
-4
votes
0answers
33 views
Sudoku solver C++ [on hold]
I am trying to make a Sudoku solver C++ program. The user inputs the sudoku board with blank spaces as zeroes. The program should process the values and replace zeroes with appropriate numbers.
I got ...
1
vote
0answers
142 views
Node.js module architecture for third party API
(If my questions below code seems too broad for coderewiew, please feel free to downvote this topic)
I'm writing a node.js module that is basically a wrapper for some API functions of third party ...
0
votes
0answers
28 views
Arbitrary function redirection at runtime
This code is for my upcoming challenge on PPCG. The key part of this challenge is supposed ability to overwrite functions that other people have written. Overwriting functions will happen at ...
1
vote
1answer
19 views
Least Mean Square channel equalizer
I've written (and tested) a simple least mean square adaptive filter . The steps of the algorithm are:
...
5
votes
3answers
214 views
Audio player for a website
I'm fairly new to jQuery and have decided to make a jQuery audio player for a website.
There are two versions of the way it selects the audio:
Here
Here
I removed some basic, not connected with ...
-2
votes
0answers
20 views
How to transform switch statement to if statement? [on hold]
I was wondering if I can convert the following into a if statement rather than it being a switch statement.
...
1
vote
1answer
12 views
Unit Testing Express Middleware That Verifies Auth Tokens
I am writing an Express middleware component that'll run on Node 4, which has limited ES2015 support.
The fundamental purpose of this component is to verify JSON web tokens, using the jsonwebtoken ...
2
votes
1answer
19 views
Converting fraction notation in strings to a Rational data type
I've been messing around with a RationalInt type, using a simple
int-based structure for the time being. I've created code to ...
3
votes
3answers
67 views
Managing many availability status
I'm a junior who wants to refactor a big method in my code, which has been tested and works:
...
4
votes
2answers
72 views
0
votes
0answers
24 views
Factoryclass versus Factorymethod in POJO [migrated]
I have this java class, which is used to create JSON objects:
...
1
vote
2answers
39 views
Determining whether a loop iterated at least one element in generator function
I have a case in which I need to determine whether a for loop yielded at least one element:
...
1
vote
1answer
25 views
Calculating a quality score of something based on attributes
I'm willing to have a way to calculate a quality score of an object; in this case an addressbook contact.
I believe there are way better approaches to do this and I'd like to hear your references.
...
1
vote
0answers
13 views
Two Cache::remember in same method
I'm using Cache::remember to cache 3 results in my action, 2 in the same call to Cache::remember. It works, but I have 2 ...
0
votes
1answer
48 views
Getting data async
I need to handle concurrent requests by waiting for the result of an already running operation. Is this code safe or does it contain bugs?
...
1
vote
2answers
26 views
Read characters from stdin into an resizeable array
As first steps in C, I'm trying to write a program that reads from stdin into an array allocated on the free store, until an exclamation mark ! is entered. The ...
3
votes
0answers
24 views
Benchmarking String splitting
This is a follow-up from this Code Review question.
There are a number of ways of splitting a String using a delimiter in Java, especially now with Java 8:
...
2
votes
1answer
96 views
Scala - how can I refactor Play Framework controller
I am using Play Framework and Slick. Is this controller and method to save user is written in the correct way
userController.scala
...
2
votes
0answers
16 views
Google maps class inside fragment , with marker carry object
I need someone review my google map class , here is my situation I am working in medical project , I created one class to show hospital items in map with data object , here is my fragment class , I ...
1
vote
1answer
64 views
-1
votes
0answers
10 views
How can I use get id with wp job manger category search? [on hold]
Im trying to make a form that goes from the home page where you can fill out location and job sector from a drop down list and then its sends the values to the jobs page and search the jobs with the ...
9
votes
3answers
3k views
Read one million records per second
The following code ingests 10k-20k records per second and I want to improve the performance of it. I'm reading json and ingesting it into the database using Kafka. I'm running it on the cluster of ...