« first day (1813 days earlier)      last day (3140 days later) » 

2:02 PM
@AwalGarg what list ?
 
esdiscuss
 
@RoyMiloh ha
not sure if i am on 10th or 1st
 
@Abhishrek it's all about comments
 
@RoyMiloh 10th
atleast in java
 
2:34 PM
Hey has anyone here worked with CodeMirror?
I need some advice regarding it's changes event
 
by the way, is it possible to invoke a function by two names? for example making both a(); and b(); a valid call. I thought something like: function a || b () {}
 
@MagnusBurton shoot
 
crl
I only see function a(){}; var b = a;
 
@AwalGarg Okay so as you might or might not know it's event changes triggers for each added/removed letter and for a couple of other situations. However I need like a way to "batch" these events together so if I type Hello world it shouldnt trigger for every single char but after a while.
I thought about counting a variable and on the 5th char "save" the changes which I'm now doing for every single letter
Does that make sense?
 
crl
*its
 
2:38 PM
@MagnusBurton Google "javascript function throttling"
 
@crl oh yep, thanks man
 
@MagnusBurton Set a timeout and clear/recreate it on each event? Then it'll always trigger the timeout after n milliseconds if there hasn't been an input. Is that what you're after?
 
@MagnusBurton That is not codemirror specific, btw. A change event fires for all input boxes for every character change. Also Zirak gave you the answer.
 
@Zirak I expected you to ask him to implement throttle himself, actually :P
 
2:40 PM
meh
 
@Zirak Perfect, thank you°
@AwalGarg But now we come to the 2nd part of the problem.
I need to merge all the delayed changes together to one
Like an ot.js operation
 
crl
I don't think that hello world could be more verbose :D
 
Merging it as an ot.js operation would be the best in this situation
 
Do you need the delta?
 
@AwalGarg delta?
 
2:42 PM
@crl oh ya, right. The other thought I had to check if a function has been called and then simply: a().called ? function a() { : function b() {
 
@MagnusBurton the difference between the value before change and after change
 
@AwalGarg Kind of. It's an operational transformation
 
@MagnusBurton Does the change event fired by codemirror contain the delta for that specific event?
If it does, you can implement a middle-ware coroutine which takes the stream of events and merges a pack of them into a single event mutating the delta along the way
 
@AwalGarg Yes which is then put into operationFromCodeMirrorChanges(change, instance) to get a TextOperation operation
Okay
 
@Zirak "I saw this once in a NetTuts+ tutorial" lol.
 
2:45 PM
@AwalGarg That's key, thanks man. I'll go ahead and try it out
Thank you for all of your assistance!
 
@Zirak how long did it take to write it out? ^^
 
@AwalGarg Couple of hours at most. The hard part was choosing Scruffy quotes. I take great pride that it ran on the first try.
 
crl
var x = Object.assign( _=>{this.called=true; return 2}, {called: false} )
x.called
x()
x.called // why this doesn't work (return true) :(
 
@crl => binds this to the outer context
That's 90% of its point
 
The rest 90% is some functional nerds like it that way
 
crl
2:48 PM
var x = Object.assign( _=>{x.called=true; return 2}, {called: false} )
 
Just use function like a regular human being
 
crl
too happy that Chrome supports lambdas now
 
oh btw, Firefox users, anyone has written a persistent extension for the GCLI dev bar? how bad is it?
 
Is there a way in javascript to find out if a function with a certain name has been called?
 
@crl arrow function preserves context
 
2:51 PM
without having to set flags
 
@Asperger no
 
am I the only firefox user here :(
 
I use iceweasel
 
@Florian I see
 
crl
@RoyMiloh Does it mean the same as what Ziral said (=> binds this to the outer context)?
 
2:52 PM
@FlorianMargaine did it get gcli?
 
@AwalGarg like I know/care
 
@FlorianMargaine hit shift+f2
 
It's my work browser for work stuff
Otherwise it's all chromium
@AwalGarg I'm not on my computer
 
@crl yes
 
here is some pseudo code. For convenience, something like this is not possible is it? jsfiddle.net/q4815t26
 
2:59 PM
wat
just create two functions; what you're trying to do is nonsense
 
indeed
Im just curious if it does work. Im aware of creating two functions.
 
though almost possible with es6 proxies..
but no reason to do it the way you are asking for
 
ि् यॊु
 
Ya, but it could come in handy for certain scenarios
 
no, not only does it not work, there isn't a good reason to do it in JS.
 
crl
3:01 PM
another ping_all unicode hack?
 
function x(command) {
    if (command === 'a') {
        // ...
    }
}
var a = x.bind(null, 'a');
a();
you can .bind() to make a new function with some/all arguments filled in to accomplish something similar
 
here is a scenario where this might be useful
 
@Zirak Hey man I have a question about this throttling function I found when googling remysharp.com/2010/07/21/throttling-function-calls
 
so instead of creating two seperate functions, everything is in one
 
\o\
/o/
 
3:04 PM
nope. not useful there.
 
@rlemon I forgot that water physics are terrible, now my hellevator is filled with water, wat do :(
 
It seems like my function isn't being executed at all. Might be because I placed the debounce function inside the event but I don't know how I'd solve it otherwise.
 
@Luggage, why do you say that? I find creating seperate function somewhat annoying : (
 
it's confusing and all you are doing is moving one argument ('click' or 'hover' into the function name, and having to write code for each one
how it that better than just
el.addEventListener("click", function() {
    console.log('clicked');
});
 
@Luggage but what if we had more than two, lets say 6 and the entire thing was more complex
 
3:07 PM
then my argument is 3 times as valid
 
@Asperger The reason you have a string as an event name is for extensibility
 
@AwalGarg it's nice
 
makes sense
 
Im overthinking this too much.
 
3:07 PM
So having the event type as an argument is very convenient
 
any good articles / resources to read which you guys recommend?
 
!!resources
 
thanks @madara
 
That link was for you.
 
3:09 PM
!! tell Asperger resources
 
@CapricaSix thanks alot
Ok, I know, I said alot. Dont post that monster pic lol
 
@Zirak Missed the "p-put it in me, senpai" opportunity
 
@Asperger, take a look at zone.js source
 
3:13 PM
wtf? why?
 
@RoyMiloh if I only werent a hater of plugins
it all started with jquery. Now I pretty much hate everything 3rd party
 
crl
some are necessary, some are optional
 
this link about custom events is awesome
how many programming languages do you guys know?
 
@Asperger I'm a janitor, I clean boiling toilets. What do you want?
 
By the way, I pretty much get annoyed when people say "I program in JQuery and Angular"
what the heck
 
3:17 PM
@Luggage why not? their implementation of tracing things is nice
 
Fluent in 3ish real programming languages. 'know' lots.
boiling toilets?!
 
@BenjaminGruenbaum yeah, but what can I expect to learn from it about promises/concurrency in general that I can apply in my code?
 
@Zirak Thank you! So I need to use the debounce function outside of the event. Now, how would I do this without setting the textarea's oninput? Could I just do debouncedLog; in the event?
 
Hi all.
 
3:22 PM
I've a local page in webview. Is there any way to check whether a specific cookie exists created in another domain?
 
@MagnusBurton debounceLog is now guaranteed to at most be called once per 500 ms. Do with it as you wish.
@Ravimallya No
 
Jquery needs to die
people need to get back to creating their own micro-libraries.
 
just don't abus jquery. Chances are you'll have it around in your code due to some other dependency, so jut only use it for the tings it does well
it's handy for event delegation (but you can do it yourself in a few lines of code)
 
@Luggage but I mean even ajax. I could create my only little ajax shorthand just like jquery... or the famous finding a class in jquery...the library is only doing the looping part.
 
no arguments here.
 
3:25 PM
@Luggage, event delegation is one of those things ya
 
we don't push jquery around these parts.
gotta go, meeting sister for lunch.
your sister
2
 
: /
 
LMAO
 
lol
 
bring it back, don't spoil the joke lol
 
3:27 PM
Awww man, really? XD
 
@Luggage Remind her of our appointment tomorrow
 
@Luggage tell her I enjoyed our night last week
 
<insert witty remark about someone's sister>
 
@AwalGarg which book are you talking on?
 
@MadaraUchiha Hey man, you're pushing it
 
3:31 PM
@RoyMiloh A thesis by the awesome Mark Miller erights.org/talks/thesis/markm-thesis.pdf
 
That's no way to talk about @Asperger's sister
 
lol. No use, she is probably somewhere on mars with other autistic people xD
 
@AwalGarg wow. nice.
 
u w0t m8
 
Its the alot monster!
just smaller
 
3:39 PM
Nice pic!
 
crl
!!s/p(.)c/g$1f/
 
@crl Nice v$1d! (source)
@crl Nice vid! (source)
@crl Nice gif! (source)
 
since i had to replacy my broken laptop with a new one, installing softwares again can make the things boring
still, does anyone has experience with corrupted bookmark backup ?
(for firefox) ... thought to fix it myself since it's a simple json file
 
gotta love es6
export const chain = (startObj, ...fns) =>
	fns.reduce((obj, [fn, ...args]) => fn(obj, ...args), startObj);
though macros would have been better
 
crl
4:17 PM
@Mosho how do you use it (by example)?
 
    assertEqual(chain({a: 1},
	    [mapValues, v => v + 1],
 	    [mapKeys, k => k + 'b']), {ab: 2});
where mapValues and mapKeys are functions that do what they should
 
crl
pretty nice, you could also use Promises to do that?
 
Don't
unless the functions are async
 
crl
hmm why?
 
4:36 PM
@crl this should do it:
export const chain = (startObj, ...fns) =>
	fns.reduce(async (obj, [fn, ...args]) => await fn(obj, ...args), startObj);
seems to work
assertEqual(await chain({a: 1},
	[v => Promise.delay(500).then(() => v)],
	[v => Promise.delay(1000).then(() => ({a: 2}))])
, {a: 2});
but it won't work for non-async stuff
so either use chainAsync as an alternate method or make all your functions async
then it would work for both sync and async values
 
5:06 PM
should I use something like this in the top of all pages ?
<meta http-equiv="Cache-control" content="public">
 
crl
i.imgur.com/Ls21G2S.webm because .gif suck
 
@Sajad Why would you?
 
I don't know, my friend told me for caching the data, you should use it, is it right?
 
If you want that behaviour (which in that form is useless to everyone), just send the header.
 
@Zirak look, I have some js and css file that I want to be cache. so should I use that code?
 
5:15 PM
No
How could you even put that in a non-html file?
 
morning
 
I don't know, I need to some .htaccess code ?
 
If you want to cache, send proper headers
 
@Sajad google it, find out what it does
 
how send proper headers? there is any reference for caching ?
 
5:16 PM
what's a meta tag do? Can it be done better elsewhere?
 
ah ok
 
Google it
 
ok
tnx
 
crl
5:32 PM
How can you modify the name of an object's key? you can only do obj.newkey = obj.key and delete obj.key right?
 
5:42 PM
depends. sometimes, some keys are un-deletable.
 
@Sajad actually, it is better if you send those parts as HTTP headers
also, you are starting to dip in the request optimization field there .. I don't think you have time for that
that's kinda a really large subject
 
lol I'm looking at a 55% tax rate on the income from my private freelancer company
why do I even bother with this shit?
 
Can anybody tell me little about roles in parse.com
 
5:59 PM
new RegExp(/#/./).test(elem)
Unexpected token /
 
@ivarni this is why in Latvia the entire development industry is basically a gray market at this point
 
nvm, forgot ""
 
when you looks for a job you get two numbers: your "official salary" and your "actual salary"
 
@tereško For the record, I don't mind paying tax. I've gotten more value out of the healthcare system than I'll ever realistically pay back but I'm starting to think all the paperwork involved with freelancing isn't worth it when I have a job with a steady income already
 
I got some really funny video for you guys
 
6:03 PM
I'm basically punished for having both a salary and income from my own company on the side
 
@ivarni have you played Deus Ex?
 
@tereško Of course, I'm not a simpleton :)
I still play the original one from time to time
best fucking game ever
 
@ivarni remember the speech by the guy at the top floor on Liberty Island?
 
@tereško ok tnx
 
@tereško not verbatim, but I recall there being a guy talking about something :)
I usually don't opt for the non-lethal route so I do miss some of the talking
 
6:06 PM
about how in 2050 only 2% of people were independently employed
and how that shift was done just by use of taxes "imperceptibly over time"
 
> Number one: In 1945 corporations paid 50 percent of federal taxes. Now they pay
about 5 percent. Number two: In 1900 90 percent of Americans were self-employed;
now it's about two percent.
 
I probably should do a replay soon
 
that game made me care about politics
 
Human Revoltion wasn't bad either, not sure how to feel about the upcoming one after the pre-order bonus BS they tried to pull
 
6:11 PM
well, pre-order thing was canceled
 
Yeah, because of backlash
That doesn't mean they're off the hook for it
 
why cannot they just make it so that "preorder bonuses" are something that is also a DLC, which is released 6-9 months later?
that would be a really reasonable policy
 
preoder bonuses are stupid in the first place. I'll probably still get the game but I might wait for a sale after the stunt they tried to pull
There'll probably be a GOTY edition down the line anyway
 
anyway, the original Deus Ex is still one of my all-time favorites
 
Absolutely agree with that one
 
6:15 PM
it's was first one of "thinking man's shooters" ever
 
And it's the kind of game where you still discover new stuff on the fifth playthrough
 
0
Q: Is it possible to increase horizontal space between characters in the text field?

SajadI have a captcha field, and I like to increase the empty space between the characters, Here is current shape: (I know the white space between characters is depends to the font, but I want to know there is another approach for increasing it or not) Now I want something like this: It should b...

 
IMHO it was way ahead of its time
 
but then I had to re-login for some stupid reason
Did the NSA just pull a number on us?
 
6:18 PM
nope, I am still here
 
That's what an NSA agent would say
 
as I see it, NSA still cannot do real-time traffic monitoring
there is just too much of it
 
@tereško thanks!!
 
There's been claims of them doing it on the phone networks though
I guess it's a problem that can be solved with horizontal scaling which makes it a matter of money, not tech
 
@ivarni that's no so hard. All you need to do is make a good speech-to-text script. And since speech is one of the slowest ways to transfer the information, having real-time phone monitoring is relatively simple to implement
 
6:22 PM
what is difference between "em" and "pix" ?
 
em is relative to fontsize
if font-size is 24px then 1em is 24 px and 2em is 48px
 
@ivarni ah I see!!
 
@Sajad EMs are relative size unit. The "base value" is defined in your browser
 
@Zirak @copy nix, guix, thoughts? Worth trying?
 
@tereško ok, so em is really useful unit!
 
6:24 PM
the value of an EM unit is computed based on parent's font size
@Sajad it is really useful but is also really hard to use
 
@tereško yes, I understand, sometimes it can be hard to use
 
guys what rule is there for checking if two special characters exist? this doesnt seem to work new RegExp("/#./") or
/#/./
 
@Sajad not "sometimes". It's always a fucking pain in the ass.
 
:-)
 
CSS3 has rem which is relative to the root element and not the parent
 
crl
6:28 PM
!!> /[#.]/.test('poo.com')
 
@crl true
 
EMs are nice when you can get somebody else to do it
 
It's a bit more predictable
 
@ivarni this. rem > em
 
@FlorianMargaine Only just heard of GUIX, and only had 4th-hand experience with Nix, so not much I can say. The ideas seem nice, it just takes the leap to use them and see if they're good and comfortable and an actual improvement.
And if GUIX is, then another target for pkgfs :D
 
6:31 PM
This meta.stackoverflow.com/questions/307329/… horrible question should have been asked for JS instead.
 
@Asperger regex101.com
 
wow
 
So many tools available.. chef, ansible, etc. No idea which one(s) to invest learning..
 
thanks zirak!!
 
@Asperger make sure you click "javascript mode" on the left.
 
6:35 PM
@Luggage thanks! this is awesome
 
It is. I donated to that site.
 
I will too. This really helps.
regex is one of those things that make you a magician :D
 
I need a chrome extension that automatically puts my bookmarks on the top of the queue instead of bottom.
old bookmarks should keep going down and new ones should come up highlighted
 
I feel I've missed something basic about CSS here, is there a way to make the browser actually care about the margin-bottom on the anchors at jsfiddle.net/L378u4Ln ?
 
it has the margin, i think it's just overlapping because it's inline, not a block
 
6:44 PM
I assume it's the margin-bottom: 0 on the parent p that's messing things up, but I kinda need that as it's added by my CSS reset
 
@ivarni display: inline-block
 
@Luggage ah, that makes sense
 
yes, the <p> are blocks, with 0 margin between, and it hink the <a> margin is just hanging out the bottom
 
Yup, inline-block to the rescue. Thanks :)
 
ok weird this does not work new RegExp("[#.]")
 
6:49 PM
define 'does not work'.
Laptop catch fire?
 
damn
 
He's using a character class, . is just a dot inside one
 
Seeking opinions on ansible. Is it a decent tool to manage small numbers of unrelated servers?
I want a system where I can replace a document that describes all the things to install to make a server from scratch with a script for a self-documenting setup deal.
 
@Zirak does this make sense to you? ("^[^#.]+$")
 
/me so sleepy
!!afk night, Tabs > spaces
 
6:54 PM
@Asperger Yes. What doesn't make sense is that you use the regexp constructor instead of regexp literals.
!!> /^[^#.]+$/.test('blah')
 
@Zirak true
 
!!> /^[^#.]+$/.test('foo#bar')
 
@Zirak false
 
So your princess is in another castle.
 
crl
there are cases where you need RegExp though
 
6:56 PM
dynamic or configurable regex.
nothing horrible about non-literal, is there?
 
Hi guys, I am creating a JS module (to use in react) to load google Charts. Because google charts uses the google JSAPI it's not available offline. Currently i am using the following code to load the Google JSAPI, and i was wondering if this is the correct way to deal with injecting a script and only allowing it to happen once (hence exporting the instance of my class):

https://gist.github.com/christiaanderidder/09bfd27960392bcfb65f
 
@christiaanderidder 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.
Error 404 occured, I will call the maid (@Zirak)
Error 404 occured, I will call the maid (@Zirak)
 
@CapricaSix Get well soon.
 
@Zirak dig to bottom, exit game, enter game
 

« first day (1813 days earlier)      last day (3140 days later) »