Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

Is this form submission validator professional?

I have written some jQuery code for AJAX form submission: jQuery(function() { jQuery('#message').click(function() { var btn = jQuery(this) var Name = jQuery("#Name").val(); …

javascript jquery ajax form  
asked by Sameer Sam 13 votes
answered by Dan Pantry 17 votes

Increase difficulty based on score

What I'm trying to do is very straightforward and easy, but I am wondering whether there is a more elegant solution. Basically I have a game and I want the difficulty to increase the moment the …

c# optimization game  
asked by user16547 12 votes
answered by 200_success 14 votes

Brainf**k Interpreter in Java

Description To increase the awareness of my previous brainfuck question, not only is there a bounty on it (Thanks, Mat's Mug) but here's also a brainfuck interpreter. This is written with Java 8 …

java interpreter brainfuck  
asked by Simon André Forsberg 11 votes
answered by Winston Ewert 8 votes

Markdown to HTML

String.prototype.replaceAll = function(find, replace) { if (typeof find == 'string') return this.split(find).join(replace); var t = this, i, j; while (typeof(i = find.shift()) == 'string' …

javascript html parsing regex markdown  
asked by bjb568 10 votes
answered by Alexis Wilke 10 votes

Dining Philosophers Algorithm

Please visit the http://en.wikipedia.org/wiki/Dining_philosophers_problem for algorithm discussion. I have written below java program to solve this problem by Arbitrator solution algorithm mentioned …

java algorithm multithreading  
asked by Shree 10 votes
answered by tim 7 votes

Checking for neighbours more elegantly in Conway's Game of Life

My method for counting neighbors in my soon-to-be Game of Life implementation is very repetitive and I was wondering if this could be done more elegantly: static int countNeighbours(Board b, int x, …

java game-of-life  
asked by 11684 9 votes
answered by rolfl 9 votes

CSV reader using StreamReader and LINQ

Mostly due to readability, I am using the following code to find a specific csv file on a drive read that CSV file using a streamReader parse it into a List<string[]> to be able to use LINQ …

c# optimization performance linq csv  
asked by Aeolus 9 votes
answered by Mat's Mug 7 votes

Greatest hits from previous weeks:

Finding repeating numbers in an array

I want to search through an array of n numbers and find the numbers that are repeated. So far I have this code, which does the job, but I find it to be a rather cumbersome method, but I can't seem to …

java homework interview-questions sorting search  
asked by Hatori Sanso 14 votes
answered by Phil K 11 votes

Java code for Linked List

I've been practicing implementing a linked list from scratch. Can someone help review my code? class Node { Node next; int num; public Node(int val) { num = val; next = …

java linked-list  
asked by Adam Johns 8 votes
answered by toto2 5 votes

Can you answer these?

Detecting connected acyclic through Tarjan strongly connected components variant

I want to verify that a given directed graph is connected and acyclic (DAG). I have implemented a modification of the Tarjan's strongly connected components algorithm in imperative style (as the …

algorithm f# graph  
asked by jruizaranguren 4 votes

Knowing who is the user in every request (in every action and every view)

First: I have many model classes that are mapped from/to tables using EF. Two of them are User and UserCookie, which are stored in tables Users and UserCookies. public class User { public long …

c# authentication asp.net-mvc-4 session redis  
asked by sports 2 votes

Tiny Lua library to get char pointer from string

Background I'm using Lua with luaglut to do some OpenGL stuff. The luaglut API is almost identical to the gl/glut C APIs. Sometimes, gl functions want a pointer to some data, for example: …

c memory-management lua opengl  
asked by Dagg 8 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