« first day (1923 days earlier)      last day (2095 days later) » 

12:00 AM
RELOAD! There are 5466 unanswered questions (89.9822% answered)
 
12:17 AM
I don't understand your question. "hacky" and "refine this even further" are opinions. If the code works, use it. If you want a code review on code you've written, use Code Review, but read Be careful when recommending Code Review to askers first. — Heretic Monkey 27 secs ago
 
@202_accepted aaanyway this cake is great, it's so delicious and moist
 
12:38 AM
@Vogel612 I don't know any more of the song. :(
 
12:50 AM
0
Q: flatten an array in python

NinjaGI would like to get some code review for my recursive implementation of python flatten array method. Write a piece of functioning code that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. I'm particularly...

 
@202_accepted This was a triumph
 
1:14 AM
@hoffmale oh yeah
 
I'm making a note here: HUGE SUCCESS.
 
0
Q: Sieve of Eratosthenes in Python

Koray TugayAny suggestions are highly appreciated. I am a beginner in Python. upper_bound = 50 def remove_non_primes(list_of_ints, prime_to_check_against): only_primes = list() for i in range(len(list_of_ints)): if list_of_ints[i] % prime_to_check_against != 0: only_primes.appe...

 
1:34 AM
I've ran short of podcasts to listen to. Can anyone suggest a tech/security/IT podcast that they enjoy? Prefer recurring podcasts rather than series, but open to either. PS: Already listen to @SmashinSecurity & @cyberwirestudio both of which I highly recommend!
If anyone thinks of something please let me know :)
 
2:15 AM
I'm voting to close this question as off-topic because it is about optimizing working code and therefore is more suitable for Code ReviewKen White 39 secs ago
 
3:05 AM
0
Q: Fit text in a textarea with textarea or div with contenteditable

SeaBassAfter a lot of testing I've reached this solution to fit text into an editable container with automatic height. I started with a textarea and javascript but it got extremely slow on hundreds of textareas so I switched to div with contenteditable, css and some js. My main issue was that firefox i...

 
 
1 hour later…
4:13 AM
Monking
 
0
Q: I need help optimizing my regex engine for use with fast disassembly

PSP CODERhow can i speed up the function regexEngine as on my machine it takes 7 to 10 seconds (depending on the format string) to do 2545 iterations wich is bad (it takes around 2 seconds without the function) (full code minimal example), as im trying to find an alternative to using a bit mask since thos...

 
5:34 AM
Monking
 
0
Q: Libgit2 commit file multiple times

PSP CODERhow do i get commit to work AFTER the initial commit using libgit2 as i have checked out and tried all of the other posts related to implimenting git commit using libgit2 (on stackoverflow) but all of them seem to fail with either SIGSEGV On the commit or give "error: Could not create the initial...

 
@hoffmale Definitely.
The shorter version of that was on DEF CON 22.
Basically, if you want to break in somewhere, use the elevator.
You know how in SSH world you should always protect your keys? In elevator world, the form and keying of the keys gets printed in manuals.
> Thou elevator shalt be able to be overridden by key this and so.
 
6:05 AM
0
Q: Replacing an XmlNode in NodeList

Peter SWe had a really messy method that created a memory leak and used to process an XML file with 300 entries and around 5 GB of memory. I have rewritten the function and I'm currently only unsure about the reading of the XmlNode to the NodeList. while (!dsNav.EOF) { XmlNode schlussrechnung = dsN...

 
6:20 AM
0
Q: Viewadapter with viewholder and async task

ShadowFlameI'm writing a small mobile app, foremost for myself and a few other people, but it won't probably get a huge userbase(but one never knows). I do want a clean architecture though, so here is my code for review I have a Recyclerview containing a line for every ingredient entered into the system. T...

 
That’s question to choose LinQ or SP will not answer for your performance. It depends on your skillsets about LinQ or SP, we good at SP the performance is good, same we are good at LinQ. With many right way to do the performance is similar. I prefer LinQ with EF core in the web application for code structure and good to have a code review with everything in code. For SP for big data stuffs. — ocrenaka 57 secs ago
 
6:49 AM
@Mast I already know this one :)
 
0
Q: Is this a good way of retrying operations using recursion?

Sudip BhandariThis is in context of a springboot application. I considered using Spring @Retryable too but found that it didn't work with function with return types. Is this approach considered good? public String getResource(String id, int retries,String url) throws InterruptedException{ if (retries=...

 
7:05 AM
0
Q: Retrieving OS Platform .NET Core

AndrewEI'm retrieving the operating system platform with .NET Core with system.runtime.interopservicesI have created the code below and was wondering if there was a way that I could use a switch statement rather than the if statement for determining which platform is in use. /// <summary> /// Operating...

 
Monking
 
7:20 AM
0
Q: How establish auto previous connection after server down in socket?

Ferdous AhmedI am doing one socket programming in java. If server socket is down for a while then start again after that the server can get auto connection with the client which connect with previously.If possible can any one help me how to handle the Exception?

 
7:32 AM
@202_accepted Did you partly shutdown SESE? Whenever I select a site, I get a runtime error. For example: CR
> Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
 
0
Q: Reserve a linked list

Giladusing Microsoft.VisualStudio.TestTools.UnitTesting; namespace LinkedListQuestions { [TestClass] public class ReverseLinkedList { [TestMethod] public void ReservseLinkedListTest() { Node<int> head = new Node<int>(); Node<int> two = new Node

 
8:07 AM
This question probably belongs on https://codereview.stackexchange.comHintham 7 secs ago
@Hintham Unfortunately, as it currently contains only example code, it's off-topic on Code Review. CR expects a complete, working implementation. See also codereview.meta.stackexchange.com/questions/5777/…Zeta 42 secs ago
 
0
Q: How to change a like button after clicking using jquery?

reza hooshyarrI'm trying to make a like and dislike system. everything works very well, a user can't like a post twice and they just can like or dislike a post, not both. my problem is in jquery part. I want to change the button values when a user clicks on them but right now when the user click on like button...

 
8:29 AM
Regardless, your question doesn't really have a clear problem statement - if the code is already working, if you want somewhat opinion-based answers on how it might be formulated better, it would be more suited to codereview than here — CertainPerformance 11 secs ago
possible answer invalidation by Flamefire on question by Flamefire: codereview.stackexchange.com/posts/201209/revisions
 
@Duga Can a person have a look at it? I don't even know if it invalidates bipll answer or not.
 
8:44 AM
@MathiasEttinger Could rule out invalidation, so rolled it back.
 
@MathiasEttinger Doesn't invalidate either answer. as papagaga say's that filter_helper method is too complicated either way and bipll is mostly concerned about namespaces.
@Mast You were able to rule out invalidation and still rolled back?
 
Ugh.
Typo.
@Zeta That should've been couldn't.
Since filter was named but not really reviewed, it's a bit iffy.
Current policy as I understand it, is to rollback even when in doubt. The standard comment doesn't even mention invalidation as an issue. It mentions it's against Q&A style.
> Please do not update the code in your question to incorporate feedback from answers, doing so goes against the Question + Answer style of Code Review. This is not a forum where you should keep the most updated version in your question. Please see what you may and may not do after receiving answers.
Please do not update the code in your question to incorporate feedback from answers, doing so goes against the Question + Answer style of Code Review. This is not a forum where you should keep the most updated version in your question. Please see *[what you may and may not do after receiving answers](//codereview.meta.stackexchange.com/a/1765)*.
21
A: Frequently Posted Comments

Simon ForsbergThis is intended as a ready copy & paste version for including in the Auto-Comments script. The Auto Comments script also has support for a "remote" feature where you can use this URL: http://www.zomis.net/codereview/auto-comments ###[Q] Broken Code I'm afraid this question does not match what ...

 
I'm aware of the FPCs. Still, OP didn't incorporate any feedback from the answers, they just found out that they can skip the template specialization for <true, …> since the <false, …> is enough. That should have been a self-answer, though, not an edit.
 
@hoffmale that's from the first verse. the continuation I have there is "Look at me still talking, when there's science to do"
Monking
 
@Zeta Oh, right, didn't read long enough to see the <false, …> specialization, so couldn't make sense of the edit…
 
9:05 AM
0
Q: Generate cryptographically strong random string of characters

StianThe method below is returning a string of random characters using RNGCryptoServiceProvider. The return string result is built by picking characters from the string chars by applying % chars.length on the values from GetBytes(). As I understand, this will favour some characters over others, depe...

 
9:16 AM
does this belong on codereview.stackexchange.com? — Joel Berkeley 1 min ago
Thank you, I was more looking for such an answer actually, not a code review. Since the day I asked, I suceeded creating my entries in my DB by limitating the in flight requests at a time. It works perfectly. Thank you for explanation and the links — Benjamin D. 39 secs ago
 
0
Q: Password field based on peewee ORM framework

Richard NeumannI implemented a password field based on the peewee framework to handle passwords of accounts in web applications for Python 3.4. My goals were Secure hashing, no plain password leakage. Easy password verification. And this is what I came up with: peeweeplus.passwd: """Argon2-based password...

 
working code is better for codeReview — apple apple 19 secs ago
 
9:35 AM
0
Q: Working with Array [C#]

Kacper Weremaplease review my code. It works as it should but I think about making it more pretty or optimal. This method should take in some IEnumerable of Rules, current number of adults and array of ints, where each int is age of child. We want to check each rule if we can identify child as some type of En...

 
9:48 AM
Request for close votes: this can be dupe closed to this
 
@Mast Why? Sounds like a followup at a glance
Oh, didn't see the first one was "broken" code to start with and don't have any answers.
Whoa!!!!
First time using my gold hammer!
Didn't expect it.
 
@MathiasEttinger The second is a follow-up, yes. If a follow-up is placed before the initial question gets a review, there's no point in reviewing the first version. It's actually quite harmful if the initial version attracts another review instead of the reviewer being redirected to the 2nd question to begin with. So the first question gets closed as dupe.
13
Q: Process to follow when un-answered questions have a follow-on

rolflThis question was asked a couple of weeks ago, and has not been answered in that time. It has languised: https://codereview.stackexchange.com/questions/79233/edmonds-karp-algorithm-for-maximum-flow-in-java In the interim, the question asker has updated their code substantially, and posted the re...

 
10:16 AM
@JoelBerkeley it dose not belong to codereview — shishir kumar 19 secs ago
 
0
Q: Slider that increased center slide width. (Slider plugin suggestions)

Sameera LiyanageI wanted to create slider when it slide center slide width must have incresed and the two slide next to it stay on normal slide. I have tried one using slick slider. Here is the code pen link that I have tried. But this is not smooth and slide next to center slide not showing properly. If any...

 
Monking
 
11:02 AM
@Mast No it's just broke, haven't had time to investigate.
 
0
Q: Updated Minesweeper library for any GUI

JamA minesweeper library in C#. Can be included in any GUI stack. It is an update to Minesweeper library for any GUI. I have done many updates with regards to the answer. Three sections: Game, Board and Tile. Then a unit test class: GameTest Game public enum GameState { NotStarted, Start...

 
@202_accepted Unfortunate. I don't use it often, but when I do, it's mighty useful.
 
Yeah, I want to look at it this weekend. Good news is the application is still collecting data.
 
11:18 AM
Good news indeed.
 
@Vogel612 Mentioned something a week or two ago as well
 
might even be longer.
 
-1
Q: Splitting and copying text by keywords Python

sssseossssthe specific question as I cannot find elsewhere: How to split the text by keywords (list of keywords e.g. 'from:','to:' etc.) to copy the text from beginning of one keyword to the beginning of another keyword. Language Python. Many thanks!

0
Q: Memory Game using Tkinter/Pygame

ZacharyI'm very new to python and programming in general. For a school assignment, I made this Memory Game and would love to receive feedback from you guys. import tkinter as tk # imports tkinter as tk from tkinter import font as tkfont # imports font as tkfont import random # imports random import...

0
Q: Confusion about Java object types

Ikenna OsakweI'm trying to find the smallest integer greater than 0 that is not in a given list. For some reason, this code outputs 1, because java thinks 1 and "smallest" are different values. Can somebody please explain to me why so? public static void main(String[] args) { int [] A= {1,2,3}; int smallest...

 
@Vogel612 I promise it's still on the list. :)
 
no worries, I got my own fancy analytics now :)
 
11:27 AM
Aye, which is why I considered shutting the service down even.
As soon as Stack Exchange has a proper competitor I'm going to burn it to the ground.
 
@Vogel612 Got a link with that?
 
lol
 
0
Q: UDP Reverse Shell

KyoI'm currently learning python / network programming altogether and coded this simple python reverse shell; I would like to hear any remarks from you regarding code structure, any common beginner mistake, actually pretty much anything that feels wrong with my code. The code is pretty straightforw...

 
Guess I got to fix that first.
 
11:36 AM
yea, you definitely should ;)
 
@Vogel612 Oddly enough I get a 404 page on that. A 403 would've made more sense.
 
Nah, they don't even want you to know it exists.
So 404 is a more appropriate response.
"Security by obscurity."
 
48
Q: Why is duckduckgo.com listed as referrer rather than search engine on analytics page?

Joe MurrayWhile exploring the moderator page /admin/analytics for the first time I see Google is the only search engine listed, and among the three referrers is duckduckgo.com at 15% of our traffic. Shouldn't it be listed as a search engine instead?

^^ it's not like that particular URL is unkown or even hard to guess :)
 
@202_accepted I think it's more of a "catch all and give em a 404, who cares about the actual reason".
 
12:06 PM
0
Q: Longest consecutive sequence of ascending, descending, or equal integers. (C++)

BaneGirlGiven an array of integers, find the longest consecutive sequence, where a sequence is defined as being either (strictly) ascending, (strictly) descending, or all-equal. 836926 then has the longest sequence 369, which happens to be ascending. 241455556 has the longest sequence 5555, which happen...

 
it's not the place for that question, use codereview.stackexchange.com in the future — kriss 30 secs ago
 
12:29 PM
If the script works fine, and you want to know what you should improve with it, you should post it on Code Review. But please post the source as text there. 50 lines is not that huge even on SO and will be rather small on CR... Anyway, this is off topic here. — Serge Ballesta 10 secs ago
 
12:48 PM
@Peilonrayz I have no idea what your last comment means, can you develop a bit?
 
@MathiasEttinger The problem you have when passing a str is the same as using the following. Rather than fixing it for a certain type, I'd recommend fixing it for all input.
a = []
a[:] = [[a], [], 2]
flatten(a)
RecursionError
 
0
Q: Passing file identifiers to all subroutines of fortran code

Ather CheemaThe Fortran program 'MAIN' below calls 3 subroutines. 1) It opens a file if it is not present, (overwrites if it is already present). 2) writes something on the file using the file identifier integer and 3) closes the file. program MAIN 2001 FORMAT (A,I10) INTEGER FILEIDS(10) CHA...

 
@Peilonrayz Interesting
Now, how should a be flattened
since a[0][0] == a
Should it be [2] or an equivalent of while True: yield 2?
 
@MathiasEttinger That's down to the user, I'd do either itertools.cycle([2]) or [2]
My problem is you say making things generic is Pythonic, and then proceed to suggest a bespoke fix for str.
 
Yay, good idea… Just borked my system by calling list(itertools.repeat(2)) '-_-
@Peilonrayz Yes because strings are special in the sense that iterating over them gives str back, not char. Handling inherently recursive structures, on the other hand, is harder and has not a natural way of solving it.
As you say, it's down to the user
and probably harder to detect as well
 
1:01 PM
@MathiasEttinger You just need to make a tuple/list/set of the parents to detect it
 
@Peilonrayz How? In your example a[0][0] is a but so is 2 is 2 so [2, [2, [2, 2, [2]], [2], 2]] should trigger the anti-recursion thingy?
 
@MathiasEttinger You can't iterate 2 so it doesn't go in the else
 
Fair point
 
It's not that hard a fix if you opt for the second method:
def flatten(iterable, parents=()):
    try:
        iterator = iter(iterable)
    except TypeError:
        yield iterable
    else:
        for element in iterator:
            if element not in parents:
                yield from flatten(element, parents + (element,))
 
@Peilonrayz This yields surprising results
>>> list(flatten(['abc', ['def']]))
[]
>>> list(flatten(a))
[2, 2]
 
1:08 PM
@MathiasEttinger Yeah to fix for that you can add an else and yield element
@MathiasEttinger Now this I didn't notice
 
Anyway, even though you raise valid points, I often feel that strings being iterables is an unwanted features as I want each string to be treated as a single token and not a container. For instance:
4
Q: Convert a dictionary of iterables into an iterator of dictionaries

Mathias EttingerI have a user-editable dictionary of content used to fill in a string.Template and I wanted to allow the user to fill the same template with several values at once. Using only values, itertools.product would be enough for my needs but I needed dictionaries to fill in a template. I also wanted us...

And I feel this is such a case too.
Flattening inherently recursive structures, on the other hand, is a slippery slope that I don't want to engage in.
"Errors should never pass silently."
 
@MathiasEttinger Yeah there's a lot of things to look out for when doing that
 
0
Q: What can I do to enhance my service locator class?

tdkr80I'm currently developing a simple 2D game engine and I was just wondering, what are some things that I can do to improve my service locator class, at the moment it's very basic. For example, should I be checking for null objects, if so, what exceptions should I throw? Here's the code, thatnks i...

 
1:35 PM
possible answer invalidation by Kajkrow on question by Kajkrow: codereview.stackexchange.com/posts/201197/revisions
 
0
Q: How to make a generic method in Python to execute multiple piped shell commands?

Arthur AcciolyI posted first this question here, but they suggested to put on this forum. I have many shell commands that need to be executed in my python script. I know that I shouldn't use shell=true as mentioned here and that I can use the std outputs and inputs in case when I have pipes in the command as m...

 
@DietrichEpp Code review does not accept neither code that is not working, nor code that is simplified for the purpose of demonstrating a specific behaviour. This question has a clear problem (code hangs) that can be addressed on SO. — Mathias Ettinger 26 secs ago
 
@Duga Rolled back
 
1:51 PM
0
Q: java rpg battle simulator (oop beginner)

SydI'm attempting to code a turn based RPG battle simulator (text based) in java. I'm doing this as an exercise/project to learn OOP design. I've coded something similar in C, but just porting that code over to java would, of course, be rather silly. I'm going to be taking this extremely slow, focu...

 
Perhaps this question is better suited for the codereview SE site. — Axeman 15 secs ago
 
2:08 PM
Greetings, Programs.
 
Greetings, User
 
2:34 PM
If anything, this question should be moved to Code Review. It's not asking for debugging and isn't overly broad. It could do with some example data, but that's cause for a comment to the author, not anonymous downvoting and close-voting. — AkselA 7 secs ago
 
0
Q: Passing element data to javascript based on button

stalwart1014i'm new to javascript and still learning. The below code works fine is just that i want to add a delete button on each new row produce. and when it's pressed it will delete the data and update the "totaldonation" value. I got stuck here and need some help. Thanks HTML <div class="item active"> <...

 
this question might be a better fit for codereview.stackexchange.comGreen Cloak Guy 5 secs ago
If you have a working solution but want some improvements (performance, code style, architecture etc), then it's better to ask a question on Code Review. — dymanoid 21 secs ago
 
3:20 PM
If the code works and you just want to optimize it, you may be better off asking on Code Reviewcybernetic.nomad 49 secs ago
 
@Heslacher and @Vogel612 I think we may have closed a question when it potentially shouldn't be closed. (@Mast you may be interested in this too)
0
Q: Closure of finding the longest word in a string

PeilonrayzRecently we got the question Finding the longest word in a String. (10k required) This question looked like it was off-topic, because of the following results: >>> findLongestWordLength("What is the space?"); 6 >>> findLongestWordLength('What is') 2 If 'word' means any segment that isn't a sp...

 
hot take: Whether the online judge accepts it or not does not imply anything about correctness of the code
 
@Vogel612 if it passes my unittests it still may not be correct. But it did work to the best of the author's knowledge
 
0
Q: Closure of finding the longest word in a string

PeilonrayzRecently we got the question Finding the longest word in a String. (10k required) This question looked like it was off-topic, because of the following results: >>> findLongestWordLength("What is the space?"); 6 >>> findLongestWordLength('What is') 2 If 'word' means any segment that isn't a sp...

 
@Peilonrayz Seems like @Mast was thinking alike
 
3:31 PM
@Peilonrayz the unit tests there appear to be something that's not a spec.
 
@MathiasEttinger Yeah Mast's the reason I decided to look for the challenge. They also said something along those lines in chat too
 
the whole spec is:

> Return the length of the longest word in the provided sentence.

Your response should be a number.
the rest is some prefinished unit-tests which are utterly lacking
that doesn't make the spec any less clear, though.
 
@Vogel612 We don't close questions whether they work 100% towards a spec, we close questions when they're broken and the OP knows it is.
> We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review.
 
-1
Q: Deleting row data with button on javascript

stalwart1014How do i get the button to delete the specific data of the row and update the value of totaldonation. Really need some guidance. Thanks HTML <div class="item active"> <img src="item/dapur.png" class="img-responsive" style="height:120px;"> <input class="input-display itemname" type="text" id="it...

-1
Q: Trying to iterate two strings of unequal length

Bidesh ChowdhuryTwo players are made to play a game They can choose a unit of either of rifle,knife,bomb and fill an army. The space is limited to 10. So player 1 and player 2 can choose any combination of units which is stored in two respective lists. Lets say Player 1 list contains [rifle,bomb,knife,rifle]...

 
Monking!
 
3:49 PM
@CaptainObvious duplicate of codereview.stackexchange.com/q/201294/120114 (asked ~52 minutes prior)
 
4:07 PM
1
Q: Reading set of large log files line by line and count how many hostnames appear on each line

MamathaI have around 300 log files in a directory and each log file contains around 3300000 lines. I need to read through each file line by line and count how many hostnames that appear on each line.I wrote basic code for that task. but it takes more than 1 hour to run and takes lots of memory as well. ...

0
Q: Generic function with more than 1 dyanamic types good practices

harshu288Below is my code, so I have a abstract class where in I have used AddAsync function so its method definition is dynamic & parameter is dynamic too however since any one calling this method may have different definition & parameter input so I had to create a empty class called DomainEntityDto, I d...

 
If you have working code and are concerned about efficiency, you might check out codereview.stackexchange.com. — Alex Johnson 1 min ago
 
4:35 PM
possible answer invalidation by Syd on question by Syd: codereview.stackexchange.com/posts/201291/revisions
 
4:52 PM
0
Q: reposting again, wasnt logged into account before - Reading set of large log files line by line and count how many hostnames appear on each line

Mamtha PillaiI have around 300 log files in a directory and each log file contains around 3300000 lines. I need to read through each file line by line and count how many hostnames that appear on each line.I wrote basic code for that task. but it takes more than 1 hour to run and takes lots of memory as well. ...

0
Q: python batch proccessing large text files for sentiment analysis

harryso i have written this script (pastebin . com/NJgLW8xb) in python 2.7 and i was wondering where i could improve it or efficient. this is my first script so idk much. the script takes a text file from a folder removes blank spaces with list comprehension and then breaks it into smaller 20 elements...

 
@Duga appears to have been heading advice from 200_success - and doesn't invalidate the answer
@Duga I guess it isn't totally surprising since it is SO... but 5 answers within 42 minutes...
 
5:10 PM
Hi Paul, I don't post enough in CR to recommend migration, but usually StackOverflow is for bugs or problems in code. Check out CodeReview if your code is working and you just want feeback — en_Knight 38 secs ago
 
5:22 PM
2
Q: 8-Puzzle BFS Peformance

HirtolI created a BFS algorithm in order to solve an 8-puzzle, and while it works, it is awfully slow compared to my DFS implementation. My main point of concern is the puzzleExists() function, which determines whether the created puzzle already exists in the list and should therefore be dropped. Curre...

0
Q: Web scraping VBA with log in with user pop up

scotsrule08Good day, I am automating a report for my department which currently requires going to a website, putting in your user name/password, then navigating to the proper page and copy the data from there. What I need help with is creating a VBA to open a pop up box asking for the username and passwo...

0
Q: Does this method guarantee protection against a CSV injection attack?

user875234The only idea here is that if it's between double quotes it can contain anything it wants. I'm only concerned about making it safe within the context of a csv file itself. That is, I don't care if they write </textarea><script>window.location.href='http://regressionbuddy.com';</script> in one of ...

 
I believe this qualifies as "stub code" and not "concrete code usage" - from the close reasons: Lacks concrete context: Code Review requires concrete code from a project, with sufficient context for reviewers to understand how that code is used. Pseudocode, stub code, hypothetical code, obfuscated code, and generic best practices are outside the scope of this site." — Thomas Ward 21 secs ago
 
5:45 PM
@ThomasWard what was wrong with that question?
 
@Malachi you're a mod you can read it. Stub code, asking if that specific function has proper anti-injection methodology to it
but no concrete context of usage, etc.
the other reason would be "Unclear what you're asking", but since OP or mod now deleted it, I can't see it if I close the other tab it's in
would also fall into the "best practices" category without any other code to show the context of the code being used, what it was being told to process, what actual injections they're protecting against, etc.
that's my interp. anyways. Two others came by asking for more details because it was unclear, but I can't see what else happened. (I'm not a CR mod.)
 
it looked like it escaped double quotes, and looked like real code, and looked like it performed the function completely and might actually be part of a code base
 
@Malachi then the next step I do is take the question to Meta of the scope of "with sufficient context for reviewers to understand how that code is used" in the close reason, and that its scope needs more clearly defined to include what is or isn't included in it.
from my perspective it was just that one singular function without details or other contextual uses of the code
but since I'm just a user on CR, my opinion remains just my opinion without any other weight behind it :P
(and you're allowed to disagree)
same exact question
my guess is OP deleted due to downvotes
and it seems that someone else commented about the question not getting better.
 
@ThomasWard thank you
 
@Malachi given that they provide "This is my function, it's supposed to make correct output like this: [examples]"
the next question:
are single functions on their own enough to stand alone on their own
 
5:52 PM
0
Q: Unicode character mapping vs ranging

hydroperParsing ECMAScript requires knowing what Unicode characters are allowed in identifiers. I mostly used Unicode character classes for validating IdentifierStarts and IdentifierParts. E.g., using the online UnicodeSet utility, I get something like [\$A-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6[large lis...

-1
Q: Does this method guarantee that cells in a CSV will be correctly partitioned?

user875234This function formats the text in each cell of a CSV. The goal of the function is to make sure that the sequence of characters in text will never break the cell's partition. The correct output of this function looks like this: "foo" "123" "drop table 'chocolate'; -- this is fine, i don't care" ...

 
@Malachi and because I'm one of the users who actually uses meta, you can provide your reasoning/interpretations on my interpretation here
since i'm just a standard user on CR, the community at large is free to argue why my interpretation is/isn't valid.
 
@ThomasWard I will wait a little bit and see if I can find some of the other meta posts surrounding that close reason.
that is a custom close reason IIRC
 
it's presented in the flags as a valid reason, hence the request for comment on the scope/reason :P
(this is also why Meta exists - to help clear up things for some users or to better clarify certain cases/opinions in a civil discussion, no?)
 
correct, I just know there is a meta post already so I want to make sure that I am in line with the community on this as well....maybe your answer is already on Meta somewhere
 
maybe it is, maybe it isn't. 'Tis why I like Meta, if it's already explained elsewhere then the answer can easily be found, and if it isn't then it gets attention and answers to better clarify things :)
... this being said, at least I'm not one of the users who goes off on a rant and gets mad at the mods/community just because I don't understand a mod's interpretation of something or such :P
(and even as a mod over on Ask ubuntu, I regularly find myself about to do something but then notice the community consensus goes against that and "WHoopsies, I shouldn't do that..." is my ultimate response, yay for meta!)
 
6:09 PM
here is where I am currently looking
My idea of Code Review is posting (near) production code in pieces that can be run on their own given the correct input. and the purpose is clear as well.
well that is rather simplified, but gives a general idea
 
6:36 PM
@ThomasWard here is what I really look at when I see this close reason
> Questions must involve real code that you own or maintain
 
0
Q: which is better and efficient way to build query params which append to URL in browser in javascript?

pro.meanI was looking for http_build_queryphp similar method in javascript but did not find but create my own and here I am a bit confused to decide the right approach. so here is the problem. I have an object of params and need to create query string to append with URL with help of encodeURIComponent....

 
This might be better off over on CodeReview. — Dave 30 secs ago
 
6:53 PM
0
Q: Coding advice for beginner trying to code a game similar to breakout in JAVA

user176827I'm trying to learn how to program with JAVA which is more or less my first programming language (had some basic Pascal and C,C++ in school and collage) but still a Beginner from a capital B. Right now I'm working on a mini game, which is similar to the break out game but it's going to have my ...

 
@Malachi That sounds like a clarification that you should put as an answer to my post? And build upon that?
'Tis what Meta is for, the discussion of the scope with the mods and community at large.
(I am not checking my chat messages regularly right now, stuck in meetings)
@Malachi Correct me if i'm wrong, but that has its own close reason
extracts a segment of his system screenshot
 
@ThomasWard lol, sorry I was formulating an answer to your Meta
 
7:08 PM
no problem :)
we're good :)
 
and doing some Mod Stuff
 
this is, though, why Meta exists, to discuss things and come to consensus, or to clear up users' understandings of things :P
 
I am not so good at the Meta thing, so please let me know (as a fellow mod) what I can do to make it a better meta post.
 
as long as I can get the gist of what you're saying you're good.
and in this case, it's a general discussion not a "What's moderator position on the close reason" because that'd be requiring policy dictation :p
and I've had to deal with a few of those.
 
1
Q: Need clarification on my close reason interpretation for a specific close reason

Thomas WardThe question Does this method guarantee that cells in a CSV will be correctly partitioned? is a duplicate of this one (10k+ and mods only) which asks whether a singular function properly 'escapes' bits of text from a CSV when handed to the function. My personal opinion is that it does not meet t...

 
7:13 PM
wow, I was able to formulate an answer before it posted here....maybe that is by design???
 
lol
 
0
Q: Presenting and passing data to a modal view controller without using `prepare(for:sender:)`

ChrisI am using a toolbar button to present a modal view controller (in which I let the user export data as a PDF file). The main section of my app is a UITableViewController subclass embedded in a UINavigationController. Here is a schematic of my layout. The modal itself is embedded in a UINaviga...

 
7:38 PM
0
Q: linked list implementation for insert and remove in python

NinjaG Hi. I was solving this problem for implementing linkedList class and ListNode class, and Insert method, Remove Method for Linked List. and I was wondering if I can get any code review and feedback. You can find this problem below. class ListNode: def __init__(self, value=None): se...

 
8:02 PM
 
8:20 PM
possible answer invalidation by Dima Vizelka on question by Dima Vizelka: codereview.stackexchange.com/posts/201206/revisions
 
@Duga I left a comment... the edit kind of invalidates my answer... I am not sure if it should be rolled back... thoughts?
 
@Malachi ^
 
8:39 PM
-1
Q: if conditional execute code in false validation

PepeI have two checkboxes chkProjectTechs and chkTeamLeader if (!chkProjectTechs.Checked || !chkTeamLeader.Checked) { //code there } For me, this if says, "only execute this code if chkProjectTechs is not checked or chkTeamLeader is not checked. So when I...

0
Q: Find char which appears maximal number of times

GiladI had 15 minutes to code the following question: Given a file name return the char which appears maximal number of times. please do not take into account the unit test. Please look at the final foreach loop, I could have also used a for loop, I have doubts what is the best way to implement find...

0
Q: LinkedList class implementation in python

NinjaGI was solving this problem for implementing linkedList class and ListNode class, and Insert method, Remove Method for Linked List. and I was wondering if I can get any code review and feedback. You can find this problem below. class ListNode: def __init__(self, value=None): self.va...

0
Q: Event emitter npm module

Sam OnelaI was asked to complete the task described below: Event Emitters are objects that serve as the core building block in event-driven architectures. They simplify the process of handling asynchronous events and enable clean and decoupled code. Create an Event Emitter module in JavaScript ...

 
@SamOnela I don't think PHP would compile that... I think that was a copy paste thing maybe. the post engine will allow for certain HTML tags and will render them as HTML.
 
@Malachi yeah - which is what I mentioned in my answer...
 
as that is the only thing they edited....it is a grey area I think
 
yeap
 
I don't think it was part of the real code, at least that is my assumption
 
8:43 PM
I don't know which of the 49 shades it would be... /s
 
lol
I would be more concerned with the space they killed in the code with that edit....
 
oh I kinda missed that - that is another thing I mentioned in my answer
 
I guess then we should roll it back, if they had commented that it was a formatting thing for the post, that would be different. I will roll it back.
they did comment about 33 minutes ago
I added <br> tag when posting here :D thank you for help. I will improve the code. — Dima Vizelka 34 mins ago
so the space that you mentioned is still there, but the <br> tag is gone because it was only there for formatting on our site.
 
I interpreted that as his/her working code instead of the code in the post, but alas I was wrong :/
 
:46128680 you didn't see that
@SamOnela not sure I understand this statement.....
 
8:52 PM
@Malachi I was thinking the OP was going to take the feedback and update the code on the webserver/wherever and NOT edit the code in the post
 
gotcha.
 
0
Q: Trick circumvents [position: sticky] restriction to parent

sagposition: sticky; elements are sticky within the bounding box of their direct parent containers. I wanted to make a stickily-positioned button that sticks to the bottom of the viewport, not its parent. So here's what I did: #container { position: relative; top: -99999px; } #offset { height: 9999...

 
@DimaVizelka, I removed the HTML Tag because it is not needed for formatting on our site, but the space does not appear to be a result of formatting so it needs to stay in your post because it was mentioned in this answer/review. — Malachi ♦ 22 secs ago
TTGH
 
peace out
 
9:20 PM
possible answer invalidation by Dima Vizelka on question by Dima Vizelka: codereview.stackexchange.com/posts/201206/revisions
 
0
Q: Searching Online English Dictionaries | follow-up

Mahmud Muhammad NaguibThis is a follow-up to Searching online English dictionaries. Here is my code: import webbrowser import random available_dicts = [ ('Merriam-Webster Dictionary', 'https://www.merriam-webster.com/dictionary/', '%20'), ('Oxford Dictionary', 'https://en.oxforddictionaries.com/definition/'...

 
9:39 PM
0
Q: Where should public and private keys be stored in Laravel?

WarrioI'm using an API that allows to retrieve a list of data. That API uses public and private keys to identify requests. For clarity of code, I would like to store these two values in a file and to access them as global values. QUESTION: In which file should I store these values?

 
10:26 PM
StackOverflow is a site for fixing problems in code, not for performing code reviews. You want to go to the Code Review Stack Exchange instead. — Abion47 51 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comDave Anderson 17 secs ago
 
10:54 PM
0
Q: Dynamic country, state select options

PsliceHere is code to dynamically choose between three country options (United States, Canada, Other). After the user selects a country it will show the related select option or an empty input (when "Other" country is chosen). Then I pass the previous value into an input called spr(state/province/regio...

0
Q: Create array that fills with series of random numbers, prints the elements of the array and more

1st timerI need to create a C++ program that creates an array, fills the array with a series of random numbers, prints the elements of the array to cout, identifies the largest element in the array and prints the value and address of this element to cout. My code will also print the address of the array. ...

 
11:10 PM
0
Q: Making filters based on checkboxes

PepeI have a scenario where I do filters depending on checkboxes checked. Now I have only 2 checkbox and I need to cover all escenarios into if else conditionals like: if (!chkProjectTechs.Checked && !chkTeamLeader.Checked) { foreach (DataRowView list in lstTech.Selecte...

 
11:22 PM
Stack Overflow is for fixing broken code and suggesting algorithmic approaches to problems, here implemented in Ruby. SO's sister-site, CodeReview is specifically for suggesting improvements to working code. I suggest you delete your question and post it at Code Review. You'll no doubt get more helpful answers at that site. — Cary Swoveland 52 secs ago
This looks like a potentially better fit for Code Review than for Stack Overflow. We can help with identifiable problems, but if you're just looking for general critiques of your code that's better done elsewhere. — David 22 secs ago
What is a good place for code review? Any websites? — espresso_coffee 39 secs ago
 
11:40 PM
0
Q: How to create stored procedure in SQL 2008?

MilosI'm new in stored procedures world and in one of my projects I'm trying to implement stored procedure for the search process. I'm not sure if everything I created is correct. Also I'm wondering if this code has any leaks or vulnerability on SQL Injection. Here is example of my stored procedure: ...

 
11:55 PM
0
Q: Generic Single Linked List with smart pointers follow up part 2

SnorrlaxxxThis is probably the last time I will post this data structure that I have been working on. I have added in an iterator and const_iterator class (although I do not use them probably where I should be). I also did not follow another persons advice to add emplace, emplace_front, and emplace_back si...

 

« first day (1923 days earlier)      last day (2095 days later) »