Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

"Have a safe trip"… or not, depending on four conditions

I have 4 booleans and all must be met to determine the value of a String: String message = (!isNameBlank && !isDestinationBlank && isDestinationValid && isAmountValid) ...

java conditions  
asked by silver 15 votes
answered by Legato 27 votes

Rock-Paper-Scissors game for learning purposes

I just want your opinions about my code. How could I improve it? Is there a better method to do it? from sys import exit from random import randint print "Welcome to the PIN Game 1!" print "Tell me ...

python beginner rock-paper-scissors  
asked by mschlindwein 11 votes
answered by David Morris 32 votes

A Text-Based Fighter - Like Pokemon

Okay, I'm a newb to programming/Python. To get a better understanding of objects/methods, I wrote a text-based, turn-based fighting game. I want to expand by adding new characters with new moves (one ...

python beginner oop game battle-simulation  
asked by Dmitri Valentine 9 votes
answered by vnp 3 votes

Python compare every line in file with itself

I am implementing a statistical program and have created a performance bottleneck and was hoping that I could obtain some help from the community to possibly point me in the direction of optimization. ...

python  
asked by Kenneth Orton 8 votes
answered by David Morris 3 votes

Simple calculator with classes in C++

I came to C++ from Java. This is my attempt at making a calculator on about 2 days worth of knowledge. I don't really know what is redundant or unnecessary. Nor do I know of the better ways to achieve ...

c++ beginner calculator  
asked by Tony J 8 votes
answered by user2471708 17 votes

Next number with the same sum of digits

I recently came across a email bot that would give you random problems to solve. Here is the problem. Please write a function in python which receives a natural decimal N-digit number (1 to 15 ...

python algorithm programming-challenge unit-testing  
asked by BryanDunkley 8 votes
answered by o_o 3 votes

CodeWars mathematical expresion evaluator

I recently wrote the following code for a codewars.com kata for evaluating mathematical expressions. I've been writing ruby for years, but almost everything I do is for personal use and isn't ...

ruby programming-challenge math-expression-eval  
asked by Zack 8 votes
answered by Caridorc 5 votes

Greatest hits from previous weeks:

Faster way to convert DataTable to List of Class

I am using ExcelDataReader to import an excel file to a dataset. Example Excel table below: //ID Name Display Order Active //1 John 1 1 ID, DisplayOrder and ...

c# performance linq converting .net-datatable  
asked by devspider 14 votes
answered by Gaui 15 votes

Update only modified fields in Entity Framework

I'm working on a website on ASP.NET MVC4 and EF5. I want to ensure that only modified values are updated in the database. I'm using a unit of work pattern and repositories for data work. Here's the ...

c# entity-framework asp.net-mvc-4  
asked by Narayana 8 votes
answered by Max 11 votes

Can you answer these?

Extending the functionality of lxml.etree

I wrote a class to slightly customize the behavior of lxml.etree.ElementTree and I use it quite extensively. It works great, but there are a few methods that I'm not sure how I wrote, and there are a ...

python python-2.7 xml inheritance  
asked by o_o 3 votes

Complex Space Factorization

I have posted a discussion on Math.SE regarding visualizing the complex space and effects of factorization methods on that space. A quick link to the paper is available here. I have 3 routines in ...

algorithm r  
asked by Fred Viole 2 votes

Auto-click the sequence

The following pascal script needs a bit of context for it's purpose to be understood. For those who don't give about purpose, feel free to skip ahead. Background A game I'm terribly fond of has a ...

performance pascal  
asked by Mast 5 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