« first day (1562 days earlier)      last day (3380 days later) » 

9:00 AM
@Jon Do you even read?
 
user4458396
isn't this javascript related?
 
user4458396
im new and i quickly went over the rules
 
Morning guys
 
Cause the maker of the elevator game, I've wasted so much time on that today
curse*
 
wow
you are completely different people
than I usually see in this chat
the others are inactive
 
9:07 AM
Curse in a good
friendly way. :)
I usually lurk on and off
mostly off
 
nice to meet you man
 
Hello and good morning to you as well
 
I usually come to chat with the people here because they are interesting, and most of all IT like me
usually not much JS going around, depends on the time :D
@jdphenix are you IT yourself?
more specifically a web programmer
 
I think the best fit for a description of my job is Tier 3 support in a telecom
hobbyist sure
 
is usually Telecom a 3 tiered or a 4 tiered
 
9:11 AM
Mine is definitely 4
 
I am not really good at support because I have never worked it but I have friends and I know that 4 goes mostly about incidents
and SLAs
 
Some times my job lends me some interesting puzzles to figure out but mostly
 
but I am not sure, maybe I'm completely wrong
 
"What's a GPS coordinate?"
/face /desk
 
ahahah
that's good man
people usually call and say "Hey, why isn't my Screen working?"
ahhaha
to be honest, I have done a bachelor which included CCNA and CCNP
but I haven't done anything with it for over 2 years already so it is kind of fading. I can still subnet though
but yeah, in general, if you are interested in what you do, there is always something new to read every week, even every day
What I actually came here to ask is, do you know in which sub-division of stack exchange
 
9:15 AM
There's a ton of stack exchange sites
 
yes
but I have a particular question in regards to job interview question which seems kind of strange to me
when I went on my first internship interview
they asked me if I am social since I am studying in a different country than my own
and that was for a programmers job
why would they ask that in your opinion?
I was wondering what might be the best stack site to post it and see the answers
 
Ah, great, thanks a bunch man. You seem really good at your job :D
Actually that was a tech support for free, thanks a lot. If I can help you in any way, just tell me!
 
Make Oklahoma warmer in the winter.
;)
 
Well, I can't really change the weather (otherwise I won't be chatting with people right now I guess). However, I can try something.
Just answer me the following question: Have you ever been to Spain or Portugal?
 
9:20 AM
No
 
Well Oklahoma is the same Longitude as South Sapin/Portugal which means it is closer to the equator than most of the European countries. That being said, you are quite to the South, I can't imagine how winter can be cold in any way in there.
I moved from a City which has the same longitude as Chicago to a new country and city which is northern than Quebec. (In the Netherlands) and people are still making joke how good the Canadians are with the cold :D
I can tell you winters with seeing the sun only once a month can be quite depressing
So enjoy your warm Oklahoman winter and if you feel cold, just put a T-shirt on :D
 
Sorry, that was a joke. I hope you did not get offended
 
Haha, I'll give you that summers get toasty, 100+ degrees and near 100% humidity is normal
Nah it's all good
 
What you could wish for is more moderate weather
Man, the city I was born in gets from 15F in the winter to 115F in the summer
So I get really pale in the winter and really tanned in the summer
btw you said you are a web hobbyist
are you good with JavaScript
btw wunderground.com is quite well structured
thank you for sharing
Oh man, it's quite late where you live, hey, sorry for disturbing you so late at night :D
Wow, sometimes I just never think where people live when I am in an international chat
 
9:35 AM
I consider myself knowledgeable enough in JavaScript to accomplish what I want
 
@jdphenix That's a good goal to have
 
well, I guess you can't know everything, and there is a lot of documentation and help out there for the thing you don't know, but I guess you have to learn at least the most used functions to be productive (if you want to work that and not get anxious while doing something)
 
JavaScript is quite different from what I'm used to, I'm most experienced in the strongly typed world of C#, specificially ASP.NET MVC
 
Ah, yes, but you still use JS for the views quite a lot if you want to make the page look more modern and interactive
 
@jdphenix I think that if you are sufficiently disciplined, the advantages of strong typing become less prominent.
 
9:39 AM
@SecondRikudo you seem experienced from what I've seen so far from you. Do you know any sites that provide content management in any way and lack AJAX which are famous?
 
first class function values sold me, forget the type system
 
Out of 100 bugs I get, maybe 1 would be related to type mixup.
@jdphenix Oh yeah, passing and returning functions is da bomb.
@jdphenix how good are you with C#?
@BenjaminGruenbaum is looking for good people (to hire, good stuff)
 
usually the mixup comes from floats from what I have experienced and seen from others
 
@ziGi How so?
 
sorry
I was thinking about floats and I wrote strings
 
9:43 AM
floats are a CSS thing
 
well summing them properly
 
It's not really related to JavaScript or the type system
 
well summing is
operations in general
don't you think, or am I wrong again?
 
@ziGi Example?
Summing an array for instance is relatively straightforward with reduce:
!!> [1, 2, 3].reduce(function(a, b) { return a + b; })
 
@SecondRikudo 6
 
9:45 AM
I didn't know about that.
 
This becomes even nicer with ES6 arrow function expressions
[1, 2, 3].reduce((a, b) => a+b)
 
!!> var foo = function() { return "Hello World!"; }
 
@jdphenix "SyntaxError: function statement requires a name"
@jdphenix "undefined"
 
@jdphenix About the bot or about .reduce?
 
hm cool
 
9:46 AM
The bot
 
I can give you simple example
console.log(0.1 + 0.2);
@jdphenix what would you expect to be the result of summing those two
 
@ziGi That is a limitation of being unable to represent floating point as fixed point numbers
 
Something close to 0.3, depends on floating point error
 
It's not JavaScript exclusive.
 
good
yes true
but I went working for a financial company, which uses PHP and JS for a system
and I have seen errors with floats in both
even when they do back-end validations
so the error is in both places
 
9:48 AM
@ziGi That is indeed a problem if you aren't careful and aren't aware.
 
and then the boss comes and asks the head software dev, hey we are missing 0.02 cents from here
I calculated it in Excel
 
A financial firm was using floats for money calculations recently?
err, rather ANY firm? o.O
 
yes people are still doing it
I am not joking
 
This is the part where I'm supposed to be surprised, but I"m not...
 
@jdphenix People still have SQL injection vulnerabilities in their code.
A lot of people
 
9:50 AM
true, true
 
So floating point errors? I'm not surprised.
@ziGi But the developers' incompetence should not be used to judge the language.
 
yes, you are right
 
That is indeed a limitation in JavaScript (and in pretty much any other language which uses floating points exclusively), you just need to be aware of it.
 
I was wrong here, I agree
well what would you suggest as a common error caused by the usage of a wrong type then?
 
@ziGi I don't like. Like I said, I don't have many of them.
 
9:52 AM
Sorry my English is terrible lately
 
Although arrays and array-like structures are where I'd put my money
document.querySelectorAll('span')
What does that return?
 
hm good question
I can't tell you with certainty
I know it is a list of nodes
but that's all
like every dom object which is a span
but they might be nested
 
@ziGi Many people mistakenly think it to be an array of DOM nodes
It's not.
 
I am one of them apparently :D
I know it is a list
 
!!> Array.isArray(document.querySelectorAll('span'))
 
9:55 AM
@SecondRikudo "ReferenceError: document is not defined"
 
of nodes
 
of course
Copy that into console
 
sure
it's going to be false
I know
 
So while you can access list[0], list.length, etc
It doesn't have array methods like list.map or list.forEach
 
yes
I do understand
I have worked with strongly typed languages so I usually pay attention to the types specified in the documentation
 
9:59 AM
!!> Array.isArray(Array.slice.call(document.querySelectorAll('span')))
 
@jdphenix "ReferenceError: document is not defined"
 
I clearly don't know how to use the bot.
 
@jdphenix The bot's JS REPL runs in isolation. No window and no document.
 
can you create on inside?
with createDocument()?
I can't try it because I have been prohibited from using the bot for a reason I cannot remember anymore
but it was not abuse in any case
!!>true
I still am
 
!!ban
 
10:09 AM
@SecondRikudo 895174 (?), 1355043 (?), 1858108 (?), 10 (?), 1005250 (?), 1941949 (?), 990192 (?), 2428683 (?), 1455016 (?), 2645256 (?), 2664200 (SpringLearner), 3350338 (?), 3106345 (?), 1800668 (?), 1593459 (?), 2509223 (?), 3586251 (?), 3517363 (?), 2959554 (?), 3141603 (?), 965090 (ziGi), 2249815 (BDillan), 91696 (?), 2272617 (?), 4155172 (?)
 
I wish the bot linked to the post where the ban was issued.
 
yes
I believe because I was obnoxious at some point during last summer, for which I apologized but never got removed from the list.
I will talk with lemon when he is here
 
!!unban ziGi
 
@SecondRikudo ziGi freed from mindjail!
 
Not required. Don't abuse please :)
 
10:11 AM
thank you kindly
 
10:38 AM
!!>0.2+0.2
 
@ziGi 0.4
 
10:57 AM
!!> this;
 
@jdphenix "undefined"
 
!!tell jdphenix sandbox
 
@jdphenix Please go and play in the Sandbox
 
Same for you ziGi ^
 
yes I did
 
10:58 AM
k ;)
 
Room for everything it seems, nice.
 
@SecondRikudo, can you make a document in the bot's REPL?
 
Don't think so
 
ok
 
11:21 AM
@SecondRikudo do you know whether there is some kind of a way to make a list of most used functions based on all the source code in GitHub in JavaScript or any other language for that matter
I remember, there was one statistic like that for coding styles
 
@BenjaminGruenbaum saw it, and feel it's a bit bullshit
 
I'd love to see a counter argument
 
Those are the worst slides I've ever seen
 
@BenjaminGruenbaum Y U POST LONG INTERESTING VIDEOS WHILE I'M AT WORK AND CAN'T WATCH?!
 
11:30 AM
isn't it Sunday?
 
@ziGi Welcome to Israel!
 
you work on Sunday?
do you have still 2 free days off?
every week
 
Friday and Saturday
 
I see, well I don't think it makes that much of a difference
do you have to avoid touching money on Saturday or is that only for Orthodox religious Israelis?
Also technology, etc?
 
Off topic in the room is fine but talking about religion for over a line or two bothers people here so I'm not going to answer that. There are plenty of places on the internet like wikipedia that explain this, I think.
 
11:42 AM
ok
thank you
I am sorry I cannot delete these lines
 
crl
earth.nullschool.net/#current/wind/surface/level/… is this wind map saying right for your location? for me it's a bit overestimating the wind
 
@crl Looks right, atleast for me
 
@crl Todo: Learn to read a wind map
 
crl
@SecondRikudo yes sorry my link was pointing in the sahara :))
 
@crl That wasn't the problem :P
 
11:55 AM
There was a link someone posted a couple of days ago, something they created with css3 and js, it was a rainbow tunnel, anyone have the link to that?
 
crl
@SecondRikudo well it's saying 16km/h of wind whereas there's almost no wind on the sea currently
 
@crl Again, not sure how to read this map to get the speed
 
crl
you click at your (latitude, longitude) then read the values
 
It reads 42 km/h for my location, which is more or less spot on
(I'm impressed that a web app like this plays nice with my phone)
And the baby is asleep, with that, goodnight :-)
 
12:25 PM
If somebody here can give invitations to lobste.rs, I'd be interested
 
hi ...
what does 'void 0' mean in javascript ?
 
undefined
 
@BenjaminGruenbaum how ? what is the role of 'void' in JS ?
 
void does what eval does except it discards the output.
 
so instead of 'eval(source)' i can write 'void source' ? right ?
 
12:31 PM
It's an odd keyword, the only use it actually has in modern JS is if you're not sure if someone redefined the name undefined in the scope (which no one ever does anyway) it is guaranteed to return undefined
Generally neither eval nor void are used in modern JavaScript.
 
@BenjaminGruenbaum ok , thank you :)
 
void is a relic from older times, and void 0 is a hack for getting undefined :)
yw.
@dystroy what is it?
looks like yc
 
@BenjaminGruenbaum It doesn't seem to run any code.
 
@ThiefMaster oh yeah, I remember something like that - maybe it used to run it like eval and now it doesn't.... to be fair I don't really remember very well. Lemme check
Oh yeah you're right, it just runs the code it doesn't eval it
 
@BenjaminGruenbaum yet bluebird is full of void 0 :P
 
12:36 PM
@FlorianMargaine not anymore.
 
Petka finally came to his senses :D
 
!!> [1,2,3].sort(Math.max.bind(Math));
 
@darkyen00 [3,2,1]
 
!!> [1,2,3].sort(Math.min.bind(Math));
 
12:37 PM
Lol
 
@darkyen00 [3,2,1]
 
@darkyen00 why the bind?
 
It took me 2 whole minutes to realize why that happened.
 
@darkyen00 Bind is not required with Math functions IIRC
 
@SecondRikudo I didn't knew that :D
 
12:38 PM
!!> [1,2,3].sort(Math.max)
 
@SecondRikudo [3,2,1]
 
it won't work though :-x
shortest way to sort ascending ?
!!> [1,3,2].sort(Math.max);
 
sort and reverse?
 
@darkyen00 [2,3,1]
 
@BenjaminGruenbaum hmm
must be a shorter golfy way :-/
 
12:40 PM
Yeah, Math.max returns the largest element - not a comparator.
 
yeap.
Realized that about 2 minutes later
 
@BenjaminGruenbaum It kind of bothers me that .reverse() operates on the original rather than returning a new one
 
@SecondRikudo it's just old.
 
@darkyen00 why golf it though? Is it literally a code golf exercise?
 
12:41 PM
@darkyen00 i don't get is , can you explain ?
 
yes Benji, my initial idea was .slice().sort().reverse()
 
(is == it) typo
 
@darkyen00 not my field then :D
 
12:44 PM
First time in life i am doing a job that i really love the every bit :D
 
Hello!!! Could I ask you something about an AVL-tree?
 
@evinda You could try.
 
@SecondRikudo Suppose that we have this AVL-tree :http://i.stack.imgur.com/hjyC4.png and we want to delete the node with key 19. I did and got this: http://i.stack.imgur.com/9BqNb.png
Then I deleted the node with key 4 and I got this: http://i.stack.imgur.com/cOYzn.png
Finally, I deleted the node with key 56 and I got this: http://i.stack.imgur.com/Kg9Ex.png
Could you tell me if my results are right?
 
You should really read Corman, it really explains all these - you always come here asking algo 101 questions.
AVL trees are just four rotations, you can implement them in a 100 LoC JS file and test for yourself.
 
12:58 PM
@BenjaminGruenbaum I bet with a little more than that one can even implement a visualization of that using DOM nodes
 
gist: Javascript AVL Tree, 2012-04-19 20:52:06Z
// AVLTree ///////////////////////////////////////////////////////////////////
//   This file is originally from the Concentré XML project (version 0.2.1)
//   Licensed under GPL and LGPL
//
//   Modified by Jeremy Stephens.

// Pass in the attribute you want to use for comparing
function AVLTree(n, attr) {
    this.init(n, attr);
}

AVLTree.prototype.init = function(n, attr) {
    this.attr = attr;
    this.left = null;
    this.right = null;
    this.node = n;
    this.depth = 1;
    this.elements = [n];
};

AVLTree.prototype.balance = function() {
    var ldepth = this.left  == null ? 0 : this.left.depth;
    var rdepth = this.right == null ? 0 : this.right.depth;

    if (ldepth > rdepth + 1) {
        // LR or LL rotation
        var lldepth = this.left.left  == null ? 0 : this.left.left.depth;
        var lrdepth = this.left.right == null ? 0 : this.left.right.depth;

        if (lldepth < lrdepth) {
            // LR rotation consists of a RR rotation of the left child
            this.left.rotateRR();
            // plus a LL rotation of this node, which happens anyway
        }
        this.rotateLL();
    } else if (ldepth + 1 < rdepth) {
        // RR or RL rorarion
        var rrdepth = this.right.right == null ? 0 : this.right.right.depth;
        var rldepth = this.right.left  == null ? 0 : this.right.left.depth;

        if (rldepth > rrdepth) {
            // RR rotation consists of a LL rotation of the right child
            this.right.rotateLL();
            // plus a RR rotation of this node, which happens anyway
        }
        this.rotateRR();
    }
};

AVLTree.prototype.rotateLL = function() {
    // the left side is too long => rotate from the left (_not_ leftwards)
    var nodeBefore = this.node;
    var elementsBefore = this.elements;
    var rightBefore = this.right;
    this.node = this.left.node;
    this.elements = this.left.elements;
    this.right = this.left;
    this.left = this.left.left;
    this.right.left = this.right.right;
    this.right.right = rightBefore;
    this.right.node = nodeBefore;
    this.right.elements = elementsBefore;
    this.right.updateInNewLocation();
    this.updateInNewLocation();
};

AVLTree.prototype.rotateRR = function() {
    // the right side is too long => rotate from the right (_not_ rightwards)
    var nodeBefore = this.node;
    var elementsBefore = this.elements;
    var leftBefore = this.left;
    this.node = this.right.node;
    this.elements = this.right.elements;
    this.left = this.right;
    this.right = this.right.right;
    this.left.right = this.left.left;
    this.left.left = leftBefore;
    this.left.node = nodeBefore;
    this.left.elements = elementsBefore;
    this.left.updateInNewLocation();
    this.updateInNewLocation();
};

AVLTree.prototype.updateInNewLocation = function() {
    this.getDepthFromChildren();
};

AVLTree.prototype.getDepthFromChildren = function() {
    this.depth = this.node == null ? 0 : 1;
    if (this.left != null) {
        this.depth = this.left.depth + 1;
    }
    if (this.right != null && this.depth <= this.right.depth) {
        this.depth = this.right.depth + 1;
    }
};

AVLTree.prototype.compare = function(n1, n2) {
    v1 = n1[this.attr];
    v2 = n2[this.attr];
    if (v1 == v2) {
        return 0;
    }
    if (v1 < v2) {
        return -1;
    }
    return 1;
};

AVLTree.prototype.add = function(n)  {
    var o = this.compare(n, this.node);
    if (o == 0) {
        this.elements.push(n);
        return false;
    }

    var ret = false;
    if (o == -1) {
        if (this.left == null) {
            this.left = new AVLTree(n, this.attr);
            ret = true;
        } else {
            ret = this.left.add(n);
            if (ret) {
                this.balance();
            }
        }
    } else if (o == 1) {
        if (this.right == null) {
            this.right = new AVLTree(n, this.attr);
            ret = true;
        } else {
            ret = this.right.add(n);
            if (ret) {
                this.balance();
            }
        }
    }

    if (ret) {
        this.getDepthFromChildren();
    }
    return ret;
};

// Given the beginning of a value, return the elements if there's a match
AVLTree.prototype.findBest = function(value) {
    var substr = this.node[this.attr].substr(0, value.length).toLowerCase();
    var value = value.toLowerCase();

    if (value < substr) {
      if (this.left != null) {
        return this.left.findBest(value);
      }
      return [];
    }
    else if (value > substr) {
      if (this.right != null) {
        return this.right.findBest(value);
      }
      return [];
    }
    return this.elements;
}
 
1:11 PM
@BenjaminGruenbaum literally one of the best books ever
on algorithms
except for I grew a beard while reading it :-/
 
Yes, and I always realise I spell his name incorrectly just a second after the 2 minute span has passed
 
Haha
@BenjaminGruenbaum Like I realize their and there :-(
Is there an alternate finder for Mac that makes its finder less dumb ?
 
Don't sort, search
 
Does anyone have some time to check the GitHub repo of my Socket.IO+Node.js chat? If so, github.com/gtomitsuka/montreus-chat
 
HAHAHA
 
1:24 PM
@GabrielTomitsuka Much ifs
You probably want to make a map
Also indenting and the such
 
my eyes
 
You should probably post it on Code Review
 
@SecondRikudo i guess its his ide
 
@darkyen00 Or lack thereof...
 
1:25 PM
</sarcasm>
@GabrielTomitsuka never do this
            var messageToBeSent = '<p class="alignLeft"> Chat bot: ' + finalMessage + '</p><p class="alignRight">' + messageDate + '</p>';
 
@darkyen00 Solution?
 
use a template engine ?
 
I shouldn't allow Chat bots, you mean?
 
perhaps don't send html output to the client
 
@darkyen00 Now I do
 
1:27 PM
@GabrielTomitsuka Send a JSON object to the client, and have the client create the DOM.
This saves you the need to do server-side HTML escaping too.
 
The version on GitHub was updated yesterday - so EJS is not there yet
@SecondRikudo Ok. Thanks.
Of course.
 
@GabrielTomitsuka like I said, you're better off asking a question on Code Review
You'll get a much more thorough review there
 
Responsive design matters too.
 
@GabrielTomitsuka Has nothing to do with the server though.
 
1:52 PM
Guys can you recommend me any good wordpress security plugin? My website recently got hacked on wordpress and I am really worried about it because I didn't add any uploading or signup kind of thing in the website but it got compromised anyway...
 
disable all plugins and update to the latest version.
 
in HTML / CSS / WebDesign, 1 min ago, by Second Rikudo
@user3027531 https://wordpress.org/plugins/uninstall/
 
user3949359
I am hiding an element on page init right after the ready handler. However, it flashes for a brief moment before the scitp kicks in
 
user3949359
How do I avoid this?
 
2:18 PM
Use CSS !
 
0
Q: Assignment a function to an element in javascipt

Jiew WeiIm new to javascript, i wan to assign the function to the button, is there any way? Im using notepadd++ to code Below are part of the javascript: Javascript Coding //Button var btn1= document.createElement("BUTTON"); var t1 = document.createTextNode(questions[0].A); btn1.appendC...

wow the w3schools click listener examples are terrible
> object.onclick=function(){myScript};
> <button onclick="getElementById('demo').innerHTML=Date()">What is the time?</button>
lolwut?!
 
2:51 PM
lol
 
posted on January 25, 2015

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} The secret kangaroo penguin club meeting went really well. I couldn'

 
3:20 PM
Lo all - is there a consensus on whether it's nicer to use a literal to access an Array's prototype's methods (for the brevity) or to explicitly spell it out (for the performance gain?) - I imagine the speed benefits are negligible
 
3:41 PM
@IanClark The speed benefits are negligible.
The answer is, whichever the project uses currently
 
@SecondRikudo yeh figured that might be the case
 
Definitely not
Unless the code becomes clearer that way
 
And if the project doesn't use any right now, pick the one that reads better.
I personally don't like using Anything.prototype for anything other than setting it.
 
It is cumbersome to write out
Hmmmm, undecided
 
sigh
!![] or Array.prototype?
 
3:46 PM
@SecondRikudo []
 
There you go @IanClark
 
Hah - so Caprica is the deciding factor :P
 
@IanClark Just remember, when you're interviewed in all the top magazines, and they ask you "How did you know that Array.prototype contains a fatal flaw that causes the user's computer to jump and kill him?", remember what made you take that call.
 
@SecondRikudo hah, as good a reason as any :D - ty for the input though, just wanted to confirm with other JS peeps if there was a best practice
 

« first day (1562 days earlier)      last day (3380 days later) »