« first day (1122 days earlier)      last day (3809 days later) » 

10:00 PM
I think what you want is && to check that all conditions are true before you move on
instead of any
now if you want proof of the reason to the error: check em all off and click the button. Voila
@MirkoCianfarani does this explain things clearly for you?
anyways.. home time
 
@rlemon the problem is:

when u check any checkbox i get the error message
even when u dnt check any checkbox i get the error message
i just want the error message to appear when no checkbox is checked
 
ugh
read what I just wrote
I answered you and it is the correct solution
I'm not writing the code for you
 
ok
wait
please
I should that the solution is:
var p=false;
for(i=0; ele=document.reason.elements[i]; i++)
if (ele.type=='checkbox')
if (ele.checked)
 p=true;

 return p;
 }
 
:(
just fucking remove all of the == false
 
Using this script function but with long if (6 OR) not
 
10:07 PM
but i'm not explaining why it worked because I just did above.
 
why?
ehehe
Thank you for your explanation that I missed chat.stackoverflow.com/transcript/message/12880623#12880623 @rlemon
 
!!> function Warning (msg) { this.or = "Warning: " + msg; } try { throw new Warning ('this is warning'); } catch (err) { err.or }
 
@Shea "Warning: this is warning"
 
10:22 PM
@Shea don't do that, no stack traces.
 
@rlemon this room is amazingly help-vampire-tolerant
 
@BenjaminGruenbaum Thanks, I was wondering about that
 
0
Q: variable declaration in javascript

ShaggyInjunI have been doing something like this for a while and I have never seen any errors. But, unfortunately, I have never been able to explain why this works. The first line creates a variable which points to a function. The second line just adds func2 to func1 separated by a dot and defines a funct...

 
Maybe I can extend Error?
 
@Shea Or monkey patch on it.
 
10:25 PM
Alright cool, I got this
 
@BenjaminGruenbaum I just don't get why would you want to use different variable name instead of proper language construct. I guess that things like "proper language declarations help compiler optimize code" can be elusive for a JS developer, but anyway you will probably need to write more comments that way to keep the code maintainable, whilst I usually see comments as unnecessary in a language that has a lot of static checks (because my code already contains the same information).
 
I give the variable name anyway - it improves readability, and I don't need the compiler to enforce that because it's silly. Variable access modifiers are just for developer communication.
 
@BenjaminGruenbaum why is it silly? Why is a name better than a language construct?
 
You do the naming anyway
 
@BenjaminGruenbaum I don't get what the fuck is it about
@BenjaminGruenbaum yeah, you name the variable private numberOfShit : number;
 
10:30 PM
176
A: Does python have 'private' variables in classes?

Kirk StrauserIt's cultural. In Python, you don't write to other classes' instance or class variables. In Java, nothing prevents you from doing the same if you really want to - after all, you can always edit the source of the class itself to achieve the same effect. Python drops that pretense of security an...

 
It's extremely retarded.
 
@rolu 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.
 
Implementation details are implementation details and if your API gives access to them, someone's bound to use them
 
No, it's not. It works great in practice. The problem is with languages that make us code like/for details.
 
Programming is about details.
 
10:32 PM
@BartekBanachewicz You give access to them anyway...
 
@BenjaminGruenbaum you explicitely say "this is implementation detail. it's private"
If you don't care about details, you're a lousy noob, not a programmer.
 
@BartekBanachewicz Why do I need a language construct for that?
 
@BenjaminGruenbaum to make a compiler, which is your primary static analysis tool, break the compilation when you break the rules you've set for yourself or others
to enforce the developer to reason about what he is doing
 
No... it doesn't really do that
 
to prevent bugs from even getting into code
 
10:34 PM
It gives you a sense of false security which in practice you don't have.
 
@BenjaminGruenbaum no one overrides private access
and compiler won't let you proceed until you figure how to do things properly
 
@BartekBanachewicz No one accesses methods in JS APIs when those methods are not documented.
 
@BenjaminGruenbaum how long have you been living in your dream world?
 
Seriously, have you ever tried to randomly type method names in jQuery for example?
 
of course I had.
I've got a list of all of them
 
10:35 PM
You just went in and started typing method names in?
Oh, that's documentation, that's the API.
 
@BenjaminGruenbaum nah, I used what autocompletion gave me
 
Yeah, exactly, and autocomplete went through the documented methods
 
not really
 
Yes really, that's how TS does it for libraries not written in TS
 
well, you can make things private in JS
 
10:36 PM
You could have used annotations like Closure.
 
@BenjaminGruenbaum I don't mean TS
 
Of course you can but a convention works just as well.
 
@BenjaminGruenbaum no, it doesn't
 
Yes, it does. Python has been doing it for ages and no one complains. People love it.
 
I love how you all users of JS think that "conventions are cool" attitude cuts it
@BenjaminGruenbaum Python is a modern language
 
10:37 PM
...
@BartekBanachewicz I love how you assume that because my opinion is different I know less, or how you assume JS is the only language I use sometimes.
 
@BenjaminGruenbaum I don't get how, if you indeed use other languages, could you say things that are so utterly nonsensical.
 
That's because you've never coded this way.
 
@BenjaminGruenbaum and you think that based on?
 
You assume I'm wrong because I use a system that works differently.
Based on you saying that _ isn't a viable solution for privates for example.
I've never heard anyone that both a) coded in languages without private keywords b) said that.
 
@BenjaminGruenbaum No, you use a system that's deliberately less complicated for beginners to use it and call it a noveau improvement.
@BenjaminGruenbaum I've written a lot of Lua and a fair portion of JS
not mentioning thousands of LoC of python
 
10:40 PM
@BartekBanachewicz did you just imply that JavaScript isn't a modern language?
 
@BartekBanachewicz JS uses a system that's deliberately less complicated, but not for beginners.
 
@BenjaminGruenbaum is that why a lot of beginners write a lot of terrible JS code?
 
JS is a much harder language to pick up than.. let's say Java.
 
@BartekBanachewicz I wish there was a way to do that in JS
 
@Shea um, there is
 
10:41 PM
Just like beginners in ALL languages do!
 
my Javascript code uses private hidden implementation
TYVM.
 
Then what's the problem?
 
@BartekBanachewicz Yes, it is. A lot of beginners come to JS from languages like C++ and assume it works the same. They don't grasp how to be effective with it, they don't understand how typing works, how real first order functions work etc.
 
If you don't see the need for it in JS, then....
 
0
Q: OOP Programming Methods

EasyBBI have an OOP program started actually in many different ways. First way is the literal method, var $_ ={ prop1: {}, prop2: function(){}, prop3: function(){} } Object.defineProperties(_$,{ "prop4":{ writable:false, configurable:false, ...

 
10:42 PM
@Shea I could perfectly replace JS with Lua or Haskell, but that's irrelevant here
 
...Then yeah, maybe it's pretty pointless, but there's definitely a need.
 
@BenjaminGruenbaum Typing in JS is broken at this very moment, so no wonder it looks uintuitive to C++ newbies.
I mean, if a language needs === operator, there's something wrong with typing
 
Oh I'm retarded lol
 
rule of thumb vOv
 
@BartekBanachewicz My honest opinion right now is that you don't understand it. I don't want to be a douche saying this, but that's what I feel. JS typing isn't broken - it's different.
It's really powerful, and it let's you worry about what you really care about - behavior.
Anyway, I feel like this discussion isn't really going anywhere. Just code more JS - that helps.
 
10:45 PM
@BenjaminGruenbaum Thing is, each and every shortcoming of TS and JS makes me want to run Haskell in the browser, but I can't :(
 
hm
I wonder how reliably does that work
maybe I'm saved, after all
 
@BartekBanachewicz That's hilarious, we all know that here. Half of the things there are because they do stuff like {}+{} and the browser thinks of that as: open block, close block, then explicitly convert an object to a number (that's what an unary plus does). So you get NaN.
 
@BenjaminGruenbaum so intuitive
 
10:47 PM
@BartekBanachewicz you can use clojurescript too.
 
But you're still missing the point.
 
@phenomnomnominal which is?
 
JavaScript is just as powerful and more flexible than Haskell
 
@phenomnomnominal bullshit.
 
10:48 PM
Not bullshit.
 
@BartekBanachewicz I've never had a bug relating to any of those. Why would you explicitly want to convert an object to a number?
 
@phenomnomnominal it doesn't have its type system
@BenjaminGruenbaum it's not about "why would you
 
The simple fact that you can compile Haskell to JS shows that.
 
@phenomnomnominal WOW YOU CAN COMPILE JS TO HASKELL TOO WHAT NOW
 
How does the ability to compile to a language make the target language more flexible?
 
10:49 PM
@BartekBanachewicz Yes, it is. You don't code for retards. You code for coders and for clients. Just because I can explicitly convert an object to a number doesn't mean I do.
 
@BartekBanachewicz Ewww, why would you want to do that?
 
Language lets me do stupid shit and counts on me being a sensible, competent programmer. Must be broken.
 
That sounds like an awful idea
 
@BenjaminGruenbaum why don't you code in assembly then?
it's way more flexible
 
No, it's not.
 
10:51 PM
but you have to be "competent", you know
 
Language forces me to define a type system for anything small, and completely break or change it when specification changes. Must be best for everything.
 
@BenjaminGruenbaum TYPE INFERENCE
 
@BartekBanachewicz I still have to define the types...
@BartekBanachewicz Yeah, but assembly doesn't let me define how components interact, how the API behaves. It doesn't have a notion of anything the least useful.
That's the thing, JS makes it very easy to do evented I/O. It's awesome at that.
With useful things like first order functions that aren't broken, and a lot of flexibility - that works.
@BartekBanachewicz also NO NEED FOR ALL CAPS :P
 
@BartekBanachewicz Did you write this? ;P
 
@BenjaminGruenbaum is that why it's called "callback hell"?
@Shea nope
 
10:54 PM
@BartekBanachewicz if only there was a way around that...
 
@BartekBanachewicz Why would anyone get into callback hell? You only get there if you have no idea how to structure concurrency in JS
@BartekBanachewicz I feel your pain though. I like Haskell too. It has a real notion of safety even if it's not perfect.
 
@BenjaminGruenbaum @BartekBanachewicz But what is it that you guys are really aruging here?
 
@Shea we're pointlessly insulting each other, why?
 
@Shea We're just having a discussion.
 
10:58 PM
That's the same thing XD
 
Imo, it all boils down to, "is this language better or worse, because it slows me down a little?"
 
Even if you end up hating JS, it's worth learning. If you haven't read "The Good Parts" yet - do it.
 
Yeah, it's not like it's going anywhere
 
this argument has been going on for hours
 
10:59 PM
Which is why I think JS developers tend to rely on reusable code a little.
 
!!s/hours/years/
 
@phenomnomnominal this argument has been going on for years (source)
 
!!s/!!s\/hours\/years\//poop/
 
@nderscore poop (source)
 
I've seen @BenjaminGruenbaum point out many times, that each language has their uses to solve different problems, when any language worth arguing over should be able to solve any problem, with a little extra work.
Which is why reusability tends to be a big thing.
That is where I think JS really shines
 
11:01 PM
There are only two kinds of languages: the ones people complain about and the ones nobody uses.
-Bjarne Stroustrup
 
@BenjaminGruenbaum I will.
 
is there an easy way to check if the innerHTML of an element exceeds the parent's width with JS?
 
anyone with a win7 - pc and latest chrome in here?
 
@GNi33 yep
 
me
 
11:06 PM
could you guys have a look at this page for me -> tympanus.net/Blueprints/OnScrollEffectLayout
is the "touch" - class applied to the html - element for you?
 
<html lang="en" class=" js no-touch" style="">
 
<html lang="en" class=" js no-touch" style="">
 
this is so weird
there are no overrides set in both chrome stable and aurora
but the touch-class is being applied in both of those nontheless
 
where are you gus seeing the html like that =/
 
it works on my Mac
 
11:09 PM
f12
 
oh i see it changes when i go to edit the html
 
@GNi33 go look at the test when it runs?
 
yeah, i'm looking for it right now
 
 n.touch = function() {
    var c;
    return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : t(["@media (", m.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function(a) {
        c = a.offsetTop === 9
    }), c
};
 
a.ontouchstart --> null
seriously, the first part of that if already fails, what the hell
 
11:13 PM
of course that fails
 
yeah, but why is the class set then?
 
well it's an ||?
but yeah it won't be a DocumentTouch either
 
the second part would return false too
 
what happens after the function returns?
 
but Modernizr.touch is set to true afterwards
 
11:16 PM
lemmings are released
 
@BartekBanachewicz I have my moments
 
yeah but what causes that?
 
sometimes I will try to urge them to see their own mistakes
or I give pseudo code
 
i don't know
 
@GNi33 so just walk through and look?
 
11:16 PM
sooooo last night I spilled a pop on my keyboard. Took it apart, cleaned it best I could, let it dry.... :( now all the keys are sticky.
 
I'm on it, dude ;)
 
I mean, I'm happy it works. but still.
 
@GNi33 either way, super weird
@rlemon you need to be more careful when you masturbate.
 
I know :(
 
yeah, especially because it's happening on both versions, which should be totally seperate setups
 
11:17 PM
I guess I'l go back to your mom doing it for me
she never spilled my pop
 
is this a rare Modernizr - bug that I'm experiencing right here? the same thing is happening on barrelny.com for me
 
@GNi33 not that rare :P
@rlemon yeah she's a pro
 
yeah, I always thougt, that the "touch" - check is pretty bulletproof
as it's probably the most used check of the whole library
 
Did you see what does it?
nothing with touch is ever bulletproof
 
that check is ugly as hell :D
 
11:22 PM
I use modernizer to make sure I have js
 
hehe
okay, this is something a lot worse
 
I wish I were joking :(
 
barrelny.com isn't even using Modernizr
 
the contractor who made our last site used Modernizr JUST for the js class on the body
BUT then *just to be sure* added this
$(function() {
  $('body').addClass('js');
});
 
probably the whole fucking thing too? :D
 
11:27 PM
included all of modernizr?
ohhh yea!
 
haha, of course :D
 
and two other scripts that NEVER get called
one just stubbed our console on browsers that don't support it
and there were no console calls made
 
I just love when people start throwing libraries at a site without even thinking about it
"It's used in the HTML5 Boilerplate, I NEED THIS THING"
 
I love when people release code with commented out code in it, or with development libraries that are never used
or console calls !
 
Does the != operator do anything in JS?
 
11:29 PM
not equals
 
@AndyAndy 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.
 
"And all of it's functionality too, because I might need this one function there and that one too"
 
strict not equals !==
 
@NathanJones ({} != {}) != NaN
 
@BartekBanachewicz Could you explain that a bit for me?
 
11:30 PM
@NathanJones that was supposed to be a lame joke
 
there is also the lesser known probably not equals ?==
;)
 
haha
@rlemon I thought string not equals is !===
strict*
 
well if you remove a = for equals
why wouldn't you for strict
== / !=
=== / !==
 
Hey there, I've got a little question.

Lets say there are 2 input boxes. First one is to input data, second shows calculated value(read only). How can I assign sort of a hidden value to the second input box, so that the result shown in this is a hidden value mutliplied by number inputted in first input box?
 
@rlemon ah okay. thanks
 
11:33 PM
Damn I made it sound too complicated lol
 
<input type="hidden" name="foo" value="" />
in your js treat it like any other input
foo.value = bar.value * n
!!write your own blog or use an existing platform like a chump
 
@rlemon write your own blog
 
I'm really leaning towards being a chump
but ok Caprica, you win
 
@rlemon db
 
!!db or flat file
!!mongo or mysql
 
11:36 PM
@rlemon mysql
 
wow
really?
but Mongo is webscale!
wow! second time today! fuck I hate myself right now
went to just install my old blog and "fix" up the stupidness and didn't include my table structures.
 
Trying to brainstorm a node.js server layer, so that localhost/request.js would execute that file, handle errors, and provide injected libraries only as they're needed, while also maintaining control of HTTP or allowing new/different types of connections.
If that makes sense
I think it's kind of obvious what I need to do, but ideas are welcome
 
@BenjaminGruenbaum done and done
 
Well for one, request.js isn't going to work. There needs to be a way to segregate whether to execute or serve the .js extension.
 
some one was clearly not awake :
 
11:54 PM
ok, it begins. rlemon.ca
check back for a blog periodically :P I like to dev live!
 
Would it be stupid to have a file structure like:
 
- public/   #localhost/
	|-assets/ #nothing get's executed here
	|	|-ui.js     #served as localhost/ui.js
	|-index.js #executed and served as localhost/index/
you're welcome
 
I need a tab key binding extension in this chat
 
I need better bin control :P
!!todo help
 
@rlemon Unidentified /todo action help
 
11:59 PM
!!help todo
 
@rlemon todo: Your personal todo list. get [count] retrieves everything or count items. add items adds items to your todo list (make sure items with spaces are wrapped in quotes) rm items|indices removes items specified by indice or content
 
But say I have...
- public/
	|-assets/
	|	|-ui.js	# should this effectively become a view
	|-ui.js		# and this be a control?
 
!!todo add "write userscript to add individual bin message button"
 

« first day (1122 days earlier)      last day (3809 days later) »