« first day (3168 days earlier)      last day (1779 days later) » 

12:25 AM
morn!
 
In the off chance people here don't check stackoverflow on an hourly basis:
if anyone is experienced with flow, I'd love to know more why the following isn't working
1
Q: Docker with flow require hook doesn't work?

paul23Well I'm trying to fix a docker which stopped working at some point after updating. When testing I notice the following error (exempt of console) /njs # npm install flow-remove-types + flow-remove-types@1.2.3 added 12 packages from 23 contributors and audited 4202 packages in 5.862s found 114 vu...

 
hello
 
 
1 hour later…
user8729657
1:40 AM
Sigh... why do I have to have a Ned Flanders for a neighbor
 
2:24 AM
🚽
 
 
3 hours later…
4:57 AM
hello
need firebase help
or help with async stuff
 
5:54 AM
Anyone here uses webpack? How to make sure, webpack will minimize and uglify my code, plus will compile too 100% es5 without webpack wrapper?
 
6:06 AM
Hi, how could I get id from react route in function component ?
 
6:20 AM
you mean how to get route variable with key "id"?
@JohnDoenym I am not sure what do you mean by webpack wrapper
but you would need to use some plugins to achieve that
in webpack everything lives in .js more or less, so you would need to extract css, concat it, minify it
Same thing with js files, I see people using "terser.js" for mangling and minifying js
Also you would need to set babel to compile to es5
 
6:50 AM
@Raimonds webpackJsonp wrapper
 
7:10 AM
example -> https://stackoverflow.com/questions/40587074/webpack-typescript-compile-without-webpackjsonp

I'm not using TS, just .js code, but after bundling, the code is wrapped in standard webpack wrappers like: webpackJsonp and I'd like to have jst uglified js code.
Btw. anyone know where are webpack 2.2.0 docs?
on official site docs are accustomed already to webpack 4
 
7:55 AM
Maybe you should use webpack 4
 
v5 is in alpha phase AFAIK
bah github unicorn is haunting again
 
8:22 AM
And downvote those rep whores
 
i wish that a close voted question immediately revokes granted SO reps.
spares the hassle of dv's
 
 
1 hour later…
9:45 AM
hello
 
hello
 
hello
 
hi
i'm building a chrome youtube extentision , was working yesterday
today when i tested it i got this error

Access to XMLHttpRequest at 'https://www.youtube.com/get_video_info?html5=1&video_id=iDO9J_3OVJ0' (redirected from 'http://www.youtube.com/get_video_info?html5=1&video_id=iDO9J_3OVJ0') from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
any idea how to debug this ?
 
10:06 AM
HI guys
I am working on google apps script and I want to update submenu name
I am using this script -
But as soon as user clicks on submenu then I want to instantly update that submenu name
 
i am looking for an express middleware to profile a route and give me the time taken for each route to execute
 
10:17 AM
i am creating a javascript library and this is the code i have written down.
 
@JRick This is because you are doing the request from a domain that is not youtube.com (or any domain allowed by youtube)
 
my question is that i want to return the chart i generated
like:
function Fnc(e,s) {
    this.selector = s;
    this.BarChart = function() {
        //return this chart after it is created
    };
}
however,  Fnc is being returned from the main Method
var MonitoringTool = function (selector) {
  debugger;;
    var elements = document.querySelectorAll(selector);

    if (elements.length > 0) {
        return new Fnc(elements, selector);
    }
    throw "provided element was not found";
}
 
@ARr0w either use a callback (that should be given in the function call as a third parameter), or return a promise that you resolve in your anonymous function.
 
@ARr0w promisify it
 
Also IMO you should not name your variables with single letter names.
 
10:22 AM
and use a class syntax. That is ... hmm
+/-
that is how I did back then, but try to avoid such syntax for representations
 
okay i'll research and apply promise to make it synchronized and class syntaxes because i am not aware of how to do such things, i'm not well skilled in javascript
thank you for the guidance :)
 
ah. Promises is a great concept in javascript
 
you promise? xD
 
best to understand it. That class syntax is not important atm if you have not enough time for that. Ensure that it works correctly (with async function eg -> check first if you can use that because of compatibility (use bundlers lol) ... )
 
i'm on it.
 
10:29 AM
Hello guyz is anyone in react native / react ?
 
!!welcome user7747472
 
@user7747472 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
emphasis on
> If you have a question, just post it, and if anyone's free and interested they'll help
 
hello :)
 
hello
 
10:36 AM
1 message moved to Trash can
@user7747472 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
 
can anyone please tell me is there anyway to get value from the redux store in a stateless/class less component.
By stateless/class less what i mean is that
I have created a file with all helper methods like this one
const HTTPRequest = (path, body, method = 'POST', authorizedToken = false) => {

    <some code here>
      if (authorizedToken) {
            headers['Authorization'] = "JWT " + <Here i want to get token from redux store>;
        }
}

export {HTTPRequest, <other methods>}
I have added the same to the paste with more lines pastebin.com/bape9dxt
 
@KarelG quick question, do i have to include some third party script like promise itself?
or i can write synchronized functions in pure JavaScript (not the callback functions though)?

i'm using Visual Studio 2017.
i'm so willing to stay independent from using 3rd party libraries.
 
@ARr0w Promises is a part of the native Javascript (ES5) syntax. You can use it in your console (if you have a recent major browser)
 
tried this though
async function (){ var something = await function(){} }

but it is giving me error "experimental level feature"
okay
 
10:56 AM
might be a VSCode setting
lemme fiddle up a quick example
 
why the heck would you play a virtual reality version of five nights at freddy's?
that's like the most terrifying application for virtual reality that I can conceive
 
maybe that's why
 
Well I get adrenaline rushes, but having the pants scared off you is another thing entirely imho
 
11:12 AM
@KarelG thanks again man. got the concept of execution and use of promise and async. Appreciated!!
 
i don't understand why this event gets fired also on input fields which don't have the class name nbr. what am i doing wrong here? :(

$(document).on(".nbr").bind("keyup input change", function(e) {
console.log("trigger");
}
when i do $(document).on("input[type='number']") instead, also a change on an input type text gets triggered
 
11:43 AM
hello all
 
Hey
 
@Seblor yup that was the reason
thanks !
 
hello all, currently, i am testing my web application in google chrome. I just want to restart google chrome. what is the shortcut key ?
 
@user3442289 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@user3442289 It depends on your OS. usually ctrl or cmd + R, or F5. This will refresh the page. It will keep the cache and app data, though
 
11:57 AM
i'm trying to send a file using request-promise-native. rather than writing the file to disk and sending, i was hoping to use Buffer.from(), however the receiving server is having issues with it
should i be sending other options than filename and contentType?
 
@Seblor yes. my manager ran one shortcut key which will open the new browser with black screen. he said, this is the way to restart google chrome so that cookie disclaimer window will popup.
I forgot that shortcut key.
google browser 1, if i use the shortcut key, it will open Google browser 2 window with black color screen. any idea
 
@Jarede content-length
 
let me try that
 
if it does not work, you have to check the streams at both sides.
 
12:13 PM
yeah i think it's going to be on the receiving server
that didn't work
though perhaps i;m not calculating the content-length correctly
 
hello people
anyone here use XPCOM API for Firefox? I've got small problem so I am looking for someone to help me.
 
I love XCOM
that game rocked
 
Guys, how can i detect the user is using edge/ie ?
the user agent doesn't seem that clear
 
Guys I want to read all the file names inside a folder with XPCOM. How do I do that?
 
12:29 PM
@John Have you tried this option : stackoverflow.com/a/31757969/3670132
 
see you around guys.
take care
 
12:44 PM
@Neil eh. it is a great game but ... one enemy is just OP
and I don't like the pure percentage based mechanics
got 2 meter distance and hit accuracy is 95% (wut?) = nope, you got miss (wut again)
 
well the strategy is about maximizing (or in some cases minimizing) percentages
you can't really do anything about that 5%
 
1:10 PM
hello
who is a firebase expert
 
@Neil it is just not my genre. I don't have divinity origin (1+2) because of that
 
1:26 PM
Anyone has any idea what framework is used here? cindicator.com
 
react/mobx
It's using three.js for the animations
 
Does anyone know something about Handsontable? I need to reload the table but cant find any solution for it
 
have they written it themselves, or is there a ready one?
thanks
 
@PatrickLüthi Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1:45 PM
@PatrickLüthi reload as in ... after injecting new data?
 
1:58 PM
@copy hi
 
@BadgerCat hi
 
Cuties
 
Hi! I've got a little issue. I exported a variable and I'm trying to import it in another file usign the require function
is there any way to do this? it keeps giving me error
const nextRoot = require("./fileName").nextRoot
this is how I tried to import it
 
@KarelG no i got the problem with resize where the width isnt resize so i thought if i just reload the table my problem is solvd, but i cant find the code for it.
 
I wish there was a way to (faster) be certain that something is a bug with a library instead of a problem of my own.
 
2:03 PM
@Blank How did you export it?
 
hey BadgerCat and Copy. Still having a lot fun in Mexico? Or am I out of the track and that you are on another location <.<
 
I spent literary 2 workdays trying to found out why something simple stopped working.
 
export { nextRoot }
 
Only to then post it at the flow-type git as a bugreport, after which someone noticed it was a regression bug -- within hours.
 
@KarelG We're in Brazil right now
 
2:06 PM
anyone?
 
@PatrickLüthi judging from the docs, you only have to call yourHandsomeTable.render()
I meant handsontable.......
@copy that is a big country. Where? In the woods? At a metropolis? Or in the suburbs?
I am still on the same location as usual 😐
 
@KarelG Sorocaba, a small-ish city
 
i tried that already i guess i have some other errors. but thanks anyway!
PS: i make the same mistake always damn handsometable ;)
 
@KarelG Belgium isn't good?
 
gotcha having governmental crisis again after the last elections 👌
 
2:12 PM
@Blank And what's the error it's giving you?
 
it has still great social structure and other things but there have not been long term actions in the past. Most are just short-term quick wins or some adjustments in the margin. I am kinda pessimistic on that though. I don't think that it would become better in the near future. At last, I am kinda less adventurous it seems
 
```(function (exports, require, module, __filename, __dirname) { import React from "react";
^^^^^^

SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/thingslab/Code/Git/Balena/retrieve_data/src/zmqSocket.js:1:78)
 
can you edit that and use ctrl+k instead? (and remove the 3x backticks)
 
 
(function (exports, require, module, __filename, __dirname) { import React from "react";
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
 
2:14 PM
@copy what brings you both to Sorocaba
(damn that is hard to write ... had Sorocoba or Soracaba)
 
@KarelG Badger had a booth at BrazilJS
For her company
 
@Blank import isn't natively supported yet without a flag
 
guys
 
@BenFortune how should I import a single variable then?
 
The code you showed us has nothing to do with the error you posted.
 
2:21 PM
I tried with 'let nextRoot = require("./filePath").variableName
 
You need to transpile your code to run in node
Using babel, typescript, whatever
Or stop using the import/export syntax
 
i'm calling a form using append(html) from double click on table
 
if I use require how do I export the variable?
 
on this form i have other table where e need to use javascript to add some rows on it...
 
2:23 PM
if i use :
var table = document.getElementsByTagName('table')[0];
it setes the new row on the first table, and e whant in the second...
 
module.exports = {variableName: variable};
 
@paul23 thanks I'll try it
 
i tryed to use var table = document.getElementById('myTable')[0]; but it say's cant add row in undefined var
 
I wish node would hurry up and allow full support for import/es6 modules though. The current split is kind of annoying. But I don't think it's on the roadmap for node 12?
Hell I believe the choice is to officially diverge commonjs and ecmascript into different paths with explicit unique functions to import one in the other.
From what I understand in a commonjs module if you wish to use code written as ecmascript modules you have to do something hideous like:
(async () => {
  await import('./my-app.mjs');
  await import(....);
  //any code that depends on  my-app module.
})();
 
I have an initial table that shows all the products, when I double click on the table it opens a window where I am trying to add new rows in the table, but this table is called by a file in js, to which the window is floating
I tried to use it initially:
var table = document.getElementsByTagName('table')[0];

but this causes it to add in the first table where it has all the products.
what I intend is in the table that I opened in the window, so I defined an id for the table, and tested as follows:
 
2:34 PM
@NoobDEV-GBL getbyid gives you a HTMLTableElement
check the docs to figure out how to get its rows
and ect
 
it says the var is undefined, looks like he don't
recognizes the ID i set on the table
 
btw anyone using webstorm here? - Do you know how to make the code completion to "import statements" use commonjs' require instead of ecmascript import?
 
@NoobDEV-GBL how do you set the id|?
 
@KarelG like :
<table id="myTable" class="table table-striped table-bordered mb-0">
 
then that getbyid should work.
remove that [0] tho
so
const table = document.getElementById('myTable');
// use table.rows[0]
 
2:39 PM
you right
it was the [0]
 
hey all. I have an asynchronous socket constantly open receiving data from an API. This updates things on a page as API data changes. In this open async connection I need to store one of two simple strings (7 chars or 4 chars). The main problem I have is it needs to be accessible by all users (eg different browser sessions). I will need to change it based on API data. I looked at cache but it's such trivial data cache seems overkill. Any suggestions?
 
@James "In this open async connection I need to store one of two simple strings"

I don't really understand. You want to *store* data in a connection ?
 
@KarelG how i prevent from addin the row if the fields are empty?
 
hmm, I cant talk about the actual project. A similar thing (oversimplified) would be tracking trucks/HGVs on the road. A user can go to the page and be told which the direction the vehicle is heading in. When the vehicle is going from A to B I need to know it's last stop was A to state "heading to B". When it is going from B to A I need to know it;'s last dest was B to state "heading to A"
 
I am confused with that addin the row if the fields are empty. What do you mean with that?
 
2:47 PM
the persistant storage need is because on first page load for each user, there is no way to know what the last stop was (A or B)
 
soo... i'm adding rows to the table using values from inputs..so if that input is empty how i cancel the sumition row?
 
do a check beforehand ?
 
making a IF(){}else{}?
 
if (canInsert(...)) {
  // add row
}
 
1 message moved to Trash can
@NoobDEV-GBL Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
2:50 PM
uops
var produto = document.getElementById('produto').value;
If(produto !empty){
//// add row
}
Right?
 
1 message moved to Trash can
@NoobDEV-GBL Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@KarelG this is the same as if else right?
if (data) {
// do something
}
 
well if data is truthy, that "do something" happens
the else branch is optional
 
3:09 PM
@KarelG tanks, you have been a god help, just one more help pls... after i insert the row and clean the fields, how i focus the input on the first input field again?
document.getElementById('produto').focus();
document.getElementById('produto').select();
 
urInput.focus()
 
done
 
you only need the first one
 
really?
ho ya, tanks mate
 
3:23 PM
better approach to my question:
I have an asynchronous socket constantly open receiving data from an API. The data is tracking a truck/HGV on the road with GPS which goes back and forth between 3 stops (a->b, b->c, c->b, b->a). Users can go to the web page and be told which stop the vehicle is heading to, and it will update when the destination stop changes. To get the current direction I need the previous stop. So e.g. when the last stop was "A" I can state "Heading to B" and so on.
The stop data needs to be persistent and somewhere not user/browser session specific, so any time on a new page load or page refresh it knows what the previous stop to tell any user the next stop. Any advice on an approach to this?
 
3:37 PM
@James Put it in a database?
 
the api sends data every 5 seconds, that would be a lot of hits that is otherwise db free
 
o/
 
Maybe DB or cache are the only options. cache seems overkill as it'd be a library. DB is simple enough as I Can write an API for it
 
3:55 PM
redis
 
4:40 PM
can anybody tell me why this is a bad idea to host a react app? aws.amazon.com/getting-started/tutorials/…
Looking for something that's
1) Quick start
2) reasonably portable
3) has a fast dev workflow
4) I don't have to crawl into bed too deep with them to make it work
I don't have a lot of experience with building CI / deployment workflows, only using them
 
Who told you it's a bad idea?
 
nobody, that's my acceptance criteria. = is not a bad idea
+easier question to answer than "is this a good idea"
 
It's the same question
 
oh god, this is going to be a long conversation...
which is exactly what I was trying to avoid, so I'm gonna have to pretend to agree with you
We can agree, that for you... and many others, it is the same question
 
I don't have an answer for you; there are hundreds of ways to deploy applications. I don't care to know enough about AWS and its offerings to be able to help direct this conversation
 
4:51 PM
yerp, all good... started the process and it seems to be going well
did you ever try the ducks patter with redux?
last I remember you hated redux
*ducks pattern
 
5:36 PM
Well, hate is a strong word, but yes, I hate it
It's a good technology, just the API was horribly designed
 
Hi, does anyone here have a github account and has a donation button on their open source project
 
@ndugger link?
 
5:54 PM
It's very old
 
6:20 PM
how were the comments upvoted lol
 
How can you console log a perfect square in JS?
I tried
function generateShape(int) {
  for (let i = 0; i < int; i++){
    for (let j = 0; j < int; j++){
      console.log("+");
    }
    console.log("\n")
  }
}
 
hi , what i can use in chrome extention to detect if window.location.href have changed or not ( DOMContentLoaded event doesnt seems to be working ) i need something that keeps checking for the url or just activated once the url changes
 
^ The above code logged
+
+
+


+
+
+


+
+
+
But what I want is
+++
+++
+++
 
@HappyHands31 Collect each line and only call console.log once per line
If you're on Node, you can use process.stdout.write
 
why i hate JS, in C# you do .select(x => x.Cost).tolist().sum
in JS you gotta make a fkn mini-function
 
6:33 PM
.map(x => x.Cost).reduce((a, b) => a + b, 0)
 
window.onhashchange = function() {
//code
}
doesnt work on chrome extention either
am i suppose to do something ?
 
@copy and in C# you can do this
.Select(x => new { NAME = x.PAYMENTSOURCE, VALUE = decimal.Parse(x.ITEMCOST) * decimal.Parse(x.QTY)});
easily, in JS....
here's a better C# example
.GroupBy(x => x.PAYMENTSOURCE)
   .Select(x => new { TRUECOST = x.Sum(y => decimal.Parse(y.ITEMCOST) * decimal.Parse(y.QTY)), NAME = x.Key })
             .ToList();
easy, done
less than 1 minute
 
Well js has a bit difficulty with sorting (need to manually convert keys to integers) but:
 
exactly, fk js
 
C# is pretty bad for codegolf though. JavaScript is much better
 
6:42 PM
.sort((left, right) => right.PAYMENTSOURCE-left.PAYMENTSOURCE)
    .map(x => { TRUECOST = x.Sum(y => Number.parseFloat(y.ITEMCOST) * Number.parseFloat(y.QTY)), NAME = x.Key})
Given you have to defined the Sum function on the x object.
 
this isnt bad
i can live with that
 
Hey, I'm using multer diskstorage file upload in feathers framework, seems images is half image (truncated) only uploaded on linux sever. I tested the same code in my local mac it uploads image fine. Any one having view on it
 
7:40 PM
pfft where I can find documentation on react-router? npmjs.com/package/react-router-dom
 
 
3 hours later…
user8729657
10:36 PM
Why do I have to live next to a Ned Flanders for a neighbor, wtf do I do about him.
 
10:57 PM
bake him cookies
 
user8729657
@forresthopkinsa, someone broke into his car and stole his laptop bag, and then left it on my door step, something's not right. And he's been asking me personal questions.
 
wha t
that all sounds pretty weird man
 

« first day (3168 days earlier)      last day (1779 days later) »