« first day (1521 days earlier)      last day (3428 days later) » 

7:02 PM
also, someone suggest a good os to put on my old desktop, which I no longer use, but others in the house do. For Office Apps like word, powerpoint, excel etc, a browser, and playing music. It's a e7300 core2duo PC with 2gigs of RAM, onboard intel gpu, and 250gigs sata 5200 rpm hdd. An intuitive UI which 'normal' people can use would be preferred.
 
@SomeKittens Meh, back to stone age programming or what
 
psh your eyes cant even see anything over 30fps anyway
thats what all the console fanboys tell me :P
 
@Loktar It's somewhere between 20 and 40, nobody knows for sure
They do know that consistent framerates look better, regardless of speed.
 
I'm gonna const all my variables and overwrite window properties
 
Also another reason to hate globals - they can't be GC'd
 
7:05 PM
@SomeKittens Huh?
 
@ssube not true
 
@copy Read the article - JS memory is stored as a tree off of the global object
 
studies have been done saying we can detect up to 240 even.
 
@SomeKittens wait what?
 
Objects that no longer have a reference in the tree are GC'd
 
7:06 PM
@SomeKittens also what?
 
@BenjaminGruenbaum See article above
 
Evening
 
@SomeKittens So if I overwrite the global variable, it will be GC'ed
 
@Loktar that seems unlikely, but I don't have anything to cite against it. Smooth low framerates still are better than high but stuttering ones.
 
@Jonathan This is your last warning - next time you show up, you'd better have a FESTIVE HAT!
 
7:07 PM
eh I prefer 60+
 
and 30 can look good, if you have good motion blur and it's always 30.
 
hat?
 
@copy No, read the article.
 
ugh I always turn off motion blur
 
also most monitors are set to 60, so more doesn't matter
 
7:08 PM
ew, motion blur
 
heh thats why I have a 144hz one :P
 
the article seems about right about the old heap and new heap part
 
Motion blur is pretty critical to things looking right, it's just incredibly overdone in most games.
 
> Your application will paused on the order of seconds.
 
7:09 PM
Primarily because they don't integrate it with the physics system at all.
 
bullshit
 
@ssube Have you seen TotalBiscuit's FPS rant?
 
eh I still turn it off in every game. I see it as fog in the 90's
 
I don't see any hats
 
Its slow but it's still miliseconds
 
7:09 PM
its a faux limitation to hide imperfections
 
@KendallFrey no idea who that is, so probably not
 
@BenjaminGruenbaum Uh, very much real. Experienced it personally on a regular basis. Albeit a netbook, but stil...
 
@Loktar fog was, motion blur isn't. Real life has a ton of it, and it's fairly important for believable motion.
 
TotalBiscuit?
 
@ssube probably the biggest hater of 30FPS out there
 
7:10 PM
@SomeKittens not due to old GC allocations.
 
I disagree. Motion blur breaks immersion for me.
 
Also, not everything is a member of window, everything has a root. That's not the same\.
 
@Loktar Nice profile pic ;)
 
@Loktar That's because it's usually done as a simple blur, or based on the camera motion (and maybe screen-space depth). It's completely unlike the real motion blur it's supposed to mimic, so it's even worse than nothing.
Good, physics-based blur, is entirely different and can help sell motion, especially small/med objects moving quickly.
 
@ssube if that were the case why is oculus doing everything they can to remove it?
 
7:11 PM
"Zero allocations" is BS and the window part is possibly ambiguous but other than that it looks like a solid article.
 
Not sure if anyone but crytek has ever tried it, though.
 
We don't blur in real life.
 
GC can indeed be the bottleneck but you gain a lot more from knowing what parts are memory efficient in JS and which are not.
 
@Loktar Real life is super blurry.
 
@Loktar Yep, our eyes literally turn off.
 
7:12 PM
^ and thats why games shouldnt add a layer of blur we normally don't percieve
 
There's a really nice paper on it somewhere in crytek.com/cryengine/presentations
 
dammit chrome, where is let? I've been waiting longer than I should have to for it.
 
@ssube lol I turned it off in crysis 3 and ryse actually
 
I think this one is the simple ss-depth one most games use: graphics.cs.williams.edu/papers/MotionBlurI3D12/…
 
but that article does look interesting.
 
7:14 PM
actually, maybe that is the good version.
You have to take velocity into account, else it looks awful.
 
I did it for ~30s 10 minutes ago, I'm still seeing it
 
@Loktar One of the biggest problems is cheap games (see anything by Epic) use simple motion blur as a fill in for low framerates.
 
eh reading this it doesn't seem any different, it still seems like they are trying to hide lower frame rates.
 
That's the worst of all situations. Good blur, at a decent framerate (40+, I'd say), taking velocity into account, makes it much more believable.
 
@SomeKittens Sorry! Working on a better one than the candles on my head
 
7:16 PM
But, if you don't like it, whatevs.
 
many (id dare say most) pc gamers dont
not for the camera anyway
 
I'm just fascinated by the techniques and what they're trying to reproduce.
 
708
A: Copy to the clipboard in JavaScript?

Jarek MilewskiAutomatic copying to clipboard may be dangerous, therefore most browsers (except IE) make it very difficult. Personally, I use the following simple trick: function copyToClipboard(text) { window.prompt("Copy to clipboard: Ctrl+C, Enter", text); } The user is presented with the prompt box, wh...

 
SIGGraph papers are the best.
 
I added references here by the way (the module question) if anyone cares.
 
7:17 PM
Why does this answer have 708 votes while not being the answer at all, and being terribly UI unfriendly
 
It's like the "HDR" stuff in games, which is really poorly done and again, usually makes it worse.
 
heh or like Bloom in the early 2k's
 
Source's version of HDR is particularly atrocious. And UE3's "lighting" that made Mass Effect look like plastic.
 
however I still dont see a reason for motion blur, our brains perceive moving objects a certain way already
why add some weird emulation layer on top
 
You know how if you whip a stick back and forth, you see a trail? That's what motion blur should replicate.
 
7:19 PM
if an object is moving too fast we will blur it naturally.. so why add it unnaturally?
 
It's very subtle, but because screens don't have depth and focus on refreshing cleanly, we lose that in games.
 
because doing more work is the best solution
 
@ssube but if you move the stick the same speed in a game, and its running at a reasonably high framerate my eyes should do that anyway. Its more of a problem < 60fps definitely though
 
Good blur should only apply to things with a very high on-screen velocity (velocity modified by depth)
 
yeah I think we are talking about two different implementations
 
7:20 PM
@Loktar They won't, though, unless you have a crazy high framerate.
 
Im more referring to the motion blur added to the camera
when you turn, the scene blurs.
 
@Loktar Right, like when you spin around and it goes all RAGE.
That's the bad kind, and most people agree it sucks. There happens to be a kind that could be good.
 
So why do people not like $(document).ready(function () { });
 
@GorgiKosev that edit :D
 
@Greg there is a shorthand, $(function(){});
 
7:21 PM
@Greg because it's redundant and usually shows fundamental misunderstanding of how a script is executed in browsers.
.ready is intended for plugins and being injected to untrusted pages whose state you don't know but a lot of people use it in their scripts for no reason.
@Loktar I always found that syntax really confusing
 
I did too, I still don't really understand how it's an alias for doc.ready
 
I don't like it because 9/10 times, the person using it doesn't need to use it or has no idea what it does anyways
 
@SterlingArcher it's just a special case.
 
@SterlingArcher jquery bro.
 
@SterlingArcher api.jquery.com/ready
does't really clear it up..
 
7:24 PM
jQuery's motto is: "Is it common, could it be useful, can we make it confusing? Add it."
 
I just don't write JS
 
@SomeKittens <-- hat
 
@SomeKittens ?
 
Can weird things ever happen if you return arguments;, or is that totally ok? I feel like I've seen it do funny stuff before
 
james.padolsey.com/jquery/#v=1.10.2&fn=jQuery.fn.init @SterlingArcher see the rootjQuery.ready part
 
7:26 PM
0
Q: Checkding and de-registering document.ready() callbacks

More Than FiveIn JQuery, it is possible to register a document.ready() listener by doing? $( document ).ready(function() { alert("Document.ready.2") }); Is there anyway to deregister that callback? Is there anyway to check what callbacks are configured for the document.ready() event?

lol new question related to our discussion
 
@Jonathan BEAUTIFUL
 
@BenjaminGruenbaum didn't want my frustrations with node core to be visible
I have no idea what they're trying to achieve now.
 
Yeah, me neither. Also it's io core now :P
 
I don't get this hat business... I don't see any
 
seems like they're not open to growing the standard library under any circumstances. that sucks.
 
7:28 PM
@SomeKittens I believe you misunderstood the paragraph below Object Graph then
 
@Loktar is it out yet ?
 
@darkyen00 what?
 
grapple
 
@TravisJ - Ah, in that case I totally agree.
 
we need good standard abstractions for a least single-event and multiple-event stuff, otherwise blargh.
we should just port dart's stdlib :P
 
7:30 PM
@darkyen00 no
going to work on it on christmas vacation
I start it on Wednesday woot.
 
can i help ?
free of cost ?
 
in JS Room Meeting, 4 mins ago, by Travis J
@Zirak - Always willing to discuss :) And sorry I wasn't present and that apparently @Kendall felt the need to leave this out:
@FlorianMargaine @BenjaminGruenbaum ^ see that and the ones below
 
@darkyen00 eh its pretty close to being done
kind of have everything left to do in my head
 
Ok, so he's just pissed that he's not RO. If I had to guess that'd be my guess.
Not going to worry about it much, he's welcome to think whatever he wants, he knows I like him regardless of what he thinks to me <3 Travis
 
@dystroy never looked at how browserify did it tbh, but yes, it does something to make the modules work. It went through several stages, and browserify 2 found a clever way to do it in the least bytes count possible
@SomeKittens I decided to stay out of drama, so I don't care, I just do the cleaning when necessary and that's it now
 
7:41 PM
I am not worried about being a room owner or not. To be honest, there was a lot of vitriol at the time and I didn't feel like staying. Also, being associated with the potential of a room being shut down was intimidating.
@BenjaminGruenbaum - I never did understand why you took part in removing all those owners though.
@FlorianMargaine - Nuking the room owner list and staying out of drama seem mutually exclusive.
 
It was an experiment, unlike the way you describe it it was quite public and we talked about it on miaou when we left the room for a week quite openly. There was a discussion room - in retrospect it was nowhere public enough.
 
@TravisJ the decision was after :)
 
On miaou, but it wasn't public. And it didn't seem that many people took part in it considering the fallout.
 
Anyone wants to develop this with me?
https://github.com/Jonathan-Ironman/Feral-Waters
Live: http://jonathan-ijzerman.nl/game/ (has sound, M to mute, arrow up/down volume... space to fire :D)
 
People got way more upset - the idea was that ROs felt entitled and when we had drama that needed actual moderation no one took action. We wanted to shake it up and make room owners janitors. Apparently people didn't like it and we reverted it shortly after - anyone who came back got ROd again.
 
7:44 PM
question: in these code snippets i am trying to refer to bundles predefined inbrowser config in package.json but these are pre-shim. When does the shim actually take place? The shim never occurs if i refer to them by name instead of using another js file to require the bundle (ie require('bootstrap') will run the shim and track the dependency)
 
Well perhaps the reflection was good for the atmosphere here. Even having the meetings about increased moderation is a step in the right direction.
 
I totally understand you not wanting to participate - no one is making you, we'll gladly have you back but I was not 'undermining' anyone or anything. It was not a conspiracy, it was an experiment which was coordinated with anyone interested in miaou and with the SE staff.
 
generally tags aren't hashtags. for the record...
 
good, i wasn't intending to use them that way :)
 
@TravisJ to be fair although the operation was a failure the patient lived - the atmosphere is a lot better since we talked about it.
 
user2620028
7:45 PM
@NickDugger are they tags that are preceeded by the hash symbol? aka Hashtags
 
can I get a pizzatag?
 
user2620028
do you have a pizza symbol?
 
@BenjaminGruenbaum Heh, reminds me of the opening to Hitchhikers - "The plans have been on display!"
 
We monitor it, we're more active in keeping it clean and the room is generally nicer AFAICT. We had a bad culture here that developed during the past year after having amazing culture and we fixed it. I'm very content with what we have now.
 
A lot of regulars are less regular now :/ :(
 
7:48 PM
@AwalGarg fiber sucks.
 
@AwalGarg Raisin Bran.
 
@AwalGarg People come and leave all the time, it's nothing new. The room is as active and actually some people like Simon came back after being a lot less active.
 
eh?
@BenjaminGruenbaum ok
 
user2620028
@NickDugger i see no reason for not having a pizzatag then :D
 
7:49 PM
What is the proper way to do it then?
 
@CarrieKendall you should probably ask that on SO - it's good enough and generic enough to be there and knowing the regulars most of us don't have that flow.
 
flow- ie more spa?
 
btw, I've got a question. If I don't have the time to follow the room meetings, and, uh, just participate in the room's meta-life, should I step down as a room owner? I'm less and less available, and it's going to be even worse in a couple months. Just wondering. cc @BenjaminGruenbaum @rlemon @SomeKittens @SomeGuy @Loktar @Zirak and ROs I forgot
 
@CarrieKendall it takes place during the transformation
heh cant find exactly where that happens with browserify-shim
 
@FlorianMargaine if it makes you feel better, @rlemon missed the meeting too
 
7:53 PM
yeah, but I'm going to miss all the meetings.
 
I wish JavaScript was more like C#. @NickDugger I haven't seen @rlemon today at all actually, which is weird.
 
@FlorianMargaine probably not. Room meetings aren't mandatory and you still do plenty of clean up.
 
You wish javascript was more like C#? You can leave
 
Also, you participate in room meta life.
@NickDugger I wish JS was more like C#, go ahead and try to make me leave (cc @Greg)
:P
 
what if I make romantic advancements?
 
user2620028
7:54 PM
damn i was gonna change that to rheumatic
 
@FlorianMargaine If you're an active and knowledgeable participant in the room, there's no reason not to remain RO.
 
@Loktar yeah, but it is a different kind since it isn't per file, its per bundle instance in the package.json
 
@Greg i'm here. just busy
 
make me RO so I can ban people
 
that's the part i am struggling with
 
7:56 PM
hi rlemon!
 
@rlemon Oh, your acting like a ninja!
 
@NickDugger ooh kinky
 
@BenjaminGruenbaum random bluebird question
 
@BenjaminGruenbaum I can't help it, I love the world of Strongly Typed delight!
 
how do I pass multiple arguments back to the next function in the chain
 
7:57 PM
@rlemon random bluebird answer.
 
bleh meeting
 
@rlemon return an array, then use .spread for example:
Promise.resolve().then(function(){
    return [1,2];
}).spread(function(one, two){
     assert(one === 1);
     assert(two === 2);
});
 
if you use .then, the argument will be an array. Using .spread is simply sugar over this.
 
@Greg C# has a pretty shitty typesystem. Weak generics (runtime though so +1), very bad enums, no union types, no ADT, lots of problems with first class functions.
 
basically spread = function() { return then.apply(this, arguments); }
 
7:59 PM
Yeah, pretty much. It's actually more like:
 
@BenjaminGruenbaum What languages actually have union types? I hadn't seen them (that I remember) before TS discussed introducing them.
 
@ssube C
 
@BenjaminGruenbaum You don't like the TypeSystem? You aren't a fan of TypeScript then I take it? typescriptlang.org
 
@Greg TS has union types and structural typing both of which C# doesn't have
 
@ssube by extension, C++
 
8:00 PM
spread = function(fn) {
  return Promise.all(arguments).then(function(args){
        return then.apply(this, args);
  });
};
 
Which reminds me, can someone explain to me what Go is? Does it have anything to do with C++? I read an article somewhere that confused me
 
@NickDugger They are separate languages that share some similarities.
 
for the giggles:
 
@FlorianMargaine Are we discussing unions as a type of type, or TS-style union types?
 
@ssube what Florian said is not what I meant by union types (although that's a more common case). Think of methods that return "int or string" for example.
 
8:02 PM
ah, my bad
 
47 mins ago, by Kendall Frey
IT'S STILL HAPPENING
best/worst optical illusion ever
 
drugs
 
@BenjaminGruenbaum But you can do it though- You end up doing some unique interface implementations.
 
@BenjaminGruenbaum yeah, you mean the TS ones. function ():string|number type. What other langs have that?
 
8:03 PM
@Greg you really can't, at least not cleanly. In C# you had to have special compiler support for nullables which is just a special case of this.
 
!! should I take the risk of breaking the system or go with what I have?
 
@AwalGarg I'm not sure
@AwalGarg go with what I have
 
goood choice
 
@ssube They're easy to do in languages like Haskell, Swift or Scala for example.
 
in which case, I can afford going to sleep now, and waste some more time.
cya gentlemen
 
8:06 PM
Oh, F# is a good similar-to-C#-but-with-good-typesystem language.
 
do people even use F# though?
 
I'm not saying a good typesystem is a killer feature, but yes - people use F#.
 
0
A: Event capturing jQuery

JonathanI'd do it like this: $("body").click(function (event) { // Do body action var target = $(event.target); if (target.is($("#myDiv"))) { // Do div action } });

 
I usually use C# though.
 
user1596138
I went to C# to say that @BenjaminGruenbaum and @FlorianMargaine are good people because they were being slandered. Was treated like a piece of shit, insulted, had my messages binned and got kicked. Fuck SO lol
 
8:07 PM
I just don't think it's a good example of a typesystem.
 
I'm I'm having a brainfart or is that answer far better than the upvoted one?
 
user1596138
!!afk have fun
 
@someDoge I don't mind being slandered
 
@BenjaminGruenbaum I haven't had any problems, I'll have to look into it some more though.
 
@someDoge I don't care either
 
8:09 PM
@NickDugger If you want to meet a F#anatic, come to the C# room when @ReedCopsey is around.
 
@Greg try returning a type you defined through anonymous objects.
 
@KendallFrey I've honestly never seen it being used.
 
me neither
 
@BenjaminGruenbaum Ah, you had to mention anonymous.
 
oh btw:
doThis(), doThat(), andMore();
// vs
doThis();
doThat();
andMore();
 
8:10 PM
@Greg why can't I return variables I create with anonymous literals?
 
@NickDugger I feel like there are a few larger projects or companies using F#, but can't find references atm. It's definitely one of the most popular CLR languages.
 
which one is better?
 
@AwalGarg latter
 
Which do you find more readable?
 
@BenjaminGruenbaum the former
@FlorianMargaine why?
 
8:11 PM
@AwalGarg really?
 
@BenjaminGruenbaum umm, yeah... why?
 
@AwalGarg usually, not more than one statement per line
 
@FlorianMargaine because debugging would be a tiny bit easier?
 
unless they return true/false, then doThis() && doThat()
 
anyone got any quick and dirty suggestions on how to control the 'cron' aspect of the timing for 12days?
I've god ideas, but they suck.
 
8:13 PM
@rlemon using cron?
 
in node
 
@rlemon use cron?
 
why not cron?
 
@AwalGarg I find the second more readable, although if you find the first I don't know what to say. The common convention is to do the latter but whatever works for you.
setTimeout(function(){
 // runs every day!
}, 86400 * 1000);
 
I've never had a node server open long enough to need cron... I'm a noob
 
8:14 PM
@NickDugger only logically chain calls if they're related and one depends on the other. && is absolutely not a general replacement for x, y, z or x; y; z;
 
Do you have to microanalyze everything I type? Geez, man.
 
@AwalGarg The latter, although those are very subtly different in semantics (the former will return the result of andMore() from the line, the latter has three different values.
@NickDugger That's hardly micro. Using && changes the behavior pretty drastically.
 
@BenjaminGruenbaum The first one looks like a plain english statement to me, which is why I found it better... but would go with latter ;)
@ssube ok, cool
 
@ssube I'm well aware, and I'd assume anyone reading would understand what it does
 
@AwalGarg You're not using the return, so it's preference, but the x, y, z can be convenient (if you've never used it before).
It can also be very confusing, if you use it anywhere but a loop condition thingy.
 
8:17 PM
first one is like -> hey you gotta do this, and that. second is like -> hey you gotta do this, and th... oh wait.
nvm, good night in real.
 
@FlorianMargaine Continue to clean shit up when you're here and it's cool
@ŠimeVidas (@FlorianMargaine, @SomeGuy): They're defined here
 
Got a testing question for you all
 
It's deep in the console implementation. That's a file which is injected into the page by some c++ code.
So you don't really have access to it, since it doesn't exist per se, and is re-injected on every eval
 
I've got a function: function (String, [JSON]) and returns a promise. How do I mock that out so I can control what parameters the promise will have in my tests?
 
Two options:
1. Re-compile chromium with your changes
2. Find out where in the compiled code that file's defined (probably resources.pak), change it at your own risk
 
8:29 PM
(Angular stuffs)
Recompiling the browser is the new recompiling the Kernel.
Wait, I may have figured it out.
 
@SomeKittens I talked about this in length with Jeff Cross (Angular team) it's not really easy.
 
// I hate myself right now.
var job = new cronJob({
  cronTime: '59 59 23 * * *',
  onTick: function() {
    return getDb(function (client) {
      return getDay().then(function(day) {
        return client.queryAsync('SELECT * FROM players WHERE dayid = $1', [ day.id ])
          .get('rows').then(function(rows) {
             var winner = rows[Math.floor(Math.random()*rows.length)];
             client.queryAsync('UPDATE TABLE days SET winner = $1 WHERE id = $2',
                [winner.id, day.id])
2
 
There are several alternatives (we discussed it in the context of Angular 2).
 
@rlemon ... ouch
 
If you're fine with not controlling the "When" you can do Promise.resolve
 
8:34 PM
@SomeKittens I'm rushing now
last night I decided to start moving a fish tank (at like 2pm) didn't finish until like 11
:?
was a bad time to do it, I thought it would take MAX like 4 hours to move it
 
@SomeKittens that looks about the best you can do at this time.
What's wrong with it?
 
5 mins ago, by SomeKittens
Wait, I may have figured it out.
 
I figured it out
 
8:36 PM
Oh, don't throw an error in a promise returning function - reject instead.
(In general)
 
Now, to figure out why I've got a leaking XHR call.
@BenjaminGruenbaum Um - example?
 
@SomeKittens BenjaminGruenbaum is afk: have to go
 
@SomeKittens don't throw new Error - instead return $q.reject(new Error(...))
 
So I should only throw when I'm returning a value?
There's no catch hooked up to this - I want the test to fail.
 
It's the zalgo thing, you can't expect everyone to try{ } catch(e){...} around your code and .catch both
You're testing with mocha and have new syntax, .reject will make the test fail too.
 
8:38 PM
@BenjaminGruenbaum Yep, that makes sense.
 
Hmmm, I want to find the first indexOf space/whitespace after a certain index. How?
 
So I can throw in my thens?
 
This hat should not to be here : winterbash2014.stackexchange.com/sumo-judge
5
 
@Buisson 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.
 
@SomeKittens yes, in Angular remember throwing also calls $exceptionHandler even in promises.
 
8:40 PM
@BenjaminGruenbaum Asking not just for Angular - also for NBE
 
Not sure what NBE is but generally throwing is the best idea.
 
@BenjaminGruenbaum Whoops, Node Blog Engine, one of my projects: github.com/SomeKittens/Node-Blog-Engine
 
ok... 12 days is up?
 
@rlemon BANZAI
 
I have no idea if the cron code will work
 
8:43 PM
Shoot - it's got a subdirective that's making the rouge XHR
boom, secret hat
 
user2620028
what is the whole hat thing i keep hearing about
 
madness
it should be right inline with your interests
 
you guys probably already saw this gem: stackoverflow.com/questions/27492683/…
 
12
A: How do you mock directives to enable unit testing of higher level directive?

SylvainThe clean way of mocking a directive is with $compileProvider beforeEach(module('plunker', function($compileProvider){ $compileProvider.directive('d1', function(){ var def = { priority: 100, terminal: true, restrict:'EAC', template:'<div class="mock">this is a mock<...

 
@tereško That's almost impressive
 
8:48 PM
TIL
 
@tereško interesting. I never would've thought of recursion for that.
 
@tereško It's like a Rube Goldberg machine
 
@ssube neither would anyone who got past the second grade (maybe 3rd in USA)
 
Noob question but if anyone feels like helping out -.-
http://stackoverflow.com/q/27492882/2407212
 
@tereško 3rd?
More like HS grads.
 
8:50 PM
 
We aren't taught recursion until college, and even then only us CS guys
 
Hey people
 
@JiFus 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.
 
last time I was in first grade, I got taught division with reminders and in 2nd grade we were taught to do calculations with numbers that have more then 2 digits
 
I got a weird problem.
 
8:53 PM
@tereško We didn't do multiplication until 3rd.
"Last time I was in first grade?"
 
I don't even know what grades are.
 
The problem is: if I use jquery (I bet some of you use it as well) to make this statement:if ( $("#test").val() != "1" || "2")
 
maybe I am exaggerating .. the memory isn't as it was
 
@JiFus equality doesn't work like that
 
so how do I say is not equal in javascript then?
 
8:54 PM
@phenomnomnominal it's the new jquery equality
 
I hate our application. Who thought it'd be a good idea to make each directive fetch it's own data?
 
that will always evaluate to truthy
 
Well actually it doesn't
when #test == 1, it will return to false, when #test == 2 it will return true for some reason
 
.. and value will be a string
so you are loosely comparing two strings
and then adding ` || "2"` to the result
 
Well it's like this:
I got 2 radio buttons.
one with value 1, one with value 2
 
8:57 PM
Read your code aloud: "run the following code IF the value of the element with the id test is NOT loosely equal to the string '1' OR the string '2' is truthy"
 
So I run this jquery code when I click a button
And I want to alert when someone hasn't filled in one of the two buttons
 
bottom line: THIS => if ( $("#test").val() != "1" || "2") doesn't do what you expect it to
 
So I thought: I do like this: $("input:radio[name=eersteVraag]:checked").val()
This takes the value of the checked radio button
 
There are two possible ways through your code: if val() is "1", then that statement evaluates to true. If val is not "1" then that statement evaluates to false, so it gives what comes after the ||, which is "2", which is truthy, so the block inside the if is evaluated.
 
.. this is why people shouldn't be using jquery till then can actually do programming without it
 
8:58 PM
I'm used to php
So that's why I messed up probably
 
that explains a lot
 
eh in fairness it wasn't a dom manipulation issue.
it was a pretty basic programming issue :P
 
yea i know
 
don't hate on the query
 
I messed up
 
8:59 PM
@JiFus haha we all do it
no big deal
 

« first day (1521 days earlier)      last day (3428 days later) »