« first day (2597 days earlier)      last day (1718 days later) » 

00:00
RELOAD! There are 6739 unanswered questions (89.9043% answered)
00:42
0
Q: How can I merge sort this list of list by number?

webiondevI can sort them by alphabet. I need to sort by number. If I add an extra index as shown in the conditional then it does not work. My data is like this: data=[("Ukraine",41879904),("Brunei",442400),("Christmas Island (Australia)",1928),("Mauritius",1265985)....] My code is def mergeSort(self,data...

0
Q: cs50 C mario (Error message expected identifier or "(" { 5:1

David F#include <cs50.h> #include <stdio.h> int main(void); { int n; do { //usr input n = get_in("Height: "); } while ( n < 1 || n > 8); for (int i = 0; i < n; i++) { (int j = 0; j < n; j++) { if (i + j < n-1); printf(" "); printf("#"); } printf("\n"); } }

01:21
@Mast I edited the answer to remove the statement that it should have been answered on SO. Also removed all my comments and flagged the responses as no longer needed.
01:51
0
Q: Merge Sort using vector c++

Ibrahima BarryI'm learning c++ and I know some algorithms and data structures. I was wondering what is the best way to do merge sort for a vector in c++. // will write a program for merge sort /* steps: * have an array of size n call it A * divide A into left and right halves L and R * call merge sort on th...

 
1 hour later…
03:00
0
Q: Tkinter treeview

Daniel HucksonI have subclassed tkinter treeview object added many features like cut,paste etc and context menus to insert rows, delete etc. Would like some feedback on how well it works and if it's intuitive or not. Current version is @: https://github.com/unodan/TkInter-Treeview-Example-Demo import json impo...

03:23
0
Q: Conway's Game of LIfe Help (Python)

user226030I am currently a beginner in Python and I am doing a project about Conway's Game of Life. For some reason, my count function doesn't perform the birth and death rules properly and I was wondering if someone could help me pinpoint my error. def countCritters (oldWorld): newWorld = oldWorld...

 
1 hour later…
04:34
0
Q: LeetCode 1: Two Sum

EmmaThis is an easy level LeetCode question, obviously not much code to review. I'm posting C++/Java/Python in this post. If you'd like to review, please do so. Thank you! Problem Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume...

 
2 hours later…
06:45
possible answer invalidation by ccpizza on question by ccpizza: codereview.stackexchange.com/posts/243636/revisions
0
Q: Scrape every Java themed codingbat problem set and your personal solutions

Tres The GoatI made the switch from JavaScript to Python lately. This is my first Python project and my first web-scraper. Do I have good practices? And could this be optimized? from bs4 import BeautifulSoup import requests urlHalf = 'codingbat.com' print("what is your email") inputOne = input(">") print("...

07:39
-1
Q: how to find edges between nodes more efficiently?

user13476360I have an undirected Graph G=(V,E) and its adjacency matrix x in DataFrame format and a list of nodes NODE subset of V. I want to find out all the edges b/w the nodes of NODE. I have tried the following code. Is there any other efficient way of doing it in terms of time complexity? please help me...

07:56
@Duga Rolled back.
-1
Q: Java xPath: simple expression evaluation

mattobobI'm using xPath on Java just to filter if an XML file contains or not a string or an expression: public boolean applyFilter(String xml, String xPathExpression) { String result = xPath.(xPathExpression, new InputSource(new StringReader(xml))); return !(StringUtils.isEmpty(result) || "false".eq...

 
1 hour later…
09:12
-1
Q: Sum of N natural cubes

WeezyI'm solving a codewars problem which asks to find out if a given input is a sum of natural numbers cubed. I was able to write a solution in rust and pass the sample tests but for some reason it keeps failing the test for some test which expects assertion failed: (left == right) left: 2, right: -...

 
2 hours later…
11:31
0
Q: Selection sort algorithm in x86_64 Yasm assembler

LRDPRDXI returned to study assembly language. And this is actually my first function written in Yasm. Implementing this function is a suggested project from this book. I slightly modified the pseudo code presented in that book: input: an array of integers 'array' length of 'array' 'len' algorit...

12:12
Monking
12:35
Monking
Monking
Monking
12:58
thanks for the help! What is code review? seems just like stack overflow? :) — AndrewNeedsHelp 11 secs ago
Glad I could help ;) Stackoverflow is part of Stack Exchange. you can ask the community @Code Review to review your code. It may not always be pleasant, but you can learn a lot from it. — KooiInc 39 secs ago
13:50
0
Q: C: function to read a token from stdin

Aniruddha DebI recently started doing some competitive programming in C and one of my first requirements was a high-speed token reader (analogous to the java Scanner class' next() function). Here's the first prototype: #define BUF_SIZE (1 << 10) // approx 2 KiB or 1024 chars char* next_token() { char* bu...

14:28
I think this question is more suitable for codereview.stackexchange.com. — Guru Stron 21 secs ago
 
1 hour later…
15:45
possible answer invalidation by Aniruddha Deb on question by Aniruddha Deb: codereview.stackexchange.com/posts/243817/revisions
1
Q: C++ - Logistic Regression Backpropagation with Gradient Descent

Jerik MangubatI implemented binary logistic regression trained with the backpropagation algorithm to calculate derivatives for a gradient descent optimizer. I am primarily looking for feedback on how I approached the functions that return optional derivatives. I used nullptr as a flag to indicate that derivati...

0
Q: Preferred way for getting an access token for a Google API by using Google Sign-in for Android?

sazharshaI am working on an android app that connects to Google Books API directly. Part of its working is to fetch user's private book data as well. (such as bookshelves) I used Google Sign-in for Android for authentication. However, i needed an access token for the request's authorization as well. THE P...

possible answer invalidation by Aniruddha Deb on question by Aniruddha Deb: codereview.stackexchange.com/posts/243817/revisions
16:33
0
Q: c# writing tests for WriteFileOuput

user226060I am new to writing unit tests and i am facing some difficult writing unit tests for this class. I am using Xunit and moq. public class WriteFileOutput: IWriteFileOutput { public string File { get; set; } public WriteFileOutput(string fileName) { File = fileName; } ...

17:10
yes its a linked list but you should put it in a separate class called LinkedList, in a separate .cs file. There is a code review stack exchange for this type of q — pm100 34 secs ago
@Mast The question (and the answer) as it stands right now is precisely what I seek. Thank you! :)
17:25
@CaptainObvious I think I've done all I can with this user, does someone else want to try.
18:22
Out of Scope: I had a peek at the source code, you have many issues to fix. For example: 1) You should use the System.Windows.Forms.Timer instead of the System.Timers.Timer in this context. 2) You don't need to any Timer nor a StopWatch to change the Value in the mouse events. 3) For this control, the main thread is enough. 4) You should dispose the Graphics objects when you don't need them anymore. Among other things. Asking another question to solve these issues is recommended. Or maybe the guys in the Code Review could help. Maybe. — JQSOFT 40 secs ago
Out of Scope: I had a peek at the source code, you have many issues to fix. For example: 1) You should use the System.Windows.Forms.Timer instead of the System.Timers.Timer in this context. 2) You don't need to any Timer nor a StopWatch to change the Value in the mouse events. 3) For this control, the main thread is enough. 4) You should dispose the Graphics objects when you don't need them anymore. Among other things. Asking another question to solve these issues is recommended. Or maybe the guys in the Code Review could help. Maybe. — JQSOFT 39 secs ago
18:52
0
Q: Group by range and include edge duplicates

JohanI've created a method that groups Item entities below based on their Value property. The idea is to produce groups that also includes possible "edge duplicates", i.e. [{ Value: 9 }, { Value: 10 }, { Value: 11 }] With rangeSize set to 10 yields two groups: [ [{ Value: 9 }, { Value: 10 }], [{ Valu...

0
Q: Almost unbeatable Tic Tac Toe

user3756068JavaScript beginner here! I have written a Tic Tac Toe game is JS that seems to be unbeatable (Title says 'almost' because I'm not sure if it's really unbeatable or just I can't beat it :) ). I really appreciate any help to improve my code and learn from my mistakes. Project's CodePen = https:/...

-1
Q: Can't read from a pipe. C

SaltyGiampyI'm writing a code that echo a string and sed it two times. My output is correct, but when I try to place that string on an array it blocks on read and goes on with the other calls. Here's the code: #include <unistd.h> #include <sys/types.h> #include <dirent.h> #include <stdio.h> #include <string.h>

19:08
Not at all. Please see my answer that explains it: codereview.stackexchange.com/a/243749/101565Your Common Sense 12 secs ago
19:26
@J.Doe No problem, we're here to help.
@pacmaninbw Gave it a shot.
19:52
@Mast Yes, but it seems some are unwilling to list to reason.
1
Q: C simpe hashcons data structure

Node.JSI wrote this hashcons data structure in C and it works correctly. It uses larger twin primes as the capacity and double hashing (open addressing). Page 614 of "Data Structures and Other Objects Using C++ (4th Edition)" describes the approach. I am wondering if I can get some feedback on whether I...

@CaptainObvious Broken code, suggested they go to SO.
20:23
@pacmaninbw VTC, downvote, flag where necessary, move along home.
If this is working code that you think could be improved, see Code Review. — jonrsharpe 6 secs ago
Now, I must admit, our scope is a bit oddly formulated at times and on many SE sites what's in the [help/on-topic] is only half the story.
0
Q: Hamming distance implementation in Java

SimmantI'm exploring String relativity and comparison techniques, and I found Hamming distance algorithm in my search so I give a try to implement that approach in Java and below I'm sharing my implementation. Please let me know if this approach is correct or I need to improve it more. HammingDistance.j...

20:39
You might want to ask this over on the Code Review site. — Dennis Sparrow 35 secs ago
Once this code is working to the best of your knowledge, consider posting on Code Review for help on fixing up the rest of it. — JohnFilleau 46 secs ago
I was thinking that my code was not efficient enough. Thanks Dennis and others, I will repost at code Review. — HCostaBrazil 13 secs ago
21:00
@Mast Wow, they seem a bit unpleasant. TBF they have a point the help center and the meta post are not very clear on this situation, as they focus on pseudo/hypo/stub-code rather than context.
21:25
I’m voting to close this question because this question belongs on Code Review, another site in the Stack Exchange network. — AndrewL64 18 secs ago
22:24
You will get better answers to this question on codereview. — Harshal Parekh 37 secs ago

« first day (2597 days earlier)      last day (1718 days later) »