« first day (1723 days earlier)      last day (2302 days later) » 

12:00 AM
RELOAD! There are 4917 unanswered questions (90.2545% answered)
Could StackExchange's Code Review site is a good place to get feedback on "..any better ways I can go about anything..". — SherylHohman 43 secs ago
 
12:43 AM
0
Q: Cell phone user interface

SushiMouseI'm self teaching programming via text I've found online and a course on Udemy. We had a challenge today to make a simple cell phone interface to add, remove, modify, etc. At this point I have learned the basic OOP principles, arrays, arraylists, and recently input. I was wondering if someone co...

 
12:55 AM
possible answer invalidation by Jamal on question by Latika Agarwal: codereview.stackexchange.com/posts/184260/revisions
 
0
Q: Implement bubble sort in Python

Latika AgarwalI have written the following code for bubble sort. How can it be optimised? def bubble_sort(details): """compares two consecutive integers in a list and shifts the smaller one to left """ for i in range(len(details)-1): try: if details[i] > details[i+1]: ...

 
possible answer invalidation by Jamal on question by Latika Agarwal: codereview.stackexchange.com/posts/184184/revisions
 
 
2 hours later…
2:45 AM
possible answer invalidation by KooKoo on question by KooKoo: codereview.stackexchange.com/posts/185543/revisions
 
1
Q: Asynchronously receiving data from a connected socket

user2288650Can anyone tell me if this is right way to call Begin recieve asynchronously? The code works fine but I want to make sure. private static void message_listener(Socket sock) { byte[] m_buffer = new byte[5000]; sock.BeginReceive(m_buffer, 0, m_buffer.Length, SocketF...

 
 
2 hours later…
4:50 AM
possible answer invalidation by KooKoo on question by KooKoo: codereview.stackexchange.com/posts/185543/revisions
 
0
Q: Recursively find the largest number within an array

TheLearnerCan anyone give me tips on how to write this cleaner? I think my base case is ok and the recursive step can be written cleaner. Is there any edge cases I have missed? public class MyClass { public static void main(String args[]) { int[] arr = {6,2,7,1}; System...

 
 
1 hour later…
5:54 AM
0
Q: C++: Valid merge sort implementation?

Archie GertsmanI've tried implementing merge sort in C++ just by looking at the Wikipedia graphic. Comparing my code to other merge sort code implementations, it doesn't look quite the same at first glance. Have I done it in an acceptable way? How can it be improved, particularly using modern C++? #include <io...

 
 
2 hours later…
8:20 AM
0
Q: Fixed-Size Memory Pool with alignment

AcornAfter taking a break and reviewing the comments on my first attempt at creating a fixed-size memory pool, this is my second attempt. The memory pool should allocate each block correctly aligned in memory, so that when I call placement new on the returned memory, it isn't misaligned. This is my ...

 
8:35 AM
0
Q: how can we join two dictionaries in python

shishirI just need some help in achieving to write logic for this prog: Merge 2 objects with any depth (including contained dictionaries, lists, sets, strings, integers, floats). Type mismatches should yield a tuple with the two elements. Examples: a = {'x': [1,2,3], 'y': 1, 'z': set([1,2,3]), 'w': '...

0
Q: Should I use static to create two lists for Windows Form in C#?

Yu ZhangI need to create two lists of Card objects in C#, a Card class is defined as: public class Card { public Suits Suit { set; get; } public Values Value { set; get; } public static Random rand = new Random(); public Card() { } public Card(Suits s, Values v) { Suit...

 
8:47 AM
Do you have any dependency to pmdcodereview? — VonC 48 secs ago
 
9:27 AM
1
Q: efficiensy issue about my code

alexI wrote a program that inputs a string with spaces between them and should allocate a new string with only 1 space between the words. and I was wondering if there's a better way to write it ( I rewrote it a couple of times and I'm trying to find the most effective way to write this code) anyway...

 
Please ask this question on codereview.stackexchange.comsmac89 57 secs ago
 
10:11 AM
If your code is working but needs optimizing it may be a candidate for code reviewQHarr just now
 
 
1 hour later…
11:12 AM
Thanks QHarr, I'll post in code review. — asim1701 13 secs ago
 
0
Q: JavaFX: a better way of moving Cell objects around a game field

woodStoneI have a 20x20 field that contains Square objects. Each Square contains a Rectangle that is used to display the Square and a Cell object that is used to store a current Cell inside that Square. Then inside the Main class a visual representation of the grid is created using Squrare.getModel() met...

0
Q: Excel VBA Filtering: AODB vs Autofilter vs SQLite

asim1701I have an Excel sheet with data in about 100,000 rows, 16 columns. I have to extract data (one value from the 1 row I find) from this table a few thousand times. I have been using Autofilter to extract this value, but have also tried AODB/SQL statements to see if I can improve the speed of the qu...

 
11:48 AM
0
Q: Largest Prime Factor of Number in PHP or QBasic

Mrigank PawagiI was solving the 3rd problem at Project Euler which requires me to calculate the largest prime factor of 600851475143 which I think is a really large number (more than 6 billion). QB64 At first, I tried solving this problem using QB64. CLS n = 600851475143 FOR x = 1 TO n IF n MOD x = 0 ...

 
12:35 PM
0
Q: A heap class implemetation. Suggest edits

Rupank Pahuja /*insert(int value) shift_up(i) - needed for insert get_max - returns the max item, without removing it get_size() - return number of elements stored is_empty() - returns true if heap contains no elements extract_max - returns the max item, removing it shift_dow...

0
Q: thread safe queue with watermarks

bobahA thread-safe queue suspending/resuming the producer when respectively upper/lower watermark has been crossed. Intended usage - interchange between a non-blocking IO loop thread and a consumer running in a different thread/pool. High performance is not a key requirement, but comments in this dire...

 
Monking
 
1:09 PM
0
Q: C#: Thread timer for each player or 1 big loop?

Harry EvansI know that a question similar to this exists, the problem was that I registered as a quest and couldn't recover my question as I lost my account. Each player in the game has their own PlayerWorker class. I was wondering if it would be more efficient, performance and memory wise to use one worke...

 
1:23 PM
Monking
 
1:35 PM
Sorry, but we are not here to fix your code for you. Or code review it. — Stephen C 35 secs ago
 
-1
Q: How do I make my xml node attribute replacing program error free?

Don_BI'm trying to create a program which will search the xml files for nodes in the form <disp-formula id="deqnX-Y">, create a dictionary where keys are like rid="deqnX" ... rid="deqnY", (where X is incremented by +1 till it reaches Y) and their respective value counterparts are like rid="deqnX-Y" ea...

 
2:22 PM
CPU overclocking is.. interesting
 
2:43 PM
Keep in mind that I'm still overvolting for my intended 4.7Ghz, so I'll lower that in a bit
 
0
Q: Rich Edit Form Input

Sep Roland This procedure is the natural continuation of the Example 4 that I wrote for How buffered input works, a Stack Overflow Q/A. Features include: freely positioning the cursor. Left Moves cursor left. Right Moves cursor right. Home Moves cursor to the far left. End Moves cursor to the far ri...

 
3:30 PM
0
Q: A console application that uses the Rich Edit Form Input procedure

Sep Roland This console application uses the Rich Edit Form Input procedure for which you can find the source here. It presents the user with a dialog that has 5 input boxes and 2 buttons. The dialog is drawn differently depending on screen width. You use TAB or SHIFTTAB to switch between fields. ENTER...

 
 
1 hour later…
4:34 PM
There are so many things in there wrong. And we don't do code reviews here. Try at codereview.stackexchange.comjuergen d 29 secs ago
This is more a code review question.. Yes There is a better approach it's called normalisation — Raymond Nijland just now
 
4:55 PM
0
Q: Reading/writing single bits from/to FILE

MarcoLucidiI'm implementing a Huffman encoding/decoding program and I need a way to deal with single bits. I tried to keep things as simple as possible, I "pack" bits inside a single byte and I have only one index to worry about (of course this is a bit inefficient). I'd like to get general feedback. Any...

 
5:10 PM
0
Q: Advent of Code 2017 Day 6 (part 2) in Functional Programming (FP)

thadeuszlayI wanted to practice functional programming (FP) without using any library but using vanilla JS only. So I took a problem from Advent of Code (the 2nd part of Day 6). You can only access the 2nd part if you type in the solution for the 1st part: 3156 or look at my solution for part 1. --- Pa...

0
Q: Many things wrong with this ERD, what do I change

Basel NoemanI have an assignment due next week, and for that Assignment I am supposed to learn MySQL and create an ERD. Now I've made this ERD I went to my professor for feedback and he just told me that it is not a good ERD and refused to give me any further feedback. I'm still a noob, but my question to...

 
possible answer invalidation by Yu Zhang on question by Yu Zhang: codereview.stackexchange.com/posts/185590/revisions
 
5:41 PM
0
Q: A portable parallel loop construct in C89

coderoddeI was practicing writing some portable C89 code and came up with this parallel for loop construct. Basically, if you have a bunch of tasks that do not depend on each other, it makes sense to create a concurrent queue of those tasks, a pool of worker threads popping the queue and performing a task...

 
an approach which helped me in the past was to make a list of libraries in use, then rule out one after the other by code review combined with recherche and testing. In my case, it was a particular version of the ODP.NET provider library that leaked a couple of bytes per procedure I failed to dispose. Undetectable in dev, but adds up quickly in production under heavy load. — dlatikay 51 secs ago
 
6:07 PM
Since you don't have any specific question regarding your code, this is rather a question for Code Review. Anyhow, you have to include an introduction, what your program is supposed to do, what your input is and what the output/behaviour is. We don't want to guess this kind of information. — Piinthesky 57 secs ago
 
0
Q: Max Gain python implementation

NinjaGI wanted to ask for code review for the following interview question. I include 2 implementation, and wondering if there's any trade-off. Thank you. Problem: Max Gain Given an list of integers, write a method - max_gain - that returns the maximum gain. Maximum Gain is defined as the maximum diffe...

 
6:38 PM
0
Q: Complete Code for a Websocket server on c# to handle multiple client

user2288650This is my test code for a websocket server to server multiple clients simultaneously written in c#. The program listen for for new connections on 192.168.0.7 port 100. Multiple clients can be connect and send data simultaneously. The console will display the messages sent by each client after...

 
7:03 PM
I'm voting to close this question as off-topic because Code Review is the better place to ask, as agreed by the OP — Cindy Meister 10 secs ago
 
-2
Q: Cowboy checkers

Tilen Podsedenšek I wonder if someone could help me with this excersize. I need it in python.

 
7:19 PM
@CaptainObvious 2 more VTC to close that crap.
 
@Kayaman you're right - full disclosure, this question was prompted by a failed attempt at optimization via parallelization. Parallelizing this program has resulted in no improvements at all and I'm grasping at straws now. Here's the revelant CodeReview query codereview.stackexchange.com/questions/185554/…Kovalainen 25 secs ago
 
7:58 PM
0
Q: 'weighted sample' from overlapping categories

TimThe Problem I wish to write a function, that will sample from various (potentially overlapping) categories C_1, C_2, ... C_k, such that the sampled values are in the ratio r_1:r_2: ... : r_k or as close to that ratio as is possible. The categories may well (and most of the time definitely will) ...

 
8:13 PM
0
Q: Streamline/simplify Optional construct

Hai VuMy method getProjectDir() will return an Optional which contains the path to the project directory, or an empty container: Optional<Path> getProjectDir() { ... } I have another method, getSrcDir() which depends on getProjectDir(): Optional<Path> getSrcDir() { Optional<Path> projectDir = g...

 
8:38 PM
0
Q: Two databases in Entity Framework, using UoW/Repository patterns

Ish ThomasI was trying to build a DAL using UnitOfWork and Repository pattern, but got confused when I had to deal with two databases. I always created UoW and Repository classes and interfaces. I knew DbContext already implements both patterns.. but I wanted to abstract EF layer. Anyway.. in this case, ...

 
@AniketSahrawat, You have no right to comment on someone's designation. The fact that I am a Senior Software engineer is pretty evident when I am trying to solve the questions without prior knowledge of php. You wanna do coding standard battles then there is a code review community. Join that. if you are already part of it, post your suggestion over there. — Priya Jain 29 secs ago
 
8:53 PM
0
Q: Make the program with less variables and less declarations.. for optimization and performance purposes

Ja_cppI'm working in a very large project and in this post I'll share only the function that I feel it could be written in better way. I have a function called M44toM33 with quite many declarations, variables and repeated operations.. What do you think about this function? could be better? I'm quit...

 
possible answer invalidation by Jamal on question by coderodde: codereview.stackexchange.com/posts/185612/revisions
 
52
Q: What criteria should we use to determine which review queue indicator a site will have?

Jon EricsonA few weeks ago, we tested a modified review queue indicator for small sites. In essence, the top bar icon will get a red dot whenever there's any task and not just when the count reaches a discrete threshold. The experiment seems to have worked for small sites, but can be annoying when there are...

 
this should be posted in code review — Funk Forty Niner 5 secs ago
 
^^ hurr durr we kinda could fix review queues, but don't wanna. How do close to a useful fix do you want us to go?
 
9:12 PM
0
Q: Find spiral 2D matrix (List of Lists) of ints in a clockwise spiral

NinjaGI got this question during my interview with Microsoft. The question called 2D Snake. I'm wondering if my solution 1 passes the test, but if my solution 1 different from solution 2. Let's have some fun with 2D Matrices! Write a method find_spiral to traverse a 2D matrix (List of Lists) o...

 
9:26 PM
0
Q: Tic Tac Toe in JavaScript (+ jQuery)

ArtbarteHere is my first project that I made with JavaScript and jQuery with a little bit of HTML and CSS: var currentTurn = "X"; //X or O var turnNumber = 0; function generateFields() { var y = 1; var top = 50; for (var i = 0; i < 9; i++) { var x = $("#board").append( "<div class='fiel...

 
9:45 PM
If this code works fine, then this question is off topic on Stack Overflow, but may be good for our sister site Code Review. — Joe C 51 secs ago
 
0
Q: Simple bitset in Go

fstanisI was playing with an implemention of sieve of Eratosthenes in Go and realised a memory-efficient solution would benefit from a memory-efficient data structure for storing boolean values at the given location - something like bitset in C++. I created this simple implementation which is backed by...

0
Q: Stitch or stretch lines of a simple text file

Dexter ThornOften I write notes about a topic into a simple text file when I learn something. Sometimes i work with these text file on other computers with a different screen resolution. So sometimes the lines of the file are to long for printing them in one displaying line. I have written a program that so...

 
10:01 PM
0
Q: Ruby: Compare dates (as keys of identical values in hash) and perform functions dependent on comparison

busfenderI have code which uses information from a MySQL database to generate a hash representing a roster/rota like: hash = {DateObject1 => "Fender", DateObject2 => "Leyla", DateObject3 => "Eiffel", DateObject4 => "Minkowski", DateObject5 => "Fender", DateObject6 => "Eiffel" etc.} where DateObjects ar...

 
10:18 PM
0
Q: Repository layer for MongoDB

Javier García ManzanoI've implemented a quick and dirty repository to save and insert users to a MongoDB. As you can see, it just inserts one and finds one. Not a rocket. The thing is I don't really know what are the best practices when implementing a repository layer, how to really arquitect this, etc... Furtherm...

 
10:54 PM
If you are interested in code review, don't block on async code with .Result. At best it is less efficient than using a synchronous API, at worst it will cause a deadlock. You should await all async calls or, if you can't go async "all the way", you should use a synchronous API like HttpWebRequest. — Crowcoder 36 secs ago
 
11:11 PM
This was my question initially, and I haven't done much Go since I posted this years ago. CodeReviewComments#Interfaces suggests that the external library should implement the struct, and the user should define an interface on that struct, passing it in using dep injection. Which, points to the first solution you mentioned in your post! — user2402831 56 secs ago
 
11:26 PM
0
Q: Python solving for Quadruple Sum

NinjaGI am trying to learn dynamic programming using hash table. I was given this problem as a challenge. Question on coding for Quadruple Sum Given a sorted list of integers and an integer target, find all the unique quadruplets which sum up to the given target. Note: Each quadruplet must be a tuple...

0
Q: python implementation of finding Maximum Sum Path

NinjaGI'm preparing interviews and studying BST tree. Maximum Sum Path Given a binary tree consisting of nodes with positive integer values, write a method - max_sum_path that returns the maximum sum of data values obtained by traversing nodes along a path between any 2 nodes of the tree. The path mus...

 

« first day (1723 days earlier)      last day (2302 days later) »