« first day (1895 days earlier)      last day (3277 days later) » 

crl
crl
10:00
damn lorempizza is slowering my tests
!!pizza 128 16
@Frondor adddiv.find is not a function :(
Merry Christmas Room!
Challenge: Implement Promises - Challenge I gave my coworker, for all those interested.
10:10
@MadaraUchiha that's a nasty question, implementing promises is hard.
@BenjaminGruenbaum I know, she was boasting :P
@MadaraUchiha who was?
@BenjaminGruenbaum The coworker who asked me to help her with JavaScript.
It's a hard challenge. If you want to be really nasty - make her pass github.com/promises-aplus/promises-tests
I'm fairly sure she can handle (most of) it.
@BenjaminGruenbaum Yeah, I'm not that evil :D
10:11
Ok smarty pants, you implement it and no peeking at other implementations.
@BenjaminGruenbaum Sure, but you'll have to remind me to do it later, I'm at work.
Ok, just keep in mind I would not ask someone to implement promises as an interview question for example, it's hard to get right without looking at other implementations.
@BenjaminGruenbaum It's not an interview question.
It took me an hour, and I think I'm pretty good with promises.
Even if she fails (which she probably will), she will gain a better understanding of how promises work.
10:13
(Then again, I passed all the tests)
@MadaraUchiha that's true, implementing does help understanding.
Observables btw are much simpler to implement generally. The A+ spec guards against a lot of wacky edge cases like .then being an effectful getter.
@MadaraUchiha tricky parts are also about throw safety, and async dispatch.
@BenjaminGruenbaum Yeah, I didn't have her implement those.
what why? error handling is about 50% of why promises rock.
@BenjaminGruenbaum Too much at once
split it to smaller tasks
@MadaraUchiha @BenjaminGruenbaum any suggestions for my query?
10:29
@MadaraUchiha also, detect recursive assimilation and other weird promise stuff :P
Aliasing variables, bad practice or ok? observables.expiryDate = this.expiryDate = ko.observable();
@ArijitMukherjee Oh yeah, sorry! My bad, instead of var adddiv = $('#MemberCountDiv').html(); try var adddiv = $('#MemberCountDiv'); and the rest of the code I gave you
ok
yup that worked :) thanks
@Jonathan sure.
It's ok?
10:38
Yes sure.
Are the AND (&&) and OR (||) operators lazy in javascript?
they're not lazy.
They short circuit if that's what you meant.
But they're not lazy - as in, they evaluate eagerly when they need something and not when they're themselves evaluated.
What I mean
if (!element && element.length === 0)
that makes no sense
10:41
!element excludes any possibility of element having the length property
It should be an OR
5 mins ago, by Benjamin Gruenbaum
They short circuit if that's what you meant.
With the OR it would work, but only if the second is evaluated only if the first one is false
This is what I need to know
@DenysSéguret I've already used it... then I realized I didn't have pg 9.5 :/
I have an Angular conceptual question but I'm not sure it's a fit for StackOverflow
10:45
@FlorianMargaine You mean you tried to use it ?
@DenysSéguret well, I wrote it, looked up the doc, etc
but yeah, I didn't run it
I did almost the same thing a few months ago, when I first heard about it. That would let me remove some ugly code from all my pg based applications, including miaou...
it was still in beta when I tried it, I thought it was already out
now you can just apt-get install it
... probably
the nice thing with pg in Debian is that you can run multiple versions in parallel
upserts are awesome, otherwise you need transactions
I know this chat isn't about css but I'm really confused... line-height: -moz-block-height;that value isn't documented anywhere, nevertheless it is really useful for me in this moment... Any clue where can I check the version support for that value? Google is not helping
chrome's new pdf viewer is now as nice as FF's pdf.js :D
But slower
@Frondor no
@AwalGarg no
11:04
Their material framework is not even close to be good
@pootis ok, not as nice, but close
angular-material sucks in terms of performance
please look my question
spammer spotted
@call-me 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.
11:12
@CapricaSix or you a bot?
are
she is, yes
!!tell call-me bot
@call-me I'm actually a bot, so don't reply to me.
!!are you kidding me? are you really a bot?
@pootis Yes, absolutely
slow clap
11:15
Hm that was maby a stupid question, :/
Well thank you for your welcome message.
@call-me Ah, you're welcome
I'm still a beginner at programming and i'm planning to make my job out of it later, (still going to school). Do you guys have much experience?
(Don't worry I'm not asking for you to write code for me)
I'll spoil Star Wars...
Jon Snow dies!
Somebody's going to get kicked.
@call-me Lot's of different people come here, some are still in school like you, some have worked in the industry for many years
11:27
@iv
my bad, ... :/
@call-me maybe
@ivarni It has been a quit a few months scine i came on stackoverflow. Most of the times I ask a question on stakoverfow i got kicked for a few days.
@call-me The help centre contains a lot of useful tips for what kind of questions are on topic and how to ask them. I can recommend looking over that.
Thanks
Also have a look at the chat room rules. Generally you can get away with more broad questions here than on the main site.
11:34
caprica already sended that link, :)
There was once a time when i thought Jquery was an other language than JS, ut you could use JS in JQuery. That was pretty dump of me and I totally got downvoted for that question.
That's probably something you could have discovered with Google :) Generally speaking, you'll want asking a question on SO main to be your last resort after you've exhausted other options and done quite a bit of research.
hi please look my above question which i have alerady pasted i have trouble for almost 2 days might be simple for others but for me nothing is working :(
11:51
@Mahadevan reduce your example. Nobody's going to look at 50 lines of code. Reduce your bug to 5 lines.
you're probably going to find it yourself using this way anyway.
12:51
Dunno if I'll be at the room meeting (3pm christmas day for me), not sure what's going on christmas day
13:17
Santa is going to relax after his work
@MadaraUchiha ok, I just tried it and it took me a lot less than an hour, so it might be more reasonable than I thought.
25 LoC, not sure it passes A+ though.
13:42
Is it okay to encode a URL (or just specific letters) with ISO encoding instead of UTF-8? E.g. "Ä" becomes %C3%84 in UTF-8 as encodeURIComponent would do, whereas ISO encoding would make it %C4 as the escape function would do.
crl
crl
a promise lib in 25 loc?
As I've understood it's not right to use escape for URL and I have found nothing on encoding URL with anything but UTF-8. However, the target website does not recognize UTF-8 and the accented characters turn out malformed. So I wonder if it's okay to replace these encodings, %C3%84 with %C4
Anyone got a clue?
Guys, is there any pure JavaScript alternative to jQuery's Typed.js
@JacquesMarais It doesn't look hard to remove jQuery there
crl
crl
@JacquesMarais this is mine for quick tests
but shouldn't be taken seriously
13:51
Nevermind, thanks, I found TheaterJS. It looks much better than Typed.js too.
@Colandus there is no specific standards to choose an encoding (for urls). IF the server expects ISO, then format it as ISO. But most websites uses UTF-8
0
Q: Inheritance hierarchy using object literal notation

overexchangeIn the below visualiation, object literal geolocation is under context of navigator(i.e., navigator.geolaocation), but as per below code, <script type="text/javascript"> function showLocation(){ if(navigator.geolocation){ navigator.geolocation....

crl
crl
Do you know there are things like API docs?
@KarelG Alright, thank you :) Do you know if there is a safe and secure (or accepted) way to encode a URL into ISO?
@overexchange
> What is the context of [object Position]?
you mean what is [[prototype]] of Geolocation instance?
14:02
@Colandus it depends of the language, but a quick google (with the language) should give you results.
@KarelG Yeah I've tried. It's JavaScript.
I'll keep looking
@Colandus : let the browser do the job
Should we close this question ?
0
Q: Call a method on its original containing object

Sergei BasharovI have an object created with a constructor: var mngr = new Manager(); It has a property contacts and a method showContacts() { return this.contacts }. I also have another object, say, named company which runs some actions then in the end it needs to make mngr object run its showContacts() I...

@KarelG Oh well I wish it was that easy. The target website is ISO encoded and if I let the browser do the job it's sending it as UTF-8. I'm sending AJAX with param string that needs to be encoded to ISO as the target website is not interpreting the UTF-8 encoding properly.
@overexchange Both those questions can easily be answered with the debugger, or did you mean to ask why it behaves like you can (easily) observe?
14:06
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
@Colandus does that not work ? ---^
also, you can do the same in form element if you're using forms
@KarelG No, as I said I am simply sending AJAX to a cross domain.
@KarelG Well normally it is fine to let the browser to the job, but I assume this website I'm sending data to is very stubborn. It doesn't want to accept UTF-8. Already had problems sending POST-data and I was lucky to find out they also accept GET-data for their form. So I managed to at least hackily convert the few accented characters I need to pass into ISO friendly format. Just str.replace('%C3%84', '%C4'). Then it worked great. Although I prefer a less hacky method.
as said, most websites uses UTF-8 :p
So, according to Bergi the double colon binding syntax is not dead. Cool.
14:19
link?
@Srle Is it navigator.Position? where I call navigator as context
window.onload in the sense, onload is under global context window
crl
crl
what is a 'context' for you?
@FlorianMargaine to the proposal ? github.com/zenparsing/es-function-bind
outside function it is global object context, inside a function it is ACTIVATION_OBJECT context
crl
crl
14:29
ok
So, I do not see Position under global object context i.e., I mean window['Position'] does not exist.
crl
crl
this is probably under google.maps....Position
can u be precise? is it google.maps.Position?
> navigator.Position
< undefined
yes thats true
crl
crl
14:33
!!google google maps Position api
Server error (status 500) occured (message probably too long)
@crl when you say google.maps, does it mean window.google.maps?
crl
crl
try it
if your browser has a console
yes it is window.google.maps but I dont see Position object literal in maps.googleapis.com/maps/api/js
crl
crl
yea it's quite hard to read minified scripts
14:40
so here window.google is a context, maps is under google context.
i think you mean ControlPosition of google maps ?
allows you to position the ui stuff
crl
crl
nah just the Position object that has a lng and a lat I guess, and that is documented on google API
Position is a type, where the code Object.prototype.toString.call(position) says [object Position]. What is position here? it is...
crl
crl
do var p = new google.maps.something.Position(); p in your console
i'm confused. On the maps, we use LatLng for marker positions on the map ?
14:47
see this code position is the parameter of showPosition
crl
crl
@KarelG Ah right I remember now, maybe it changed
you're probably checking to an old google maps API :o
never heard of that. Been used LatLng since i started to use gmaps
I use LatLng like this.. {center: new google.maps.LatLng(position.coords.latitude, position.coords.longitude)}
crl
crl
put a damn breakpoint in the body of that function, and inspect that bitch of position :)
you're making yourself difficult
just use {lat: urLatHere, lng: urLongHere} for position values
try center: {lat: 0, lng: 0}
crl
crl
14:52
there's everything you need in the docs, I'm seeing them now
that's why docs are for
After debugging I see this...
crl
crl
new google.maps.LatLng(x, y) is probably just giving {lat: x, lng: y}
do as you wish
in this debugger, it says position is type of Position and nothing more than that. How would I know x and y in x.y.Position?
crl
crl
it's a private class maybe, I'm not really good at that sorry
14:57
Spec ops the line is like 6 bucks on steam. Really recommend it: store.steampowered.com/app/50300
crl
crl
hmm Position is actually maybe part of HTML5 geoloc thing
crl
crl
!!mdn API Position
@overexchange google maps provides a function to get the LatLng object ...
that's used to locate the user in the world, which then can be used to center the map correctly
(or for statistic stuff or language selection, or ... )
crl
crl
there should be a user gender detection API, that would prompt you as: "Do you allow your browser to identify your gender?"
@crl It's called a webcam
crl
crl
good point
And I'm pretty sure face recognition algorithms can detect gender reasonably well :)
crl
crl
15:04
what would you say for stackoverflow.com/users/2539335/praxis-ashelin? (sometimes in html room)
Well, I'm no face recognition algorithm but I'd say it's a trap
crl
crl
:)
No honestly, I can't tell
crl
crl
more likely a girl, but hard yea
praxis is referred to that greek godness
i suppose that she's a female
keh ...
> Praxis: In mythology, another name for Aphrodite -- but the rare feminine name that sounds better for a boy.
androgyny ...
crl
crl
!!xkcd new
Definitely bathroom mirror
wouldn't that be a good horror movie idea?
15:23
@crl it's pretty obvious that it's a girl :/
Just say Santa three times...
crl
crl
eh, not for me, I've seen girly men, but right, the hair coloration gives it
@FlorianMargaine That could be a male teenager easily
I've played hockey with guys that looked more female than that picture
crl
crl
let's not tell her :)
in HTML / CSS / WebDesign, 2 days ago, by Praxis Ashelin
@crl why do ppl keep asking that Q.Q
vOv
Kind of rude to ask someone their gender, to be honest
\o/ 600 games owned
15:38
did you really asked his/her gender ?
crl
crl
yes :s, been an asshole..
guys, any idea to print var a = Array(9).fill(Array(9)).map((r,i)=>r.fill(0).map((_,j)=>i+'x'+j)) on a beautiful table in the console?
a.map(r=>r.join('\t')).join('\n') can fail
hmm it's good enough a.forEach(x=>console.log(x)) also
console.table
maybe only works on chrome
crl
crl
ohhhhhhh!!!!!!!! <3
@Colandus that is so cool, thanks :)
crl
crl
15:57
maybe it even works for html tables, nah
What do you think of this?
I don't think it concerns me what they eat in India :p
crl
crl
I give -1 shit about it personally
16:17
@pootis Yet another attack against non hinduist Indians...
> Cows urine has medicinal and anti cancer properties and is used in the soil for anti-termite properties
if that's true, then TIL
Not long ago, a muslim man was murdered by his neighbors after rumors spread that he'd killed a cow.
I just had an interview where someone explained promises to me, it was fun.
crl
crl
hehe, I wouldn't be too good at that either
I didn't ask them about promises.
16:35
hi who know socket.io? i have request: 4219["getOnlineCount",{"interval":1800}]
where getOnlineCount - action
interval - argument
what is the 4219?
this is so interesting...
try running this code in the console on this page:
var base = 'http://chat.stackoverflow.com'; function genReq( count ){ var r = new XMLHttpRequest; r.onload = function(){ console.log( count ); genReq( ++count ); }; var str = base; for( var i = 0; i < count; ++i ) base += '/'; r.open( 'GET', str ); r.send() } genReq( 0 );
or the base to the domain of the page
basically it adds a / at every cycle
so when count is, say, 5, you get a request to 'http://chat.stackoverflow.com/////'
on my console, the requests for this site stop giving anything at count=171
while on towc.eu they stop at 64...
any known reason?
http://chat.stackoverflow.com///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
that's 271 slashes... weird
actually, if I type things in the url the maximum number of slashes seems to be 14631
var s = 'http://chat.stackoverflow.com'; for( var i = 0; i < 14631; ++i ) s += '/'; copy(s)
14632 no longer works for example
crl
crl
that code is ugly
But it works
crl
crl
var str = base;
for( var i = 0; i < count; ++i ) base += '/';
base + Array(count+1).join('/')
16:48
the request still goes to the server... why did it choose 14631?
Seems arbitrary
@crl I was in the console and couldn't care much :P
crl
crl
but I wouldn't trust that code atually, mixing that sync for with async, let me try to see through it
@towc 270 would have been perfectly sane number of slashes
it's pretty trustuble. The code before was all async. Only once a request has been succesfully given back it called the next loop
@crl let me try to format it better for you
16:50
It stops at 173 for me.
crl
crl
you're modifying base and not str.. and use str just after
@pootis You just don't know what a proper amount of slashes is then
so why not 271?
var base = 'http://chat.stackoverflow.com';
function genReq( count ){
 	var r = new XMLHttpRequest;
 	r.onload = function(){
 		console.log( count );
 		genReq( ++count );
 	};
 	var str = base;
 	for( var i = 0; i < count; ++i )
 		base += '/'; r.open( 'GET', str );

 	r.send();
}
 genReq( 0 );
@crl oh... woops
@towc same for me
wtf is this? and why does this happen?
16:53
what's the backend of this site?
@Firedrake969 ASP.net
what about server?
!!> 170*(170+1)/2
@towc 14706
oh, so in the end they had the same amount of things pretty much
16:54
@towc 14535
yup
in any case, it would have taken a long time to get to 14631 requests :P
This has something to do with how browsers treat multiple forward slashes in URLs, apparently.
that's the thing, it doesn't seem to have much to do with browsers
it's all because of the server
hmmm... at this point my site seems to get some paths broken
var s = 'http://towc.eu'; for( var i = 0; i < 2030; ++i ) s += '/'; copy(s)
Not really. Try it in a different browser.
crl
crl
var base = 'http://chat.stackoverflow.com';
for (var i=0; i<20; i++)
  fetch(base+Array(i+1).join('/')).then(r=>{console.log(i,r.url);return r.text()}) // if you want the actual response .then(r=>console.log(i))
16:57
@pootis ? do you get something different?
@towc firefox just doesn't seem to stop
HAMMERTIME!
@pootis did you try putting somethinglike 100000 for the number?
maybe it does handle it differently
but chrome seems to just trust the server
FF may shorten it from the client already
I tried a trillion.
crl
crl
17:00
are you trying to DOS those servers :)
yup, my site seems to stop at 2039...
@crl oh god wait
and it breaks some paths gradually until you get to that number
actually, let me see if cURL gives me the same behaviour
@crl I'm going to make a javascript-based low-orbit ion cannon
it shouldn't do any handling of the url, right? It would just request it
curl allows me for 2049 slashes...
I guess somehow it do is browserbased... but there definitely is something coming on the server
I don't think it checks the user agent
maybe FF just cuts it... but I can't really explain the difference between chrome and curl
17:35
hmm, vim isn't that hard, actually. I am able to do most of things I normally do in sublime text with vim now. Only 1 or 2 days of using vim.
crl
crl
17:45
congrats you're a pure geek (I tried a bit, but failed)
@MadaraUchiha you home?
@BenjaminGruenbaum Yup
Sup?
@crl yeah I am totally mocking everyone who doesn't use vim now saying "lol you aren't a real programmer"
@BenjaminGruenbaum shall be the first one
> Q: How do you spot a vim user in a chat room?
> A: Don't worry, they'll let you know.
3
When you’re a Vim user and haven’t told anyone in 10 minutes https://t.co/3yA279bUbq
17:53
expecting @BenjaminGruenbaum to burst through my door at any moment
crl
crl
Can I programmatically know if a select field is collapsed? i'm making a custom select with a button + select width:0
!!mdn html select
see if it matches the :focus selector?
crl
crl
heee thanks will try
5
Q: How to find the closest element using jquery

MahadevanI have searched in SO I found so many examples but mine was little different from all. 1) initially i have a row if the user click save & next button it will say you have 3 fields missing 2) if the user click the addmore button and he did not type any value in the text field then ...

17:59
@crl you can also check document.activeElement, actually. no need to call the selector API
but my guess is that some User Agents allow focusing a select without actually opening it
18:10
@MadaraUchiha I want to see how long it takes you to implement promises :D
@BenjaminGruenbaum I'm actually thinking about how to do the .then() returning a new Promise part.
Cool, no peeking.
It's challenging.
I'm trying to figure out how few LoC I can make promises in and keep it reasonable in terms of readability (no line of code hax like && for conditional execution)
crl
crl
well it's actually pretty hard to trigger a select with js, after checking on google jsfiddle.net/crl/zmLLch8b/18
18:19
@AwalGarg I used vim for a while - it's pretty stupid.
crl
crl
I'll rather try another approach (keeping the select with like 20px width, and the label on top with point-events:none
@BenjaminGruenbaum 1 LoC:
const MyPromise = Promise; // problem?
crl
crl
pfff :)
const MyPromise = {then: x=>x}
hmm it's ugly once selected
18:52
I have a row where i have a set of textfield if i enter any value in any one of thefield i want to add class for rest
$(".text").prevAll("div>row1").addClass("required_Field");
@MadaraUchiha how is your progress?
is this correct ?
@MadaraUchiha Got here just in time!
@FlorianMargaine Sauce?
@AwalGarg That's quite annoying then
@FlorianMargaine I don't believe you
any suggestion please

« first day (1895 days earlier)      last day (3277 days later) »