Add this tag to your question to indicate that you are new to the language of your code. This will often be taken in to consideration by reviewers when assessing your code.
3
votes
2answers
56 views
Determine if a function is bijective
Concise Problem Specification
Given an integer \$n\$ and a function \$f : X \to X \$ where \$X = \{1,2,3,..,n\}\$ Determine whether the given function is a bijective function or not.
Definition:
...
3
votes
1answer
50 views
TicTacToe Implementation With Classes
This is my first program using a class that I personally designed. Please pay special attention to the design of the class and I would love pointers and advice on how to better improve logical design ...
-2
votes
0answers
13 views
Using `flat_map` to unpack nested structs in Rust [on hold]
Does this code use flat_map idiomatically? I am uncertain about my use of clone on the inner strings.
...
2
votes
2answers
71 views
Pausing a loop with a Raspberry Pi 3
I am trying to perform a loop and then stop the loop when the last line of code in the if statement is printed to screen saving on CPU cycles.
I want to start a ...
0
votes
1answer
83 views
Tasks organizer app
I've created my first complete JS app, which lets you add tasks and control how much time you spend on them. I posted this to get some ideas how to improve readability, efficiency and the speed of my ...
2
votes
0answers
41 views
Display a simulation using Tkinter
I wrote a module to simulate physics of 2D elastic balls and the community helped me to improve it on this post.
Now I implemented a GUI using Tkinter to display the simulation in a window.
I'm a ...
1
vote
1answer
42 views
Weightlifting calculator
I'm building a simple iOS app using Swift that calculates the One Rep Max weight a user can theoretically lift. User inputs a weight lifted, the number of repetitions and the app uses one of several ...
4
votes
2answers
45 views
Processing trip route table in C
In fact, this is a group assignment for our C programming lesson, but seeking help from others is not considered cheating.
The goal of the following code is to:
Sort the data in ...
4
votes
1answer
35 views
Binary-octal-hexadecimal conversion table
I solved this exercise of displaying a table of numbers from 1 to 256 in binary, octal and hexadecimal. I made this program to convert from decimal to binary and took that binary number to convert to ...
4
votes
3answers
555 views
Project Euler 10: find the sum of all the primes below two million
This is question #10 from Project Euler:
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million.
I just started programming and read that a Sieve ...
4
votes
1answer
98 views
Clearing filters, copying a range, and then pasting a formula down a row
Novice coder here. I have the following code to perform a few actions like clearing filters, copying a range, and then pasting a formula down a row till the last line.
It works perfectly, but it ...
4
votes
1answer
105 views
Printing fizzy lines
Challenge
Given a test case print out a FizzBuzz Series.
Specifications
The first argument is a path to a file.
Each line includes a test case.
Each test case is comprised of three spaced ...
2
votes
1answer
30 views
Table View Controller for selecting and saving user default preferences in an iOS app
This is the Swift code from one of the view controllers in my app that calculates a one rep maximum weight a person can theoretically lift. This particular view controller presents a list in a ...
12
votes
5answers
714 views
Validating integer or string input
I'm at uni and working on an assignment in c# that takes some user input (from they keyboard via console).
The input validation required:
numbers must be within range (range will vary depending on ...
10
votes
3answers
83 views
Userform for getting data from data sheet into a table
I am making a userform that grabs data from a data sheet and puts it into a table:
Grabs the data based on what the user wants (Brand -> Items for brand)
Allows multiple items to be added
Displays ...
4
votes
0answers
50 views
Youtube playlist saver with Google API
I have a problem with Youtube videos being deleted from my big playlist and not knowing which videos got removed. So, I decided to write a Python script to save certain information(title etc.) about ...
3
votes
2answers
65 views
C++ object pool
I am a beginner and would like to build a pool. I made some research and found out that if my software has heavy object create and delete part, I should use a pool because of performance. I made some ...
-1
votes
0answers
36 views
Calculating my shocking monthly electricity costs [on hold]
I've been learning Java for a few months now and have finally tried my first project from scratch. I succeeded partially in some of it, but I'm really confused by some other parts of it. I was hoping ...
4
votes
3answers
60 views
Nucleotide count in Scala
This is my second day in learning Scala and I still need to develop a taste of functional programming, I often find myself doing imperative coding. Below is the result of my TDD practice.
Code
...
1
vote
1answer
24 views
PHP Script to write values from JSON on image and display image
This is a script I made that opens img.png, downloads the json data from the API, writes it on image and displays it. It currently is a community ad over Arqade.
...
7
votes
3answers
210 views
Summarize raw data in new sheet, 2.0
Thanks to zak for some great advice on this previous question. This is a follow up question:
I have an Excel workbook with two sheets: "Raw data" and "Summary". In the raw data sheet there are ...
2
votes
1answer
37 views
Summarize raw data in new sheet
Note: This question has a follow up question here.
I have an Excel workbook with two sheets: "Raw data" and "Summary". In the raw data sheet there are several blocks with data structured like the ...
5
votes
2answers
103 views
Creating a simple 52-card data structure for Blackjack in Python
I am fairly new to Python so I am trying to learn more about its conventions and ways to make my codes more efficient.
I am making a Blackjack game and so far have this class that draws, organizes, ...
9
votes
4answers
1k views
Create a list of random numbers with sum = n
I want to create a list of random integers in the range [0, 9], that sums up to 100 in Excel, using VBA. The list should be printed in a single column.
The routine I've written is as follows:
...
3
votes
0answers
66 views
Showing the slide named in the query string and hiding the others
I have this all figured out now thanks to the help of a mod. Here's the working code:
...
3
votes
1answer
90 views
Finding the prime factors of a positive number
I have an assignment to write on the standard output the prime factors of a positive number displayed in ascending order and separated by '*'. My code works, but I need help reviewing it before I ...
1
vote
1answer
14 views
Render SVG background with Gradient
I'm new to and still fairly confounded by SVGs.
So feeling pretty happy with the following hobbled together SCSS code demonstrated here.
...
3
votes
1answer
50 views
Converting embedded JSON into flat table
I am new Python user, who decided to use Python to create simple application that allows for converting json files into flat table and saving the output in cvs format. I was wondering if you could ...
3
votes
1answer
40 views
Project Euler 23 - Non-Abundant Sums
I'm new to Python! Kindly suggest me improvements!
Problem statement :
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum ...
6
votes
2answers
744 views
C the large print
This is the Longest lines challenge from CodeEval:
Challenge
Write a program which reads a file and outputs a specified number of lines, sorted on length in descending order.
...
5
votes
1answer
101 views
Simple restaurant menu
As stated in the title, the code produces a simple drop-down menu that allows you to select your Starter, Main and ...
4
votes
2answers
96 views
I can has(kell) moar cheezburgers?
KITTEH HAS IMPROOVD CODE SKILLS, AN NAO HAS BETTR CODE 4 U
This is an improvement of my original Haskell Lolcats Translator, and now features a function to do the translation (recursively?) using a ...
8
votes
1answer
115 views
Snakes and Letters
This is the "Clean up the words" challenge from CodeEval:
Challenge
Given a list of words mixed with extra symbols. Write a program that will clean up the words from extra numbers and ...
4
votes
2answers
67 views
Simple C# application that transfers new files (modified in the last 24 hours) from one directory to another
I'm new to C#, so I'm eager for any and all criticism/advice.
...
5
votes
1answer
135 views
Simulate Turing machine
I have written this code to simulate a Turing machine and wonder what could be improved. In particular, the --tape.end() seems a bit dodgy.
...
7
votes
4answers
897 views
No more filthy words
Challenge
Given a list of words mixed with extra symbols. Write a program that will clean up the words from extra numbers and symbols.
Specifications
The first argument is a path to a file.
...
4
votes
1answer
47 views
Simple Java RSS reader
As a study project I was supposed to write an RSS reader in Java (I used Swing to make GUI) using MVC pattern.
I finished it, but it's not quite polished yet (still gotta write these javadocs and add ...
4
votes
2answers
54 views
Encryption using a mirror field
This is my attempt at the mirror encryption challenge posted on r/dailyprogrammer/. The idea is that each character is to be replaced by its counterpart in the mirror field, as if a laser pointer ...
1
vote
1answer
34 views
Making a quiz in python and I need help making the code more concise when I add longer lists of questions
I'm a complete beginner at python and I know I'm probably approaching this the wrong way but I've tried making a quiz and can't work out how to make it more concise and work with longer lists of ...
10
votes
2answers
1k views
6
votes
3answers
201 views
Converting decimal integer to binary string
I'm wondering how I can make this function better, more compact, even faster.
...
4
votes
3answers
102 views
HackerRank “Bot Saves Princess” beginner code
I submitted the following Python 3 code for this HackerRank challenge. Given an n × n grid with an m in the center and a p in ...
8
votes
1answer
57 views
Wireless Rickroll using Arduino
This is a script I made for the ESP8266 that uses the Wi-Fi chip and creates a new Access Point every 5 seconds in order to display a message on WiFi lists on nearby devices that looks like this:
...
3
votes
0answers
43 views
Recursive Web Crawler in Go
This is probably my third Go application. It essentially takes one or two command line arguments of wikipedia articles and pulls every /wiki/ link that isn't a special page, memoizes them to avoid ...
-1
votes
1answer
51 views
Classes (and maybe subclasses) for characters in a Python game
I am practicing classes and subclasses in Python. I'm not sure whether it might be useful to add a subclass to the following code, instead of just adding methods to the class.
...
3
votes
1answer
69 views
Tic-Tac-Toe Implementation in C++
First full program in C++. I'm having trouble understanding when I should use classes and when I should not. Ultimately, after this review, I would love to have a better idea of what circumstances I ...
3
votes
0answers
67 views
CUDA program that emulates a kind of cellular automata slower on the GPU than on the CPU
I'm a very new to CUDA, so I'm still trying to understand how to make the best use of the GPU. I've ported a C algorithm to it. This algorithm works by loading the memory with an initial input, then ...