« first day (2622 days earlier)      last day (1410 days later) » 

12:02 AM
RELOAD! There are 6808 unanswered questions (89.8675% answered)
 
0
Q: Better way to assign value to variables depending on where it is present

dragonsI have a below code in which I am repeating few things so I wanted to see if I can write it in a better way if possible? In my below code I assigned value to two variables by first looking at what we have in dictionary and if nothing is there in dictionary then I assigned it default way. As of no...

 
12:20 AM
possible answer invalidation by Sᴀᴍ Onᴇᴌᴀ on question by Steve Ngai: codereview.stackexchange.com/posts/239388/revisions
 
@Duga ಠ_ಠ I didn't modify code in the question... and it is my answer anyway...
 
 
1 hour later…
1:36 AM
Assuming your current code is 100% working, Code Review is probably a better place to post. — John 6 secs ago
I’m voting to close this question because it is about improving working code. Code Review was created specifically for this sort of question. — Ken White 53 secs ago
 
0
Q: Navigating out of a TextField in GridPane using the arrow keys in JavaFX

a pI am making a sodoku solver program in Java with the JavaFX library. The program incorporates an interactive sodoku board consisting of a series of TextFields in a GridPane. The board looks like this: Right now, the cursor is in the top left most TextField. If the field had text in it, the user ...

0
Q: Looking at the hill of indents seems like this can be improved

user227321I've spent some time on this as an answer elsewhere, and did my best to optimize it. But looking at the hill of indents seems like this can be improved. I've tried to implement an any() statement to replace the for break part, without any luck. Does anyone have any suggestions? Groups = [[['NM1',...

 
Sorry I posted in the wrong place I’ll post it in code review — NiteRyder 52 secs ago
This might be better suited for Code Review. — Lambda Fairy 43 secs ago
 
2:12 AM
I did post it on code review, but unfortunately got little attention, so crossposting to a bigger audience... — Gust just now
 
 
2 hours later…
4:04 AM
This might be better suited for codereview.stackexchange.comchris 1 min ago
 
 
1 hour later…
5:31 AM
Monking
 
I’m voting to close this question because it was cross-posted from Code Review, where it actually fits better. — Mark Seemann 20 secs ago
 
 
2 hours later…
7:50 AM
 
8:11 AM
1
Q: Google People PHP best practise to get OOP

ČamoI need to log in users to web app in Javascript and PHP. So I have Javascript interface which send me accessToken to PHP which stores users data to DB and log user in. But the result code does not look like OOP but like a peace of garbage. May be I dont know how to write that code, so the questio...

 
8:45 AM
Monking
 
9:05 AM
@SᴀᴍOnᴇᴌᴀ Me thinks it has something to do with the tags, they went from default highlighting to something JS / CSS. Strange since the code is a snippet but, eh
 
9:49 AM
0
Q: New to C#. Looking for better way to write same program

NiteRyderI am new to programming and have been taking the time to learn C# by reading, doing some classes online for Unity, and using Youtube. I think you learn more from doing your own projects so I decided to write a program that asked the user to enter a movie they have not seen and then store the movi...

 
10:37 AM
0
Q: Should I unpack a Maybe with maybe or pass value around

smwhrI'm beginning (for the third time in 5 years) to learn Haskell and decided to do a "More or less" console game (game pick a random number, you then have to guess which). First the code, then my question : import System.Random import Text.Read(readMaybe) main :: IO () main = do gen <- getStd...

 
 
1 hour later…
11:48 AM
@Mast Thank you.
 
11:58 AM
@CaptainObvious Maybe
Maybe either, maybe both.
Maybe neither.
> I'm beginning (for the third time in 5 years) to learn Haskell
Now that sounds familiar. I have a list of projects that go like that.
 
12:13 PM
Maybe it's a good thing I don't want to be a data scientist.
 
@Mast That's how I feel when asking "Will this Python 3.10 PR add Maybe support?"
 
1:16 PM
Welcome to Stack Overflow. Reviews of working code belong on codereview.stackexchange.com. That community is focused on commenting on this sort of problem. — bad_coder 55 secs ago
 
1:52 PM
0
Q: proper way to search an image within another image

Fede KindredThe following code correctly finds an image, however, only the partial/cropped one. Let me be more clear, I took a screenshot of an image, cropped it and putted it on the desktop. Then I saved the actual original image in full size (not cropped) on desktop as well. When I run the code, it correct...

 
2:12 PM
posted on July 08, 2020 by CommitStrip

 
0
Q: i need to use count in select coulmn but when load a lot number row slow run query i looking way tune

Mohammad SafyarI need to use count in a select column but when the query loads, a lot number row slow run query. I'm looking for a way to improve this view. CREATE VIEW [dbo].[doc_vwDraftInstancesFolder] AS SELECT instances.* , drafts.AttachmentCount AS [DraftAttachmentCount] , drafts....

1
Q: Permutations in C

machine_1I searched on the internet for an algorithm for permutations in C and I found the following function: void permute(char *a, int l, int r) { int i; if (l == r) printf("%s\n", a); else { for (i = l; i <= r; i++) { swap((a + l), (a + i)); ...

 
Ryan Donovan on July 08, 2020
Many developers write software that’s performance sensitive. After all, that’s one of the major reasons why we still pick C or C++ language these days. When done right, supplementing C or C++ code with vector intrinsics is exceptionally good for performance.
 
3:06 PM
0
Q: emplace_back on multiple vectors

YamahariSuppose we have a datatype like this std::tuple<std::vector<T>, std::vector<U>> I want to create a function that forwards a set of arguments for each vector to the respective emplace_back function and I ended up with something like this (Note: need C++20 for emplace_back on POD) (https://godbolt...

0
Q: TypeScript Express.js proxy server overall design and structure

MauricioRobayoI have built a Express.js proxy server using TypeScript to be able to hide my front-end API keys. I designed it to be able to include multiple API services and to reject connections that are not from allowed domains. It is working as expected, but I'm new to TypeScript and wanted to get some feed...

 
cf. this, this, this, and this. the "shrinking domain" aspect of it doesn't apply but the "n nested loops" does. (also, more directly related, this). that's what Haskell's replicateM n digits is doing: it creates n nested loops for d1 in digits: for d2 in digits: ... for dn in digits: yield [d1,d2,...,dn]. — Will Ness 5 secs ago
 
Monking
We got another suggestion about the modal for new users last week:
1
A: Let's update the modal for new askers

user673679Re. the original modal dialog: I think most users will immediately close a box entitled "Asking a good question" followed by a bunch of waffley text. Ain't nobody got time for that. That useless bold title and the text below it need to go away, and the important things (the bullet points) need to...

I'm contemplating how much I agree with it/ my thoughts about it
 
3:43 PM
@SᴀᴍOnᴇᴌᴀ Lol, and it goes off-line when I give it a click. IIRC the suggestions are wordy, and one of the bullet points is about inline code which we haven't had a real problem with for years
 
okay I think it is back online
 
0
Q: C# Better structure in my code & any other critiques

Philip PolAny advice on how to make this code; cleaner, more effective, just overall better! Program creates a 'post' in the console. The post has a: message create on date score for 'upvotes' and 'downvotes' Users are able to upvote or downvote the post using upvote or downvote with a simple trim and to...

 
4:05 PM
You might get better answers at Code Review. — hmm 56 secs ago
 
@SᴀᴍOnᴇᴌᴀ Ah, comment = posted
 
You may want to try asking on Code Review. Please read What topics can I ask about here?. — user 8 secs ago
 
Monkin
 
0
Q: Reduce an X/Y Value to an Index In a 1D array and Return the Array Value

KECGInitially, this is not an attempt at early optimization, though it's thoroughly possible I'm looking in the wrong place :). The following function returns a height value for aliased columns in a kind of voxel-style height-map renderer. It is called many, many times for both AI and player controll...

 
4:20 PM
@SᴀᴍOnᴇᴌᴀ www.youtube.com/channel/UC1DTYW241WD64ah5BFWn4JA
 
@ankii IIRC http(s):// is required because we're a programming community and A.B.C is pretty commonly not a URL.
 
pretty.com
right
@DerKommissar it's the other chat client that behaves like this.. ^_^'
 
Please refer codereview.stackexchange.com/help/dont-ask for questions to not ask. Just to guide you right - softwareengineering.stackexchange.com may help. — krohit just now
 
4:41 PM
I’m voting to close this question because it belongs on codereview.stackexchange.com. — JosefZ 45 secs ago
 
@ankii I took inspiration from the muppet Sal Minella
 
5:23 PM
I agree with @roganjosh, this might be better suited to softwareengineering.stackexchange.com or codereview.stackexchange.comjfaccioni 38 secs ago
 
0
Q: Primiitve calculator

imgeek_So, the problem task is: Given an integer 𝑛, compute the minimum number of operations(+1, x2, x3) needed to obtain the number 𝑛 starting from the number 1. I did this using this code: #include<iostream> #include<algorithm> #include<vector> using namespace std; int main() { int n; cin >>...

 
5:56 PM
1
Q: Refresh the List box with new rooms from the server every 3 seconds

tameer kenaanSo i have a server which I send a Request to and it sends me back a list of rooms,Now i made a window for joining rooms and I'm trying to refresh it every 3 seconds but when i use the Timer thread to refresh the list it doesn't work if I use the normal refresh method with the Timer it works just ...

 
Since there's nothing wrong here, perhaps this question belongs on codereview.stackexchange.comWyck 17 secs ago
@Wyck when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". In the current form the code above would likely be closed as off-topic because it is missing context (e.g. names is undefined). — Sᴀᴍ Onᴇᴌᴀ 52 secs ago
 
6:29 PM
@B001ᛦ I assume OP intends for this to be a code review question, which 1) should be on Code Review instead of SO and 2) should be included as part of the question, not be posted as an answer :/ — Moira 19 secs ago
I’m voting to close this question because this is a code review request and would rather belong on Code Review. (This wouldn't be a good fit there either in its current form; please don't post additional information as an answer to your question, instead consider editing the question.) — Moira 8 secs ago
 
@Duga I like the avatar - Salem is one of my favorite characters from 1990s TV shows
 
7:09 PM
-1
Q: Optimize Compare and Remove Values in Stack with Kotlin

Adam HurwitzWhat is the most performant strategy to implement a stack in Kotlin to compare and delete values? Expect Create a stack in order to compare an array of asteroids (ASTs) and handle collisions (deletions), returning the final array of ASTs after collisions. Each AST moves at the same speed Negativ...

0
Q: No hardcoded path

Syxssince i develop in Java, i got into the habit of not putting hardcoded text in my code. For paths to files and folders I use the code below. I did it in a way that it was easy to set up and quick to understand, but i want to know if there are any solution more clean to do the same work ? A lib ju...

 
7:44 PM
Sorry @DanielLopez I'm not quite sure what you mean, but I meant that you could just forget about q1 and q2 etc and just use arrays instead. But that depends on what direction you're going with this so do whatever you think. If you're looking for solid advice on quality code, try posting on Code Review — Jaden Baptista 52 secs ago
 
7:57 PM
I think this question should be posted on codereview.stackexchange.com. Improve code that you wrote or maintain, through peer review. Your question must contain code that is already working correctly, and the relevant code sections must be embedded in the question. Please avoid stripping out key details that may be relevant to the review. If your code is incomplete or not working, you should ask for help on another site. You may wish to mention specific concerns: performance, security issues, etc. — rsjaffe 59 secs ago
codereview might be a better platform for your question. — lovelace 26 secs ago
Mmm, I don't think this is the right place to post this question. Have a look at codereview.stackexchange.comRonald 39 secs ago
Even on Code Review, this won't fly. You'll need to post code directly in your question and ask about one codebase at a time. Please make sure to take their tour and read their How To Ask page before posting. — Chris 28 secs ago
 
8:22 PM
0
Q: What is the common API endpoint architecture in backends?

TZieburaHey I always used to create some pretty messy endpoints and I decided that it's about time to start writing cleaner code, I'll provide an example of how would I design an endpoint and I'll be thankful for any insights why is it good or bad practice to do it like this also I'd be more than happy ...

 
Probably not @lovelace as code review requires that code be working and not prototyped. — Dave 25 secs ago
 
8:47 PM
0
Q: Combinatorics challenge solved it Python

kharandziukThe easiest way to explain this problem is to show these two test cases: assert solution('ABC') == ['A', 'B', 'C', 'AB', 'AC', 'BC', 'ABC'] assert solution('ABCD') == ['A', 'B', 'C', 'D', 'AB', 'AC', 'AD', 'BC', 'BD', 'CD', 'ABC', 'ABD', 'ACD', 'BCD', 'ABCD'] my solution is below: def subsoluti...

 
@SᴀᴍOnᴇᴌᴀ does it need the hammer?
 
@pacmaninbw ಠ_ಠ no....that was an SO post... deleted now
 
darn... I was trying to get my custom mac keyboard shortcut to work - didn't go through the first time when I hit the enter key
 
9:11 PM
 
@pacmaninbw I got to jam yesterday with some guys and we played the Beatles song Hey Bulldog :)
 
9:38 PM
There's no answer to this. You need as many as you need. That said, the scope of your variables may (or may not) be optimal, but who knows; can't see any code. (And code review requests belong on the Code Review SE.) — Dave Newton 11 secs ago
 
 
1 hour later…
11:03 PM
Good thing I'm not already prone to overthinking everyday decisions!
2
 
11:56 PM
@RMunroe I can't help but think of this one from March 4th
Mar 4 at 21:48, by RMunroe
Turns out I've been "practicing social distancing" for years without even realizing it was a thing!
 

« first day (2622 days earlier)      last day (1410 days later) »