« first day (632 days earlier)      last day (3401 days later) » 

5:00 PM
Well, at least they're using PDO.
 
@Vogel612 Where/how?
 
> 2 people can be logged in the same account and use the account at the same time (I can login with two different browser at the same time and neither logs out). Is this a security issue? What is this called and how do I fix it?
 
Lots of web pages are like that, I don't see it so much as a security issue, not sure why OP is so concerned about it...
 
That's not unusual on most sites.
 
no of course not, but they want to change how the code works.
 
5:02 PM
No, it's a question.
 
I think number two is fine - I'd be pretty ticked if I got logged out while trying to use two devices at once. — Hosch250 44 secs ago
 
@Malachi does Option Compare Text work in ?
 
@Vogel612 I'm with 200 on that one
@RubberDuck Like the rest of vbscript: with lots of pain ;) (no idea really)
2
 
> Is this a security issue?
^^ On-topic, no?
 
Looks fine to me.
 
5:04 PM
Just my opinion......
 
0
Q: Javascript pref/localstorage

jmorenoI am working on a small app to help my kids study their multiplication and addition. And I have various preferences I want to be persisted between visits. What do you think of the below to get the settings out of local storage? I know I could do it even more simply by simply stringifying the w...

 
Maybe you should ask the OP to change it to "should I fix it"
 
hmm... maybe
 
edited number two from "how to fix" to "should it be fixed?" — Simon André Forsberg 18 secs ago
 
@Hosch250 damn right. I keep switching between ChatSEy, Chrome and the SE app... I'm logged in with at least 3 different apps, not counting tabs in Chrome...
 
5:07 PM
I need one more vote for it to count towards the badge.
 
I wonder if putting up a bounty on the MSE "how about an interesting newsletter?" post, would earn it some attention... no answer still...
 
@Mat'sMug I might post an answer in over time.
 
@Mat'sMug I guess the SE devs got too much other things to focus on right now
 
If no one else does.
 
putting a bounty on it will only cost you rep
 
5:15 PM
^^^ that
 
Bah, why don't we just make one for CR.
 
post a bounty on CR instead ;)
 
@SimonAndréForsberg Yeah. Nice try ;)
 
bounties on meta.SE are low-value propositions.
 
Just make a script to handle it for CR only, and maybe they will sit up and take notice.
 
5:17 PM
@RubberDuck - this came to my attention recently - this was apparently an entry in a hackathon: 2015.staticshowdown.com/teams/kale - Apparently you should use Chrome and go to: ss15-kale.divshot.io
 
I was expecting users to post layout proposals as answers...
 
Oh, I see.
Well, sure.
 
Because, you know, it's a lot more infornation that the current format; giving devs layout ideas might spark something..
 
0
Q: optimal way to calculate the xor of a list of a numbers(in binary format)?

jazzzI am trying to find out the xor of list of numbers (in binary format)in python ... here is my first code: def main(): t = int(raw_input()) for i in range(t): input_list = [int(j) for j in raw_input().split()] res = input_list[0] for n in range(len(input_list)-1):...

 
I see the newsletter as a potential tool for following up on smaller sites' activity. The newsletter was originally intended for users that don't visit often: I think it can change.
 
5:21 PM
So, do they email a PDF out, or is it just HTML in an email?
Or what?
 
HTML
You haven't subscribed? ;)
 
Nope, no need.
 
Would you, if it had interesting content?
 
Maybe.
The email I currently use to sign in is extinct anyway.
I had a security breach, and changed it.
I never updated my SE email (I probably should...)
 
@Hosch250 That.
 
5:24 PM
But then, around that time, SE was breached.
Don't know if they got any emails, but I started getting junk mail left and right - I didn't before.
 
0
Q: Program to continually read from and write to txt file

BenignReaverThis program is intended to meet the following requirements: 1) Have 2 Classes, instantiated within main 2) The first class needs to create/open a text file, find the last line and display the line-count. 3) The Second class needs to write the current date/time to the .txt file, and print "Last e...

 
@rolfl That makes me so very happy.
 
Well, what should I think of this: codereview.stackexchange.com/questions/78661/… ?
 
@rolfl facepalm
 
Mutter mutter.
 
5:31 PM
Isn't it broken code?
 
@Vogel612 - thanks, but, if the rollbacks continue, leave it... ;-)
 
@rolfl sure thing
 
Yeah, I saw.
I had that happen once - someone insisted on calling JavaScript Javas Script.
 
Jabba's Crypt
 
5:32 PM
> The feedback I seek is based on fixing a print error where the first cycles as follows:
 
I was about to edit the original, my bad. I'm all for corrections where applicable. I'll ensure I use correct grammar in future :3 — BenignReaver 28 secs ago
 
I think it is broken code.
 
Reminds me of one SO user who insists on keeping lowercase "i" in the middle of sentences.
 
@Hosch250 agreed
@Jamal Scimonster...
 
Or ScImonster. ;-)
 
5:34 PM
SCiMONSTER.
 
@Jamal that drives me absolutely up the wall.
 
Me, too. If he were a regular on here, I would go crazy.
knocks on wood
 
@rolfl while (loop) { ... Thread.sleep(500); ... catch (InteruptedException e) { Thread.currentThread().interrupt(); } }... why do people not know how to handle InterruptedException correctly!?
 
Because it is a PITA and they never actually see one happen, so don't know what to do.
In fairness, I don't believe I have ever seen an interrupted exception 'in the wild'.
 
@RubberDuck hmmm .......
 
5:43 PM
I encountered them when creating my Minesweeper solver. That's when I learned how to handle them correctly.
I suppose I can't blame them...
 
Did you actually get an intterupted exception?
 
they should read up on what Thread.currentThread().interrupt(); actually does though, IMO.
 
They should.....
In fairness, it is one of the recommended practices, depending on your circumstances.
 
@rolfl sure did. I ran my code with a time limit (using some feature in Guava), Guava interrupted the thread, I handled the interrupt by throwing the exception.
 
Ahhh, Guava uses an interrupt for that? Ugly.
 
5:45 PM
@rolfl what would be the alternative?
(using a synchronized flag, right?)
 
Well, an interrupt is only 'caught' when you do a blocking operation.
If you have a tight loop of code, it will not stop running when the thread is interrupted.
 
@rolfl or when you check for one -- which my code had to
 
Exactly.... so, you may as well check for a boolean state.
 
@rolfl in the case of this CR question, as far as I can see an InterruptedException will create an infinite loop.
 
@RubberDuck I don't know that I have used Option Compare
 
5:48 PM
1 min ago, by Simon André Forsberg
@rolfl in the case of this CR question, as far as I can see an InterruptedException will create an infinite loop.
It's an infinite loop with, or without, the interrupt.
 
It's cool. Thanks anyway @Malachi. I'm just gonna move on.
 
@rolfl s/will create an infinite loop/will not break the loop/
putting a break; instead of a Thread.currentThread().interrupt(); is the solution.
 
I don't believe the intention was to ever break the loop.
it is supposed to be infinite.
(at least, by the code)
 
0
Q: Storing Data In a Image pixels

sdin3dspaceI wrote a tool to store text as colors in a image around the border. I then saved the resulting image to file. To use the resulting file I set it's path to a the src attribute of a tag and call DrawImage and colorToText OnLoad to read the contents and remove the messy data around the edges of th...

 
@rolfl then what do you think the intention of Thread.currentThread().interrupt(); is ?
 
5:51 PM
The fact that the controlling main method keeps scheduling competing threads with the same runnable, but is a fixed-size..... is a problem.
@SimonAndréForsberg Purely to catch the exception that's thrown from the sleep.
 
@rolfl then why isn't the exception swallowed?
 
There's a decent article out there about how to handle InterruptedExceptions... they probably read that. ... let me find it.
 
I admit, that InterruptedException will not happen for that user, but to me it looks like the intention is to interrupt the thread - and therefore to interrupt the loop.
 
First hit in google for "InterruptedException How to"
Recommended practice, never swallow it.
Of the alternatives, if you are not going to directly handle it, call Thread.currentThread().interrupt().
 
hmm... let me check javabot for a second...
 
5:54 PM
Interesting.... Abstracting the file system‌​.
 
but how does marking the current thread as interrupted help anyone?
if it occur once here then it will repeat this:
 
It ensures that, if you are not interested in handling the exception, that it will happen the next time someone else checks.
 
thread.execute(reads);
Thread.sleep(500); <-- will interrupt directly
Thread.currentThread().interrupt();
 
In this situation, all the re-interrupt does, is guarantee that the next iteration of the loop will fail immediately on the sleep.
 
@rolfl I kinda remember @Simon telling me exactly this sentence not too long ago...
good evening btw
 
5:56 PM
Hey Janos.
 
hey Janos
@janos I did? I thought I told it to @skiwi...
 
@Simon - to be clear, the handling of the IE in this case is crappy, but, it is partially following best practices.
Really, a better solution, in my opinion, would be:
 
what he tries to do here if/when it happens just doesn't make sense.
 
Thread.currentThread().interrupt();
throw new IllegalStateException("Unexpected interrupt", ie);
 
yes, that would be better ^^
 
5:58 PM
The problem with the IE is that, the moment you catch it, you also reset the flag.
 
when you set the interrupt flag on a thread, you should consider "ok, so when will this flag actually be checked? and how will it be handled?"
 
You have to set the flag again so that other things downstream that are interested in it, will get it.
 
@rolfl not necessarily. The problem with if (Thread.interrupted()) is that.
 
...... ?
 
catch (InterruptedException ex) doesn't reset the flag. Checking if (Thread.interrupted()) does.
 
6:00 PM
Catch does reset the flag.
 
you could theoretically throw an InterruptedException without doing if (Thread.interrupted())
 
(let me check that).
 
@rolfl I can't recall any situation when I had something downstream interested in it
have any of you?
 
@janos honestly, nope. I just make sure that whatever loop I am currently in breaks, and the current method returns. Although rolfl does have a point about it.
 
about swallowing the exception, the article says: "Unfortunately, this approach throws away important information about the fact that an interrupt occurred, which could compromise the application's ability to cancel activities or shut down in a timely manner."
I've just never encountered such situation where this mattered at all
 
6:03 PM
@janos in the kind of libraries they write on IBM, I guess it can matter a lot.
 
@janos No, but if, for example, you are writing a library like JDOM, you just don't know.
 
and now I am just more confused as to what an InterruptedException actually is...
well at least I know what not to do ;)
 
see the article linked by rolfl
 
InterruptedException definitely sounds like something you don't want to use everyday.
 
Opinions on topicality of… ?
0
Q: CoffeeScript formating in Meteor

janoChenThis is how I usually do mine: Template.bookPage.helpers chapters: -> Chapters.find bookId: @_id, sort: position: 1 Template.bookPage.events "click .move-up": (e) -> e.preventDefault() prevChapter = Chapters.findOne bookId: @bookId # to prevent fet...

 
6:14 PM
@janos ya I read it
 
I'll be digesting it for a few days
 
@200_success VTC'd Opinion Based.
 
@janos / @Simon - catching the interrupted exception clears it:
Note line 19, the variable isi is false in the output.
 
nice rolfl
 
I am not convinced, @rolfl
I think you are not entirely correct.
 
6:16 PM
Possibly, perhaps it never was set?
 
I will produce a counter-example
it is cleared inside Thread.sleep I believe.
it is cleared right before the exception is thrown
 
Thread.sleep clears the exception before it throws it?
 
clears the flag
the flag is not the same as the exception
> The interrupted status of the thread is cleared by this method.
^^ from Thread.interrupted()
 
Good morning fellas!
 
/away dinner
 
6:19 PM
@SimonAndréForsberg Oh, I know that, @Simon.
(also, Thread.isInterrupted() performs the same check, but does not reset the flag).
 
@SimonAndréForsberg the javadoc does not imply that clearing is only performed by that method.
 
The question is, whether the flag is set when you catch an InterruptedException.
 
@rolfl I'd say that the question is, is the flag cleared before it is thrown.
AFAIK, the recommended pattern is if (Thread.interrupted()) throw new InterruptedException();
i.e. the flag is cleared before the exception is thrown.
 
> By convention, any method that exits by throwing an InterruptedException clears interrupt status when it does so. However, it's always possible that interrupt status will immediately be set again, by another thread invoking interrupt.
So, yes, it appears that the sleep resets the intterrupt flag.
 
6:23 PM
^^ catching InterruptedException does not clear the flag
 
I see, it is not the catch that resets it.
It is the fact that Java practice never throws IE without first resetting it.
 
exactly. it is reset right before it is thrown
@janos don't miss this conclusion ^^
 
The basic take-away is the same, though, that blocking operations will throw an IE if the thread is interrupted.
If your code catches an IE, the assumption has to be that you were interrupted.
you need to either handle the interruption correctly, or alternatively delegate the process out again.
 
yes
it'd be nuts to throw an InterruptedException for another reason than an actual interrupt.
 
Since you can't throw the IE (probably because you can't have it on your signature), you need to set the flag again so that the calling code can handle it as designed
The likelyhood is very high that when you catch the IE, the interrupt flag is not set.
You need to set it.
 
6:30 PM
or at least handle it properly. break loop, end method. throw some other exception
it doesn't hurt setting the flag again, sure.
oh, great... AnalyzeProvider(MinesweeperMap map, boolean detailed, int timeout, TimeUnit timeUnit) throws Exception {
 
Power's back... but all the servers are still down... FML
 
@SimonAndréForsberg /back, and thanks :)
 
Looping back around to the OP's code for read/write... he's never seeing an actual interrupt on his thread, and that try/catch is just boilerplate that's unused.
 
I guess this code was written two years B.CR. (Before Code Review).
2
 
throws Exception ;-)
 
6:34 PM
@SimonAndréForsberg TS
 
@Mat'sMug Long day?
 
0
Q: MVC + Events in JavaScript

lauthiamkokI'm a bit lost with implementing MCV pattern on javascript. Where should events (such as 'click','change') come in on MVC in javascript? I have this event function, var EventExample = function (controller, view) { this.controller = controller; this.view = view; return ...

 
@RubberDuck Actually, that was a major PICNIC moment. Hadn't plugged the network cable...
 
lol
oops
 
But yeah, long day :)
 
6:48 PM
Hmm. bsa posted a link to his Scala question to one of the Scala mailing lists.
 
0
Q: Batcher using Microsoft.Tpl.Dataflow

Dan RyanWhat do you think? In particular, i'm not sure about my exception handling approach to raise errors when posting objects; but I couldn't come up with anything better. public class Thing { public Thing(int number) { Number = number; } public int Number { get; set; } } c...

 
@Mat'sMug lol that sucks.
 
@Mehrad There's the paper ^^
@Phrancis I was thinking about your question, and I believe that a lot of it is a feeling of responsibility.
Because people know that you are not a Christian, they feel responsible for trying to prevent you from going to hell.
You said you read much of the Bible, you may remember how God appointed Ezekiel to be a watchman over Israel.
And he had to warn people that they were sinning, and if he didn't and God punished them, Ezekiel would be responsible.
But if he did warn them and they continued, they were responsible.
If they changed their wicked ways, God would not punish them.
 
6:58 PM
@Malachi I like your answer, thanks for taking some time to write it
 
I could turn this into a long answer, but I think this is enough.
 
can we not discuss religion here please?
 
@nhgrif Sure.
I just don't have an account there.
Lunch time anyway, see you.
 
Otherwise, someone will be offended...
 
@nhgrif I agree, it's definitely off-topic for this room. @Hosch250 @Malachi you're welcome to invite me to a room if you want to discuss the topic
 
7:01 PM
@Phrancis I'm a Christian, and I don't think all non-Christians will go to hell. Perhaps some Christians will think that this will make me go to hell, but to hell with them so be it then.
^^ all I wanted to say.
 
:)
 
5 mins ago, by nhgrif
can we not discuss religion here please?
^^^ I'm with that opinion, mostly just because it's practical.
 
Josh Helfgott?
 
^^^ SE folk pressed the wrong button? Moderators on Stack Overflow: stackoverflow.com/users?tab=moderators
(he's an employee ... ;-)
 
Also, for future reference, this probably isn't the place for political discussions.
 
7:11 PM
@rolfl asked me a bit about Swedish politics on day though, but that wasn't so much discussion I guess
 
I Guess vi vs. emacs is a no-no .... both political, and religious ....
XKCD for everything
 
Politics and religion are two topics on which no one ever changes their stance and there's not much reason to anyways because there are very rarely ever fact-based, objective arguments made from anyone.
 
politics, religion and coding standards
 
Oh, but religion was topical on Code Review just a few minutes ago:
Your code does not compute the correct answer and is thus offtopic. checkdiv(3) returns 2, also for the love of god, use a prime sieve. — Emily L. 37 mins ago
 
I remember you editing out my prayings to a higher entity from an answer, though..
 
7:18 PM
Coding standards though would be on topic here, even if debating it is equally pointless.
 
@nhgrif are we nihilistic today?
 
0
Q: Angular: Why Use Multiple Modules?

RhsI have an angular application that looks like such. file1.js var app = angular.module('app', ['third-party-stuff-A'] file2.js var app = angular.module('app', ['third-party-stuff-B'] so essentially file1 and file2 represent two separate pages in my application. I've registered all my contr...

 
Stfu Donny.
... Please realize that's a movie reference...
4
 
@Vogel612 If we're gonna evoke any gods around here, it's going to be the gods of clean and maintainable code.
 
ermph...
 
7:20 PM
I know a store where they tell people (not literally) to shut up when religion and (or?) politics come up .
 
@nhgrif I was guessing... but I don't remember what movie or scene it was..
AHHHHHHHH, I am a FAILURE!!!!!
how could I not realize that's from TBL...
 
Big Lebowski...
 
@Phrancis I believe that you can talk about that kind of stuff in The Upper Room as well @Hosch250
 
TBL -> The Big Lebowski
 
Disappoint.
 
7:22 PM
Oh I remember now... but I am, too
 
Going to semi-pimp a meta.se question of mine... but, i also want people to give me feedback on whether the comments by Isaac are right (that it's more confusing to put the Day-of-week on the timestamp...): meta.stackexchange.com/questions/247597/…
 
"semi-pimp" ?
 
Well, I want people to actually consider it carefully.....
 
unlike we normally do?
 
More carefully.
 
7:24 PM
I am trying to figure out whether I am an odd person who thinks things will be simpler with the day-of-week rather than the day-of-week making things more complicated.
 
I was kinda hoping that's the default mode ;)
I like that idea
 
^^^ that, yes, but I am actually seeking dissenting opinions too....
 
after careful consideration, of course :)
 
The comments indicate it's a problem, and I also have some other people I respect say it would be more confusing.....
 
well they kinda have a point. but you have, too.. and TBH I find your arguments more convincing.
not that the Zulu Time adds any really relevant information in and of itself IMO.
 
7:27 PM
rolfl, I think of day of the week as a concept more tied to subjective experience than the date/timestamp. Why would one want to know what day of the week it was, other than to relate it to something locally-relevant, like whether the author was likely at work? If you see a raw timestamp with a 'Z' at the end, you're more likely to make the necessary conversion. If you see a timestamp that says "Mon 2015-01-26 09:22:17Z," you might just think "oh, Monday morning -> work," and stop there, less likely to consider the fact that the author is in, say US PST and was hacking at 2 am on a Sunday. — Isaac Moses 4 hours ago
 
See, the thing is, that I cannot see any merit to his argument/assertion. I see zero down-side to having the day-of-week on the timestamp.
 
Who cares when the author posted it? Whether he was likely at work or not?
 
^^ that...
 
Occasionally, I do.
 
from my PoV the whole debate is moot. I don't see a point in including the exact time at all
 
7:28 PM
I like being able to hover over people's post lists, and see that thy are more active in the week, than the weekend.
 
isn't that the usual case??
 
Don't you use SEDE for that stuff, @rolfl?
 
SQL-Stalking Stalking Query Language
 
I'm afraid to answer at work for fear that someday it might be taken against me
 
or that there's a difference between 2014-01-17 22:53:17Z and 2014-07-17 22:53:17Z
 
7:29 PM
that's why I don't come on chat either, though I see your pings sometimes
I think Isaac's is just a minor nitpick. Having the day name there will be a net benefit
by his reasoning, there should not be a date at all, as some people might not see the "Z" at the end, and falsely assume it's in their own timezone, naturally
 
It is definitely easier to do it in UTC.
 
That's my thinking too. Once you are in the mental frame of mind that it's in UTC, there's no downside to including the day-of-week.
 
I was thinking of programming.
 
@Hosch250 Timezones generally are a hassle anyways.
 
0
Q: Entity component system for text based console on Windows

MORTALI have written this code base on AsciiEngine How can i improve this code #include <iostream> #include <fstream> #include <vector> #include <string> #include <memory> #include <algorithm> #include <unordered_map> #include <type_traits> #include <random> #include <chrono> #include <cassert> #inc...

 
7:33 PM
for me the "Z" at the end is not easy to see, I'd prefer a loud "UTC " prefix or something
 
the Z is the ISO convention though
(I believe)
 
Is that comment addressed to me, or Isaac, @Simon?
 
to @janos actually
 
I know that
 
or do you mean this @rolfl?
@IsaacMoses Why is the current format also not misleading in the same way? Since you are likely to be in another timezone when anything is posted... — Simon André Forsberg 1 min ago
 
7:35 PM
This comment:
@IsaacMoses Why is the current format also not misleading in the same way? Since you are likely to be in another timezone when anything is posted... — Simon André Forsberg 1 min ago
ahh, yes, that one... ;)
Fast edit there, Simon
 
I guess you got the answer with my edit ;)
did it as soon as I realized what you were talking about
 
@Vogel612 is that on Netflix?
 
@Malachi should be
 
@Vogel612 it's been a while since I watched that
a long while
 
7:52 PM
Next to 10K:
 
hmm.. If I capped out everyday... 10 days.
 
somebody somewhere was offended by "Not you, silly duck!"
 
somebody somewhere is always offended.
 
that sentence just makes me smile
now I have to track this down on Ask Ubuntu... (where the flag came in from)
 
Because we have a duck?
 
7:59 PM
@janos Why would anyone be offended by that. =;)-
 
I guess that depends on what you say to them @RubberDuck
but yes, I smiled partly because it reminded me of our duck
 

« first day (632 days earlier)      last day (3401 days later) »