Code Review Weekly Newsletter

Code Review newsletter

Top new questions this week:

"Up" script for moving up directories quickly

A long time ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here. It's a very simple script with just 8 lines of ...

console bash  
asked by Joe Z. 16 votes
answered by rolfl 16 votes

Calculate all possible distributions of n objects to k containers

Let's say I have \$5\$ apples, thus \$n = 5\$. I have three bags (\$k = 3\$), each having the capacities of \$4\$, \$4\$ and \$2\$: $$c = { \{4, 4, 2 \}}$$ I'd like to calculate the number of ways ...

c# performance algorithm combinatorics  
asked by aLightning 15 votes
answered by mjolka 2 votes

N closest points to the reference point

Here is working code to get N closest points to some reference point. Please help to improve it, specifically by commenting on my use of std algorithms and vectors/iterators manipulations. ...

c++ c++11 coordinate-system clustering  
asked by Maxim Galushka 11 votes
answered by Deduplicator 3 votes

Options, options, options. None for JavaFX?

I was looking through the JavaFX library, and I spotted that JavaFX DOES NOT HAVE A JOptionPane EQUIVALENT. (Or at least not in my version - as @SirPython has said in comments, as of 8u40, there is a ...

java oop gui javafx  
asked by Manny Meng 11 votes
answered by Antot 1 vote

HashTable implementation in C++

I made a simple hash table and I was wondering if there was any way to increase the efficiency of search times. My table class is called Dictionary, because C# has tainted me. The way I set this up ...

c++ performance hash-table  
asked by Gurman8r 9 votes
answered by Zulan 12 votes

Numbers to byte-arrays and back

As the title explains, this is a series of extension methods that convert certain numeric types to and from byte-arrays, for certain actions which work better on byte-array types than numeric types. ...

c# reinventing-the-wheel integer serialization  
asked by EBrown 9 votes
answered by Mat's Mug 7 votes

Simple generic double buffer pattern

I wrote a small generic implementation of a simple generic double buffer pattern, and I was wondering if it's actually thread safe or can be improved in any way. Note: The specific part that I'm ...

c# multithreading thread-safety generics  
asked by Ron 8 votes
answered by Kuba Wyrostek 10 votes

Greatest hits from previous weeks:

Simple authentication in ASP.NET MVC 5

I am building an ASP.NET MVC 5 application and, for reasons which are irrelevant at this point, I am attempting to build my own means of authenticating users. I'm still very new to programming, ...

c# beginner reinventing-the-wheel authentication asp.net-mvc-5  
asked by Jason 5 votes
answered by Marc-Andre 4 votes

Brute force password-cracker

I am just coding some classic brute force password cracking program, just to improve myself. I've explained how my program works at the start of the code. Check some of those screenshots to ...

c++ performance beginner loop  
asked by daktari 12 votes
answered by Jamal 13 votes

Can you answer these?

Twitter clone in Golang

I have built a Twitter clone in Golang, using object orientation principles. I wish to know the design mistakes I have made. package blade import ( "database/sql" "fmt" ) type User struct { ...

oop sql go  
asked by Anony-mouse 6 votes

Optimizing HLSL shader

I am trying to optimize my vertex and pixel shader code. Do you have any suggestions what could I possibly do to improve performance? I am using it to draw textured cuboids, and if there are many ...

performance graphics hlsl  
asked by bartosz.baczek 3 votes

C# Treap implementation

I recently developed a simple treap data structure in C#. In the future, I may have the class extend IDictionary. For now, I only expose a public accessor and a delete method. public TValue ...

c# data-structures tree library heap  
asked by rookie 7 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