« first day (1595 days earlier)      last day (3356 days later) » 

7:01 PM
Great answer! Everybody always seems to think you have to have Apache running. I just wanted to be sure if that was really true. :-)
 
Thankfully the people in this room aren't everybody (and your everybody sounds an awful lot like the PHP community TBH)
 
We are the gods
 
@NickDugger It just makes sense for me to have a JS room jam actually be in JS. If you want to write a game in a language that isn't JS, no one's stopping you, but why would it be part of the JS room jam?
 
Because we're a community that is not only held together by the fact that some of us write JavaScript
 
Ooh, argument,
what are we arguing about? I want in
 
7:08 PM
tabs are better
 
I was responding to Nick's pinned message.
 
@rlemon no tabs are horrible. They show all different on different computers.
Spaces get converted to soft tabs anyway, spaces are objectively superior for indenting.
 
that is the computers fault, get better pc's
 
Tabs are terrible. New window for each website.
If I use tabs, I don't consume enough browser memory and my computer no longer is able to keep my house warm in winter.
 
Everyone who uses tabs is probably mentally retarded and sexually caressing cats in a dark alley, the cats are also mentally retarded.
Spaces are the one true way to solve all your indentation needs.
Reports from reliable sources claim that people who use tabs poop on slides.
7
 
7:10 PM
ok, the last one is starrable.
 
Re: the jam; while I get that this is, to some degree, a community of people who just happen to hang out in the JS room... for the purpose of events, I really think we should put on our "JS room" hat, and actually be the JS room, rather than being the "JS room community", if that makes any sense (of which I'm doubtful)
 
@FlorianMargaine is the star Czar
 
I faint when I see tab indented code. Because they are always mixed with spaces and becomes all wrong, defeating the whole purpose of using tab.
 
just use your IDE to autoformat all of your code always
 
Tabs are more semantic, and are quicker to 'arrow-key' through.
 
7:17 PM
@Sheepy Couldn't you just as easily say "I hate space indented code, because it's always mixed with tabs and becomes all wrong"?
I don't think anyone's like "I love when tabs and spaces are mixed indiscriminately!"
 
@Retsam ... I don't care.
 
Tabs are awesome. Too bad your editors always suck so I resigned to using spaces.
 
My $0.02 on jam language: I'm a moron who only knows JS and would love to read/learn from other entries (which is why I voted for the FOSS requirement). Hard for me to do that when they're in UbScalGo.
2
cc @NickDugger
 
Is that $0.02 USD or CAD?
 
@RoelvanUden - I guess everybody was an overstatement!!! Lots of people talk about various web servers and I've even had one person tell me to go to the cloud! Really? Is that necessary?
 
7:23 PM
Ok, I give up. I'll write JavaScript then
 
@Lucy No. They're just buzzword bees. Annoyingly buzzing around. Smack them.
 
Are you sure?
 
Is it really so difficult to swap spaces for tabs and tabs for spaces?
 
Yeah! It drives me crazy!
 
@Neil if you're in a project with other people, yes
 
7:25 PM
@Nick Absolutely
 
@FlorianMargaine Well I suppose it would only have an effect on the files that you open
 
(diffs/merges are crazy if you swap...)
 
@FlorianMargaine Eh, it's about coordination and enforcements
Swapping as a one-sided move is completely impossible.
 
@SecondRikudo he means swapping at every commit since everyone uses his own convention
just use a formatter as a pre-commit hook and everybody's happy
 
7:27 PM
@FlorianMargaine And how do you handle different tab size? Not really practical.
 
why doesn't there exist this convention and a big "fuck you" to developers that want to mix
 
@FlorianMargaine Exactly, enforce one style by all, and be done with it.
 
@SomeKittens starred for UbScaleGo!
 
@RoelvanUden - You seem to be on the same page with me, perhaps you can answer a question for me and I'll give you the points. It's here: stackoverflow.com/q/28770623/1735836
 
you want spaces? NOPE!
 
7:28 PM
@Neil I don't understand the big deal anyway. The IDE does all the work anyway, you don't have to worry about what kind of unicode character is being inserted there for you...
 
@SecondRikudo If the IDE is smart enough to convert pasted code, sure
Most don't though, and understandably so
 
@Neil I know that at least WebStorm/Intellij is.
 
the IDE usually does its work when you save
@Neil even ST2 handles that though...
 
I don't want to have to hit backspace 12 times to reduce 3 levels of indent
 
But yeah, use a precommit hook to, at the most basic and primitive level, disallows changes where the lines match ^ + or ^\t+ or whatever you want to enforce.
 
7:31 PM
@Lucy That depends entirely on the server-side programming language and exposure to the public. I'd be totally comfortable with NodeJSs build-in server (even though everyone goes all "No, that's bad!"). Since you mentioned PHP, I'd go with nginx or apache. 1GB RAM and a ~1GHZ processor is plenty to run a fair-traffic site on a poorly optimized LAMP stack.
I run a community with ~100 active users polling a PHP chat room on a simple 1GHZ/1GB RAM on even worse optimized forum/chat software on an outdated LAMP (on Ubuntu server) stack with no issues. Regular servers aren't necessarily beasts for moderate traffic at all.
 
Hi, does anyone know how to parse string value of datetimeoffset in javascript ? ie to convert "27/02/2015 19:24:30 +00:00" to a js date object?
 
@SiddharthP Have you tried anything?
!!tell SiddharthP google convert string to date javascript
 
@Retsam Space indented code with some tabs is easier to fix, because replacing mixed tab with proper space is easier than the other way round.
 
@Sheepy Meh, there are tools that do a great job in both cases.
 
7:35 PM
@Sheepy That's why I generally prefer tabs over spaces
 
@KendallFrey I press Shift+Tab.
 
Also I dislike the backspacing :(
 
@KendallFrey Shift+TAB
 
@Sheepy Seems identical work to me. Either delete x 4 then tab, or delete x 1 then space x 4.
And, realistically, most editors/IDEs handle that for you.
 
That ^
No one does this work manually.
 
7:36 PM
@Retsam I just tab and untab. All my editors are set to soft tabs.
 
Any respectable IDE can switch between tabs and spaces freely
 
@Retsam I think he means that you have one line with 4 spaces and another with 3.. is that a new ident or a typo?
 
I get that blackandyellowblackandyellowblackandyellow reference now.
 
Difficult to be ambiguous with tabs in that sense
 
@Sheepy So you're arguing that space are better because, with your specific setup, in the case where someone does it wrong, then it's a bit easier to fix that mistake?
 
7:37 PM
@SecondRikudo Do you mean code formatters?
 
@Shmiddty Would you say... you know what it is?
 
@Sheepy Yes
WebStorm for instance, allows you to define whatever style you want, and then enforce that style automatically or with a single key-combination.
 
@RoelvanUden - The server side programming is what is still up in the air. This is a biometric security device that will process fingerprints to open doors instead of badges. The web application will execute on one of these devices that is dedicated as a master device. The web interface is merely to synch the databases from the master to all other devices on the building and for human interaction.
All devices will reside on a company network (not public at all). Most instances will be just all the doors to your office. I'm interested in the NodeJSs build-in server you mentioned.
 
@Retsam No, it is because real core rarely use real tab characters, so replacing them is easy once you find the correct number of space. When I am editing tab-indented code, I make sure my changes are all tab indented.
 
7:39 PM
@Sheepy Instead of using a proper tool for fixing indentation, you just globally replace the tab character with spaces? That sounds bad.
 
@RoelvanUden - If that and JavaScript has the smallest footprint then that is my answer.
 
Replace tabs with one space.
 
@Lucy NodeJS, the server-side JavaScript environment, includes a built-in HTTP server. Besides that, NodeJS is really light weight, easy to program for, and excels at IO-bound work (like synchronizing databases :-P). There are environments with an even smaller footprint (e.g. Luvit) but they aren't anywhere near as vibrant with an amazing ecosystem. That said, you should consider your experience, deadlines, willingness to learn and monetary influence on your final choice.
 
@SecondRikudo Code formatter is nice... when working on in house code. Unfortunately when working on other's code, it means changing the whole file's format. And then you have to ask why not change the whole project's style. And then the whole site need to be re-uploaded...
 
@Sheepy What do you mean "others' code", please tell me you aren't "improving" 3rd pary libraries in-house...
 
7:43 PM
@Lucy Arguments against NodeJS are plenty a dozen too. You need to know JavaScript, and it's awkward at times. NodeJS is single-threaded, and CPU-bound work (like Math!) is really not that great in it. NodeJS is relatively immature (read: it's not a dinosaur yet). For me, however, it's the lightest and simplest thing I would want to work with.
 
@SecondRikudo We maintain many abandoned projects for our clients.
 
@Sheepy "maintain abandeoned project" is an oxymoron.
If it was abandoned, it's clearly not maintained.
 
(this video)[facebook.com/video.php?v=764259270337768] explains the dress thing pretty well to who can only see it in one way, and makes you able to actually look at it the other way (some had spasms during the experiment, not suggested for work environment)
 
user1596138
Reasons to not own a pickup
> will you take me to pick up a motorcycle I'm buying
Sure
It's in Maine
Wut
 
Also, I follow coding conventions in the following order:
 
7:45 PM
Not maintained... when we picked them up. Yesterday I was working on a system with 1000+ tables that has been "enhanced" by at least three teams. Most of the tables are unused copies left after previous rewrites.
 
1. Whatever's there in the project
2. If there is none, the default by my IDE.
Any further thinking into it is 100% bikeshedding and waste of time.
 
A style guide written made by people smarter than you?
 
I like how we're having this whole tabs vs spaces debate... based on a joke comment by @rlemon. Thanks, man!
 
@copy Waste of time. And my IDE generally implements that by default.
 
you guys are still on this?!
 
7:47 PM
If the style guide was already implemented in the project I'm working on, sure.
 
The bomb had a lasting effect, @rlemon
 
people who use spaces probably think that the dress is blue and black
 
If I get to determine it, spaces vs tabs, opening bracket inline or on its own, that's just so mundane
 
@Meredith So... they're objectively correct?
 
They're wrong
 
7:48 PM
I saw the picture as White/Gold personally... but the dress itself is definitely Blue/Black.
 
Yeah the actual dress is black and blue
But the picture is white/gold
 
Context for the confused: buzzfeed.com/catesish/…
 
Well, with colours at least there can be (relatively) subjective answers. That is what colour meters are for.
 
NodeJS: is it possible to get changes without stop/start server
when I change res.end('Hello World \n'); to res.end('Hello World 2\n'); I need to restart server
 
7:59 PM
Anyway, it can be worse than tab and space. There is an html I fixed today that the indent is very nice. The tabs are totally perfect. No mixed space at all. Very tidy.
Except that it is totally inconsistent, code on same indent may or may not be at the same level. So the perfect indent is just for the look and useless for maintenance.
 
@Teomanshipahi meteor js will let you change server-side code without restart
 
thanks, let me check that
 
@Teomanshipahi it's a framework, it does a lot of things that you may not necessarily want
 
different than node js or works togetger?
 
@Teomanshipahi I'd use something like nodemon, something that restarts when you change stuff during dev.
 
8:04 PM
@Teomanshipahi meteor is client/server framework
You might be better off with roel's suggestion
 
@RoelvanUden oh, that's what I am looking for exactly! For dev environment yes
@Neil yes, I was expecting for a package :)
thanks anyway
just started to learn node.js..
 
We all had to learn at some time ;-)
 
yep
 
Hope this is the right room for asking this kind of questions
because I will visit here a lot :)
 
This room sure is related to JavaScript and NodeJS. You're welcome to ask questions, of course. Just, google and look around prior to asking because nobody is going to take the time to respond to questions that the first google search page would've solved. That is, excluding things like having to know certain packages or keywords ;-)
 
8:09 PM
@Teomanshipahi are you mighty mighty, letting it all hang out?
 
And don't ask to ask :)
 
Love this song
I think this guy created a question and answer together :)
20
Q: How to npm install to a specified directory?

coudyIs it possible to specify a target directory when running npm install <package>?

That's cool to I was looking for it :)
 
user4330208
9:06 PM
Man do I have the question of questions for you guys
 
user4330208
WHO'S READY
 
user4330208
k this room is obv dead. AFK
 
@carb0nshel1 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.
 
user4330208
Dont welcome me dude
 
user4330208
I'm a respected member of this room!
 
9:08 PM
!!s/r\w+//
 
@KendallFrey I'm a member of this room! (source)
 
user4330208
seriously though. Tell me why these arrays don't behave the same: ary1 = [ 234, 035, 005 ] and ary2 = [ '234',' 035', '005' ]. When I convert all ary1 indexes to a string. It still behaves differently than ary2. Why is that?
 
user4330208
Heres how I converted ary1:
 
user4330208
		for( var i = 0; i < ary1.length; i++ ){
			ary1[ i ].toString();
		}
 
user4330208
ary1 and ary2 should be identical now. No?
 
user4330208
9:11 PM
BUT THEY ARENT
 
um
what does toString() do?
 
user4330208
umm
 
user4330208
I think it makes numbers into a string
 
user4330208
right
 
what does it do with that string though?
 
user4330208
9:20 PM
@carb0nshel1 It's because of the notation
and if you manipulate array with int like 44+"333" it will be "44333"
So 035.toString() gives you '29'
If you need the zero padding, then you need to store them as strings
not convert them after the fact

- boltclock
 
That has nothing to do with your problem though
 
user4330208
035 with a single leading zero is octal notation and represents decimal 29
 
user4330208
Now, you see?
 
user4330208
I'm F***ed because I made this whole app without taking that into account
 
I know that, what am I supposed to see?
 
user4330208
9:22 PM
kendall man are you trolling me
 
@carb0nshel1 Why does that matter? Don't use leading zeros
 
user4330208
i know but my program looks at these numbers, 029 must equal 029. its built into all of my arrays
 
user4330208
I can solve this. AFK
 
what do you mean it's built in?
 
user4330208
i feel like u trolling me but I cant blame u
 
9:23 PM
!!wiki schadenfreude
 
Schadenfreude (/ˈʃɑːdənfrɔɪdə/; German: [ˈʃaːdn̩ˌfʀɔɪ̯də]) is pleasure derived from the misfortunes of others. This word is taken from German and literally means 'harm-joy.' It is the feeling of joy or pleasure when one sees another fail or suffer misfortune. It is also borrowed by some other languages. == Linguistic analysis == === Spelling and etymology === Though normally not capitalized in English, the term schadenfreude is sometimes capitalized to mimic German-language convention as German nouns are always capitalized. The corresponding German adjective is schadenfroh. The word derives from...
 
user4330208
rotfl
 
user4330208
u guys man
 
I'm not trolling, I just have no idea what your problem is
 
user4330208
Basically, the main problem is I need leading zeros. All of my numbers in these arrays need to be 3 digits.
 
9:25 PM
why?
 
user4330208
Its essential to my app. It looks at patterns in numbers.
 
if they're numbers, leading zeros shouldn't matter
 
user4330208
no, it looks at a series of random numbers
 
user4330208
032, 564, 732, 004 etc.
 
@carb0nshel1 but numbers are the same with or without leading zeros
 
m59
9:26 PM
vanilla $http, ngResource, or Restangular?
 
user4330208
Not when you need to count how many times each digit occured. including zeros
 
user4330208
or how many times each pair occured
 
user4330208
like 05
 
just add leading zeros
 
user4330208
9:27 PM
?
 
you're fundamentally doing string operations now, so you shouldn't be using numbers
 
user4330208
u trolling me man
 
user4330208
I know. Thats exactly the case!
 
user4330208
but how do i convert all of my numbered arrays into strings
 
no, you weren't listening
> you shouldn't be using numbers
 
user4330208
9:28 PM
035 with a single leading zero is octal notation and represents decimal 29
 
only as a numeric literal
 
user4330208
but the user first enters numbers into the app
 
user4330208
i have to convert them to strings
 
user4330208
with leading zeros intact
 
uh, yeah, that's easy
don't convert them to numbers at all
 
user4330208
9:29 PM
but they are numbers...
 
You're converting them from strings to numbers then back again?
 
user4330208
o wait..
 
user4330208
crap
 
user4330208
im confused man. i have 4000 lines of code
 
user4330208
AFK
 
user4330208
9:30 PM
thanks.
 
user4330208
black and yellow black and yellow black and yellow black and yellow
 
^unminified
And that's just the client-side bit of the app
(but it does include a bunch of libraries we didn't write so there's that)
 
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Javascript                       1          23604          24006         152549
-------------------------------------------------------------------------------
Concat but no min
 
what bundler do you use?
 
Browserify
 
9:35 PM
is there a flag to turn on stats?
 
I used cloc
 
ah, I see
 
9:48 PM
yo skrill drop it hard
 
@Shmiddty like Angular? (30K) and stuff?
175K LoC is crazy
(I mean, split it into files don't include it all at once)
 
dang killa
 
Alright !!die is a horrendously abused feature.
 
@SecondRikudo who killed the bot?
It's very simple - !!ban liberally.
 
@BenjaminGruenbaum Almost died in the HTML room
got her away just in time
with !!unsummon
 
9:55 PM
!!ban Phreak
 
@BenjaminGruenbaum I couldn't find Phreak.
 
!!summon 29074
 
!!summon 29074
 
user4330208
so caprica six does anything we tell her to?
 
user4330208
Anything?
 
user4330208
10:00 PM
cuz i got some ideas...u know >>
 
He's a teenage boy, use your imagination
but not too vividly
if you do that you're gonna have a bad time
 
lol
 
@BenjaminGruenbaum stahp unsummoning her from HTML
!!summon 29074
 
10:07 PM
!!unsummon 29074
No, you're killing her there and teaching her stupid stuff.
*it
 
@BenjaminGruenbaum ...
 
I want @rlemon or @Loktar's word they'll take care of this mess.
 
@BenjaminGruenbaum "mess"?
 
Did you just summon the bot there from another room o_0?
 
no I put her back
 
10:09 PM
Oh ok.
Please make sure they behave @rlemon :)
 
user4330208
11:05 PM
				for( var i = 0; i < newArray.length; i++ ){
					if( typeof newArray[ i ] == 'undefined' ){
						newArray[ i ] = '';
					}
				}
 
user4330208
Is there anything inherently wrong with this code?
 
user4330208
It is removing WAY more than just the 'undefined' keys
 
11:17 PM
Okay, I probably wrote the worst Node.js module on the history of mankind: github.com/gtomitsuka/priority.js/blob/master/index.js
@BenjaminGruenbaum How many rooms can Caprice listen to simultaneously?
 
@GabrielTomitsuka lots, I think
 
Can anyone give me a theory as to why images would be loading painfully slow using node.js + express?
 
@Phil More details, please?
Sometimes using Nginx or simply hosting with a CDN would make more sense, if you have huge static files.
 
app.use(express.static(path.join(__dirname, 'public')));
using that to server up static files. the file isn't that large
 
Or, option B, your server is way too slow.
 
11:25 PM
every 3-4 refreshes it takes 30-50 seconds to load
this is the only image on the page
 
30?
Use cache?
Oh! There's a really helpful node module
 
That might help, but I don't know to have an image load for 30 seconds if there is no cache
 
That's the one you're looking for. gzip it all! You'll note a performance improvement.
 
yeah, but it's 9kb and I don't think that size should load at 30-50 seconds
 
11:28 PM
If it takes 30 seconds to load an image from a static route, something is probably wrong, unless the image is humongous or you're on a 300 baud line ?

Open the console and check for latency times
 
that is the strange thing, when it finally loads it says that it took 18ms to load
in network tab of chrome
 
@BenjaminGruenbaum I don't think let was made for that.
But I do understand the question.
 
Sorry for the mass ping, this is either a firefox or an io.js bug and I want to know which :)
@GabrielTomitsuka made for that?
 
oh dear
 
@BenjaminGruenbaum For defining globals.
 
11:30 PM
To be fair, I tried the spec.
 
The same with other browsers? (i.e. Chrome Nightly and so on)
 
@GabrielTomitsuka the problem manifested itself in an io.js issue. Autocomplete didn't work because it was not bound as a property. I want to know who's to blame :P
 
LOL got it
 
1 message moved to Trash
 
@BenjaminGruenbaum - I'd say it's an IO.js bug, there's nothing in the standard about not being able to use let in the global scope, and use that as the "block scope"
 
11:33 PM
Nope
 
> let and const declarations define variables that are scoped to the running execution context’s LexicalEnvironment.
 
@adeneo Is there anything in the standard saying that it declares properties on the global scope?
 
spec ain't helpful
 
@FlorianMargaine yeah, I was stuck with that too :/
@copy thanks.
 
that said...
> A var statement declares variables that are scoped to the running execution context’s VariableEnvironment
it seems it should have the same behavior as var.
@BenjaminGruenbaum ^
 
11:38 PM
I'm not sure, does it prove it?
 
it's phrased exactly the same
you'll have to ask on esdiscuss to be sure
 
@FlorianMargaine Read again
 
var and the global object is "special", there's some sort of binding that implicitly adds globals as properties to the global object, I can't seem to find it, but has something to with variable enviroment or ....... ? Not sure if let is supposed to have that as well, it doesn't really say anywhere ?
 
@adeneo it's supposed to - it's the language specification after all but I couldn't find out either.
 
11:54 PM
1
A: Do `let` statements create properties on the global object?

Felix KlingAccording to the spec, no: A global environment record is logically a single record but it is specified as a composite encapsulating an object environment record and a declarative environment record. The object environment record has as its base object the global object of the associated Real...

hmm
 

« first day (1595 days earlier)      last day (3356 days later) »