« first day (2061 days earlier)      last day (2905 days later) » 

12:31 AM
@JohnDotHR .inner { height: 50vh; }
 
 
2 hours later…
2:37 AM
// Create a reducer
// (ES6 syntax, see Advanced usage below for an alternative for ES5)
const counterReducer = createReducer({
  [increment]: (state) => state + 1,
  [decrement]: (state) => state - 1,
  [add]: (state, payload) => state + payload,
}, 0); // <-- This is the default state
What does this ES6 code mean?
[increment] : lambda
I'm reading this redux tutorial github.com/pauldijou/redux-act
Can we use arrays as object keys in es6 ?!
 
hello
 
@Wusevari 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.
 
are you a bot hue
 
biiiiiip bup
 
2:42 AM
Any idea on the freak es6 syntax above ?!
 
A little googling would have worked
1
Q: Square Brackets Javascript Object Key

lcharbonCan anyone explain how the why/how the below method of assigning keys in javascript works? a = "b" c = {[a]: "d"} return: Object {b: "d"}

 
@KendallFrey ahha, i tried other terms. thanks
 
why are some profiles pics more colored than others, those pics ---->
 
inactive users fade out
 
I have 980 gpu and the last chrome version, and javascript tells me that EXT_frag_depth is supported, but when I add gl_FragDepth = 0.0; to my fragment shader it doesn't compile, whats going on here
 
2:48 AM
is there an error message?
 
gl.getShaderParameter(sv, gl.COMPILE_STATUS) is the line that fails when I add gl_FragDepth = 0.0;
 
Can you post a minimal complete code sample?
 
my code is very big, I am trying to find any webgl demo online that uses gl_FragDepth to see if it is my mistake or is my computer
 
I assume you're not trying to set it in a vertex shader
 
I put gl_FragDepth in the fragment shader
 
2:59 AM
What does getShaderInfoLog return?
 
ERROR: 0:30: 'gl_FragDepth' : undeclared identifier
my last two lines in the fragment shader are
gl_FragColor = vec4(skyColor(ray), 1.0);
gl_FragDepth = 0.0;
can I write to gl_FragColor and gl_FragDepth in the same shader?
 
3:19 AM
@amin No, that is not array object. That means increment is an expression, instead of textual property name.
@amin A more formal name is "computed property name": developer.mozilla.org/en/docs/Web/JavaScript/Reference/…
ES6 has many new syntax, sometimes with new logic. Try to learn it organised, instead of trying to deduce it from ES6 snippets.
 
3:34 AM
I tried gl_FragDepthEXT instead of gl_FragDepth but then it tells me that I need the GL_EXT_frag_depth extension, so I eanble that extension and then it tells me ERROR: 0:30: 'gl_FragDepthEXT' : undeclared identifier, wot
 
You are a brave soul, Wusevar. Don't give up! :)
 
anyone knows a website that has a working demo that uses gl_FragDepth?
in webGL of course
 
Have you tried placing this GLSL directive in your shader code?
#extension GL_EXT_frag_depth : enable
 
3:57 AM
just tried
#extension GL_EXT_frag_depth : enable
and
#extension EXT_frag_depth : enable
with their respectives gl_FragDepthEXT and gl_FragDepth
and the two told me
the shader compailer failed with bla bla bla extension not supported
 
Tried Firefox?
 
Guys, what is the method of styling a page with the style like bootstrap home page? startbootstrap.com
So it's like a load of contents but user just has to keep scrolling down to view all of contents..
 
nop but if it doesnt work in chrome then I will be missing a lot of users
 
And if it works in Firefox than you can be sure it's a Chrome issue. Otherwise it is either js or driver.
@choz I don't see that on your link. And I don't think there is a magic bullet method that does what you want...
 
@Sheepy Really? I first thought it was like masonry.. but its actually not..
 
4:13 AM
Bootstrap has many things. It has a responsive grid layout system. But it doesn't "hide contents until user scroll", if that's what you are after :/
 
@Sheepy Well, I just happened to come across this sprint where I should finish this one page application in less than 8 hours. If I cant find anything to help me implementing this within the next hour, Ill just go manually as you said..
 
I'd google some examples if I'm in a hurry :)
 
That's what I am doing.. And I've seen some of them really implement this manually.. Lol
 
I expect that's the norm. I think this is a technique first developed to reduce requests and improves page delivery... which would be moot if you put everything in the html anyway.
Imagine facebook, where you can just scroll on and on and on forever... it can't load them all on start, can it?
 
That's one different thing.. There's no ajax request on this one page application I am developing. It's simply contents..
 
4:23 AM
Figured that when you want a method to do that with boodstrap grid :) Good luck!
 
Does anyone get what a GADDAG is?
 
@littlepootis I fully expect the final phone and email icon to be clickable. Insane web design skill indeed :<
 
4:47 AM
@littlepootis Tq for the source.. I notice that site has almost the same external library as blackrockdigital.github.io/startbootstrap-creative
 
@choz That is intentional. The site is a mockery of the "grab a bootstrap template" mindset.
 
Building an ecommerce site - Confused between Angular and React, SEO is one of the primary focusses ? Suggestions
 
@PKaura 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.
 
@PKaura use php
Andgular and React are not the right tools for what you're doing.
Especially when you care about SEO.
 
Yeah. w3school used neither.
2
 
4:55 AM
Lol
 
5:07 AM
Is it just me that gives 0 shit to w3school?
 
wow.. 2013 messages posted since I was here last, about 14 hours ago
you people have been busy
 
@choz It is safe to say most of us don't have high regards of it (if not outright hostile). But you can't deny that SEO is where it succeed. Combine that with our low esteem for it and that's why we laugh.
@JimmPratt This is quiet time for this room, you know. :)
 
Sometimes I forget that w3schools exists but then this room reminds me
 
@Meredith google usually reminds me lol
 
@Mayhem50 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.
 
5:18 AM
Idr the last time I googled something javascript related
Usually I just search mdn directly
 
Usually I type in my address bar and an MDN url will come up.
Just need to make sure to select the normal page, not the edit page. :/
 
@sheepy Yeah same, or w3schools or stack overflow etc
 
Lol. The rules caused me to lose the game in the first time in a year or more.
 
@cyclingLinguist 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.
 
Anyone know of any good generic replacements for alerts,, confirms etc?
 
5:26 AM
Modals
 
Ok, I am stupid and don't understand this line: 0 <= window.location.href.indexOf("/testing") && (testing = !0); How is this useful at all? Doesn't it just evaluate to a true or false? But it is not inside an if statement so I don't see how it does anything.
 
i tend to stick to HTML Rocks, over W3Schools... the later is kinda ok for a rank beginner (I'd still recommend codecademy though), but once you are ready to 'level up' there are much better websites for learning web development
 
@cyclingLinguist I like use of !0 lol
 
@Sheepy it's 7:31 AM! time to get programming! \o/
 
if I type !lol does it mean i'm not laughing?
 
5:32 AM
lol
 
3:33pm down under, time for a beer
 
nice
 
I guess !0 is shorter than true, saved two keystrokes.
 
@cyclingLinguist Is that supposed to be testing = !0?
Or just a typo for ==
 
@Mayhem50, yeah I just put it together that type coercion is going on there.
@Meredith This is someone's production code that I'm looking at in chrome dev console. So I don't think it is a typo.
 
5:35 AM
That's some really bad code then
 
@Mayhem50 Define your requirements for "good generic replacement"
 
I'm pretty sure it's most of the game logic for slither.io
 
@cyclingLinguist It means If location.href contains "/testing", set testing = -1.
 
(Not that one line of course.)
 
Because, if location.href does not have testing, the left hand side of && is false, then && won't run the right hand side which is an assignment.
 
5:37 AM
or just use 'true' or 'false' for readability?
 
The fact that it replace if with && already says plenty about its readability, if you ask me...
 
You should use an if statement there
Nobody is going to read that line and understand it immediately
 
@Shee Oh wow, I wasn't noticing that the right hand is a statement and not a comparison equality.
 
It's always gonna take a second or two
& either I'm slightly misunderstanding the code, or you can write that without an if statement or being clever
 
@cyclingLinguist One of the advantage of always using === to compare. The length different is more obvious :)
@Meredith I read it the same. And I read the style intent the same...
 
5:41 AM
With my code if i'm browsing through, if i need to really stop and think about a line i might try to re-write it.
 
Good habit.
 
I would consider some reg ex for that if.
 
hey guys.........fresher is coming...!!! sorry to disturb you...
 
@Ravi 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.
 
i'm developing application with laravel. it doesn't matter. I want to know how to add my own keyboard keys as shortcuts and use it anywhere in the application
 
5:45 AM
@Shee did you mean it means set testing = true?
 
like a library
I checked mousetrap, openjs for shortcuts.. but it just adding things. I don't like that. i want like a library or js file and use it anywhere
 
@cyclingLinguist I mean the habit of rewriting code to make them reads simple. Your code may set testing to -1, which can be compared with true but is not true.
 
1 message moved to Trash can
@Mayhem50 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
var str = 'www.test.com.au';
var re = /(test)/i;
var found = str.match(re);



if (found.index === 0)
{
	// do somthing
	console.log(found);
}
 
I really wouldn't use regex for that
 
5:51 AM
@Sheepy 0 <= window.location.href.indexOf("/testing") && (testing = !0); Hmm maybe I'm still confused. Shouldn't the right part evaluate to true if the left side is true?
 
The right hand side always evaluates to true iirc
 
sorry bad example, I changed my if at the last moment from > 0. @Meredith just an idea is all to keep it simple to read quickly.
 
But there's a side effect
 
@cyclingLinguist Sorry I misunderstood. Yes you are right. I mistook ! for ~. Yes it will be true.
 
@Sheepy Ah, ok. Thanks!
 
6:00 AM
!!ice cream or no ice cream
 
Stupid caprica I knew it'd pick the second option like always
 
I want ice cream
 
personally I hate it when I see
if (!icecream)
what is icecream a int, , string, undefined or null/object
but not as much as if (!!icecream) or if (!!!icecream)
 
user3119231
o/
 
6:05 AM
I like to do !!!!!icecream just to make sure
 
If i use vanilla.js and have var icecream
will If (typeof icecream === 'vanilla') always be true?
 
!!> typeof icecream === 'vanilla';
 
@Meredith false
 
Must be chocolate
 
Should go to coco channel and use same joke....
 
6:11 AM
Ok, another random question. Has anyone ever dealt with a websocket server more often than not, but not all the time, causing this complaint on a websocket client Error: Sec-WebSocket-Accept header from server didn't match expected value of X where X is an alpha-numeric key thingy?
 
Are you creating websocket connections in a loop
 
@Meredith I don't think so. It's just a one time attempt.
If I try enough times, eventually I can connect.
 
user3119231
@cyclingLinguist you can check open ports to identify if there are too much
 
user3119231
I remember creating a new connection in php for every mysql request I did. The result were several critical errors (including the total break of the server)
 
@Maurice You mean check to see if there are too many connection attempts in a short amount of time?
 
user3119231
6:25 AM
@cyclingLinguist Let me check the time - It's 08:25 here so probably anything I say is shit. Or maybe not. You decide. But you can give it a try
 
@Maurice Lol. D'accord.
 
6:41 AM
I got chocolate ice cream :]
I didn't listen to caprica, she's just a troll anyways
 
yo
any one watch game of thones
 
@Shea No, you are.
 
user3119231
well played, pootis, well played.
 
Oh gee I wonder who said that
 
@naeluh Spoilers get you kicked.
 
user3119231
6:47 AM
First he needs to explain me "game of thones" - Is new series depending on game of thrones? :P
 
@naeluh No, what the hell is that?
 
1 message moved to Trash can
@Mayhem50 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
if (!hodoor)
{
 meSad()
}
 
cheese
 
7:09 AM
can i use the fetch API to add Data to the database? Haven´t found any example for this? Or does one use sth else for redux?
 
@elsololobo No. Most database does not have web-accessible API. You usually need a server side language as the bridge between web server and database.
 
yeah my Question was bad formulated :) Is jQuery .ajax still state of art of react redux do get/post data async with database?
to get data i currently use isomorphic-fetch API
 
$.ajax still works well enough, yes
 
^
 
okay thanks :) thought there would be also something new that i prob missed :)
 
7:22 AM
Fetch exists, but why use it when you have jQuery?
!!mdn fetch
 
@JanDvorak Something went on fire; status 403
 
@rlemon fix her pls
 
thought guys do it when using react/ redux ^^
 
hey anybody know why image is flashing only in Firefox, while updating the image tag im fed up with this :(
 
@elsololobo Fetch has a more modern design, but $.ajax covers that front for you. Fetch can also do things that XHR can't, but those tend to be low level features. Learn it, but there is nothing wrong with sticking with $.ajax that every new grads understands.
 
7:27 AM
okay, thanks :)
 
@Pramod Do you mean this bug?
 
@Sheepy in js im updating img src value changing in every 5 sec only in firefox image is blinking
yes
 
It's the linked bug then. Seems to be an old bug that's tough to fix.
 
I'd classify that as a bug in Firefox, but try double buffering anyways
 
Or perhaps try preload the image and swap with blob url.
 
7:31 AM
yea seems like its FF bug, is there any workaround
 
Would swapping two image elements work?
show one, set the url for the other, wait five seconds, repeat
 
@Pramod Workarounds are often noted in the bug thread
 
actually its not flashing onload , its flashing after sometime. And it wont happen if we're not scaling that image, means we didnt give heght ot width
 
document onload or image onload? what happened after "sometime" that triggers the flickering?
 
Im using image onload only. after that flickering nothing will happen, its just like refresh the image
 
7:41 AM
So it sounds like the bug. I linked to two workarounds, you can try them. That's all we can help.
 
@HosamMourad 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.
 
@HosamMourad ...
 
@littlepootis ....
 
@HosamMourad ..
 
user3119231
7:56 AM
@FlorianMargaine ...
 
@Maurice ....
 
@Cerbrus ...
 
So, it is my understanding that you should reference frequently used libraries from a CDN location, so that the browser can easily retrieve and cache it. And when the resource is requested again, it's already in the browser cache, right? Then why does Chrome request all my CDN resources on every page load anyway?
It comes back with a 304, but still, wtf?
 
does it say "from cache" when requesting it?
 
@GNi33 No
10
A: Why does Browser still sends request for cache-control public with max-age?

woolagarooIf the HTTP Response contains the etag entry, the conditional request will always be made. ETag is a cache validator tag. The client will always send the etag to the server to see if the element has been modified.

That seems really counter-productive then. The resource is ultimately read from the cache, but I have to wait for the round-trip to complete anyway
Why is everyone serving the file with an ETag to begin with?
 
8:11 AM
@MadaraUchiha I've thought about it, and you're going to have a hard time trying to read the .asd file correctly. It's probably easier, and actually more correct to use regex to look for the :depends-on (). More correct because otherwise, you won't be able to restore the content to what it was before.
 
@FlorianMargaine How so?
 
Well, not everyone, but this seems to be the root cause for some requests
Oh and also, it makes a difference if you press F5 or press Enter in the address bar O__o
 
@MadaraUchiha because of stuff like this github.com/fukamachi/cl-project/blob/master/skeleton/…
this is a read-time macro
you won't be able to restore it if you (read) the forms in the .asd file
 
@FlorianMargaine What is?
 
@MadaraUchiha the #. thingie
 
8:16 AM
@FlorianMargaine Isn't that part of the templating engine?
 
@MadaraUchiha nope, that part is Common Lisp
a .asd file is interpreted as a Lisp file, it's not just a data format
 
@FlorianMargaine Yeah, I get that
OK so, basically, I need to actually parse the file in some way
I can't have the reader do it for me.
 
As of this date, Costa's reply is still relevant: Chrome sends a max-age=0 in the request header if you refresh the page. If you press enter in the URL, it doesn't. — DarkNeuron May 9 at 12:34
 
okay, I hear that for the first time
 
8:18 AM
0
A: Why does Browser still sends request for cache-control public with max-age?

Oliver SalzburgWhen you press F5 in Chrome, it will always send requests to the server. These will be made with the Cache-Control:max-age=0 header. The server will usually respond with a 304 (Not Changed) status code. When you press Ctrl+F5 or Shift+F5, the same requests are performed, but with the Cache-Contr...

There we go, TIL!
 
@FlorianMargaine Yeah, I already found that one
 
@MadaraUchiha since you just want to replace just the deps, I suggest going through regex.
(using cl-ppcre)
 
How is #. different from a normal macro though?
Is it basically an anonymous macro?
 
it's not run at the same time
(read-time vs compile-time)
 
mornings
 
8:25 AM
I see
CL-USER> (read-from-string "(format nil \"Hello world\")")
(FORMAT NIL "Hello world")
26

CL-USER> (read-from-string "#.(format nil \"Hello world\")")
"Hello world"
28
 
did you break the internet?
 
@tereško Nah, playing with Lisp
 
@MadaraUchiha yup, so you couldn't restore it
I suggest regex because the other way is a full-blown Lisp parser :)
 
Isn't writing a LISP parser supposed to be easier than writing a regex?
 
@FlorianMargaine Yeah
 
8:35 AM
@littlepootis a Common Lisp parser
 
But what if the value of :depends-on is itself a read-time macro?
 
then the guy ought to get fucked
 
Hello guys !
What is the best way to add javascript to modify a page in our brower nowdays ? Is it still Greasemonkey ? because most of the article I see on it are pretty old
 
@FlorianMargaine For example, say I'm a hardcode node fan, and I want my dependencies in a package.json format
 
if that's the case, you can't restore it correctly, so you can't do anything with that anyway
 
8:36 AM
So I write a mapper function from JSON to the format of :depends-on and call it in read-time
 
yeah, or you're a hardcore python and you put your deps in requirements.txt, but fuck off either way :)
seriously, I've never seen that
 
OK, fair enough
 
I've seen it for the components, or for the description/license, but never for :depends-on
 
@FlorianMargaine So in the example you gave, he's basically copying README.markdown into the :long-description, yes?
 
@MadaraUchiha yup
which is pretty neat, if you ask me
 
8:40 AM
Yeah, that's pretty cool
But then again
It's something I'd expect ASDF/quicklisp to do
Not require that of the author
 
?
whatever you want to say, I completely disagree there
 
@FlorianMargaine Read the README file and use that in the long-description
i.e. not take it from the manifest file
 
that's not necessarily what the author wants.
that's metadata, that should be 100% from what the author specifies
 
@FlorianMargaine There's a line where flexibility becomes cumbersome
Also, sane defaults, just sayin'
 
not there
 
8:43 AM
@FlorianMargaine vOv
What's wrong with how npm does it, for example?
 
npm doesn't have a long description?
 
@FlorianMargaine Sure it does
It takes it from the README file
 
it uses the readme on the website
that's about it
 
@FlorianMargaine How is it any different?
Quicklisp doesn't have a site (to showcase packages) or an open repo per-say, but isn't that kinda the point of a long description to begin with?
 
if quicklisp had a website, I'd be fine with using the readme, yes
but for the system's metadata, it's different
 
8:51 AM
Another question
@FlorianMargaine how does quicklisp/asdf handle multiple versions of the same dep?
(does quicklisp even has version handling whatsoever?)
 
it doesn't
 
So it just kind of assumes I want master from all my dependencies?
 
no, quicklisp has a concept of distribution
 
@FlorianMargaine "distribution" how?
There isn't even a self-service for adding packages to it
 
it makes sure that all the packages shipped in a version (monthly) work together
 
8:55 AM
Wait, there's a quick lisp?! What have I been using all this time then?
 
@Neil quicklisp is essentially npm for lisp
Sorta
 
well, s/work/compile
 
@FlorianMargaine That's nice, but I can't say which distro I want in my manifest, can I?
 
@MadaraUchiha no, asdf isn't part of quicklisp
 
@FlorianMargaine How is that not a big problem?
 
8:58 AM
*googles quick java*
 
(not that asdf and quicklisp as separate, but that you can't specify the versions)
 
Morning
 
I do something like this when I want a specific version github.com/ralt/hermes/blob/master/Makefile#L53
 

« first day (2061 days earlier)      last day (2905 days later) »