« first day (2123 days earlier)      last day (1877 days later) » 

12:00 AM
RELOAD! There are 5866 unanswered questions (89.8989% answered)
 
 
1 hour later…
1:14 AM
Thanks for the code review @Fab if you have time, please submit a pull request with your improvements. Thanks! — Devin Garner 35 secs ago
 
0
Q: appendChild only working once

Santiago WelbesI'm trying to create a small div inside a section every time I click a button. The section is id="grid" and the button has a simple onclick="generateGrid()" my code: var div = document.createElement('div'); function generateGrid() { document.getElementById("grid").appendChild(div); } Th...

0
Q: Adding STL iterator support to custom collection class -- followup

grokI read the excellent answer to the question Example of adding STL iterator support to custom collection class on this site; but would like furthermore the iterator class to be a nested class (because of shared types). The skeleton I want is: template <typename T, std::size_t Capacity> class Ring...

 
1:48 AM
0
Q: Length of longest non-repeating substring challenge using sliding window

CppLearnerI am working on Leetcode challenge #3 (https://leetcode.com/problems/longest-substring-without-repeating-characters/) Here is my solution using sliding window and a dictionary. I specifically added start = seen[s[i]]+1 to skip ahead. I am still told I am far slower than most people (for example,...

 
2:38 AM
@SimonForsberg I've gotten as far as I can :( You'll need to add some JS to update one divs width and height. I've asked a question to see if there's a way to do it in just CSS however.
 
 
3 hours later…
5:16 AM
Also see this answer by @GarethRees where he reviewed this exact algorithm in more detail. He believes it should be O(N^3) for an NxN matrix. codereview.stackexchange.com/questions/185626/…Andrew L 10 secs ago
That said, I suppose that some teams will be hoping that applying a consistent style will keep people from doing dumb things. It's an easy thing to lint for and be sure it won't bite you. I'll just say that it's not a substitute for real code reviews, and it's important not to turn good practice into cargo culting. — johncip 10 secs ago
 
5:45 AM
0
Q: Found this deep in a group project. It looks bad and I'm sure there is a super elegant solution

Chaz CareyPretty obvious what it's doing here, but It seems pretty silly. What's a better way? public bool DidHitBounds { get { if (hitBounds == true) { hitBounds = false; return true; } else { return false; } } ...

 
possible answer invalidation by Voile on question by JuanR: codereview.stackexchange.com/posts/212741/revisions
 
6:00 AM
0
Q: How do I write code for

Ritu GillWrite Java program that displays all the uppercase and lowercase alphabetic characters, the digits 0 through 9, and the symbols +, -, _, =, &, @, #, $, ?, >, <, |, !, ~, a blank space character as well as their ASCII integer values. public class PrintAlphabetsInJava{ public static void main(Stri...

0
Q: Spring data JPA : insert 50k rows taking too long

PankajI am using Spring Data JPA with Spring boot application. My requirement is to insert 50K rows in JPA entity table in one hr or less. I have 3 entities A,B and C. Entity A have one to many associations with entities B and one to one assiciation with entity C @Entity public class A { @OneT...

 
6:10 AM
possible answer invalidation by Developer on question by Developer: codereview.stackexchange.com/posts/214002/revisions
 
 
1 hour later…
7:19 AM
0
Q: Allow console draw poker game to output more hands

zach274I'm an absolute python beginner. I created a draw poker game that works fine up to about ten thousand hands, at which point it starts to freeze and not generate the hands. Given that straight flushes only generate about once per 70 thousand hands (it may be more common bc my program uses multipl...

0
Q: Full Working of Rspec Controllers?

Sai SivaI want to write specs for controllers, Example: require "rails_helper" RSpec.describe RemindersController, :type => :controller do context "when the user is an admin" do it "should list of all Reminders" do user = create(:user) if user get :list, params: { use_route: '/reminders' ...

 
7:50 AM
-1
Q: Template instantiation for nested class

grokIn trying to code an iterator, I have the following structure: template <typename T> class mything { typedef unsigned key; public: template <typename subT> class myiter { key pos; public: ... } using iterator = myiter<T>; using const_iterator = myiter<const T>; using revers...

 
8:10 AM
possible answer invalidation by The Faan on question by The Faan: codereview.stackexchange.com/posts/213962/revisions
 
8:21 AM
You may want to try posting this on codereview.stackexchange.comtshimkus 45 secs ago
 
Monking
 
8:37 AM
0
Q: My implementation of a for_each function that traverses a std::container by some step size integer N

Francis CuglerI had written this function with the following driver program and output: #include <array> #include <vector> #include <iterator> // Forward iteration from begin to end by step size N. template<typename Container, typename Function> void for_each_by_n( Container&& cont, Function f, unsigned incr...

 
8:57 AM
@Peilonrayz Seems like you got an answer. Whether it will work or not I don't know.
 
9:17 AM
@thb Yes of course I do. It often makes code much harder to read and reason about. Virtually every time somebody posts code containing goto on the code review site, eliminating the goto vastly simplifies the code’s logic. — Konrad Rudolph 40 secs ago
 
@Duga @MathieuGuindon Could you check if this needs a rollback?
@Duga Handled.
 
If you want to have a review of your code, then please submit it to codereview. — Icepickle 22 secs ago
 
@Duga @SᴀᴍOnᴇᴌᴀ @Heslacher @Donald.McLean I'm not quite sure why this question is closed?
 
9:49 AM
@SimonForsberg If I had to guess, I’d say because the description don't even try to explain what the code is doing?
 
@MathiasEttinger Doesn't the title says what needs to be said?
"Lacks concrete context", which links to this is not for "Lacks description of what the code is doing"
5
 
@SimonForsberg Right misread "Unclear what you’re asking" in a hurry.
 
@MathiasEttinger Seems like a lot of people misread it that way when closing a question.
 
The title doesn't say much either, it seems to be a calculator, but arithmetic is broader than that
@SimonForsberg Yeah, I always found having the two confusing, but I try to stick to Unclear->missing description; Lacks context->missing code
 
10:22 AM
@MathiasEttinger Good, that's exactly the way you're supposed to VTC :)
 
@SimonForsberg We've had two metas about this, but it seems a certain user doesn't want to follow that, and is making a trend not to.
 
Yes, I am aware...
 
@Peilonrayz Doesn't mean everyone else has to follow either.
 
@SimonForsberg Yeah, those answers don't make the square fill to the rect. :(
@MathiasEttinger It's been a year since those questions. It's also easier for people to copy other peoples close reasons when picking, and this makes you build an incorrect pattern match. We can say the same thing over and over, but it'll never be as strong as constantly picking the wrong option every day.
 
10:38 AM
@Peilonrayz Maybe you could update the question and mention that you are currently using Vue and Vuetify?
So that people understand that they should not say "Here's how you do it in jQuery" (which, frankly, they should understand already from what you have written now)
can you please add a screenshot of what you are expecting, — Xenio Gracias 15 secs ago
> This square can also change dynamically and this approach doesn't resize the square
@Peilonrayz The resize-component I added in my test on the about page isn't meant to be used later, but of course the square could change dynamically because of the browser window being resized
 
@SimonForsberg Yeah if the browser window changes then it's basically just my question with a bunch of padding (with information in it), and so it is resizable. Never mind you editing the flex directions :)
 
I thought what I wanted to do hear would not be so complicated in today's responsive world
 
10:56 AM
Hi, because there is nothing wrong with your code and you are mostly asking for best practice, you should to put your question to codereview stackexchange, you can expect only closing there, because question is too broad. Please, if you will do, delete the post from stackoverflow to avoid cross-domain posting, thanks in advance. — xxxvodnikxxx 40 secs ago
 
11:26 AM
@xxxvodnikxxx this is not suitable for codereview because this is not real code. (Hypothetical scenario code is not accepted.) If OP can include current working code of their application it can be reviewed. — 422_unprocessable_entity 42 secs ago
 
11:46 AM
You should post this here: codereview.stackexchange.comStultuske 15 secs ago
 
@SimonForsberg Got it working 100% in Chrome using the experimental ResizeObserver. Found from this SO question. I've pushed to peilon's-nonsense for you to see. :)
 
@Peilonrayz Cool, I will take a look after work
How much does it work in other browsers? 50% 70% ? :P
 
Dynamic resize doesn't work because ResizeObserver doesn't exist in them. Using a polyfill should be fine, or using the top answer from the SO question :)
Initial resize should work, or you'll just need to add this.updateMapRect(); before the ResizeObserver().
 
@Peilonrayz I think I might be able to solve the resize things with some Vue magic.
@Peilonrayz Why the display: none; on the .selectors ?
 
12:01 PM
@SimonForsberg If you don't then you have a ton of whitespace below the map. (As it duplicates the size of the map below .field-views.)
 
0
Q: Switch case implementation in Java for an integer pair combination

Edge GoldbergI have following python code - def get_subject_from_stream_id_and_subject_id(stream_id, subject_id): #(stream_id, subject_id): ("subject_name") return { (1, 1): "Accounts", (1, 2): "English", (1, 3): "Organization of Commerce", (2, 1): "Physics", (2, 2): "English", (2, 3...

 
@Peilonrayz Ok, then I guess I'll just have to put those selector-elements inside the other .field-views
@Peilonrayz Do you have a Firefox or other browser around? Could you check if akryum.github.io/vue-resize works?
 
@SimonForsberg Yeah I can have a quick look
@SimonForsberg Looks like it works correctly. It seems like I broke the ability to resize by adding it tho :(
 
12:33 PM
-1
Q: Listing very X number of bytes in a file

Brandon SeissI am trying to list every 4th byte in a file with roughly 1200 bytes, What would be the best way to go through and list out only every 4th byte in the file (so byte 0, byte 4, byte 8, 12, 16, etc) and ignore all other bytes in order? I had seen something like: List<long> searchResults ...

 
1:00 PM
I'm voting to close this question as off-topic because it is asking for a code review (and this thus too broad / opinion based). It could probably be adjusted to be on topic for the code review stackexchange. — Quentin 31 secs ago
 
1:20 PM
0
Q: Optimizing the code for 8-puzzle in Python

Sarvesh ThakurI am new to programming and I am trying to solve the 8-puzzle using brute force algorithm. The code works for very simple puzzle configuration but freaks out when the even a modest puzzle is input to it. Initially I was working with a format for board as: [['1','2','3'],['4','5','6'],['7','0','8...

 
possible answer invalidation by Edge Goldberg on question by Edge Goldberg: codereview.stackexchange.com/posts/214234/revisions
 
@SimonForsberg Which question?
 
8 hours ago, by Duga
possible answer invalidation by Voile on question by JuanR: https://codereview.stackexchange.com/posts/212741/revisions
 
1:35 PM
Monking
 
" I do not like how this is implemented", this isn't a question or problem description. If there is nothing wrong with your code then I suggest you post it on Code Review instead. — Joakim Danielson 35 secs ago
 
@Vogel612 @SᴀᴍOnᴇᴌᴀ God Monkon
("God Morgon" in Swedish)
 
1:52 PM
0
Q: RDS receiver - synchronization and error correction

Toby SpeightIntroduction The Radio Data System (RDS) is a digital signal modulated onto a 57 kHz subcarrier of broadcast FM radio (above the 19 kHz pilot tone and 38 kHz stereo difference channel). The details of the modulation scheme are unimportant here; we assume that the output of demodulation is a ser...

0
Q: Cross-platform standard library-only data synchronization script

Richard NeumannThe script below is intended to retrieve digital signage data from a server on Linux and Windows systems. The script needs to be copy and run, so I am limited to Python's standard library. The script has two modes: In normal mode it just updates the data and terminates. In server mode it listen...

0
Q: Add up values from one field for multiple months

AngelinaI have data as follows: Payment Date 11/01/18 01/01/2019 11/01/09 11/01/20 Total Amount 4536.87 4654.98 4698.63 4687.69 I need to add up all of the Total Amount starting from 11/01/18 through 11/01/20. For the months in between dates, I need to use the amount from previous month...

0
Q: Return sum values within a div

Vinny SohaI have created a 2 player Dice game. The idea is that each player in turn rolls the dice. This is a 6 sided each, 2 dice per player. After each roll the numbers need to be added. var myScore = document.getElementById("score"); var die3 = document.getElementById("die3"); var die4 = document.getEl...

 
2:20 PM
Monking
@SimonForsberg That's because UWYA is not intuitive here either.
Making close reasons intuitive is hard.
For example, why isn't a description part of the context? Try explaining that to new users, it's not easy.
This, of-course, can all be solved by leaving a specific enough comment explaining what's wrong with it regardless of the close reason used.
Which is cumbersome at times, but not hard.
 
@Mast Exactly, which is one of the reasons why I prefer comments, and why I am encouraging others to do so as well.
@Mast Three clicks if you have the auto-comment script.
 
@Mast By "not intuitive" you mean for new people to the site?
 
@SimonForsberg If you have enough auto-comments to make them specific enough again, yes.
It's on my to-do list, somewhere. Been there for a while...
My to-do list is about as long as @skiwi his list of tabs.
 
@SimonForsberg No offense/disrespect meant, but I honestly think the "auto comment" script (and any argument for it) is a bit of rubbish.
 
@Mast 1156 items on your most important todo list?
 
2:31 PM
@Peilonrayz Primarily, but even for regular users.
 
1. It's not mentioned anywhere on the site except in a couple Meta posts and such.
2. It's not exactly "universal" -- I can't put it on my phone / tablet.
3. It's not always trivial to setup, and with browser security boundaries and settings changing all-the-time, is somewhat unreliable.
 
yea, power users could really use builtin auto-comments
 
@Mast I guess changing from "Lacks concrete context" to "Lacks concrete code" would be enough to 'fix' this? Makes it explicit about code, rather than 'context'. I don't think we'd have this issue if we didn't have that title.
 
@Vogel612 That would be a much better solution, IMHO.
 
le sigh :)
 
2:34 PM
@202_accepted All true.
 
preferrably accessible with proper keyboard nav
 
@Peilonrayz That's not a bad idea.
 
@Peilonrayz that close reason is not about lacking code alone though
 
@Vogel612 If it's hidden behind a link too IIRC
 
it's also intended to be applicable for code-dumps
 
2:35 PM
Yes, the commit is already in a code review system Gerrit! — xSavitar 10 secs ago
 
@202_accepted I especially agree about point 3, it's annoying when you have to copy-paste your old auto-comments when it has updated. However, point 1 and 2 is not really any argument against using it when you have the possibility to do so.
 
No, but it is primarily and abused a lot for the rest. Sometimes with good reason though.
It's all screwed up really, even though we've debated this ad infinitum already.
 
@Vogel612 Which is why it's unintuitive that it shouldn't be used for questions lacking description.
 
@Peilonrayz I like that idea
@Vogel612 code-dumps are not mentioned in codereview.meta.stackexchange.com/a/3652/31562
 
2:36 PM
sometimes my memory is great, sometimes it does this to me ...
 
@SimonForsberg I do 95% of my SE from my phone or tablet, particularly the SE / SO Apps. There's no ability for me to use the auto-comment script with those, for reason 2 particularly. As a result, I have to come up with my comments all-on-my-own, or maintain an Evernote or something with them in it. (So, as a result, I don't bother using it.)
4
 
@Mast It's not meant for code-dumps
@202_accepted Yeah that seems annoying. I never use SE from my phone.
 
@SimonForsberg Unfortunately, these-days I'm quite-frequently mobile. :/
 
I have a Windows phone, except for chat most of SE doesn't even work on it.
 
@Mast I replaced mine a year-and-a-half ago, when they sunset the program.
 
2:39 PM
@202_accepted I find it hard to find questions tagged on my phone, never mind actually do something constructive...
 
@Peilonrayz Yeah since "Favourite Tags" is not accessible anywhere on the mobile site FFS.
7
Q: Stack Exchange Android App doesn't show Favorite Tags

202_acceptedStack Exchange Android App Version 1.0.63 I recently downloaded and started using the Stack Exchange Mobile App for Android. And while it's a great app, overall, and I quite like it for the basics, it seems to be lacking one feature I absolutely love about the website (and even the mobile site):...

 
whenever I was trying to do some serious SE stuff on mobile I was getting too frustrated quickly
I'm happy chat works well enough to do most things on mobile now, that helps
 
For a company that likes to encourage "developer first" and a "clean aesthetic" they're awfully bad at it...
 
Yup.
 
the android app is a dumpster fire
2
 
2:50 PM
Oh, I'm well aware.
You should see it on my tablet.
GARBAGE
 
Honestly, a lot of apps are dumpster fires.
 
@Mast For a while one of my apps was putting the password in my keyboard dictionary...
 
-1
Q: Quick Sort - C Implementation

TVSuchtyI have implemented a QuickSort-Algorithm in C myself as an exercise, and in general, it works fine. First of all, I found a bug, which occurs in about 1% of the generated unsorted arrays. I am loading somewhere a number outside the array into my array. You can reproduce this bug, by running th...

 
@Vogel612 ^^^ That's the SE app on a tablet.
 
Hang on I need to google for a mind-bleach image
 
3:04 PM
Yeah, that's how I feel every day.
 
I might become a front-end developer after all. If crap like that is the bar, it can't be hard to do it better...
7
 
@Mast I enjoy front-end development much more now than I used to, many thanks to Vue.js
 
> Friend (learning Python): "is `num >= 1` the same as `num > 0`?"
> Me: "Not quite, what happens if `num` is `0.5`?
> Friend: "Oh, so which one do I want?"
> Me: "Well, we try to use the 'Say what you mean, mean what you say' philosophy: do you _mean_ `num > 0` or `num >= 1`?"
> Friend: "I mean `num >= 1`."
> Me: "Then use that one."
 
Explicit is better than implicit.
Readability counts.
 
Yep. Trying to teach him to do things the right way from the beginning, whereas his professor is doing the opposite. >.<
 
3:19 PM
A lot of professors are...
 
Yeah, it's super frustrating because he texts me "our professor said to do <x>", and I'm like "Oh FFS that's the complete opposite of what you should be doing." I mean, I don't know python all that well, but I still know the basics.
His professor likes to say that "PEP-8 doesn't matter in the real world", which fine, whatever, to each their own, but if my friend wants to follow the PEP-8 guidelines because they're the de-facto standard, let him.
 
Welcome, Pat. Because you have a problem with your code, you are asking at the correct site. But, since you are new, I will inform you that when your code is complete and tested, you can post it at our Code Review sister site and get feedback on how you might improve it. It can be very helpful. — Mawg 50 secs ago
 
@202_accepted A lot of things doesn't seem to matter in the real world, does that mean that we should just give up on promoting good code quality standards?
 
@SimonForsberg That was my point. Yeah, sure, you can write Python without PEP-8 (and plenty of people do), but a lot of us follow it because it helps create a consistent experience, so you should probably advise students to do the same.
 
0
Q: Retrieving the IDs of entries to be deleted from a table

BCdotWEBBusiness logic It would take us too far to explain the whole business case behind this code, so I'll try to be as succinct as possible. There are Persons, and Persons can have Profiles, and the combination of those two is a PersonProfile. There is also a table called ProfilesToReplace, whi...

 
3:29 PM
@202_accepted You got to keep some standard to keep your code base sane.
 
@202_accepted Back when I was at school, I wasn't allowed to use JSON because "it's not used in the real world"...
 
@Peilonrayz There was a time where, when building a webpage, you didn't use JavaScript if you didn't have to. It was too expensive bandwith-wise, slowed down your loading time and was too much error-prone.
Some advice isn't wrong, but outdated.
 
@Mast Unfortunately, that's not outdated.
I work with JS enough to know.
 
@Mast I can't imagine a time where anyone said "don't use JSON", only a time when it didn't exist.
 
And yes, we still have to support PoS (technically, that's point-of-sale, but read it how you like) machines where JS execution is a serious factor in performance.
 
3:34 PM
@Peilonrayz There was a time when long-term support for it was far from sure.
 
@Peilonrayz Perhaps only 50% of the world is real?
 
posted on February 25, 2019 by CommitStrip

 
@SimonForsberg Everything not Academia is the 'real world' :P
 
@SimonForsberg The rest is imaginary.
It's a complex world after all.
 
3:50 PM
 
@Mast IN THIS CLASS WE DON'T USE "BEST-PRACTICES!"
 
@RMunroe No.
 
Did you mean to post this on codereview.stackexchange.com ? — L_Church 50 secs ago
 
4:13 PM
0
Q: 99 bottles of beer on the wall in python 3

David AndreiThis is my try on the 99 bottles of beer on the wall lyrics, made in python 3. I am a beginner willing to learn so be gentle :) def lyrics(): if count > 1: print(f"{count} bottles of beer on the wall,") print("") print(f"{count} bottles of beer.") print("") ...

 
4:44 PM
I'm voting to close this question as off-topic because it asking for improvements to working code. ask on Code ReviewDaniel A. White just now
 
buon monkerno
 
@SᴀᴍOnᴇᴌᴀ You can do better than that
 
@SimonForsberg in Italian?
 
No, not in Italian, but in other languages :P
 
4:59 PM
I will likely branch out in coming days
I'm learning Ukrainian, because I am going there in a couple weeks
 
0
Q: React context api design pattern

sol404I created a boilerplate from react-boilerplate. I have remove redux and immutable for use context API and immer. I wonder if I use the context API with a good design pattern. I use like this: // ./app/containers/LanguageProvider/index.js import React from 'react'; import PropTypes from 'prop-t...

 
Damn it @Peilonrayz, you managed to do string injection into my Jenkins server
sh "echo 'VUE_APP_GIT_BRANCH=$env.GIT_BRANCH' >> .env.local"
When GIT_BRANCH is peilon's-nonsense, well....
 
Ooops :(
 
sh "echo 'VUE_APP_GIT_BRANCH=peilon's-nonsense' >> .env.local"
No worries, at least you didn't do rm -rf / or DROP TABLE students
 
I suggest you post your procedure (and your code generally) to code review. Your organization is in need of some serious efforts to improve the code itself and to make it more readable (and therefore understandable). I see scattering of nolock hints without reason, addresses that are composed of empty strings, incomplete addresses, inconsistent use of column refs w/ and w/o aliases, hard-coded special ID values, use of TOP without order, normalization problems (PersonIdentificationValue), etc. — SMor 59 secs ago
 
5:31 PM
@SimonForsberg Mwuahahaha
Perhaps your Jenkins server (config) requires a review.
 
0
Q: Java: Longest common subsequence solution

fpezziniI've seen this today on a mock interview and wanted to give it a try. I'd love to hear some feedback from you guys. This is my second attempt at the problem, initially I had a mess of if/else towers and nested loops. /* * Write a function that takes two strings s1 and s2 and returns the * lon...

 
possible answer invalidation by lolololol ol on question by lolololol ol: codereview.stackexchange.com/posts/214194/revisions
 
@Duga Converted an answer to a comment
Voting to close as off topic, not working as intended, because the stated problem is "The new list should be made by splicing together the nodes of the first two lists" but the code is not splicing the lists together (it makes copies). And there's a bad bug. — 1201ProgramAlarm 17 hours ago
Can any C-person tell me if it's a big issue or not that it's making copies instead of splicing lists together?
 
5:51 PM
@SimonForsberg Well, in short it simply means the code does something else than the problem statement asks for.
It's like using the wrong sort method.
If the problem asks for a bubble sort and you write a selection sort, the code does not work as intended.
 
@Mast Does something else, or in a different way?
Sounds like different way
@Mast You have a point there
What does "splicing together" mean anyway?
 
That's very context dependent, but with linked lists, it's basically a relink.
Like a transfer.
But the whole point of a splice is not needing copies.
 
I voted with unclear what you are asking because at the time of my vote thats what it had been for me.
@SimonForsberg ^^^
 
@Heslacher Ah thanks, I didn't check who VTC'd for what
@Mast So you merge the two lists into each other, modifying one of the existing ones?
 
6:06 PM
Splicing itself is more generic than that, but think of it as moving the pointer instead of copying the data.
 
@Duga should we let t3chb0t know that another user has an avatar with the same character?? (not that he/she has an exclusive right to use it)
 
The full explanation on splicing (or at least the system call splice, which is where splicing in the computer world originates), can be found here @SimonForsberg
 
6:35 PM
0
Q: Simple dynamic array template

Leon2806For my game engine I needed a simple templated array class that can be safely passed across module boundaries. It's not supposed to be a replacement for std::vector and thus doesn't need all of its features. Instead it is intended to be used in the interface where binary compatibility is importan...

0
Q: Producing a Pandas Data Frame from Long to Wide format Efficiently

Furqan HashimI have a time series data in long format which looks like as follows: +======+==========+======+======+ | Name | Date | Val1 | Val2 | +======+==========+======+======+ | A | 1/1/2018 | 1 | 2 | +------+----------+------+------+ | B | 1/1/2018 | 2 | 3 | +------+----------+---...

 
6:51 PM
0
Q: python - create a list of most recent files in directory

VrunI'm working with directory of raw data csv files, stored daily in a directory with the same name except date stamp in the name, for example "ABCD_20190221_version2.csv". The below function works fine but given that directory 10K files and growing, it's slow. Any idea of how to speed it up? im...

 
7:12 PM
I'm sure this has been asked before but I couldn't find an answer on Meta, sorry. Given the CR question title policy, if we're asking a second CR question involving the same software, is it acceptable to give it the same or nearly the same title?
 
@puzzlepiece87 most users will add some type of versioning string like v2, v1.1, etc. to subsequent questions
 
@SᴀᴍOnᴇᴌᴀ Got it, thanks for the help.
 
@puzzlepiece87 You won't manage to use the same title twice. Every title has to be unique, it's enforced by the system.
However, very similar titles for follow-ups is quite possible and accepted.
 
@Mast Exactly what I wanted to know
 
another common convention is to provide a link back to the previous post(s) within the body of the post
 
7:17 PM
@SᴀᴍOnᴇᴌᴀ Will do this as well now, thank you!
 
another mature zombie was taken out ~6 hours ago :)
 
7:28 PM
@puzzlepiece87 I think that is one meta question that hasn't been asked actually
If you want to, you can try to be creative with your titles for the follow-ups. My favorite is this sequence of questions:
28
Q: A grid and a menu walked into a program

Henrik BohlinA program that creates a grid 10x10 and assigns a random number in each tile. It then asks you if you want to: create a new grid view the current one count how many of each number there are in the grid sum the rows sum the columns exit the program import java.util.Arrays; import java.util.R...

22
Q: The grid looked at the menu and said "Something with class, please"

Henrik BohlinThis is a follow up on my previous question: A grid and a menu walked into a program I integrated classes into the mix. The program now asks how big you want the grid to be. import java.util.Arrays; import java.util.Random; import java.util.Scanner; class NumberGrid { private static ...

 
7:43 PM
@Peilonrayz I had an issue with the view not updating on first load so now I also call the updateMapRect method when component is mounted
 
@SimonForsberg Makes sense, is everything else working?
 
@Peilonrayz Looks like it so far, gonna test it on other devices to make sure shortly. I haven't tested many different browsers but I assume you have tested a few at least.
 
@SimonForsberg Hahaha, very nice
@SimonForsberg I'll take care of that now, you all can make it a reference question or whatever.
 
@puzzlepiece87 Perfect!
 
@SimonForsberg I mostly just tested on Firefox, and moved the viewport around a lot. I don't think there's a reason for it to not work on the other browsers, except maybe IE.
 
7:49 PM
0
Q: Given CR's question title policy, how to title a second question about the same program?

puzzlepiece87Originally asked in 2nd Monitor If we're asking a second CR question involving the same software, is it acceptable to give it nearly the same title? What is best practice for naming these questions?

Feel free to chime in with your above answers or make a community wiki answer or whatever
@SimonForsberg I bet you'll get a lot of smiles/upvotes for including that sequence in your answer.
 
@Peilonrayz I don't care much about IE anyway
@puzzlepiece87 That's the plan
 
0
Q: Wordpress Menu / Google App

A.M.I recently change the code for one of my client's wordpress website and then, it appears that he (my client) wasn't able to reach all of the pages related to the Menu. It appears that he is using the Google App for browser, and has an Ipad. I tried on Chrome, Safari, IE, Firefox, and everythi...

 
0
A: Given CR's question title policy, how to title a second question about the same program?

Simon ForsbergCreating different titles for follow-ups is difficult, so most follow-up questions tend to have very similar titles which is perfectly fine. Some options for naming a follow-up question is: XYZ Program v2 Follow-up to XYZ Program XYZ Program continued XYZ Program - follow-up If you want to be...

 
@SimonForsberg you have the announcer and booster badges but do you care about going for the publicist badge?
 
@SᴀᴍOnᴇᴌᴀ Somehow I tend to get those kind of badges every now and then, for very weird questions that I sometimes don't even remember that I have shared.
Also, I don't think you can get those badges by sharing links internally within Stack Exchange
I don't think a chat link will give me progress towards them, or a meta link
 
8:02 PM
oh so your meta answer counts as "internally within Stack Exchange" as well?
 
Like this: stackoverflow.com/q/28662058/1310566 I got an announcer badge for that on February 11. It was a long time ago since I shared that question at my work, and now I don't even work there anymore
@SᴀᴍOnᴇᴌᴀ I think it counts as internal yes
 
Hmm...
Actually, maybe I didn't share it at work, maybe internal links do count...
Or someone copied the link, posted it somewhere, and then I get the credit for sharing it :D
 
@SimonForsberg Any linking counts IIRC.
If you share it, and someone clicks it, you get credit.
 
0
Q: Formatting time delta

Mantas KandrataviciusQuite often, I find myself measuring how long some part of my code takes to complete. I normally do that by storing current time using time.time() and then subtracting time after the code is done. This normally gives me a float that I can then format and print for debugging purposes. This is the...

 
8:09 PM
@202_accepted Only one way to find out: Could I get 25 different IPs to click on this ? :)
 
@SimonForsberg One down
Question: does it count if I copy/paste the link?
 
Oh crap, it's 25 needed for bronze, not 10
@202_accepted As long as it ends with /31562 I get the credit, as that's my user id.
 
If copy/paste counts, there's two.
@SimonForsberg I have a server farm with over 200 IP's in it, I could loop through all of them and ping it...:P
 
@202_accepted lol
 
Alright, only used 1 from the farm.
Wonder if I can get more allocated to me...
 
8:14 PM
@202_accepted When you get a link from SE it usually looks something like this: [site].stackexchange.com/[qa]/<postid>/<userid>/
sooo it's not any linking
because only the visits with a userid are attributed to you.
 
@Vogel612 I figured, didn't know if they checked that it came from a Referrer or not, though.
@SimonForsberg If you know where to look, I'm listed in the ARIN WHOIS Database.
 
1
Q: Given CR's question title policy, how to title a second question about the same program?

puzzlepiece87Originally asked in 2nd Monitor If we're asking a second CR question involving the same software, is it acceptable to give it nearly the same title? What is best practice for naming these questions?

 
@Feeds you're late to the party... old news...
 
@202_accepted Not sure I know where to look
 
@SimonForsberg Hehehehehehe
 
8:30 PM
possible answer invalidation by khashashin on question by khashashin: codereview.stackexchange.com/posts/214161/revisions
 
@Duga Hmm.... 1) Doesn't that say that the answers are slower then the OP? 2) Not sure if it counts as invalidation or not.... @Vogel612?
 
Sorry but Stackoverflow is not a code review service, IMHO this code has some issues and we can only try to guess. The OP did not provide yet a Minimal, Complere and Verifiable example. stackoverflow.com/help/mcvedparoli 59 secs ago
 
yes it says that. I'm tempted to rollback for the atrocious orthography and self-deprecation. Also a performance test without the used code presented is ... probably bollocks?
well it says that Matthias' answer is marginally faster and both are using 99% less function calls
which is kinda breaking my suspension of disbelief.
 
I don't know that I'd trust that "benchmarking", it doesn't explain what a "Function Call" is...
 
@Vogel612 Oh, few function calls is a good thing?
 
8:40 PM
if you get the same result in fewer function calls I'd say that's a good thing, yes....
 
@Vogel612 Is that what happened, though? Or was it a "timed" test, and they counted how many times it could be run in that period?
 
I was first thinking that it tried to do as many function calls as possible in the same amount of time
 
@202_accepted you're reading the same post as I am right?
 
Rollback as "unclear what you are editing"?
2
 
I dunno
 
8:42 PM
@Vogel612 I think so, I don't trust the "benchmark" what-so-ever, I'd like to see the technique used and what definitions are at play.
The times are within 500ms of each other, while the "numbers" are several orders-of-magnitude different.
 
It's going to be better if I say nothing now...
Different topic: I'm trying to move a REST service from being an eclipse plugin to being a webapp
 
Can someone add some comment to the question perhaps?
 
how in the world does RESTEasy work?
~sigh. Maven, you don't get to decide that there is a compilation error and then there isn't one from one moment to the next
 
@Vogel612 Never used it, these days my favorite REST server is Javalin - especially wonderful if you can use Kotlin
 
snrk
sorry I couldn't help myself
in VBA Rubberducking, yesterday, by Vogel612
My mental state is currently oscillating between extreme focus, extreme boredom, the wish to git-blame-with10kV, nuclear grade facepalms and projectile vomiting
in VBA Rubberducking, 2 hours ago, by Vogel612
praise the sun. It compiles
that was my state on saturday and earlier today.
Kotlin sounds really nice, but.... I'm currently struggling to move this thing away from being an eclipse-plugin
sooo ... you're about as far away as the stars right now
 
8:53 PM
Ah, I see the problem :)
 
java.lang.ClassCastException: org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher cannot be cast to javax.servlet.Servlet
T.T
 
I don't envy you right now
 
"It's all so easy, you just put thingie A and thingie B on your classpath and then everything magically happens"
except when it doesn't and the eldritch horrors bound in the entrails of the language are starting to feast on your brain
 
9:12 PM
0
Q: Fixing Medical Claim Files through Text File Read/Write v2

puzzlepiece87This is another review on a program I've asked about before, with a different target in mind. Program Function As before, this program makes emergency changes to medical claim files, delivers all the corrected files analysts need, and produces a changelog as well for their review. Core Pr...

 
^^^ Part 1 of my thing.
 
Oh right, I was supposed to review something
 
If you are asking for a review of your code, the proper site is Code ReviewJim Garrison 34 secs ago
If your code works correctly and you are looking for possible performance improvements then codereview.stackexchange.com is a good place to ask. They have dedicated categories [programming-challenge] and [performance]. — Martin R 11 secs ago
 
It's really cool how the tomcat8-maven-plugin starts an embedded tomcat 6 ...
like...
I'm not even angry anymore
 
That aside, your seeding is sub-optimal. See e.g. my question Seed std::mt19937 from std::random_device for a more thorough attempt. — Baum mit Augen 25 secs ago
 
9:28 PM
0
Q: Dynamically Generating XML Deserialization Classes / Code: Part I, Reading

202_acceptedI'm building an IntelliJ Plugin which will allow a person to select an XML file (and even a snippet of XML in the file, if they like) and, using a really brief GUI, generate classes / code in one of a selection of languages that will read the XML via native functions and generate code to do so on...

 
actually falls under abusive
 
and spam
and gone
and user destroyed
 
@SimonForsberg I like the edit
 
9:35 PM
Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/vogel612/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.1/jaxb-runtime-2.3.1.jar!/] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
~sighhhhh
 
@SᴀᴍOnᴇᴌᴀ I don't want to scroll, figured you didn't want to either :)
 
I have been using the PageDown key more lately
 
@Vogel612 You using some kind of byteassist library? Hibernate maybe? Or something else?
@SᴀᴍOnᴇᴌᴀ Figured you didn't want to do that either
 
nope.
well there should be a hibernate somewhere on the classpath, but I'm not touching jars that I depend on through maven
 
@Vogel612 You sure about that? Because otherwise I'm not sure how that error message got there
 
9:37 PM
I actually set up proper maven dependency myself within the last 72 hours and I'm the only one working on that state, sooo...
yes I'm sure
 
yea, I assume the module-info.class (which is java9 stuff) is just tripping tomcat8 when it expected a language-level 8 war
 
probably so, yes
 
I'll try downgrading that specific dependency to see whether it keeps blowing up
 
You should be able to get rid of all the module-info.class files I think somehow
 
9:42 PM
I'm not gonna start rewriting all jars I get from maven
 
I mean somewhat more automatically than that, like with some Maven configuration
 
I already have my sourcelevel on 1.8. If that's not a hint for maven I highly doubt there's another one, honestly
 
@Lapys You can see a good bit of it here. There is also some more here. I also believe one of Bjarne Stroustrup's books also details how to make a vector. — NathanOliver 23 secs ago
 
10:25 PM
@Vogel612 I've heard that there is another one, but I do not know for sure. I haven't upgraded past Java 8 myself yet
 
I found a fix.
I just need to get credentials to work now ...
but that's honestly an adventure for another time by now :)
 
Sounds like you've made quite a lot of progress
Out of curiousity, what was the fix?
 
0
Q: Singleton service class with inheritance

Jacob StammThere is a service class (ProposalPdfService) in one of our assemblies that has implementation logic specific to that app's assembly. Previously (and, I believe, erroneously) I treated it as a quasi-singleton by making it and all its members static, but I refactored it to use the singleton patter...

 
@SimonForsberg use a newer tomcat version :D
 
lol, yeah well that works too
 
10:32 PM
though if tomcat8 in the arch repositories isn't new enough I'm going to talk to my boss about ditching tomcat
 
Sounds like the best solution to upgrade tbh
 
we're using Jersey as well, sooo ...
The whole project is gaffa-tape, spit and snakeoil
 
So you're using both Jersey and Tomcat? You haven't considered using Jetty as well while you're at it?
How come you are working at this hour though?
 
~meaning-havy sigh
mostly because I was sick last week and didn't get to working as much as I wanted and because I'm free to work whenever I damn well please
benefits of a student job that I can work from home
We're configuring jersey when the application is started. We're also using Apache Camel, OSGI and a handful of other things that are ... quite dubious IMNSHO
there is some stuff around jersey-min and jersey-all. I should actually ask my boss whether they had that in the back of their head when they defined tomcat as the new host instead of eclipse
 
11:02 PM
-1
Q: Java getParent/trace routine

MinjiI am finishing a homework solution and need to print a routine using the .getParent() method and trace back through the routine to all existing nodes to print out a list. How would I go about doing this, the code is as follows: if (nodeSearching == null) System.out.println("No solut...

 
11:34 PM
0
Q: What should be the position of logger in the class?

vtokmakThere is an ongoing discussion with friends regarding the position of the logger. According the clean code static final attributes must locate on top the class. My friend is insisting on to keep like that which is below: public class SomeDummyClass { private static final String PREFIX = "xxx...

 
@CaptainObvious looks a little ... generic..
 
11:53 PM
@CaptainObvious I'd also go with the logger first. I'd also go with the question closed, unfortunately.
 

« first day (2123 days earlier)      last day (1877 days later) »