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

11-08-2017 , 07:15 PM
Bike > Hollywood Park >>> Hustler >>> Commerce for enjoyment imo. Again small sample size. Commerce just seems full of hoodiebots. Also we're talking like 2009 is the last time I was there. Lol.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-08-2017 , 07:47 PM
https://devdocs.io/

Very nifty and handy tab to have open while programming, especially if you work in multiple languages - I'm constantly looking up APIs and behavior contracts in standard libraries that I don't have memorized
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-08-2017 , 10:31 PM
thanks, that's pretty slick
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 01:23 AM
Nice!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 02:43 AM
What would be considered the "best" way to compare an array to an array of objects in javascript and return that into an array?

For ex.

array = [1,2,4]

data = [{id:1,d:'hi'},{id:2...

solution = ["hi",...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 03:11 AM
Not much left in the sprint so I decided to spend more time paid programming. Paired programmed with the person who I mentioned being a slow typer.

The person is not only a slow typer but a slow computer user. The person uses the mouse way too much when coding which bugs me. Copy and pasting code around is done using a mouse but in a veryyyy slow way. For example, this person nevers uses the arrow key, on the keyboard to copy text, but always uses the mouse.

Click drag slowly across the text that is needed to be copy. I'm trying to nudge this person to use the built in tools in the IDE for refactoring variable names so hopefully it helps. But I'm not sure how else I can help when the person is just slow.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 06:49 AM
Quote:
Originally Posted by Victor
limit poker is a million times better than nl, esp in a live setting.

Last edited by Wolfram; 11-09-2017 at 07:06 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 07:02 AM
Quote:
Originally Posted by Larry Legend
What would be considered the "best" way to compare an array to an array of objects in javascript and return that into an array?

For ex.

array = [1,2,4]

data = [{id:1,d:'hi'},{id:2...

solution = ["hi",...
my attempt, using lodash:
Code:
let result = _
  .chain(data)
  .filter(obj => _.includes(array, obj.id))
  .map(obj => obj.d)
  .value();
Edit:

I guess you can do it like this with vanilla js:
Code:
let result = data
  .filter(obj => array.includes(obj.id))
  .map(obj => obj.d);
That gets rid of the chain and value calls, but I use underscore/lodash because it allows me to use map and filter on more than just arrays.

Last edited by Wolfram; 11-09-2017 at 07:18 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 11:31 AM
Quote:
Originally Posted by Barrin6
Not much left in the sprint so I decided to spend more time paid programming. Paired programmed with the person who I mentioned being a slow typer.

The person is not only a slow typer but a slow computer user. The person uses the mouse way too much when coding which bugs me. Copy and pasting code around is done using a mouse but in a veryyyy slow way. For example, this person nevers uses the arrow key, on the keyboard to copy text, but always uses the mouse.

Click drag slowly across the text that is needed to be copy. I'm trying to nudge this person to use the built in tools in the IDE for refactoring variable names so hopefully it helps. But I'm not sure how else I can help when the person is just slow.
Pretty much my pair programming nightmare.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 11:53 AM
What if I modify my question to make data an object?

In the example of 2 arrays my thought was to use vanilla js, and I was using filter and map as well, but we also use lodash so that is an interesting option.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 12:24 PM
Quote:
Originally Posted by Wolfram
my attempt, using lodash:
Code:
let result = _
  .chain(data)
  .filter(obj => _.includes(array, obj.id))
  .map(obj => obj.d)
  .value();
Edit:

I guess you can do it like this with vanilla js:
Code:
let result = data
  .filter(obj => array.includes(obj.id))
  .map(obj => obj.d);
That gets rid of the chain and value calls, but I use underscore/lodash because it allows me to use map and filter on more than just arrays.
Wolfram,

If you like lodash, strongly consider switching to ramda:

https://goo.gl/v4pSGe

Code:
const isIn = flip(contains)

const dForIds = (ids, data) => pipe(
  filter(where({id: isIn(ids)})),
  map(prop('d'))        
)(data)

dForIds([1, 2], data)
In this particular case, I actually prefer your vanilla JS solution, but in general ramda enables composition much more effectively than lodash/underscore because it's data last, curried by default.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 12:25 PM
Quote:
Originally Posted by Larry Legend
What if I modify my question to make data an object?

In the example of 2 arrays my thought was to use vanilla js, and I was using filter and map as well, but we also use lodash so that is an interesting option.
If you use lodash then everything that is an array can be an object. It treats them all as collections. E.g:
Code:
_.includes({ 'a': 1, 'b': 2 }, 1);
// => true
Quote:
Originally Posted by gaming_mouse
Wolfram,

If you like lodash, strongly consider switching to ramda:
I'll check that out, thanks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 01:18 PM
Don't use lodash for built in js stuff like filter...

If you need to loop through objects use Object.keys.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 02:09 PM
I have a question about Amazon's classic elastic load balancers and am curious if anyone here knows the answer.

Does their round-robin algorithm have any logic to account for the differing size of servers behind the ELB? We generally have 5 or 6 servers running at any given time, two of which are 2+ instance sizes larger than the others. I'm wondering if a simple round-robin approach from the ELB might be the explanation behind some of the variability in response times.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 02:13 PM
Quote:
Originally Posted by RustyBrooks
This forum needs a drunk posting thread. I could fill it up by myself.
or general rant thread, it happens already in this thread but lets not exclude ones who cant stomach it . Thread like that would be nice, no need to explain, debate or be rational after a ****ty week
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 02:24 PM
Getting into machine learning, taking an online class and reading books... update on the "pave my own way" rants I've had in the past. Very optimistic about the future of this science.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 02:32 PM
Quote:
Originally Posted by Grue
so here's a weird/stupid situation: some dude is trying to "steal" my game. In other words he's cloning my site and trying to recruit my players to play on his instead (no idea why really other than he's a narcissist? I don't allow hate speech maybe he wants that? w/e). He's not writing any code really.

I mean its open source on github but uh I don't really want to write code that someone's going to compete with my game and push it there publicly right? I mean everyone in this situation would just stop pushing to github correct?
Finally learning to copy my text after losing it twice due to network issues.

What the T&C states in github. Can anyone use identical code in commercial purpose? Do they need to give credit? Do they need to share modified code.

It could be that this guy is or has been one of your site users especially if signing in is required. no certainty but would think there is a chance.

+publish a short notification about the shady dealings when users log in on some kind of a note users see once. I would think twice playing on a site doing shady stuff like that. Especially giving them my details.

Last edited by vento; 11-09-2017 at 02:50 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 03:02 PM
Oh I shamed him into getting rid of his site with the implied threat of banning him from mine. Also he's not much of a developer so he'd probably never get it up outside of localtunnel. Meh.

He unstarred me on github lol...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 07:39 PM
Quote:
Originally Posted by vento
What the T&C states in github. Can anyone use identical code in commercial purpose? Do they need to give credit? Do they need to share modified code.
That's not how it works. Each program on github is supposed to have a license attached to it. These license vary in their definitions.

GPL is considered the most copyleft, and Linux uses v2. All the code + additional code must be open-sourced.

MIT is a popular, DWTFYW-style license. You can choose to keep the code open or closed.

I use MPL because I do not want people close-sourcing my code, but I understand it if people don't want their code open-sourced. If you use my program, you have to release my code + any changes to the original files to the end-user. Any file you add can be whatever you want.

Quote:
It could be that this guy is or has been one of your site users especially if signing in is required. no certainty but would think there is a chance.
Totally not what "open source" means. You can look at the source of any open source product, and you can reuse, modify, change, and examine the code. There is no clause in any open source code that says "you must create something unique."

Grue took an open source project and made it his own. That aligns with the spirit of open source.

Quote:
+publish a short notification about the shady dealings when users log in on some kind of a note users see once. I would think twice playing on a site doing shady stuff like that. Especially giving them my details.
if you can't handle open source, don't partake in it. Nothing at all shady about what the other guy did.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 08:47 PM
Quote:
Originally Posted by Grue
Don't use lodash for built in js stuff like filter...

If you need to loop through objects use Object.keys.
I disagree.

Object.keys doesn't give me map, filter or reduce on collections. And if I'm using lodash for object collections then I prefer using it also on arrays for consistency. Especially because I'm not the only one working on the codebase and I'm trying to introduce more functional practices to junior devs and don't want them getting confused with different syntax for map/filter/reduce.

Last edited by Wolfram; 11-09-2017 at 08:55 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 10:52 PM
I'm about 4 beers in, is it time for me to say what I *really* think about Java?

Actually, I'm going to give an informal talk in a week or 2 about the language "Solidity" which is what Ethereum uses to write their crypto currency contracts. Spoiler alert: it's a garbage fire of a language that it's nearly impossible to write bug free code in.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 10:54 PM
what? Object.keys returns an array. My biggest problem with lodash filter/each etc is that you don't know (without jsdoc which no one uses) if you're working on an array or an object.. I don't mind dynamic typing at all but uh I do mind that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-09-2017 , 11:04 PM
Quote:
Originally Posted by Grue
what? Object.keys returns an array. My biggest problem with lodash filter/each etc is that you don't know (without jsdoc which no one uses) if you're working on an array or an object.. I don't mind dynamic typing at all but uh I do mind that.
"map" is not something you just do over an array. technically, you can map over any functor, and that's _lots_ of useful things, including streams and functions themselves. what that means is, you can map over anything where some concept of mapping makes sense, which is tons of things.

it sounds like you're arguing you only ever want to map over arrays, which is a limit you really don't want to impose on yourself....
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2017 , 12:25 AM
Eh? In javascript you can only map, as a method, over an array. I'm sure you know this so I don't get the point you're making.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2017 , 12:29 AM
gaming_mouse sounds high AF right now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m