« first day (2265 days earlier)      last day (2908 days later) » 
00:00 - 16:0016:00 - 00:00

00:01
thank you to guys on here who helped me with my annoying JS questions this year..you have been good mentors :)
just sayin
Rob
Rob
Does this room cover typescript?
sometimes
this room seems to cover pretty much everything. I dunno if there are any typescript users on atm though
is your question typescript specific?
Rob
Rob
Yeah - in particular an issue with typings for react
I welcome the Alphabeaver. Too many trees, anyway.
00:14
alphabeaver during fallout is like a meat fiesta
but you gotta run to the endge fo the map to get it
a little exposure never hurt anyone
argh, without a mod to give me fuses, i keep losing crops in my hydroponics bays
and after a field fire and blight, I've been hunting for food most of the game
00:38
is it bad have multiple $(window).load on my page?
or I can use it multiple times without problems
does the second assignment overwrite the first?
is window.load what you want? not document.ready?
yes
i don't think i've ever actually needed window load for anything...
I have created separated files
you madman
00:43
ok can I have multiple document.ready?
@david ?
if you're using jquery i think it allows multiple
try it and see?
yeah, you can, but don't go spreading them over the place or introducing dependencies
ok I solved with
$(function(){...});
^.^
that's document.ready.....
do you know why sometimes I found () at the end?
$(function(){...})();
01:09
No. Looks wrong.
Just stick with the $(function() { ... });
01:22
I don't think '$(function(){...})' returns a function, so currying won't work.
trying to think of uses for tagged template literals
01:52
fun fact: Tagged template literals can be generators. I have no idea what that gets you other than confusion, but.. you can.
they can't be used as constructors, which would be more useful.
well, with generators you could build some sort of fancy query and iterate results maybe
but you can do that just by calling a generator with the object built with your "tag".
I mean.. it only saves you a second function call, so I could accept it not being allowed.
I haven't had the chance to try Relay, but it's using template functions as a factory
as a factory?
i know it uses them as a parameterized query
Relay.QL`
  query StoryQuery {
    story { ${Component.getFragment('story')} },
  }
`
I meant to say, maybe you can't pass a constructor, without doing those checks to see if this is an instance of the type being constructed
but you can probably take the parameters and call a constructor... oh well, they're really confusing because it's hard to figure out where they'd be useful
02:08
well, you can't use 'new'. But you can still return a 'class' from the tag.
so, besides parameterized sql (or graphql) and adlibs, I can't think of anything else.
!!> 'strict mode'; function Foo() { return Foo; }; Foo() === Foo
@FilipDupanović true
I think it's always legit. A constructor can return anything it wants.
If called as a constructor, it'll 'default' to return this; but you can choose to return something else.
yeah, I think so; iirc, the constructor can even return an instance of a different type
right
which I never do.
If i'm going to do that, I won't call it as a constructor. Confusing.
I'm sure there are reasons.
02:16
scratch yeah, I guess, but nothing readily obvious
I do get the practice of returning a new instance when you call the constructor with new omitted, but that's only because everyone did it back in the day, so I just got used to it
I can understand that, but never found it necessary in my own codebase
me neither, because the constructor starts with useless lines of noise that just permit someone to use it as something else
But I started this project after years of blundering through JS. I already had a firm graps of 'classes', protoypes, constructors in JS.
I spend more time as a lvl 60 healer writing code instead of solving problems, I leave that to smarter people that can meet deadlines; still, a few months of inactivity on any repo and I'm completely ashamed how everything looks
02:38
I have been studying JS for a while, it's far more complicated than I think
02:50
@FilipDupanović wut
Oh
morning
@Y.C. yeah lol, this front-end biz is like entering the lair of a celestial dragon; I botched my first hackaton with JS because I spent all of my time setting up RequireJS first time from scratch after I had a fairly decent build running at work and had nothing to show at the end
oh wow, PACKT gives you tokens for reading which you can use to get more books O_O
@Filip Dupanović I'm learning JS by trying to build my own codebase, for example, compare two objects, the unit test is exhausting
!!> function C() { return 42; };;;;new C()
@littlepootis {}
03:06
!!> function X() { return {lol: 42} };;; new X()
@littlepootis {"lol":42}
!!> class Foo {}; class Bar { constructor () { return new Foo(); }}; new Bar instanceof Foo
@FilipDupanović true
@Y.C. which test runner are you using btw?
github.com/avajs/ava is pretty good atm
@Luggage , i did some reading , but can't seem to find anything
Just so that im sure
this is what I want
there will be restful endpoints for my app
say
03:14
!!golang or work or .zZ
@FilipDupanović golang
/users/create/
I want to perform the exact same functionality using HTTP and also using web sockets
is it possible ?
uhh, it should work; requests which you sniff out that should be handled over WS you respond by upgrading them, otherwise you just return the usual response
@FilipDupanović was that for me ?
03:22
thanks for the reply
I am trying to build a service that can be accessed by HTTP
and also like a chat
sometimes users won't connect via WS , just HTTP , sometimes they will do via WS
@FilipDupanović I wrote my own test functions from scratch, which may be why it is exhausting
so say I define a controller that updates a users email
is it fairly straightforward to access that same controller function via HTTP as well as WS ?
@Y.C. oh nice, yeah the assert module can get you far alone
in case of HTTP, user may provide details as query string , or json
umm, tbh I never did it myself, but technically it should be possible
03:24
and in case of WS , user will provide details only using json
its not impossible right? socket+REST can exist easily ?
it should be definitely possible, it's just that usually the way you integrate a WS server with your HTTP server is done on distinct paths
I dont know node or express
well, you'll sort of get that yourself either way, you'll just branch out in a single handler instead of having two, just that it's not something I did myself
does socket.io have something to parse incoming message ?
say a user is connected
then he wants to POST to /user/create/
so WS body will look somewhat like:
/user/create/
{
"id":4050,
"name":'bleh"}
umm, it's a bit different, you'll see when you get into it
03:29
ah okay
i want sails
with HTTP requests, because the protocol is stateless, you basically get something like f(req, res)
okay
and what about socket ?
with WS you'll get a connection that will call your handlers on different events
what are events ?
like c.on('thisevent', dothat).on('thatevent', dothis)
03:30
is thisevent something like on connect , on message
or something more granular like 'user create' ?
you can have your own events with socket.io; I haven't used it for quite some time, but it has a few principal types you get to work with
it has a type for a connection and for a channel, or something like that iirc
on the connection you get the usual events, but the messages go through a channel, or something like that, and there you can have your own custom events identified by strings
@harvey_slash yes
@littlepootis yes to what ?
(hover over the message)
@FilipDupanović, okay ill dig deeper , i can't really understand too much
03:34
hover on my message to see the message I replied to
take your time, socket.io is confusing af, at least to me
if what i want is possible, only then do I want to learn it
would it be okay to have as many events as rest api endpoints ? or will that be some serious design issue
well, you'll need to have all of them for HTTP at least
you can reserve one for establishing a WS connection and if your requirements are to be able to do everything over both protocols you'll probably have all matching events too
my concern is , because socket events are a black box to me
is it doing some very special detection that would make 10k different types of events super slow?
say i have 10k HTTP endpoints , so according to what you said , I should have 10k socket events
will that many socket events cause a serious issue ?
03:45
hmm, no
alright
so this is my plan of action
at the end, it's just like having a router for WS messages, the same thing that you have intercepting all your incoming HTTP requests
create a generic controller
oh
okay so ill create create a generic controller that will take in a body and user session details
then i will create some sort of a handler that will take HTTP calls and call the right controller
and if its a WS event, it will call the right event
ye! I'm sure after you get the basic CRUD done for users over HTTP and WS you can step back and figure out how to reduce duplication and write reusable handlers
alright thanks
thanks a lot
03:57
@MadaraUchiha Where do you get PDFs that were made for the Kindle?
I think it's going to crash before I get to 10k cycles
05:06
anyone from casperjs
@parwat08 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.
05:22
@CapricaSix Can I ask you a question?
@TrojanByAccident Do you have anymore questions ? I am satisfied with Sheepy's answer
morning
@FlyingGambit It's still a bit confusing, but yeah, Sheepy explains it well.
@Linus Yes indeed, 30 minutes into the morning, as a matter of fact.
05:50
@Linus welcome to the darker side
:D
@devendratata 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.
7
Q: How does Twitter implement its Tweet Box?

trekforeverI'm trying to implement something like Twitter's tweet box, specifically: Automatically highlights text in a red background when the overall length exceeds 140 characters. Automatically highlights links, mentions, and hashtags in blue. These should happen automatically aka when a user types. ...

I'm trying to implement same like tweet box feature in my application.
whenever user enters normal text it should come as normal text,
if a user enters a username ('@') or hashtag('#'), I want to differentiate the color and I want to hit the search API to get the username or hashtag. Can anyone help me on that.

http://stackoverflow.com/questions/28820293/how-does-twitter-implement-its-tweet-box
06:10
@devendratata Please don't repeat yourself.
Please don't repeat yourself.
@Shmiddty VVVVVV
06:42
@BenjaminGruenbaum eh... same node?
lol, it's the "dry" principle in the world, but the "pdry" principle in Canada
user7029249
06:58
0
Q: Neglect "Returned or Cancelled" rows when calculating total commission

abcdwe are displaying Total commission by calculating with below formula Total commission = commission * Number of Rows for some rows we have value = "Returned or Cancelled". if value = "Returned or Cancelled" , we don't want to count those rows for calculating commission. for below image, now TC ...

Just wondering, do you guys keep fiddles or projects to show off ?
@FlyingGambit I upload pretty much everything I work on to github and make things public as much as possible, Though as I've not got a job yet I'm not sure how helpful it'll be to show off :)
Can I have a link ?
07:16
To my github?
Thats neat
@lix i like your space invaders game
@TheClonerx 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.
@TheClonerx Thanks dude, it was the first javascript project I ever did :-)
though incomplete its cool
07:26
Yeah, I've thought about going back and finishing it + redoing the code but I've progressed so much since then it seems like a wasted effort. Do you share any of your stuff?
I have nothing to share...
Depends what your goals are I guess :-)
I also want to make a simple game, but i don't know where to start and what to do...
Like canvas?
07:28
give me a sec I'll try and find the project I looked at when I was trying to figure out how to make space invaders
Oh, thanks.
Ohh and also a guy whose doing something simmilar to me atm
@TheClonerx tic tac toe ?
This guy here is brilliant interms of learning some basic stuff you can build on, though he uses p5 which simplifys a ton of stuff
just google for "canvas game examples"
07:31
Oh! p5, i already saw that guy, he is really funny.
Yeah you can adapt all of the stuff he makes outside of p5 if you want to have more control, though he explains stuff really well
lostdecadegames.com/how-to-make-a-simple-html5-canvas-game This is what helped me out a ton at the start
08:01
@SomeGuy Well, generally from stores that support kindle
Kindle has this nice feature where it assigns you with an email address, and then you can email stuff to that address, and it'd be synced to your Kindle
So what usually happens when you buy not from Amazon is: you buy, they ask for your kindle address, you approve their sender address from the Kindle web interface, then they send you the document/book/whatever via email, and it's available.
Ah, neat
I was hoping it'd help with reading zines, textbooks, and research papers (which I imagine won't generally be made specifically to look decent on the Kindle)
Well, you can send me a sample of such a PDF if you have one handy, and I'll tell you how it looks
As for models, I think the Paperwhite gets you the best cost/effectiveness ratio
The lower-end ones have no backlight, and the higher-end ones offer no real improvement.
08:17
Yep, I was looking to get the Paperwhite. I've sent you 2 PDFs, btw. Not sure it's the correct email, though :P
@SomeGuy Got them, remind me tomorrow evening when I have my kindle nearby?
(Just remembered I don't have it on me 😆)
Oh hai there
So... tempting...
08:33
Will do, haha
09:01
HOOOO hooooooo oooOOH , they made 2nd Jan a holiday
09:15
i need to wake up
just troubleshooting a problem and found it: bound a load event on a button.
hi
do any one know how to avoid multiple ajax request sending in datatables?
I want table to send ajax request only when i filter the table
09:37
it's in the docs ... could find that after 3 minutes
@FahadUddin I am willing to convert
10:06
@lix he's the p5 author methinks
10:54
ah, I sometimes love the truthy/falsy thing of javascript with pain
had to do this: else if (jsonResponse['success'] === false)
because the "success" key has either true or false. Other values are ignored
@KarelG you could do !!jsonResponse['success']
that gives false, which causes to jump to the next condition ...
i need to end in that condition block if success: false is part of jsonResponse
ah ok, so you want it to be exactly false
11:20
that condition must be evaluated as true if object has success: false
adding another ! to the !! would be silly
hi all. Anyone know the answer of this question stackoverflow.com/questions/41281809/…
@FilipDupanović Oh yeah your right, never actually heard him say it but I guessed he'd have some part of it, though he's pretty eccentric
!!afk csgo
anyone here who has implemented a tic tac toe game using minmax method ?
11:55
Hey guys
how can i find the hue number from a hex color?
@MarcRasmussen Have you tried googling?
That exact phrase "how can i find the hue number from a hex color?" paste that into Google.
@MadaraUchiha Yes i havent been able to find a fomular ?
@MadaraUchiha im not looking for an online converter i am looking for a js converter or a math fomular
12:24
How do I make a button text change in react? the code I mean it's in CommentBox class line 66 - codepen.io/Thaenor/pen/PbvdGp
According to the tutorial this should be enough
let buttonText = 'Show comments';
if(this.state.showComents)  {
  buttonText = 'Hide comments';
}
@Thaenor yourButtonNode.value = 'my button text'; ?
I thought everyone was like gonna be on holiday ?
what you do is a simple assignment
The button text is set correctly but then it doesn't update
because you don't manipulate the button, to change it's display
12:27
The text doesn't change to "hide comments" when it's clicked
@KarelG so I need to change _handleClick?
oh you do... it's further in the code
<button onClick={this._handleClick.bind(this)}>{buttonText}</button>
yes. The button itself is working. It just doesn't update the text in it.
i don't see this.state.showComents being updated to true
it's toggled in each click. Does it need anything else?
yes look again :)
if(this.state.showComents) {
-------------------^
only a typo ;)
12:34
SERIOUSLY!?.... loooooooool
I hate the word comments. I just keep misstyping it and saying "coments"
@Thaenor donuts on you !
I was starting to freak out, because the tutorial had some "..." in the if statement, and I was getting worried I was missing something basic, because they made it look so simple and casual.
yup. Now it works just right ;) 👌
tip: if you aren't sure if the state is being changed or not
search on the vars used in the condition. By this you can track any updates. If there is no other use of that var, it's either missing or the var name isn't right
TypeScript ftw
@KarelG I have an atom package to help with that, but I'm in codepen right now.
12:40
How was everyone's chrismas?
It was pretty great :)
12:59
Not so great, but still nice
13:13
guys :| who here gets draft-js? How would you add a selection, if all of the data is immutable?
I basically just want the parent component to have the ability to add something to the editor
13:24
put a wrapper around it
@TrojanByAccident new Date(00000100) = new Date(0100) = new Date(64)
does anyone here in humans have experience with svg/d3 ?
13:52
forms that don't submit when you hit enter from the last input are literally the worst.
so many login forms do that (or rather, don't) :(
@corvid if you don't need anything custom, there are a few wysisyg components out there built on draft-js
but no, i know little about draft-js
;_;
lost 5 hours before I realized that java EE servlet API doesn't support HTML5 FormData by default
That sentence triggers my PTSD.
had an idea to check the servlet annotations and adding @MultipartConfig actually allows the servlet to access FormData object sent through xhr
javaEE needs a huge update ._.
14:01
did multi-part forms really change in html5?
If so, I never noticed, because who uses multipart/form-data anymore?
I still use it. No it hasn't changed.
@Mathematics did you have a question?
display port or DVI-DL?
@KarelG it needs to be replaced and I don't think that is going to happen inside Java
@Neoares dP forever
@ssube why
14:08
@Neoares much higher bandwidth, support for additional data (like freesync or audio), better plug
dvi is old tech
DVI is just barely digital and can't do many of the things displayport can, including high res
@Luggage yes
good to know. I guess we'll never know what it is
keh, the dvi is actually founded for monitors.
14:10
so was vga
CRT monitors :P
somehow it ended to a standard for data exchange
where is it used for data exchange?
@ssube dvi-dl can go 1080p 144hz
and I've heard display port may not reach 144hz
1080p is for casuals
14:11
@Luggage Is rerendering svg/d3 maps a big issue ?
my monintor is 1080
displayport is the highest bandwidth cable we have atm
No. svg are used for maps all the time.
and d3, most commonly
well, unless usb-c can beat it, which I'm not sure about
well, my monitor doesn't have display port so.. xD
14:12
probably most of the election maps were d3/svg
@Mathematics most SVG libraries use maps as one of their examples
d3 comes with maps of common areas, i think
or maybe just the US and states.
sorry I meant tree map, in other words... calling chart a map
what kind of chart?
I have this tree chart - --- --- jsfiddle.net/d76z9vpm/11
14:13
i'm going to build a pc with DP screen in january
assume all rect are titles... and I want to add details to each node as another rect...
gotcha wait for Ryzen CPU to see if it's worth
I want to show/hide them on click on title... would I need to re -render this chart then ?
you can show/hide svg elements just like html ones (with css)
(if it's not worth, the intel prices may drop a bit ... i hope)
14:15
@Luggage Yes, but would that reposition other elements ? :)
svg isn't positioned like that. you specify coords.
@KarelG the high end i7s are not expensive
@Luggage that means I have no chance other then recreating chart
No.
It means you can add new floating elements with no hassle. SVG doesn't reflow.
If you wrote that chart, you specified all the coords.
(or calculated)
the 6th generation i7 ?
somewhat 350 ish $ ?
14:16
@Luggage it does here though... bl.ocks.org/mbostock/4339083
That was written into that.
sorry didn't get u
That moves because someone wrote code to move it.
why doesn't sets in JavaScript implement methods like union, intersection, etc? Is it something different than a set as I am thinking of it?
svg does not. svg only takes {x,y} and will put it RIGHT THERE.
14:17
@Luggage yes, but that code is recreating chart ?
re-creating parts of it.
or just modifying some props.
This is what d3 helps with.
@Luggage I am interested in that...
ohh, you WANT it to reflow?
pretty sure someone had done this before, like u click on title and it shows details... but not sure what keywords to use to search it
@Luggage reflow ? yes, but not child nodes... details of nodes :) {which are not present in fiddle I sent you yet}
ok, well, yea. d3 is designed to let you add/remove nodes later and it'll give you 'hooks' to modify the existing ones.
that example you pasted might be a good start.
14:20
hooks that's a interesting word :|
also "collapse"
@Luggage on my local system, I can already collapse/expand, pan, zoom etc...
this fiddle is not updated yet
it is already expanding collapsing childrens...
I want to add another rect which will contain details specific to nodes and want to show/hide them
ok, well, until you can ask something more specific my answer will be the same "yes, d3 can help with that"
@Luggage I share your thoughts but don't know how.. and how to search it
if you share my thoughts, are you as ashamed as I am?
14:24
@Luggage I meant only on this topic
I know how to add these details rect... but I want to show/hide then on click on main box... but also want to details boxes to not overlap other nodes :)
the show-hide is easy. The non-overlapping means you need to calculate new coords for boxes.
d3 has some tools to help you 'space' things. It's used on the bar charts. You can use that to help.
I forget the name,
yes, you are right, can even use vanilla for showing hiding..
but I want to find something similar on internet, not sure what keywords to use
sorry, gotta go.
14:32
@Luggage don't be sorry
Date.prototype.getDate() to get days (1-31) while Date.prototype.getDay() returns with day of week (0-6) ... confusing :|
one day, we all have to go...
@KarelG when are you not confused :|
@corvid you're thinking at another "set" (group theory)
 
1 hour later…
15:43
damn, my washing machine wasn't actually broken (and thus, is not fixed)
i still have that 20 years old washing machine
the tech in the past is way better than what they offer nowadays >.>
less efficient tho, but idk
Yea, the rock I use to beat my clothes against never breaks down.
haha
00:00 - 16:0016:00 - 00:00

« first day (2265 days earlier)      last day (2908 days later) »