« first day (2585 days earlier)      last day (1415 days later) » 

12:00 AM
RELOAD! There are 6696 unanswered questions (89.9385% answered)
 
0
Q: How to write this 7-nested loop in a better way while keeping (or improving) performance?

TortarI'm doing a challenge online, the problem is to find all happy numbers from 1 up to 1.000.000.0. In a part of my code , I have to sum all of the digits to the power of two for numbers from 0 to 1.000.000.0 then I have to find if the sum is inside a given set of integers and if this is true put ...

 
 
2 hours later…
2:20 AM
possible answer invalidation by Mohsen Alyafei on question by Mohsen Alyafei: codereview.stackexchange.com/posts/243164/revisions
 
 
2 hours later…
4:14 AM
If your code works, I guess this is offtopic for SO and you should ask this question on another stackexchange site? — vasily.sib 6 secs ago
 
4:33 AM
0
Q: Is there a way to justify code? (Python)

01001101 01100001 01110100So, I was starting to code a pretty simple rock, paper and scissors program... if random.randint(0,2) == 0: computer = 'rock' elif random.randint(0,2) == 1: computer = 'scissors' elif random.randint(0,2) == 2: computer = 'paper' When I realized that I had to put my "if statements" ...

 
4:49 AM
@CaptainObvious Not a request for review.
@Duga Rolled back.
 
5:21 AM
0
Q: Translating Dijkstra's Algorithm from Python to C++

Jerik MangubatI'm going through the book Grokking Algorithms which is in Python but wanted to write everything in C++. Up to this point everything's been pretty straightforward translation but the code for Dijkstra's algorithm really exploits nested dictionaries and weak typing which I used as an excuse to try...

0
Q: date convert with format, and i wrote it with closure concept, what is the best practice of this code

Mehrdad Kiani Anbohii want write the best practice of this block code with closure, I hope help me to write better code //this is date function function dateFactory() { /** * convert georgia dateTime to persian dateTime * with custom format. * @param inputDate you should pass dateTime value ...

 
Side note: Descriptive variable names make debugging (or code reviewing) much easier - names like x, y, c, t1 etc are difficult to follow as they don't mean anything (unless you made them!). — Samuel Everson 36 secs ago
In Ruby variables and method names are snake_case, not camelCase. ItIsAReadabilityThing. Pay attention to that if you every intend to program as part of a team as they'll call you out in a code review. I'd recommend read github.com/rubocop-hq/ruby-style-guide several times, until you understand why we do those things. — the Tin Man 10 secs ago
 
6:04 AM
@vasily.sib This issue may fit the description of codereview.stackexchange.com/help/dont-ask So I won't ask it in CodeReview — Flithor 10 secs ago
 
6:15 AM
please see here codereview.stackexchange.com/questions/243164/…. It could be n^70 or n^-70 or more — Mohsen Alyafei 40 secs ago
 
 
1 hour later…
7:21 AM
-1
Q: Buffered reader end of stream and empty messages while reading from socket

Tishy TashI read message from socket and append to my queue for processing. I need to know the difference between when empty message is received or what does end of stream means in my case. Sometimes, I receive empty messages that makes socket dirty and as a result the connection is terminated after specif...

 
8:10 AM
0
Q: JSON Input validator and Parser

QuestThere are probably a lot better ways to do it, but take it as a learning exercise. Basically below is the JSON InputValidation and parsing using nlohmann::json which takes expected fields, objects arrays and verifies its presence and (optionally) parses them into an appropriate c++ structure. in...

-1
Q: How to correct the following error?

Arshad Noman# create a database connection conn = create_connection(database) # create tables if conn is not None: # create ACTOR table create_table(conn, sql_create_ACTOR_table) # create MOVIE table create_table(conn, sql_create_MOVIE_table) When I add one tab...

 
8:20 AM
0
Q: Why am I getting downvotes for closed question

Kartik ChhajedI answered a question. I agree that the question was off-topic. Still, I thought of helping that person. But, now I am getting downvotes for my answer. My answer is legitimate and answers the question. Should I delete my answer before any new downvote happens?

 
8:59 AM
-1
Q: Give segmentation mask as input to segmentation network?

MuhamMad RoshAan MughEesI want to train a semantic segmentation network. I have a dataset with Red, Blue, Green, Infrared, Low segmentation mask, high segmentation mask. Low segmentation mask consists of class labels as pixel values like 0 for the forest, 1 for water. with dimension (256x256x1). High segmentation mask...

 
9:14 AM
@CaptainObvious No code.
 
9:39 AM
@Feeds RBA.
@CaptainObvious Beyond hope.
 
@Mast RBA?
Oh, probably "removed by author"?
 
@Zeta Yes.
We have a lot of unofficial abbreviations like that, introduced (and sometimes died out) over the years.
> print("I can share the basic code with you if any one requires")
What do you think the bloody 3-codelines prompt was for
 
10:11 AM
0
Q: Sending emails asynchronously

IgavshneIn a part of our system a lot (I'm not sure how many, probably a couple thousand) of emails are being sent to the users at a specific time of the month. It seems this kills the server. So I was asked to add the mailing of these emails to another part of the system that uses a Scheduler to do calc...

 
#!/bin/sh
GITHUB_REPO="https://github.com/my-profile/my-code"
xdg-open "${GITHUB_REPO}"
Obviously. /s
@CaptainObvious Good question, although the text content could use some more structuring.
 
This user has been posting questions and answers lately that definitely need a polish. If anyone has any great ideas on how to support the effort made by this user without sacrificing quality, I'm all ears.
Some of the answers are simply unacceptable in current form, others can be turned into something decent with enough work.
 
10:28 AM
Hello Hury Shen Thank you for your response. About the first solution, if I initialize it with Object type, I'll have a problem when the value id defferent to Null , I cannot set it as Object :/ for the second solution , when I remove the quotes from the Code Review side , and I return to the Designer , I don't find it , and it demand to re-save the workflow . — AdnaneBt 58 secs ago
 
And can someone who's actually proficient in React JS double check whether this question contains valid code or not?
 
11:03 AM
Monking
 
11:17 AM
@Mast { get(url} Makes no sense
Other than that } it looks ok
 
11:48 AM
0
Q: How to apply Python generators to finding min and max values?

Denis ShvetsovI'm solving yet another problem in HackerRank (https://www.hackerrank.com/challenges/determining-dna-health/problem). In short: you are given 2 arrays (genes and health), one of which have a 'gene' name, and the other - 'gene' weight (aka health). You then given a bunch of strings, each containin...

 
11:59 AM
Greetings, Programs.
 
Greetings, @Donald.McLean
 
Greetings user.
 
Greetings
 
12:22 PM
@Zeta is xdg-open even cross-distro compatible?
 
No idea, to be honest.
It's installed on Ubuntu by default, and probably also on Debian (as long as you have a desktop installed).
Ironically, I'm currently on Windows.
 
12:36 PM
400 is a value. 400 is how we display that value in decimal. You are looking for opcodes, not the literal string cmp xxx, immediate. Chances are there isn't even a cmp. More like just a dec, followed by a conditional jump (jz or jnz). If that has you stumbling, stop doing whatever you were trying to do. You will break things. Post your code at Code Review, and have someone optimize it, to help you regain your lost time. — IInspectable 1 min ago
 
18 items in the CV queue. Can someone please kill that beast?
I've 0 open.
Open, left, available, etc.
 
@Vogel612 Apparently I need it to run Chromium on Arch
 
16 in the queue. It's working :-)
 
 
1 hour later…
1:41 PM
I’m voting to close this question because this question belongs on (CodeReview)[codereview.stackexchange.com/] another site in the Stack Exchange network. — AndrewL64 19 secs ago
I am agreeing with @AndrewL64. This is definitly a question that belongs to Code Review. — Harald 36 secs ago
 
-1
Q: Nested try/catch blocks

kyrillI have recently encountered the classical problem of nested try/catch blocks in Python: def enum_value(enum_cls: enum.Enum, member_or_name_or_value): """ :param enum_cls: enum class for which to obtain value of a member :param member_or_name_or_value: if this argument is either: - ...

 
@AndrewL64 Unfortunately, this question would be off-topic on CodeReview, as it doesn't provide enough context on the actual code. For more information, see the migration guide or the on-topic section. — Zeta 24 secs ago
 
2:02 PM
@CaptainObvious Lot of work, but wrong site.
 
2:36 PM
Questions like this are generally better placed in codereview.stackexchange.commloning 9 secs ago
 
@Mast Any more coffins you need nailed? What is working?
 
2:53 PM
@pacmaninbw Telling people to get their ass in the queue, lol
15 in it now.
 
I only had 5 when I went into the queue. I don't have any now.
 
-1
Q: Node.js ws server: global or local functions?

Eli TheHumanI'm working on a Node.js chat app project using the ws library. I have it up and running but I'm still making improvements and adding stuff like authentication, etc. Before I get too far, I am wondering what the best functional approach to handling messages (and other events) is. For example, rig...

 
3:11 PM
Many Greetings, colleagues
 
3:36 PM
@pacmaninbw There's still 16 left, so I guess it's just a matter of more people.
After all, it takes more than 1 vote to get it out of the queue again.
@SᴀᴍOnᴇᴌᴀ Monking to you too
 
first question I see in the queue makes me wonder why it's got four close votes...
I mean ... it's badly written, but it's not off-topic IMO
 
@Vogel612 bad link
 
fixed
 
I was influenced by this comment:
Your code is full of black boxes. FE, all these UnitOfWork and the classes you store. That makes a good review impossible. — Gert Arnold 2 days ago
@Vogel612 Is that ^^ not a valid concern, enough to make it off-topic?
 
3:58 PM
while it's a valid concern, it doesn't disqualify the question completely
 
@Mast thanks for your comment here:
I’m voting to close this question because it poses a specific question, there is no request for review. Please take a look at the help center. — Mast 2 days ago
I had a similar sentiment except the OP included this text: "If it is not is there any way to improve it?"
 
@Vogel612 We've closed and kept open other questions for the same reasons. I hate the reason cause it changes so much day to day.
 
@Peilonrayz I'm contemplating removing my comment since 1. the title has been updated and 2. that statement about the consensus likely isn't accurate
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of CR: Asking Questions for guidance on writing good question titles. Also, while it isn't exactly a mirror scenario the consensus is that questions about the complexity of code are off-topicSᴀᴍ Onᴇᴌᴀ May 28 at 21:25
 
@SᴀᴍOnᴇᴌᴀ Is that meant to be an at or a reply? Because if it's a reply I edited the source comment to be clear I'm not talking about that question.
 
@Peilonrayz I replied to your message because it seemed related - mostly about the close reason
 
4:10 PM
To me they're totally different. One's a clothes line with a ridiculous amount of slack, where the other's unclear if we want a clothes line or not.
 
@Vogel612 It's missing review context.
But possibly that can be alleviated by more accompanying explanation too.
If someone decides it's worthy of the effort and fixes it up, I may reconsider my vote. But for now, the question is all over the place yet not in a good one.
Left a comment. Possibly as unclear as the question itself, but it should trigger a response with hopefully helpful information. If anyone disagrees with it, I'll see it in the morning.
 
4:38 PM
0
Q: This service submits an application to a 3rd party API and returns a URL to redirect to. It does too many things. How can I refactor it?

Robert CaloveA user applies for a lease for a car and on approval, can submit the car they want to buy. The service is consumed like so in the controller one layer above: $application = constructApplication(); $service->sendApplication($application); $url = $service->sendCart($application); redirectToUrl($ur...

 
@Peilonrayz I got the princess metaphor last week but this one is a little more challenging...
3
 
@SᴀᴍOnᴇᴌᴀ Not sure how to better explain it. Clothes line = line where things become off-topic. The first one my make more sense if you imagine it in storm, cause it swings all over the place.
 
 
1 hour later…
5:50 PM
0
Q: Feedback on simple Merge algorithm

RohitGI am writing a simple merge algorithm in Haskell. I wanted to add simple logging, hence am using the Writer Monad to include logging. type ArrayWithLogging a = WriterT [String] Identity [a] merge :: (Show a, Ord a) => ArrayWithLogging a -> ArrayWithLogging a -> ArrayWithLogging a merge al bl = ...

0
Q: Increase speed of global calculations of light under climate change using Dask

Trond KristiansenI am implementing an algorithm for estimating light at the ocean surface as a function of wind (waves, surface roughness), chlorophyll, and zenith angle. I want to do this using climate projections from CMIP6 as input for the period 1950-2100 on a monthly basis. I use Python and Jupyter notebook ...

 
SE is switching to CommonMark.
 
why am I even using macOS at this point!
neither Valgrind works, not Address sanitiser (google + llvm), neither gperftools-heap-profiler.
@DerKommissar oh hi!
back to angry.
 
@ankii I don't use any of that but I use my Mac more than any of my PC's lol
 
@DerKommissar for development ?
 
5:59 PM
I bet it's much better for email checking
 
I do both /shrug
 
lol
 
Little Snitch is whining about an update or I'd screenshot.
 
I use Lulu
 
Oh wait I can minimize it
 
6:00 PM
then I came to know that a stupid unarchiver also phones home
and a screen-darkening utility too
and Firefox too
 
back to GitHub for a searching better memory leak detector
now that the code is small, I can find where the problem is. Later on, I need something that I can rely on.
 
This migration won't enable header IDs. This migration is already a big thing so we don't want to conflate adding new features with running the migration itself. Both, markdown-it and markdig support header IDs via plugins so implementing this feature will now be easier than before - but it remains a different discussion. — Ham Vocke ♦ 6 hours ago
Wow, we can hold out hope :O
 
@ankii ^^^
I had to do some serious downsizing on that because Imgur is dumb
 
@DerKommissar I have several things to say
;)
 
6:10 PM
Yeah? Lol
 
- I have removed my name from the top bar since no-one else uses it
- I am too illiterate to understand the console + postgres thing
just toying around C++ still
 
I was building a thing in Python using Postgres. :)
 
- you have the full suite of tools by the makers of pycharm!
 
- you use top as a live watch for stuff ?! for me, activity monitor is great. It stays on all the time & shows cpu usage in the dock
- how big is this screen ?
 
6:13 PM
It's the 5k retina
I scaled the screenshot to 50%
It's 27" IIRC
 
mine doesnt even flinch if I change 720p to 1080p.. it's the same (1400x900)
 
@ankii ^^^
 
yes, I guess we've talked about it
lastly, - I have 0 unread emails :)
 
Lmfao Gmail never gets that way for me
I was presenting on a conference call with a startup I was working with and the guy said "holy crap, do you read your email?"
 
stop giving every site your email address (:
I use an outlook account which is in no way associated to me (not even my phone number )
well except the Ip address
 
6:29 PM
Nothing against you or your question, it just isn't the right spot for it at all. If you want some help looking at your code, try codereview.stackexchange.comCireo 21 secs ago
 
1
Q: Outputting the Manufacturer ID of a processor using CPUID with inline ASM

CarcigenicateThis outputs the manufacturer string associated with your CPU using the CPUID instruction. I wrote this up for a homework assignment, then found out that I didn't need to. When run on my (virtual) machine, I get the following output: EAX: 16 EBX: 756e6547 ECX: 6c65746e EDX: 49656e69 GenuineInt...

 
6:51 PM
@Peilonrayz that would be nice...
 
7:07 PM
@DerKommissar Is that top on the top right, aswell as htop in the bottom left?
Well, two htops in a tmux session, apparently.
 
@Zeta Yeah, the top-right is my iMac top, the bottom left are two servers on the other side of my basement.
Two SSH in tmux.
And the other two are not htop, just top. The difference is they're the Debian 9 top, vs being a Mac top.
 
Ah, I see.
 
Honestly I hate the way the Mac top looks, but I don't get to choose it lol
 
@ankii I've been trying hard to clean up my email and I'm down to about 3,200 unread emails.
 
7:33 PM
@Donald.McLean Personal or business?
 
7:51 PM
0
Q: C - Fast & simple bump allocator

XilpexI recently have been very interested in custom allocators, so I decided to make the very basic (this should be faster than malloc) bump allocator. Here is my code in C: #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <sys/mman.h> #include <unistd.h> #define KB(size) ((size_t...

 
I don't think it should affect testing, as the code should be exercised whether as a result of an if clause or a bit shift. There may be some code coverage tools that are confused by such tricks (especially the second one), but that's why you employ humans, right? I wouldn't say it's arbitrary; if you have a single method with a cyclomatic complexity over, say, 50, that's probably too high and your method is likely doing too much. However, as a code reviewer, if I see a ton of code with tricks like those shown, I'd be making sure the test suite is very comprehensive. — Heretic Monkey 6 secs ago
 
8:11 PM
@Zeta Personal. I have no unreads in my work email.
 
-2
Q: binance macd script in python language

torgny hovedef initialize(state): state.counter = 0 @schedule(interval="1h",symbol="BTCUSDT") if state.counter < 4: state.counter += 1 Else: state.counter = 0 if counter == 4: (every four hours) macd = data.macd(12,26,9) signalLine = macd[‘macd_signal’] - Check if bot has position has_...

0
Q: Cycle through an array of available colors repeatedly

primelfI have an array of colors for my app to choose from. My goal was to have the app cycle through the array of colors, apply it to my object, and reset to the beginning once each color has been used. This is simple enough to implement, but I am looking to see if it's possible to clean it up slightly...

 
8:34 PM
What you are asking for is a code review and you should be asking such questions on the Code Review Stack Exchange Please delete this and ask over there. What topics can I ask about here?Rob 39 secs ago
 
8:45 PM
@Rob Unfortunately, "how to implement X?" questions are off-topic on Code Review. Therefore, the question as-is is off-topic on CodeReview as well. Please see the guide for further information and help users to write an on-topic question if you redirect them to CodeReview. Thanks! — Zeta just now
@Rob it appears there are two questions asked: "_ How can I improve this code to capture each and every click?_" and "How can I improve efficiency?" - The first question implies that the code is not working as intended, which would mean it is not on topic for CR - see the questions on that page - specifically: "To the best of my knowledge, does the code work as intended?" If the code is fixed to work then the second question could be asked on CR... — Sᴀᴍ Onᴇᴌᴀ 11 secs ago
 
@Duga darn excess spaces .... ლ(`ー´ლ)
 
9:01 PM
@SᴀᴍOnᴇᴌᴀ Thanks for backing me up :)
 
9:29 PM
Hello
 
how is everyone doing?
 
9:45 PM
possible answer invalidation by 0f-bajor on question by 0f-bajor: codereview.stackexchange.com/posts/243124/revisions
 
@Malachi not bad... staying busy with work stuff... weather here in OR is getting nice
@Duga it's okay- OP added sample data per request of @Peilonrayz:
Please can you provide a couple of lines of the CSV so we can better understand the structure. This can help you get better feedback. — Peilonrayz 2 days ago
 
@SᴀᴍOnᴇᴌᴀ Ah, ty. Ima clean that up
 
10:01 PM
@SᴀᴍOnᴇᴌᴀ Weather here in MN is pretty nice right now too
 
I have not. Github or Bitbucket? I haven't looked at my Github in a while, my team finally got the Green light to work on Automation at work! I am so happy!
@SᴀᴍOnᴇᴌᴀ does it work?
I haven't used that extension in a while. I am trying to move over to Brave (Chrome-like browser where I get paid for viewing advertisements)
I haven't loaded up that extension there yet
 
@Malachi it works for me in Chrome on MacOS
@Malachi nice
 
looks good I will get it merged in. maybe I will get to install it this week
I am on a Week Long Furlough this week
I have 5 days each month that I won't get paid for until October.
 
I'm downloading Brave now
when I saw the image still of the promo video I thought the guy was going to do some kool matrix move
 
10:20 PM
lol
it also has a built in Ad Blocker
so you have to learn how to turn it off if you want to support ads on certain sites, but it is easier than most of the ad blockers I use on Chrome
@SᴀᴍOnᴇᴌᴀ can I not approve and merge from Github website?
never mind, I found it...lol
 
I would believe you should be able to unless there are conflicts...
okay good
I just tried using it in Brave and it works for me
 
I don't do that action in Github often
 
I do it for work repos but I haven't had any PRs from people outside my organization
 
possible answer invalidation by Denis Shvetsov on question by Denis Shvetsov: codereview.stackexchange.com/posts/243217/revisions
 
@SᴀᴍOnᴇᴌᴀ what is your username, I will add you as a contributor on that project
sorry, collaborator
 
10:26 PM
github.com/aelliott1485 - there should be a link to it from my PR
TY
 
had to figure that out too...lol
we use Bitbucket at work
and I have my Asteroid Assault game on my private Bitbucket
 
so I don't know my way around github like I used to
you should get an invite now
 
I've been planning to extend Simon's Code-Q2A script with GH style commenting
@Malachi invitation accepted
 
10:31 PM
@RMunroe ಠ_ಠ okay....?
 
LOL
catch you guys later I have to finish what I set out to do when I sat down....buy an electric lawnmower from Home Depot
 
peace out
@Malachi are you considering anything like @DerKommissar 's ryobi?
 
@SᴀᴍOnᴇᴌᴀ yeah, I think the exact same model
I am looking for HD coupons right now
or discount codes
My wife got me a 40v trimmer thing for father's day
it is one where I can change the extension
 
11:06 PM
I have the same one.
(The trimmer, I mean.)
 
11:20 PM
I am getting the lawnmower you got too...lol
 
great minds....
 

« first day (2585 days earlier)      last day (1415 days later) »