« first day (2706 days earlier)      last day (2244 days later) » 

4:00 PM
There isn't any convenient way to smash a promise on standard implementation, is there?
 
@jAndy what the hell is "Salmannsweilergasse in Konstanz" mean
Is that german?
 
most likely it's an address
 
@SterlingArcher Yes
Salmannsweilergasse is a street name and Konstanz is the city
 
lmao she said she's near me... gave me an address in germany xD
 
Es ist an der Zeit das Spiel zu erwähnen.
 
4:02 PM
@jAndy What do you mean?
 
Waiting for the scam
 
@SterlingArcher Stop stealing our women please
 
The person that has been posting random messages on my OSS repo.. just created this PR... like wtf is the point of this PR i.imgur.com/UZ6qECI.png
 
Stop stealing our gas please
 
4:03 PM
@OliverSalzburg like, breaking a promise. You create/return a Promise object with some async event, but you know early that the event is never going to happen or you just want to no longer wait for it
there is no convenient way I know of to do that from "outside" of the Promise
 
@cswl None. Probably automatically generated?
@jAndy Ah, I see
 
@jAndy why do it from outside of the promise? why not within, where you can call resolve/reject?
 
I know of no standard way
 
but it annoys me more than often.. especially in a big application with many async processes running in parallel
 
cancelling promises has been a problematic, contentious, and largely meaningless feature
 
4:06 PM
@jAndy Promise.race() them with a promise you control :D
 
@ssube well, the Promise object itself shouldn't be responsible from itself to deal with all possible outside actions that can lead to the denial of the async process its waiting for (imo)
 
That's probably not standard either though :\
 
I guess, I like the idea of a Deferred Object better for that reason
 
@jAndy it doesn't need to deal with all possible actions, just listen or check for a particular one, then cancel itself
not unlike preventDefault in DOM events
 
there might be many things which could cause an async process to never happen
I'd actually love to see like Promise.resolve.call( somePromise )
 
4:08 PM
if you end up in that situation, you've done something very wrong
 
You can just make a promise that exposes it's resolve/reject if you need to
 
wat
 
@Luggage yeah.. but thats anything but convenient
 
you only have to do it once and it's just a line or two of code
 
in my very situation here, I have a method like this
 
4:09 PM
having the promises watch a single source for cancellation and handle it themselves will be much simpler
 
timeout( ms = 200 ) {
		return new Promise(( res, rej ) => {
			win.setTimeout( res, ms );
		});
	}
 
Can you like block people on Github :|
 
all your various external events can go through there, rather than passing raw events onto each promise
 
I don't see a way to mark an answer as "no longer valid"
 
sometimes I use this to wait, some overlays for instances display for a certain amount of time
await this.timeout( 5000 );
 
4:10 PM
@cswl yes, go to their profile and click block
 
but then again, sometimes I want to cancel the overlay early
and I just can't do anything to resolve the promise early. Its not a problem in practice, since it just doesn't matter for the promise object to resolve at some time
but it bothers me anyways
 
I need to test against iOS safari. It'd be nice if I could just install Safari on my windows machine and test it through there, but nooooooo.
 
browserstack
 
browserstack, but prepare to slog through an unusably slow experience
 
@cswl what do the comments say? Are they rude or just out of the blue?
 
4:12 PM
@ssube so what did I do very wrong in that case?
 
user1596138
@Shmiddty browserstack
 
fix usage apparently that person's doing same thing on another repos too.. github.com/Seliniux777/termux-packages/commit/…
 
user1596138
It';s sweet.
 
@jAndy if you want to cancel halfway through, you can't do that with a single long timeout. Many smaller ones in a loop would fix it.
 
in the case of removing a notification early, just have the timeout remove it if it's still there. No need to use multiple promises or cancel then
 
4:13 PM
you need to provide a break point in the async flow for the signal to cut in and cancel it all
 
@Shmiddty I do have an macOS High Sierra Virtualbox image... totally against Apple TOS
 
@ssube I know, but I think its bad design anyways
of the Promise object
 
killing a promise from the outside is bad design
 
why
 
in your example, what does canceling the promise do to the execution, the timer, any of the resources it used?
they just leak
 
4:14 PM
do you consider a Promise.race() to be 'cancelling a promise from the outside'?
 
same with HTTP requests, canceling them often leaves the server doing work
 
the original concept of promise makers had the option to smash a promise early
 
@Luggage not at all
 
afaik
 
@jAndy then you should break it down into many smaller promises representing the actual promises you're making and break between them
 
4:15 PM
there are UX reasons you might want the user to be able to ignore a long request and move on, server working or not
 
that's where multi-value async is useful
async iterators would make that break-loop much nicer
 
@ssube actually I want to avoid leaking memory, because I have a (useless) promise waiting for a timeout lying around sometimes
 
that's fine, it'll timeout and then go away
 
until it resolves itself of course
 
or you could use a smaller timeout
 
4:16 PM
I havent done a lot of JS recently.. but did they add the Promise cancellation yet..
 
a few extra promises for notifications the user closed early is no big deal.
 
@cswl it's been removed from most promise implementations by now
if you're really worried about having that many promises in-flight, use smaller promises
 
user1596138
@cswl There's no need really.
 
user1596138
So no.
 
Talking about the theory, I just don't see any reason why you shouldn't be allowed to smash a self created promise early. I see tons of reasons why I would like to have it tho
 
4:18 PM
or have one setInterval() and a 'loop' that checks for any notification that's older than it's timeout to remove
 
@jAndy you can: from within the promise handler
 
not even smash.. but resolve or reject it, externally
 
@user1596138 how does it work for testing local stuff?
 
user1596138
@Shmiddty Chrome extension allows access to local URLs
 
doing it externally is at best meaningless, at worst an intentional resource leak
 
user1596138
4:18 PM
Even localhost/in-network stuff
 
@ssube yea, but it should be possible to do it outside of the handler, without referencing the resolve/reject method to free variable scopes
 
@jAndy The Game
2
 
@jAndy why? the ambiguity of what .cancel might do (will it even work on this promise?) makes it a problem
 
Alright.. so Observables for cancellation.. okay :\
 
how could that possibly leak? It would mean the promise is forced to resolve or reject itself, just immediately
 
4:19 PM
this is an X/Y problem, a smell
 
I don't think it is. Again, in my very example from above, it would be a totally fine and legit case
 
it also wouldn't do anything at all, the timer would still be running :)
 
canceling a timeout early, because something happened which makes the waiting for it meaningless
 
@user1596138 so I go to the browserstack app, which is... online? Then with my Browserstack plugin, I select a local url?
 
@cswl observables still don't let you cancel a single resolution/value, that's not a thing. They send many values and you can unsubscribe between two, which is what I'm suggesting for @jAndy's problem as well.
but don't stop after promises and observables, there are many other async structures
 
user1596138
4:22 PM
@Shmiddty You can just go to Safari in the "real device" on browserstack and visit localhost
 
user1596138
Even tho the device is being access via a remote desktop-ish client
 
user1596138
That's my understanding. I tried it once but haven't used it for real development
 
user1596138
 
if you want to abuse promises to make some externally controllable thing, that's fine. But wrap it up and don't call it a promise. Call it a cancellable timer or sometthing. (my opinion)
 
4:24 PM
const timer = new Timer(1000, myCallback);
timer.cancel();
 
there is already a word for it.. Deferred object
which again, is the original construct
(and no... jQuery didn't invent that)
 
Deferred is usually more like an async Optional, ime
again, ignoring jQuery because they did async utterly wrong
 
iirc Doug Crock gave a speech over a decade ago about that, from Fortran or something?
 
ok, deferred. But I would still treat it like promise-abuse and keep it contained, instead of getting used to using deferred semantics when the industry has chosen another path.
 
hello, im having a problem with this javascript code, apparently it is suposed to work but it doesnt work for me, can you guys see if im doing something wrong? ive looked at it alot of times and my friend too and we cant figure out why it doesnt wrok. The first alert wroks but the rest of the code doesnt. this is my code:
 
4:26 PM
@jeyejow Welcome to the JavaScript chat! Please review the room 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.
 
whether you poll, promise, observe, iterate, w/e, containing is is a Good Thing
 
function validaform(element)
			{
				alert("Entrou na func");

				var nomex = document.GetElementById("nome");
				var nomeval = nomex.value;

				alert('ola');

				if( nomeval == "" || nomeval == undefined)
				{
					alert("Entrou no if");
					nomex.blur();
					nomex.focus();
					nomex.scrollIntoView();
					return false;
				}


				alert("Nao entrou no if");
				return true;
			}
 
what doesn't work?
 
nome is a <input type="text"
 
> the rest of the code
 
4:27 PM
it just outpust the first alert
 
my browser just asked me if I want to translate this french page
 
and nothing more
 
you sure var nomex = document.GetElementById("nome"); doesn't throw an error?
 
delete the alerts
@KevinB I'm sure it does :D
 
if i delete the alerts it doesnt do nothing
 
4:28 PM
press F12
 
how do i know if its trowing an error?
i did, it opened the console, but it doesn say that there is an error
 
F5
 
still nothing
 
alt+f4 solves quite a lot of trouble from time to time on windows machines
 
maybe you disabled error logs
 
4:29 PM
how do i enable them
 
are you using chrome?
 
yes
 
then idk
should be a button
 
Do you (anyone) pronounce /etc as "e t c" or "etsee"?
 
@jeyejow you see the developer tools open?
 
4:30 PM
you should see the error just after you close the first alert
 
just focus it and press ESC
the console will open/close
 
@Luggage e-t-c
Etsy is where I buy gifts
 
I transpile that to it's full form .. etcetera
 
ok i did that
the shows nothing odd in the console
i can print it
 
@jAndy you know you're not going to win this one
doesn't even matter how hard you try
 
4:31 PM
@Luggage why would anyone do that? :(
 
why would anyone do which one?
 
@Neoares win what?
 
I want some original canvas oil art but everybody who paints thinks their shit is worth like $3000
 
lol
 
I pronounce it like etc
 
4:32 PM
pronounce it "etsee"
 
I hear it all the time.
 
took me a moment, well played
 
No long "see", just... etc
 
ets
 
4:32 PM
thats what shows me
 
@jAndy your try to teach dev tools to the guy
in spain we pronounce it "et-th-etera"
 
oh..... I thought you were referencing to.... the... GAME
 
it does roll off the tongue better than "e-t-c"
 
I'm a little biased about it
 
@jAndy THE GAME!
 
4:33 PM
too obvious = no fun @ikari
 
should i make a question from my problem?
 
Caprica did the job early again
 
you have to be subtle when you playinst an expert
 
:(
 
oh lol
@jeyejow eh, no
 
4:34 PM
I'm going to design,.. a totally new async structure.. for the understanding :/ .. first step: what do I call it
 
why doesnt it work them? how can i solve it?
it shows no errors
 
that is the fucking CSS editor
lol xD
 
ah
 
@jeyejow if you press the escape key, nothing happens in your dev tools?
 
where's the "console"
 
4:34 PM
no
 
there should be "Console" tab at the top as well
 
once you toggle the console, it will most likely say
VM9228:1 Uncaught TypeError: document.GetElementById is not a function
 
100% prediction accuracy
 
ok
 
the blind seer
 
4:35 PM
 
its is what it shows me:
what does it mean?
 
I was close
 
10/10 jAndy is debugger confirmed
 
@jeyejow read it closely, what do you think it means?
 
it pretty much means exactly what it says... GetElementById is not a function.
 
4:36 PM
probably im using getelementbyid wrong?
 
you are looking for .getElementById
 
yes
 
Correct, there's a typo
 
ohhhhh
 
@jeyejow JavaScript functions are case sensitive
 
4:37 PM
omg r u seriuos xd
2
 
God dammit guys teach him how to debug D:
 
ok, i didnt knew that
thanks!
 
all of JS is
 
except if you're ndugger, then you can just .gETelEmENtbYId
 
4:38 PM
I'm really getting worried that my mac power supply cable gets more brown and yellow coloured at the very front of the macbook connector
 
It looks like Firefox and Chrome don't support the same JS names... I got an error in firefox saying event was not defined and the whole web page crashed.
 
@HéctorÁlvarez And so god created babel
Or something
 
are you talking about browser events or something you defined?
 
> Ask Alexa to Read Your Audiobooks!
Oh boy, something new and terrifying
 
I actually removed the Babel loader from my projects last week. I figure there is nothing which needs to get babel'ed at this moment in time that isn't widely supported
 
4:40 PM
There are differences, but I'd look at your code before blaming firefox or chrome. Most events are pretty consistent
 
@ssube event.preventDefault(), which aparently works in Chrome, doesn't work in Firefox. The default event. The event.
 
unless.. you want to use ES7 class properties or something
 
I don't know why I'm using babel, all I know is nothing worked without it
 
holy fucking cover batman
 
4:41 PM
@jAndy I do.
 
@rlemon
 
@HéctorÁlvarez where is event coming from?
did you declare it as a parameter?
 
event is something related to... I don't know where it comes from, but I assume it's part of the browser's definition.
 
@ssube please remove the word event from your last line
 
@HéctorÁlvarez the value of it will be a browser Event of some sort, but the variable is something you declare
 
4:42 PM
This is towc level of explanation
 
ah gnah
 
It was written on the example I downloaded, and it worked A-OK on Chrome. It would stop forms from submitting by default. I got rid of it by replacing that event with return false;
 
lol, close enough
 
s/event/game/ on the line of @HéctorÁlvarez above would have been glorious
 
@jAndy also s/browser/life/
 
4:43 PM
@jAndy please, go ahead.
 
@HéctorÁlvarez event in this case is a variable. It's passed to any listeners listening for that event
So it would be in your function definition
 
Maybe it's just me, but I don't consider automatic device reboots to be a particularly effective "customer experience improvement"
 
the whole attribute was onsubmit='event.preventDefault();'. I just moved it to JS
 
talking about updates, osx bothers me for MONTHS to update and for months I click that stupid "remind me tomorrow" thing
...and I really think every time: tomorrow is the day
 
I always click remind me tomorrow
 
4:45 PM
why
 
This is from a test machine where I'm trying to force Windows into kiosk mode behavior
 
because I have shit to do, boi
 
why not disable it
 
at some point I really would have expected an easter egg from the devs... like... "do I really need to ask again?"
 
And there is resistance
 
4:46 PM
or something
but neeeeehh
 
I haven't even enrolled in CEIP wtf
And I disabled Windows Update, but then apparently ran a manual update that re-enabled it
 
CEIP?
something something insider program?
 
Customer Experience Improvement Program
A nice way of saying that they send all kinds of your data to their servers
 
1/4
they do it anyway
 
Of course. I'm just trying to get rid of garbage that takes away from the "kiosk mode"
This was a lot easier in XP days
 
4:49 PM
everything was better in XP days
pinball 3D is the best videogame I've ever played
 
@OliverSalzburg It renables itself after x amount of time
I believe
 
@rlemon that's older than XP, cause I don't remember it
 
that's the deck selection for the card games
 
@Cereal Well, I'm setting all kinds of stuff to disable these updates, and neither was effective. I just caught the machine rebooting to install some shitty update
Even though I have set NoAutoRebootWithLoggedOnUsers when I installed the thing
And NoAutoUpdate, AUOptions and AUPowerManagement appropriately
 
4:54 PM
the software IT put on this machine forces it to reboot if it's been running for more than n days
 
@Neoares Well not quite but it does share a theme with the best game of all time.
 
Hi
 
@john Welcome to the JavaScript chat! Please review the room 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.
 
@KendallFrey enlighten me
 
with regards to what
 
4:56 PM
with the videogame
which one did you mean
 
@KendallFrey space invaders?
😉
 
i am integrating this validation formvalidation.io/examples/… in a form but it is giving me errors
 
@Neoares You don't know me very well do you
 
star citizen?
 
@rlemon hur de hur
 
4:57 PM
Is it Rubik's cube 2014?
 
kendoll space.. uhh... parable?
 
0
Q: Nesting (this) in jQuery

dungey_140In the below examples, when .article has a class of .has-video-thumb, I want the .video-bg <video> to play. The code below shows a working and non-working version. Within the nested mouseenter function, if I explicitly specify .article, it works as expected, however if I try to re-use (this) wit...

 
i like the new onion capsule
 
oh, worms!
 
4:58 PM
I'm disappointed they removed the awesome art from the loading screen
 
I also like that game
why do they wear space suit?
 
any help?
 
for doing space stuff?
 
because they're going into space
 
I don't have that DLC
 
4:59 PM
@john not with what you've given us
 
@Neoares it's not DLC. It's the entire premise of the game
 
@rle
 
i tried a few of the missions, not impressed with mission builder
 
you should provide the code you're using, and the errors you're getting.
 
@rlemon i am integrating this validation formvalidation.io/examples/… in a form but it is giving me errors
 

« first day (2706 days earlier)      last day (2244 days later) »