« first day (2242 days earlier)      last day (1783 days later) » 

12:00 AM
RELOAD! There are 6143 unanswered questions (89.8236% answered)
 
12:24 AM
0
Q: JavaScript `localStorage` with `document.cookie` fallback for static web sites

S0AndS0The Code I've got things operating as desired so far and am hoping fresh eyes can point out any mistakes or bits that can be improved, a live demo is hosted and updated on GitHub Pages, and the source code is just a fork or clone away.... BrowserStorage.js class BrowserStorage { /** * @th...

 
12:45 AM
0
Q: Modelling Family Relationships in a OO way

thebenmanI'm trying to model family relationships in a OO way, i.e. As we update the relationships between two individuals our model must be able to find the people given a person and the type of relationship • Given a ‘name’ and a ‘relationship’, you should output the people corresponding to the re...

 
1:05 AM
0
Q: Building a frequency dictionary from a pandas dataframe without looping

LukeI need to make a frequency dictionary from a pandas series (from the 'amino_acid' column in dataframe below) that also adds an adjacent row for each entry in the dictionary (from 'templates' column). templates amino_acid 0 118 CAWSVGQYSNQPQHF 1 635 CASSLRGNQPQHF 2 468...

 
1:25 AM
0
Q: Python pong with parabolas code glitching

TimI'm making 2 player pong on python using the turtle module and I added parabolas when you hit the ball with the paddles moving, but in specific circumstances, when I curve the ball with the right paddle, and I don't move the left paddle, it goes right through it. I've tried everything. Here is my...

 
2:06 AM
0
Q: A Betting Game Using a Dice Class in C#

Thunderstrike51class Program { static void Main(string[] args) { Betting game1 = new Betting(); game1.rules(); Console.WriteLine(""); while (true) { game1.game(); string answer = ""; Console.WriteLine(""); while (tru...

0
Q: "A.I." controlling left paddle makes it teleport along the y axis. (Python)

TimIs there any way to make the paddle on the left not jump? My "A.I." on the left makes the y coordinate of the left paddle change at every horizontal impact, so it makes the paddle jump. Is there any way to make the paddle move towards the point, and not jump to it? Here it is: import turtle imp...

 
2:57 AM
How is this a case of plagiarism - codereview.stackexchange.com/questions/221042/…?
 
3:14 AM
If you are looking for recommendations to improve working code, check out codereview.stackexchange.comC.Nivs 59 secs ago
 
3:47 AM
0
Q: Small socket based packet Library

Xtrem532I'm currently writing a python script which needs some simple networking. After some playing around with sockets, this emerged, but as this is my first foray into sockets I'd really like a second opinion. Package Format: datalength+1 \0 data \0 import socket sep: bytes = b'\0' minpackets...

-1
Q: how can i add student marks and table appearance using php

Alexisevery thing is added successfully in the result table but the appearance of the result table in the phpmyadmin is quite different to what i expected once i added the the marks, student_code, subject_code and subject_name I have six subject, what i expected is every student should have all his/her...

 
 
1 hour later…
4:47 AM
Monking
 
 
2 hours later…
6:26 AM
@Justin are you sure you want to do this here?
 
6:52 AM
0
Q: How to make a cleaner model log in Laravel?

Fortunaglobal DevelopmentThe application I'm currently working on have two main user types, let's say user and reviewer. I need to create a functionality to track changes made by both user and reviewer (for post) and show them in the frontend. I have given specific messages to show in the frontend for each change. ex:- ...

0
Q: Unable to loop through the worksheets in an Excel workbook

PaulI am trying to learn Python and trying to generate a .sql file from a mapping given to me in an excel file. But I am able to go through the rows and columns of the first sheet but unable to move forward to the next sheets. I am using Python 3.7. Each sheet would contain two columns This is what ...

 
7:27 AM
Monking
 
7:53 AM
0
Q: Avoid using C Strings on C++ code

VansFannelI'm learning C++ and someone has told me that this is a bad coding style: #include <fstream> #include <ios> #include <iostream> #include <string> std::string trimLeft(const std::string& input) { if ((input.empty()) || ((input.at(0) != ' ') && (input.at(0) != '\t'))) return...

 
8:12 AM
I'm voting to close this question as off-topic because this question belongs to Code Review Stack ExchangeAlive to Die 29 secs ago
 
0
Q: Client side Jquery library For validation

satsvelkeI have created a library for client-side validation using jquery, need to review the same what can be changed It's on GitHub: see here, just need some bits of advice, thanks e.g sample code - /// add verify.js and css <div class="form-group"> <label> Number</label> ...

0
Q: React Tabbed Template

chrisI made this simple tabbed app template and one thing in particular I am not sure about is my creation of a pageMap object. The thinking behind it is that you can add a new page to the app by adding an entry in the pageMap as well as the list being mapped to produce the tabs. The components are f...

 
8:33 AM
please use this page for code review: codereview.stackexchange.comluschn 6 secs ago
I'm voting to close this question as off-topic because it´s about code review and should be posted here: codereview.stackexchange.comluschn 43 secs ago
 
8:54 AM
0
Q: How can I make this SQL log file parse become faster

elisaI have a read log file function to get select operation from database log file like this: def getSelectMySql(log): with open(log,'r', encoding='utf-8', errors='ignore') as data: lines = [] for baris in data: bariss = baris.rstrip() newBaris ...

 
9:14 AM
0
Q: Is there a way to make this vba code faster

RagingDeathWishwhat i'm trying to do here is to open an excel file and then search and copy/store the data i need (i.e if there is a reference than i copy 2 columns).Afterwards, i paste or write that data into a word table (already exists in my template). Thus, here is my question: Is there a way to make run fa...

 
9:35 AM
0
Q: Is there any better approach on this rows to columns table?

don pentavia I pass a function into the variable ($monthly_receivable) to get the value of each months to pass and get the result of a function.. but the process is dumb slow. This was the only January data but it can add a month range example January 2016 to December 2019. When I try to remove that variabl...

 
9:48 AM
 
10:15 AM
0
Q: Calculate Smallest Subarray with a given sum

thadeuszlayThe task is taken from educative.io Given an array of positive numbers and a positive number ‘S’, find the length of the smallest subarray whose sum is greater than or equal to ‘S’. Return 0, if no such subarray exists. Example 1: Input: [2, 1, 5, 2, 3, 2], S=7 Output: 2 // Explana...

 
i assume the code works? if so this question is offtopic here and should be asked on codereview.stackexchange.comRaymond Nijland 57 secs ago
 
10:44 AM
I'm voting to close this question as off-topic because this question belongs to codereview.stackexchange.comnilsK 34 secs ago
 
10:56 AM
0
Q: MySQL Stored Procedure How to Shorten the Statement

Jack_N_JelJust want to ask your help regarding creation of store procedure in MySQL database. This is my first time in creating the store procedure. Most likely, I used to creation views but this time, I need to implement a store procedure in the mysql database. I have here created a simple one but I thin...

 
11:14 AM
May be you should review question here codereview.stackexchange.comYo Yo 30 secs ago
 
11:38 AM
I'm voting to close this question because code review is off-topic on SO. Use Code Review SE. — Peter 55 secs ago
I'm voting to close this question as off-topic because it belongs to CodeReview — Ilya 43 secs ago
Check out codereview.stackexchange.com — achAmháin 56 secs ago
 
11:57 AM
0
Q: Find the length of the longest substring in it with no more than K distinct characters

thadeuszlayThe task is taken from educative.io Given a string, find the length of the longest substring in it with no more than K distinct characters. Example 1: Input: String="araaci", K=2 Output: 4 // Explanation: The longest substring with no more than '2' distinct characters is "araa". ...

0
Q: Robot game in C++

CheronaI have a very basic "game" where a robot is placed on a small 5x5 board, and commands are given to it. To start, the robot must be placed on the board, then you may command it to move, or rotate left and right. I have tried to use object oriented concepts, but it was not a requirement for my task...

 
 
1 hour later…
1:05 PM
I'm voting to close this question as off-topic because it belongs to CodeReview SE, since it is concerned around how to improve an already working code. Before asking your question there, please make sure that you check that site's help page making sure you formulate your question in a way that it is on-topic according to that site's rules. — Dávid Pásztor 27 secs ago
 
1:59 PM
Greetings, Programs.
 
2:40 PM
0
Q: Find missing element in an array of unique elements from 0 to n

thadeuszlayThe task is taken from LeetCode Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1] Output: 2 Example 2: Input: [9,6,4,2,3,5,7,0,1] Output: 8 Note: Your algorithm should run i...

0
Q: How can strike a post out when i click the complete button in React

Karthik Devaraja I got a noteApp. This App creates a new note, updates a note,delete the note and complete note. Each note has a complete button, edit button and delete button. When I click the complete button on one note it will strike through the text inside the note, disable the edit button and also c...

 
3:01 PM
0
Q: Skipping over failed imports until they are needed (if ever)

HoboProberWe have a program with many dependencies. Because the user may not want to use all of them, the program should skip over failed imports and only raise an error if absolutely necessary. e.g. if the user tries to call that class. I have implemented a way of doing this but I'm not sure it is as goo...

 
3:20 PM
0
Q: Are questions of coding challenge websites copyrighted?

KIKO SoftwareAn user of Code Review has been posting lots of questions from coding challenge websites. Here is an example: Find all letter Combinations of a Phone Number Now I can fully understand why someone would do this. It's a great way to get feedback on your code and learn from others. Nothing wrong wi...

 
3:36 PM
@Feeds Well, that was oddly expected. I'm surprised it didn't happen sooner.
 
4:02 PM
0
Q: Fork bomb in C to target testing platform

Saucy GoatI am enrolled in a first year college subject for which we have a project in C. Our projects are assessed via an online testing platform. Me and a few colleagues were intrigued as to the harm we could cause to that platform and so we talked to the teacher about it. He laughed and told us "If you ...

0
Q: overly complicated list-culling function

ShapeOfMatterI'm bothered by my answer to this SO question. I'm pretty sure it's more efficient than the sort-and-cull implementations, but I'm having trouble expressing that in a way that I trust. Also, it's rather convoluted by python standards. Is there a way to express the same process more clearly, wit...

 
4:19 PM
 
Monking
 
4:42 PM
0
Q: Why my result of my program is slow for large data and almost have a result "Memory Error"

aldonni hutThis is the program function code for clustering using k-medoids def kMedoids(D, k, tmax=100): # determine dimensions of distance matrix D m, n = D.shape # randomly initialize an array of k medoid indices M = np.sort(np.random.choice(n, k) # create a copy of the array of medoid i...

 
5:00 PM
@Mast we did have questions like that on codereview meta already :)
 
5:23 PM
0
Q: Injecting Appsettings.json into nlong.config

user95488My goal is to inject values from the appsettings.json into nlog.config for an ASP.NET Core application. I am using NLog.Web.AspNetCore 4.8.3, NLog 4.6.5, NLog.config 4.6.5, and Microsoft.Extensions.Logging.Abstractions 2.0.0. I wasn't able to get this working. I was under the impression that ${...

 
 
1 hour later…
6:24 PM
1
Q: Efficient way of BinaryGap

Selman KeskinA binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 10...

1
Q: Batch retrieve formatted address along with geometry (lat/long) and output to csv

swingcakeI have a csv file with 3 fields, two of which are of my interest, Merchant_Name and City. My goal was to output multiple csv files each with 6 fields, Merchant_Name, City, name, formatted_address, latitude, longitude. For example, if one entry of the csv is Starbucks, Chicago, I want the output ...

 
6:39 PM
Now that your code works but you want to improve it, you might try opening a new question on the Code Review stack site. One optimization I can see with this snippet: You're constructing your set twice, once in each if condition. Why not a sum instead of a constructing a set (a moderately "expensive" operation) then doing a len check? After all, sum([0,0,0,0,0...0]) == 0G. Anderson 31 secs ago
 
The random upvotes continue x)
I even get them on French.SE now despite having just a few questions and answers
3 upvotes yesterday, 3 upvotes today
Also I forgot the mandatory:
Monking! :D
 
6:55 PM
@Mast A friend of mine started OGame again... and now I did too... send help
 
lol this comes up every two to three years, right?
 
I haven't played in more than 10 years o.o
 
@Vogel612 I guess :P
 
7:25 PM
0
Q: Excel table filling with EPPlus

Lucas ApolinárioI am making a tool to read 3 input files in CSV and then filling an XLSX file with the information from the CSV. I want to know if I am repeating myself and if I can make it better and faster. Currently the entire migration time of the files is 2:30 minutes approximately. I will shorten the code ...

0
Q: Quick Select C#

GiladI tried to implement https://en.wikipedia.org/wiki/Quickselect Please review the coding style and clarity using System; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ArrayQuestions { [TestClass] public class QuickSelect { [TestMethod] public void Qu...

 
7:45 PM
0
Q: Using virtual inheritance for an interface system based on abstract classes

user225183I want to use a physics engine (like bullet or PhysX) in my program, however I want to hide the actual physics engine from it, so I can easily swap it out with another during run-time (e.g. switch between bullet and PhysX without requiring any changes to my main program). To do so, I have create...

-1
Q: Unittest with mocking

davidh38I am new at testing and I have tested the following function, which should read all .csv files in a given folder: class Main def read_all_csv_files_from_folder(path, extension): os.chdir(path) return glob.glob('*.{}'.format(extension)) I have written a following test with...

 
8:05 PM
0
Q: Knight's Tour - Python

EMLBelow is my recursive solution for the Knight's Tour. The user can set the board size and the program will print the first legal knight's tour it finds. As there are potentially millions of correct solutions to the knight's tour, only one solution is given. def legal_moves(visited, position, s...

 
...which will have to go through code reviewing etc. Not a desirable solution. — Sridhar-Sarnobat 38 secs ago
 
 
2 hours later…
9:50 PM
You did some recommedable work on the question. It is now much better than before (requirments, pelase give the code). It is however now a "working code, please improve". Which is still too broad. Maybe you can get a review. Check codereview.meta.stackexchange.com/questions/5777/…Yunnosch 58 secs ago
 
10:28 PM
1
Q: Generic data structures in C

TheMaxI'm new to C, and I thought a great way to learn would be to implement some generic data structures and algorithms. So far I've implemented a linked list and a dynamic array. Both are generic, the linked list with void*s and the dynamic array with macros. Both have some straightforward tests in U...

 
11:08 PM
0
Q: openweather map library (python)

mishuniahey guy can someone please help me out with my project, basically we should should develop a library that allows other developers to retrieve weather data about specific location. while creating the classes : exeption class location class weather class getWeather global function i cant figure o...

0
Q: What is the factor of this program run slowly and get Memory error for large data

aldonni hutI have some problem about the rusul, the result run slowly and get the "Memory Error" for large data def BCS(Eval_Func,m_i=50,n=50,minf=0,dim=None,prog=False,alpha=0.1,beta=1.5,param=0.2): estimate=Eval_Func().evaluate if dim==None: dim=Eval_Func().check_dimentions(dim) pa=...

 

« first day (2242 days earlier)      last day (1783 days later) »