« first day (2164 days earlier)      last day (2769 days later) » 

12:06 AM
Hey, guys, is it worth to gzip a project if you already minify js and css?
 
@JoãoPaiva yes
 
@bitten If I am using iis do I have to make any additional configurations in order to use gzip?
 
yes
and no
 
It works out of the box?
I read that http supports it, but what about https?
 
i think gzip is protocol agnostic
well it's not even related to protocols
so yes
don't listen to me about server stuff, i'm not so familiar with it
gzip on; is as far as i go
 
1:06 AM
MDN > other docs
ooh, mdn has a new theme!
 
@JoãoPaiva if you use a web server like iis it should be just configuration
in web.config in the iis case
googling should give you everything you need
 
1:34 AM
@towc meh, I've beaten that twice
 
@littlepootis Hey :D
 
1:50 AM
16
A: My mom is too picky

anongoodnurseYou have lots of options. Here's one: At dinner one evening, you can say you have a serious announcement. Then tell your mom and dad that you're pregnant. You're really sorry you slipped up, but it will all be OK, not to worry, because you're in love and you plan to marry the father. Unfortunate...

I died. Lmao.
 
@littlepootis i have the same situation with my parents , but i dont get straight A's :/ .. Not really funny
 
As a boy, I'm sure the pregnancy would scare them quite badly :) But in all seriousness, thank you for the very detailed answer. I think talking to my school counselor may be my best bet here - I don't want to be too dramatic about this whole thing. — TreFox 9 hours ago
 
2:13 AM
Can anyone help guys
http://stackoverflow.com/questions/39553393/pass-backend-generated-data-as-webpack-module
 
@William I shuffle through random music on SoundCloud until I find one I like. But there are some bands and artists I like (not all of their songs, but yeah): David Archuleta, The Fray, Linkin Park, Lorde, Thimlife, Trading Yesterday, Alan Walker, etc.
I can listen to this thing for hours.. it's so depressing: youtube.com/watch?v=IpDQ9VXo8dQ
 
Ok i gotta go .. cya everyone :)
 
 
1 hour later…
3:31 AM
Can I get some help with this question? I've really been trying at it for a while, and I followed the example. stackoverflow.com/questions/39553720/…
 
@ilarsona eval is a terrible idea
 
What would you recommend? I was gonna go long form with an if statement...
It seemed like a far easier way to just return a boolean
 
@ilarsona I'm no expert but why do you need an eval to begin with
just remove that it
I think it should still run
 
@William If a certain option is selected, it will require another field that appears to the user.
 
@ilarsona try it without don't think it is needed
 
3:38 AM
@William I can't just remove it, but I can substitute it with something else. Both fields are not required (both of the ones with eval in it), it's one or the other.
 
@ilarsona did you try make a jsfiddle
 
I'll do that
Hold on, why am I creating one? @William
 
@ilarsona you don't have to nevermind
 
If you need me to further explain the eval statement, @William, I can.
 
please do
@littlepootis you around
 
3:44 AM
"If the value of the select statement with the id 'type_of_contract' equals 'fss', then require this field."
Instead of writing it inside an if statement, I used eval to determine if a statement was true, like "'type_of_contract' = 'fss'"
 
Is it possible to get google map api key using javascript?
 
@IññoceñtÙšmâñ Welcome to the JavaScript chat! Please review the room 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.
 
Is that a bad thing? @William
 
@ilarsona eval is frowned upon and in your example I don't think it is needed
 
I'll look into fixing that, but it still isn't my primary problem @William
 
3:55 AM
@ilarsona I'm not sure how the validate function works but you could just add if and else statements saying what does and doesn't work
 
Sorry, I'm confused, if/else for what, the evals or for the length of #vin?
@William
 
@ilarsona so in addition to the validate you are trying to check if the VIN is above 17 characters yes?
 
I'm trying to check if the vin is 17 characters with the validation plugin
Which they even show is possible, it's just not working in my code for some reason
 
@ilarsona screw the plugin that is my advice
I don't particularly like plugins
you can do whatever you want
 
Before this, I had code that checked the length, and that worked. But I found the plugin and it will validate the whole form and that's ultimately what I needed.
If I just return false with if/else, will it prevent it from being submitted?
 
3:59 AM
yes it will prevent it from being submitted
 
That should work for now.
Just kidding, I fixed it myself. In my form, I had min=17 and that confused it.
@William is this a better way to do it instead of eval? jsfiddle.net/oaLa05vq
 
yes exactly
eval is i believe disabled in strict javascript mode but i'm not 100% sure
 
Why is eval bad?
 
365
Q: Why is using the JavaScript eval function a bad idea?

Brian SinghThe eval function is a powerful and easy way to dynamically generate code, so what are the caveats?

 
That's it?
(I did Google it before I asked)
 
4:10 AM
Those are not bad reasons
 
Isn't 'if' just an eval function, that triggers code to run if it returns true?
 
no!!!!
you don't really understand what is going on which is okay
 
I thought it was, and following that same logic, it should be just as fast/just as slow
 
they are very different
eval("if(true)alert('true');")
try running that
 
true, because that's a string...
If I run it how I thought you meant it, though, SyntaxError, unexpected token
 
4:23 AM
@ilarsona eval is bad because several things
The most prominent reason is that people most often use it to evaluate code that comes in part or in full from user input
And that's dangerous.
 
@MadaraUchiha Raw user input, like a textbox? I was using it with a select, which is less 'stupid proof'
 
@ilarsona What are you trying to do?
If eval is the answer, usually the question is wrong.
 
@MadaraUchiha Leme put my answer into a fiddle, since I solved my own question and deleted it. I'll show you.
It looks something like this, @MadaraUchiha jsfiddle.net/8p404yb7
It will require that field if a certain option is selected.
 
@William now I am
 
And eval() is needed here... why?
 
4:30 AM
No, because that will set the value to that.
and it'll return if it did it or not
I looked at the documentation, which is written for a checkbox. It uses .is('checked') as it's evaluator, and it gives back a true/false. Eval does that, and I needed a returned true/false.
I rewrote it using if/then, which is longer but seemingly better, @MadaraUchiha
 
Mines returns a Boolean as well...
 
Oh my gosh, does it? :D
Maybe I tried it but without "return"
 
It's return something === something else, it always returns a Boolean...
 
Oops.
Thank you, x a billion.
 
user2620028
4:48 AM
could anyone give me ideas why a returned dataset from a query would not match the data in the database for the same query
 
user2620028
i am in a joomla install and using their database interface class and i will get the right row returned (has some of the correct data, but then there are columns of data from the same row that dont match what is actually in the db
 
5:00 AM
@RyanKinal Happy birthday! :D
3
 
user2620028
5:54 AM
fuck.... nevermind i figured it out myself finally
 
Wes
6:07 AM
do you guys actually care of undefined/null semantics or you just use undefined?
hey SomeGuy \o
 
6:24 AM
what semantics
also, is your avatar a nazi panda?
 
Wes
nope. it's just a waving panda
the difference between "nonexistent value" and "no value" is very subtle, especially in js that has basically no types
 
null is neither of those
well, I guess you could say that
null is something you set a value to
to indicate it doesn't exist
it being a variable
undefined means it was just never defined
 
Wes
6:40 AM
to indicate it doesn't exist -> to indicate the variable has no value
 
or has a value of null
undefined isn't something you would set a variable to
or you shouldn't
 
Wes
which is the placeholder for no value
 
user2620028
technically its just the placeholder lol
 
Wes
i agree with that but it seems reading others code null is quite literally never touched
 
to me the line between null and undefined is very clear
 
Wes
6:42 AM
probably because using undefined only is easier
 
you are not supposed to set stuff to be undefined yourself
if you really had to do something like that, you would use delete
 
Wes
eg
function A(optArg){
    this.foo = optArg === undefined ? null : optArg;
}
A.prototype.baz = function(){
    return this.foo + .... / ...;
}
 
I would just use == in this case
 
Wes
do you bother converting all the undefineds in null, like here?
 
in a perfect world you wouldn't be in a position where you don't know what something is
 
Wes
6:47 AM
perfect world? you mean a strongly typed language? :P #shotsfired
 
I guess so, almost anything I write from scratch nowadays is in typescript
 
Wes
@Mosho tbh i don't care about types at runtime
are there static type checkers for js these days?
i imagine typescript actually being one
or are types checked also in the compiled code?
 
not for now
 
Wes
answering which question? :P
 
6:53 AM
the last one
typescript isn't a "static type checker for js"
per se
maybe flowtype can go by that definition
 
Wes
that actually makes it interesting for me. i need to check it
anyway, in plain js, would you bother doing
this.foo = optArg === undefined ? null : optArg;
or would you just go with
this.foo = optArg;
and literally never mention null like ever anywhere in the code
 
You
hello all
 
Wes
hello - said the waving panda
 
You
How's it going, @Wes?
 
Wes
bad. they say i must reproduce myself with my lady or i'll go extinct. but i only like to roll in mud and climb trees - answered the waving panda
 
7:05 AM
@Wes well, in that case you can do optArg || null;
or a default value for optArg to be null in the arguments list
 
Wes
@Mosho what if optArg is bool :P ie 3 possible values, true false and null
 
default value
 
Wes
that is es6 right?
 
Wes
thanks for the help folks
 
7:37 AM
@towc hey! Can you create patterns like shared.awalgarg.tk/abstract.jpg these with canvas?
 
7:58 AM
@AwalGarg if you provide the maths I can provide the code...? Can't think of the maths tho, unless it's just a tiling with a trailed color
 
@towc don't have any maths. Just need to generate a bunch (16) of images similar to that.
 
ok, so the coloring is not a problem, just need to think of a way to tile those
but it surely is possible
 
8:14 AM
Is there any point in watching an Ember 1.6 tutorial, when I'll be working on 2.*? Are they like the 2 Angular versions?
 
@towc Don't call me Shirley.
 
not sure I'm getting the reference
 
@towc "Surely you jest!" "I don't jest, and don't call me Shirley."
 
from?
 
@towc tile what? do you have a link to some article explaining this stuff?
@MadaraUchiha that's incredibly stupid. cc @littlepootis
 
8:22 AM
@AwalGarg it's just orthonormal non-regular hexagons, right? aka hexagons whose angles are tau/4 or tau/8
 
so you need a tiling algorithm for those kind of hexagons, knowing that the size and order of angles is random
for the color you just take the color values at 2 of the 4 tau/4 sides and drag the color up to the remaining 2
 
@towc I think I see what you mean (I don't). How much would you cost for doing this? :P
 
if you were from a company I'd go on explaining you how complicated the maths is and sucking money out of you, but in reality it's just going to be ~2hrs of chilled tiling research and ~2hrs of implementation
and given the experience with the implementation part, normally that would be £40/hr, and £20/hr on the research because that would benefit me as well, also considering that I'd be asking the maths people here about it as well
now, since I'm not completely a money sucker, I can do it in my free time for my own amusement
when do you need it for?
 
Just use the jpeg
 
8:29 AM
and a kernel neural network?
not sure that would work :/
a recurrent kernel neural network perhaps
but that's probably too far fetched for me
 
user2620028
8:55 AM
@towc Airplane. A movie you obviously need to watch.
 
9:13 AM
Can I get some input on class file name conventions?
SkeletonMage.js, skeletonmage.js, skeletonmage.class.js, skeleton_mage.js, Skeleton_Mage.js, skeleton_mage.class.js?
Which one would you say is the best? I am resigned to using camelCase with javascript since everything else is using it, but what about file names?
 
9:39 AM
@Schoening we don't use different files for classes
 
I'm running node.js 4.4.5 and it has class support.
Wait. So you are not using separate files for your classes o_o' Is that a joke I am not getting?
Ah. Ok nvm you mean the distinction. Well, alright I guess..
 
@Schoening Do whichever you want
But stay consistent.
 
10:15 AM
Hi, I've tried using browserify with gulp, based on browserify handbook and gulp recipes, but can't make the sourcemaps to work. Tried https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md this copied and pasted, still no luck with sourcemaps.

Mostly I wanted to use require(...) for npm modules and my local moudles, but should I do it differently for local web development?
Like... do I really need to bundle my projects .js to use require(...)?
 
@mrówa what do you mean by "do i need to bundle to use require" ? Are you asking for a way to use the require keyword in your browser directly?
Because if so, that is not possible.
 
10:34 AM
it is with the requirejs library :p
but yeah, not natively
 
hi guys
i have a question about goolge maps
 
10:45 AM
Sorry, but i speak only spanish.
 
@ArtEze Welcome to the JavaScript chat! Please review the room 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.
 
@CapricaSix ok, thanks.
Unicorn XD
Alan Mathison Turing OBE FRS (/ˈtjʊərɪŋ/; 23 June 1912 – 7 June 1954) was a pioneering English computer scientist, mathematician, logician, cryptanalyst and theoretical biologist. He was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence. During the Second World War, Turing worked for the Government Code and Cypher...
 
11:05 AM
unicorn to you too
!!welcome Sherlock
still in mindjail, am I @rlemon?
 
anyway
@Sherlock Welcome to the JavaScript chat! Please review the room 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.
 
11:21 AM
@Schoening Thanks.
 
what do you call "?
nvm
quotation marks...?
 
11:41 AM
I call them doublequotes
 
12:01 PM
@rlemon I can't believe I've never read the Wikipedia page on the ISS's assembly en.wikipedia.org/wiki/International_Space_Station#Assembly
 
12:25 PM
!!unban towc
 
@Luggage towc freed from mindjail!
 
12:43 PM
thaaanks
 
 
1 hour later…
1:50 PM
@towc hmm is it not possible to sprinkle a lot of those hexagons randomly everywhere on the canvas until it looks full? The original image has overlapping too if you look carefully - they are not exactly perfectly aligned (and the overlapping is "flattened" which is what gives it that orthonormal look)
 
2:04 PM
 
I don't see any overlapping tbf. Sure, I see also pentagons and quadrilaterals, but they can be derived just by adding 0 to the 45 and 90 angles
although yeah, you probably can fake it pretty closely by just adding hexagons
 
Okay then I'd just write a macro for Krita for now and hand-draw with it 16 times. Thank you for looking at this though @towc!
 
Hey guys, does anyone see anything wrong with this code? I'm basically just trying to add class 'current' to the .navAnchor
$(document).ready(function(){
  var path = window.location.pathname.split("/").pop();

  $(".navAnchor").each(function(){
    if($(this).attr('href') == path){
      $(this).parent().addClass('Current');
    }
  })
})
 
2:30 PM
no prob @AwalGarg! If you just want the hexagons added on each other I can do that in a few mins if you want ;)
 
 
1 hour later…
3:39 PM
morning guys
quick question. how can i get the class text using DOM. the node is <i class="ui2-icon ui2-icon-gs-year-num11"></i>
 
or a newer classList property that lets you add/remove individual classes without messing with string manipulation
 
@Ming el.className => ui2-icon ui2-icon-gs-year-num11
^^
 
@littlepootis thanks :)
 
 
2 hours later…
5:28 PM
hey guys. what does this mean as a dom selector? form[action*="/search"] [name=p]
what does form[action*="/search"] do?
 
@Zirak thanks :)
 
Enjoy
 
holy shit holy shit I've set the frequency of a piezo on my espruino to be 0.5 (so it ticks every second), and had put some wiring and buttons on it with a display with a playable maze. Was just testing the piezo so that it would ring when the player hit walls, but it was just 1 tick a second continously when mate comes into the room and thinks I'm making a bomb
 
quick check. how can i simulate a typing using DOM?
 
5:36 PM
yes
as in, JS + dom
as of now I'm kind of enjoying living to a ticking sound. Better perception of time and how much of it I am wasting?
 
@Ming what kind of typing?
 
dom typing
using dom in console.
 
oh
you mean fake typing, not just make it look like you're typing to the user
 
@Ming inputElement.value = "content" works
 
mostly you can, yeah, but there are some things that you can't normally set from javascript
 
5:40 PM
If you're talking about simulating keypresses, I've got no idea.
 
so you need a sketchy browser to give you the permission to access those values
like e.isTrusted or something similar
 
159
Q: Simulate JavaScript Key Events

tanIs it possible to simulate key press events programatically in JavaScript?

 
@littlepootis first one to get to teapot points wins?
 
the teapot is a myth
 
maybe your teapot
in the uk teapots are quite real
I've seen like... 2
 
5:42 PM
I've never seen one in my life..
 
@littlepootis thanks :)
 
@littlepootis you haven't lived yet
there are no teapots in the matrix
 
can i have a selector like this? $$('input[type=email] [name=email]')
it does not work, but wondering why it works for this. 'form[action*="/search"] [type=submit]'
 
So what's everyone saying about angular 2?
 
5:58 PM
@Ming because it's expected that [name=email] is a child of input[type=email]
which it's not
 
6:19 PM
i see. got it. thanks @bitten so, if i have a node like this <input value="Log In" tabindex="4" type="submit" id="u_0_l"> how can i select both value=Log In and type=submit ?
 
@Ming then you'll just chain it like input[value="Log in"][type="submit"]
 
@bitten thanks :) it worked
 
I am trying to set up my node.js / express server as a proxy for some third party data.
Gotta to do multiple GET requests before I send the data to the client.
I think this is still non blocking.
But would like some confirmation if I am right:
http://hastebin.com/odofiwidug.js
 
@Ming ^^
although read the link that Zirak posted above, you'll learn it all there
@Schoening you could use Promise.all on lines 9-26 btw
 
I haven't used promises before, so I tried without. Thank you for the tip @bitten I will read up on Promises and Promise.all. Not sure if that was a yes or no to my answer tho, a yes I think?
 
6:34 PM
@bitten yeah. that was a good link. will take a look at that
 
@Schoening i don't really know what you're trying to do, just pointing out a nice place for promises
i haven't tested that code, so i may have missed something.. but that's the idea
 
Damn.. well it sounds like me to not explain it enough. Was just wondering if that code, (or your promise solution for that matter) is not gonna block up the thread while it waits for the callbacks. I think it doesn't but wanted to make sure. @bitten
That is a really with the promises btw. Thank you. I will totally start using those.
 
@Schoening why do you not want it to block the thread? what else do you have going on?
also you should clarify your semantics, javascript code will always "block" the thread as it's single threaded
 
It's a server. Other people wanting to get data from it :p
 
it's asynchronous because of it's event loop, not because it's multi threaded
are you worried that using your node app as a proxy is going to take up too many resources?
as i'm unfit to comment on that, sorry :3
 
6:43 PM
Ah, I guess I see what you are saying about the semantics. I just want to make sure that this is a totally async operation. So that other users can request from the server while these requests / promises are still waiting for their data :)
 
@Schoening your question is answered on the homepage
> Node.js uses [a] [..] non-blocking I/O model
^^
 
Yes I know. Just wanted to check that I didnt fuck it up somehow. Guess I didn't, yay :p
Thanks for the help and the promise syntax
 
i'm not fit to answer it exactly but generally.. yeah, your code is non blocking and async ^^
 
Thank you :)!
 
no problem!
 
 
1 hour later…
7:59 PM
Does anyone here know of/has used an immutable graph structure?
 
!!welcome david
 
@david Welcome to the JavaScript chat! Please review the room 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.
 
!!welcome towc
 
@towc Welcome to the JavaScript chat! Please review the room 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.
 
> 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.
 
8:04 PM
That was my question...
 
sure, "can I ask a question?" is a question
 
sure is
 
8:16 PM
Have been playing around with Alkali, and am feeling missionary like React people where for some years ago :)
Anyone here that knows about it and/or has tested it?
 
I haven't, taking a look now. Just a note: your api page has 'bellow' instead of 'below'
 
@david ah, typo, thanks will fix.
 
 
2 hours later…
10:14 PM
Hi guys
 
@TeodorKolev The simplest way would be to pass down a 'callback' function to the child component that it could call to notify the parent when the length is 0
but really if the parent component needs to know the length of the data then it should be the one in charge of that data. You would then pass the data down to the ListViewComponent
 
10:30 PM
hey everyone. quick question... when you install nodejs forever module, do you type the install command from the root directory of your project or the /server directory?
 
@LXXIII Welcome to the JavaScript chat! Please review the room 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.
 
@LXXIII Do you have a package.json file in your /server directory?
 
@david no package.json is in the root directory of the project
 
then you'd do it in the root directory
 
thanbks!
npm WARN notsup Not compatible with your operating system or architecture: fseve nts@1.0.14

But I'm running Ubuntu v16 and nginx through Linode. I don't understand
 
10:38 PM
@LXXIII no worries, you should also maybe look into pm2 (github.com/Unitech/pm2) and come back and tell me which you prefer
npm warning are weird sometimes... that might be a dependency that isn't actually needed for you... check to see if it works anyway. It was a warning not an error after all :D
 
10:57 PM
i like npm
 
i'm sure npm likes you too
 
yea
 
I'd love to see some pictures of this out in the wild: http://support.wasdkeyboards.com/customer/portal/articles/1973584-vim-layout

It sounds like it could be amazing, but I'm not brave enough to drop $ on it incase it comes out terrible.
(That's vim keycaps for a mechanical keyboard)
 
11:34 PM
thanks a lot david! I got forever working! just had to install like 10 dependencies lol
 
11:46 PM
@david their keycaps are pretty good
I ordered a set last year from them
 
@Loktar Just regular ones? I've heard people say the quality is good apart from the printed tops which rub off quite quickly
 
heh in fairness all mine were blanks except 2
 
Just coloured?
 
yea
 
I'm a little tempted to get a set of pure white keys cos I think that could look quite cool on a black backing...
ahhh
yeah like that! light on dark
 
11:50 PM
yeah it's pretty cool how custom you can make the sets from them
 
I'm just worried that dirt would show up super bad
yeah, i've seen lots of WASD highlighted game ones
I like that the blue in yours kinda makes a shape like a coffeecup
to match the ESC
 

« first day (2164 days earlier)      last day (2769 days later) »