« first day (1504 days earlier)      last day (2562 days later) » 
00:00 - 19:0019:00 - 23:00

7:15 PM
@RobertHarvey people who don't use braces concern me
how did it bite you in the ass? New version needed braces?
 
@RobertHarvey You work for apple?
 
@rolfl He didn't want to brag or anything
 
@Ampt Someone added a line of code below the first statement, apparently thinking they were coding in Python. Took three engineers and a couple of hours to figure out the problem.
 
@RobertHarvey o.0 how confused do you have to be to confuse java/C# with python
(not sure which you use. Neither is close to python)
 
Figuratively speaking.
Braces != significant whitespace.
 
7:17 PM
ah, they were just an idiot. got it.
 
in eclipse, Ctrl + A -> Ctrl + Shift + F
 
user41796
@Ampt They were in a hurry that day; their mind was on that afternoon's sports game; they were worried about contract negotiations; etc...
 
@durron597 have to know which file it was
 
user41796
Tons of reasons for simple mistakes like that
 
@Ampt Every file.
 
7:18 PM
@durron597 I doubt they know that was the problem too
 
I don't check something in without doing that
 
a pair of braces probably cost apple a few million in real dollars, and a lot more in good-will... nakedsecurity.sophos.com/2014/02/24/… (and a whole new version of iOS).
 
@durron597 You are far better than us mere mortals I'm afraid
@GlenH7 It was you wasn't it
 
user41796
@Ampt I didn't bork up Robert's code, no. But I've made that mistake before, and I've seen it be made.
 
@Ampt If you think I'm anal, try contributing to the jukito project
 
7:20 PM
@durron597 I've fairly well established that anyone contributing to OSS projects needs to be anal, or have very thick skin
 
user41796
or both
 
If you're coding in a decent IDE, it will back-indent the second line of code, and you'll immediately see that there is a problem.
Nevertheless, I am now a convert. Always use the braces.
 
(or, just a thought, you use braces)
 
user41796
@RobertHarvey "Stupid IDE; never gets the indentation right... grrr"
 
user41796
'cause I've never heard that one said either...
 
7:22 PM
 
> Use the curlybraces, Luke
 
Visual Studio is surprisingly good in that regard.
 
user41796
or, god forbid, you allow mixed spaces and tabs for your indentation.
 
@GlenH7 I think I just puked a little
 
user41796
@Ampt Yeah, well... <sighs>
 
7:23 PM
I spent a good few hours working on a bug once, that my colleague found in 1 minute.... in python.
that's the difference between a 2-space tab-stop, and a 4-space stop.
the python file had an errant tab in it that I could not see on my screen, but when put up in his editor it was obvious.
Hey, I feel blessed ;-)
 
That gives me an idea for this thread:
178
Q: What? No error?

JwostyYour task is simple. Write a program that should obviously produce an error on first glance either when compiled or run, but either doesn't or produces some other unrelated error. This is a popularity contest, so be creative.

 
user41796
@rolfl And how many times had that developer been bit before by that on a project? Probably lots...
 
My solution is to stay as far away from python as possible
 
In fairness, the tab error crept in during a copy/paste cycle that was on a code branch that was uncommon....
The overall system of testing and validation was insufficient for the job at hand, can hardly blame that all on the one person...
 
7:36 PM
@RobertHarvey the part where you use floats to store money made me spit out some coffee
I hope you're happy with yourself
@durron597 Python is fantastic. Not sure what you're worried about.
 
WTF == Wow, That's Fantastic.
 
Besides, on the topic of the current conversation, you don't have to come up with goofy coding standards in python, because they build one into the language.
 
7:59 PM
so for people with lots of experience with agile development / continuous integration
what would you say is a good benchmark for how long it takes to ACTUALLY release a new build
 
This long |--------------| ;-)
 
e.g. "if from the moment you decide to release a new build it takes you an hour, that's too long"
because right now, i could release a new build with whatever bugs i've fixed and tested that day
but it still takes me like half an hour to do it
 
user41796
@durron597 You're asking the wrong question
 
user41796
What you want to ask is if the current process is meeting your needs
 
user41796
If it is, don't mess with it - there's more important things to tackle.
 
8:02 PM
@durron597 I think this should work:
0
A: Solving a race condition

Jimmy Hoffaimport java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class RaceSolution { private static enum State { NEW, READY; } private static enum Type { ACK, RESPONSE, NOTHING; } private static class EventHandler { private volatile State state ...

 
user41796
If it's impeding the business, then fix it.
 
(don't frankly know Java)
it's waitless
you buffer things that aren't ready for processing, and when the state goes ready, you process them then
...I really couldn't give a typical review of code syntax or semantics being it's Java and I don't know the detailed semantics, sorry
also my while is a gnarly way to do it, just trying to do the minimal code because I don't really know the right ways to use the structures off hand, does the approach make sense?
sorry - shouldn't have posted on CR, it's as the guy said, not a review
 
@JimmyHoffa It does make sense but I considered and rejected your approach before I even posted the question on code review for the reasons I explained in the comments just now
 
@durron597 ? if ack shows up first, your state goes ready and responses will be handled immediately?
no?
 
@JimmyHoffa Oh never mind, I fell victim to my own "this example is too contrived" lack of code
but the first bit is still true, it doesn't fail well if the ack never shows up
 
8:08 PM
@durron597 if the ack never shows up - doesn't that mean you should never handle responses?
you could put a check on the buffer before adding - buffer > 10 = ack failure, handle failure ?
 
@JimmyHoffa I need the ack wait to timeout and then do something with the response messages
 
@durron597 response messages are in the buffer
You can timestamp the first add to the buffer
or create a timer that will flush in 10 seconds and handle the unreadyBuffer, and upon the ack you cancel the timer
if it's a timer style timeout you want
 
@JimmyHoffa I'm not sure how having a separate timer thread is better than @rolfl's solution
 
if (unreadyBuffer.size() == 0) //create timer to call HandleNeverReceivedAck
@durron597 thread? Timers need a thread in Java?
 
I agree your solution is better than my solution but I think @rolfl's solution is better than both
How else would you implement a timer?
 
8:12 PM
> A facility for threads to schedule tasks for future execution in a background thread.
it schedules it, it doesn't use a thread until the timer fires (OS registration of timer usually)
thread.wait blocks a thread (inside of a lock no less) - so it's holding the lock for the period of your timeout
 
I'm just saying you're adding YACS (yet another context switch)
 
@durron597 I'm not holding onto resources in a sleep state though
that's all I'm trying to avoid
 
that is not what Object.waitdoes
 
When .wait is called does the synchronized lock get released?
 
Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. In other words, this method behaves exactly as if it simply performs the call wait(0).
The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method. The thread then waits until it can re-obtain ownership of the monitor and resumes execution.
 
8:14 PM
@durron597 see, it blocks the thread
I'm referring to a blockless approach
 
(timers don't block threads)
 
your answer does not block, but it does have an extra context switch
 
@durron597 ....it says it blocks
> Causes the current thread to wait
 
Lessons learned today:
Tomcat sucks
Jira sucks more
Libraries suck
I hate deploying shit
 
8:15 PM
@Ampt devops FTW!
 
plus most of the time i don't want to wait 10 seconds to check to see if the ack has gotten here yet! that's an eternity
 
@durron597 you wouldn't
why would you do that?
as soon as the ack shows up, the unreadybuffer get's processed
 
5 mins ago, by Jimmy Hoffa
or create a timer that will flush in 10 seconds and handle the unreadyBuffer, and upon the ack you cancel the timer
 
upon the ack you cancel the timer - the timer is the "I didn't get an ack, time to clean up" process
 
if the ack doesn't show up in 10ms, it's not going to ever
and the overhead of the context switch will cost more than the thread blocking
 
8:17 PM
@durron597 10ms? oh. I thought you were talking about 10s, 10ms isn't generally big enough to worry about blocking for.
block for 10ms I guess - no big deal
 
that's why my inferior thread polling solution had tries < 10 and Thread.sleep(1 /* millisecond */)
 
@durron597 ah, I thought it was sleeping for a second. Meh. Making a timer that kicks off in 10ms is a waste of resources agreed
 
@JimmyHoffa And most of the time the ack arrives way way before the response
The actual scenario is submitting an order to work in the stock market
ack = "your order is working"
response = "you got filled"
 
@durron597 yeah, then I'd just eat the 10ms block. The only reason I'd ponder otherwise is if your concurrency is so significant (or response handling takes so long) that you are filling up your thread pool
 
the race condition only happens when you submit an order at a price that gets filled immediately. And so the data processing problem only happens sometimes anyways
@JimmyHoffa As of right now I am at least one order of magnitude faster than the exchange. If that ever becomes too slow then I'll investigate stuff like that
the problem is not performance, it is the race condition
 
user41796
8:39 PM
Can we get some close votes to kick this into the queue, please? programmers.stackexchange.com/q/260192/53019
 
I need to make a bot that checks this chat for [close] [vote] [cv] and links in the same post and apply some much needed CVs
 
user41796
@Ampt Not a bad idea... :-)
 
@GlenH7 never! long live the off topic quesitons!
I see nothing everything
 
"How do I give my boss the 'Birds and the Bees' talk?"
 
That would likely get you more upvotes than mine did me :P
 
user41796
8:53 PM
@AshleyNunn Did yours hit the hot questions list? And how was the email received?
 
I am not sure if it did, but I got a lot of views and votes so I think it might have
and it was recieved well
and they are going to work around my training schedule for my new thing
 
user41796
@AshleyNunn That's coolness. That's a good way to leave on good terms.
 
"You see, I like my boss a lot, but he's never had a girlfriend and came to me for help..."
 
@GlenH7 Yeah, it seems to have worked out pretty well all things considered
 
@AshleyNunn that's awesome!
 
8:56 PM
Now I have to just run around like crazy after work to get ink and things to finish my paperwork for my new job (because the printer I got second hand recently apparently had no ink left in the cartridges)
 
@AshleyNunn Just use blood. It's cheaper. Seriously.
 
Yeah, i am so mad I have to go get ink, that stuff is so ridiculous expensive
 
user41796
@Ampt There is a measure of truth in this...
 
user41796
@AshleyNunn But think of the very fun first thing that you get to print on it.
 
@GlenH7 Truth
I am still kinda amazed how quick this all happened
 
user41796
9:01 PM
I like to wrap unexpected transactional costs within their silver linings
 
user41796
Does seem fast, but steady hours and a pay raise are bueno
 
Indeed :D
 
user41796
Some orgs do have their hiring process down to a science. They're usually a pleasure to work for
 
I mean I am going to be working crazy hours for the next two weeks because I still am within my notice period so my current job is scheduling around it, but hey, money
 
@GlenH7 some.... dont :P most?
 
user41796
9:03 PM
Most don't. But I see it as this: They accept there is a measure of turnover within the field. So they are taking steps to minimize the pains caused by that turnover. And if they are doing that, then they are likely to try and reduce the causes behind the turnover too.
 
user41796
You don't optimize to facilitate churn; you optimize to stem it
 
9:41 PM
Answer: Not that unreliable.
Considering that's true, use a reliable protocol built around UDP with custom congestion control and optional reliability? You can probably outperform TCP. Especially on a LAN.
 
10:05 PM
Am I missing something, or does the following code not actually accomplish anything?
4 hours ago, by MetaFight
It's late in the day.... but doesn't this accomplish nothing??
public DateTime LastDataTimeStamp
        {
            get
            {
                lock (this.SyncRoot)
                {
                    return this.lastDataTimeStamp;
                }
            }

            internal set
            {
                lock (this.SyncRoot)
                {
                    this.lastDataTimeStamp = value;
                }
            }
        }
every property in this class follows this pattern.
and all the backing fields are value types.
I don't see the point in locking around a simple value-type assignment or read.
 
10:26 PM
(I linked it on the Wayback machine because blog.coverity.com appears to be down at the moment).
 
cool, thanks. yeah, leave it to Lippert to make it overwhelmingly obvious and make me feel stupid in the process ;)
 
Yeah, that's a great little article. I'm getting to the point with C# that I'm beginning to understand Eric's posts without my head exploding.
 
now if the code snippet I sent earlier had been for an int32 property I could have claimed that I was still right :)
 
Ehm, mayyybe. Eric's example uses an int32.
 
Yeah, my goal with C# is to be able to explain the majority of his posts to other devs.
I'm not done reading it yet...
so yeah, if my class was just a bunch of int32 reads and writes, having no locks would be just the same.
the instant I add more code in the getters and setters things change.
also, the instant I start using structs, things change as well.
my favourite bit: "If you can avoid writing multithreaded code, do so."
the last dev had a different motto: "If you can avoid writing single-threaded code, do so."
 
10:49 PM
My second favorite bit: If you're going to do concurrency, do it at the highest possible level of abstraction.
 
00:00 - 19:0019:00 - 23:00

« first day (1504 days earlier)      last day (2562 days later) »