« first day (2773 days earlier)      last day (1248 days later) » 

12:00 AM
RELOAD! There are 7172 unanswered questions (89.6935% answered)
 
12:57 AM
Ok, maybe that wasn’t finally :) using the word ‘unacceptable’ in a code review without guidance suggests to me your employer has a culture problem. Hopefully other employers are available? — stuartd 24 secs ago
 
1:09 AM
-1
Q: simple self-replicating virus

fartgeekI made a virus that copies itself to any .py file it sees. It isn't very fancy, but it does the job. I was wondering if a) you guys could give any feedback or whatever and b) if you know of any resources to learn how to make viruses (not for anything bad of course... :D ). import os class Virus...

 
 
2 hours later…
3:02 AM
I believe this would be a better question for the Code Review SE, especially with a more precise definition of efficient (I'm guessing you mean that the code is way too verbose and repeats itself everywhere?). — TheHansinator just now
 
3:20 AM
The code looks like very normal boilerplate code to me, nothing "wrong" per se. Please don't ask diffuse questions like: "Please give me feedback on my code!". Stack Overflow is not for that; the site Code Review is for that. But be aware of this question not being extensive enough for CR as well; the code just doesn't really "do" anything, it doesn't solve a problem, so there is nothing to review. — akuzminykh 53 secs ago
 
 
2 hours later…
5:47 AM
1
Q: Avoiding race in a sub-millisecond TOD timer

vnpPart of the project I am working on is to maintain the time-of-day, at the sub-millisecond accuracy, while not overwhelming CPU. The controller has a pretty standard timer, with two registers, COUNTER and PRELOAD. On each system tick COUNTER is decremented; once it reaches 0, the timer posts an i...

0
Q: LONGEST COMMON SUBSEQUENCE

White TigerHere is my code to compute the length of the longest common subsequence of two integer arrays arr[] and brr[]: #include <bits/stdc++.h> using namespace std; //Dynamic programm solution int mem[10004][10004];//mem[i][j] stores length of the longest common subsequence, up to index i of arr and ind...

 
6:12 AM
0
Q: A calculator in JavaScript

ArianI made a calculator in JavaScript. Now, I want to rename my functions, variables, and input names. But I don't know how. Here is my codes: function Calc() { var num1 = +txt1.value; var num2 = +txt2.value; var ch = +optxt.value; var result; if (ch == 1) { result = n...

0
Q: superimpose images at Java

JavaGuest2000Here white is the transparent color, the goal is to overlay the images and for that I have to copy all colors except the transparency color (white) static final Color transparence = new Color(255, 255, 255); static final Color black = new Color(0, 0, 0); static final Color red = new Color(220, 0,...

 
Don't do that. Revert your edit and ask a new question; though I'm afraid in this case it will be somewhat likely to be closed as off-topic. (Our sister site Code Review might be more appropriate for that.) — tripleee 41 secs ago
 
 
2 hours later…
7:53 AM
-1
Q: Text based python game

The Drowning GuppyI'm developing a small game for my final project in a class and I am very new to scripting. I can do the individual pieces but I have trouble piecing it all together. For the game, you are supposed to enter the 8 rooms and collect 6 items but if you get to the room with the Vampire without having...

 
 
2 hours later…
10:16 AM
You should probably post this on codereview.stackexchange.com. Anyway, you're repeatedly creating files in a temporary place and then move them. Why? Just create them in the right place and get rid of those move commands. You can also remove the Set-Location commands. — Swonkie 17 secs ago
 
10:49 AM
0
Q: Statically allocated memory pool in C for embedded systems

MrBitI made a statically allocated memory pool for embedded systems. I think it needs a little work but it works fine so far. How it works: An array of size MEMORY_POOL_SIZE is first reserved in memory and that's actually the space and the whole program uses to get memory from. The number of allocatio...

 
11:18 AM
I am not sure what to recommend here, any suggestions?
I will work on improving the question. Should I delete it for the present? — ICT1901 21 mins ago
 
If your code is working as expected, your question might be a better fit for codereview.stackexchange.com . It is much too broad for SO. — Thierry Lathuille 47 secs ago
 
11:40 AM
0
Q: Exporting Shellbags, Jump Lists, and LNK files with PowerShell?

albatrossJohnsonI'm new to PowerShell (started yesterday) and was wondering if there is a way of exporting Shell bags, Jump lists, and LNK files from the Reg to a local computer's desktop using PowerShell? I have tried a few things and can export them as CSVs... but I'm not sure if that's going to have any foren...

 
12:05 PM
0
Q: Thread-safe LFU Cache Implementation in Java

yplooI am trying to implement a thread-safe LFU cache algorithm, please review my code and would really appreciate some criticism or suggestion. (on naming, design, data structures used, anything) Some assumptions: capacity will be larger than 0. If the cache is full and multiple keys have the same f...

 
12:17 PM
And if your implementation works correctly then you can always post it at Code Review - after reading their tutorial of course. — Maarten Bodewes 27 secs ago
 
12:30 PM
Monking
@MartinR that is a clear yes on the question.
 
12:53 PM
Yes, you should delete the question until the code is ready for review. After you have improved your question you can easily undelete it. — Heslacher 11 secs ago
 
0
Q: Is this correct solution for Josephus problem if we travel anti-clockwise? This code is working for n = 5, 6, 7, 14 etc

Ankit SinghMy possible solutions: Reverse the list/stack, traverse clockwise (probably not the solution the interviewer is looking for) Remove the nodes from the ending using this equation: k is the step size, so if k = 2, and size = 5, with nodes 1, 2, 3, 4, 5 index_to_remove = size - k*i + 1 i = 1 index...

0
Q: Heap insertion and deletion Implementation using Python

minglyuI have implemented basic max heap insertion and deletion functions without recursion # insertion arr: [6,5,4,3,2,1] # insert 7 arr: [7,5,6,3,2,1,4] tree: 7 5 6 3 2 1 4 # delete 7 arr: [6,5,4,3,2,1] tree: 6 5 4 3 2 1 My implementation ...

 
1:27 PM
M nk ng
 
2:00 PM
You don't need a triple nested loop, just check if i^2 + j^2 is itself a perfect square. Or as shown in Project Euler #9 - Pythagorean triplets, you can rearrange the math to not need an FP sqrtsd instruction. Also Project Euler, problem # 9, Pythagorean tripletPeter Cordes 54 secs ago
 
 
1 hour later…
3:06 PM
First of all there is a specific site for code reviews, codereview.stackexchange.com, and secondly no matter if you post here or on the linked site you should include your code in the question and not link to it. — Joakim Danielson 7 secs ago
 
3:29 PM
0
Q: A simple linked list for C practice

TradingDerivatives.euAfter a long break I have to return to programming in C. As an exercise I wrote this simple linked list thing. Please just have a look, any comments are appreciated. Just shoot. #include <stdlib.h> #include <stdio.h> typedef struct { int iNumber; } TData; typedef struct TLinkedList { struc...

0
Q: Python. Renpy. Expected statement

beLIEveWant to check that age of user is legal but i think import of timedate failed so? Any help? Error is in line with 'today' and 'age'. label date_of_birth: today = date.today().year $ dob.year = renpy.input("Date of birth. Year:", allow ="0123456789" ,length =4) $ dob.month = renpy.input("

0
Q: A population_variance Function For Various Type Arbitrary Nested Iterable Implementation in C++

JimmyHuThis is a follow-up question for A Summation Function For Various Type Arbitrary Nested Iterable Implementation in C++, An arithmetic_mean Function For Various Type Arbitrary Nested Iterable Implementation in C++, A non-nested test_vectors_generator Function for arithmetic_mean Function Testing i...

 
3:54 PM
0
Q: python - Reading sensor data from serial device & publishing on MQTT

wuff1337I have a weather station with a data logger which accepts commands (specified in user manual) and sends back the respective data over a serial interface. In my case, I want to read the current data from the different sensors of the weather station in a specified interval and then publish them on ...

 
 
1 hour later…
5:07 PM
First of all, style: code should be indented to the right of labels, see this codereview: Checking if a number is prime in NASM Win64 Assembly. Also style: don't hard-code magic numbers like 90, use 'Z'. Other than that, looks like your logic is correct (as long as you can assume that every character below 'A' is a decimal digit). — Peter Cordes 45 secs ago
 
0
Q: Resize video frame to fit tkinter window size when the window is resized

JovanI've written a piece of code to play a video using OpenCV on tkinter. Its part of a game I've made and compiled into an application. But I've noticed that when I play the game in a different computers, since the screen sizes are different, the video doesn't fit exactly to screen size like I want ...

 
5:23 PM
You don't need a triple nested loop, just check if i^2 + j^2 is itself a perfect square. (Or to work with smaller numbers, check if k^2 - j^2 is positive and a perfect square.) Checking for a perfect square could be done with cvtsi2sd / sqrtsd / cvtsd2si to square root (rounding the conversion result to the nearest integer), then imul and compare. (In a previous comment, I had some codereview links but they were to special versions that restricted to searching for a triple with sum = 1000, which means you can use that instead of sqrt). — Peter Cordes 19 secs ago
 
5:35 PM
0
Q: Skip List Implementation in Java

Bala I have to implement the following methods in code: 1.public void add(int value) adds a number to the list 2.public boolean contains(int value) determines whether a number exists in the list. 3.public int successor(int value) returns the next larger value (or the value Integer.MIN_VALUE if the val...

 
6:26 PM
0
Q: OpenCV video player not playing the video as expected

JovanThe video player works. But the problem is that the code is not fast or efficient enough(according to my assessment). Here is the code: from tkinter import * from tkinter.ttk import Button from PIL import Image, ImageTk import time import cv2 as cv2 from threading import Thread from Scripts.music...

0
Q: Convert array of arrays to array without duplicates

AngularDebutantI have the following array, and I want to convert it to an array without duplicates. const a = [ { items: [ { outerKey: { innerKey: 1 } }, { outerKey: { innerKey: 2 } }, { outerKey: { innerKey: 3 } }, ], }, { items: [ ...

0
Q: Bash script - compile and run c++ code for coding competitions

thesilicanThis is a simple bash script that I use to compile and run single C++ files for coding competitions. Features: Detects if there is a corresponding .in file next to it, and if so uses that as stdin e.g. if the file problem1.cpp and problem1.in are in the same directory, the script will redirect ...

 
Hey, check out codereviews.stackexhange.com. This would for well there. — Andrew Cheong 8 secs ago
 
7:16 PM
0
Q: Validating firebase insert

Yash KarankeI have been learning firebase with react js lately and I have stumbled upon a situation where I think my code is somewhat not okay. const handleFormSubmit = (e) => { e.preventDefault(); if(props.addOrEdit(values).path.pieces_[0] === "Contacts"){ setValues(initialFiel...

 
8:07 PM
0
Q: Permutations of the alphabet with backtracking

baktrix/* Generates permutations over an array of integers by backtracking. * * chain[] Status stack with box index per level * box[] Marks pieces available for next permutation * * The candidate_next() is a filter or wrapper to box_next(). It is needed * to prune the huge tree (26! = 10^2...

 
8:23 PM
You have a way which works - why do you believe it is not elegant or memory-efficient? If you have working code which you think could be improved generally (especially in subjective matters like elegance), codereview.stackexchange.com is the place to ask. If you have a specific performance problem with your code (based on benchmarking), you can ask here but you should post your code and details of how you have benchmarked it. — kaya3 1 min ago
 
8:57 PM
0
Q: Noughts & Crosses (Final Version)

George Austin BradleyI've made a major update to my Noughts & Crosses program, this ISN'T a duplicate! I know it's not good to use system("pause") and system("cls"), however, I just wanted to make the console screen more readable so resorted to these methods to achieve this. I would like feedback on how well I've use...

 
9:43 PM
Sounds like a code request to change from div to ul structure... Right? That may possibly be answered on Code ReviewLouys Patrice Bessette 8 secs ago
I’m voting to close this question because it should be posted on Code Review. — Louys Patrice Bessette just now
We're not security consultants or code reviewers sorry. You'd need to ask us something more specific, e.g. if you found some code in the source of that library and weren't sure what it did — ADyson 56 secs ago
 
10:13 PM
0
Q: C++ Battleship Matrix Creation

Roma MaloneyI am writing the code for a computer AI to place ships on my battleship board, but for some reason the code draws rectangles on top of each other even though the code specifies not to draw a ship in a location if there is a 1 in the matrix at that location. The matrix is 8x8 and each space corres...

 
10:38 PM
0
Q: Sorting Algorithm using Modified Merge sort

EL_H4CK0I've been messing around with merge sort. Instead of doing a recursive division of the array I chose to keep keep track of the middle index of every three numbers. Using the index of the middle number, it sorts the numbers directly around it and then merges the consecutive arrays. I'm having trou...

 
Please use codereview.stackexchange.com for code reviews. Stack Overflow is for specific technical questions. — xaxxon 36 secs ago
 
11:03 PM
-1
Q: stuck understanding how to throw an error

MinskyThe user types text in an input element. When pressing "Send" a function analyses the input.value It should insert a small text-box above the input when the string is not valid. As I built the code, the error returns a string, and instead the error message is being set as input value. I'm includi...

0
Q: Model View Controller in Python

Akash PatelI have attempted to do Model View Controller in Python for learning. First, I am not sure if dictionaries are faster than lists for about N = 30 (20 to 40) items. Second, how maintainable is this design since I got abstraction but not very much encapsulation. The abstraction comes from abstractin...

 

« first day (2773 days earlier)      last day (1248 days later) »