Code Review Stack Exchange Weekly Newsletter
Code Review Stack Exchange Weekly Newsletter

Top new questions this week:

Simple and effective port checker in C++

Intro A couple of weeks ago I finished a Python implementation of a multithreaded port checker and I wasn't quite happy with the result I've got (speed). I needed it to be faster, so I've built ...

c++ performance networking socket tcp  
asked by Dex' ter 18 votes
answered by Zeta 27 votes

Rock, Paper Scissors game in Python

I wrote a simple Rock, Paper Scissors game in Python for class. As a beginner, I would like some input as to how I could abstract or make my code smoother. I feel like the repeated use of if or elif ...

python beginner python-3.x rock-paper-scissors  
asked by Richard Peña 14 votes
answered by hspandher 7 votes

Python bot to answer mathematical questions for a remote server

The MSP Tech Club puts on an annual CTF, available here. I've worked on a solution but was wondering if there's a better way to write it or if I have any particular bad habits showing themselves? The ...

python python-3.x socket captcha  
asked by Codingo 14 votes
answered by alecxe 13 votes

Making a web service call based on a type of request

I have my code which makes a web service call based on a type of request: public class Client { IRequest request; public Client(string requestType) { request = new ...

c# object-oriented design-patterns .net dependency-injection  
asked by Simsons 12 votes
answered by JanDotNet 9 votes

Plotting a rectangular prism

I'm making a rectangular prism function who's results look like this: I think I can reduce the amount of code I'm using by somehow using np.meshgrid more effectively and using a Python iterator, ...

python matplotlib  
asked by Seanny123 11 votes
answered by Dex' ter 5 votes

Increase efficiency with Like operator in Loop

I have vba code that loops through a large number of records and deletes rows based on criteria. The issue at hand is that it takes far too long to run. I have never actually let it finish because it ...

performance vba excel  
asked by PartyHatPanda 11 votes
answered by Raystafarian 10 votes

Reversing an array in Python

Reversing an array in Python without using a built-in function: def reverse(alist): end = len(alist)-1 limit = int(end/2) + 1 for i in range(limit): alist[i],alist[end] = ...

python array python-2.7 reinventing-the-wheel  
asked by Akan 8 votes
answered by Dex' ter 10 votes

Greatest hits from previous weeks:

Input validation for text boxes in a Form

In a Win Form I'm doing initial validation in the Form. So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. There are about 18 such Text ...

c# .net validation winforms mvp  
asked by CAD 4 votes
answered by tinstaafl 6 votes

Generating all combinations of an array

I'm generating all combinations of an array, so for instance, ["a", "b", "c", "d"] will generate: [ "a", "b", "ab", "c", "ac", "bc", "abc", "d", "ad", "bd", "abd", "cd", ...

javascript combinatorics  
asked by Incognito 41 votes
answered by Wayne Burkett 33 votes

Can you answer these?

Safe (and restricted) version of eval

I have built a shell function aimed to perform the following: Given a string as first argument, perform safe expansions (i.e. those that cannot cause arbitrary code execution and only produce string ...

bash shell  
asked by Fred 2 votes

Pandas code for calculating distance and time between waypoints for large files

This is very similar to other code I've posted, however this is designed for very large csv files, for example 35gb. The files typically look like this: ...

python performance python-3.x numpy pandas  
asked by Joshua Kidd 5 votes

Finding all the divisors of a given number, that are even

What this code is basically supposed to do is find how many even divisors a number has. For example the number 100 has the divisors 1, 2, 4, 5, 10, 20, 25, 50, 100 of which 6 (2, 4, 10, 20, 50 and ...

java algorithm  
asked by Rockstar5645 3 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3