« first day (2949 days earlier)      last day (1365 days later) » 

00:01
RELOAD! There are 7610 unanswered questions (89.4229% answered)
00:14
0
Q: advice for pointer to void in C?

Matteo Pagliarelloim a beginner of C and i am trying to code with pointers to void. My goals would be to sort every type of record with one function.The code works and compile but i think that i could write it better. I am searching for advice to improve my skills,thanks for the attention, i leave the code down: m...

 
1 hour later…
01:29
0
Q: Trying to port Javascript to Java may left some error

Magno CI'm porting this code to Java and after a few tests all seems ok but I need to know if I'm doing this right. The code takes some colors and create a color ramp for maps and other stuff. You can see the original Javascript version working here. I removed the "slider" part and fixed the amplitude t...

01:54
0
Q: Checking whether a graph is connected in an immutable way

bigfocalchordI have this function at the moment def isConnected(adjacencyListMap: Map[String, Seq[String]]): Boolean = { // Simple BFS to check whether each vertex is connected val visitedMap = mutable .Map[String, Boolean]() ++= adjacencyListMap.keys.map(vertex => vertex -> false).toMap v...

02:24
There is a Code Review Stack Exchange (codereview.stackexchange.com), this question would be mroe suitable there. — paisanco 16 secs ago
I’m voting to close this question because it is more suited to Code Review Stack Exchange — paisanco 5 secs ago
02:51
possible answer invalidation by Magno C on question by Magno C: codereview.stackexchange.com/posts/261447/revisions
@LoicTheAztec if you are interested, someone of your WP expertise might be able to weigh in @ codereview.stackexchange.com/q/261431/141885 (let me know when you've read this so that I can delete it). — mickmackusa 28 secs ago
 
2 hours later…
05:14
0
Q: Make some condition shorter

Miomir DancevicI have something like this in typescript isSendCalculationDisabled(): boolean { return (this.calculationResults.state === CalculationState.SENT) || !this.assignmentService.assignmentEditable || (this.buildingImageRenderService.isRenderReady === false) || (this.calculationResults.reaso...

 
2 hours later…
07:23
Monking
@Duga Looks ok.
Was mentioned in the comments, should've been included at the start.
08:10
0
Q: How to split recursively a dataset according to one of its attributes?

John CampbellI want to split a dataset recursively according to one of its attributes (attVal) and based on others datasets attributes values like the following : Given the initial dataset ds1 and the datasets to split with ds2, ds3,..., i want to split by min(df2) and max(df2),min(df3) and max(df3)... the da...

08:46
possible answer invalidation by Xeнεi Ξэnвϵς on question by Xeнεi Ξэnвϵς: codereview.stackexchange.com/posts/261421/revisions
Monking
@Duga Handled
0
Q: Does my code fail for large input

ZebraBelow is the code for mergesort using multithreading, will this code run for large number of inputs or does any other part of the code needs changing #include<iostream> #include<thread> #include<mutex> #include<vector> #include<functional> #include<fstream> std::mutex mu; void merge(std::vector<int

09:25
0
Q: Project Euler 7 (JavaScript)

user243125Project Euler 7: What is the 10 001st prime number? \n I currently have this code: let primesfound = 0; for(i=0;i<Number.MAX_SAFE_INTEGER;i++){ if(isPrime(i)){ primesfound++ } if(primesfound==10001){ console.log(i) break; } else{ console.log(i + `and ${primesfound} found`)...

09:36
That's the extent of my suggestions. I would suggest you contact Apple through the developer account code review request or whatever it is called. If there's a way, they'll help you find out or just tell you that it's not possible. — EmilioPelaez 9 secs ago
 
2 hours later…
11:31
0
Q: Compare strings to markup commentary in main text

Satifrom itertools import cycle # Integers represent Chinese characters main_text = "234458674935346547521456767378878473562561423" text_with_commentary = "2344586749215432678652353465475214561655413164653413216576737887847356152352561423" iter_main = iter(main_text) iter_comm = iter(text_with_comm...

11:56
0
Q: Find if a dataset of words contains any words containing all vowel by using exactly 5 calls to str_detect

J. MiniTake the words dataset from stringr. An R4DS exercise challenges the reader to check if there are any words in that dataset that contain every vowel. My presumably correct solution, using five calls to str_detect, was as follows: library(stringr) words[apply(sapply(c("a", "e", "i", "o", "u"), fun...

12:46
1
Q: Optimising a Prime-Generating Algorithm and Python Script

KStarGamerI was wondering if it would be possible to optimise my python script? It is designed to quickly generate and print all the prime numbers under some inputted number. It is fairly fast currently, and I am wondering about its current time complexity, however, I'm also curious to know if there are fu...

0
Q: Verify Armstrong Number in Clojure

Billy MoonBackground I am doing an exercise in clojure to make a function that can determine if a number is an Armstrong Number or not. The solution I came up with us a bit more complicated than it would be if there was not a requirement to take 17 digit numbers which start to cause calculation errors with...

@CaptainObvious do we have any JAVA programmers who can check if the code works?
13:36
0
Q: CLI ASCII Maze Generator / Python 3.9

SamI made a maze generator in python that outputs in CLI. With mazes that are extremely big, it can take a while to output. I want to know if there is any way to increase the efficiency of this code. Here it is: import random def mgen(size=3, disallowedcoords = [[]]): try: def canmove(co...

14:09
Aaron Shekey on May 31, 2021
Stack Overflow celebrates site accomplishments with confetti in multiple places. That means it’s time to formalize it in our design system.
14:51
0
Q: MatLab: Plotting Output Electric Field Spectrum

MateGoal This code combines two matrices, diagonalizes that matrix, and finds the right and left eigenvectors, right and left eigenvectors are normalized with respect to each other, then it is multiplied by an exponential function that is a function of the Eigen values and plots the output spectrum w...

15:36
Trying to balance recording how the work was done, not polluting the repo, and minimizing code reviews. I settled on creating a script in python that identifies commits in on their feature branch, and then steps through those commits looking for orphaned files. Debating if i want to go the extra mile and compare the size added from all commits, and size added from delta from dev. — Sam P 32 secs ago
0
Q: Filter results by a search term

user3378165The below code filters my contacts according to a search term the user typed. Is there a way I can make it dynamic? contacts = contacts.filter( contact => contact.firstName.toLowerCase().includes(search) || contact.lastName.toLowerCase().includes(search) || contact.title.t...

 
2 hours later…
17:14
I think this question fits better to codereview stack — B001ᛦ 17 secs ago
0
Q: Ask for user input and again on the same line

msjoaA function that asks for user input according to some criteria and again on the same line if the criteria is not met. It requires that escape character sequences be enable. """ Ask for user input according to some criteria and again on the same line if the criteria is not met """ __all__ = ['inp...

1
Q: JavaScript discrete slider web component

ackhThe standard HTML range input element suffers from a number of limitations that caused me to implement the web component presented here. First, it is unnecessarily complicated to style the standard HTML range input element to make it look the same in all web browsers (see here and here). Second, ...

Monking
17:47
0
Q: Tower of Hanoi in Racket

Avrohom YisroelI'm in the early stages of learning Racket, and decided to have a go at the tower of Hanoi. I did this without any reference whatsoever, so everything is up for review, including the algorithm as well as my code. In order to move n disks from a from peg to a to peg, we need to... move the top n-...

0
Q: R code optimization

Stupid_InternI have about 977 obs in top500Stocks which contains name of 977 stocks. head(top500Stocks,10) ï..Symbol 1 RELIANCE 2 TCS 3 HDFCBANK 4 INFY 5 HINDUNILVR 6 HDFC 7 ICICIBANK 8 KOTAKBANK 9 SBIN 10 BAJFINANCE and I have Date, OHLC and Adj.Close, Vol and Ret...

Re. https://codereview.stackexchange.com/a/261457/25834

It was deleted due to the appearance that it was an alternate solution with no explanation. But I would have accepted the author's

> We are using pd.Grouper which is much faster compared to resample when used with groupby.

as sufficient explanation/insight. So I think that it's unfortunate that it got deleted. is this worth undeleting, or would that be inappropriate?
@Duga I see we ninjaed each other here Mast
Bloody magnificent time that was.
You posted the comment around the same second I performed the rollback.
Teamwork.
4
I was like "oh an edit". Hang on a minute the post has radically changed
@Reinderien The performance gain looks like it doesn't require much of an explanation indeed.
18:53
OK. That being the case, since the author themselves deleted the answer - if we undelete it, would an explanatory comment on the answer be enough?
It's not a very well-written answer, but the basis is there. It didn't have to be deleted IMO.
@Reinderien I think deleting the existing comment and posting a "we've undeleted your post, sorry for the confusion" would be sufficient
great :)
19:51
possible answer invalidation by JSuisEnPeignoir on question by JSuisEnPeignoir: codereview.stackexchange.com/posts/261428/revisions
@Duga nah it's fine
20:42
1
Q: Is it wrong to split this function into two?

Josh FriedlanderI wrote this module to find the Hamming distance between two strings. (It's a problem from exercism.io's Haskell track.) As I saw it, the problem has two distinct parts: check if the length of the two strings are equal (if not return Nothing), and recursive pattern matching on equal-length string...

Then you should post on code review, because that's what code review is for. — user3386109 39 secs ago
21:42
glibc printf is written in C, not by hand in assembly. code.woboq.org/userspace/glibc/stdio-common/printf.c.html - it just calls __vfprintf_internal. You could of course look at the compiler output if you want, probably easiest is to single-step into a call to printf. (Use gcc -g -fno-plt foo.c so you don't have to step through lazy dynamic linking on the first call. It's not pretty, in fact kind of a mess last I looked: see my codereview answer on Bytes to binary conversion function, and the comment thread) — Peter Cordes 12 secs ago
21:58
@DanielLangr - for the final steps using n threads to sort n sub-arrays, then it would be faster to merge even and odd sub-arrays using n/2 threads, and then again using n/4 threads, and then a single thread to merge the final two sub-arrays. Example code using Windows native threads . — rcgldr 39 secs ago
22:38
23:01
possible answer invalidation by Arnon De Paula on question by Arnon De Paula: codereview.stackexchange.com/posts/261356/revisions
23:12
0
Q: @reify executes database queries every time called?

maudevBased on this comment about reify, It acts like @property, except that the function is only ever called once; after that, the value is cached as a regular attribute. This gives you lazy attribute creation on objects that are meant to be immutable. I have this custom reify class: class reify(obj...

23:37
0
Q: WIP "Console" processor, written in C#

ArchivedButterI decided I wanted to make a console-like system. So, I started planning & creating it in c#. Currently, all that it is is a processor of sorts. It reads all bytes from a file (R:\disk00), and then executes them, somewhat like a CPU. display.pyw is a simple pygame application which reads R:\disk0...


« first day (2949 days earlier)      last day (1365 days later) »