« first day (1566 days earlier)      last day (3397 days later) » 

4:00 PM
naughty, shouldn't be using the web browser on a server! :P
 
Totally gonna use it
 
@SterlingArcher Allahu Akbar! pop
 
They loved it
This is what seth rogan must feel like
 
lol
 
Is [].forEach.call better or worse than Array.prototype.forEach.call? I imagine the latter is just barely faster, since it doesn't have to declare/allocate an array (that probably ends up on the stack anyway)
 
4:06 PM
use for..of
 
Same thing, just alias'd
.. or is it
I know it's much slower than a traditional loop but it's safer
 
@SterlingArcher I imagine that depends on whether anything gets inlined
 
@ssube doesn't really matter tbh... I usually use something like function forEach(arr, fn) { return Array.prototype.forEach.call(arr, fn); } so that it's abstracted away.
 
@FlorianMargaine I like that
That's a good function
 
for es6, just use for..of
for everything
array, nodelists, etc etc
for (let el of arr) {
    // foo
}
 
4:10 PM
that relies on the tremendous stretch that you can use es6 features
 
6to5 :P
also, I can't read anything you guys are saying. My cat is right on the screen.
 
6to5 in prod?
 
alright, gone.
@ssube yeah, what's wrong?
github.com/Ralt/erinome uses browserify + 6to5
 
@rlemon I used the cafepress giftcard and got this
And a pair of boxers because 20% coupon :3 Thanks again man!
 
@FlorianMargaine Why would you have cat in a screen?
 
4:12 PM
ahahaha nice
 
@KendallFrey I said "on"
 
@KendallFrey to print out a file, even if you lose network
 
as in, hiding the screen.
 
Laugh at my jokes, dammit
 
Linux is so much easier for servers than windows.
Deploying to anything other than PaaS on windows is so bad :D
 
4:14 PM
Is the arrow operator more expensive than function(...) once ES settles in browsers (e.g. how .bind is more expensive)?
 
@KendallFrey oh sorry... didn't see the backticks
 
@BenjaminGruenbaum that's cause windows servers come with a GUI, which is very silly
 
@ssube not necessarily
 
@RoelvanUden bind is only more expensive because it wasn't optimized. There is nothing inherently slow about it.
 
@RoelvanUden I hope it will be less expensive (not having to create a scope). What could happen is a greater burden for all functions, though
 
4:14 PM
@FlorianMargaine how do you install windows server without the desktop? Never seen an option for that.
 
How do i get a specific value out of a cookie with socket.io?
 
@MarcRasmussen client.request.headers.cookie
 
Is that on my server side?
 
yes
 
4:16 PM
Great start for a question :
> Yesterday my application was working just fine
 
@FlorianMargaine yeah, that's what it says. That's super useful.
I don't suppose they managed to add an SSH server to go with it?
 
hey, it's windows.
 
 @rlemon So this should work:

    console.log(client.request.headers.cookie);
 
try it
 
@dystroy to be fair that's happened to me before. It compiles tonight, and tomorrow morning it throws some compile exception
 
4:17 PM
@SterlingArcher Yeah, but you don't go asking people without more details, do you ?
 
I can live with RDP if the server is no longer running a huge desktop stack (taking memory and adding bugs).
 
i get an error
 
Not usually
 
/var/www/system_learningbank/server/server.js:14
console.log(client.request.headers.cookie);
 
0
Q: Cannot find module escape-html in node.js

Jessica ThedocYesterday my application was working just fine, I cant find anything about it online, could someone help me? I don't even know what this module does.

 
4:18 PM
@MarcRasmussen and.. what is the error :P
 
ReferenceError: client is not defined
at Namespace.<anonymous> (/var/www/system_learningbank/server/server.js:14:17)
at Namespace.EventEmitter.emit (events.js:95:17)
at Namespace.emit (/var/www/system_learningbank/server/node_modules/socket.io/lib/namespace.js:205:10)
at /var/www/system_learningbank/server/node_modules/socket.io/lib/namespace.js:172:14
at process._tickCallback (node.js:415:13)
 
@dystroy @BenjaminGruenbaum Hi again. I found the correct question of the exercise: Order the array this way: negative numbers at the start, positive ones at the end and the 0 ones at the middle, with one iteration. That's sounds possible. E.g. [4, 5, 0, -3, 0] -> [-3, 0, 0, 4, 5] (----0000+++)
 
@dystroy oh ffs
 
my server looks like this
    var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

io.on('connection', function(socket){
    console.log('a user connected');
    console.log(client.request.headers.cookie);
    socket.on('disconnect', function(){
        io.emit('goodbye', 'Another user has disconnected');
    });

    socket.on('chat message', function(msg){
        io.emit('chat message', msg);
    });

});
http.listen(3000, function(){
    console.log('listening on *:3000');
 
because you never defined client ;) hint, you should change client to the object you already have for the clients socket
 
4:20 PM
^ wham bam thank you ma'am
 
@IonicăBizău you mean just sort the array?
 
Do you want ants? Because this is how you get ants. — Sterling Archer 2 mins ago
Too mean?
 
@rlemon What should i define the client as?
 
@MarcRasmussen io.on('connection', function (socket) { what is 'socket' ?
 
@ssube Yes, a sort that will put the negative numbers at the start, positive at the end and 0 in the middle. It also can be -4, -5, 0, 0, 5, 6, 2.
 
4:22 PM
@rlemon Socket is the "socket" a client connects to?
 
@IonicăBizău That was an exercise ? I don't remember that...
 
@MarcRasmussen and you wanna know what to defined client as.... did you just answer your own question
 
@IonicăBizău that's just a normal sort.
 
@dystroy Yeah... Initially I said sort an array with one iteration.
 
although...
!!> [-1, 0, 1, -2, 0, 2, -3, 0, 3, -4, -0, 4].sort()
 
4:23 PM
@ssube [-1,-2,-3,-4,0,0,0,0,1,2,3,4]
 
@rlemon Yeah kinda execpt that my cookie data contains more than 1 datastring i want to get a specefic value from that cookie string
 
that's not sorting...
 
huh, cap and my chrome handle -0 differently.
 
@MarcRasmussen I'm positive you can find a cookie parsing module - writing your own is trivial as well. .split(';') and .split('=')
 
I get [..., 0, 0, -0, ...]
 
4:23 PM
@IonicăBizău sure it can just maintain a double ended queue
 
.
 
@ssube Yeah, but you have to write the ordering algorithm, with one iteration.
@BenjaminGruenbaum What is a double ended queue?
 
@IonicăBizău just put the numbers at one end if negative and at the other end if positive, it can be done in one iteration because it's not a sort
 
@dystroy Exactly. But what to do with 0?
 
add it in the end
or just use two aux arrays that's easier
or even three, this becomes trivial
 
4:25 PM
@IonicăBizău just store the count and add them at the end, if you count all numbers and use 2 arrays it's easy
(oh yes, 3 arrays too, I see we think alike...)
 
var arr = [-1,  1, -2, 0, 2, -3,  3, -4, 4]
var pos = [], neg = [], zer = [];
for(var i = 0; i < arr.length; i++){
    console.log(arr[i])
    if(arr[i] > 0) pos.push(arr[i]);
    else if (arr[i] < 0) neg.push(arr[i]);
    else zer.push(0);
}
var res = neg.concat(zer).concat(pos);
res;
Easy as pie, of course it could be a single reduce.
 
Sure... But I guess I should use only one array... I tried to put the negative numbers at the start, and the positive ones at the end, counting them, and then to use override with 0 the middle interval.
 
you can use one array if you want, you just have to keep 2 pointers : to the start of the 0 and to their end
 
@BenjaminGruenbaum I agree it will work, but I guess I have to work with one array..
 
That's just as easy, also, you didn't state it was a limitation
Also what dystroy said
Also, I have to get back to work ttyl
!!afk work stuff
 
user1596138
4:29 PM
@BenjaminGruenbaum isn't it supposed to return them in the correct order?
 
@dystroy How do I know where 0 starts/ends?
 
user1596138
That would fail var arr = [-2, 1, -1, 0, 2, -3, 3, -4, 4]
 
nope, not a requirement
!!afk for real
 
user1596138
Oh ok. I jus woke up
 
@Jhawins watch the redneck madnessssss
 
user1596138
4:30 PM
What??
 
@IonicăBizău well, just count the numbers of positive and negatives...
 
It's so glorious
 
user1596138
Yea I have a car to trash before it goes to scrap
 
user1596138
I'm open to ideas
 
user1596138
Runs/drives an shit
 
4:33 PM
Is surviving part of the requirements ?
 
user1596138
There were going to be 2 and we were gonna hook em up ass to ass and just... Well just go.
 
user1596138
But I'm not spending money to fix the other one so I can do it hahaha
 
pee on it
 
user1596138
@ssube how to trash a eagle talon before you take it to scrap (runs n drives)
 
Drifting, off road jumps
Sink it
 
4:34 PM
@Jhawins why are you trashing a talon, dude?
sell it on craigslist or something. If it runs, you can get a few grand.
 
user1596138
@ssube No no don't worry about it I promise you you'd do the same. I don't have pics but it's bad. Plus the cylinder walls on 1,3,4 are fucked and the head gasket is blown (he ran it with straight water in sub-zero weather and it seized/overheated)
 
There is likely nothing worth doing that is legal or cheap
 
user1596138
I can't even get it started if it's not over 40 degrees or I put it in the garage with heater and then it starts spewing antifreeze before too long
 
oh
 
Any d3.js savior here?
 
4:37 PM
rig up a remote driving thing
 
user1596138
@Neil To the South,West,North from my house are cornfields..
 
i ran into problem
 
or, if you can't do that, hang some weights from the wheel and a brick on the throttle
 
user1596138
Whatever. I'll just go ram something and post the video later
 
and let it go
 
4:37 PM
You could line the whole thing with cellophane and fill it up with water
 
don't put a ring on it, just let it go (into a wall)
 
user1596138
It's a manual too
 
ghost ride the whip
 
/me is definitely in the right chatroom for javascript...
 
@user 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.
 
4:38 PM
Make sure you park the car (it'd weigh a lot) and it is no where near where you can't get wet
 
user1596138
@user Are you a user?
 
He's the user
 
He is 'the one'
 
@Jhawins I don't know how I got into this place... is this the grid?
 
user1596138
@Neil ....why?
 
4:38 PM
@SterlingArcher so many cringes
 
The duct tape hands one had me in tears
 
@Jhawins You tell me, I thought you were looking for things to do for a car you're about to scrap
 
user1596138
Oh shit wait if I actually break it I have to load it on the trailer to scrap it so.
 
user1596138
It's not like it was even my car lol
 
How to add Label to each state in d3.js d3.geo.albersUsa?
 
user1596138
4:39 PM
You guys suck I was hoping somebody would have some crazy idea
 
Filling a car full of water isn't crazy?
 
Fill it with jello or pudding
Or cheese
 
user1596138
@Neil But it runssss
 
> I can't even get it started if it's not over 40 degrees
 
user1596138
I wanna see if it can pull these posts for me lol
 
4:41 PM
Hii .
can anyone please help me in this question.
I'm trying to create directive in angularJS, but unable to do it.
http://stackoverflow.com/questions/28216523/create-directive-for-dropdown-inangularjs
 
yo
 
You could drive the car full of water
Though pretty sure that's illegal
 
user1596138
@Neil lol oh ok I can see how that'd be cool
 
Get a scuba suit and drive
 
user1596138
4:41 PM
Like those DUI commercials
 
Don't drink and swim and drive
or something
 
user1596138
I only drink and drive in the field
 
>tries to answer question
>plunkr is down
>no hope
 
jsfiddle, codepen, jsbin..
 
4:43 PM
@Jhawins In the field of combat or like, an actual field? Also, that sent shivers up my spine either way
 
so's stack snippets
 
It's an Angular question tho'... I'm not a big fan of Angular but it's darned particular
 
@SterlingArcher THE DUDE HOLDING THE BALL GETTING HIT BY THE TRUCK
O.o
THERE IS A TREE RIGHT BEHIND HIM
wow
 
@user: no .. now I can open plunkr
 
user1596138
@Neil Idk my friend's family owns some ~900 acres beside me they farm and one day I was drunk and he came over with a brand new hummer and I wanted to drive so I took it through the fields since I was over the limit haha
 
4:44 PM
It opened as soon as I complained. It knows.
 
I guess no one have d3.js knowledge
 
@user : ok . Please see .
 
@Jhawins How'd you reason through that? "Hmm, I want to drive his new hummer, but I'm drunk, so I can't drive on the streets. Hey! I got an idea!"
 
@Loktar : now you can open plunkr .
 
user1596138
@Neil his idea lol
 
4:45 PM
@BrianS lol is that passive aggressive?
 
I guess nobody cares to answer snooty people
 
@Jhawins Ah then, no problems :D
 
@taco glad I wasn't the only one to pick up on that
 
I saw it - I ignored it
 
@IonicăBizău Make one pass where you order negative and positive including zero, then make one pass where you swap positive and zero (starting and the end point of the first pass)
 
4:46 PM
he's been in the chatroom for less time than my last fart
 
> Sigh wont help me with my specific problem I could google.. guess no one in here KNOWS JAVASCRIPT
 
@Loktar hahaha no
 
@SterlingArcher spray cheese
 
/me waits for the answers to floooooow
 
@Loktarthe entire convo i see here is all personal, no one talk javascript
 
4:47 PM
dayum
 
eh there are side convos we were just talking about services liek jsfiddle/plunkr/ect
 
@BrianS where did you link to a fiddle showing your problem? not seeing the link
 
user1596138
@suube the next time something like that happened he brought over a brand new camaro but it was shitty v6 one
 
Attention Newcomers: The room will not always be talking about JavaScript. that is not a problem. If you ask a well formed question and someone cares they will answer. STOP COMPLAINING ABOUT OFF TOPIC SIDE CONVERSATIONS! thankyou. ~ your friendly Canadian
 
@Loktar : First I posted it in angulrJS chat room. But no one reply. Then I posted here. Hope some one can help me
 
4:48 PM
whoa lol @SterlingArcher
 
@AmitKumar I probably can't help you just fyi
screw directives in Angular
 
user1596138
@BrianS There are no interesting questions being asked.
 
^ how I feel about them :P
 
Jhawins posted i.stack.imgur.com/WhBkT.gif but it was moved to chat.stackoverflow.com/rooms/61037 because gifs get annoying fast.
 
user1596138
wtf I thought she waited for edits now
 
4:49 PM
Its simple, i need to know how to add label to each state in d3.js @ssube here is fiddle jsfiddle.net/1c90htw5
 
@Jhawins not yet
 
@rlemon \w+/javascript/g
 
@ami
 
@Jhawins so it have to be interesting? i mean I'm new to D3.js and even though i know jQuery i can't get the concept around my head
 
I don't see any states in that fiddle, just a big black thingamajigger.
 
4:50 PM
@user : yes
 
@AmitKumar I rewrote your question because I'm too dumb to directive
http://jsfiddle.net/mbxh1fn0/
But it still does use your data
 
@ssube because is DOM
 
@ssube this
 
@BrianS It helps to look at some examples
 
@BrianS I imagine there's some data missing, that you should probably attach to the fiddle. Adding labels to things that aren't showing up will be difficult. ;)
 
@Neil The second parameter is by default the name of the constructor. It's the name under which Chusha will look for an instance
It's basically a key in an object.
 
@IonicăBizău Something like gist.github.com/copy/8ef2af76f636fa648c72
 
@user : thank you . but I need to create directive . As I need create custome dropdown, and it is being used many number of times in my application. so I want to create a directive for it .
 
posted on January 29, 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) {} Glorious time recording with Ellen McLain. The audiobook will be ava

 
@ssube It doesn't, currently. Will add it (will appreciate if you could open an issue on that on the GitHub issue tracker)
 
4:53 PM
@SecondRikudo Then I don't understand where it gets "http" from if not from the name of the property containing the instance of http client
 
@Neil The default value for hash is obj.constructor.name
 
This is what i got so far s29.postimg.org/uksgv2mfb/…
 
So if http instanceof HttpClient, hash will default to 'HttpClient'
 
@SecondRikudo But the example calls it using 'http'
 
function MyObject(http) {
    this.http = http;
}
MyObject.inject = function() { return [HttpClient]; }
MyObject.inject is a static method that defines all of the dependencies
So this means that the first argument to the constructor should be an instance of HttpClient
function MyObject(http, db) { ... }
MyObject.inject = function() { return [HttpClient, MySQLClient]; }
 
4:56 PM
@SecondRikudo already forked, changed, wrote tests, and opened a PR :D
 
In this example ^^ two parameters are injected, one HttpClient and one MySQLClient
The names you give them in the constructor are irrelevant.
 
@ssube Yeah, I saw, thank you so much :D
I'm reviewing it now
 
Hey guys, so I "browserified" somebody elses npm module. Is there any naming convention for the main script in the package.json?
 
Since we don't have names or annotations, it just tacks them onto the end (so it's injected + passed).
Might be more useful as passed then injected, not sure. Super simple change, regardless (although my vim screwed with line ends a bunch :\ )
 
4:59 PM
@ssube, Yeah, that's pretty much exactly how I thought to do it, thanks.
Merging
 
Why do I have the urge to do this
 
eh, just gonna call it main.js
 
lol
!!s/this/you/
 
@KendallFrey Why do I have the urge to do you (source)
2
 
Oh dang ._.
 
5:03 PM
o_o
 
Cap is going through puberty. Pay no mind to it
 
@copy Thanks!
 
@Loktar "robber shits himself so hard he passes out"
 
haha
 
5:05 PM
@copy @dystroy @BenjaminGruenbaum This actually is the Dutch national flag problem. I posted it as question on code golf: codegolf.stackexchange.com/q/45142/12495
 
Oh well. It could be worse than shitting yourself hard. Like shitting yourself soft.
 
@ssube tsk tsk your commits don't pass lint though :P
 
My uncle told me his new years resolution was to not shit himself this year
 
@IonicăBizău Oh, that algorithm is smarter
 
5:07 PM
6 days later he texted me saying resolution over
 
Is it OK to delegate to CodeGolf one's school exercise ?
 
I can't load my us.json to fiddle i get error Failed to load resource: the server responded with a status of 404 (Not Found)
 
But codegolf.se is full of shit, so I don't care any more
 
@dystroy I actually wanted to know a working algorithm. But why not...? I posted it in the spirit of codegolf I guess.
 
@SecondRikudo oh, I thought test ran lint too. My mistake.
 
5:11 PM
@ssube I should probably add a build section to the readme
 
@SecondRikudo I just don't know how gulp works
 
It's okay, I'm refactoring a bit anyway (I also moved your object structure to a fixture file)
@ssube just run gulp
And have a look at my Gulpfile, it's relatively straightforward.
Mine only does linting and testing for now
 
@SecondRikudo figured that out now, but had run gulp test before
 
But it will use 6to5 to generate the dist files in the future
 
I like to study object oriented javascrpit. could u please share useful website, books or ppt with example
 
5:13 PM
@KannanThangadurai 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.
 
if (typeof(define) === 'undefined' && typeof(require) === 'undefined' && typeof(window) !== 'undefined') {
Do you guys think this is a good enough check to see if the runner doesn't use AMD, CommonJS or Node?
 
What's the practical difference between rawgit.com and cdn.rawgit.com?
(I'm not too familiar with how CDNs work)
 
calm down now
 
@KendallFrey I guess cdn.rawgit.com can be used in production.
 
According to the web page, one caches more/longer (the cdn one)
 
5:16 PM
@Luggage sense it makes
I don't know why Yoda took over there
 
If it's a cdn, the dns server inspects your ip and gives you a server that's closer
 
If you want a jsfiddle against a changing library, you do NOT want the cdn.
 
so annoying trying to replicate it
 
@copy yep, that's how our CDN does it
 
That was unexpected
 
5:20 PM
we use BGP to route you to the nearest CDN server
 
@SterlingArcher I did not see that coming ;)
 
Dammit mini Hitler
 
Humpty Hitler
"The Hitler dance is your chance to do The Hump"
 
@SterlingArcher reminds me of tiny hippo
user image
2
 
I lol'd hard
 
5:32 PM
The system is down
 
!!s/system/raven/
 
@SterlingArcher The raven is down (source)
 
@SecondRikudo what's this about a tiny dic?
 
@BenjaminGruenbaum ^
 
I am an idiot
I'm building 3 different files for AMD CJS and none, when there's UMD that does that for me
And 6to5 supports it >.<
Gah, food.
 
omg
the pause
 
son of a bitch
 
@SterlingArcher 'twould be a boy pup
 
5:46 PM
lol
 
user1596138
lol
 
I hate you all
 
And your damn puns
 
stop
 
HAMMERTIME!
 
omg the piss risky click?
 
5:55 PM
I risked. I lol'd
 
I've never actually had PBR, because everyone says it's so bad.
 
Nothing compares to the terribleness of Genny Cream Ale
 
I hate it
Genny Light is terrible
 
I recently picked up a pack of flat tire, and that's actually really good
 
Aren't you like 17?
 
5:56 PM
Specifically, this ^
 
am I 17? wat
I'm 22
 
@NickDugger new belgium's stuff (I think they make that) are generally goodish
 
PBR is cheap, but has impurities, so you'll get a hangover
 
@SomeKittens ah the ol $13 30 rack
classic broke college move
 

« first day (1566 days earlier)      last day (3397 days later) »