Code Review Weekly Newsletter
Code Review Weekly Newsletter

Top new questions this week:

What does the Bob say?

Description: Bob is a lackadaisical teenager. In conversation, his responses are very limited. Bob answers 'Sure.' if you ask him a question. He answers 'Whoa, chill out!' if you yell ...

java oop strings programming-challenge  
asked by CodeYogi 18 votes
answered by Tunaki 20 votes

Fraction class in Java

(See the next iteration.) I have this class for representing exact fractions. See what I have: Fraction.java: package net.coderodde.math; import java.util.ArrayList; import java.util.List; /** * ...

java rational-numbers  
asked by coderodde 9 votes
answered by Tunaki 14 votes

Generating Robot Name

Problem: Write a program that manages robot factory settings. When robots come off the factory floor, they have no name. The first time you boot them up, a random name is generated, such ...

java oop strings programming-challenge data-structures  
asked by CodeYogi 8 votes
answered by Tunaki 9 votes

Removing all duplicated pairs in a Python list

I need a function to remove duplicated pairs from a list. The following is example list: a = [1, 1, 1, 2, 3, 5, 4, 4, 5, 2, 3, 3, 2, 3, 1, 6, 6, 6, 6] I need remove all pairs [a[i], a[i+1]] if a[i] ...

python python-2.7  
asked by Loom 8 votes
answered by Joe Wallis 8 votes

Finding a string whose MD5 starts like the digits of π

I tried to make a program to find a string whose MD5-hash starts like the digits of pi, where dot is omitted. Is there a faster way to do it than this: import hashlib import random import string n = ...

python performance algorithm python-3.x hashcode  
asked by guest 8 votes
answered by vaeta 1 vote

Social network graph of characters in a novel

I wrote a C program that builds a social network graph of characters in a novel. The program takes two text files as input: a list of the names of the characters in the novel, and the file of the ...

c linked-list graph  
asked by Cathal 7 votes
answered by Edward 2 votes

Simple python calculator

I'm very new to Python, and so I'm trying to learn it by doing simple programs, like a calculator. But I don't know if this is the "Pythonic" way to do it, or if I am making beginner errors. So ...

python beginner python-3.x calculator  
asked by Rakete1111 7 votes
answered by Joe Wallis 10 votes

Greatest hits from previous weeks:

Simple Example of an Iterable and an Iterator in Java

I was a TA for a first-year Java programming course this year. As a very simple example of iterables/iterators, I wrote the following code for the students. I am curious if any styling or other ...

java iterator interval  
asked by Sahand 18 votes
answered by rolfl 23 votes

Very basic calculator using methods

I have made a basic calculator using methods. This is my first attempt at using methods and would like to see if I can improve on this as there is a lot of repeated code. import java.util.Scanner; ...

java beginner calculator  
asked by Niall Szalkai 12 votes
answered by asteri 12 votes

Can you answer these?

Making a logic Prolog compiler simpler with Java

Good morning! I'm student in philosophy taking some course in programing in order to have a better understanding of artificial intelligence. I'm actually doing my own Prolog compiler just like SWISH ...

java performance ai prolog  
asked by Marine1 5 votes

Sparse table implementation

I wrote a C++ implementation of a sparse table (I wrote it for an arbitrary function) and I want so much to ask for a review. I'd like to know how I can make it better, especially the consistency of ...

c++ algorithm  
asked by Ayaz Salikhov 3 votes

Event-driven UDP listener wrapper

I wrote this wrapper around the UdpClient,using events for new datagrams: Class EventedUDP Implements IDisposable Dim Client As Net.Sockets.UdpClient Dim Endpoint As ...

.net vb.net socket udp minecraft  
asked by beppe9000 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