« first day (2162 days earlier)      last day (3011 days later) » 

17:00
Did you do the .map, yet?
@AwalGarg ?
@Luggage Yup, took my array of arrays, then mapped it to an array of objects, now I'm trying to combine like objects. Someone said to use reduce for that.
yea. reduce will work. can you think of how to do it with a plain loop and loose variables?
@rlemon incredible
@Luggage Yeah I think so, let me try that first before I get fancy.
17:03
@BenCraig ohh my, please say today you're the lucky 10000
@rlemon this is one of my favourite videos
> AHHHHhhhhOOOOOODdhhGHhHhhhhh
@Waxi is this the transform you want to do? if not, alter it. jsfiddle.net/of0ooL7s
Interesting Read :D
"Kinda of a cocky SOB. You ain't got what it takes yet kid" - workplace.stackexchange.com/questions/76068/…
17:06
that fiddle is the same as before and still kinda useless
Well, now I have objects instead of arrays lol. I want to combine them where they have the same id.
is and name, or is just id good enough / unique?
are those numbers dates? that's a difficult format to work with
id and name are unique, but to make things easier just id is good enough
yeah they are dates
once i'm done with these array of objects, i'm gonna go through it and put all the results on a 'calendar'
Where's @SterlingArcher?
strat by making: { id: 123, name: 'Alpha', date: 1231441241, value: 4.5 }
17:08
He's always here for Friday.
That was they are all KNOWN property names and you don't have to use the name as a value
hmmm, so maybe i don't need to combine objects then if i do that. i just thought it would be easier to work with
maybe. we'll get there.
ok, made the change, have known property names, but have multiple objects that have the same id, but that shouldn't be a problem now that i think about it. i should be able to find the table row that has that id, then drop the value into the appropriate date cell
@Trasiva last we spoke he was taking care of business in the bathroom, maybe he's still there?
17:12
i wonder if i should build my calendar as an object too. right now it only exists in the html
@rlemon Two hours since he was on hangouts.
His legs probably died if he's been gone that long, and he can't get the blood flow back.
My money's on another goldfish disaster
@Waxi jsfiddle.net/of0ooL7s/1 this look like what you want?
@Luggage Yeah exactly, something like that, but hold on...that may not be necessary, as long as I can just go through the objects and put the values where they go.
I thought grouping them would make things easier, but maybe not.
you could order by id/name first. that'll get you close
17:15
@KendallFrey possibly. but those are usually announced immediately. I suspect hot coffee on the lap
let me screenshot where the values need to end up then maybe you could steer me in the right approach
Hey guys,
or he said viola in a meeting and they're still laughing at him
17:16
1 message moved to Trash can
@ManuelStoilov Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@ManuelStoilov array indexing returns native Elements
not wrapped ones
@CapricaSix got you. Sorry
.on() is for jquery objects. By using [i] you are getting the plain (better) object.
use eq
or use .each
just $(".navAnchor").click(...)
17:17
@rlemon Or he decided to get an afternoon quickie with Steph, and something went horribly wrong.
the one thing jquery brings to the table is not having to loop
> It's not supposed to bend like that!
a broken penis is no laughing matter.
Since they put casts on broken bones, I reckon he'll be getting a caster.
that's awfully generous
17:19
@Kendall you know how toes are too small to cast
same deal
@Luggage This is where I'm going with it: i.imgur.com/D1UhyTX.png
The date/hours need to end up in the red x input boxes.
it makes me sad that you've ignored a lot of security concerns and it has to do with payrole.
:(
i see.
@rlemon What do you mean?
So, I would use a structure similar to my last paste, plus a list of all dates in range / used separately
@rlemon pretty normal for all of a companies internal software to be someone's learning experience. Programmers are very learn-as-you-go.
17:22
@rlemon Some people have a third leg. And some have an eleventh toe.
@KendallFrey Some people have a personal toothpick.
Without using your list, I could loop through my array of objects, take the id, find the row with that id, find the cell in that row that has that date, then drop that value into the input box. It's not the best way, but I think it could work.
@Trasiva Some people have an extra pube
That definitely removed the error, thanks y'all. Still, the class isn't updating when I click.

for (var i = 0; i < navAnchors.length; i++) {
    $("navAnchor").eq(i).click(function(){
        $(this).classList.add("activePage");
    });
}
Some people are growers, not showers
17:23
I hope I formatted that code right
@Waxi were you not the one in here asking about security for your kiosk software?
@KendallFrey Some people have have a permanent pimple.
I may be mistaken who it was
@ManuelStoilov $("navAnchor") is the wrong selector
@Waxi the dates as keys make a little more sense that way
17:24
yaaaaaaas
@rlemon How so?
@Luggage Yeah, but using a dynamic property name is probably not good though.
Let me see if I can make this work, I don't think I'll have to combine anything afterall.
when I thought it was going to be random dates, it's not good. If you know what keys you are looking for, it's bettter
@ManuelStoilov I highly doubt you have a tag <navAnchor>
then it's just a map, not a list
k
17:26
They want this done by next Tuesday lol
It needs to read hours, pto available and requested, crunch it, and lay it all out for them so they can make adjustments before submitting totals.
@rlemon You're right. That's a class. But above my code, I have this:
var navAnchors = $(".navAnchor");
Oh oh, I know why I wanted to combine the objects! I was using my object array to make these rows in the table, but when I have objects of the same person, it makes multiple rows for them when they only need one. That's why I needed the combination.
Why all corporate apps are written by noobs: youtube.com/watch?v=ecIWPzGEbFc&feature=youtu.be&t=3061
@ManuelStoilov post your actual code then
yea, that's the reason to transform the data
alternatively you could make a separate array of JUST unique people.
for the purposes of looping over for rows.
17:31
@rlemon Okay, but it's a bit long so I'm trying to figure out that JS Bin things right now
Oh that could work too, didn't think about that.
Doing my own is still faster than modifying the existing one, written in Visual Basic, so whatever.
If I don't finish by Tuesday, they can fuck off.
ohh, this is that..
    @keydown(Keys.BACKSPACE)
    onTagRemove() {
      const selected = this.getSelected();
      selected && delete this.state.tags[selected];
    }
Is there anything wrong with this? The state does not appear to update after it
well, short circuit evaluation is stupid
use an if statement
I'm all about throwing out old VB programs, but if I was in charge, I'd feel pretty nervous that devs were re-writing programs jsut because they couldn't recompile the old one.
and by 'nervous' I mean 'angry'
17:35
@rlemon
https://gist.github.com/Manistoi/a8ff6ebaa66ed666beaf65a41f06d4b2
All I'm trying to do is add the 'activePage' class to each of the 'navAnchors'
okay, like I said before $("navAnchors") is wrong
that looks for <navAnchors> elements
@rlemon you mean mine? But the part that seems weird is it doesn't ever update the state reactively
okay well I don't know about any of that, but don't try to be clever to get around using an if
@corvid is that react? you can't mutate state that way
just use the if
17:36
I don't know where all the files are to recompile it, my computer is not setup to do VB development, such as having all the dependencies he had to do his nifty tricks in Excel or whatever, I don't know VB, I don't know Visual Studio which seems to be the thing you want to use, and I don't know his program. Figuring all that out would take longer than just recreating it given what I have and know.
@Luggage So, do I copy the object, delete the key, and then set the state to that new object?
this.getState(). never touch this.state outside of the constructor.
no, you set it to undefined since react merges in new state
deleteing from a clone won't helo
you know.. react has a page all about this.
well, it merges shallow, so you can clone tags, delete, then this.setState({ tags: modifiedTags });
I missed that it was a nested property a minute ago
Up until this point I've been able to make/produce anything asked of me (with the help of this site and chat of course), but this one is challenging me, which is good and bad at the same time.
if i'm not challenged, i'm suicidal.
or homicidal
@Luggage Is there anything wrong with using the callback provided with this.setState? That solution works as well
17:40
or genocidal
lol
the callback tells you when your state change is done, but I don't see how it applies here
Today I shall murder all... rolls dice... Italians.
2
What's the meaning of "inset" when I use it in box-shadow property?
does it mean "inner" ?
you remember those old windows 98 window borders?
It says you can use a callback to set the state in this.setState
17:44
link?
this page describes what inset is:
I checked. It really does.
It's got pictures, too.
That Snaggy is cool.
Scooby agrees
@KevinB I'm curious how is "inset" related to win 98 ?
> The second (optional) parameter is a callback function that will be executed once setState is completed and the component is re-rendered. cc @corvid
nope, can't change state there.
17:48
Huh, I am looking at a different page then
> It's also possible to pass a function with the signature function(state, props). This can be useful in some cases when you want to enqueue an atomic update that consults the previous value of state+props before setting any values.
link?
ohh, one sec. that's not the callback, though
Yeah that was my fault, it's based on this page
There also isn't a this.getState() function in react I don't think
@Shafizadeh the borders of all the windows used an inset border that looked very similar to the example on mdn for inset border
so.. that' doesn't help. That still accepts a patch to state
and you RETURN that.. never mutate state directly. I am 100% certain of this.
    @keydown(Keys.BACKSPACE)
    onWatermarkRemove() {
      this.setState(function (previousState, currentProps) {
        delete previousState.watermarks[previousState.selected];
        return Object.assign(previousState, {
          selected: null
        });
      });
    }
That appears to work though, although I feel it's wrong
17:50
1. it merges. don't use object.assign
2. you are setting the wrong property.
you want to delete state.watermarks[selected] but then state state.selected = null
13 mins ago, by Luggage
well, it merges shallow, so you can clone tags, delete, then this.setState({ tags: modifiedTags });
^ replace tags with watermarks
Okay, so they give me a copy of the object to mutate, and I change the properties as needed, then return it?
You return just the properties you want to mutate. it merges.
shallow
so.. return { watermarks: modifiedWatermarks }
So, when you say shallow, if a key is an array, I return a new array that "replaces" it, you mean?
Yes.
react only cares about the direct properties of state.
> Performs a shallow merge of nextState into current state.
100% of your questions have been answered directly in a single documentation page.
It's not even a long page, man
17:56
And a good eveninz to youz.
Yeah I'm not gonna make a separate array of unique values because that stills leaves me with my array of objects that are not ready for use. I gotta combine their stuff.
I suppose, but it appears to be acting a bit strange in a few places despite following the documentation. Why did you say not to use Object.assign?
because it does that part for you
did @MadaraUchiha got the question about async operators? I got introduced in a project full of them and would read a good canonical about that.
18:01
it's redundant and only shows that you don't know what react is doing
Hey! Can someone share their or somebodies .cshtml homepage. I'm looking for examples of a pretty homepages I can edit.
There a place to find those? premade templates
many
@FélixGagnon-Grenier No
and if you are using bootstrap, then even more
I'm using MVC5
18:01
But I did write a documentation topic about it
and bootstrap yeah
they aren't MVC or anything. They are just css and html. you turn it ino .cshtml
Those aren't free?
But you said it was a shallow copy, so wouldn't you have to copy an object to make it?
18:02
And I dont see the templates, only the themes
No, but for about $10 and they save you many many hours
category: admin and dashboards
those usually have more what you'd want. all of bootstrap themes, plus additions, themes for common UI controls, etc.
I dont want a theme, just a template
so delete the css file
@MadaraUchiha cool. I'll start by getting my understanding to a relevant level
hehe
18:04
@FélixGagnon-Grenier Do you know how async functions work?
They unwrap promises for you, by pausing the function and waiting for the value
I think part of the problem, also, is this e.persist() on an event. What's the point of that? Just that this.setState is async and therefore the event would have already been garbage collected before the state is set effectively?
@corvid I said shallow merge
Async iterators do exactly that, for iterators.
it does an object.assign on whatever you give it
If you have questions after reading the doc entry, ping me :)
18:05
@MadaraUchiha yep, actually I'm reading about koa (used for the project's server) and one thing leading to another am seeing a lot of these async generators and functions. thanks for the help!
Yeah, to the first key. What if you have an object at a key, eg, { thing: { magic: true }, meow: true }. You would have to make a new object for thing, wouldn't you?
27 mins ago, by Luggage
well, it merges shallow, so you can clone tags, delete, then this.setState({ tags: modifiedTags });
clone, modify, set. I said that so many times
I am done with you.
IF you need clarificatino, ask a new question, bit I am tired of answering the same one over and over
cat puked on the sofa, we have the insurance and warranty crap -- call them up, they're sending ME cleaning crap and if that doesn't work then they're sending a professional.
you'd think they'd send the professional to apply chems to fabric first?
just tell them it didnt work?
hell, I'll try it
but if it strips the colour or fucks my sofa they have to replace it
5 year warranty + free cleaning for like $350
was a really good deal actually
18:09
> This baby's got a 5 year arm rest to arm rest warranty.
And room-side assistance
silly rpi, y u ship with node 0.10
@rlemon Like, that's the total cost of the couch? Or just the insurance?
insurance
user1596138
user1596138
Lol Facebook you are either pro-shitty shit or anti-shitty shit
user1596138
18:19
Borderline clickbait lol
!!afk \//\
user1596138
!!afk actually paying attention to the meeting
@Loktar ^ slacker
user1596138
lol I've been outted
jsfiddle.net/v71w8cxg, what function/method should I be using? Can it be done with loops/variables?
18:23
for doing what? morphing A to B?
I want the top to become the bottom, yes.
What happens in react if you have an onClick event on a parent element, and an onClick event on a child overlayed on it?
reduce could probably do it
while iterating build a map of id-> index to avoid having to do unnecessary looping
if a loop is what is natural, do that.
we can help (maybe) convert it to a .reduce() later.
(or switch to an object so you don't need said map)
18:25
I don't have any preference, just looking for something simple that works, cause I'm a damn amateur.
Let me try loops then since I already understand those.
I can't tell if Friday afternoon is making me feel like mush or if I'm just a lamer.
there is bubble wrap on my desk and I just leaned on it and scared myself
Scared yourself in which way? Jumped up and shrieked like a girl?
@rlemon A military academy here was shut down for an hour and a half because someone called the cops thinking it was gunshots.
i.imgur.com/FMZyrLT.gifv iphone 7 launch denmark
18:35
it bothers me the artist just up and stopped half way
some of the dogs are missing / not filled in
That's something I didn't need on a Friday
:D
How do you check the next iteration in line on a forEach()?
	results.forEach(function(e){

		if (e[0] == e+1[0]) {

			console.log(e[1]);

		};

	});
it is
@Waxi you don't.
18:39
if the kid isn't using a seat or watching the game he shouldn't be charged for admission
@Luggage So instead of using a forEach, I should just loop through the array based on the count and then compare like that? I've done that before.
@Waxi keep a second list of already-processed items and refer to that
not a bad idea
was a brutal summer
bought two of these
they are AMAZING
@Waxi show me your .map(). I want to use it but I don't want to accidently write it for you
18:42
I only watched the first 30 seconds
if he doesn't mention it, you can hook it to a hose as well
and you get the 18V battery
	var results = results.map(function(e){

		return {

			emp: e[0],
			name: e[1],
			day: e[2],
			hours: e[3]

		};

	});

	for (var i = 0; i <= results.length-1; i++) {

		if (results[i][0] == results[i+1][0]) {

			// splice the duplicate out

		}

	};
That's how I was gonna do it.
they were on sale for $5 more than the battery alone, so shit. great deal
Oh wait, I'm getting my shit mixed up.
I'm not making a listing of uniques anymore, I'm combining objects, ok, so I would still do my loop for comparison, but instead of splicing, combine the object...
wait, are you trying to filter dupes from an array?
he's trying to combine objects with duplicate id's
18:44
ahh
nvm then
Yeah, confused myself for a moment. Thought I was still making a unique list.
@KevinB Damn dude, you just saved me hours of work. Gonna absorb this so I understand what's it doing so I can use it in the future. Thank you much and everyone else.
Working in isolation is not helping my skills. I wish I had a team to bounce off of.
@Waxi Buy a rubber duck.
I used to give them to all my troops when they started.
lol
I'm being serious. The rubber duck method can save your sanity.
troops? is that literal?
Yeah, i was thinking about using a map, but didn't think to use it that way and then convert it back
was thinking just having the result be a map
Damn you guys, giving me 3 ways of achieving the same thing. Time to educate myself.
@Luggage I love you long time.
18:56
main thing i wanted to avoid was .find()ing in the result array
I did not avoid .find()ing.
I don't bother with performance until it is an issue
performance? meh, not a problem unless you have many hundreds. browser compatibility? MDN has a polyfill.
good god that took way too long
pi@raspberrypi:~/ $ node --version
v6.6.0
also, if someone is trying to get the concepts, performance just makes things harder than they need to be
18:58
I don't bother with performance when it's an issue, but micro optimize while prototyping.
@Luggage Yea, 'troops' is a term used in the military for people under you.
@rlemon A wild update appears
@littlepootis So do most people. :(
@littlepootis rpi3/wheezy ships with node 0.10
and no npm apparently.
Yea, I didn't know if you gave ducks to actual soldiers, or if you were calling your current employees/co-workers troops
18:59
ffffuuuuuuu
just npm install -g npm
ohh
I just installed node from source with npm
i thougth node from source came with npm..
i've done from source before..
it does
I didn't mean like "node with npm" is a specific package

« first day (2162 days earlier)      last day (3011 days later) »