r/CritiqueMyCode • u/wgman • Oct 02 '14
r/CritiqueMyCode • u/andygmb • Sep 28 '14
[Python] A script to handle adding livestreams to a reddit sidebar.
r/CritiqueMyCode • u/DerKlub • Oct 01 '22
I am new to JavaScript. How am I doing?
if (userName === '')
{console.log('Hello!')}
else
{console.log(Hello, ${userName}!)}r/CritiqueMyCode • u/thehitechpanky • Apr 08 '20
Wrote a JS library for bootstrap tables with amazing functionality
Bootstrap tables using vanilla javascript with built-in search, serial no., event-firing, colspan, rowspan, counters and much more...
r/CritiqueMyCode • u/DoomTay • Mar 08 '20
PHP/MySQL site interfacing with a pre-made database
https://github.com/DoomTay/SQLExperiment
A few years ago I tried teaching myself PHP, and using MySQL to make things more dynamic. I used the "world database" to save the time of gathering data, though it's also kinda limiting.
One thing that concerns me is the way the database is called and the data is displayed.
Soon I'm going to dive into another project that involves PHP and MySQL and I want to be sure I'm not repeating any noob mistakes.
I once contemplated looking at WordPress's source code as an example, but it might be too complex for my needs.
r/CritiqueMyCode • u/Striker_San • Jan 11 '20
Beginner Quiz game (True or False)
This time I made a Quiz game in which the player is asked questions and receives points for each question answered correctly. Some people told me I should learn about classes, so this is what I came up with :). https://github.com/Tlomoloko/Quiz_T-F
r/CritiqueMyCode • u/BlavikenCZ • Jul 25 '19
[Java] Stationary pixels detecting and refreshing app
Hello, I would appreciate some feedback on my code:
https://github.com/JoeScripter/Plasma-Saver
Thanks.
r/CritiqueMyCode • u/Diestri • Jul 06 '19
simple calculatro in c++,I'm a beginner programmer, I want to share with you my first program in c++
r/CritiqueMyCode • u/Mindreactions • May 25 '19
Github. Credits Blockchain Source Code Release

The Credits blockchain platform meets the wishes of all crypto communities and presents the full source code of the most decentralized blockchain platforms in the world.
Credits publishes the entire source code that is aligned with the latest state of Credits software. All updates, optimizations and hotfixes will occur on GitHub. At present time the following list of components is available on GitHub:
Network
Storage
Consensus Protocol
API
Smart Contracts
Monitor
Web Wallet and etc.
Credits team trusts that this move will increase the transparency of development process, will attract new audience and will speed up the growth of Credits blockchain ecosystem.
Right now Credits programmers are refreshing the documentation that is required for developers of blockchain-based products and services to wrap up in technology and its features. A Bug Bounty Program will be launched shortly after that.
Credits company is focused to invite all developers to participate in the process of platform development. Any developer is able to track the whole history of Credits code updates on official GitHub. Go ahead! Be on the same wavelength with the most innovative technology!
r/CritiqueMyCode • u/_T_R_O_N_ • Feb 16 '18
[SQL] my data base design for a VOIP billing web app
This is a diagram of the data base design I have come up with for a web app that provides itemized billing for VOIP calls:
https://drive.google.com/file/d/1-26Dih-F3zOxe7ThbW4Bjdt2cJUj0oxZ/view?usp=sharing
The idea is that a company’s employees should be able to log in, and see the billing data for their company, as well as generate billing data for their clients. I am hoping to be able to cater for VOIP service providers, resellers, and end users. Most of the billing data will come from csv files that Service Providers, and Resellers will have to upload, but there also needs to be allowance for manual manipulation of call costs, and call types.
End users will only be able to view their own company's billing data.
Resellers will be able to view their own billing data, and create billing data to send to their clients, which are the end users. Resellers can only sell to end users.
Finally, VOIP service providers will be billing the Resellers, so they will also need to see their own billing information, and then generate billing information to give to the Resellers. Service providers can only sell to resellers.
Along with the generation of billing data, companies also need to be able to manage their clients, and their clients phone numbers to varying degrees depending on the company type.
What are your thoughts on the data base design? Do you think that it will work for the application that I described?
r/CritiqueMyCode • u/Bunchhieng • Aug 22 '16
Hey guys, I wrote a simple script in Go. I'd like to get feedback from the community. Feel free to put issues and PR. <3
r/CritiqueMyCode • u/Gingerale947 • Jun 17 '16
[Python] Trying to make a reddit bot that uses markov chains to make stupid phrases
DISCLAIMER:
This is literally the first program I have ever written in any programming language. I'm pretty proud of it despite its flaws.
The Code:
import praw
import pdb
import re
import os
import time
import markovify
from ConfigBot import *
r = praw.Reddit(user_agent = "A chatbot by /u/Gingerale947 that just wants to say stupid things :)")
r.login(REDDIT_USERNAME, REDDIT_PASS)
print("Logging in...")
already_read = []
match = ["SHITPOST"]
my_name = ["GAs_ShitPostBot"]
def run_bot():
print("Connecting to /r/Homestuck")
subreddit = r.get_subreddit("<My test subreddit>")
for submission in subreddit.get_hot(limit=5):
if submission.id not in already_read:
r.search('flair:"SHITPOST"', submission.link_flair_text)
if submission.link_flair_text in match:
print("Title: ", submission.title)
print("Text: ", submission.selftext)
print("Score: ", submission.score)
print("Author: ", submission.author)
print(submission.link_flair_css_class)
print("---------------------------------\n")
already_read.append(submission.id)
print("SHITPOSTING...")
submission.add_comment(text_model.make_short_sentence(500))
time.sleep(180)
def find_replies():
print("Checking replies")
subreddit = r.get_subreddit("<My test subreddit>")
comment = subreddit.get_comments(limit=25)
for comment in comments:
comment_text = comment.body.lower()
if comment.parent_id in my_name:
comment.reply(text_model.make_short_sentence(500))
time.sleep(5)
with open('C:/Users/Ginge/Desktop/GAs_ShitCommentBot/ShitPostComments.txt', encoding="utf-8") as f:
text = f.read()
text_model = markovify.Text(text, state_size=1)
while True:
run_bot()
find_replies()
time.sleep(20)("<My test subreddit>" isnt actually part of the code its just where I put the name of my test subreddit)
The run_bot() function works perfectly, it's set to find all the posts on a given subreddit that are labeled "SHITPOST" (/r/homestuck has a lot of these), and reply with a comment generated with markovify. The find_replies() function doesn't work at all, sadly, but it's intended function is to reply to any comment that replied to the bot's comment.
The sad thing is, I want this bot to say MORE things, and I'm at a loss as to how to do it. I know that putting "text_model.make_short_sentence(500)" in the "submission.add_comment()" field will make it generate a sentence, but I was hoping it would generate a whole paragraph rather than single sentences. Is this even possible with markovify?
Also, the subreddit that I want to use this bot on allows emotes (formatted like "[](/emote)"), but as far as I know, markovify only looks at alphanumeric characters in the source text, so generating the brackets and parentheses needed to type an emote just isn't possible. Has anyone figured out how to do something like this? Is markovify just a bad program to use for the task I want my bot to perform?
r/CritiqueMyCode • u/stuie382 • Oct 20 '15
[Java] Desktop application for logging Football (soccer) tournament results
Objective of the project was to create something using as little external tools as possible. Specifically, no ORM (too magic). Swing was used as I am more familiar with it, but may change to JavaFX at some point. Same deal with Log4j, as some point I'll get round to making it current :(
Cheers for looking
r/CritiqueMyCode • u/Sacki2015 • Sep 03 '15
Please inspect my code - It's Vigenere's Cipher done in C as part of CS50 online at Edx.
I spent two days on this, not so much the math, rather char's and int's and converting to get the thing to work. So I was thinking I am just never going to master any of this. But now it is finished and I was impressed I did it in 46 lines of code, could any experts advice if this is good or could be improved upon.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>
int main(int argc, char * keyword[])
{
int cipher[24], cipherLower[24], i, n;
bool passed = false;
char * message = malloc(256);
do {
if (argc != 2) {
printf("Error\n");
return 1;
}
else {
for (i = 0, n = strlen(keyword[1]); i < n; i++) {
if (isupper(keyword[1][i])) {
cipher[i] = keyword[1][i] - 65;
}
else {
cipherLower[i] = keyword[1][i] - 97;
}
}
passed = true;
}
} while(!passed);
printf("Enter your secret message\n");
fgets(message, 256, stdin);
for (i = 0, n = strlen(message); i < n - 1; i++) {
if (isupper(message[i])) {
char c = (((int)message[i] - 65 + cipher[i] ) % 26 ) + 65;
printf("%c", c);
}
else {
char c = (((int)message[i] - 97 + cipherLower[i] ) % 26 ) + 97;
printf("%c", c);
}
}
printf("\n" );
}Thanks Adam
r/CritiqueMyCode • u/ilikeyourblackcat • Jul 09 '15
[Python] A collaborative bot, the BlackCatBot [x-post /r/requestabot]
I reached out here a month ago to request a bot to be made for foolish purposes. A friend of mine considers herself "internet famous" via her black cat that is often on the front page of /r/blackcats
I checked it out and realized that although they're a cute little community no one really comments on their posts. I created this test account to make some simple "I Like Your Black Cat." comments on about 100 posts manually to see what the reaction would be.
The community seemed to have fun with it and many appreciated the simple compliment and thanked me.
I then decided it would be fun to have a bot that left fun and adorable comments to get the conversation started. I found that when there was at least one comment on the post that others would go to read it and then often leave more comments themselves.
I worked with /u/_inu on the code and he was super helpful.
So, i'm open to all suggestions/feedback on this code to help make her better.
runonce.py http://pastebin.com/h009CJZE
BlackCatBot.py http://pastebin.com/h9ySbqTK
r/CritiqueMyCode • u/[deleted] • Nov 21 '14
[C] A Toy OOP Calculator Using Vtables
r/CritiqueMyCode • u/cruyff8 • Oct 09 '14
[Python] How to Draw a Histogram in Python Using Matplotlib
r/CritiqueMyCode • u/exiva • Sep 28 '14
[Python] orangeredpusher Push reddit orangered's to mobile devices.
r/CritiqueMyCode • u/20unsavage • Dec 16 '22
Novice Programmer: Critique on an web-based app I'm creating.
As the title says: I'm making a small project with jQuery to create study "Que-Cards". I need a critique of my coding as is, I'm trying to improve my coding efficiency.
I do plan to add session storage to save the values in the case that the tab is refreshed and implement editing functionality.
Any advice would be helpful, if you do look thanks for your time!
r/CritiqueMyCode • u/Kshipra_Jadav • Dec 09 '22
Advent Of Code Day 8. Stuck like hell.
Hello fellow programmers. I have written the solving the day 8 part 1 problem.
it gives the correct answer for the example case given on the website but is completely wrong for the actual input. Already spent hours on this one. Can someone guide me or atleast point me in the right direction?
Here's the code :- https://gist.github.com/f6320229744ddc7f24a63c3397108ab2
Thanks in advance!
r/CritiqueMyCode • u/jtjumper • Sep 30 '22
Minesweeper Clone in Python!
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 24 02:41:21 2022
@author: jtjumper
"""
import random
import numpy
import tkinter as tk
import tkinter.font as tkFont
def boardmaker(dimension_x, dimension_y,mine_count):
mines = {(random.randint(0, dimension_x-1),
random.randint(0, dimension_y-1)) }
while len(mines)<mine_count:
mines.add((random.randint(0, dimension_x-1),
random.randint(0, dimension_y-1)))
return [[(1 if (x,y) in mines else 0) for x in range(dimension_x)]
for y in range(dimension_y)]
def minesweeper_numbers(board):
if board==[]:
return []
else:
return [[mine_spaces(x,y,board) for x in range(len(board[0]))]
for y in range(len(board))]
def mine_spaces(x,y,board):
return 9 if board[y][x]==1 else numpy.sum(
numpy.array(board)[max(0,y-1):min(len(board),
y+2),max(0,x-1):min(len(board[0]),x+2)])
class App:
dx , dy , mine_count = 10, 10, 10
space_count=dx*dy
free_spaces= space_count-mine_count
spaces_checked = 0
board = boardmaker(dx, dy, mine_count)
mboard = minesweeper_numbers(board)
GLabel_830=0
playing=True
for x in board:
print(x)
print(sum(sum(x for x in y) for y in board))
print ("Nums:")
for x in mboard:
print(["@" if y==9 else str(y) for y in x])
def __init__(self, root):
#setting title
root.title("Tippin Mine Search")
#setting window size
width=500
height=350
screenwidth = root.winfo_screenwidth()
screenheight = root.winfo_screenheight()
alignstr = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
root.geometry(alignstr)
root.resizable(width=False, height=False)
dimension_x, dimension_y =App.dx ,App.dy
GButton_array=[[self.make_button(self,30*x+20,30*y+20,y,x) for x in range(0,dimension_x)] for y in range(0,dimension_y)]
GLabel_830=tk.Label(root)
ft = tkFont.Font(family='Times',size=10)
GLabel_830["font"] = ft
GLabel_830["fg"] = "#333333"
GLabel_830["justify"] = "center"
GLabel_830["text"] = "Spaces checked: 0"
GLabel_830.place(x=360,y=70,width=120,height=25)
App.GLabel_830=GLabel_830
def GButton_774_command(self):
print("command")
def make_button(self,text,x,y,xidx,yidx):
GButton_Place=tk.Button(root)
GButton_Place["bg"] = "#f0f0f0"
ft = tkFont.Font(family='Times',size=10)
GButton_Place["font"] = ft
GButton_Place["fg"] = "#000000"
GButton_Place["justify"] = "center"
GButton_Place["text"] = "?"
GButton_Place.place(x=x,y=y,width=30,height=30)
GButton_Place["command"] = lambda : self.button_command(xidx,yidx,GButton_Place)
return GButton_Place
def button_command(self,x,y,button):
if button["text"]=="?" and App.playing:
val =App.mboard[x][y]
button["text"] = str("@" if val==9 else str(val))
App.spaces_checked+=1
if App.mboard[x][y]!=9:
App.GLabel_830["text"] = "Spaces checked: " + str(App.spaces_checked)
else:
App.playing = False
App.GLabel_830["text"] = "You Lose"
pass
if App.spaces_checked==App.free_spaces:
App.win(self)
def win(self):
App.playing = False
App.GLabel_830["text"] = "You Win!"
if __name__ == "__main__":
root = tk.Tk()
app = App(root)
root.mainloop()r/CritiqueMyCode • u/itsmaximelau • May 10 '21
[Java] Patternish - Random Pattern Generator
Hello !
I'm learning Java and I'm looking for any feedback concerning this app I made :
https://github.com/itsmaximelau/patternish
I'd especially like to have some feedback concerning the code structure/quality and about the look of the GUI. I also made a Youtube video about the app. You can find the link on GitHub.
Thank you !
r/CritiqueMyCode • u/Immediate-Ad-8226 • Mar 22 '21
[JavaScript] - Judge my code! Backend Interview Challenge Node.js Express MongoDB JavaScript
I'm applying to software engineer positions and was given a backend coding challenge. They reviewed it and said everything looked good but didn't give much feedback outside of that. I have a follow up interview this week and I'd love for anyone to critique my work so I could better prepare.
It was designed using node.js, express, and mongodb
Thanks in advance,
Challenge Question: https://github.com/Grandelisn/Interview/tree/master/challenges
Github Link: https://github.com/Grandelisn/Interview/tree/master/challenges/headstorm-backend