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

2:04 PM
@Srle I suppose it depends on how you intend to use it
 
@Neil, basically for every element in array, i need to emit via socket to all clients just ONE number every M seconds (where M is some random number greater than 1 second) till end of array
 
Not a very traditional stream
 
this is my example without using streams

http://codereview.stackexchange.com/questions/73619/web-socket-server-which-needs-to-query-some-api-and-to-pass-chunk-per-chunk-of-d
 
I would make an object with the socket instance and client id that internally keeps track of the current index
After timeout defined by a random number generated, send out another signal
I see you're using socket.io, that's good :)
I'm familiar with that
When user connects, created a new instance of this object passing everything it needs to do as you require (number from array every M seconds)
 
i don't see on which way here stream would improve the code
 
2:42 PM
Where is my hat?
 
@Najera 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.
 
user2620028
@Najera You lost it and now you wish to purchase a new one.
 
off the top of your head, would anyone know which is faster? foo in bar vs bar.hasOwnProperty(foo)?
 
I'd say hasOwnProperty
 
alright
 
2:49 PM
Hehe, I have a 5-hat-lead on the Stack Overflow leaderboards xD
 
@Cerbrus Congrats
You might be the only one who cares enough to maintain it :p
 
Possibly xD
 
and wait, you have an android phone and an iphone?
 
At least I can say I'm the only person in the world at this moment, that has the Aztec hat :P
iPhone and android emulator
 
you're crazy
 
2:52 PM
Only a little
 
aren't we all?
 
Besides, the android emu is really a piece of cake to get to work... Bluestacks.
 
Otherwise, what are we doing spending time discussing intangible code in a virtual world?
 
Does (Chrome) DevTools allow defining custom, persistent, Console-only helper functions?
 
Depends on what you mean by persistent
 
2:54 PM
You can add Snippets
But they aren't console-only, nor do they run automatically
 
@copy Well, fully persistent. Still available after browser restart.
 
Using an extension maybe
 
Does the console have an isolated scope from the rest of the page?
 
yes and now
 
Nope
@FlorianMargaine How do they have an isolated scope?
 
2:56 PM
it's in an isolated scope, but it runs eval in the scope of the page for the code you type in it... so in practice, nope
 
Ah
 
@ssube Well, Console provides $0, $_ and other bindings so there’s definitely a separate environment going on there.
 
@FlorianMargaine So it's literally a scope, but not isolated from the page?
 
(I just want to add my own $foo stuff in there.)
 
@ŠimeVidas You might want to talk to @Zirak. He's messed with the internals of the console a lot
 
2:58 PM
actually, my bad
it's not an isolated scope
with (__commandLineAPI || { __proto__: null }) {
throw new Error('hi')
}
(run throw new Error('hi'); in your console, the link will lead you to that)
 
do ... end is the same thing as { } in ruby?
 
can anyone recommend a good drag'n'drop library ?
preferably - without jquery
 
@tereško browser support?
 
Hello @all
 
@tereško interactjs.io
If you don't mind the size.. it is a little meaty for a drag n' drop library maybe
 
TIL Chrome was failing to use an onclick on a select input.. had to change structure using <select onChange=myfunction(this.value> ...
 
hello
 
@user3470815 Don't use the on* attributes, if you can help it. Better of binding to the events in JS.
 
@rlemon I converted my jQuery HTML constructor to regular javascript, and I think it puts your FragBuilder to shame now. github.com/ndugger/html-builder
 
3:12 PM
@Neil use sandbox.
 
@NickDugger window.HTML seems like a questionable name.
 
@FlorianMargaine For what?
 
@ssube Which is why I added the check, but I don't disagree... I was thinking of changing it to HtmlBuilder
 
@Neil the stars thingie they're talking about
 
@ssube I have this and its working , what do you mean with binding the events? <select onChange="myfunction(this.value,this.value)">
<option value="10" >10x10</option>
<option value="15" >15x15</option>
<option value="20" >20x20</option>
<option value="cus" >Custom</option>
</select>
 
3:14 PM
@FlorianMargaine I doubt if my stars are going to reduce the clutter at all
 
@BenjaminGruenbaum :)
SE tricks
 
Hmm, rlemon's handles textNodes, but mine does not...
 
nodeName
instead of tagName?
 
tagName doesn't exist
 
wat
yes it does
 
3:17 PM
it does?
 
weird
I've always used nodeName
 
tagName does exists but i normaly use ids
 
what do id's have to do with tagName?
 
@ssube you mean addListeners?
 
3:20 PM
@user3470815 addEventListener yes.
 
@Second yeah thats what i meant
 
@NickDugger document.createElement, creates Elements, not Nodes
 
@user3470815 yeah. It's generally cleaner to use that than the attributes, so as not to mix markup and script.
 
yes... I know. why are you telling me this?
 
Hmm, rlemon's handles textNodes, but mine does not...
 
3:21 PM
I just fixed mine to handle textNodes as well
 
ah, sorry...
So...
i had a question...
about Constructors...
 
@ssube thx
 
and using "var" keyword in them
and why I never see anybody do it
... ???
 
vars are local to where you are declaring them
 
@Terry var in constructors?
 
3:24 PM
@Terry Uhm..? They will use it if necessary.
 
what do you see instead?
 
Because they'd be local to the constructor, and won't be propagated to the rest of the object
 
function Constructor () {
 
he probably means that people use this.prop = val;
 
blah
@FlorianMargaine, correct
how do i newline?
 
3:25 PM
he means function Constructor() vs var Constructor = function()
or not
I dunno
 
@NickDugger nope :P
 
myVar = 'value' <==> window.myVar = 'value'
 
ok, shift + enter
 
function Foo() {
    this.bar = 'baz';
}

function Foo() {
    var bar = 'baz';
}
what's the difference between these two, right?
 
function Constructor () {
var thing;
}
never see it
 
3:26 PM
Morning everyone.
 
because javascript doesn't work like java
it's closer to php on this matter
 
it works, I just never see anyone do it
 
@Terry It does an entirely different thing.
 
I know, this.prop is property of new Constructor instance
 
In function Constructor() { this.thing = 2; } Constructor.getThing = function () { return this.thing; }, what will you get?
vs function Constructor() { var thing = 2; } Constructor.getThing = function () { return thing; }
the latter will be all kinds of undefined
 
3:28 PM
which can be usefull
 
++1 @ssube
 
and that's why I'm asking why i never see it happen?
 
How could that be useful?
 
@Terry If you want a variable that is entirely local to the ctor, then yes, and that happens occasionally but is rarely useful (you don't want to do much processing in a ctor, it's not meant for that).
 
Hey folks
 
3:29 PM
If the ctor does work, copies become expensive, you can throw during new, and other bad things.
 
Welcome @PeeHaa Master :D
 
Guys, can haz votes for hat kthxbye stackoverflow.com/a/10868373/871050
 
On the occasions where doing work to produce the object is necessary, you should have a factory function (Class.create = function () {) to put the object together.
 
@SecondRikudo: Vote limit :-/
 
3:30 PM
Hello
javascript = java
 
jQuery = C++
 
and air = oxygen
 
lol
 
Congratulations on assigning things.
 
javascript = java
 
3:32 PM
haha... i am programmer in C#-Objective-Java.Net-Sharepoint.
 
I need a small / tiny animation library which I can use to move two elements with easing. It should be as easy as jquery's ui animate()
Oh right it's :)
 
\o/ Thanks
@PeeHaa CSS
 
@PeeHaa animate() is jquery, not jquery ui
 
@SecondRikudo Need to support IE8+
 
and if you support IE8, you already have jquery
 
3:33 PM
@FlorianMargaine The easing shit is or am I wrong?
 
@FlorianMargaine I don't get that one :)
 
IIRC It's reasonable.
 
@FlorianMargaine I cannot use native. IE10+ needed
 
jquery animations make my brain bleed
 
3:34 PM
@tereško the only missing method is too much?
 
oh .. hmm
I somehow saw "2.02% implemented" there
instead of global usage
< approaching braindead state
 
jquery is too big for me to use :(
 
if jQuery is too big for you, most other libraries will probably be too big for you as well
 
@PeeHaa npmjs.com/package/fxjs is the one I was looking for
 
@FlorianMargaine I understand... but "var" can be useful too... jsfiddle.net/v6c1tk8n
 
3:40 PM
how is that useful?
it's undefined
 
i dont understand @Terry im with @NickDugger ^
 
@Terry bar is completely worthless there. If you were to use it later in the ctor, it could have some value, but it doesn't.
 
ill set something up...
 
also github.com/relay/anim looks similiar to JQ animations
/me goes to meeting
 
@Loktar Shitty Shifty looks like exactly what I need \o/
<3
 
user2620028
3:45 PM
@PeeHaa a little different but up to you to see if it could fit the bill. I have used animate.css quite a bit and like it
 
Will look ty
 
I added nodeName support to my html builder
I figured the low effort was worth the case
 
user2620028
you made an html builder?
 
I converted my jQuery one into regular javascript
 
@HatterisMad cool that animate.css
 
3:48 PM
same number of lines for both lol
 
user2620028
@user3470815 yeah the guy that made it i am sure put some blood sweat and tears into it
 
user2620028
@NickDugger admission of too much time on your hands? :P
 
i forgot to update fork last time... jsfiddle.net/v6c1tk8n/1
 
Nah, I actually do use my jQuery html builder at work, but I wanted to convert it to regular JS for a while now.
it only took like 20 minutes
 
user2620028
oh gotcha
 
user2620028
3:50 PM
I like how whenever i converted my JQuery code to javascript as a challenge from rlemon i learned like 30 different things i didn't know native js was capable of doing
 
native js is the bees knees
 
I've always felt that I have far more control over my code when I don't use jQuery
 
user2620028
And i haven't written a single line of jquery since. (Not that i have anything against it, just a daily challenge to learn the native way to do it)
 
not sure if you want feedback on the UX, but I didn't really like having to click to get to more content. As for content:
- The "The solution - VCS!" slide needs more content. Maybe a brief (and simplified) overview of what that is.
- "Git is currently probably the most popular" currently probably <-- weirdly worded
 
Screw this whole thing. My car won't start, so no Google for me.
 
3:51 PM
posted on December 15, 2014

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) {} OH GOD IT'S MOVING DAY AAAHAHAAAAA

 
@SomeKittens check the sparkplugs
or battery
 
@NickDugger @user3470815 @ssube did u see the fiddle? I didnt update the last fork lol jsfiddle.net/v6c1tk8n/1
 
That's not generally how I would do that
 
@CarrieKendall Arrows
 
I understand, i never see it happen and I've been trying to figure out why
 
3:54 PM
@Terry You shouldn't do that in the ctor.
It's too much work, it should be in its own method.
 
@CarrieKendall I get what you mean about the slide and the wording. Will have a look and see what can be added.
Thanks
 
I wouldnt do that inside the const ^beat me ^
 
@user3470815 A) get a real name and B) it's more complicated than that
 
xD give more info @SomeKittens
 
3:55 PM
that's not very noticeable. maybe add a legend or something similar?
i think i would like it better if you could zoom out and see an overview of the content
 
check the maf also
 
anim it is Thanks @Loktar
 
@ssube why is it too much work? This is what I don't get... i never see anyone do it but it works...
it's not the best example...
 
@Terry You don't do work in constructors.
 
3:58 PM
np @PeeHaa
 
@Terry Use the prototype in your advantage
 
Unless it is a defining part of creating the object, you just don't do it. It introduces way too many opportunities for really hard to debug errors.
 
Think about it this way:
 
Specifically because you don't necessarily know when the ctor will get called.
 
@user3470815 no, you're some ignorant nobody on the internet who probably defragments their hard drive to avoid viruses
 
3:59 PM
function Foo() {
    this.bar = function() { ... }
}
Every time an object is constructed, the this.bar method will be defined again on that object
 
yep
 
The result is many objects with different but identical this.bar methods.
The .bar method on every object will be functionally the same, but it's a different method on every object.
On the other hand:
function Foo() {}
Foo.prototype.bar = function() { ... }
 
I think it comes down to, constructors are for constructing. You want it to do something? Add a method in the constructor's prototype, and call the method.
 
This method is defined once, and is automatically inherited on all objects which are created with new Foo.
 
I understand
 
4:01 PM
@SomeKittens so you got mad at me for telling you to check the sparks /battery /maf?
 
@Terry If you need something that is shared across all objects, use the prototype.
 
function Foo() {
    this.init();
}
Foo.prototype.init = function() { ... };
 
Use this.x = ?? for state, something that will change per object, and should not be shared with all other objects of the same type.
 
What, you think I don't know the first thing about my car?
 
@SomeKittens i never said that... I just told you what it maybe could be.. with no info whatsoever given about what youve already tried
 
4:04 PM
@NickDugger That's not much better than doing the work in the constructor...
 
I'd argue that it's at least cleaner, but sure
 
@NickDugger The thing is that you shouldn't do work at all in the constructor.
Constructor is only about constructing the object, making sure everything it needs to do its job is in place
 
It used to be a practical problem, in languages with copy constructors and the like.
 
The rest should be called externally by a different layer.
 
If you did work in the ctor, it could throw anywhere later down the line when you were least expecting it.
Regardless, it's good practice when writing OO code to keep methods as small and single-purpose as possible, and the ctor's predefined purpose is to set up the object.
Any real work you need to do should be called by the client later (or scheduled as a timeout, if necessary).
 
user2620028
4:07 PM
@user3470815 To be honest user, that is kind of like saying to someone who is choking, hey have you tried clearing your throat?
 
@HatterisMad ok, give more info so i can maybe help¿
 
user2620028
Well that would be his information to give, not mine. And he didn't ask for help. Normally i am all for speculating to try and help fix something but maybe you came on a little strong :P
 
@HatterisMad so I should be sorry for trying to help?
 
@ssube I understand your mindset, I have a similar view on the topic, there's reasons for conventions and and best practices... but lately I don't know, I've been conflicted... JS is such a expressive language, I'm starting to think why not bend the rules>
The performance inst that bad... jsfiddle.net/v6c1tk8n/2
 
Because once your project is 50k lines of code, you start regretting bending the rules
 
4:12 PM
@Terry i dont think it would be a good idea to try to re-invent the wheel
 
@copy I'd say 5k, or the day someone else tries to build it, or anyone uses it, or you set up an automated build.
 
@copy that starts with just 15-25 lines, actually.
 
@Terry Because then you end up with a mess, and it's no good to you or anyone else. Most conventions exist because they solve a practical problem.
Just because a language allows you to write messy code doesn't mean you should (only if the language requires it, like PHP).
3
 
@Cerbrus you don't have the selfie hat?
 
@ssube oh php... I'm not trying to argue. Was looking for a "why not" reason and I got it. Thank you, and to everyone else.
 
4:17 PM
Anybody got resource on yacc ?
my college fucked us up bad --- real bad.
 
@ssube Bitch please. Everybody knows that PHP is great and does all the things :)
 
@darkyen00 story time again, I guess
 
@PeeHaa yeah, but only the PHP devs know the truth :p
 
:D
 
@darkyen00 Does it need to be yacc? I think bison is the more modern equivalent.
 
4:20 PM
PHP devs used to know the truth, but the documentation was missing so they ended up deprecating it, and now there's an object-oriented odITruth module.
 
bison is backwards compatible with yacc isn't it?
 
@FlorianMargaine nah they wrote programs in c
today is when they realize : they were supposed to be using yacc.
no story, just blunt google search and copy paste :-(
@Retsam yes
 
ama crab ama crab ama crab
 
@FlorianMargaine: Nope
It seems the requirements are relatively strict
 
4:27 PM
@Sippy cooks you, eats you ... damn you were delicious.
 
@Cerbrus dude you are playing well man! Network wide lead :O
 
Ikr
 
@darkyen00 Sippy uses Claw! It's super effective! Abhishek fainted.
 
@HatterisMad exactly. I didn't come in here for car repair help
 
I just need to think of a question I can answer here...
 
4:29 PM
@Cerbrus uh? you must ask a question, and check the little box that lets you answer your own question
 
I did on meta, didn't get the hat
 
@SomeKittens So i should shootmyself for trying to help someone who didnt want help but mentioned he had a problem with the car... It has sense
 
I answered a old question of myself, didn't get the hat
 
*it makes sense
 
I don't think winterbash works on meta
and you need to ask the question during winterbash too me thinks
 
4:31 PM
Yea
 
that was my winterbash question/answer 2 years ago :D stackoverflow.com/questions/13957354/…
 
So I just need to think of a question I can answer.
 
I had 30 hats that year ._.
 
@user3470815 it seems like you don't have many friends - have you tried empathizing with people?
 
@SomeKittens Xd im not going to continue this conversation i find it ridiculous..
 
4:32 PM
do a jig
 
@user3470815 oh, I was just trying to help - you exhibited a lack of personal skills, so I suggested a remedy.
 
@SomeKittens it was a bit abrasive, though.
 
@Cerbrus do you have any open source stuff you're proud of?
 
Ehm, my miaou bot is pretty okay
 
4:36 PM
Yeap...
 
Yay the hats are back!
 
CRABHAT
 
@Cerbrus for the record, you can do that right after this
 
user2620028
What about hats
 
Heh, that's actually code inspired by either Caprica's source, or miaouw sourcecode :P
 
4:39 PM
s/inspired/copypasted/
got it
 
Copied, stripped, but yea
 
not sure why taking your clothes off was a part of the process
 
I write better code when naked.
s/write/steal
 
user2620028
I was told it was a required part of any programming process O.o
 
@HatterisMad Yeah, every interview I've ever had.
true story
 
user2620028
4:48 PM
@KendallFrey Sign me up for those interviews
 
@HatterisMad It is, along with ballmer's peak.
If you really want a job, you show up naked and drunk. They'll be impressed by your ability to code, and give you whatever you ask for.
 
user2620028
@ssube that i can't do. Drinking of any kind leads to me falling asleep on the bathroom floor only waking up occasionally to puke.
 
You must be parched
 
@HatterisMad That's easy to fix, you just need to do some strength training.
 
user2620028
4:51 PM
Can't tell if you guys are being serious or kidding :/
 
I used to be awful at drinking, but after living near the U for a few months and going to parties all the time, I became much better.
 
user2620028
@ssube i prefer drinking wine..... tastes good and i can drink a whole damn bottle and not end up on the floor.
 
user2620028
Sake is also fantastic
 
ew. I only know a few lady friends who drink wine (the ones who are too classy for flavored vodka).
Get a bottle of whiskey, some bitters, and some vermouth and start drinking.
 
user2620028
4:56 PM
@ssube flavored vodka will get me pretty quick too :) Rum or whiskey isnt tooo mean to me
 
That's because flavored vodka exists purely to get white girls wasted.
 
I heard that sugar is a catalyst for alcohol
 
user2620028
i know that monster energy drink is! lol
 
user2620028
monster energy drink + vodka = ..... well drunk lol
 
Don't mix caffeine and alcohol, unless it's rum and coke or something like that.
 
user2620028
4:58 PM
had a rum and coke the other night
 
@ssube Don't ever intend to try..
Must be hell to (try to) fall asleep like that
 
user2620028
@Neil its fantastic for falling asleep. Drink a little bit and then pick where you want to wake up at.
 
@HatterisMad Drinking makes you sleepy but it doesn't help you sleep
 
@Neil You can do worse than caffeine for that...
 
If anything it knocks you out, but it won't make you sleep
 

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