« first day (2248 days earlier)      last day (2925 days later) » 

00:52
how do I set search queries in react router
#wat
or whatever that is called
@Zirak wat game iz dat?
01:20
@Abhishrek overwatch
> You can also access parameters from the query string. For instance, if you're on /foo?bar=baz, you can access this.props.location.query.bar to get the value "baz" from your Route component.
user2620028
@abhishrek i added you on messenger
02:04
hey folks. Anyone know how to customize a user for travis CI? ie default user is travis but I'd like to specify a separate account
nvm
03:08
can someone help me to get over this callback mountain?
i just want a function to make a request and return a response body.
but libraries like "request" and "fetch" uses callabcks
 
1 hour later…
04:27
@MadaraUchiha stackoverflow.com/q/41012525/829835 this should have been closed correct?
04:38
@littlepootis It is not really that much interesting since the real magic is in ptrace in kernel. Rest is just front-end to ptrace and some instruction overwriting tricks.
does anybody recommend a DB for JSON
 
2 hours later…
06:09
Hi
I have a modal box in javascript
What I want to do is :
I want to click in the content of modal for example in "Some other text"
And I will get this text in javascript
Is it possible ?
07:01
@FlorianMargaine That would explain why I keep hearing Erlang is great for concurrency, haha. I'm an idiot for never having looked it up
 
2 hours later…
09:29
@littlepootis Oh, that looks very interesting! Have you read it? I've been meaning to start SICP soon, but "soon" is as arbitrary as it gets :P
Can I help anyone with something?
@SomeGuy Two chapters in, it's pretty interesting.
09:46
@MadaraUchiha lol at the ts playground... that is nasty
10:27
I am appending data to a div by the following code :
for (i = 1; i < fileName.length; i++) {
                            var d1 = document.getElementById('modal-body');
                            d1.insertAdjacentHTML('afterend', '<p onclick=\"getFileName(this);\">' + fileName[i] + '</p>');
                            //   d1.innerHTML += "<YOUR_CONTENT>";
                        }
But after a certain event I want to clear the content of the div
SO I have written the following code :
$('.modal-body').empty();
But the content of the div is not cleared .
why ?
@SagorAhmed .modal-body === class="modal-body"
You're using ID
So I'm guessing you want $('#modal-body').empty()
The div is declared as
<div class="modal-body" id="modal-body">
</div>
I have used $('#modal-body').empty()
But the content is not cleared
@SagorAhmed Can you create an example on jsfiddle.net that demonstrates the problem?
hello everyone
I have created a webpack-react-typescript project following the instructions here : typescriptlang.org/docs/handbook/react-&-webpack.html
The problem is that typescript is type checking the definition files for modules under node_modules and this results in more than 1000 errors in the console
the application worked but how to disable checking for anything inside node_modules ? I tried setting "skipLibCheck" : true in tsconfig, nothing happened
10:41
I was asked for snow on #Miaou. The existing scripts were ugly so I made mine with snow accumulation on the "ground" https://canop.github.io/snow/
7
(shamelessly announcing the snow script I just made. It's better than the other ones :p )
10:54
silly me, I only needed the exclude option, thanks everyone
user6438653
11:09
Anyone wanna play? splix.io/#team-bqBQY
user6438653
How can I use jQuery to display the contents from an external page inside a div?
11:29
hi guys!
11:42
@TheCodesee .load. Requires the site to allow it with CORS headers
12:28
@DenysSéguret cc @Loktar :)
@Loktar made a famous jquery plugins for snow
I tried it. It's heavy because there's a span for each flake and the accumulation doesn't work well
Try both, you'll see
loktar's one has the advantage that it probably works for IE8 but I don't care
13:28
stare at the snowfall for a few minutes then look at a text editor. the text appears to move upward briefly :)
this drives me nuts. Can anyone help me to write webpack.config.babel.js in ES6?
I profiled it. looks like chrome heavily inlined everything. nice
"SyntaxError: Unexpected token export"
ahahahaha
@animaacija replace exports with module.exports =
@doug65536 I spent a lot of time looking at the snow accumulating at the bottom, and my editor doesn't move up. Yet. But I've a heavy monitor, that's probably why.
13:30
and see if it works
@littlepootis that 4 sure works.
I want import x from 'x' etc ... the cool stuff everywhere
Can you paste your .babelrc, webpack.config.babel.js somewhere?
and i have no .babelrc
using query property ... and building with webpack2
ill prep package.json 4 u ;)
@littlepootis i was there .. .thay didn't solve the problem
14:13
Hey guys i have a problem
`ratings = parseInt(ratingnow,10) + 0.50;`
when ratingnow is `int` e.g. -> 5 then its giving me 4.5 should be 5.5
when ratingnow is 5.5 then it is giving me 6 which is right
@PraveenKumar Can you make a fiddle ?
!!> parseInt(5,10) + 0.50;
@DenysSéguret 5.5
(just checking that 5 + .5 is indeed 5.5)
hi
gyus I need to "fork" a react native app I created
with another name
how can I do?
14:31
!!> parseInt(4.5,10) + 0.50;
@PraveenKumar 4.5
@DenysSéguret see this
what i should do to avoid this
!!> parseFloat(4.5,10) + 0.50;
@PraveenKumar 5.5
@PraveenKumar 5
14:51
I have a working react native project named "AwesomeProject"
in this I got working a webrtc stuff
now I created a new project making all the same as AwesomeProject
copied node_modules, package.json, index.ios.js
but it is not working
I cannot understand why
so since my awesomeproject is working fine,
I would like to "fork" it into another project, with another name
 
1 hour later…
16:02
Hey guys, can anyone here help me with a Google VR quickfix?
@MaxdeMooij 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.
Great, I'm using Google VR for the web to load a 360 video, but I'm getting a render error when I load in my video from my own site
16:23
trying to use toggle flot to change transparency of series by clicking on series label
need to change these colors but not sure how
var plotData = [
				    {
				       label: "Eyebrow Changes",
				      data: chartData.y,
				      color:  "rgba(112, 38, 129, 0.7)"
				    },
				    {
				     label: "Eyebrow Changes",
				      data: chartData.x,
				      color: "rgba(165, 205, 57, 0.4)"
				    }
				];
17:10
@copy Guess what
@DenysSéguret yeah I made it back in like 2007 or so as well
I've made a vs similar to yours as well just not on gh :p
snow is easy.
Yeah. But what I feel interesting is making a pretty snow accumulation on the ground and I was surprised to find nothing acceptable
Yeah I'll have to add it to mine
the element collection I had was a bit janky and worked oddly but it was thrown in as an afterthought
also mine works in IE6 not just 8 :P
but... it was back when IE6 was still used
Of course that made sense at that time
honestly though my best snow creation
haha so long ago
I made over $500 or so on that though
... man now I need to get these working on windows 10
and just make them free as well
17:29
I wanted to make it fun for Miaou, so there's a command with args, you call for example
!!snow blizzard
!!snow big sticky
@DenysSéguret That didn't make much sense. Use the !!/help command to learn more.
!!snow light wind
(sorry Caprica ;)
So that people can decide what kind of snow and what kind of accumulation they get in their room
nice, that's a cool idea @DenysSéguret
@BenjaminGruenbaum I'm not sure what you mean lol robinhood?
Hi there. If I have babel-cli installed both locally and globally, will there be any conflicts in future usage?
17:34
@SangeethSudheer 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.
That's always a possibility, but it's unlikely.
@Zirak You did it?
user2620028
@zirak what does that correspond to?
Knu
Knu
fast poll, what's JSON for you? A. Arrays and Objects (first spec) B. anything goes (latest spec)
user2620028
17:45
what is the ladder on OW
@Zirak Neater than neat
@copy :D
@HatterisMad I dunno really, some internet sources tell me it's top 20%
user2620028
oh thats sick dude
user2620028
@Zirak thats about where i am at in league ranking, just under top 20%
tbh I had an insanely good winning streak. Out of ~20 games I played over the last couple of days, I lost maybe 3 or 4
Got ~40 sr for each win
Knu
Knu
17:47
I am really not sure which side is the safest
B. seems like over the top to me.
@Zirak So, 3.5k next?
@Knu Whadya mean by "latest spec"? json hasn't changed in the past few years
Knu
Knu
Do ppl really use JSON for "'1'"?
@copy My goal is to hit 3.3k. If it goes over the top and hits 3.5k then who am I to complain :D
@Knu rephrase?
17:49
I don't think I'm good enough for masters right now
Knu
Knu
@zirak you know how some implementations only support the first spec?
@Knu oh, you mean the top level object?
Knu
Knu
yes
The following are valid JSON:
"1"
"null"
"{ "foo": 42 }"
"[ 1, 2, 3 ]"
Knu
Knu
the last two are valid in the first spec
17:50
afaik it's always been allowed. Can you elaborate on what you mean by "first spec" and "lastest spec"?
no, officially a JSON text can only be of some object of some array
and many parsers break when you give them something's else
!!> JSON.parse("42")
@Luggage 42
Knu
Knu
17:52
denys so you vote for A.
I don't vote, I just tell you what's the spec
@DenysSéguret Really?
According to MDN, numbers are valid root json elements: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…
(and this point doesn't matter much)
Knu
Knu
@DenysSéguret you mean the first spec :)
not the latest sorry
17:53
What's more important than that is if the parsers you use support it.
The spec DID change, you're right
Knu
Knu
@Luggage it's a library
> A JSON text is a serialized value. Note that certain previous
specifications of JSON constrained a JSON text to be an object or an


array.
Knu
Knu
so anything goes
I see it used all the time, non-{}/[] roots, that is
17:53
It's recent enough, I made a correct answer on SO precising that point, a few years ago...
!!afk dîner
huh, didn't remember that
json.org and ecma-404 both don't specify that
@Zirak Because that's one of the many stupid details of JSON, and one which was largely not respected
because it's stupid
Knu
Knu
let's say you are receiving something with a application/json content-type
would you assume it's an array or an object? (serialized)
(not should)
No
Knu
Knu
I am really dubious about ppl transmitting "true" or "42"
is that really a thing?
18:01
Sure
Sometimes I even transmit an empty message, just for fun
Knu
Knu
string > parse > string is the worst
""2"" > "2"
@SterlingArcher broker
Your broker
@BenjaminGruenbaum I look forward to the day I can actually figure out what's going on in your promise example, lol. (Don't tell me, btw. No spoilers.)
My whole node.js/bookshelf/passport/express/bluebird/jade crash course has been super weird. Every piece of documentation is missing one thing. Every tutorial has 4 things right and 1 thing wrong. It's been a game of just reading as much as possible and trying to piece together the most common advice into something meaningful.
Knu
Knu
18:22
jade is called pug now
passport is a mess
@JasonC let me know when you figure it out
@Knu I know but pugs are garbage dogs so I refuse.
And yeah. Passport is actually working well for me now that I figured it out, but the complete lack of documentation on isAuthenticated() is... beyond my comprehension. The docs don't even mention it exists, but it's like the entire point of using the library.
Is anyone able to help with this? stackoverflow.com/questions/41085719/…
I read the whole story of why Jade got renamed, it was a bummer. But it's a much cooler word than Pug.
18:47
Bookshelf.transaction(function (t) {
    return Promise.all([
       example1.forge(...).save(..., { transacting: t }),
       example2.forge(...).save(..., { transacting: t }),
       example3.forge(...).save(..., { transacting: t })
    ]);
}).then(function () {
    console.log("transaction committed");
}).catch(function (err) {
    console.log("transaction rolled back");
});
This makes sense, right? 3 saves, one transaction, proper use of promises?
@DenysSéguret now use real snowflakes: community.wolfram.com/groups/-/m/t/235291
@Shmiddty DenysSéguret is afk: dîner
19:22
@JasonC Hmmm
No, I don't think that would make sense.
See, Promises are values, not actions. A Promise for the number 42 isn't the same thing as the action of getting that number from somewhere. A Promise is the result of the action, and not the action itself.
So by passing promises to .transaction, it will have no way of rolling things back (save from passing some object into the .save() function, which is a shame
It would make more sense if Bookshelf.transaction accepted an array of functions which return promises, and it itself would call them all to return the single transaction Promise.
That said, the code you posted is valid, and would probably work well.
@MadaraUchiha Thanks. I've been playing with it. It seems to work, both in success and error handling. There's an SO post with similar code at stackoverflow.com/questions/29757619/…, it's for an older version of Bookshelf, but it looks like a related change has been made to fix everything (github.com/tgriesser/knex/pull/786). I asked there, too. I think it's right, now.
At least, everything seems to happen in the proper order when I turn on knex debugging.
Ah, I wasn't aware that Bookshelf is a library
I thought it was your own code.
I have no idea how Bookshelf serializes things with the same "t" but it does. They happen in an arbitrary order, but they all do the right thing.
If that's how the API looks, then it seems to me like it's a perfectly fine use of Promises.
Ah sorry I was being presumptuous. Yeah Bookshelf is an ORM. The transaction callback is documented as being supposed to return a promise (or however you say that in English, I tried...).
And you pass in transacting to save when using transactions to make sure everything is in the same transaction on the same db connection. At least that's what it says.
You guys have been really helpful btw. I have no JS help to contribute but if you ever have C++ or Java questions feel free to ping me in the Tavern on MSE.
20:10
@copy I don't even have a clue golf.shinh.org/p.rb?Primarily+Prime+Primes
@MadaraUchiha it's right. that's how transactions work in bookshelf.
it's the fact that { transacting: t } is passed tot he other method that makes it work, not the promise
cc: @JasonC
in fact, it's calling .then() on the result of .transaction() that starts the process. if the transaction promise resolves, then it calls .commit() underneath. if it rejects, .rollback()
 
1 hour later…
21:39
was just rewatching breaking bad
last time I watched the first couple seasons my english wasn't strong enough to understand it
hank was so much more likeable :/
22:18
@Luggage Oh, that makes sense. Thanks.
22:33
Meh, trying to understand 'Promises'. Not easy.
@Duikboot It's the type vagueness and how everything fits into a chain that I'm struggling with the most. Like the difference between .then(function(){return aValue;}) vs .then(function(){return aPromise;}, or things like putting my own new Promises in the middle of chains. I'll get it, with some experimenting. I'm just trying to learn too many things at once to get this project done.
They are keeping my code clean, at least.
Today I have a day like .. it's in general all so much all those JS variants is even es6 vs vanilla js etc stuff naming is confusing me ><
I have a much better PHP knowledge but I feel i should do much more js.
My brain thinks in C++ and Java, JS is confusing the crap out of me. Less confusion the more I work with it. But it's weird.
I've at least got a little bit of Python in my head so I'm mostly used to being able to do things like object.arbitraryName = to add "arbitraryName" on the fly.
Currently Im spending much time reading developer.mozilla.org/ :D
stackoverflow.com/q/336859/616460 is strange to me, too.
Yeah. I've got like 6000 documentation tabs open. So many half-baked tutorials.
Somebody here introduced me to devdocs.io the other day, check it out. It's pretty cool.

« first day (2248 days earlier)      last day (2925 days later) »