« first day (3040 days earlier)      last day (2133 days later) » 
02:00 - 21:0021:00 - 00:00

02:08
how do i: exDataList.where(x => x.exerciseName == "BenchPress").select(x => x.Muscle).FirstorDefault ---> JS: var test = exDataList.filter(x => x.exerciseName == "BenchPress").map(x > x.Muscle).FirstorDefault?
@Adan that is very confusing. need context
im sry, was looking for a filter --> map example, found it on google, disregard question
 
1 hour later…
03:33
@Adan datalist.filter(({ exerciseName }) => excersiseName === "BenchPress").map(({ muscle }) => muscle)
If you're using underscore, the map can be replaced with pluck(list, 'muscle')
Regarding the FirstOrDefault, just leave it as [muscle1, muscle2, etc.] or [] which will behave like an optional type
03:59
Thanks google for allowing regex in find and replace for Google Docs :)
04:23
now they just need multiple cursor support...
in google docs? o_O
yeah
would be easy to implement and very awesome for power users
 
2 hours later…
06:13
Any React person out there?
Facing a weird issue
 
2 hours later…
07:50
@JBis that's cool
I didn't know about that
+1 for google
@AbhishekPandey \o
In my application I'm uploading user images, but they needs to be in square to be fitted in the frame
I'm looking for a js plugin to crop image and upload it to server with ajax
@ShrekOverflow lol?
 
1 hour later…
09:06
@ShrekOverflow "If it's brown, lay down. If it's black, fight back. If it's white.... Goodnight."
@Neil No markdown in multiline
You had a linebreak there
oh did I?
ah I grabbed the last line from that page
In fact it looked weirdly formatted
 
2 hours later…
10:56
@Neil what % of your work would you say is repetitive?
@Rick define repetitive
and what % is actually problem solving
technically writing programs is repetitive from a certain perspective
I do that a lot :)
doing something you know how to do would be repetitive. but not on a micro scale
someone tells you to build this button would be repetitive, walking down a path that's been well established
ok, so how often do I do things that are outside my comfort zone?
10:59
like other have walked it and your just the third guy to be doing it
ya
not often, but not even rarely
sometimes I'll be asked to do something which I've never done before or that it isn't my job to do but I've been asked to do anyway
that's usually just due to incompetent managers.
and how much of that is true problem-solving, something which involves Math or some higher conceptual thinking?
virtually 0
maybe it's because the types of problems I encounter, I've encountered before
do you consider that a positive or a negative?
but I work for a bank. Not a lot of math outside of calculating tax
Well neither I suppose. It's to be expected if you work long enough
Though I think I would enjoy more problems which challenged me
11:09
I don't think I would enjoy working in an environment where I'm not actually problem-solving. Or at a minimum around others who are solving hard problems.
well, I am always solving problems most people can't solve
It's just gotten to the point where the types of solutions to these problems are usually the same
that's true, the more problems you do, the more familiar you become with recognizing them, and how to solve them.
the only way I encounter new problems is if I try using a new language
which is something I do, but in my spare time
it's the only way I can think like I used to think when I started programming
11:28
that's interesting, I learn something new when I can structure the problem in my head, and then put it into working code. It's knowing the tools really well and how to use those tools to structure things at a higher level.
at least for me.
usually the more challenging aspects are in how to rearrange the code
though in most cases it just boils down to picking a pattern that decouples two classes
12:04
Does any one have idea about this : stackoverflow.com/questions/54627995/…
@AqibSamanK Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
12:49
let final = fs.createWriteStream(this.final_temp_file, {flags: 'a'});
        this.parts.forEach(async part => {
            await new Promise(resolve => {
                let r = fs.createReadStream(part.file.path);
                r.on('close',function () {
                   resolve();
                });
                r.pipe(final);
            });
        });
Is that waiting for each part to complete its appending until going to the next one?
I am getting (node:20263) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit and not sure why.
159
Q: possible EventEmitter memory leak detected

DevI am getting following warning: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace: at EventEmitter.<anonymous> (events.js:139:15) at EventEmitter.<anonymous> (node.js:385:29) at Server.<anonymous> (...

They say here to figure out why.
@JBis No.
forEach won't wait for your promises.
@MadaraUchiha Ok. So just a normal for loop then?
let final = fs.createWriteStream(this.final_temp_file, {flags: 'a'});
// must be inside of an async function
for (const part of parts) {
  await pipeFileToWriteStream(part.file.path, final);
}
// ...
async function pipeFileToWriteStream(path, stream) {
  return await new Promise((resolve, reject) => {
    const r = fs.createReadStream(path);
    r.on('close', resolve);
    r.on('error', reject);
    r.pipe(stream);
  });
}
I'd do something like this ^
great thanks
any idea why its writing, not appending? I added the a flag?
13:05
> options may also include a start option to allow writing data at some position past the beginning of the file. Modifying a file rather than replacing it may require a flags mode of r+ rather than the default mode w.
it would seem you should be using r+, not a
> r+ - Open file for reading and writing. An exception occurs if the file does not exist.
Wont that just write over the file, not append it.
well it says it would modify it rather than replacing it
that sounds like append to me
14:06
Anyone knows when assignments in a class body are executed
before or after the constructor is called
new class { v = 9; constructor(console.log(v)}}()
Why am I getting:Uncaught SyntaxError: Unexpected token =
@AnArrayOfFunctions Because class fields is not yet in the standards.
So it's typescript only
class Foo {
  constructor() {
    this.v = 9;
  }
}
@AnArrayOfFunctions Indeed.
Anyone knows typescript?
!!welcome AnArrayOfFunctions
14:12
@AnArrayOfFunctions Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
OK well then about this futuristic not yet implemented feature of JS anyone knows about it
:D
quietly closes the door
@AnArrayOfFunctions I meant that you should just ask your question
And if someone knows/interested they'll answer
We have people here who know TypeScript, yes.
Ah ok nvm though I found the answer myself
Thanks anyway
14:20
I hope to god that typescript is never made a part of the javascript standard
@DavidKamer Unlikely to happen anyway, but why not?
because then people who think they're better than me for using typescript will have validation lol
Is there a good suggestion on how to debug React Native? I know the error and the general issue it comes from (I think) but because the Stacktrace is telling me nothing really, I don't know where to start my search.
@DavidKamer I don't need to use TypeScript to know I'm better than you ;-)
🔥🔥🔥🔥🔥🔥🔥
14:24
@MadaraUchiha fair enough, but it's others that I'm worried about, and when the java people finally give up and come over to the dark side, I'm sure they'll want to ruin it by looking down on everyone not exclusively using typescript. I'm okay with being looked down on by you (even though you are a weeb), but not the Java people lol
I'm actually getting some weeb tendencies lately, so I don't have much room to talk...
@DavidKamer Java devs have no business looking down on anyone lol, even PHP is significantly better than Java nowadays
I know... It frustrates me that universities still make students learn Java. I think it is time to change, but I get that they want a language easy to setup that has strong typing.
*statically typed (probably strongly typed too, but not what I was going for)
so we're bashing Java today?
when is bash php day? I can come back
@Neil You can bash PHP if you want, but it's at least improving, unlike Java.
I know it's bashing Java today
14:35
I can't believe Java added var lol
I asked what day is php day. ;)
Don't get me wrong, I'm not an anti-Java fanatic.
It just feels like something made for learning at this point.
nah, you don't offend me
I am a java programmer and I bash Java, so
It's way too verbose for what it does tbh
I often see Java code for a simple problem and I'm like "wow, it is impressive that you are able to turn it into that much code, but it is still a terrible thing to do"
it's never really been a good language for writing a small program
inb4 s/for writing a smal program/
I've been looking into Kotlin and it is a bit more succinct
15:11
hi all, long time and all that
quick question mongodb aggregates
i have an array in a document which are line items in an invoice, how can i create a view that adds total cost?
ive managed to calculate total cost, but in doing so I have had to $unwind the line items, and now they are not the array I need to return
@Neil I mean even a large program doesn't need extra code lol
I mean it especially doesn't need extra code
@DavidKamer welllll Java's verbosity isn't for nothing
when you're working in a large codebase with a lot of people, it can be helpful to require verbosity
@DavidKamer if you were using a language whose word with minimal letter count is 10, you'd end up typing a lot of letters to say anything
@Neil anyway Kotlin is 110% the way to go
it's not extra code, just verbose
15:16
@forresthopkinsa never really thought of it this way, but also could it just be making a need for more people at that point? What's the chicken and what is the egg
@forresthopkinsa I'm really liking it so far
@DavidKamer I mean it's kind of a bell curve
@Neil yeah it's a beauty
it's a unique language in that I like it more and more the more I use it
not a lot of languages do that
I started with Java, and I've done some cool things with it, but I could have done the same things a lot faster and cleaner with JavaScript or Python or even C++
JS and Python are awful for large teams because dynamic typing
C++ is only ok for teams where everyone is very competent
it's very elegant, and I like that public members are like properties now
and getters and setters can change the behavior, so you're not forced to change the call everywhere in your program afterwards
15:19
data classes are the bomb
@forresthopkinsa that's one of those things where I agree at face value, but I also wonder why people aren't commenting there code (maybe that is a naive thing to say, and yes I agree self documenting code is better)
Also, I hate to say it, TypeScript basically kills that argument
No, you're totally right, TS is great
but you weren't talking about TS lol
TS does the best with what it's been given, but it's always limited by the fact that it's trying to squash types into a very dynamic language
@Neil have you used property delegation?
@forresthopkinsa yeah, I like that too. I think that could be used to bad effect though, so I try not to
but I think it would make injection easy as pie
yeah I do think there are some things that could be abused
it's not Go lol
 
2 hours later…
17:16
@Feeds yo dawg, I heard you like error bars
@forresthopkinsa who's behind "Feeds"?
that's easy. [REDACTED] owns the account and posts the content
oops, my bad
So it isn't SO?
I always thought it was SO lmao
17:40
nice one, xkcd
@DavidKamer it's a random dude
just joins a room to post random links, then leaves
huh, that's really odd lol
it is, right?
they have a bugged id too
I think you guys are lying lmao. It doesn't even link to an
SO account
again, bugged id
the oneboxing regex doesn't check for negative ids
bugged? Are we in a James Bond film from the 70's lol
17:47
this guy seems to have cracked SO as well: chat.stackoverflow.com/users/-3
but they don't post messages
nah, different thing
feeds is just an SO util
but nice try lol
so what, Qt is a util as well?
no, if you notice Qt has a little "why?" link that explains why it's hidden.
@DavidKamer yes, but that says nothing about it being a utility
maybe it only has 1 rep
or maybe they managed to bring rep to -1 or something
while @Feeds' isn't showing because the id is bugged, but it's some amount
!!stat Feeds
17:55
@forresthopkinsa User Elusio proved elusive.
classic feeds
!!stat QT
@DavidKamer User Elusio proved elusive.
@towc quite the SO creepy pasta you're building
18:45
Does :, //, /, ?, etc. in URLs have special names or are they just called separators?
well, leading // is one thing, / throughout is another, and ? is another
they do different things
I wouldn't ever try to group them into anything together.
Yeah. I'm gonna inform some colleagues about URL structure. Sometimes there are confusions. I don't want to misinform them. What these characters do, essentially, is seperate different kinds of URLs parts. I was just curious if they had specific names.
well, / is a path separator, but the // separates the protocol and the address, and ? is for the query string
then you also have hashes, and some people get fancy with hashbangs
 
1 hour later…
20:02
ugh, I need to set up gulp
I'm becoming more and more intimate with JavaScript than I prefer. Yes, I'm randomly venting in the JS channel about JS.
npm install gulp
what else is there?
or do you need help setting up gulp scripts/?
contractor sent me the files I need... I asked him if I just do npm install in the folder. I have to compile scss files I guess... basically forcing myself to catch up on front-end dev that I haven't stayed on top of in like six years...
@Tiffany Couldn't he just send you a script that does that?
i.sstatic.net/BSt2O.png#.png this is what I was sent
hmm.
20:14
package.json and package-lock.json look familiar from when I've used Composer, so I have a rough idea what they do
well, if you wanted to get 'modern' gulp is already kinda dated
I still use it
webpack is probably what most are working with now
and even that is being replaced.
@rlemon I was wondering that...
but gulp-sass is easy enough
so an "npm install" would install all the dependencies you need, and if the dev was using gulp globally, you'll need to install that globally too. otherwise it should be pretty easy setup
@Tiffany okay you have a gulpfile
open it and see what tasks are defined.
then npm install && gulp <task name>
also look in package.json
20:16
hey all, hope you don't mind me jumping in on your chat. So relatively new to JavaScript and thought I would join a chat room that could help out a newbie'ish. StackOverflow is great for answers (most of the time lol) but sometimes just good to just chat about a programming language. How did you all find learning JavaScript, I would say my progress is slow so would love some experience tips if any of you have them?
@Coder Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
there is probably a script already defined for this
@Coder it depends...
I learned JavaScript in the 90's
then re-learned JavaScript in the early 2010's
In this one folder... that happens to be on a mapped drive, every time i save it takes like 3 seconds for the save to complete
in vscode
20:18
@KevinB one of my first questions on SO was about a networked drive taking like 30 seconds to a minute to allow the open file dialog in c# to open
I tried learning C when I was ten, then learned VB, C++ and Java in high school, self-taught myself HTML/CSS outside of school around that time. Basically my experience with JS is I need to do something on the front-end that isn't appropriate for HTML or CSS, and end up having to google what I need until I have some clue as to what I'm doing.
The other mapped drives are fine
And forcing myself to not use jquery anymore and focus on doing stuff in ES6
@KevinB Windows?
@rlemon I had this problem early last year, never figured out what the problem was, but ended up using C drive to complete the project.
20:22
@Tiffany open package.json and look at the "scripts" entries
err
"test": "echo \"Error: no test specified\" && exit 1"
Yep I would say JavaScript is the first real programming language that I am learning and there seems to be a lot of syntax that comes with it. Would it be fair to say that once you learn your first programing language the others become easier. The reason I ask is that I see so many developers that seem to know so many languages and unless they are all geniuses (which I am sure some are) I can only assume it gets easier with every language you learn??
@Coder essentially, yes. It's a matter of learning programming logic in general. Learning another language is just different syntax and occasionally different processes (e.g. short-circuit evaluation in PHP)
some languages let you return early which can be handy, others execute code differently which requires a different pattern
@Tiffany then I'll end the gulpfile and look at the tasks
@Coder if you're looking for a general programming class, I've heard a lot of good things about CS50x which is free
20:30
Imo: Yes. It will get easier. You have similar structures in a lot of languages (for-/while-loop, if, functions, classes, etc.). Once you are familiar with those structures, you can dive into another language more quickly.
I'd also say that while programming in any language, you start to think differently about writing code and approaching problems in that regard which further helps to tackle a new language.
You will still have differences between languages (typing for example) and the tools used to efficiently develop stuff in them but being familiar with the base principles and structures
@Coder JavaScript falls into the C line of syntax
there are quite a few languages that are mainstream that follow a similar syntax (like c#)
there's also: eloquentjavascript.net which is pretty good at teaching JS
but learning JavaScript syntax probably won't help you in Ruby, or CL, or even Python
@Tiffany thanks for the feedback, helps to get some advice from those who have real hands-on experience! Thanks also for the link, that looks like it could really help me with understanding the logic behind programming - which is where I think I am struggling.
but language features cross over.
20:33
if someone ever tells you their project is written in Velocity, run like the wind
:45321519 tab to auto-fill someone's name, also you can edit your messages by pressing up-arrow on your keyboard, while your cursor is in the textbox. Or you can click the little down arrow to the far left of your message and click "edit"
@geisterfurz007 thanks for the advice, it certainly helps with confidence as it can sometimes seem like you are a million miles away from where you want to be lol!
I wonder how many sites this will break: community.letsencrypt.org/t/…
@Coder it doesn't stop
HAMMERTIME!
I've been doing this a while
there is always a bigger dog
and you are always aware of them
20:38
@Coder Been there, done that 😉 If someone told me 2.5 years ago (where I started to write some ugly rubbish in Java with Swing) that I would now know who to write apps with JavaScript, write some mediocre Webservices with Node.JS or JavaEE and put together some decent desktop applications using JavaFX, I would not have believed them. Be patient, learn from your mistakes and those of others and you'll get there!
@Coder Programming is hard, it takes time to learn. Don't be discouraged. Also, don't focus your learning entirely on theory or you will burn yourself out. The PHP room had problems with a member who seemed to only focus on learning theory and drove himself up a wall....
@rlemon for sure, I love to code but know I will always need to learning and always keep up to date. I just want to get to the point where it becomes more fluent and involves less time staring at a small piece of code trying to work it out for hours haha!
it never does tho
you just find different problems with the code
@rlemon the easier stuff does... then you find harder stuff...
that's my point
you never stop looking at small chunks of code for hours
that's the name of the game
20:40
always learning new things
@Coder just don't read any code that use bitwise operators, that will always make you feel stupid... unless you're a freaking genius
if you wanna crank out brainless code - customise wordpress themes 😉
@DavidKamer eh, this comes up all the time.
don't use them as a cheat, but there are many sensible uses for them
quick poll: are bitwise operators in language support for the brainf*ck language?
in PHP, Oct 25 '18 at 19:00, by Tiffany
I fucking hate Wordpress
@rlemon I agree. It is just one of my very weak points tbh...
20:43
same could be said about regexp
@DavidKamer I don't even know what bitwise operators are so don't image i'll be visiting that dark sounding place anytime soon lol
and the same could be said about my skill level... however regexp's can be deciphered and created with a good cook book or reference, whereas bitwise operations can be impossible to understand without explanation
@DavidKamer No, they're no harder than regex
@Coder just look up brainfuck and that's basically a language that uses only bitwise operators.
@DavidKamer That is completely false. @Coder Don't listen to him.
20:45
@KendallFrey I disagree with that, because intention doesn't matter nearly as much with regexp
@KendallFrey it was sarcastic, not false
humor doesn't have to be empirically and objectively right to have a shade of truth.
eh?
@DavidKamer I have no idea what you mean by that
@KendallFrey okay. Why did they make the assembly language instead of just messing directly with bits?
What are you talking about?
Thanks for all the advice everyone, really helps to hear from experienced programmers. Have yourself's a good day/night and happy coding. Chat again soon
I'm not trying to argue, but I'm having a hard time thinking of a way to explain what I mean by regexp being a thousand times simpler than bitwise code because it seems very self evident to me
20:49
Are you confusing bitwise operators with machine code?
I'm in fact not.
Then you'll need to explain yourself
what's an abstraction?
why not just use bitwise operators to search text?
or use bitwise operators to add numbers, etc
what I mean is, why not implement binary manipulation every where you can?
Why... would you?
exactly, but I can tell you why I would use a regex
20:51
I can just as easily ask, why not implement everything using a OISC?
and when you see it you at least know where things are going
Or, why not do everything with regex?
I can tell you why not to add numbers with regex. I've tried. It's not nice.
obviously when you see a regex each part has a meaning that is translatable. When you see a bunch of bit operations, it could mean anything because the whole idea is to manipulate the data at a very low level.
Everything also has a meaning that is translatable
You're failing to make a distinction
@KendallFrey because it's not just a general tool that can be used to do whatever
20:53
Yes it is
In the same way that bitwise math is
the only difference I see is that more people are forced to debug regexp than bitwise operators.
Okay, so can we assume a situation where we are looking at code written in a competent way that was meant to do a job and in a proper way?
familiarity makes the false assumption that regexp is easier
@DavidKamer Uh, sure?
not exactly. You could much more easily replace most regex's quickly than debugging something written with bitwise operators
20:55
because you're familiar..
@DavidKamer I'm not convinced
@KendallFrey okay, so in this imaginary program you find one module that has regexp's in it and one with bitwise operators
bitwise maths is very straight forward. nothing jumping out to 'gotcha' about it
regexp otoh..
what does the first module do, and what does the second module do if you had to guess?
20:56
has those things in it, or is written exclusively using those things?
In both cases, I wouldn't guess, I'd read the code carefully
@KendallFrey that's not very meaningful in the concept I"m trying to communicate
right, but what is it doing at a basic level that you can start analyzing it from?
I don't understand
like obviously, assuming we are not talking about some terrible idea to "add numbers with a regex", it's searching and/or replacing text by some pattern, correct?
That's what it does, yes
Likewise, bitwise operators replace numbers with a pattern
okay, so you'd presumably debug it by analyzing what went wrong with text patterns, right?
@KendallFrey not necessarily...
20:59
And with bitwise operators you debug it by figuring out what's going on with the number patterns
What's the actual difference?
you could be doing it to anything (any piece of data) and I'd argue that the use case is just as valid for bitwise operators
is there any drawback or concern to building a npm project (I'm not sure if I have that's the right term) on OneDrive?
02:00 - 21:0021:00 - 00:00

« first day (3040 days earlier)      last day (2133 days later) »