« first day (2387 days earlier)      last day (28 days later) » 

12:00 AM
RELOAD! There are 6247 unanswered questions (90.0874% answered)
Ask this at Code ReviewJens 34 secs ago
Q: Strictly typed JSON representation

Dmitry NoginI would like to be specific in parameter types or write something like this: Test test = (Json<Test>)"{\"age\": 46}"; Where: public class Test { public int Age { get; set; } } My helper is: public struct Json<T> { public static implicit operator string(Json<T> json) => json.JObje...

12:45 AM
Q: Is there a way to do this without 64 if-statements?

Blake BaileyI was told to create a 2D array from a txt file that had the "carModel, carColor" followed by a new line. The 2D array is 8x8 and for each time a certain carmore and carcolor appear, their respective [x][y] coordinate that represents their count goes up by 1. So far, I have read the file, creat...

1 hour later…
1:49 AM
Maybe I've missed something, but all of the Stack Exchange accounts I've been active on seem to have randomly jumped in reputation by 50-600 points...?
Ah, nevermind. Just found the newest blog post.
2:05 AM
Q: ES6 Class for getting GitHub PR info

Mauricio RobayoI was learning some DOM manipulation and interaction with third-party APIs by building a simple interface to get the people who commented on a PR on GitHub. I got great feedback for my initial prototype: Interface for getting Github PRs commenters using Github API. Now I am trying to get into O...

2:25 AM
Q: Printing a string in NASM Win16 Assembly

T145A small script that simply prints a given string. It's an improved snippet that combines some recommendations given in my post on string helper functions. org 100h mov si, hello call puts ret puts: jmp .run .putc: mov ah, 0Eh mov bx, 7 int 10h .run: l...

@Mast I know many a better place than the network in general. But it seems that CodeReview seems to be relatively immune to this stuff.
Grammarly no that is not a hug message
1 hour later…
3:35 AM
Hi, @EthanBierlein. Long time no see.
Everything good still?
3:54 AM
I'm voting to close this question as off-topic because it is about optimizing working code. It is more suited for Code Review, which was created specifically for that purpose. — Ken White 27 secs ago
Hey @Hosch250, long time no see as well! Things have been going pretty well on my end; I'm in college now (Luther College in Decorah, IA) and studying linguistics, Latin and CS.
Definitely been a while; my interests shifted to Latin and classics for around two years ago, and my interest in software development dropped off quite a bit for a while (and as a consequence, I suppose, I dropped off the Stack Exchange "map").
Been getting back into CS and software development as of late, though, and I've definitely missed it.
Q: Simplifying code for deleting directories

user63710Background info: An FSObject is a dir or a file. A directory (dir) is a (make-dir Str Sym (listof FSObject)) A file is a (make-file Str Nat Sym) The function I want to write is supposed to only delete a directory if its contents are empty and NOT any other directories that have empty cont...

4:46 AM
Q: Make more efficient this algorithm

gañañuflai make a code with Python3, list1 and list2 are lists with numbers, my problem is the time-process is actually 0.193812 seconds, everyone know a way to make more efficent this code, i try with threadPool, maybe change the order on the if-condition or add another condition, or use a dictionary li...

Q: excel vba discrete random variable udf

dactyrafficleI am working on writing a discrete random variable generator function in excel vba. I've pulled this off a number of ways but here is the one I like the most. Imagine in excel we have the following in cells A1:B3 red 5 blue 7 yellow 3 The following code is modeled as follows. Imagine ...

5:06 AM
Q: Calculator using Shunting Yard Algorithm - Java

ganesh rI have implemented a simple calculator using Shunting yard algorithm, requesting code review comments. It takes infix expression as an input "3 + 5 * 2". Evaluates and return value 13. public class ShuntingYardAlgorithm{ private static Map<String, Operator> operatorMap = initializeOperatorMap(...

5:46 AM
Q: Linked list implementation in python 3

Brijesh KalkaniI have implemented a linked list. But there is a problem inside it. My size is 0 after removing One element. Please provide some solution. This code was tested in Python 3.7.4. class Node(object): def __init__(self, data): self.data = data self.nextNode = None class LinkedL...

6:06 AM
Q: Prim's Algorithm - Minimum Spanning Tree

coderI have implemented Prim's Algorithm from Introduction to Algorithms. I have observed that the code is similar to Dijkstra's Algorithm, so I have used my Dijkstra's Algorithm implementation. Please review this code and suggest improvements. To compile on Linux: g++ -std=c++14 prims.cpp #include <...

6:46 AM
Q: How to apply DRY to redux network request actions

MisamotoI'm writing a MERN stack application (for a personal/portfolio project). I'm still a bit new to webdev. I'm using Redux and redux-thunk. For my requests to backend, I find myself writing quite a lot of code that basically does the following (as I understand the idea is close to best practices)...

7:06 AM
Q: Leetcode container with most water

iRohitBhatiaI was doing container with most water question in Leetcode for which I wrote this algorithm Question link: https://leetcode.com/problems/container-with-most-water Question: Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical li...

I created a simple method to add this suffix. Please see my answer below. I do not see this question in code review. — Jeff 38 secs ago
7:46 AM
Q: This divides the class of game objects into material and immaterial

MironThe fact is that a material object must have a field that does not make sense to an immaterial object Here is a class whose objects I want to divide into material and immaterial: public class GameObject { protected boolean isHidden; protected Coordinate position; protected int pictu...

Q: How would I simplify the code for the function owned-by?

user63710Background info: An FSObject is a dir or a file. The structure definition for a directory (dir) is the following (define-struct dir (name owner contents)). A directory (dir) is a (make-dir Str Sym (listof FSObject)). The structure definition for a file is the following: (define-struct fi...

8:43 AM
9:01 AM
Welcome back @EthanBierlein
We also have a meta post about the reputation jump.
9:45 AM
Q: Stack data structure in python 3

Logwin TechI have implemented a Stack. It works well. But if you think something needs to be improved, say it. you would love to review my code . class Stack: def __init__(self): self.stack = [] def isEmpty(self): return self.stack == [] def push(self, dat...

2 hours later…
11:47 AM
Q: How to write the code with classes

cdacsysargv[1] = word.txt below <aardwolf> <Aargau> <Aaronic> <AAU> <akac> <abaca> <abactinal> import sys # the sys module import os def hasattr(str,list): expr = re.compile(str) # yield the elements return [elem for elem in list if expr.match(elem)] isword = {} FH = open(sys.argv...

12:08 PM
Q: WPF: Style that Animates Button Opacity

CleveI have a Style for a Button which: 1) Animates the Opacity when the IsMouseOver property is False. 2) When IsMouseOver = True the Opacity to be restored to 100% and the animation to stop. The Style works, but I am left wondering if there is a better way to achieve (2)? At the moment I am usin...

12:59 PM
1:14 PM
No - it is not correct IMO. But it is off-topic since it is not directly related to coding. If you want someone to review, i suggest you post to code review or dba. But reviewing an ERD requires a clear understanding of the system you are modelling. — SMor 48 secs ago
@SMor on Code Review this would be off-topic. No code, no glory. — Heslacher 12 secs ago
1:29 PM
Q: How to use JQury drag and drop

AdamI'm using jQuery UI draggable component to add to content editable .This code works fine. I got this code from the internet. Now I need to take an idea about how this functions works here. can anyone please explain what this fucions does? I'm new to jquery and need to learn. So please help me to...

1:50 PM
Q: Elevator design implementation in C++

coderI have written c++ code which performs an elevator's function like carrying people from one floor to another. It is a fun project and I have written to test my C++ skills. Please review this code and suggest improvements. Also suggest some other features I should add. #include <iostream> #include <

Yes. The second will get you fired at the code review. The others will get you escorted out of the building today. — Martin James 28 secs ago
2 hours later…
3:52 PM
Q: Java Fx game with Animation Timer

Zidane101I have this game thats going to be like a "Space Impact" kind of game. In which I have a ship (that's able to move) and shoot bullets. I also have to create the specifics of the game through Animation Timer. However while I am able to move the ship, I am having a hard time in creating the bullets...

4:06 PM
1 hour later…
5:13 PM
Q: Generating Infinite Procedural Terrain Using Command-Line Graphics

Ethan BierleinContinuing my trend of (ab)using the Windows command-line interface to do fancy graphical things with my command-line-graphics library, CLIGL, I've implemented an infinite procedural terrain generator, capable of generating coherent fractal noise to an appreciable distance. The basic structure o...

@CaptainObvious Someday I am going to implement a proper OpenGL rendering engine which mimics a console interface, as opposed to abusing the poor Windows console interface to render things.
6:01 PM
If you're building from source, I'd guess CMakeLists.txt, but I'm not familiar with teh code base. If you're installing from something like MacPorts or Homebrew, it may need to go into a patch file, or perhaps as a submission to the Wireshark codereview process. code.wireshark.org/review/#/q/status:open. — tresf 14 secs ago
This question would probably fit better at Code ReviewLarsTech 47 secs ago
Q: File(s) encrypter implementation in python

KrishiI'm looking for any feedback in order to improve code styling, performance etc. Also I want to make sure that the way I've implemented AES here is actually secure import os import hashlib import sys import base64 from cryptography.fernet import Fernet class Cryptor: def __init__(self, pass...

Q: Longest Palindromic Substr

Gregg LeventhalI am looking for review on the algo, and want to know the runtime complexity. Variable naming is garbage, I know. from collections import defaultdict def lps(s): pals = [] pairs = defaultdict(list) for i in range(len(s)): pairs[s[i]].append(i) for pair in pairs: ...

6:55 PM
Q: Custom String Formatter

LinnyI've written my custom implementation of an f"" / .format(...). I started the project thinking it was going to be longer than three lines. from typing import List, Union, AnyStr def format_string(string: str, variables: List[Union[str, int, float, bool, complex]]) -> str: """ Formats th...

Q: Python timing optmz

Lolloxox31I'm new in this comunity and with Python 3! I'm trying to optimize this exercise: We have n strings stored in a txt file. Inside the strings a secret word is hidden as a substring of consecutive characters. We know with certainty that the word repeats itself exactly once in each string but we do...

7:16 PM
Q: Bubble Sort Implementation in Python 3

Brijesh KalkaniI have implemented a Bubble Sort. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. def bubble_sort(nums): for i in range(len(nums)-1): for j in range(0,len(nums)-1-i,1): if nums[j] > nums[j+1]: ...

Q: classes to represent a HTTP request and response in C++

arcomberI am writing an HTTP message coder/decoder. In my decoder I parse http messages into a http_request or http_response. In my encoder I encode one of these classes. Representing the messages is the easy part, but I am sure I have made some mistakes. Please review and let me know what could be i...

8:05 PM
possible answer invalidation by Miron on question by Miron: codereview.stackexchange.com/posts/232490/revisions
8:58 PM
Q: Simple PHP Form Application

Brendon ShawI have just started messing around with PHP/SQL and came up with a simple sign-in application that checks if your sign-in information is valid based on database information. Here is my code: <!DOCTYPE HTML> <html> <head> <title>Sample Database Page</title> <style> body { font-family:...

Q: Retweeting popular tweets

TwitAppI am a developer, working on my first real project. Here is my code, and see if there is any issues. This is not finished code yet. I had an issue with it, if you think you can solve, here you go. import tweepy import time import json auth = tweepy.OAuthHandler(auth keys) auth.set_access_token(a...

9:39 PM
Q: Rpg Parser routine

Just EarlI wanted a routine that would allow me to use the NumPad keys for directional commands. 1-9 for each compass point - for up and + for down. If one of these keys are not pressed, it would act as a regular readline(). I threw in a few simple lines to act as timers, obviously this was just to comple...

This question might be better suited for Code Reviewstovfl just now
10:20 PM
Q: What can I add on to my login system that I created with python? I am pretty new to python

Zer0This is a program that I created using Python. Please help me optimize the code Question: How can I improve this code? Code: Below import time import sys import socket from time import localtime, strftime # start up system def start(): print("Welcome, please choose what to do") cho...

10:40 PM
Q: Making a quick Mandelbrot Fractal viewer

Samuel ShifrinI'm making a Mandelbrot set viewer in JavaFX. It takes a while, like maybe 5 seconds to finish. Here's my code: package sample; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsCon...

1 hour later…
11:41 PM
Q: String Reverse C++

RedThe code currently functions as expected, there aren't any real errors Compiled using C++14, extremely simple code designed to reverse the order of characters in a string (or data in any array), without using any extra variables beyond the i in the for loop: #include <iostream> #include <string>...


« first day (2387 days earlier)      last day (28 days later) »