« first day (1784 days earlier)      last day (2239 days later) » 
00:00 - 23:0023:00 - 00:00

12:00 AM
RELOAD! There are 5195 unanswered questions (89.9790% answered)
 
12:30 AM
1
Q: Trying to understand Javascript Promise

Martin YorkUsing javascript functions and the old way of doing things I wrote a piece of code to copy the first file in a directory to a file Test. console.log("Copy First File"); var fs = require('fs'); fs.readdir(".", function(err, files) { if (err) {console.log(err);process.exit(1);} fs.exists(...

 
@Daniel questions on design and efficiency seem more related to code review, rather than SO. — tehhowch 39 secs ago
 
12:48 AM
0
Q: Basic C++ Circle Class

Corey FordI'm trying to improve on my basic C++ skills and create really nice, concise and clean code that is free from artefacts. The program can add and subtract radius values from each circle, assign one circle to another and furthermore give the area. Any tips on how this program can be improved, w...

 
Code Review? this app was written 20 years go, There are over 3000 Queries, and at least 30 or 40 thousand parameters, probably more. Hand rewriting each query is out of the question. so i'm left with trying to come up with the next best thing. What is the second most secure way to query basicall — jdmneon 48 secs ago
 
@Hosch250 I ended up posting a question on the vendor's support community, from what I could see inspecting the source, there seems to be something server-side that hijacks click events
 
@Phrancis Pretty much impossible.
Clicks are handled by the browser. Something in the browser has to be notifying the server :)
 
It's a big mess of Angular crap, who knows what they have going on
 
Who knows is correct :)
 
1:04 AM
That's where that culprit console message comes from :)
 
dies
@Phrancis Are you using the click event?
Are you sure the browser handles that event?
Some make you handle onmousedown and stuff instead.
And yeah, onmousedown gets handled before click, I think.
 
Hmm
 
Yeah, I think all browsers handle click.
It's mousepresssed that's not handled by Chrome, or something like that.
 
1:22 AM
0
Q: Maintaining a complicated installer supporting per-user & everyone

thisAnother challenge for developing rubberduck VBA project is to develop an installer that support per-user mode and everyone-mode. Normally with a MSI package, one has a bootstrapper so it is possible to defer the privilege escalation until it is determined that it is in fact necessary. However In...

 
@Hosch250 From poking around, I can't get any of the button events to do anything
Even onmouseover doesn't work
 
@Jesse If you have a working code and you want to know where is it not-the-best-practice, you can post on Code Review. I'm not very familiar with that site so read their help center before asking. — user202729 19 secs ago
 
Well, I found a sort of "workaround", I just put a change listener to the <select> menu I added and that one works, guess it'll have to do, for now
 
1:38 AM
Also, code review suggestion: make your code readable to others too with proper indentation. — user202729 24 secs ago
 
@Phrancis :)
Try the monitor events thing.
Chrome has a handy one.
 
Is that an extension? Or in the developer console?
 
Console.
Select the node you want to monitor.
That works, but Chrome has a handy way of referencing the selected node. $0 or something.
Yeah, I was right.
They have $0 for the selected, $1 for the previous selected, and so on through $4.
 
Oh cool
 
1:56 AM
Still at work resolving bugses.
In prod this time :joy:
 
I'm guessing ya'll don't want questions like this, right?
-2
Q: Most elegant way to have search bar that shortlists depending on input

it HaffensI'm just trying to make a search bar that will allow the users to type in a substring of any page on my website, and the search bar will shortlist page names that are consistent with what they've typed. I'm adding as an answer the most elegant solution I've come up with so far, but I'm writing th...

 
0
Q: C# - Making one messy method into smaller, cleaner methods

LairinusI am making an open-source C# tool that supports pagination. So far, it is working well and it is near functional completion (did not focus on defensive code yet), but after reviewing my code and cleaning everything up I think it looks worse. Any feedback is welcome, however I am most interested...

0
Q: Are these frequent calls to a function that returns a fixed value in dblquad avoidable?

uhohThis is my first question here. If the question and example is too simple for codereview just let me know and I'll delete and move the question to SO. The script below calculates the electric field at (x0, y0, z0) from a uniformly charged annulus using SciPy's dblquad. My question is about the ...

 
@Undo Heck, no, did you even read the about?
No working code anywhere in sight.
 
@Hosch250 Exactly my thoughts. This'd be a good opportunity to educate stackoverflow.com/questions/49437008/….
 
@Undo Hit it with fire.
 
2:04 AM
@Taplar Code Review requires code to review. Please don't recommend other sites without at least reading their help center. — Undo ♦ 59 secs ago
 
We just realized we've been freaking out about almost nothing at all.
The one bug is fixed, and the other is just a low-priority issue with an empty guid being sent back in one of the fields sometimes.
We usually do nothing because that data doesn't exist--except on one site.
And we explicitly created that to test something and never pulled it out.
 
2:32 AM
0
Q: Retrieve elements from a list

Computing...I retrieve elements from a list with code: re.findall(r"[\w\.]+",str(dirs)) # data dirs dirs = ['', 'Applications cores sbin', 'Library dev tmp', 'Network etc usr', ...

 
3:08 AM
0
Q: Calculate cryptocurrency gains and losses using the Coinbase API

0112This class calculates the gains and losses (in USD) from the four leading cryptocurrencies using the Coinbase API. (The full repo can be found here) In additions to general feedback here are some specific items I would like feedback on: What can I do to improve my tests? (For example, is it s...

 
3:44 AM
0
Q: How to retrieve data from database and display it on label

jordanI'm working on the Registration page for Lucky Draw system.So the process for registration is user need to scan their barcode using usb barcode scanner. I stuck on that part which i cannot check the employee id on database after user scan or type in the textbox. I also want to display the employe...

 
possible answer invalidation by nullbyte on question by nullbyte: codereview.stackexchange.com/posts/190159/revisions
 
4:03 AM
0
Q: Calculate electric field of a charged annulus

uhohThis script calculates the shape of the electric field on a 2D grid perpendicular to a uniformly charged annulus using SciPy's dblquad. I've chosen a coarse grid and specified a very large relative error epsrel here so that this example will run in about 10 seconds, but I'll be using it on a muc...

 
5:05 AM
I think this question is better suited for codereview.stackexchange.comflen 12 secs ago
 
5:44 AM
@Duga Rolled back.
Monking
 
Monking
 
6:06 AM
0
Q: Number of Islands in a 2d grid in python

NinjaGRecently, I've solved this "Number of Islands" problem on Pramp. Problem Description Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four ...

 
If the code is already working, try asking on Code Review. Be sure to read their help center before asking. (in this case the second snippet is not working so I'm not sure...) — user202729 30 secs ago
 
6:22 AM
@Robear The only place where it may (but doesn't have to) cause confusion is where you can't use your IDE to point out proper type. For instance, take code review boards. — Asunez 16 secs ago
 
6:40 AM
0
Q: python code to delete any file of size less than or equal to 1KB

paul josephi have numerous files of audio,text,video and images. I want to delete the files of any type, which are of size <=1KB. i need the code in python. thank u

 
I don't fully understand your code. If it works as is you should post it on code review to get some help cleaning it up. Only after then would I start thinking about making it a package. — Bailey Parker 39 secs ago
 
@CaptainObvious Needs code, should use find . -type f -size -1k instead.
 
7:08 AM
The linked question is C++, but the answer applies here as well. Additionally, I should add that you problem seems better solved by enforcing all changes have to go through code review before being allowed into master branch. Writing a checker for side effects is not easy at all, especially in a non-statically typed language like python. How do you even know what kind of object localStorage is? Where to look for the definition of it? Does it even have side effects? — kutschkem 13 secs ago
 
 
1 hour later…
8:25 AM
1
Q: Deep Neural Network in Python

SamuelI have written a neural network in Python and focused on adaptability and performance. I want to use it to dive deeper into that field. I am far from being an expert in neural networks and the same goes for Python. I do not want to use Tensorflow since I really want to understand how a neural net...

 
8:43 AM
0
Q: More elegant way to use database outputs in a search shortlist [javascript/jquery]

it HaffensI'm just trying to make a search bar that will allow the users to type in a substring of any page on my website, and the search bar will shortlist page names that are consistent with what they've typed. I'm ajaxing in relevant pages, though I'm wondering whether it's more expensive to do ajaxes...

0
Q: Shell script to build executable from node.js

Phi TruongI'm trying ompile archive node.js executable into one executable using node-packer. For my all packages, executables of node.js are in {projectRoot}/node_modedules/.bin The project structure as follow: |- node_modules | |-- .bin | |--- executable with source code |- compiled-bin | |-...

-1
Q: Payslip API to show payslip details in django rest framework

philipI am using django rest API and would like to create a class-based view that will result to creating a payslip and render results in json. How can I correctly make GET and POST methods that will show all the payslip details e.g net_deductions,net_allowances,basic_salary,net_pay etc class Pays...

 
Monking
This code looks familiar to me… — Mathias Ettinger 12 secs ago
Is this a case of "authorship of code" close reason?
 
9:19 AM
0
Q: async parallelLimit

eightnoteightI'm trying to implement parallelLimit so that to limit number of parallel tasks that can be performed at any time. for my use case i'm using this function for limiting the parallel uploads from my code. const _ = require('lodash'); async function _parallelLimit(tasks, limit) { const _...

 
Monking
 
This might be better suited for codereview. — Axeman 52 secs ago
 
@MathiasEttinger That is an exact copy of your code. They've posted your code and so it's 100% off-topic.
 
9:36 AM
I like the answer, though
 
Monking
 
If you upvote it the question will stay IIRC
 
Yes, upvoted answers on questions make it harder to remove.
 
You could ask a mod to move the answer a question you post, but IDK.
 
@MathiasEttinger I think it's time for Meta.
 
9:41 AM
I like this answer and would like to upvote it. Why don't you post it on the original question where this question code is a verbatim copy of my answer? — Mathias Ettinger 13 secs ago
There, hope the answer would go away ;)
 
@MathiasEttinger No, that's a reason to flag the post. It's violating the CC-BY-SA licence.
No proper attribution.
 
@Zeta Oh yeah, that's also a TOS violation. You have to give attribution, even if it's CC0.
 
All of it. It's basically 167 lines that's one method and none of it is PEP8. There are hard coded paths and magic numbers. The comments are sparse. You just aren't going to find many SO users with the patience to comb through all of that. Again, I'd recommend posting on code review. — Bailey Parker 56 secs ago
 
CC0 does not contain attribution, though.
 
9:55 AM
0
Q: A basic form with React

DDDI have been working of a basic from using React and i would need your review/help to improve this part of my code especially (validate and onSubmit) state = { email: "", emailError: "", }; change = e => { this.setState({ [e.target.name]: e.target.value }); }; v...

0
Q: Javascript, threejs, tool to show planes

enoyCurrently I have working code which shows two NRRD planes on the web: I would like some help to improve my existing code. First I will show it file by file, and then I will tell you how I think it could be improved. We have a class InitCanvas.js which has the responsability to inicialize a T...

0
Q: Better way to format and make it more readable

Thomas FlinkowBased on this answer, I hope I am on-topic here. I have the following function call in my project: return InteropServices.MarshalResponse<TResponse, __GenericSingleResponse, TMarshaledClass>(interopResponse, interopResponse.RequestData, this.RequestDataType); As you can see, it is way too l...

 
Ah, you were talking explicitly about SE content, not about CC0 in general. Sorry.
 
@Peilonrayz actually that is not correct
 
Yeah, :) No problem man
 
you can consider the content dual-licensed
which means that it's up to the reproducer to choose the license they decide to apply
 
@Vogel612 It's not a license violation. It's a TOS violation.
SE's TOS says you have to attribute, whatever the licence of the code posted is.
 
@Vogel612 Shouldn't it be up to the content producer to choose which licenses are acceptable?
 
the content producer can choose multiple licenses
of these only one can apply at a time
@Peilonrayz I don't see that, actually..
> In the event that You post or otherwise use Subscriber Content outside of the Network or Services, with the exception of content entirely created by You, You agree that You will follow the attribution rules of the Creative Commons Attribution Share Alike license as follows:
 
@Vogel612 I don't understand what you mean by this
 
I don't see where it says that not giving attribution for content that the author dual-licensed under CC-0 is a TOS violation
 
> In the event You [...] use Subscriber Content outside of the Network or Services, [...] You agree that You will follow the attribution rules of the Creative Commons Attribution Share Alike license as follows.
It says if you use the content, you have to follow the attribution rules.
 
10:13 AM
It also makes your code more code review friendly in github and other similar tools which respect PEP8 more than 16:9 monitors. — Roman Konoval just now
 
10:27 AM
@CaptainObvious One last CV
 
NinjaG is a bit of a puzzle. I've answered a few of their questions, but never got the impression that they were paying attention; their next question typically has all the same problems that were identified in the previous review.
For example the user got extensive feedback on this string search question but then ten days later posted a similar question with the same set of problems. Once you've see this happen a few times, you get a bit discouraged as a reviewer.
 
@GarethRees Understandable.
@MathiasEttinger Perhaps this should've been the moment to bring it to Meta instead?
There is an ongoing discussion in chat about attribution, licensing and TOS. You can join in if you like. — Mathias Ettinger 35 mins ago
Meta is much better suited for making sure we don't have the same discussion again in X months.
 
10:43 AM
Nice to see you here @GarethRees. Reminds me of a couple older users that just came up with some problems to similar interview questions every time...
 
Probably the C++ regulars.
Code Review does a lot of good for a lot of people. But you can't help them all.
 
@CaptainObvious maybe flag for mod attention for plagiarism...
 
"but I'd rather would like to know if there are any cons/flaws in my thinking" - Sounds like a question for Code Review instead of SO. — Magnus Eriksson 20 secs ago
 
@Vogel612 Already done.
 
11:05 AM
0
Q: Shell install.sh for repository (rpi_videoloop)

HackXItI've written my first installation script in shell and was wondering on how I can improve the "stability" of the program? (Don't know the english word I'm looking for, but something like "failsafe"?) Currently it doesn't really check for redundancy, so running it twice causes some errors for exa...

 
12:07 PM
I'm voting to close this question as off-topic because it should be posted on code review codereview.stackexchange.com or it's opinion-based; take your pick. — Funk Forty Niner 12 secs ago
possible answer invalidation by ComFreek on question by eightnoteight: codereview.stackexchange.com/posts/190282/revisions
@FunkFortyNiner good to know as i can't post for 1 hour at the codereview. Next time i will know we have such a webiste in our stackexchange ! Again, thank you very much — W.Lukasiewicz 51 secs ago
 
-1
Q: Simple Android Flashlight app

Bar AkivaOne of my first projects. I present to you - Android Flashlight app! public class MainActivity extends AppCompatActivity { Camera cam = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act...

 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — user1251007 29 secs ago
 
12:34 PM
0
Q: Lazy lists with transformations, using generators & iterators

Joseph SilberI've built this very-basic lazy list. You provide it an array, a generator or any iterator. I creates a lazy list, which lets you run a pipeline of transformations in a lazy manner, meaning that they'll only be applied as you pull values out of the list. Here's the class: class List { stati...

 
12:51 PM
This question would be more suited on codereview.stackexchange.comArcher 35 secs ago
 
1:09 PM
2
Q: Password hashing and database

SupremeDEVI would like to ask someone if the code i will put here is Secured for SQL injection and my password hashing and checking while user is logging in is secure and done well. My Database connection : $hostname='localhost'; $username='root'; $password=''; try { $dbh = new PDO("mysql:host=$host...

0
Q: Simplify java script redirecting functions logic

RaskolnikovI have javascript file which is ugly but I have not idea how to make it better. There are many function for redirecting with different number of parameters. Just few functions are used for other thinks. All this functions will be called from Jquery event. Like this: $("#btnSomeButtonID").click(f...

 
Greetings, Programs.
 
@rolfl How is Golang these days? I remember you complained a lot about it about a year ago.
@Donald.McLean Greetings, Scala. Still using Scala? Or are you using Kotlin these days?
If anyone is using Kotlin at work, please let me know.
 
I am going to hide today and try to figure out some more Oracle syntax. but I will pop up if I am pinged
 
@SimonForsberg - I've been embedded in JavaScript/Node.js for the past 18 months. My current complaint about Go is that I am not using it enough.
Mind you, for what I am doing, JavaScript/Node.js is almost ideal....
 
1:25 PM
@rolfl Do you prefer Go more than Java these days? (for backend-stuff)
 
Yes.... for serious server-side work, I'd choose Go over Java now, with a couple of exceptions.
 
while I see you guys here, do any of you use Oracle?
 
Not recently, @Malachi - in fact, I have not done serious SQL of any sort, been mostly NoSQL type things, Cloudant, Redis, ELK, etc.
 
not sure how much of the code I write here I can actually post for review, but I may have questions about performance stuff, or similarities between it and SQL Server
 
0
Q: Linq IEnumerable extensions for void functions

JADI found myself wanting to use Linq to map void methods to an IEnumerable to modify all items. The existing Linq methods require a return variable when mapping, since they are based on Func. So I decided to try my hand at creating some extension methods myself. This is the first time I've done an...

 
1:28 PM
@SimonForsberg - the deploy easy of Go is just..... remarkable, when compared to Java. The JVM makes portability much easier, but deployability sucks, and the cost of the portability for an application that's guaranteed to run in a Linux/Docker container in an elastic/scalable situation, is just not worth it when Go is so simple and light.
Even things as rediculous as JVM arguments, -Xmx... is just excessivly hard.
 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — user1251007 50 secs ago
@user1251007 I dont think it belongs on codereview. AFAIK codereview only accepts working code, this one segfaults. — Borgleader 10 secs ago
This looks like it should be made runnable and posted on Code Review. — Carcigenicate 1 min ago
 
1:58 PM
@rolfl I remember you complained about Go's lack of libraries earlier, like not having a descent UUID class, is that still an issue or have Go improved there as well?
 
Monking
 
@rolfl What are you doing in JavaScript/Node.js these days btw?
@rolfl "for serious server-side work, I'd choose Go over Java now, with a couple of exceptions." - what exceptions?
 
@CaptainObvious Reading the last comment on that question, I wondered what was the "2" that was mentionned… And came to realize that not only the code was copied verbatim, but the problem description / code explanation too was copied almost verbatim from that other question…
WOW
 
@SimonForsberg - using Node.js for REST API development and some workflow management on the server.
As for Go libraries... I am out-of-touch a bit, but I am sure things are moving quickly to fill in any (significant) gaps.
 
Ok, thanks @rolfl.
 
2:10 PM
Go is better than Java in almost all areas where portability is not required (or portability issues are minor and already contained in the Go cross-compile features), and the application is fully server-side.
 
Btw @rolfl, you don't happen to know if IBM is using any Kotlin?
 
Surprisingly, though, I would recommend Node.js for those times where anything is dynamic, though, over Java/Go .... if you are not writing a CPU-performance-critical app (you're writing a program where things are mostly IO/network bound), and there is a lot of data handling, then Node is nicer than the strict static typing of Go/Java
@SimonForsberg - I don't know the answer to that, but, in general, there is very little that IBM is not doing somewhere, at least. Even if it is in the competitive evaluation office ;-)
 
@MathiasEttinger Aren't problem descriptions usually copied verbatim? That's what I do, take it directly from the source. If somebody else does that too, it's a copy.
Problem statements being copied verbatim isn't a problem. The code being copied is.
 
@rolfl We're having a discussion at work about whether or not to use Kotlin (at least for an experiment), the question about possibly also using Golang also appeared (as having multiple microservices in Kubernetes costs a lot of extra memory for the JVM)
 
@SimonForsberg Look at their pros/cons in writeability, maintainability, deployability and portability and select the one most fitting your specific needs. Depending on how important the experiment is for future projects, you might even want to implement it in both.
 
2:21 PM
if everything is working in your code then this would better be posted on codereview.stackexchange.comavigil 32 secs ago
 
You can learn about a language/framework/etc. all you want, you'll only know whether it works for you when you've tried.
 
@Mast Yes, problem description usually come from a single source and are copied verbatim, but I was more about the "The Solution" part; sorry if the wording wasn't clear enough.
 
@SimonForsberg Still using Scala.
 
@Mast All that is purely subjective though. One person can find out those things, but then other people needs to agree on it.
 
@Mast Before we picked Scala/Lift, we evaluated four different technology stacks by implementing a small piece of the system in each. The answer was - they all work, but some were easier to use than others.
 
2:34 PM
@MathiasEttinger Vote To Delete that.
@CaptainObvious Vote To Delete
is it possible that they came up with that code independently, @MathiasEttinger?
crazy question I know
 
Wow - some of the early code dates back to 2010. It seems strange to have been using Scala for that long.
 
TTGH
 
that user has 37 questions, is it possible to search the code they posted to see if they have plagiarized anyone else? @Mods?
 
0
Q: Multiple Inheritance in Python where the second class overwrites methods from the first class

Michael K.I try to write a wrapper for all widgets that contain text that needs to be translated for wxPython and make them handle the initial translation and the change of language on their own using gettext. I already have a working prototype but I'm sure this is not the correct way to do it. Here is an...

 
sorry, to use the code they posted in a search parameter on the site
 
2:39 PM
@SimonForsberg - my opinion is... well, my opinion, but in your circumstances I would choose either Node or Go by default, depending on whether the app is primarily RESTful/HTTP/Network bound or not.
 
Both Node and Go are small-footprint, easily deployed, scalable and cheap in cloud.
 
first one I grabbed has a comment by Gareth
The code in the post does not attempt to solve the problem: it a selection sort that runs in time \$\Theta(n^2)\$, ignoring \$k\$ completely. Did you paste the wrong function? Can you clarify the post to explain why you want us to review this code? — Gareth Rees Mar 16 at 12:20
 
Only if there is a compelling, specific reason would I consider anything that's JVM based.
 
@Malachi I seriously doubt it as the Solution class is very LeetCode specific and they claim to be using Pramp
 
2:41 PM
@MathiasEttinger I just went to the site to see if they might be using our posts without attribution
 
As an example, consider the factorio blueprint encoder/decoder I put together in a few hours in Node, on cloud: github.com/rolfl/FactorioPrints -- 128 lines of code, and easy cloud deploy at factorioprints.mybluemix.net running in < 100MB of memory
 
He should return the Package enum, not an int. And I think this question should be on the codereview.stackexchange.com , not here — Simply Ged 33 secs ago
 
> Learn from peers’ feedback, gain confidence and master the art of interviewing. Keep practicing until you interview like a rock star. Impress recruiters and land awesome job offers.
wonder if they are somehow using a template to post code from the practice sessions
 
Yeah, you need great interviewing skills if your real skills can't keep you in the job ;-)
2
 
@rolfl We are definitely using REST - I wouldn't call it RESTful though. We use HTTP, and a whole lot of network calls to subsystems (using both REST and SOAP). We also have a huge amount of business-logic. And on top of that we have started using Java libraries for connection pools, circuit breaking and stuff (primarily the Hystrix library by Netflix, and also C3P0 and stuff - I barely even know it all myself)
 
2:43 PM
That;s a compelling reason ^^^
 
@rolfl A good thing about Kotlin is that there's the possibility to share code between your backend, frontend, and mobile apps - if we would ever need that, of course.
 
But, if you go the Netflix OSS route, you would be using things like eureka, etc... which have native libraries in Java.... etc.
 
@rolfl Does it have libraries in Golang too?
 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — user1251007 50 secs ago
 
Probably third-party libraries. When I dealt with Netflix core OSS code it was all Java, with Java libraries available... some "sidecar" code was available in Java to help run non-java applications.
 
2:45 PM
@Donald.McLean Exactly.
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comtrailmax 42 secs ago
 
Note, @SimonForsberg, that Netflix is deployed (or was deployed a few years ago) in a primarily VM-based setup without Docker, etc.
 
@rolfl The description of the repo says Blurprint Strings ;)
 
Oops... pull-request ;-)
 
@rolfl I can't make a PR to change the description :P
 
2:47 PM
@SimonForsberg Not to be an ass or anything, but I mod flagged a question 4 hours ago and the flag is still pending. Got any idea why? They usually go faster than that.
 
The README.md is correct.
@Mast Because I'm in chat on not on main site :P I'll get on it!
 
enough of my conspiracy theory, looks like it is a real person.
 
@Malachi I tried to search for copies of this code, found nothing interesting on CR
 
Fixed.
 
he never replied to the comment. previous questions show him responding to comments....
 
2:49 PM
@Mast Handled. I hope the answer has been copied already.
 
TFW we find production code that has a sorting algorithm with eval in it. :D
 
This might be a single occurence of them copying code, but damn that feels so wrong…
 
@DanPantry You're still alive!
 
ctrl+f eval - 56 results found
@Mast I'm not sure I am after seeing the above
 
@SimonForsberg The answer was copied hours ago, yes. So that's saved.
 
2:50 PM
I am pretty sure I am messaging you from beyond the mortal plane, having died from why-is-there-eval-in-my-sort-algorithm-itis
 
@Malachi Hanlon's razor.
@DanPantry lol
Take a deep breath.
Refactor.
 
It's not my code. and it's in PHP
I can't refactor it :P
 
But you can rephpactor it
5
 
Being security though I can heavily recommend refactoring something because security
 
@DanPantry Tell me, is the internet any good in the afterlife? Mine is like sucking golfballs through a hose today.
 
2:54 PM
@trailmax No no no. This doesn't belong to cr. It's pseudocode, which is not acceptable there. Please see codereview.meta.stackexchange.com/questions/5777/…. This question is opinion based and doesn't give enough information. It should be put on hold, not shoved to another site where it will just be put on hold there. — Scott Mermelstein 42 secs ago
 
@DanPantry Sleep-sort?
 
@Mast unfortunately I am in hell, so all of the <marquee>, <blink> and TODO: documentation programmers are here.
3
 
@Duga Bloody genius.
 
@rolfl I guess you could say we need to clean up the phpoop
 
Requests for improvement to working code are off-topic on Stack Overflow. Post this at CodeReview.Stackexchange instead. — Tab Alleman 33 secs ago
 
2:57 PM
@rolfl This reminds me of
StackSort connects to StackOverflow, searches for 'sort a list', and downloads and runs code snippets until the list is sorted.
2
 
-1
Q: What would this return? Quiz

TlinkI get this cryptic quiz and it displays this function (as an image): then asks: fn("m"); no clues, no copy and paste into an IDE

0
Q: Have I implemented my php code for the MVC pattern properly

ArtekIn order to improve my PHP skills I decided to implement my own MVC in php. So far it can display movies on the main page and show movies by categories. Obviously I use rewrite mode in .htaccess file. I don't want to show to much at once so i will show the router code and the code that displays m...

 
That panic sort is somewhat, really scary !
 
my code: you have no `bar`s.
the print output: you have 10 `bar`s.
integrating with 3rd party APIs sucks. It's such an ightmare to test.
 
@DanPantry You can mock the API all you want, doesn't make it easier.
 
It's not easy to mock APIs in some languages than others. It's also not a good idea to mock what you don't own. My philosophy generally would be to just test the bits and pieces around the API and then add smoke tests.
However, in this specific case that's not that easy, since I need to make calls to a different API depending on the response from one API
._.
And there are no interfaces in Elixir.
Also, it's complex enough that I've fallen into the trap of JUST WRITE CODE UNTIL IT WORKS
 
3:11 PM
user image
2
 
...sorry :D
 
@ScottMermelstein Uh, did not realise pseudocode does not belong there. Anyway, there was no option to move it to Codereview and it is closed here already. — trailmax 47 secs ago
 
@MathiasEttinger lol, the StackSort
 
Yes, should be interesting to implement ^^
 
psuedocode does not belong on CodeReview either — Malachi 47 secs ago
@user1251007 It is okay to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 33 secs ago
@trailmax - going along with what the others have said: It is okay to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 15 secs ago
 
3:27 PM
@SamOnela I gotta download the auto commenter again, and put that in there! there is a meta post with most common comments. it is mostly for close vote comments after you vote to close, but I think that may be something that should be added
 
@Malachi maybe I should use that instead of Google Keep...
 
I don't have the post link handy though
> StackSort connects to StackOverflow, searches for 'sort a list', and downloads and runs code snippets until the list is sorted.
 
35
Q: Frequently Posted Comments

Simon ForsbergOn Code Review we often encounter questions with the same kind of problem over and over again. Some of us are using the auto comments script which allows you to maintain a list of comments to post. What are some useful tin-can comments that can be good to have in your list of comments? If you ...

@Malachi It should be fine AFAIK, as it's for anything really
 
@Peilonrayz thank you
 
1
Q: How Can I Display this better?

BeccaMy code seems to be working okay .. but it just seems like a lot of copy and paste code to suit to each food. I only have copied and pasted the code for two of variables, but thinking there must be an easier way? I am currently displaying meals in relation to 'keywords' which they were able to s...

 
3:32 PM
@Peilonrayz I had installed that a while back but forgot about it... I just re-installed it :)
@CaptainObvious ಠ_ಠ $1 = ("cheese"); == $1 = "cheese";
 
3:48 PM
0
Q: Possible bad practice in my Java code

Egek92 @Override public boolean equals(Object obj) { if (!(obj instanceof MenuItem)) { return false; } MenuItem item = (MenuItem) obj; return type.getOrderTag().equals(item.getType().getOrderTag()); } I try to achieve the same without using Object.h...

0
Q: Checking if the device is rooted

Egek92 private static boolean isRootedOnSu() { Process process = null; try { process = Runtime .getRuntime() .exec(new String[]{"/system/xbin/which", "su"}); BufferedReader in = new BufferedReader(new InputStreamReader(proc...

 
3:59 PM
@Malachi We could make that a .
 
0
Q: Find the battleship

CallumDAThis is my first attempt at anything in C#. It's based on battleships, but there's only one player and only one ship. The gameplay is super simple: just try to find the ship... keep guessing until you've found it. using System; using System.Collections.Generic; using System.Linq; using System....

 
4:23 PM
0
Q: Code check required for below code

Saurabh KumarI have the following code. I am still a newbie in Reactive programming. Would like to know if anybody can review and find out mistakes for the below code. Mono<Long> count = count(m); Flux<T> list = findAll(new Query().with(pageable), m); return Mono.fromSupplier(() -> ne...

 
4:52 PM
@Mast lol
 
I love Elixir. If there's a crash at runtime it can be trapped and the caller can just transparently retry. No try/catch, ever. :D
 
@DanPantry I've been wanting to try it for years. Got as far as installing the environment.
 
@Mast wow, someone actually did it....I wonder if there is one for visual studio? I would install that at home and then get lost in some code....lol
 
@Malachi For some values of it.
 
@Mast Takes a bit of time to get used to, but we're using it in production
 
5:05 PM
@DanPantry For what (roughly)?
 
Just general webservers instead of Node
      pair = case key do
        "group_contains_group" ->
          relationships = get_in(map, [key, "left"]) || []
          children = relationships
          |> Enum.map(fn %{"data" => %{"left" => left, "right" => right}} ->
            GroupContainsGroup.build(left, right)
          end)
          {:group_contains_group, children}

        "group_owns_product" ->
          relationships = get_in(map, [key, "left"]) || []
          children = relationships
          |> Enum.map(fn %{"data" => %{"left" => left, "right" => right}} ->
an example if you're interested
This is code from a reduce function; given a map key it retrieves values from a map based on the key, then accumulates the results into a different map (or silently drops them if the key is of an unknown value)
  defp parse_relationships(map) do
    builders = %{
      "group_contains_group" => {GroupContainsGroup, :build, :group_contains_group},
      "group_owns_product" => {GroupOwnsProduct, :build, :group_owns_product}
    }

    Map.keys(map)
    |> Enum.reduce(%{}, fn key, acc ->
      case Map.get(builders, key, nil) do
        {module, method, name} ->
          relationships = get_in(map, [key, "left"]) || []
          children = Enum.map(relationships, fn %{"data" => %{"left" => left, "right" => right}} ->
Which can be refactored to this
 
Monking
:o h ey @DanPantry, that's been a while!
 
@DanPantry Right.
 
My colleague wrote it for some kind of CI server that actually executes builds though @Mast
hey @skiwi
 
5:30 PM
posted on March 23, 2018 by CommitStrip

 
@CommitStrip Two words: quirks mode.
3
 
5:50 PM
Oh my dogs, IE6, blech. IE8 was bad enough.
 
I remember those days.
The additional popup blocker I got installed was a godsend.
Although the release of Firefox was even better.
 
I just removed some legacy code from our intranet that was looking for ns4 via document.layers and ie via document.all :|
 
I think codereview would have been better suited to answer a question like this — smac89 58 secs ago
 
6:09 PM
-2
Q: Warning: Illegal string offset 'asturian' in C:\xampp\htdocs\dokeos\main\lang\english\trad4all.inc.php on line 632

Truth TrollI have a lot of this type of error: Warning: Illegal string offset 'asturian' in C:\xampp\htdocs\dokeos\main\lang\english\trad4all.inc.php on line 632 Warning: Illegal string offset 'bosnian' in C:\xampp\htdocs\dokeos\main\lang\english\trad4all.inc.php on line 633 Warning: Illeg...

 
6:39 PM
@ScottCraner I'm putting down my mug... and then, I was at MVP Global Summit earlier this month, and Scott Hanselman convinced me it was a good idea to "unify" all my online profiles - so I now have the same mugshot on LinkedIn, Facebook, Windows Live, ...and now across SE as well ;-) (only my Twitter profile remains Rubberduck) — Mathieu Guindon 37 secs ago
If your code works, and you only want to improve performance: codereview.stackexchange.com is better place to ask such a question. — Algirdas Preidžius 44 secs ago
 
6:52 PM
This isn't a code review site, but a I'll give you a pointer anyway. You need to work on your casing conventions. Classes and methods should always be PascalCased. Your method parameters should never be prefixed with a _, typically that is only ever seen in private class level members (and even then its debated if its proper). — maccettura 9 secs ago
 
7:02 PM
0
Q: Optimizing moving average function

Max FtI am trying to improve the code and speed up in C++ (Rcpp) a (centered) weighted moving average function I coded. An example of what the roll_mean function does. Note that the function works no matter what the size of x is and adapts to both tails of my data w=c(1/2,1,1/2) x=c(4,2,6,12) res=c...

0
Q: C# WinForms - Verifying that a user is a member of a group

Big EMPinI am working to update a C# WinForms application and am trying to ensure we are using a secure means of authenticating users based on whether or not they are members of one of two AD groups. The code below is used to prevent non-admin users from seeing certain screens. As it is in the current v...

 
I'm voting to close this question as off-topic because questions to review working code should, after reviewing the perspective FAQ, be asked on codereview.stackexchange.comscrappedcola 38 secs ago
@scrappedcola It is okay to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 31 secs ago
 
7:19 PM
0
Q: Read files from a directory using Promises V2

Martin YorkFollow up to Read files from a directory using Promises Removed exists() and replaced with stat() so I can check if the file is readable before proceeding. console.log("Hi"); const fs = require('fs'); const { promisify } = require('util'); function mystat(file) { return new Promise(functio...

 
We're making some changes to this behavior to short circuit the evaluation, it's in code review if you want to check back in a few weeks it should be live. — bmoore-msft 35 secs ago
 
8:11 PM
0
Q: Python Logger Inteface OOP Design

ClannadqsI just want some general feedback on the code I provide below. This is a extremely simple Logger interface I plan on fleshing out and I want to know where to go from here in an OOP manner. Is there any reason to have this interface set up like this? I'm trying to make my code as readable as possi...

0
Q: Queue Implementation in C++

SRGA code review of my queue implementation please... queue.h #ifndef H_UTILS_QUEUE_H #define H_UTILS_QUEUE_H #include <stdexcept> namespace Utils { template<class T> class Queue { private: // Node class Node { public: explicit Node(const T& data, Node* next); ...

 
8:50 PM
0
Q: Java Text Based Adventure Game

Liamso, i'm trying to make a text based game and i think i've got a good start, however, this code seems a little cluncky and im pretty sure there is a better way of doing most things in the code, i am very new to coding. package text.based.adventure; import java.util.*; public class TextBasedAdve...

 
9:22 PM
@VitaliyLutsushyn Re: "what exactly should I do to fix this" - it's hard for me to say. Your sample code is very involved and uses all kinds of hard-to-grasp utilities that nobody knows (TransferredData::ToBuffer(...) const? BytesToReceive(FrameSize? _BindMessageRemainder? etc.). I'd say you should probably start with a much simpler, isolated piece of code, and possibly invite a code review on Code Review before proceeding on integrating it into your codebase in such elaborate ways. I know that's painful, but the fact is you probably jumped in a bit too soon. — sehe 45 secs ago
 
0
Q: Class Iteam: Answer to one of the unsolved Stack Overflow Qes

NiceBuddyI would like to improve my skill on C++ concepts and I came across the following question in StackOverflow, which has been directly asked by a StackOverflow-user without any preliminary attempts.(unfortunately, I have only the image of the question, since the actual post was an unsolved question,...

 
9:39 PM
Wow, after all this time I get a new answer to one of my old questions!
0
A: SudokuSharp Solver with advanced features

Vadim OvchinnikovThis is amazing. Especially for person who is not using C# every day for years. My main concerns are too many thing that are public that should be internal. error-prone method AddRow of SudokuBoard. I'd prefer single string array passing to SudokuFactory constructor instead of multiple AddR...

 
9:50 PM
I suspect, You have just forced the correct function to be called now. Probably there is another function select somewhere... or some other problem. I would suggest You paste your code on codereview.stackexchange.comRobert Andrzejuk 19 secs ago
@RobertAndrzejuk a question like this would likely be closed as off-topic on CR since it (i.e. proposed code change) doesn't lead to working code... — Sam Onela 59 secs ago
 
@SimonForsberg It's funny how you were doing C# back then, and I was doing Java, and now I'm doing C# and you're doing Java
 
@skiwi the tables have turned...
 
Doesn't take away that Simon always has done lots of Java as far as I'm aware
 
They're not too different from each other so I could see going back & forth
 
just like JAVA and JS ;)
 
9:59 PM
Yeah JAVA and JAVASCRIPT are basically the same, right...
 
and VBScript, too!
 
@skiwi I've always almost always done Java. That was just to try C# for a weekend challenge, to see how LINQ and yield worked.
Dec 18 '13 at 2:17, by retailcoder
Looking at @Simon's Sudoku solver code. In 2 years of C# I never used yield because I failed to understand what the keyword does the first time I came across the thing. He uses it everywhere he can. This guy is a programmer. I'm just a nerd.
 
10:16 PM
hahahaha
@SimonForsberg
Dec 18 '13 at 0:59, by Simon André Forsberg
I've worked some with Github, but I really could use more experience in it. Forking a Github project would be a good challenge for me (hopefully shouldn't take an entire weekend though)
 
@Phrancis Oh God.
Now I'm the git-guru at work
 
Mwahaha.
 
10:33 PM
@SimonForsberg I'm the hit guy too, but it's hard to convince people as svn isn't that terrible
 
00:00 - 23:0023:00 - 00:00

« first day (1784 days earlier)      last day (2239 days later) »