This looks like bot behavior to me. 1: https://codereview.stackexchange.com/questions/183468/leetcode-10-regular-expression-matching#comment349278_183468 2: https://codereview.stackexchange.com/questions/183204/multi-field-sorting/183380#comment348724_183204 Suspicious :|
I wonder if SE platform has some kind of bot detecting mechanisms.
I have always been known to write really sloppy code. Can someone help me rewrite the the following code in a more neat manner.
import os
import hashlib
import sys
import time
file_list = []
rootdir = "C:/"
print("Program starting!")
print("[+]Collecting virus definitions and allocating memor...
guys. I'm having some issue in recursion where there's a part that's confusing the heck out of me.
this is the code:
int re(int i) { int j; j = i while(j <= 3) { re(i+1); j++;} }
Now from what I understand so far is the variable j within the function , which takes the value of the argument i o...
I am building the encryption program for a messanger app I am developing. I was wondering if the code looks clean and succint, and at the same times is safe and secure.
import random
import os
import time
key = os.urandom(64)
def encrypt(_key, message):
letter_map_message = []
ascii_ms...
I'm new to Go, so I implemented a few sorting algorithms for practice. For example, I have an in-place insertion sort, and a bubble sort:
func bubbleSort(arr []int) {
for i := 1; i < len(arr); i++ {
if arr[i] < arr[i - 1] {
tmp := arr[i - 1]
arr[i - 1] = arr[i]
...
I'm new to Haskell, the part of my code I'm concerned with is the isSumAbundant function. Surely there must be a better way, in an imperative language I might use a for loop and break out of the loop if i got greater than n, but it seems like having to filter the list for every single function ca...
After having the scales, thermometer and a coffeemaker connected to the internet, it is finally time for Christmas Tree to become smarter.
Hardware
An addressable WS2811 LED strip
Raspberry Pi Zero W
Voltage level shifter (3.3V to 5V)
Power Supply
Software
used rpi_ws281x Python samples ...
Using JSX syntax I wrote a function that takes either a float or an integer as a parameter and returns a formatted string. I'd like any feedback for refactoring the code.
const moneyFormat = (float) => {
let answer = [];
let firstHalf;
let secondHalf;
// check if whole number
if (floa...
Which stack exchange site is the best place to ask a question if I want help understanding the big picture of an algorithm in a C++ programming project?
Is https://codereview.stackexchange.com the best place to ask?
I'm picturing a milk carton printed with "Have you seen this hobbit?", a blank space where the photo should be, and below that, "Description: 3'8", 80 lbs; Hair: Invisible. Eye Color: Invisible. Skin Color: Invisible. Last unseen wearing: Magic Ring that makes him invisible. If you have seen this hobbit, please call 1-800-THE-RING. Reward of global annihilation by the Dark Lord for information regarding the whereabouts of this hobbit." — Wad CheberMay 22 '15 at 16:15
A syntax error? The compiler will find that. Just press the Compile button. Other than that, code review questions are off-topic here. Read the rules of codereview.stackexchange.com, it might be on-topic there (potentially only if the code compiles) — Thomas Weller33 secs ago
How can efficiently check duplicate(only 2) in array and if duplicate found then replace the duplicate element with index(0 to n-1) value of the array.Please help.
@DmitriiZ. Even by downscaling or small resolution video input it's still too slow, also bigger output helps me better to use it after. Thank you for your help, I'll try codereview.stackexchange.com — Anes Madani36 secs ago
On Pokemon Fusion, I found it annoying that the webpage didn't automatically update the tab URL to the permalink when the fusion is changed, so I decided to write a UserScript to do that.
After finishing that, I thought it would also be convenient to update the fusion whenever navigating through...
I am writing an WinForms app to make automatic measurements. For it I have a DB with 2 tables (there are more tables there but aren't important for the problem) called Transmitter , which are the devices to be measured and Calibration, which are the measurements.
A Transmitter can have zero-One...
I want to solve this problem in functional programming (fp) way only. This is my fp approach:
Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will
be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
By co...
If your code produces the correct output but it appears to be too slow, you should post your question on Code Review, not StackOverflow. I'd start with replacing the ArrayList<Long> with long[] and maybe Scanner with a faster input method — Fureeish56 secs ago
I am building a budget app with the main focus on an easy accessible API.
I want to have a Budget per user the following information:
userID
month
sub-category
categories
budgetedAmount (per sub-category)
amountSpend (per sub-category)
Use case would be a REST call for
finapi.com/users/4/bu...
I am struggling to resize my canvas due to my code not working once sized, how would I solve this? Also how I add local storage to save the drawing in the browser?
var canvas, ctx,
brush = {
x: 0,
y: 0,
color: '#000000',
size: 10,
down: false,...
I have written a method to compute Fibonacci numbers, but am struggling to find a way to only use one line in the function. I can do it with the slow formula (return 1 if n <= 1 else fib(n - 1) + fib(n - 2))but takes about 30 seconds to get to Fib(40). This faster method I can do up to fib(50000)...
@Antoniossss yes I know stream.foreach does the same thing, for a straightforward situation it works very easily and I know it would also work and should work, but transforming this code looks a little bit difficult for me. I know it is a working code, but the code reviewer is asking to change the code. Regarding the exception those would be handled, those are also in pipeline. — hossaindoula41 secs ago
I'm attempting to make a parser using nom in Rust. Nom implements parser combinators, so more complex parsers are built from simpler parsers. Because of this, I've started with a simple ID token parser, but before I keep going, I'd like to know if there are any obvious (to anyone besides me) desi...
I have a condition check logic, which seems to be taking more than 1/10 of CPU time (millions and millions are such checks are performed). I don't think I can improve any other aspects of my solution, but at least this one may be something to be improved still.
Basically I have a loop inside a l...
@StuartMarks your points are absolutely valid, and this is one of the tasks from the code review which is going to be taken care of. And also exception would be taken care. — hossaindoula14 secs ago
Here is a very basic object orientated implementation of a read evaluate print loop AKA REPL. I encluded REShell to demonstrate how one could use Reple
#-*-coding:utf8;-*-
#qpy:3
#qpy:console
import re
import sre_constants
PS1 = '>> '
DEFAULT_EVALUATOR = print
class Reple(object):
def __...
Problem Statement
A network consisting of M cities and M − 1 roads connecting them is given. Cities are labeled with distinct integers within the range [0..(M − 1)]. Roads connect cities in such a way that each pair of distinct cities is connected either by a direct road or along a path consisti...
I don't remember the exact wording of the question, but it is clearly an activity selection problem, which is
[...] notable in that using a greedy algorithm to find a solution will always result in an optimal solution.
I put a rough description of the problem in the docstring, and present i...
This is the first draft of dqueue, a dynamic queue library written in C, with a sample program to demonstrate it.
This is my first time writing any sort of library to be used as a generic subsection of other projects, so I'm sort of guessing as to what additional considerations I should have tak...
I made simple input class that gets input form keyboard and mouse(code might be copied). I just want to get feedback about code(Like: what should be improved and etc).
Code:
package com.memequickie.engine;
import java.awt.Canvas;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListene...
Given a sorted dictionary (array of words) of an alien language, find
order of characters in the language.
Link:
The idea is to create a graph of characters and then find topological sorting of the created graph. Following are the detailed steps.
1) Create a graph g with number of vertice...
Since you do not really have a problem you encounter, but are asking for a way to do your code better, i hereby want to point you to the code review community, where questions like yours are in good hands. — Philipp Maurer14 secs ago
Actually I didn't know there is a codereview place and saw numerous similar but not downvoted questions here at Stackoverflow... — stckvrw22 secs ago
Actually I didn't know there is a codereview place and saw numerous similar even more general but not downvoted questions here at Stackoverflow... — stckvrw7 secs ago
This is codes that Hernan Caceres use to solve his LP problem in Java with CPLEX API. Can anyone help me to check the codes in"// constrain" declaration, I don't know why in the first constrain, he don't sum x[j] instead of x[i]? This seems to be different from the original problem. Next constrai...