« first day (2543 days earlier)      last day (1468 days later) » 

12:00 AM
RELOAD! There are 6517 unanswered questions (90.0882% answered)
 
12:22 AM
0
Q: A couple questios regarding a C pset from CS50

StefanDI started the CS50 and am at pset4. I completed both the less and more parts for the filter app that takes an image and applies a filter to it. In this pset we need to write the filters code only(greyscale, sepia, reflect, blur and edges). The edges function should apply the Sobel operator to an ...

 
12:45 AM
0
Q: How do I lessen the number of branches of code?

Heidi FelixI have 25 branches but I'm only allowed to have 12 branches maximum. The objective of this task was to cancel out unnecessary punctuation, find the common elements that exist in the sentence and dictionary and then to translate the result into English into the other language or the other language...

 
 
1 hour later…
2:05 AM
possible answer invalidation by Jamal on question by Neslihan Bozer: codereview.stackexchange.com/posts/240622/revisions
possible answer invalidation by Jamal on question by Neslihan Bozer: codereview.stackexchange.com/posts/240673/revisions
 
2:39 AM
0
Q: What's the best way to pass state to javascript using ASP MVC and razor

GeoffBurnsI am maintaining an existing ASP MVC application that has passed through many hands. Each section of the code seems to do the same task in a different away. I would like to standardize. But standardize on what? Sometimes the code expresses an URL using Url.Content <input type="hidden" id="actio...

-1
Q: Star Rating System

EmmanuelAm trying to build a product rating system into my web application.Not the best solution and needs your advice to come up with a better solution. Am using the star rating approach where there is stars and default value which start from zero(0). Below is how the code is working now: The stars are ...

 
thanks guys i was a little sceptical on this site cause i did not really think anyone would see this but i got a fast reply Ill re-post this on code review hope thats not against the rules or anything lol. — Emmanuel Okafor 34 secs ago
 
3:23 AM
Btw, I'm done arguing with you, since you're clearly ignoring what I say, and seem to have a strange fixation about K&R being some sort of holy word which can't possibly be wrong. K&R is worthless both as a general programming book and as a reference on the C language. Almost none of the code samples included in this book would pass a code review today, and I cringe to think that people are still trying to learn from it in this day and age. — Martin 45 secs ago
 
3:47 AM
0
Q: Is it okay to use multiple repositories from inside a single service implementation in Spring?

Alexiz HernandezI currently have two entities, Adress and Company. They both have DTOs to perform CRUD operations. AddressCreateDto: @Getter @Setter public class AddressCreateDto { @NotNull private String address1; private String address2; @NotNull private String city; @NotNull ...

0
Q: Randomizing all class variables in constructor c++

BlueLightning42I'm playing around with making random items and decided to implement the following structure. #include <stdlib.h> //uints #include <limits> #include <random> #include <iostream> class RandomItem { private: struct _physical_properties { uint16_t length; uint16_t width; uint16_t sqew; uint16...

 
4:23 AM
I’m voting to close this question because requests for improvements to working code belong on codereview.stackexchange.com, not here. — Joseph Sible-Reinstate Monica 58 secs ago
 
4:34 AM
0
Q: Formatting phone numbers CSV and Regex

Conor SmithIm just starting out with Python, so I am trying to play around with a few things to continue learning. I have pulled and printed the specific data needed from a csv file. But the phone numbers all print in different formats. How can I print them in all the same format, like say xxx-xxx-xxxx? im...

0
Q: Shared counter variable among different threads

VijayI have a need to use a shared variable among different threads in c/C++. So putting my knowledge of threads and mutexes I have written the below sample code. Can anyone please review the code and provide me review comments so that I can improvise it in a more better way. Also I know about atomic ...

 
5:19 AM
-1
Q: Securing HTML form from XSS?

Stevan MilicI have created this code which has a basic HTML form and I tried to validate the user input as much as I could. However, when I try to input the code below, it still goes off. I saw guides which validate the form to not allow , but I do not know how to implement it in my form. <script>alert("he...

 
5:42 AM
-1
Q: Why doesn't print(r"\") work in python without other spaces

helenIn python I know that to print a backslash you can use a double backslash or use the 'r' before the string. But if i wanted just a solo backslash, I don't understand why I cannot use the r method without extra characters or spaces etc. print("\\") #--> this works print(r"\") #--> this creates an...

 
6:15 AM
Here on Stack Overflow we are fixing problems in code. To get your working code reviewed please post it on Code Review. — Klaus D. 58 secs ago
I’m voting to close this question because it should be posted, along with the code, here: codereview.stackexchange.comStultuske 19 secs ago
 
6:28 AM
-2
Q: Decode cipher text using frequency analysis

Melvin-JPThis program is to decrypt ciphertext using frequency analysis. The goal is to replace the ciphertext letters entered by the user based on their frequencies with English letters based on their frequencies. I've been able to loop through the ciphertext and get the characters with their correspond...

 
6:50 AM
-1
Q: How to implement simple copy function?

Gaurang ShahI am trying to solve the following problem. Problem I have to write a copy method to copy from one file system to other. (i.e. local to hdfs, s3 to s3, and few more later). This file system (local, s3, hdfs) could increase in future and so does actions (copy, move, delete) some of the actions a...

 
7:40 AM
possible answer invalidation by Alexiz Hernandez on question by Alexiz Hernandez: codereview.stackexchange.com/posts/240841/revisions
This question is more suitable here. — Sebastian Kaczmarek 35 secs ago
 
8:11 AM
Request for 2nd opinion on this question by someone who actually does Java.
Currently at 4 VTC, but it may yet be on-topic depending on how the question is interpreted. May have been VTCd too soon.
@Duga Not ideal, but no clear invalidation. I'll leave it be.
 
8:40 AM
The problem with your question is that you posted it on the wrong site. SO is for actual problems, i.e. code that's not working. Your question would be much better off on codereview.stackexchange.comFrauke 46 secs ago
 
9:30 AM
-1
Q: It's better simply returning true/false or return the variable?

DennisIn a method I made this @Override public boolean canEditHq(User user, LocalEvent localEvent) { if (!HQ.equals(user.getUserHierarchy())) { return false; } if (!SECOND_APPROVAL.equals(localEvent.getStatus())) { return false; } final boolean hqCanApprove = this...

 
9:53 AM
-1
Q: Large number multiplication and addition

UnstookI made a code for multiply and add large numbers stored as vectors but is too slow. I grouped the numbers in groups of 18 digits and the addition is faster and correct but the multiplication now isn't correct. Before grouping the numbers I multiplied each numbers digit by digit and then adding th...

 
@Mast AFAICT the CV is correct.
there is not enough context on the method in question in the first place
 
10:10 AM
See codereview.stackexchange.com for this kind of questions — Mehmet Karadeniz 14 secs ago
 
0
Q: Tic Tac Toe Program: Are there any ways to make this code more readable?

bimyouThis is my second Python program, and I wonder if this code is readable to most people or if it only applies to me. Should I make more distinct functions or use more appropriate names? Are there other ways that lessen the lines of codes and do lesser lines mean more readability? Any suggestions...

0
Q: LeetCode: Finding all possible letter combinations from an inputted phone number

mycleanlittlescreteProblem Statement: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. This is a leetcod...

 
10:39 AM
-1
Q: Calculating the mean average precision (mAP) over different IoU values

iNetI am trying to get the mean average precision score (mAP) based on different IoU threshold values. In my task, I need mAP based on 0.5 and 0.75 IoU scores. Also, mAP within the IoU threshold range from 0.5 to 0.95 with step size 0.05. I am using the Matterport Mask-RCNN library to detect and eval...

 
11:11 AM
Hmm, would you be ok sending all the requests up front then parsing as results are returned? IIRC, this is how async works, it doesn't wait for a response from the server before sending the next request. If you do, maybe something I did awhile back codereview.stackexchange.com/a/221316/108307 would help. You could add a max timeout in the while loop in the example. — Ryan Wildry 29 secs ago
 
11:41 AM
@Vogel612 Thank you.
 
try codereview.stackexchange.com if you are just looking for a review. — Thomas 51 secs ago
Although this isn't code review, you don't need round. It involves an unnecessary cast to floating point and back. Also length should probably be an unsigned type as should probably all other ints in your code. Ideally size_t. — bitmask 47 secs ago
 
12:09 PM
Can I ask a short question here? Not a review, but for general Python advice.
 
0
Q: Function to set nested property by dot-path, like _.set

CherryDTAs part of a Stack Overflow answer, I whipped up a quick example implementation of a function to set a nested property of an object using a dot notation string. The goal was to show how that could work in a small amount of clean code: function set (object, property, value) { if (typeof propert...

 
@EugeneProut You can ask, but we may not answer
 
Okay, thank you.
I want to implement a distance matrix, but I don't which structure to use. I could use a 2d array or a Python dictionary.
If I had a dictionary I could store the distances (weights) and then enumerate with the keys. I would require another list for that if I went with the 2d
 
If you use a dictionary what would the keys be? range(len(d))
 
The keys would be the vertices
 
12:17 PM
Yeah, what type
 
Strings
well, chars but I think Python doesn't distinguish
 
Can you give an example of what a key would look like in Python
 
{"A":[0,3],"B": [3,0]}
 
Not really sure what that would mean. But since you think dicts are better just use them
 
If the code works this might be better suited for codereviewGrajdeanu Alex. 46 secs ago
codereview.stackexchange.com is better suited for code refactoring suggestions. — jfaccioni 22 secs ago
 
12:22 PM
Thank you for letting me work through the problem, I think I have a solution
I will probably post it for review once I have mangled some code together
 
@EugeneProut Don't you have the problem with the example you posted above? Or are you going to zip the keys with the nested lists?
 
I said enumerate but that would be incorrect, I think I need to use zip
But I already keep a list of vertices in the code, so I wouldn't be running d.keys()
This is what makes me question the benefits of a dictionary
 
You don't have a specific problem but want suggestions on how to improve the code. So question is more suitable for Code Review SE. Also, this is C++ code and not C code. — kaylum 49 secs ago
 
If I were to do it I'd either go full dictionaries or full lists.
 
0
Q: Is this a correct implementation of quicksort in C?

MihaI'm learning C at the moment and chose implementing quicksort as an exercise. My code is sorting correctly, but afterwards I looked at some tutorials online about quicksort. And they implement it differently. I don't know, if I misunderstood quicksort, or if I simply implemented it differently....

 
12:34 PM
@Peilonrayz I think I will go for a nested lists. It would be cleaner than messing around with dictionary.keys() and zip. Many thanks for your help
 
I fail to see why you'd be using .keys() and zip rather than .items() if you have nested dicts.
for k1, subset in d.items(): for k2, d in subset.items():
 
Ah, I hadn't thought about nesting dicts
That would make a very nice structure
 
Either way it's not much different to lists. Unless you're indexing by the vertex
for k1, subset in zip(vs, ls): for k2, d in zip(vs, subset):
 
So to check if they are connected - having a distance != 0:
if distance_matrix[vertex_1[vertex_2]]:
 
That looks super broken.
 
12:43 PM
My code is super wrong
if distance_matrix[vertex_1[vertex_2]] != -1:
and have -1 represent no join
What makes you say it's broken?
 
Run this distance_matrix[vertex_1[vertex_2]]
Since you're indexing the data by vertex I'd use dicts.
Anyway I'm off to lunch
 
Thanks for talking through it with me, have a good lunch.
 
0
Q: How to make this Python code more neat in functions?

AnnaI'm making a code that, starting from an xml file: stores the index of child elements of a tag and the child elements as key, values in a dictionary; deletes keys whose values contain a certain string; joins the dict values and extracts their text; replaces certain values with ""; counts the oc...

 
1:18 PM
please go to code review: codereview.stackexchange.comIfaruki 26 secs ago
 
1:42 PM
0
Q: Scala - How to avoid multiple if/else condition

Gaurang ShahI am trying to solve the following problem. Problem I have to write a copy method to copy from one file system to other. (i.e. local to hdfs, s3 to s3, and few more later). This file system (local, s3, hdfs) could increase in future and so does actions (copy, move, delete) some of the actions a...

 
I tried codereview, but nobody answers — Anna 19 secs ago
 
1:58 PM
welcome. this sort of question is better suited for Code ReviewDaniel A. White 49 secs ago
@DanielA.White Looks off-topic for Code Review to me. — Peilonrayz 43 secs ago
 
0
Q: Regular Expressions - finding two or more vowels with a consonant before and after it, includes overlapping

MahdeenSkyIs there a way to make my code more compact or efficient? Testcase example 1 : rabcdeefgyYhFjkIoomnpOeorteeeeet output: ee Ioo Oeo eeeee Testcase example 2 : baabooteen output: aa oo ee import re def find_two_or_more_vowels(string: str): match_obj = list(re.finditer(r'(?<=[qwrtypsdfghjklzx...

 
2:16 PM
@DanielA.White oh i didn't know about Code Review, thanks — Natanael Nunes 33 secs ago
 
2:27 PM
0
Q: fixed size memory allocator interface without fragmentation on freeing the memory

Agrudge AmicusI was trying to write a memory pool interface which: Grants memory of fixed size chunks in linked list style fashion. On returning the memory there is no risk of memory fragmentation. //mem_struct.h #ifndef MEM_STRUCT_H #define MEM_STRUCT_H struct mem_struct { char arr[4]; struct mem_st...

 
@Feeds 404 lol
 
2:50 PM
0
Q: Minimum priority queue in Pascal for Dijkstra shortest path algorithm

ArturoI have a record with an integer representing the name for a node and an array of integers representing the possible connections to other nodes in a directed graph. I want to use dijkstra's shortest path algorithm to find the shortest path to every other node given the name of one. So I've made a ...

 
Having said that, all of these are opinions and, as such, not suitable for this site (take our tour and read our How to Ask page) - perhaps this question is better-suited for codereview.stackexchange.com :) — blurfus 17 secs ago
 
Ben Popper on April 20, 2020
The world has changed a lot in the last three months. As we adjust to this new reality, we are seeing interesting new traffic trends and community efforts across our network of sites.
 
3:06 PM
This is what codereview.SE is for. — Karl Knechtel 30 secs ago
Oh shoot - I saw a link to this post from Rubberduck's dev chat and assumed it was a Code Review question... and answered it as such. I hope it's ok.. — Mathieu Guindon 1 min ago
Not sure what codereview.SE is. Link? — wiwa1978 39 secs ago
@MathieuGuindon, awesome that you already answered before I could upload the full code ;) I quickly read the answer to the first question and I guess that I have got the point, although not understanding everything. Later this evening I'll read again and then translating stuff that I didn't understand. If it is ok for you, I'll ping you again when something is unclear. My plan was to post the full code on Code Review when I have finished refactoring which will most likely will take some more time. When I have more questions, I'll ask them here again. — Stefan Pinnow 8 secs ago
 
3:36 PM
0
Q: Extract multiple substrings in XML like tag

NuageuxI have a XML file (test.xml) that can be sum up as follow (I filtered it so it will be more readable): <coverage complexity="0" line-rate="0.66" lines-covered="66" lines-valid="100"> <package complexity="0" line-rate="0.66" name="."> <class complexity="0" name="file_a.py"...

 
For code that is working, codereview might be a better place for a review. — Anonymous 27 secs ago
I went down a similar path recently: codereview.stackexchange.com/questions/240828/… My take away is that you can use states within your library components, but you need to be careful and should call callbacks within effects. If you want to exchange knowledge don't hesitate to get in touch with me. — Robin 33 secs ago
 
3:59 PM
@CaptainObvious Wow, someone still uses Pascal?
I haven't seen or used Pascal since I graduated in 1985.
 
4:14 PM
Pascal is huge in machines programming.
We used it for all of our CNC machines ~5 years ago.
I think they still use it, I'm not sure I don't work there anymore.
 
Welcome to Stack Overflow and to the Perl tag! I'm glad you're learning Perl and want to get better. I'd like to give you some feedback on your code, but Stack Overflow is the wrong platform for that. Your question doesn't have a concrete answer. Please post it again on Code Review and we'll give you feedback. Thanks. :) — simbabque 33 secs ago
Once you get this working how you want, consider bringing it over to Code Review for peer review on ways to improve your code. Again, make sure it's working before you post it over there. — JohnFilleau 14 secs ago
 
5:30 PM
-3
Q: Clean Code - Difference between encoding a variable and something like "accountList"

nonethewiserThis is specifically concerning what Robert C. Martin is saying in "Clean Code." I realize there are other schools of thought on this. I get it to some extent, but don't see where the limits are. I assumed he means not to do something like: int_age = 50 He also explicitly says not append m_ f...

 
@CaptainObvious best practices question
 
if not getting solution here you can ask them in codereview.stackexchange.comsahasrara62 just now
Question asked, answered and accepted at codereview: codereview.stackexchange.com/q/240859. — mzjn 56 secs ago
possible answer invalidation by Marc on question by Marc: codereview.stackexchange.com/posts/240814/revisions
 
5:46 PM
@Duga great follow-up @Peilonrayz!
How impatient are you if you only wait 1 hour to get an answer... :O — Peilonrayz 4 hours ago
"Gimme gimme gimme!"
 
0
Q: CMake setup for Project with multiple .exe for game engine

Rick NijhuisI am working on a game engine using CMake, this being the first CMake project I worked on I am looking for some feedback. The project has the following structure: root |--CMakeLists.txt |--Cheetah | |--CmakeLists.txt | |--includes | |--dependencies | |--src | |--out | |--build | ...

0
Q: Is this code "Pythonic"?

Abstract AcumenI am new to Python, so I am interested in knowing if I am efficiently using python for this project. This program is meant to simulate the Central Limit Theorem. It uses sliders to adjust the number of measurements and the number of trials. I am mostly curious if I am using the function for upd...

-1
Q: Refactoring Angular/Ionic App

mozpiderI am looking for ideas to refactor my code. I am a stay at home dad, I don't really have anyone to review my code. So reaching out here. My code is a resume App with modules such as: Summary, Education, Core-Competencies ... Each of these component have CRUD operations, which are done be (Read ...

 
@SᴀᴍOnᴇᴌᴀ *something something* age of the 2 second attention span *something something*
3
 
6:16 PM
0
Q: MailCrypt CLI using mailcryptlib

Joe SmithI applied the suggestions from the previous post as well as created a new CLI to help identify issues with with the library. mailcryptlib """Library for send and receiveing encrypted emails.""" import pickle import email import imaplib import smtplib from Crypto.Hash import SHA512 from Crypto....

0
Q: Best approach for converting list of nested dictionaries to a single dictionary with aggregate functions

Jasper SardonicusI've looked through a lot of solutions on this topic, but I have been unable to adapt my case to a performant one. Suppose I have a list of dictionaries stored as: db_data = [ { "start_time": "2020-04-20T17:55:54.000-00:00", "results": { "key_1": ["a","b","c","d"], "key_2":...

 
My Quadtree is not subdividing properly C++ SFML
 
6:33 PM
If the code works as intended, you could post it on Code Review Stack Exchange instead. — Georgy just now
 
@jasbindra00 That's unfortunate, but not something we can help you with.
@SᴀᴍOnᴇᴌᴀ @Peilonrayz Now answered.
Not a great question, but I've seen much worse lately.
 
@Duga @Mast yes Duga's sharing of this comment led me to that info...
Question asked, answered and answer accepted at codereview: codereview.stackexchange.com/q/240859. — mzjn 55 mins ago
 
facepalm
 
but thanks for being helpful! ⭐
 
@Duga Is the review really on the code behind the link?
 
6:41 PM
@Mast Yeah, I noticed that a while ago. The answer seems to have the same level of quality as the question.
Why the .replace*20 hasn't been addressed IDK.
 
did anybody else see this flagged chat message for review?
 
@SᴀᴍOnᴇᴌᴀ It's handled.
 
@SᴀᴍOnᴇᴌᴀ Yeah, strange since it was already in the trash
 
There's nothing in the documentation indicating flags are removed after a message is moved, I think.
 
6:43 PM
it reminds me of a line from the Dude where he tells Walter he isn't wrong...
 
And it's also perfectly possible to flag messages that are already in Trash.
Flags take a while to reach the network-wide queue, so I wonder what a flag looks like that's flagged in room A, migrated to room B, escalates. Will it point to current or previous location?
Probably most recent location regardless of how often it's moved, but that would require some experimentation. And I'm not going to screw with chat flags.
 
@Mast That's such a strange video XD
 
@Peilonrayz First thing I thought of while considering the current CR situation.
 
lol
 
"We're not gonna take it" is also on the list somewhere.
 
6:53 PM
@Mast when I click the link YT shows the message Video unavailable The uploader has not made this video available in your country. but I can view it in this playlist #side-stepping
I have been listening to a lot of Genesis this year, as well as S&TP
 
@SᴀᴍOnᴇᴌᴀ Vevo vs non-Vevo
I'm on a bit of a Sabaton binge myself lately.
 
7:12 PM
Got a new mower :D
 
Can any 15k+ user please protect this? It keeps attracting crap answers.
 
Protected
 
@DerKommissar Shiny, didn't know they made battery-powered mowers that big.
 
Yep, they even make riding lawn mowers.
Ryobi is currently the king of battery-powered lawn tools.
 
@Peilonrayz Thank you.
@DerKommissar Battery-powered riding lawn mowers? Welp. With the rise of electric cars I shouldn't be surprised, but I'd have thought such mowers to be too expensive to actually sell.
 
7:16 PM
They're expensive, so I'm not sure how popular they are.
I don't need one or I would consider it.
 
I'm so glad I don't have enough grass to need a riding lawnmower anymore. Especially since I didn't have a riding lawnmower at that time, so, lots of maintenance...
1700m2
 
The far right battery is what it came with.
I bought the middle one today as well.
Then the other two are for my weed eater / trimmer and leaf blower.
 
@DerKommissar How is the middle one smaller than the one to the right if it has the same capacity, same voltage, same brand?
HP don't overheat as quickly as the ordinary ones?
 
0
Q: Prolog refactor if/else

pfftHow do I refactor this mess of if/else conditions so that it's more readable? ( Reverse_Path = [[]] -> Child = [c(New_Score,G1,Pos),P] ; otherwise -> Child = [c(New_Score,G1,Pos),P|Reverse_Path] ), ( memberchk(Child,NewAgenda) -> addChildren(Others,Reverse_Path,Current,NewAgen...

 
@Mast I think it's "high power"
 
7:26 PM
Ah, my guess was on "high performance", but in marketing speak that's probably the same thing anyway.
 
Yeah, I think it allows for a higher AH draw.
 
@DerKommissar Probably. Thicker leads, better insulation, overall higher C-rate.
Welcome to The 2nd @Loong
 
Yep, my guess
I put both those 6AH's on the charger around 2 and they've each only come up 1 bar lol
It's now 3:30...
 
7:43 PM
@DerKommissar Perfectly normal for such batteries to take a couple of hours.
Charging Li-ion too fast is detrimental for their lifespan. Make sure you store them cool too.
 
Oh yeah, just funny because the 4's take like 2 hours from dead to full, these got 1 bar in an-hour-and-a-half lmao
 
Comment out each one of the aggregates in Nstat() and see which is bottleneck. BTW - If code works, this should be posted on Code Review for tips on re-factoring/optimizing. Try profiling, too. — Parfait 27 secs ago
 
@DerKommissar With consumer-grade batteries, the bigger they get the slower they charge. Usually.
Industrial grade you can get anything you want as long as you pay.
I've seen 1 MWh batteries charge and discharge in an hour.
Bloody huge, bloody noise too...
That's Tesla battery-farm level charging.
 
Yeah we used to use them for momentary shots at the plastics factory. Had about 30 seconds to get a battery up to snuff to fire the machine for 1. Really expensive.
 
8:10 PM
1
Q: Improving Poker Odds Calculator

AlistairThis code accepts input from the user on a game of Texas Hold Em Poker. It then reports back the odds of winning against a single opponent at each betting stage. The calculation needs to process (50 choose 5) * (45 choose 2) for the pre-flop calculation. The way I know this can be done fast is to...

0
Q: Can you give me pointers on my latest Java program?

Emmanuel OkaforQuite new to Stack and I have some Java code I would like you guys to give me pointers on. I've been listening to some programmers and they use terms like good and bad code. I am not really sure what they mean by that. I mean I went on r/badcode and saw some stuff I knew was definitely bad code....

 
8:33 PM
0
Q: Arduino code for multi button state change detection

Coding-Is-An-AdventureI created state change detection for multiple buttons, which is intended to run on my Arduino for a touchpad project. In a nutshell, the code makes sure that the Arduino only reacts to button presses and not to holding in the buttons. I noticed that I started to write the same code for every but...

0
Q: How do I speed up Pandas Groupby operation on a large dataset

XinI am working with a large dataset expanding > 50 years. Each year has ~ 15 million lines of records with multiple variables/columns. I need to perform groupby operations by location and time. My code runs extremely slow - it takes ~5 hours to process 1 year's data. I looked at a few posts on mult...

 
8:55 PM
possible answer invalidation by AJNeufeld on question by Heidi Felix: codereview.stackexchange.com/posts/240837/revisions
 
0
Q: Live Streaming Service Schema Design

David BellI'm requesting some feedback on a database we use in a live streaming service. We've frankensteined this one as we've grown, and I'm looking to make a new one because there are now some obvious pain points. I'm not a database engineer and I've likely broken some beginner rules in the current desi...

0
Q: Write a lock free singleton factory using generics in c#

Vivek JainI am writing a generic CacheProvider factory which contains a concurrent dictionary to keep the "Named" cache objects (a custom implementation of memory cache based on concurrent dictionary) to be shared among different state machines/pipelines. I found this article and came up with below implem...

0
Q: Code duplication

Benjamin WI wrote a function that merges two linked lists but I seem to have some code duplication I'm not sure what to do with: //merges two sorted linked lists into *merged_out, returns suitable error/success codes ErrorCode mergeSortedLists(Node list1, Node list2, Node *merged_out) { if(!merged_out...

 
9:10 PM
 
@Duga hmm... it appears whitespace was removed and not just for indentation - e.g. the value for dictionary ... a cursory glance over the answer doesn't look like it mentions that variable specifically... but shouldn't the edit be rolled back?
 
0
Q: Vowels and consonants in Java-exercises with strings

AdamKI feel like my code is too messy-Im looking for possible way to make it more readable/shorter. Goals: 1)Get three strings from user input. They have to be the same length. a)First must contain only lowercase letters. b)Second must contain only uppercase letters. c)Third must have an even length ...

0
Q: Keeping groups based on the row count of a second column

JulioI have the following code that aims to filter those pid (1 and 4) that have at least before_threshold (2) rows with a value of before in the day_type column and at least after_threshold (2) rows with a value of after in the same day_type column. Is there a more succinct way of doing this using ...

 
@Mast Best mower ever
 
9:26 PM
@SᴀᴍOnᴇᴌᴀ I agree - not for AI but because users shouldn't edit the code in other peoples questions.
 
right - that was what I meant
 
Actually
It might be an SE bug
 
~ raises eyebrow
 
When you quote text it truncates it. And so there may be an issue with CTRL-k, because it's not valid Python
 
9:32 PM
I think the user may have accidentality press the block quote icon manually reverted it and then pressed the code block button. If you press the block quote button on AJNeufeld's change you get:
> sentence = "?hello boolean bring, !mango! and, country ban,ana wish
> yum  apple!"
Which looks about right
 
0
Q: Simplifying function

drill dogI'm making a chess game. On the board the columns go from a-h and rows from 8-1. I made this simple function so when someone inputs 'a' for the row it will give me the right row on an array same goes for columns, 7a would be [1][0]. Is there an easier way someone could point out for me? Thanks ...

 
@DerKommissar I'd never heard about them before, turns out they sell a lot of 18V equipment in EU too.
@Peilonrayz Ctrl+K simply adds indentation regardless of whether it's valid Python, right?
 
@Mast Yes, I was wrong. I believe they must have pressed the quote button by accident.
 
9:51 PM
Always fun.
 
 
1 hour later…
10:59 PM
OHAI @Malachi
 
possible answer invalidation by Mast on question by Marc: codereview.stackexchange.com/posts/240814/revisions
 
@Duga its okay - he formatted command example for compiling, as well as error message as code
 
0
Q: Merging multiple awk commands while retaining functionality

rubbunTurned in a project a few days ago, and I needed a way to filter and format values off a file. I decided to go for a bash script since it seemed like a good option, and I came up with the following: #!/bin/bash amount=100 awk '{ if($i == "data: 1"){ getline; getline; ...

 
11:20 PM
for code reviews there is a special site codereview.stackexchange.com and thats why code reviews are off-topic on this site — Sir Rufo 23 secs ago
 
@Peilonrayz ಠ_ಠ so... should it get rolled back? because it was a code modification?
 
@SᴀᴍOnᴇᴌᴀ No, obvious (or less obvious in this case) C&P errors are exempt from the no editing rule.
 
Assuming they're done correctly. We've meta'd this. Kind-of.
 
jives with meta answers like this one
13
A: Should you edit someone else's code in a question?

200_successUnlike Stack Overflow, at Code Review we are interested not only in a solution that works, but a solution that is well expressed as code. Therefore, we review all facets of the code, including whitespace. If you feel that the code in the question is improperly formatted, do not silently edit th...

 
11:34 PM
Ah, the exact meta I was thinking of :)
 
I was thinking of one of Mug's answers, but I can't find it.
200's looks good too.
 
11:59 PM
-1
Q: how to running test script in Ctest

coder4I would run a test script in my Ctest, and compare generated output file with some expected file, which means i need to run two commands in one ctest. According to CTest with multiple commands I have a Script.cmake : macro(EXEC_CHECK CMD) execute_process(COMMAND ${CMD} RESULT_VARIABLE CMD_R...

0
Q: Using SSH.NET to interact with a Bash shell

jscarleI'm trying to interact with a bash shell on a router to automate some CLI commands using SSH.NET. I'm not sure if the approach I'm taking is the best one and would like to get some recommendations on how to improve my methology. Although this code does indeed work correctly and does produced cons...

 

« first day (2543 days earlier)      last day (1468 days later) »