Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

08-27-2016 , 11:08 AM
ITT very serious business.

fyi there's 125 people subbed to the clojure meetup group in my non tech hub city so there's that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-27-2016 , 01:26 PM
We get unlimited vacation and most here take at least 3-4 weeks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 03:36 PM
I feel like an idiot here. Isn't there some very easy JS one-liner to accomplish this? Map/reduce doesn't seem much simpler. Something else?

Code:
let detail;
if (response) response.forEach((agent) => {
  if (agent.basicDetails.id === id) {
    detail = agent;
    return;
  }
});
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 03:53 PM
Quote:
Originally Posted by suzzer99
I feel like an idiot here. Isn't there some very easy JS one-liner to accomplish this? Map/reduce doesn't seem much simpler. Something else?

Code:
let detail;
if (response) response.forEach((agent) => {
  if (agent.basicDetails.id === id) {
    detail = agent;
    return;
  }
});
this should be equivalent:

Code:
let detail = response ? response.find(x => x.basicDetails.id === id) : undefined;
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 03:56 PM
Quote:
Originally Posted by gaming_mouse
this should be equivalent:

Code:
let detail = response ? response.find(x => x.basicDetails.id === id) : undefined;
No need for ternary. Also no IE support for find at all.

Actually nm depends on what response can be at that point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 03:58 PM
Does javascript have something like python's 'next'? Because in python this is

detail = next([x for x in (response or []) if x.basicDetails.id == id])
or anyway, if you only expect one match, surely in JS you can say
detail = response.filter(function(x) { x.basicDetails.id == id })[0]
or something like that?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 04:03 PM
I barely know any javascript, no idea what is going on. Is response variable a collection of agents? By checking for response with if statement you implicitly check if it's initialized and not empty?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 04:04 PM
Quote:
Originally Posted by Grue
No need for ternary. Also no IE support for find at all.

Actually nm depends on what response can be at that point.
yeah you need the ternary to replace the outer if. as for IE support, if you need it, just use a polyfill -- hobbling your code is not the right solution.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 04:07 PM
Quote:
Originally Posted by RustyBrooks
Does javascript have something like python's 'next'? Because in python this is

detail = next([x for x in (response or []) if x.basicDetails.id == id])
or anyway, if you only expect one match, surely in JS you can say
detail = response.filter(function(x) { x.basicDetails.id == id })[0]
or something like that?
the filter solution should work too, but doesn't express intent as well as find -- otoh, it has better built in support so may be the best choice here.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 04:12 PM
Meh with browserify pulling in lodash to a file is easy enough as its more or less ubiquitous now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 04:45 PM
Wife thinks I got a job offer, but I'm skeptical. Will hopefully know more soon.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 04:52 PM
Quote:
Originally Posted by Noodle Wazlib
Wife thinks I got a job offer, but I'm skeptical. Will hopefully know more soon.
I am trying to imagine this. Wife thinks you got a job offer, but you think it was... what?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 06:17 PM
Offer to go past the first stages of interviewing
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 06:32 PM
Quote:
Originally Posted by Noodle Wazlib
Offer to go past the first stages of interviewing
Well let me help. If it doesn't have a dollar amount and a start date, it's not a job offer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-28-2016 , 08:18 PM
That's what I said, in exactly not those words
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2016 , 01:10 AM
Quote:
Originally Posted by gaming_mouse
yeah you need the ternary to replace the outer if. as for IE support, if you need it, just use a polyfill -- hobbling your code is not the right solution.
It's node, so ES6 is fine. (Still can't do destructuring though).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2016 , 09:28 AM
destructuring is supported in node 6 standardly and node 5 behind a flag but yeah LTS
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2016 , 01:35 PM
looks like i was right
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2016 , 11:24 PM
If anyone here has a lot of react experience and might be interested in a full time or part time side gig, shoot me a PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-29-2016 , 11:27 PM
Pretty liberal city, small business, developer in-person interview: if my hair is just a little too short for a pony tail, should I cut it all off?

It's massively impossible to style at the length it's at.

tia
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2016 , 10:08 AM
Quote:
Originally Posted by KatoKrazy
We get unlimited vacation and most here take at least 3-4 weeks.
Unlimited Vacation is a great PR strategy for companies that costs nothing as soon as they add the "need approval form manager, can't inconvenience clients" type clauses.

My first job after graduation in the UK in 1988 started with 5 weeks' vacation plus 8 public holidays. And the UK is typically on the lower end of European allowances.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2016 , 03:48 PM
Quote:
Originally Posted by suzzer99
Apparently there are some US companies (according to El Diablo) which have unlimited vacation and people actually take like 6 weeks off - Euro style. I am skeptical that it's not a scam most of the time.
Quote:
Originally Posted by KatoKrazy
We get unlimited vacation and most here take at least 3-4 weeks.
I do too. I'm a bit of a workaholic so I don't go nuts, but sure, 6 weeks doesn't seem unreasonable and I'm sure some people at my company take that much. I'd probably like to do a long trip to Europe sometime next year and still take a normal amount of vacation around the holidays, and it's nice to know I can just do that if I want to without planning years ahead.

My last company originally had something standard-ish like 5-10 sick days a year (no rollover) plus 3 weeks PTO (with rollover), then changed it to give you like 2 extra PTO days and take away all the sick time. Boy was it fun to dip into PTO time when I got the flu.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2016 , 03:52 PM
My company has unlimited vacation. Very few people taking more than two weeks though. The 2 or 3 examples I can think of are all executives.

My team probably averages two to three weeks when you tally up all the long weekends. Other folks more than one rung below our execs are probably talking one week, if that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2016 , 04:07 PM
Why so little???
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-30-2016 , 04:13 PM
You'd be surprised if you just take more.

Try taking 4 weeks instead of two, and when everyone else sees there is no repercussions, it could change the culture a bit.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m