« first day (2273 days earlier)      last day (1751 days later) » 

12:00 AM
RELOAD! There are 6288 unanswered questions (89.6975% answered)
 
12:11 AM
This Zombie-hunting thing is hard work.
5
 
12:39 AM
0
Q: Difference between dates in Months and Days

Nick AlbrechtSo I've written a function that returns how many Months and Days are between two dates. I want to respect calendar month boundaries, but I'm ignoring time as it's not relevant for my needs. I've got the following, but I feel like I'm missing thing I can do to optimize it/refactor it. So I'm look...

 
12:59 AM
0
Q: Cryptogram-Puzzle | Python

Jesse BriorStill learning Python, but thought this was kinda a cool project to work on. Feel free to critique and let me know what to work on or change. main.py # -------- MODULE IMPORTS -------- import random # -------- CLASS IMPORTS -------- from phrases import Phrases # -------- GLOBAL VARIABLES ----...

 
 
1 hour later…
2:00 AM
If you have a working code and is looking for a review, you might want to check codereview.stackexchange.com. Just make sure you check and follow their guidelines. — Andreas 16 secs ago
 
2:17 AM
Belongs on codereview.com, but it is inefficient to flush after every write; on the other hand your application may demand flushing of every log message so as never to risk losing any. — user207421 23 secs ago
 
2:44 AM
I'm voting to close this question as off-topic because it belongs on a code review site. — Thilo 52 secs ago
 
 
1 hour later…
3:49 AM
How to separate state from logic?
0
Q: AWS_CDK - How to separate state from logic?

overexchangeAWS_CDK is provides abstractions to write programmable cloud formation templates. We are using TypeScript. But, I see that AWS CDK did not provide abstractions to separate state from logic. In the sense, below example from cdk documentation: import s3 = require('@aws-cdk/aws-s3'); // "this" is...

 
4:10 AM
@pacmaninbw about the names I am complaining that you include the constraint type in the name, FK should not be part of a name. camel case is not a big deal.
@pacmaninbw The choice of PK ,even if you are forced to use a numeric value, should not include non-key attribute. For instance the PK (id, first name, last name) should just be PK (id). The combo first name and last name should not even require to be unique.
 
4:38 AM
0
Q: Reviewing non-working code when author thinks it's working?

user11536834I came across a pretty simple question where the author explicitly states: The function returns the correct output, and all known edge cases have been accounted for. I took this at face value and started writing up a quick review. Examining the code further, it turned out to be broken. I we...

 
I'm voting to close this question as off-topic because it probably belongs to codereview.stackexchange.comReblochon Masque 23 secs ago
I'm voting to close this question as off-topic because this is better suited for Code ReviewChris 47 secs ago
So what is the problem in your code? If it is purely about optimizing, I believe this belongs to Code ReviewChris 13 secs ago
 
5:21 AM
-1
Q: Android code crashes when opening in an emulator

BaRudI am very new to java, but for some reason, trying to create an app the app is building properly in android studio, but, when trying to open in an emulator, it is crashing. This is my complete code is the zip of the app, with I guess, the main error is final View rootView = inflater.infl...

 
5:48 AM
Monking
 
6:01 AM
1
Q: is there way to make faster to write to a file?

monkwith open(filepath) as fp: #line = fp.readline() cnt = 1 while line: line = fp.readline() print("Line {}%: {}".format(cnt, line.strip())) line = line.replace('\n', '') #print('line->',line) rst = read_ct[read_ct['user_id']==line] #print(rst) ...

 
6:11 AM
Monking
 
@Zeta Monkin'
 
1
Q: Can we convert the below code to O(n) instead of O(n^2)

Yashwardhan PauranikI have 2 data structures with me in JS. One is an array say of length N. Let's consider N = 4. const arr = ['a', 'b', 'c', 'd']; The second one is an object: const obj = { a: 0, b: 2, c: 3, z: 5 }; I wrote a code in Javascript, to create a new object out of obj which should not cont...

1
Q: Project Euler # 53 Combinatoric selections in Python

emadboctorThere are exactly ten ways of selecting three from five, 12345: 123, 124, 125, 134, 135, 145, 234, 235, 245, and 345 In combinatorics, we use the notation, 5C3=10. In general, nCr = n! / r! (n−r)!, where r≤n, n! = n × (n−1) × ... × 3 × 2 × 1, and 0! = 1. It is not until n = 23, that a value e...

 
6:31 AM
Monking
 
Monking, I suppose
 
7:09 AM
@dfhwze Gets tricky, not worth the trouble IMO.
@pacmaninbw The database when it's in use, after creation.
You build a bookcase. You provide methods for filling the bookcase. Who's using the methods? How?
 
0
Q: How to avoid nesting in code where we deal with Monads

Sandio To avoid nesting I use for comprehension instead of nested map and flatMap, which of them is most recommended way while dealing with Monadic data types in functional programming. For comprehension version of the code: val result: Future[T] =(for { result1 <- Future[T1] ...

 
7:40 AM
0
Q: ERROR PAGE:Notice: Undefined variable: BUT data is getting entered in database

WhiteRoseSo My code seems to be working as data is being entered in database after my form is being submitted.. However, concurrently, another ERROR page is being generated with the above error message. And an additional field without any data is being created in my database. Here is my code for my html s...

0
Q: java very basic singly linked list

user3300327Here is implementation for singly linkedlist. Any suggestions are most welcome '''java''' package linkedlist; import java.util.Scanner; public class linkedlist { private int size=0; private Node newNode,oldNode,firstNode,displayNode; public void createNode(String value) { if(size==0) { ...

 
8:20 AM
0
Q: Brute for Looping & formatting Or Create Union range & Format? Which is efficient and when?

Ahmed AUMay be my question is not up to the standard for Code Review, but of upmost importance for reassessing methods used in my VBA coding . While preparing/testing answer for a SO post (thought to simplest of simplest questions) VBA cell format that contain a specific percentage value, I came to a jol...

 
8:47 AM
@RMunroe A double-nested arrayformula? Hmmm
Excel can do some pretty powerful things though, especially when (ab)using both VBA and Python to make the circus complete.
Should Yvette arrive: we can't accept this question and will return it to SO.
 
0
Q: Fastest method for string comparison in python

Maeaex1I was wondering what's the fastest method to compare similarity between two lists of strings (e.g. two dataframes, documents etc.) using levenshtein distance or other procedures. I am currently using: def wuzzyfuzzy(df1, df2): myList = [] total = len(df1) for idx1, df1_str in enumer...

0
Q: Does this process_value() function look like it is written properly?

Alexis WilkeHere is a function I just wrote and I'm wondering whether there would be better ways to implement it? void severity_variable::process_value(message const & msg, std::string & value) { severity_t sev(msg.get_severity()); severity::pointer_t severity(get_severity(sev)); if(severity == ...

0
Q: how to read a huge SAS7BDAT file in python Pandas and overcome memory overflow?

SmurthyI'm having memory overflow issue with the code below when I read huge file, code is converting a sas file to parquet by hashing few columns. import pandas as pd import ast, sys def sas2parquet(df,col_names): lis = df.columns.tolist() tgt_path = col_names[0].replace('.sas7bdat', '') for i in c...

 
9:12 AM
@CaptainObvious You should download more RAM.
 
0
Q: Determine if a triangle is equilateral, isosceles, or scalene

badukerI've been fiddling around with some easy code challenges and there's one about determining if a triangle is equilateral, isosceles, or scalene. I've come up with a working solution, but I feel this could be greatly improved and/or simplified. The sides of a triangle come in a list e.g. [2, 2, 2...

0
Q: Rails controller refactor with MiniMagick implementation

mr_muscleI've got below implementation for my controller and show action which implements MiniMagick gem. I've just wondering is there any better way to write it down? If block in a separate, private method maybe? def show identification_document = IdentificationDocument.find(params[:id]) autho...

 
9:37 AM
@Mast ok
can you reject it?
 
@YvetteColomb If a 5th close vote comes in, it will be.
Migrated questions that get closed are automatically rejected IIRC.
 
yes they di
I'm wondering if I can reverse it, let me find out
 
I knew you were interested in migrations towards CR, so I was hoping you'd keep an eye on the current process among SO mods. This isn't the first migration we reject and all migrations are from mods. Indicating at least some of the mods may benefit from extra instruction we're perfectly willing to provide.
 
@Mast I am interested. I will ping the mod involved and I appreciate the ping.
 
@YvetteColomb Glad to be of service. You know where to find me if you need anything :-)
 
9:43 AM
I haven't seen a migration request for a while to code review. mind you the flag queue is big and I'm not getting to the bottom of it lately
@Mast thanks and vice versa
 
This question is for Code ReviewBob 49 secs ago
@Bob This is absolutely unsuitable for Code Review by lack of context. Please refer to their help center before making further recommendations. — Mast 54 secs ago
 
@Duga 4 votes on that comment, sigh.
 
hm I should keep up with Duga and see what posts are commented on
would it help if I come into this room every day?
 
@Bob If you want more information than that, take a look at the FAQ: A guide to Code Review for Stack Overflow usersMast 57 secs ago
@Mast I've read it and it says also that, there are question on-topic on both sites, so that means in my oppinion , that's also suitable for Code Review. — Bob 26 secs ago
 
@Duga The nth time I'm going to explain this to John Doe from SO.
@YvetteColomb It certainly won't hurt anything, but the average SO user won't be able to migrate it anyway. It's probably moderators responding to custom flags where things go wrong here. You're in a better position to raise awareness among the SO team than the average CR user. Martijn used to do a lot of good in regards to debunking migrtion myths among the SO populace, not sure what he's been up to lately.
 
9:55 AM
@Bob please do not make recommendations for migration to sites you have limited experience. Code Review has strict migration guidelines. — Yvette Colomb ♦ 29 secs ago
 
@Mast yes he did. He has helped me a lot. He still does a lot, I've left the baton. I'll pick it up again. Thanks for the heads up. If we need to we can always post another meta post on SO. But I'll wait and see how we go. Currently SO is in a state of flux, but I'm hoping it's sorted out soon
 
0
Q: Using flexbox to replace fixed and absolute positioning

SamI'm using flexbox to create a simple header, hero image with caption and footer. As you can see from my snippet, the header is fixed and the hero image scrolls underneath. Is there a way to achieve my layout without fixed or absolute positioning? I'm relatively new to flexbox and and haven't co...

 
@Bob With this particular question it's clear that the code in the question is not the OP's actual, real code, as you have the If vs. if issue and also ProgressBar vs. progressBar, so this question would get closed on Code Review directly, as it's currently written. — Simon Forsberg 1 min ago
@Bob The topic itself, about simplifying if-statements, is absolutely a good fit for Code Review. But I would have guessed that the OP will just see "Oh, I should copy-paste this exact question to this site instead" and then it would be closed on Code Review, leading to unwanted experience for both OP and Code Review. The question itself is not the only requirement for a question to be on-topic on CR, the code also matters. — Simon Forsberg 44 secs ago
 
10:12 AM
Shall I place the last cv? @Mast @YvetteColomb
 
@Heslacher yes please :)
 
@Heslacher Sure.
 
on hold
 
@YvetteColomb in a state of flux?
 
And migration rejected.
 
10:14 AM
yep it's back and thanks
@SimonForsberg have you seen our meta site?
 
@YvetteColomb Doing my best to avoid it :) Anything in particular I should see?
 
@SimonForsberg I linked the posts above. It's a huge thing ttytt. And avoiding it, is wise... you'll have lower blood pressure
 
0
Q: Why was this answer for "Add and Search Word" deleted without any comments?

t3chb0tI'm wondering why a perfectly valid answer with two upvotes for the Add and Search Word question has been deleted? There is no comment explaining this strage action. From a regular user's point of view a ♦ has removed it single-handedly witout prior community voting for deletion or without asking...

 
yesterday, by Mast
Oh don't worry, the community won't play much a role here. It's just the mods who can wreck havoc by featuring whatever post they like. :-) ... but yeah, jokes aside, I don't think it is practically possible nor feasible for users to come up with a process for featuring posts. My plan as of now is to just feature every post that crosses +3 or dips below -3. That should help some of those posts get the traction that they need to rise further up. — Bhargav Rao ♦ 6 hours ago
 
10:17 AM
@Mast yeh it's the result of all this that is actually huge
 
-1
Q: hourglass sum code

Adarsh Kumar PandeyCan someone please tell me why this code is giving wrong answer ... I don't seem to find the mistake... #!/bin/python3 import math import os import random import re import sys if __name__ == '__main__': arr = [] min_sum=-9*7-1 #all elements of an hourglass become min val ie -9 here ...

 
@CaptainObvious broken
 
@Heslacher It's almost 'pick a random close reason, they all apply'.
 
;-)
 
You added example dataset, now add expected output based on your example dataset and explain what your rules are. This is not a code review site. — Erfan 28 secs ago
 
10:40 AM
0
Q: Calculate Exchange Rate between two currency

lio oliverthis method definition for you to implement: CurrencyExchange.rate(date, from_currency, to_currency) The method definition should not be changed. This method must return the exchange rate between from_currency and to_currency on date as a float. If the method is unable to calculate the exchan...

 
10:56 AM
0
Q: Code following bulleted list not formatting

LinnyI encountered this bug a few minutes ago, and decided to bring it up here. It happens when both asking and answering a question. Steps to reproduce 1. Create bulleted list with a couple/few items. I checked, the size of the list doesn't matter, whether it's one or seven items . 2. Post a piece...

 
11:14 AM
@Feeds It's not a bug, it's a feature.
 
@Feeds that part of markdown parsing is a bitt annoying, but there's not much else possible there
 
11:30 AM
@Vogel612 can you switch to this question codereview.meta.stackexchange.com/q/9257/29371 because you have deleted that answer.
 
already on it :)
 
great
 
Would bot-support for highlighting zombies be a good idea (i.e. a bot that declares when a Zombie is some number of days old)? I can't see any references to this idea before, but I'm not much good at searching for things.
(I wrote some musings as an answer to a meta question, but then realised it shouldn't be an answer to that meta questions, so now it's a gist)
 
Unrelatedly: The question activity indicators have moved to under the title. That's realy cool
@VisualMelon You're looking for Robo-Santa
 
Thanks, I'll search him out.
 
11:34 AM
23
Q: RoboSanta the pimp

janosRegular visitors of the 2nd monitor chat room may be familiar with @RoboSanta, a friendly bot, pimping posts that are hopefully upvote-worthy. Currently RoboSanta posts one Naruto answer per day (accepted non-selfie answer with zero score on a non-closed non-deleted question), randomly selected...

I think Janos has been poked more than once about reenabling that particular bot
 
0
Q: Bigram extraction code, can it be made faster?

SandiI've written this code in Scala that extracts bigram statistics from the Reuters dataset. It puts the statistics in a Map[String, SortedMap[String, Int]]. For example, the bigrams for "hi" could look like this: Map("hello" -> SortedMap("there" -> 10, "friend" -> 6)) which means that "there" fo...

 
11:59 AM
0
Q: F#, Timer and propperly removed ElapsedEventHandler

Wojciech SzabowiczI have a simple program that looks like: [<EntryPoint>] let main argv = let mutable timer = new Timer(float 5000) let OnTimedEvent (frameId:uint32) : ElapsedEventHandler = new ElapsedEventHandler (fun obj args -> printfn "DATE: %A FRAME: %i" DateTime.Now frameId) while(true) do ...

 
@Heslacher Answered.
@VisualMelon FWIW that looks like a good answer or possibly even new question
 
12:16 PM
@VisualMelon About bots: if you write something useful, let it do a test-run on it's own chat room and point a couple of users from here towards it. If it's useful enough, we'll support it in The 2nd.
If you got the next RoboSanta and it helps with keeping the zombies down, we're probably all for it.
Or, if you want to make it interactive, keep it in it's own room, make a meta post about it's launch and see what happens.
 
Could be a good weekend project...
I'll have to look at existing bots, to find one writing in a language I can cope with (far too lazy to read the documentation)
 
@Ctx "If you reverse the logic, you could close everything as opinion based." What logic do you want to reverse? "If not X then not Y" does not imply "If X then Y" - that is a classical fallacy. I would like to point to the existence of codereview.stackoverflow.com which specializes in exactly these kinds of questions. — Max Langhof 56 secs ago
 
@VisualMelon Duga is written in Java / Gradle, RoboSanta was python if memory serves and then there's repos like SmokeDetector (also python) or Zirak's Chatbot
that last one is Javascript
 
I'd better look at Duga then...
 
12:32 PM
@VisualMelon SO has a couple of interactive bots finding questions that are interactive. Charcoal, SmokeDetector, what are their names nowadays...
Interactive bots finding interactive questions, uhu...
If anyone is wondering why all my mistakes are still visible, that's because the browser on my current machine doesn't support this chat too well so editing is not possible.
3
 
12:59 PM
0
Q: How could I avoid foreach loop

Roxy'ProI'm getting articles from db, and each article has it's own list of histories (as price changed etc) and there inside should be ModifiedBy - to check who modified it, and because of that I need to loop throught each row of history to set ModifyName.. I think it might be avoided? Check code below...

 
Looking at Duga now; I've never seen Groozy or Grails or Gradle before, and I only pretend to know how to use Maven when other people ask me for help ;)
3
Thinking about reading this and exploiting this, so that I can stay in my comfortable world of bodged together C# with minimal dependencies.
(thanks for the links)
 
@VisualMelon Story of just about everyone here.
 
0
Q: python automagically closing a file?

nz_21Am I right in thinking that this will automatically close a file? def get_file(): with open("file.csv", "rb") as f: yield f If not, how do i write a function that returns a file object, whilst making sure that it closes the file after the receiver is done using it?

 
Just had a smoke, and my intern came in and said his pc is burning.....
Its just too hot today
 
1:26 PM
@Heslacher literally burning?
because... yes it's waaaayy too hot
 
Yes, at least the cables are burnt now
And now I have a nice smell inside my office :-(
4
 
1:39 PM
1
Q: React - calculator - how could I can I impove my code?

javascriptingI hope its the right place to ask. I have a calculator (in React) and I wonder if the way I did is is good or what I could improve. I wanted to do it like the iphone calculator (you dont only see results when you press =) and I feel like my code became a little messy. Any suggestions would be awe...

0
Q: Suggestions for implementing Merge logic

LinuBelow is a stored procedure which we use to port the data from a remote server to our Data ware house server. THE SP uses a generic style where all the table's along with it's schema and data will be loaded into the data ware house. The script is working fine, but now we have a requirement where...

 
@VisualMelon You don't need to know anything about Groovy or Grails. You can choose between using Maven or Gradle. It is possible to use neither, but I wouldn't recommend it.
@VisualMelon Well, if you are used to C# then I guess that's what you would go with
 
'used to' isn't how I'd put it ;)
 
1:57 PM
@VisualMelon Well, in that case I'd go with @Duga
 
0
Q: c++ sqlite3 wrapper

dev65this is a simple wrapper for sqlite3 to make working with databases easier it isn't a professional implementation but it is much better than the raw c interface I saved much time and code using this wrapper instead of the raw interface any improvements will be appreciated HandleBase.hpp #pragma...

0
Q: Check validation of data entered after form submission and display msg/warning box using Razor Pages

user11692177There are four categories(Technical, Quality, Extracurricular and Economics) in a school and 5 free days. Each student has to invest in a course under each of the four categories AT LEAST ONCE during the 5 free days. (For example, Technical on 1st day, Extracurricular on 2nd day, Economics on 3rd...

 
If you have a working solution and have questions about efficiency, then the question is more suitable for CodeReview. If however you don't have code that works exactly as you really would want it, then share your code and describe the problem it has. — trincot 45 secs ago
you dont have to open/close the file for each single log message. btw for code reviews there is codereview.stackexchange.com. Just make sure to post complete and working code there. — formerlyknownas_463035818 12 secs ago
 
@Hosch250 Shhhhht, don't give away our secrets.
@Heslacher Which one?
Power cord?
 
2:14 PM
Power for hard disc and dvd
 
Odd
Well, that's one way to get a hardware upgrade.
 
@VisualMelon I have to admit btw that using Grails was a mistake. I'll never do that mistake again.
 
@SimonForsberg How was it a mistake?
 
-1
Q: Ubuntu 18.04.2 Non-canonical terminal input

Shift_LeftAskUser has been developed as a means by which to get a single keystroke in non-canonical mode without echo and return the ASCII value to calling procedure. Prompting should be intuitive enough that the user realizes input in the range of 0-9 or A-Z or any ASCII character from 32 to 127 for that...

 
@SimonForsberg It's not a mistake if it seemed like a good idea at the time.
I'm still waiting for maven to download at the moment, but I'll let you know if I make any progress.
 
2:22 PM
@SimonForsberg So, Duga 2.0 will be made using something else?
 
@Hosch250 Grails is using "convention over configuration", which is sure a good thing... IF YOU KNOW THE BLOODY CONVENTION - otherwise it's a mess.
 
Yes, I hate convention over configuration.
 
@VisualMelon Well, I did learn something, so that was positive
 
Rubberduck uses that, as do some other projects I've worked on.
It's impossible to remember all the conventions it uses.
 
@Mast If I would do it today, I would go with Kotlin and LinAuth.
@Hosch250 Take something like this line for example: github.com/Zomis/Duga/blob/develop/grails-app/controllers/net/… - that's some very black magic right there. I've seen a lot of black magic in my days, but this beats it all
 
2:26 PM
Does that basically say that everything has to come in as a POST, not a GET, etc.?
I could do that with a one-liner middleware in OWIN too.
 
@SimonForsberg Heh, that's what I think when I see modern Python.
 
@Hosch250 Might reject everything not a POST, looks like it.
 
@Hosch250 for the method "hook", yes.
 
2:31 PM
Oh.
In ASP.NET MVC, you use an attribute [HttpGet]. You can also optionally override the route there, as [HttpGet("/Foo")].
 
@SimonForsberg At least it's succinct.
 
That goes on the method.
You might be able to put it on the class, but I don't know.
 
@Hosch250 In Java Spring Boot, you use an annotation @PostMapping, also on the method
 
There is code review, but that's impossible since nodes are not in SCM, so can't be seen as having been edited during code review. — CallMePickle 29 secs ago
This question should be asked on code review SEd_kennetz 17 secs ago
As d_kennetz stated, this is not code review. If you want help, you have to explain your logic in words, and not expect us to go through your code and reproduce a better answer for you. — Erfan 28 secs ago
 
ASP.NET MVC has both.
You can set up as many default routes as you want in the config methods.
And you can override those with attributes on the controller classes/methods.
 
2:42 PM
I'm new to stack overflow. Didn't even know that code review existed. — SCool 57 secs ago
@PatrickHonorez no. this is clearly a very specific question involving hypothetical illustrative code, Code Review is for revieweing all aspects of real, working code. Illustrative example code like this is explicitly off-topic on CR. — Mathieu Guindon 29 secs ago
 
Greetings, Programs.
 
@SimonForsberg meh, that's really not that bad
 
OK, I'm reading the guide to Code Review for Stack Overflow users, and I have a question. How much context do you actually need? Must questions explain every line of code and what it does, or is "this is an ORM" sufficient?
 
would you be mad if I said "it depends"?
3
 
[sigh]
2
No, just unenlightened.
 
2:49 PM
Like... there is a difference between "I implemented a Doubly Linked List" and "I implemented an ORM"
 
@RobertHarvey No, you don't have to explain every line. But you should provide enough detail so that someone reviewing the code has some idea of what it's doing and why.
 
the first one says basically everything that you need, the second one still leaves a lot of things unanswered
 
The first one does what every coder is told not to do.
And if I'm getting reviewed, I'd prefer not to telegraph my presumptions.
 
You really want to say why too.
 
Why is good.
 
2:51 PM
I implemented a doubly-linked list because my professor told me to.
 
Well, some of those presumptions are actually useful to the reviewer. Tells us why you're doing the arcane things you did.
 
@Hosch250 Ick.
 
Vs. I implemented a double-linked list because I need to represent links in a chain.
And each link has X properties.
 
@RobertHarvey I'd answer that with: Don't modify your code just for the sake of putting it up on Code Review. If you don't do that, then we normally have all the context that we need. We want the code as-is.
 
But you can't get from the first to the last without following all the middle ones, so a doubly-linked list is what I need.
 
2:53 PM
@SimonForsberg Yes, the moment somebody starts talking about simplified code, alarm bells go ringing. We've seen in the past that reviews on such code are nigh useless to whoever posted the code.
 
But then we can say "Oh, you might want a singly-linked list because your code makes assumptions that you can only move forward in places A, B, and C.
Basically, we like enough context to A) review the code as-is, or B) recommend a completely different path if necessary.
 
unless.. you explicitly state you are reinventing the wheel
 
Yep. That's like the "my professor told me to" case, where you are studying it to learn new principles that can be applied with or without various transformations to other problems.
 
I remember the trouble we had with a high-scoring migrated question here. Turns out all he wanted was verification, not a review. It's one of the highest-scoring off-topic questions we have.
Don't upvote that people...
 
@Mast oops
 
2:57 PM
IIRC, it had a bunch of bounties on it for a long time trying to get people to answer it.
 
@dfhwze You have 5 minutes to take it back or something.
 
@Mast =D
 
0
Q: .apply() on a dataframe with conditions, editing updating values, and returning the whole row. Can this be optimized?

SCoolI am using an API to check if customers have social media profiles. Depending on whether they have phone or email or both there's a different search type. There's a lot of conditions in this function, and the real dataframe has about 50 columns. So I'm just wondering if this is the most effici...

 
@Hosch250 Yes, only to boil down to a bad migration. The question failed the first rule of CR: do I want a review?
Mighty fine answer, OP responds with:
@syb0rg Mmmhhh... I think you're answer is a little off-topic, but I'll accept it anyway — DavideChicco.it Jul 29 '16 at 17:02
No, that's not how it works.
Details matter. Context matters.
 
OK, what's wrong with this one?
1
Q: Design recommendations for Image Converter Class

sfunI am writing a small color space converter for a device, that records an image and displays it on a screen. The image is available as a planar 4:2:2 YUV image and needs to be converted into a 8 bit/channel RGB image. It is possible, that in the near future, the color space of the input image will...

 
2:59 PM
@Mast Votes doesn't have to correlate with on-topicness
Still, the question is pretty damn cool
 
@SimonForsberg I know.
 
@RobertHarvey Looking
 
> The following simplified code shows the implementation of the image types
 
@RobertHarvey It has a whole lot of methods that are not implemented
 
That's problem #1.
We want the real, unmodified code.
void ColorConverter::convertImage<YUV422_LOGIISP, RGB888>(YUV422_LOGIISP const& src, RGB888& dst) {
// Do actual conversion
// Handle indices to access correct (y,u,v) values
// For every (y, u, v) set, call src.yuc2rgb to obtain a the rgb values
}
A stub method, which is also off-topic.
 
3:01 PM
Oh, I see.
I guess I was confused by "lacks context." That part of your guide doesn't say anything about unmodified code.
Thanks for looking.
 
It's explained in the close reason, which contains a link.
 
I can't get to the post you rejected. I don't have sufficient rep.
 
> 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.
 
OK, I think I see a potential feature request.
An option to not move answers when migrating a post.
 
> If your question contains stub code, then there are significant pieces of the core functionality missing, and we need you to fill in the details. Excerpts of large projects are fine, but if you have omitted too much, then reviewers are left imagining how your program works.
 
3:03 PM
Because more than once, I've seen a post that has N answers, and think it's not worth answering, but then find it was migrated and doesn't have any good ones.
Whereas if we nuked the answers when migrating, we'd see that it was still a zombie right on the home page.
 
That's one of the dangers of migrating.
 
@RobertHarvey I guess Prefers code in its "native habitat" goes in that direction, which is in the guide.
 
Yup.
 
That's fine. It took me ages to find the post because I work two sites and your rejected migration 404's on your site.
 
Well, good job finding it. I know @YvetteColomb was here earlier today discussing the same question.
codereview.stackexchange.com/help/on-topic also has a handy checklist for on-topicness
 
3:07 PM
It would be nice if the 404 page listed the close reason, instead of "Duh, bad thing happened."
5
Not exactly informative.
 
@RobertHarvey The "lacks context" close reason has a bunch of odd clauses including "general best practices"
 
@RobertHarvey Sounds like a network-wide feature request for migrations.
 
@SimonForsberg Not just migrations.
Any deleted question just says "removed by mods".
 
@Hosch250 Does it even say by mods ?
 
No.
It says something like "this question was removed for reasons of moderation".
OTOH, that makes sense.
You don't necessarily want to broadcast why a post was removed.
So, it would make sense for migration-only removals.
"This question was migrated to X. Find it [here]."
 
3:15 PM
@Hosch250 You get automatically redirected on migrated posts. This however was a migration rejection.
Is different.
 
Oh.
So rejecting a migration leaves it deleted on the original site?
That seems wrong... It should remain open for normal closure, or get auto-closed with a generic reason (too broad, maybe, or a custom reason just for this).
 
@Hosch250 No, it leaves it closed on both sides. In this case, I think @rolfl manually deleted the migrated post
 
@Hosch250 It's already closed if it's migrated.
 
I did,
 
0
Q: Unity Custom InputManger for Cross-Platform Input

FlamesWillBurstI have been working on my game for quite a while. one of its key features is cross-platform local multiplayer for example 2 players on 1 keyboard and some people on the controller. However after finishing my script which took me a whole day to get it running just the way I want it to work. it wo...

 
3:18 PM
OK, thanks for the corrections :)
 
The SO mods actually contacted us to apologise for the migration before it was closed on our side.... but I did not get their ping until after it was closed here.
 
@Hosch250 The whole reason for migration is that it's off-topic on one site, but on-topic somewhere else. So if you encounter a situation where a post gets migrated, migration rejected, and re-opened on the original site, then it shouldn't have been migrated in the first place.
 
It was already rejected, and closed here.
hi Simon! ;0
 
In that case, it would probably come down to "show the close reason on moderation-removed questions" regardless of migration.
 
I think we should start Sweding instead of Monking....
6
 
3:22 PM
And might as well show the delete reason too.
 
Hi @rolfl!
Oh, wait... I mean...
HI @ROLFL!!!
 
You can see the history on the SO side if you look at the edit history there ;-) stackoverflow.com/posts/57185289/revisions
;-)
 
oh sorry i didnt know about code review i just found out from you thanks i will move it there — Boozie 36 secs ago
iam tempted to say this is off-topic on stackoverflow as the code works and the question is about refactoring.. This seams more on-topic on code review which is a other stackexchange site — Raymond Nijland 26 secs ago
 
@RobertHarvey @YvetteColomb Could you migrate this one to us? stackoverflow.com/q/57193227/1310566
 
@user207421 I believe you mean Code Review Stack Exchange. Make sure you really understand the scope of that site before recommending it though, but in this case I think you are right — Simon Forsberg 43 secs ago
 
3:28 PM
@Duga @Simon ex-moderator and you think you're right? snickers
I'm fairly sure.
 
@SimonForsberg done
 
@Mast I didn't spent too much time looking first, I wanted to post the comment before the question was deleted
 
-1
Q: Printing only the sheets I want. It hides and unhides after printing

MushiesmuDim Good_Sheets As Variant Good_Sheets = Array( "Sheet4", "Sheet2", "Sheet1") Worksheets(Good_Sheets).Select Sheets(Good_Sheets).Visible = False ActiveWorkbook.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False Sheets("Sheet4").Visible = True Sheets("Sheet2").Vi...

0
Q: Linny: An Interpreted Programming Language

LinnyI've undertaken the project of creating my own programming language, Linny. It's a very, very simple language, with only variable creation, variable changing, and outputting to the console, but I've very proud of it. It's an interpreted language, with the interpreter being written in python3. The...

 
3:48 PM
Questions involving improving otherwise working code are better suited on Code Review, but be sure to follow their posting/content guidelines. — jmoerdyk 17 secs ago
 
Monmking
 
1
Q: Contact form with AJAX call and secured PHP with Google reCAPTCHA v3

Moosahere is a code of a simple contact form that I have created, I believe that the form is server-side protected against empty fields, header injections, CSRF, XSS, bots using 'Google reCAPTCHA v3' and so on.. The call is done through AJAX.. I just wanted to share this code and I am open to any sugg...

 
4:05 PM
I was wonder if a few people here might up votes dfhwze's answer on my question codereview.stackexchange.com/questions/215431/…. It is a much better answer than the other.
 
4:38 PM
-1
Q: vue.js | Does this bad to write following methods

iaswmnI new in vue.js and i need fast rewrite my js code. There custom inputs validator. Is this good way to use following methods: methods: { checkInput: function () { let callerClasses = event.target.classList; let inputTo = document.getElementsByClassName("inputTo"); le...

 
4:58 PM
-1
Q: Adding image from workbook to userform dynamically

TomI'm trying to write a script that will allow me to load pictures contained in my workbook into my userform dynamically in an attempt to make the workbook completely portable. I've come up with the following that seems to work but there is one line which I don't understand why it doesn't work with...

 
5:15 PM
This is a Knapsack problem, there are plenty of available algorithms for you to implement. If your code works but you need to speed it up/improve it in other ways, this might be more appropriate for code review. — user3483203 41 secs ago
Please try to ask a specific question. SO is not for code review or general debugging. — Calum Halpin 9 secs ago
 
5:34 PM
@pacmaninbw 2 necromancers on your questions. thanks :)
@pacmaninbw and thanks again! please stop voting now, I'm at my daily 200 :p
4
 
To clarify, yes - this could use some optimization (code review site - use the iterator it gives you), but it is the brute force knapsack solution and will fail horribly on a larger dataset. — Kenny Ostrom 9 secs ago
 
@dfhwze Glad to help and very grateful for both answers.
 
You should post this question in the code review stack exchangeOlegNovo 53 secs ago
 
@pacmaninbw so what's the current status of your project, still working on it?
 
Welcome to StackOverflow. Please follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. StackOverflow is not a testing or code review site. When you can demonstrate a reproducible problem, then you have an appropriate posting. — Prune 59 secs ago
 
5:48 PM
@dfhwze I plan on finishing it, but it's been on hold since April because I had to move. I could start a new project utilizing Entity Framework, now that I know EF supports stored procedures. Why are you asking? There have definitely been changes since both questions you answered. How does one normalize tables in a code first approach?
 
@pacmaninbw I ask out of curiousity :)
 
@dfhwze I still have one or two problems in add book that I haven't looked at in a while. I also need to set up unit tests for the c# code, currently only the database has unit tests.
 
@pacmaninbw The way we used to do it (current projects are in Oracle and NHibernate) is generating scripts (stackoverflow.com/questions/13939404/…) and then we could edit the scripts before we ran them.
@pacmaninbw It's imperative you make proper use of interfaces to allow for TDD (test driven development)
 
@dfhwze I haven't created unit tests in Visual Studio, I have done with shell scripts (C and C++ on Unix), PHPUNIT on Linux and SQL scripts using MySQL on windows.
 
@pacmaninbw There is a wide array of mocking frameworks available in C#. NSubstitute, NMock and RhinoMock are the ones I use most.
 
5:57 PM
-2
Q: Business Rules Engine. PHP

AlexProhA few months ago, I wrote a library that implements BRE(Business Rules Engine). But I can't find any programmer who can(and wants) to review the code. What is this library for? This library allows you to simplify the writing of rules for business processes, such as complex discounts calculation...

 
zombie hunting
 
6:17 PM
-2
Q: Sending incrementing numbers as asynchronous HTTP requests

N_PI have a webserver that replies with {"data":true} if it receives the right number between 0-999. My script is guessing the number by sending numbers 0-999 to the server one by one using the requests library. However, this is a very slow process. How could I make the requests asynchronous, let's ...

0
Q: Google Scripts (Add, Remove & Moving Record) stop timeout

R BorlandWhat is it? The google sheet that the macros are on acts as a sort of "back-end" for the records of a behaviour system at a school. I build multiple google sheets that link to this one that pull the data. Each week the behaviour records are put in this main sheet and then formulas total up the r...

 
6:40 PM
Why you shouldn't write dirty code, even if it's "just to check how it pans out, temporarily":
    return "={0}('{1}'!{2}{3}+'{1}'!{4}{3}+'{1}'!{5}{3}+'{1}'!{6}{3}:'{1}'!{7}{3}+'{1}'!{8}{3}+'{1}'!{9}{3}+'{1}'!{10}{3})".format(formula, target, chr(1+64), i, chr(2+64), chr(3+64), chr(4+64), chr(5+64), chr(6+64), chr(7+64), chr(8+64))
 
6:57 PM
0
Q: Form re-using is it good practise?

Dio ChrisI am using 3 forms which are used very much inside my project. Cause my skin elements are some kind of heavy, i deside to re use this 3 forms instead of creating again and again each time. Here i will write a mini example of my code. Form1 private void button1_Click(object sender, EventArgs e) ...

 
7:38 PM
1
Q: Possible refactors and a suitable design pattern

Dot Net developerI am a part of group that is building ERP for some months. We are having a practice of Anemic domain model. After few researches I came to know about Rich Domain Model. As ERP is considered to be a long lasting product , which would be better? Along with that I am adding code snippet to know abou...

 
 
1 hour later…
8:38 PM
0
Q: Code to Change Various Cells Running Slowly

AaronI am relatively new to scripting. My programming experience stems from a QBASIC course when I was 11, and teaching myself HTML when I was a teenager (a while ago). This script resides on what is essentially a log of orders for a company. Occasionally, orders will be "shorted" if all the products...

 
#define loop(n) for(int i=0; i<n; i++) - If I saw this in a code review I would have a serious talk with my manager about getting rid of the idiot who did that. — Jesper Juhl 48 secs ago
 
 
1 hour later…
10:17 PM
0
Q: Splitting an array into batches of 100

Umair Shah YousafzaiI wrote a bit of code to create an array out of another array where each batch will have maximum 100 records and then the last batch will have the last remaining records. Here is the code but I am not happy with it, I would like to refactor it into a more smaller and cleaner code. Can anyone hel...

-2
Q: Simple Python tkinter calculator

introvert_guyI am creating a simple python Tkinter calculator. My code works however when I was due to submit my code in my teacher said that my code is inefficient and recommended I change the following: Create buttons using a for loop have two classes - one of which is for the definitions of the functions...

 
10:37 PM
1
Q: Convert a string like 4h53m12s to a total number of seconds in JavaScript

Dirk BoerAt the moment I have this: function getValue(str) { let result = 0; var regex = /(\d+[a-z]+)/g; match = regex.exec(str); while (match != null) { var match_str = match[0]; var last_char = match_str[match_str.length-1]; if ( last_char == 'h' ) ...

 
Welcome to SO! If your code already works and you're simply looking for a review/optimization, you should post it on link instead. — Mark H 13 secs ago
 
11:37 PM
0
Q: "String Interpolation in {language}", "VBA"

Robert Todar"This is {0} cool!", "freaking" I've always wanted an easy and intuitive way to inject variables into a string. So after about 10 variations, I finally came up with this function. How it works The concept is that I can find every pattern such as {key} or {0} or whatever {taco} and get a uniq...

 
11:57 PM
0
Q: How can I get better at Java?

MrMarshallI am already coding in Java since some years as a Hobby but I always think that I make things wrong and have to improve my coding but I dont really know where to start or what to do so if someone would take his time and look at some of my code and tell me what are typical mistakes or wrong things...

 

« first day (2273 days earlier)      last day (1751 days later) »