« first day (2113 days earlier)      last day (3060 days later) » 

08:00
@Neil I usually put classes on anything I will select, and use different classes for what I select with js and what I select with css
that's the readable code standard
Let them tell you to not use firstChild because it is too ugly.
so your selectors are just class-based
@towc I agree, but I assume that you can't do that here
nope
I know you want to conform to existing style, but Confucious say: man who is foolishly consistent is hobgoblin with small mind :(
08:03
ohi @littlepootis
@FilipDupanović did he actually say that?
Well you can't prove he didn't say it.
True
"Trying to invalidate quotes on the internet is a fool's errand." - Abraham Lincoln (Aug 2023)
08:06
good one :P!
Abraham Lincoln was a wise man in the ways of the Internet
Set in the future no less
TIS if(sth){/*nothing yet*/}else{...}
Man I'm so sad I don't get to learn about any new magic CSS selectors today.
Today sucks.
There are a couple in jQuery 4.1, IIRC
Those aren't CSS selectors, they're jQuery faffery.
08:15
OK, how about this new SASS 5 extension?
it basically analyzes your razor templates and automatically pads the selectors with the full path, and essentially revamps the CSS specificity rules to make more sense.
Ahh.
I don't use CSS compilers, hell I even stay away from JS libs a lot of the time.
Tends to happen when you're writing a game engine instead of a website :P
The downside is that you can't use generated templates, like was the craze in 2017
I don't get meter
What is the point of high and low and optimum?
@JanDvorak we're on to you, future man!
08:30
@Nimphious CSS Lincolnify yourself cssnext.io
Hello everyone. Please have a look here. Can anyone help with the math logic needed to achieve the desirable layout? Thank you in advance.
http://stackoverflow.com/questions/38653623/centering-elements-in-isotope
@justme 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.
@justme just use flexbox ;-)
@FilipDupanović Oooh nesting. That seems really powerful and also really easy to go from performant to gross.
Flexbox won't give me the filtering and the animated movement that Isotope will. That's why I ended up with Isotope. if you can help me given what I've used it would be great. I've provided the JS code that I've wrote :)
08:36
Use flexbox to define the positions for isotope?
Oh.. it's a private repo.
yes I tried that too.. It doesn't change to the layout. It still stays floated to the left.
:/
I just realized that if you're watching a private repo and someone forked it, you autowatch their private repo.
And that ends up in your mailbox.
RIP my mailbox.
Someone has been exploiting this to send spam to mailboxes.
:(
Some comments from that thread:
> WTF, мля? Why I see it??? Why I can't unseen this shit?...
> @CruzBishop Their bowels did evacuate yes, because they died, but I have since cleaned it and it's in "like new" condition.
> Anybody want to buy a sink?
So, basically, every UE4 dev's mailbox's now filled with spam.
08:43
Gross.
24k rep user that suggests and documentation example that contains syntax errors: stackoverflow.com/documentation/proposed/changes/…
*facedesk*
WTB 30k rep requirement to edit docs.
then you include a couple of repwhores and exclude a couple of locals
Those repwhores are already included, though
@Cerbrus 100k
@littlepootis That's overdoing it ;-)
08:55
You only say that because you're 34k
I'm 18k, so let's put the limit there
What’s the difference between f and (x) => f(x) (if I pass only one argument)?
Another difference occurs when f gets changed after it's passed somewhere.
I think I just resolved a mysterious bug by replacing onChange={foo} with onChange={s => foo(s)} and I have no idea why that worked or what was wrong. Does this change, or something?
this does change, too
defined by caller in the first case, global in the second
@Lynn there are quite a few. f can be a constructor. The latter cannot.
08:59
@JanDvorak Fine by me :P
I'm 0.3k, let's just leave it there.
we give you rep and you spend it all on booties
s/oti/obi/
I'm pretty sure rep is not directly proportional to knowledge and/or infallibility.
@justme hmm, you should be able to animate on flexbox properties
09:04
Hell, I'm 2.4k and I should be -12k or similar.
plz mor neg rep
I like the meta Q, which sought out the people that spent all their rep on bounties
Yeah?
but then they run out of rep and the whores start blaming humans for the questions they ask/don't ask :|
apparently, we don't think about helpful questions
09:14
There's no such thing
anymore
Woah, his rep has never gone too far over 2k. stackoverflow.com/users/70942/ant2009?tab=topactivity
Hello, I have a div with class name .qodef-slider-inner and I want to hide it in case that there is a part of a sentence like "[qodef-". I tried different ways but I didn't succeed as I am beginer in Javascript/jquery
whoa, their rep graphs <3!
@GregoryCh mmm [class^=qodef]
Here's a reference for you that explains that btw, @GregoryCh developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
Specifically the part about the prefix selector (^=)
() ()
(^=^)
how can I write something in code mode here?
@GregoryCh paste code and before submitting, ctrl + k
Also please note that massive programs don't exactly inspire people to help you
i tried something like that.. but with no luck..
if (document.getElementsByClassName('.qodef-slider-inner').innerHTML.indexOf("[qodef_slider") != -1) {
document.getElementsByClassName('.qodef-slider-inner').style.display="none";
}
@GregoryCh well ctrl + k doesn't indent...
document.querySelectorAll('[class^=qodef]')
09:31
which means?
it will find all the elements that have a class name that begins with qodef
@FilipDupanović I think not.
no.. just I want the div with class .qodef-slider-inner to be removed if there is a part of sentence "qodef_" inside the div.
@GregoryCh :contains
As a rule, I don't use classes that way. If anything, similar elements will have a class in common and another that distinguishes them
09:36
I know but it's wordpress's plugin
Good ol' WordPress
Is there contains to simple javascript? Because I tried in Jquery
$('.qodef-slider-inner:contains("[qodef_slider slider='shop-masonry-slider' auto_start='yes' animation_type='slide' responsive_breakpoints='set1' show_navigation_arrows='yes' show_navigation_circles='yes']")').hide();
var groups = new function() {
@GregoryCh that is horrifying
09:41
Yes, I'm not surprized
var arr = document.querySelectorAll('.qodef-slider-inner');
for (var i = 0; i < arr.length; i++) {
  if (arr[i].innerHTML.indexOf('[qodef_slider') != -1) {
    arr[i].style.display = 'none';
  }
}
Or something like that.
Wordpress is horrifying
@Nimphious that's working. Thank you
@JanDvorak I try to run away from wordpress as fast as I can.
first thing you do with WP: you remove 2/3 of WP
09:46
What do you use?
@GregoryCh if you have to have a base, bootstrap to start
I usually settle for one of those "rapid application development frameworks" or a CMS built on top of one I'm familiar with
Don't be afraid to adjust styles as needed
Hi, is there any JS event Listeners when document is completely loaded(even with CSS, images). I tried "DOMContentLoaded" - it turns out the function is called when DOM is fully constructed (non necessaritly images and CSS are loaded)
@venkatvb window.onload
09:58
@BenFortune so, the listener would look something like window.addEventListener("load"fn); ?
@BenFor
@BenFortune, will onLoad wait for the images that are outside the window ? I beleive "A document can be larger than a window - the window is the "visible" part in your browser." (see stackoverflow.com/questions/9895202/…). ?
stay inside, beautiful weather for work \o/
o/
typeahead problem got solved after 3 days of hack!
grats!
that was some hairy markup there :P
10:07
ha ha
going to post it on github
> The load event fires at the end of the document loading process. At this point, all of the objects in the document are in the DOM, and all the images, scripts, links and sub-frames have finished loading.
It's not a good way to do it though. Just add your scripts before </body>
@venkatvb test it.
my office is a pokéstop
HAMMERTIME!
@JamesFinnigan 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.
Image width and height will be zero before it loads. So check
@JamesFinnigan ignore her, she's weird
10:10
@BenFortune Okay Thnx. Please share if you have some link to documentation.
Halt
HAMMERZEIT!
@Neil haha ok, does what she said even make sense?
@JamesFinnigan not to me. Some people think she's a bot, but don't tell her I said that
4
10:12
@BenFortune Thanks! #JSNewbieHere
user6524633
10:37
0
Q: Count occurrence of two numbers in array and return max number of occurrences

MartinlocI am trying to find how many times two numbers have equal occurence in JS. The function should return the index in the array of the max occurrences of the fragment in which these two number exist. Otherwise I ll return -1; E.G: numOne = 5 numTwo = 3 myArray = [6,3,11,5,1,3,5] In this case i...

user6524633
guys anyone?
10:58
you can find more lessons and their accompanying reading material at codility.com/programmers/lessons
!!nudge 30
@SagarNaliyapara Nudge #4 registered.
@Martinloc I stil dont understand your question.. Why does it return 6
Shouldn't it be 4?
11:30
@SagarNaliyapara nudge
11:42
> (0, _matchRoutes2.default)(routes, location, function (error, nextState) {
What’s up with this (0, f)(x) syntax? I can’t Google it. ;-;
someone here who know a bit node.js/sails.js?
7
Q: Calling function with window scope explanation (0, function(){})()

Adam HeathI am curious as to why this works: var c = { d: function myFunc() { console.log(this === window); } }; var a = { b: function() { console.log(this === a); (0,c.d)(); c.d(); } }; a.b(); Console output: True True False So it seems to be that (...

That’s… wow, JavaScript. Thanks.
11:58
hello
need help related bootstrap toggle event
!!welcome AjayBijlani
@AjayBijlani 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.
ok
I want to hide a div when bootstrap toggle is active with jquery?
12:04
44
A: Twitter Bootstrap onclick event on buttons-radio

hheimbuergerThis is a really annoying one. What I ended up using is this: First, create a group of simple buttons with no data-toggle attribute. <div id="selector" class="btn-group"> <button type="button" class="btn active">Day</button> <button type="button" class="btn">Week</button> <button ty...

0
Q: Passport.js sessions are not set when Login with Android

PomeGranateIn my AuthController.js I check if login is sucesscul and set an hashcode in the session: req.logIn(user, function (err) { if (err) res.send(err); var redirectTo = req.session.redirectTo ? req.session.redirectTo : '/user/show/'+user.id; delete req...

12:29
Hi guys, what module loader are you all using to load es6 modules? I'm writing an angular 1.5 app using typescript. I tried using systemJS yesterday but I'm not sure its workflow for running it in production.
I'm using JavaScript.
woo
progress
@rlemon @Loktar just another day
o shit
@FlorianMargaine FRIDAY!!! @Loktar o/
\o/
Hi folks,
need opinion
can anyone suggest what are the resources to learn JS in depth.
it's behavior, this, scope, prototype etc...
12:36
not dee dee
@FlorianMargaine she's worth 1.2 million
:D
guys what do you think, what could be the issue, why the sessions for passport.js are not set when I login with android? any ideas?
> It's raining? FML. How do I get to my car now?
Underscore prefixes for "Private variables" in Documentation: Yay or Nay? (relevant)
Don't document private variables
(In examples)
12:40
nay, but meh
I agree, fake private isn't private at all
@JanDvorak swim? OK ok, bad joke
@Cerbrus yay
@rlemon privacy in private variables in languages is about communication and not security.
Fake private is just as private.
I disagree
Unless we're talking capability theory, which we're not.
12:45
it is misleading and a false sense of security
What do you call an eye that keeps to itself? A reclusive eye. No, wait.. I screwed that up
I think Cer has it right in this comment stackoverflow.com/documentation/proposed/changes/…
@BenjaminGruenbaum Once communication fails (and it will) then it's about security.
What security? No one does _varName and thinks it's foul proof - in fact even if you don't do that it's still not foul proof. Private variables only communicate that the consumer of the code should not access them - that is all.
Check my rejection reason as well
12:46
@KendallFrey it's about communication to the programmer.
@BenjaminGruenbaum "No one does _varName and thinks it's foul proof -" except a LOT of people do that
because they are misinformed
"It's a fake private that will leave the reader with questions. (Like: What is the significance of "_"?)" <-- We don't want that in documentation
@BenjaminGruenbaum *fool
@BenjaminGruenbaum Yes, what else would you have meant?
@rlemon Crockford really has no standing for the past few years, and that post is 8 years old.w
12:47
case in point: _proto_
@Neil no, foul as in foul play.
@KendallFrey then I don't understand your statement.
Well, it's not foolproof either
There are two separate theories behind private variables.
Now I really am confused
you really think people are not confused by the lack of privates in JS and when we say "this is a private" it isn't more confusing?
really?!
12:47
There is communicating to the consumers of the code they should not touch it (but can if they have to - like reflection in Java) and there is actual capability theory security.
@BenjaminGruenbaum Never assume programmers won't use your code a certain way.
then they carry it over to memebers and all shit hits the fan
@rlemon somehow, in every other language that does this it's fine but JS is bad for doing it.
Like Python.
Or Ruby.
Or Lua.
Or pretty much any other dynamic language, geez.
Ruby has private variables
Sure it does.
..
12:49
calling something that isn't private private is going to confuse people. geez
If you want capability privacy use the barriers in the language created for that - WeakMap and WeakSet
@rlemon a private in C# isn't private either.
What exactly is private?
@BenjaminGruenbaum great, you can give me more examples of what I view as a poor thing
it isn't going to make me think any differently.
So, that means two things - something consumers of the code shouldn't touch, or something consumers of the code can be proven to be unable to touch.
@rlemon going into a discussion with "it isn't going to make me think any differently" isn't going to produce any meaningful discussion.
JS programmer: "So you're telling me that it is private? " "Yes, precisely. " JSP: "So, what, does this mean I can save credit card info in them? " *facepalm*
12:50
@BenjaminGruenbaum LOL okay I see how you would latch onto that
@BenjaminGruenbaum But it is much better at communicating intent.
you are not going to change how I feel about the verbiage by giving more examples of what I just told you I view as wrong
@KendallFrey right, language enforced convention is better than most other conventions. In other languages this is a non issue.
The first thing we should consider is what problem we're approaching, communication or security.
@KendallFrey intent is only as good as the person writing it. If it is incorrectly used, it is worse, not better
12:53
The two problems are fundamentally different, to be fair languages like Java have SecurityManagers to make approaches created for communication into stuff that can enforce security but it is really uncommon.
I've literally never seen it actually "used as intended", just like DLLs and JARs were supposed to be sort of like hot swappable containers but they're rarely used this way - but microservices are all the bomb.
wp.doc.ic.ac.uk/sd/publications contains some interesting reading on capability theory
And, for what it's worth, a lot of JavaScript research actually went into the other kind of private - secure. All of the Caja work and the frozen realms proposal.
In terms of secure, how secure is "private"? If it exists in memory, does that make it accessible and therefore not private?
@KendallFrey that's a good observation, indeed in order to not be able to break out of not having a reference - you can't have unrestricted memory access.
There are a lot of negatives in that sentence.
For example, if you're browser JavaScript - the fact that something exists in memory is irrelevant if you can formally prove you can't get to it. If you're interested in such a proof see www-cs-students.stanford.edu/~ataly/Papers/sp11.pdf
@Luggage Yeah, I'm tired
@KendallFrey In a more general sense - it is possible, Microsoft did it with Spec# and Singularity - by building the operating system in a managed language without direct memory access they got amazing performance because it means you don't need to have user mode and kernel mode.
User mode can't "break out" simply because it doesn't have a reference - truly amazing capability work.
That's actually pretty cool
13:01
Singularity was an experimental operating system built by Microsoft Research between 2003 and 2010. It was designed as a highly-dependable OS in which the kernel, device drivers, and applications were all written in managed code. == Workings == The lowest-level x86 interrupt dispatch code is written in assembly language and C. Once this code has done its job, it invokes the kernel, whose runtime and garbage collector are written in Sing# (an extended version of Spec#, itself an extension of C#) and runs in unprotected mode. The hardware abstraction layer is written in C++ and runs in protected...
Is that related to COSMOS?
It's amazingly cool, I had the pleasure of taking a course by one of the engineers who worked on it. Singularity never really took off because well - it couldn't run Windows software - but they use it in Azure.
I'm not that familiar with CosmosOS to be fair
So, this proposed docs edit suggests that +function(){ console.log("Call with plus sign behind!"); }(); is a alternative way to write IIFEs... Should be rejected imo.
well, it does work
Sure
13:04
I don't think I've written an IIFE in about a year
But it's pretty much a hack
as opposed to just (function() {})();?
Holy crap, it's actually still alive?
We don't need that junk in documentation
@KendallFrey "It" being documentation?
13:05
COSMOS
yea, a I have very few IIFEs and they are only for when I need a statement where it only accepts an expression (like in JSX)
maybe none. I might have refactored them out to make it more readable.
There may be one or 2 in the application I'm working on
the proposed do should replace IIFE's right?
@Luggage yeah, I get tempted to do this a lot, like if I need to throw I might do const value = truthy || (() => { throw Error(...); })(); but I always end up removing such code because it's ugly.
After checking: no IIFE's that aren't in some kind of library
13:08
Yeah, it was a really useful trick back then, but now with proper modules it's just a trouble maker.
So what does the room watch today @SterlingArcher @rlemon ? I really need a new TV show.
Rick and Morty
It's the new Futurama.
The current state JS in docs.so is :(
of* :|
Someone added another image to the Promises Introduction: stackoverflow.com/documentation/javascript/231/…
building in protection from circular references is harder than I thought.
at least if I want it to be favor the shallow instance over the 'first' instance.
13:17
@Luggage for what? Promises?
> Tail Call Optimization (TCO) is part of ECMAScript 6
:|
@BenjaminGruenbaum no, I am trying to display arbitrary JS objects. snag.gy/GpeTLM.jpg
Oh, I wrote that once
oh cool visualization!
@Luggage Don't import statements supposedly take care of that problem? Or maybe I am thinking of something else.
It started as a simple stateless recursive react component. Now I am triyng to fill in some features for real world use.
13:19
You need to check if it's a refernece and if it is put it in a map and check.
yea, i made a map and used that. That worked, but it preferred the 'first' instance, over the shallowest.
@cswl actually it's going to be removed.
shit, i gotta go talk to a client.
lol, have fun
Same user suggested the same IIFE hack, again: stackoverflow.com/documentation/proposed/changes/…
13:22
you only need the launchpad once
@BenjaminGruenbaum I haven't been following.. but it's actually PTC that's in the spec.. not TCO
lol someone on reddit
@cswl proper tail calls means tail call optimization
"FPS count??"
> FPM count
ftfy
13:24
optional :|
@SterlingArcher 9news.com/news/local/… you have a hand in this ;) cc @KendallFrey
@rlemon #FractionalNumbersLivesMatter
Technically the two mean writing functions that can be optimized and actually optimizing said functions so you're correct - but de facto it's the same thing.
In either case - no one has implemented them and they're going away.
Exercise pays off!
lol
you cheated tho
13:28
@rlemon That looks very capable of a water landing. I wonder if that was intentional.
@KendallFrey ask @SterlingArcher
@SterlingArcher divulge all technical details of your company's work pls
@BenFortune Weight: 8kg
Wut
Bulbapedia says 210.0 kg
lol anything I know beyond what was said in the interview I'm not allowed to say
@BenFortune I hate you. HOW?!
13:37
@SterlingArcher he's abusing the api
This is all I got :(
@rlemon que?
Abusing how?
@rlemon I haven't used it since I made it
he's got a desktop app
@BenFortune suuuure
Whaaaaaaat
@SterlingArcher tl;dr spoofs your gps so you can 'walk around' while not walking at all
there is a handful of them on github already
but if you get caught you account gets banned
so there is a level of risk
13:38
Oh
At least I'm still leading the Dragonite battle in my neighborhood. Nobody else has one yet
Though they do all have freaking Magmars and Lapras and Snorlax that are OP
I'm 29 candies away from a Nidoqueen though
and I have 2 near max Eevees ready to go
And a near max Magikarp xD
You know a video game has got it right when you start watching a video and think "Wait, is this screen capture or a real camera?"
@KendallFrey And then you look at it again 10 years from now, thinking: "How did we ever think that was a real camera? o.O"
FF7 was "over the top realistic" when it came out
Just installed Skyrim again... Damn, that game is actually pretty ugly on max.
(By today's standards)
13:48
You're ugly by today's standards >:(
Skyrim is a global treasure how dare you
@rlemon You see that corn picture?
yea
It was taaaasty
Not much mess either though.
Also, burned the shit out of the pads of my fingers because I was hungry and couldn't wait for it to cool down.
Hey guys. Does anyone know some similar solution to angular-elastic, elastic is quite old and it doesn't work well in Safari?
@KendallFrey youtube.com/watch?v=YledrMyoqgs fun with LIN and magnets
:D
13:55
Guys, is there any way to run componentWillReceiveProps only AFTER componentDidMount?

« first day (2113 days earlier)      last day (3060 days later) »