« first day (1901 days earlier)      last day (3063 days later) » 

12:05 AM
0
Q: Recreating audio filter curves in html5 canvas

AspergerIf I wanted to program curves of various audio filters, what tools should I use to construct them in canvas? http://raider.mountunion.edu/~miskeljp/ds/resources/filters/filter_types.jpg My ideas are: quadraticCurveTo bezierCurveTo custom curve using Math.sin Since I am still lacking experie...

 
Hello.
 
.olleH
 
hello!
 
Gruezi
 
12:07 AM
Guys, what for are curly braces used in globs? /modules/**/{,*/}*.js
 
what are globs?
 
Did you even try googling? Even once? tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm
 
I must confess. This time I didn't. Usually I do. Plus I spelled the word wrong way :( double fail
 
googling is becoming a profession xD
 
12:14 AM
@Asperger and you're terrible at it too
 
@phenomnomnominal why?
Bad but not terrible
 
You could've googled "glob" before and got an answer.
 
Asperger == lazy
:D
 
What the hell? Are you saying that people with mental disabilities are lazy?
/stoking the fire
 
Yep
 
12:18 AM
Well I know at least 3 Social Justice Warriors, and I'm gonna tell on you
 
XD
 
laziness is one thing, but actively wasting people's time is pretty shit.
 
no, seriously I dont really care what glob is
 
So if I'm right, then this pattern tells about all directories inside modules directory and all of subdirectories. So if /modules has /modules/homepage and /modules/contact, then this pattern should cover all *.js in there(not sure about /modules/homepage/sidebar).
 
so why say anything then?
 
12:20 AM
There was a momentary spark of interest...
Its gone now ; )
 
Does anybody know of a gulp- file minifier that supports generator syntax? All that I've tried so far throw a fit at the asterisk char.
 
crl
DOMTokenList.prototype.toggle = function(cls, b){if (b===undefined)b=this.contains(cls); if (b) this.add(cls); else this.remove(cls);}
 
generator syntax?
 
function* () { ... }
 
ES6?
 
12:28 AM
Aye
 
Haven't looked into it yet.
I've just finished a project translation from grunt to gulp for the dev. env. Only jshint creates a headache. Not sure why, but for some reason it outputs warning in files two times.
Or it scans them two times.
Maybe due to that glob pattern. Investigating the issue.
 
crl
!!>undefined||1 - 1
 
@crl 0
 
In typescript, is there a practical difference between import * as foo from "./foo" and import foo = require("./foo")?
 
yes
you can't do the latter if you're going to ES6
I think
I can't remember :(
 
12:44 AM
I've switched a few modules over from export = to export default and that required a switch to import bar from "./bar", I'm trying to decide whether or not to switch the non-default exports over for consistency, too.
 
I would
 
I still don't get it. What is the diff. between goo.gl/ig7e6d and goo.gl/X3VGvr
 
crl
I guess {} is for optional things
 
great for concentrating while programming.
 
@Asperger I had a friend who read a study about Pachelbel's canon aiding concentration... so he listened to like 100 hours of it while studying for finals.
 
12:56 AM
@Retsam great composer!
 
1:09 AM
@crl isn't everything optional with the second as well?
 
import app from "../../../../app";, man I love Node's relative paths so much...
 
sarcasm?
 
Little bit.
 
if import statements could be used in conjunction with template strings, then that would mitigate at least some of that nonsens.
 
aliases like require js had would be nice
 
1:20 AM
Oh? How so? Something like:
const BASE = '..\..\..\..';

import app from `${BASE}\app`;
 
import foo from `${process.cwd()}/app`
 
Ehh, assuming that the current working directory is the root of the application has its own issues.
 
Since you can't define variables above imports, you would have to define global properties that would store those things
 
Node actually does sort of support setting a base path via the NODE_PATH environment variable... but the documentation there is that they're basically just supporting that for legacy and don't actually want you to use it.
But that was annoying, since it meant setting either setting NODE_PATH globally on my machine... or else setting it every time I start the app. Which was mitigated by using scripts, but still annoying.
 
1:40 AM
nick make me RO pls
 
2:33 AM
How do I decide, whether I use object literal notation or function constructor for completing a task?
 
@overexchange Personal preference? Consistency with the rest of the code? There's not one "correct" approach.
 
@Retsam I saw this article preferring object literal notation
 
ok i got it.. i have to refresh the browser for a call to the server to happen and see the debuging in vscode
thanks
 
@Retsam that article also takes some concrete widget class to to explain the difference
nice article
 
@overexchange I mean, that's one person's opinion. If you agree, sure, go with that; but there are other opinions, too.
Though I'd still argue that consistency should trump either opinion. If the codebase has a convention, stick to that.
 
3:02 AM
@ndugger you forgot to release 0.1.1-beta
Y u no use a version bump tool?
 
 
1 hour later…
4:32 AM
Hello All
I am working with knockout js and a fileInput
And I get a fake path as my file input value in my knockout viewmodel
can anyone help me how to get full path not only file name or fake path
 
That would be a privacy breach
However the fake path should still be usable
 
105
Q: how to resolve the C:\fakepath?

e_maxm<input type="file" id="file-id" name="file_name" onchange="theimage();"> This is my upload button. <input type="text" name="file_path" id="file-path"> This is the text field where I have to show the full path of the file. function theimage(){ var filename = document.getElementById('file-id...

 
4:49 AM
@Retsam I have tried this, but It's giving me only file name
 
@Neha According to that question, that's what firefox does, yes. As the answer (and @Shea) says, there isn't any way to get the real path.
 
I need an alternate way to pass my file to my controller from knockout viewmodel
 
Hi All
 
@Neha You should be able to get the file object itself from the input; not just the file name.
@Neha See the MDN page on File.
 
5:09 AM
@Retsam ok Thanks, I am working with fileReader api. See if it works.
 
5:45 AM
Is there a chrome addon which highlights English syntax ?
as I type it ? Would help me significantly in learning the English language.
 
Hahaha
I don't think spoken languages are that simple
Just pay more attention. Read books, watch movies, etc.
Also, there shouldn't be a space before the question mark (or any punctuation) in your sentences.
 
6:25 AM
@Retsam most of the browser objects are function constructors. Ex node -> element -> htmlelement...
 
@krish Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Thanks @CapricaSix
 
@GNi33 I don't know if I've linked you to this sub before, but if not reddit.com/r/bodyweightfitness
 
@Retsam In this hierarchy all are function constructors
 
6:34 AM
@nderscore you probably should watch infoq.com/presentations/8-lines-code-refactoring
(referring to that framework of yours)
 
@rlemon @KendallFrey whobuiltthemoon.com
 
@krish thats a linter I want a highlighter
although syntax highlighter + linter === fun ! :D
Also I'd rather not have everything I type uploaded to a web service !
 
6:57 AM
 
 
1 hour later…
8:02 AM
@crl It is very intuitive already, but still here you go: awal.js.org/especser/#7.3.21
 
My 2015 was very productive in career aspect. I learnt functional programming using python, completed Java JLS, CSS3, JS, currently learning jQuery
user image
2
 
stealing that
 
@overexchange You learned FP with Python? hehe
 
It was the continuation of SICP course and SICP course was using python language
 
8:22 AM
@overexchange Yeah, JavaScript is actually a much stronger language to do functional in.
If you want to be really fancy, take a look at Common Lisp or Haskell.
 
Python is largely ok for FP too but to learn FP, as @MadaraUchiha said, JS is much stronger.
Also the ecosystem
 
JS is much stronger? Not true. python 3.x has functional programming features that ES7 is trying to propose. ex- generators
python programmer can use ES7 proposed features easily
 
@overexchange Generators are already supported in all major browsers, as well as NodeJS.
 
8:37 AM
Generators are in ES6.
It is not about 1 feature or another. JS has function expressions, for instance, which Python doesn't have. But really, it is the entire language and the experience itself.
 
@overexchange generators are not a functional programming construct.
@overexchange python is a great imperative programming language, probably the best one right now for general stuff. It's just very imperative - the people in charge of it hate functional programming mostly.
@AwalGarg those are lambdas and python has those. They have to be single line though.
 
@BenjaminGruenbaum yep, single line ones. Which ES6 has too.
 
Anyhow, JS has tail recursion - any language without tail recursion isn't really a functional language.
@AwalGarg Yes, but the statement "JS has function expressions, for instance, which Python doesn't have" isn't really true.
Python is also very declarative (for example expressions), just not functional.
 
@BenjaminGruenbaum ok, should be "Python's lambdas aren't as useful".
 
@BenjaminGruenbaum s/has/will have/
 
8:43 AM
@MadaraUchiha has, in babel today for instance.
It's a property of the language, not the implementation.
 
@BenjaminGruenbaum your hat's placement is near perfect, nice :D
 
comprehensions and generators help a lot for functional programming
 
@BenjaminGruenbaum Eh? How is that a property of the language?
 
crl
comprehensions are not so necessary imo
 
@overexchange no, they're the opposite of it.
 
8:45 AM
It's not left to the implementor's discretion, but it's still an implementation thing
 
You can have generator-like constructs in functional programming, but Python is very mutation friendly and has pretty weak functions overall (and that's a good thing).
 
crl
!!> Array.from({length:4}, (_,i)=>i) // should be easier tho
 
@crl "0,1,2,3"
 
@MadaraUchiha the language dictates that it supports tail recursion, defines what a tail recursive call is - and an implementation that does not do tail recursion is not a conforming implementation.
 
@BenjaminGruenbaum Fair enough
 
8:46 AM
:D
 
Beer today?
 
Also, JSC does TCO, so Safari for example has them.
 
That's not a normal internet argument when a guy recognizes he's convinced...
 
Or is Sharon still busy reimplementing SVG in React?
 
^ * 2
@MadaraUchiha I'm the one doing that atm :D
 
8:47 AM
@BenjaminGruenbaum Yeah, but you can do it in, what, 45 mins?
Shouldn't affect beer time.
 
I want to have a beer today, so I'm inclined to say yes, but Gal and I are supposed to see the new starwars movie - so if he opts out then sure.
 
@Zirak ping
@BenjaminGruenbaum Saw that yesterday
 
@MadaraUchiha no spoilers!
 
Company rented the entire theater for R&D
@BenjaminGruenbaum Darth Vader is Luke's father
 
@MadaraUchiha nooooooooooooooooooooooooooooooooooooooo
 
8:48 AM
@FlorianMargaine nooooooooooooooo.com
 
@MadaraUchiha yeah, some companies did that. There were 3 free screenings - but I wanted to see the first 6 first.
 
@BenjaminGruenbaum Nope.
You didn't edit it.
 
@BenjaminGruenbaum see the histories of the two above messages
 
8:50 AM
@BenjaminGruenbaum Reload
 
Ah, cool.
Weirdish
 
@BenjaminGruenbaum We can purge history, but the last revision always remains
If you want to ask me to permadelete, remember to edit your post before deleting
 
@MadaraUchiha Do you have any info about : meta.stackoverflow.com/questions/310598/wheres-my-swag/… ?
 
@MadaraUchiha or you can edit it yourself and then permadelete :D
 
Welp, talk to the relevant parties, I'm for a beer.
 
8:51 AM
how can jon skeet have that amount of reps if he only answered 11 questions?
 
@AwalGarg Yes, that's also an option, but not after it's been deleted by OP.
@Neoares wat
 
ahh
 
only 30k people reached
 
@Neoares He answered 32K questions. Not 11.
~138.1m people reached.
 
8:52 AM
You're looking at his meta profile
Not his stack overflow profile.
 
wait
shet
 
Jon Skeet, Reading, United Kingdom
833k 418 5873 6993
 
SO pls
now it has sense
6993 bronze badges?
 
> Jon Skeet has more "Nice Answer" badges, than you have badges.
 
oh ok, they are accumulative
last time awarded by @jAndy, 6 mins ago
 
8:54 AM
I can't find a USB stick, going mad now >:(
 
@MadaraUchiha Do you think you can read my messages ? ^^
 
Jon Skeet has more gold badges than most users have rep
 
@TheLittleNaruto I have no idea about that.
 
Thank you
 
It's Stack Exchange employees, not the moderators, who are handling it
Sorry :(
 
8:55 AM
NP :)
 
I had forgotten about that swag. Maybe that was the plan...
2
 
@DenysSéguret Given that out of 5m users on Stack Overflow, 3m have 1 rep
That applies to anyone with more than 1 gold badge :P
 
@MadaraUchiha let's be fair, those 3m users aren't 3m humans. Many people create an account each time they want to ask a question
 
@DenysSéguret Yes well, obviously users who remain active naturally get more rep
 
9:02 AM
How many programmers are there on Earth ?
 
@DenysSéguret to be fair, a lot of high rep users get rep just from intertia
Look at Raynos for example, he had 60k when he left, I bet he has like 100k now
 
"inertia" ?
 
No activity in 2 years
 
@DenysSéguret passive rep
 
9:03 AM
Yup, over 100k, he's getting a shirt for his 2 years of inactivity :D
Raynos, San Francisco, CA
100k 30 254 318
 
yeah, was wondering about the word, but I'm now sure it was just a spelling error ^^
 
@crl first time i see that ...
 
@DenysSéguret oh yeah. lol.
 
it has to be noted that scientists in USA is using metrics lately
 
9:07 AM
Is the mole part precisely true ? I'm puzzled on that one...
 
Probably should be Carbon
Also, isotopes
 
@DenysSéguret Not for Hydrogen, AFAICR
 
Oh, I think I understand what they mean, if all your Hydrogen is 1H that's correct.
 
it's caused by definition
one mol hydrogyn has x weight
 
I didn't do Chemistry since 2010 :D
 
9:11 AM
and one hydrogyn has y amu , which got found out that x = y
 
oh yes, the mass of C12 is exactly 12 times the mass of an atom of H
 
i don't know the precise value
> hydrogen has an atomic weight of 1.0079 amu or 1.0079 g/mol. By this definition, 1 mol of hydrogen weighs 1.0079 g.
 
OK, I've looked at wikipedia, there are 4 definitions which varies by "less than 1%"...
 
@BenjaminGruenbaum In this code, cartesian_product_recursive is a sequence generator
list comprehensions can be used in similar way. adding for..in in list comprehension is a different aspect.
Advantage is, code looks elegant
 
Eh, you're just asking for a flatMap, no need to write it recursively.
Doing iteration with recursion is a great way to tell who has not been doing fp for very long - in practice you typically don't need to do it explicitly.
 
9:22 AM
example may be inappropriate but this is how we use generators in functional programming
 
So you use generators in FP inappropriately :D?
 
Is there somewhere a documentation discussing the performance impact of the various babel es2015 transforms ?
 
In babel itself, probably.
_.flatten(arr.map(x => arr.map(y => [x,y])));
 
I mean cartesian product may be solved with a different approach but this is one example that ensures stateless programming using generators
 
Generators are the opposite of stateless, they're super stateful.
 
9:25 AM
@SomeGuy yeah, I know that sub. some good stuff in there
 
That's the point, it's a function that resumes state when run.
 
crl
Array.range=function(len, cb){if(cb===undefined)cb=i=>i;else if(typeof cb!=='function')cb = i=>cb;return Array.from({length:len}, (_,i)=>cb(i))}, Array.range(3), Array.range(3,1), Array.range(3, i=>2*i)
 
Are you talking about generators that do lazy evaluation?
 
crl
makes sense?
 
@overexchange no, I'm talking about the mental model of generators.
It's just _.flatten(arr.map(x => arr.map(y => [x,y])));... no need for generators and silly stuff. If you use an iterable it's lazy - that's a property of iterators not generators.
Of course, in a real functional language it's just cartProd = liftM2 (,) :D
 
9:28 AM
I never use lambda expressions(arrow functions) because they are less readable, in the same code, I have iterative version.
But am not talking about the approach to solve cartesian product
 
@SterlingArcher What's your problem?
 
@overexchange right, you are correct - an imperative solution is the better Python here. This is because Python was designed to not be a functional language and its authors dislike functional programming.
 
crl
do u . even . lift bro
 
This is why we find you learning FP with Python odd.
 
wait
who's learning FP with Python ?
 
9:33 AM
@overexchange is.
 
i should go with Haskell to learn FP if i was you
@crl will give an error btw :p
 
Do I have to recalculate canvas.offsetTop everytime the user scrolls?
 
@MadaraUchiha any idea why Only I am getting the error though all people have same content in git config file Host gitserver User git Hostname 91.12.12.12 Port 22 IdentityFile ~/.ssh/pratikj ? — Pratik C Joshi 12 mins ago
Have you even bothered reading the answer?
 
crl
@KarelG you can have fun, like the lengthiest titles: data.stackexchange.com/stackoverflow/query/383644
biggest post body would be len(Body)
 
> 219 | ... | 2008-09-09 19:36:57
keh, it's pretty obvious since the site at the start didn't have a lot limitations :p
 
9:44 AM
!!urban keh
 
@AwalGarg keh Pardon, excuse me, what the fuck did you just say, what, huh, come again....you get the picture
 
title is now limited to ... 150 chars ?
 
guys why isnt this htaccess working?

AuthType Basic
AuthName "admin"
AuthUserFile /opt/lampp/htdocs/php/.passwd
Require valid-user
im never logged in
 
crl
10:08 AM
I feel like a noob, just fell in the "var in for loop bug" (where the last value of that var is taken)
 
all are noobs
 
crl
I forgot I can fucking use let in strict mode
 
There is no regret in learning FP using python. For me, Understanding the paradigm is more important. I would not hesitate using Java 1.8 for the same
 
@overexchange java 8 is probably a better functional language than Python :D
 
damn I still can't understand how regenerator works :(
 
10:22 AM
@overexchange good that you used "1.8" for java :p
before that version, lambda expressions fe doesn't work.
even method passing as argument.
now i can write a generic method which receives a method as argument
 
crl
10:43 AM
all it takes to do a wysiwyg jsfiddle.net/crl/sutjd8e0/6
nah, the tables are the worse
 
@BenjaminGruenbaum I was unable to understand how can they maintain lexical scope with ES5 functions. I experimented a bit more since that message and now I think I was missing the obvious: they are hoisting all lexical variable declarations (unconditionally) to an outer function and then return a closure. Isn't this... too hacky?
 
11:16 AM
@AwalGarg of course it's hacky, it's a transpiler - all those are hacky.
What choice do they have? Anything other than a closure would totally break.
 
@BenjaminGruenbaum I was expecting something more exotic. Like maintaining a state object which acts as a copy of the [[GeneratorState]] internal slot or something :-P
 
@AwalGarg I don't think that would have been possible, consider a case where you have eval inside of a generator.
 
@BenjaminGruenbaum well, eval would break babel currently anyways...
 
11:32 AM
@tereško i refuse.
 
@KarelG I guess I will have to make a change.org petition to revoke you developer's license
but seriously, it's a good lecture and a must-watch
 
crl
Can someone explain the fuck out of this jsfiddle.net/crl/zmLLch8b/38? it's supposed to just toggle show.hide. But the display of that element is always none for some reason
I have a css rule that does it, but shouldn't style override it?
yea I know Awal, I should use add/remove class, well will do then, it's because of jquery...
 
I... what
 
crl
nvm
 
@AwalGarg why?
Regenerator can just wrap eval calls if it needs to and run the code through regenerator, if it had a lexical scope dictionary thing I guess you could make it work but it'd be a lot harder.
Same with with I guess.
 
11:48 AM
@BenjaminGruenbaum it doesn't precompile the passed code.
 
crl
ok I'm doing something wrong, but dunno what exactly jsfiddle.net/crl/zmLLch8b/39
things don't get updated
 
1 message moved to Trash can
@Frondor Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@Frondor Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@Frondor Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
guys. I discovered IRC, I hope you're all proud of me :P
 
crl
man...
 
11:58 AM
(jQuery) is it possible to append some html template (few nested divs) and introduce a callback so I can manipulate the "appended" html as a jQuery element? something like:
    $(...).append(html, function($this){
        $this.fadeIn();
    });
 
crl
you made it finally
 

« first day (1901 days earlier)      last day (3063 days later) »