« first day (2790 days earlier)      last day (2172 days later) » 

1:02 AM
morn
 
1:14 AM
Hey, when I compile jsx with babel it outputs something like bit.ly/2M3eb4G
But on browser it complains require is not defined. Should I include it manually?
 
2:00 AM
Is it bad to leave unresolved promises in memory if they're just never going to resolve?
apparently they get GCed, so not really
cool
 
 
1 hour later…
3:31 AM
@Shmiddty Go for it, making multiplayer games is amazing
 
3:42 AM
@copy do you feel multiplayer games are dependent on graphics? SourceUndead was real time but there was no images
I have a graphics block D:
 
Hi all, I am getting error: .map() is not a function
 
yep, that's an error alright.
 
you're probably calling map on a non-array or Map
 
@SterlingArcher Can you check it here: stackoverflow.com/questions/50711896/…
I have converted objects to array of objects but still getting an error.
 
When you console.log(profiledata) does it show that structure?
 
3:54 AM
It is showing empty object
 
Perhaps it's not being imported properly
If you drop the array directly into the component as a variable (outside the class) does it work
 
Am I using map() properly ?
 
I don't know, that error doesnt say anything
 
It is saying line 10 error.
 
Did you drop the array into the same file and not import it?
 
4:02 AM
 
@SterlingArcher What do you mean by that ?
I am getting data is assigned but never used.
 
I'm not sure how to explain that differently. Take profiledata from file 1, move it into file 2 (your react component), remove the import profiledata
Now it should all be in one file, so we can see if the issue is caused by an error in importing the array
 
Wait I will show my file structure.
 
no
one file
no importing
 
Both profiledata.js and chart.js are in same folder
 
4:05 AM
Yes, now combine them
 
Data is about 500+ lines.
 
That's fine, it's not staying there
i have to go to bed really soon
 
posted on June 06, 2018 by Michael Dawson

Summary Node.js will release new versions of all supported release lines on or around June 12th, 2018 (UTC). These releases will incorporate a number of security fixes. Impact All versions of Node.js 6.x (LTS "Boron") are vulnerable to 1 denial-of-service (DoS) vulnerability with a severity of LOW. All versions of Node.js 8.x (LTS "Carbon") are vulnerable to 2 denial-of-se

 
Ok wait checking it
Ok wait checking it
Getting the data
I am getting the objects as an array
 
because its inside an array
 
4:08 AM
@rlemon hah. I just saw this. Or I forgot about it for several years.
 
the point here: it's logging correctly now that you're not importing it?
 
Ok, so there's your problem
You're not importing profiledata correctly
Im off, good luck
43
Q: How to import a json file in ecmascript 6?

Nikita JajodiaHow can I access a json file in Ecmascript 6 ? The following doesn't work: import config from '../config.json' This works fine if I try to import a JavaScript file.

 
@SterlingArcher Thanks finally fixed the problem.
 
 
1 hour later…
5:38 AM
ohhi
 
I have a simple API with Node/Express that only returns "Hello World". Is it normal that with a 5$ server (Digitalocean) only can handle 50 request per second?
 
noidea
i would expect it to do more, but it depends on what kind of requests, from how many different locations, depends on whether the network allows that kind of traffic, whether or not it's a constant 50/s or instead more like real traffic where it's bursty, etc
Way too many factors for there to be any one answer
 
6:34 AM
heyo
 
i need little help i have to know is there any way to use no-data-to-display.js file in our multi level pie chart ?
Consider District, City and Union Council UC,
‘District – Grand Parent’
‘City – parent’
‘UC – child’
now in as a franchiser we have to see where and where we are selling our products.
my problem is when there is only distribution in district it drillDown and shows message “we are only selling in …… district”

else it shows different cities and then uc wherever we are ending it shows message.
 
@MuhammadSiddique 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.
 
sure I'll follow rules @CapricaSix
 
Bahaha I haven't lost the game in months xD
 
@Cosmo 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.
 
6:44 AM
Done
@MuhammadSiddique I feel like I'm probably missing a lot of context
what is no-data-to-display.js?
 
@Cosmo brother it is supportive library provided by highcharts
when we don't have data it will show message no data to display
 
Can you show me a piece of example code, the output you are getting, and the output you want?
 
sure
message and in multi level chart when animal -> dogs don't have further category jsfiddle.net/bge14m3a/514
 
7:20 AM
Morning all
 
@New_2_Code good after noon :)
 
Ah sorry! @MuhammadSiddique
sec
@MuhammadSiddique How about if you click on an option that has no sub-option it shows that option alone as if it were a sub-option with the message "no other categories" or such in the middle. Is that the kind of thing you want?
 
@Cosmo yes you got the point
 
okay cool, sec
 
7:42 AM
@MuhammadSiddique I'm sorry. I don't know enough about hightops
 
7:52 AM
@Cosmo well thanks for taking time have a good day
 
8:11 AM
1 message moved to Trash can
@CvP Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@CvP Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
CvP
Well that didn't work
Can I somehow see a preview of what I am sending?
 
click on that message link. It is fairly easy tho
just hit Ctrl+K before pressing enter or clicking on "send"
 
that gives you thois
 
CvP
I did in my last message, that's why I am confused
 
8:15 AM
magic text
 
which function dec. is most suitable?
 
please be a good person and use the first syntax thank you
 
that is something personal. I use the former. But if you want to use the latter, use const if you do not want that the function gets overwritten.
 
also the second syntax is a waste of memory
 
sometimes I write functions that should not be overwritten. For this, I use const ...
 
CvP
8:17 AM
if ( $('#selections > *').length > 0 ) {
$('.dropdownSelections').stop().animate({"backgroundColor": "red"});
};
 
@KamilSolecki in which context?
@CvP good good.
 
CvP
third try is the charm
 
@KarelG you are allocating a variable, that you dont really need/
 
CvP
My question is this: I try using that code in a .js file and it doesn't work
 
well do you have jQuery pulled in?
 
CvP
8:18 AM
So I thought maybe my code is bad, but when I put it in the google chrome console it runs perfectly
Yes, i do
 
where do you call it in?
after jquery loading?
 
linking order matters
 
and load time
 
CvP
Yes, after jQuery loading
It's part of a bigger .js file and those elements all work fine
 
@KamilSolecki you cannot use the name of function lala(...) {} as variable though
 
CvP
8:19 AM
but this somehow doesn't
 
(after it)
function lala(...){
  ...
}
const lala = 1; // will throw error
so there is still name binding. Does not make much difference to const lala = () => ...
 
CvP
Is there a way to figure out why my code doesn't get executed?
 
any errors?
check if the length is ok
 
any code?
 
debug step by step
 
CvP
8:22 AM
No, no errors
I checked the code step by step in my google chrome console
if ( $('#selections > *').length > 0 ) {
$('.dropdownSelections').stop().animate({"backgroundColor": "red"});
};
 
can you do $('#selections > *').length in your console?
 
Hi guys how to make regex only accepts ,[]space and " only? Thanks
 
CvP
Yes, It gives me 1 or higher in case A or 0 in case B
 
@CvP try an else block
 
CvP
what do you mean with that? (I am quite new at this)
just make an empty else block?
 
8:25 AM
you could do that, but i dont see the point of it
there is no guarantee that your code ran but the result of the if condition simply returned false
so, try putting an else block in there with a console log
 
can you alter the code a bit and do this
 
(also put a console log in the then block)
 
CvP
You are smart
 
no, I am Wietlol
 
CvP
I did a console.log("Hello world")
And it instantly gave me Hello world in the console, so it only executes once
How do I make it keep checking the if statement?
 
8:26 AM
put it in a loop?
 
could it be that your element with id selections is loaded in dynamically ?
 
you might require recursion by timers if you dont want to freeze the thread
 
it can be that at the first run, it is not present but it does when you used the console
 
maybe the script runs before the html is loaded
 
CvP
Yes, the element with id selections is loaded in dynamically
 
8:28 AM
scripts in the head (ignoring the defer option) are executed before right?
 
CvP
yes, almost everything uses:

$(document).ready(function(){
 
event window ready or something?
 
CvP
Problem I am trying to solve is this: I use a third party .js that fills my element with id selections with all kinds of things. When it does I want it to change color.
 
Any one have any idea how to use chartist.js with react. Link: gionkunz.github.io/chartist-js/examples.html#stacked-bar
 
@CvP does that plugin/library have an .complete callback or something? Something that fires up when it has added elements to the DOM dynamically
if so, just handle your task in that
 
CvP
8:32 AM
I think the solution to me problem is to change the third party .js and everytime it adds it also runs my little js part
I'll post the third party code as well, give me a second
 
@Jhawins ufff I can feel the nut pain
 
Hey anyone can help me how to use this code -> gionkunz.github.io/chartist-js/examples.html#stacked-bar in Reactjs
 
wtf
no
you have the documentation there. read it
 
CvP
app.getList("SelectionObject", function(reply){

$selections = $("#selections"); //DOM node to append selections to
$selections.html(""); //Clear node of any previous selections

//Loop through array of fields that have selections
$.each(reply.qSelectionObject.qSelections, function(key, value) {

var field = value.qField; //The field name
var numSelected = value.qSelectedCount; //Number of selections in field
var total = value.qTotal; //Total number of values in field
var threshold = value.qSelectionThreshold; //Threshold in which to display a number count instead of each value
 
@Neoares Documentation is incomplete just check it out.
 
8:36 AM
what have you tried? and what have you achieved?
 
CvP
Am I wrong when I assume I can just put my code below this code, but inside the $.each part?
 
@Neoares I am getting typeerror please check the question which I asked on SO.
 
what is "type"?
 
Typeerror
 
you need to provide one of ["Line", "Bar", "Pie"]
I mean the variable
oh, that's the transpiled code
but I guess it's getting the "stack-bar" you're giving to it
 
CvP
8:38 AM
It works! Thanks a lot for the help guys
 
Does the topic mean that this room doesn't cover typescript, etc?
 
@Neoares Ok I changed it but now it does not give error but different bars and not stack bars
 
@Cosmo why would it say that?
 
Topic: JavaScript, ECMAScript. It seems oddly specific
 
so...?
 
8:40 AM
typescript, angular, jquery is allowed here too
 
it doesn't... javascript and ecmascript are generic
 
angular or angularjs?
 
lol, these are just base
 
so everything related to javascript and ecmascript are allowed
 
@Neoares What can I do for stack bars just see the screenshot I am getting bar chart not stack bars.
 
8:41 AM
hence, any framework based on them
 
Typescript is being interpreted into js
 
s/interpreted/transpiled/
 
@Neoares Check the screenshot
 
@stonerock nice, you got it :)
 
8:41 AM
@Neoares No I want stack bar charts not bar charts
 
then check the docs and see how to do it
 
I don't think anyone here has worked with that library
I'm not gonna check the docs, I have no time
 
In docs they have not givem
@Neoares Ok thanks.
 
new Chartist.Bar('.ct-chart', {
  labels: ['Q1', 'Q2', 'Q3', 'Q4'],
  series: [
    [800000, 1200000, 1400000, 1300000],
    [200000, 400000, 500000, 300000],
    [100000, 200000, 400000, 600000]
  ]
}, {
  stackBars: true,
  axisY: {
    labelInterpolationFnc: function(value) {
      return (value / 1000) + 'k';
    }
  }
}).on('draw', function(data) {
  if(data.type === 'bar') {
    data.element.attr({
      style: 'stroke-width: 30px'
    });
  }
});
they give you this example
 
8:43 AM
@Neoares the webpage of TS uses "compiles"
 
yes, but not "interprets"
I prefer transpile, since compile to me is "from text to binary"
 
but it is actually interpreting <.<
so that main page is wrong
 
no, it's actually converting the code to javascript
to a real JS file
 
that is interpreting
 
@Neoares So I tried it similar still not getting ?
 
8:45 AM
or at least that's what babel does
@KarelG interpreting would be reading the TS file and understanding it in real time
 
no that is compiling
 
@Neoares @KarelG I see
 
idk, that's my idea of interpret... but anyway
@KarelG lol what
compiling is translating text to binary
 
no
 
go home Kerol, u're drunk
 
8:46 AM
compiling is a process to read in text and convert in a series of instruction set directly useable. Like C++ that goes to machine code
interpreting is a process to convert a text into another text which can be compiled. So TS -> javascript -> instruction set for the javascript engine
transpiling is ... hmmm
 
But the term interpreted language generally refers to "interpreted in real time"
 
my transpiler is your interpreter, @KarelG
 
it has something to do with the level of abstraction
 
My question re: transpile vs compile is simply this: is transpilation perfectly reversable?
 
^ agree
 
8:48 AM
cannot word it accurately 🤔
 
or understandable by humans
 
Understandable by humans is a rabbit hole
 
humans has nothing to do with that
give your javascript code to someone that works in HR
 
^Also I understand assembally. It's just difficult to process mentally
 
he or she would not understand some jizz
 
8:49 AM
I was going to add "a human that knows how to program"
 
^moot IMO
 
do you know all programming languages then?
if I give you my PROLOG code, can you read it?
 
I have this idea for a fun project to make a lisp out of valid javascript, using arrays and strings. Macros would be actual functions on those arrays. Need to find a neat javascript-relevant way to quote
 
man
you got the point, stop trying to find the 3 legs to the cat
 
To me, compilation is a process that typically loses some information, which is used only for structure and design purposes
 
8:51 AM
(that's an actual spanish saying)
compile is "human text" -> "cpu instructions"
and yes, even a HR guy can read a JS file
 
Transpilers typically contain all the information, since they typically contain something that is not inherently enforced in the target language, and therefore must be "embedded"
 
give him a binary and tell him to open it with any text editor (they'll go for word) and ask him to read
even minifying is transpiling xD
transpile is like "soft compile"
 
^agree (re: minification)
the "soft compile" definition might go weird with the .NET common language runtime I suspect
Although.
 
Compiling
    is the general term for taking source code written in one language and transforming into another
Transpiling
    is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction
 
Actually it might one of the earliest transpilations
 
8:54 AM
I guess it's very subjective
 
Actually, yes, similar level of abstraction is key I agree
 
@Neoares it is nit
 
> A VB6 to VB.NET converter can be thought of as a Transpiler. I might think of COBOL to C# / C++ / Java tool as a transpiler.
 
@towc so js that converts into a valid lisp program?
or in another direction?
 
Transpiling ⊂ Compiling
 
8:59 AM
@KarelG nah, just a thing with I think they're called s-expressions
the main language can still be javascript
the idea is that maybe I can golf the interpreter
 
That is the strength of lisp, s-expressions
but that led to lots of ('s
meh
 
but it's also interesting that you can absolutely use s-expressions in javascript with js-valid syntax
 
that caused me to have a habit to add a ) myself if the IDE did not auto-add that after I entered a (
@towc you need to have a sorta meta-interpreter for that
like (+ 5 2) becomes 5 + 2
that can be done with some string manipulation and using template literals
 
well, in this language, it would be something like interpret(['+', 5, 2]), and I'd have a symbol lookup for stuff like + which converts it to add(5, 2)
I wouldn't actually directly use js operators
the hardest part is probably keeping a register of scoped variables
and then distinguishing between variables and strings
sadly this is not valid in JS: {[let x = 1, ['+', 5, x]]}
and even if I used that, all the variables would be put in before the interpretation, so it's as if they were all constants
 
seems more effort, that array
interpret(['+' 5 2]) would be fun and more natural to sexpr
but that does not work :|
 
9:11 AM
@KarelG well sure, but then you change the goal of the little experiment
 
yeah not making it difficult I suppose
 
I could just use a string all the way through, and then transpile that string, but that's less fun
the nice thing about using actual arrays is that you can use actual js functions to manipulate the structure, and those are a possible type of macro already
 
@KarelG wait what is the strength in s-expressions?
 
const multBy2 = (expression) => ['*', 2, expression]
const afterMacro = ['+', 3, multBy2(['/', 3, 5])];
// ['+', 3, ['*', 2, ['/', 3, 5]]]
const result = interpret(afterMacro);
@Cosmo it's really easy to programmatically modify
 
They are convenient for some purposes (e.g. genetic programming, etc etc), yeah.
 
9:15 AM
which means that macros are really intuitive and easy to write in languages with s-expressions
 
Ah in that sense alright
 
also makes it easy to interpret them
compared to languages like javascript
 
I was going to say they have a major weakness IMO
Which, I'm going to (I realise not very usefully) describe as the lack of support for lambdas
 
lisp has lambdas
what are you on about?
 
I'm trying to figure out how to explain it, so I've spent the last week reading about genetic programming and s-expressions and s-expressions /alone/ SFAIK don't really support functions as arguments
 
9:19 AM
Hi guys
I'd like to know if webpack allow to launch a `task` before an other ?

For exemple I need to transform sprite to svg before mixing them up with my sass. s it possible with webpack.
Is there something I can't do with webpack by the way ?
 
i.e. you can do ((6+4)*2) but not as ((x+y)*(x-y))(x=6,y=4) @towc
My understanding is that you need more than s-expressions for that, since it's no longer a pure tree?
 
(lambda
  (x y)
  (* (+ x y) (- x y))
  6 4)
 
Good point.
I was thinking you needed a DAG to do it, but you're right.
Then why haven't I seen it more in the Genetic Programming styles...
 
in a way, anything that at some point of the process is completely representable through an AST, can also be done using s-expressions
someone please correct me if I'm wrong. I think I'm taking some leaps here
 
@towc obviously my lisp is rusty (I only used scheme for like 2 weeks in class); How would you use that function with two different argument sets without redefining it?
 
9:26 AM
I like s-exp
 
@Cosmo you create a function
or a macro, depending on what suits you best
 
For the purposes of this scenario, only lambdas of a fixed arity (parameter count) and primitive types exist. There is no memory space other than the connections between expressions/sub-expressions.
I want to know what the s-expression/AST looks like for it in lisp
I won't actually be using lisp, but most Genetic Programming models are either s-expressions or very closely equivilant
 
-15
Q: Why is Stack Exchange like this?

Steve WoodsWhy is StackExchange a forum when it's just copying Wikipedia standards? People have fun grabbing reputation and that's probably why they like to destroy people's help. They upheld, edit your question, only to insult you. You get slapped in the face all the time. We are all decent people though...

best meta title
 
@towc defining function would put it in an entirely seperate s-expression wouldn't it? (I did some googling)
 
@Cosmo it can be a parent
 
9:33 AM
Oh. Something like:
(
    (lambda
      (x y)
      (* (+ x y) (- x y))
      6 4
    )
    ((6 4) (2 3))
)
?
 
@Neoares wait... does he say that SE isn't welcoming enough :O
 
I don't know lisp, but do look up functions in lisp
they're not necessarily lambdas
 
I know that but my use case isn't lisp, it's just that the entire program needs to be modelled as a single expression chain (with possible branching)
 
@GNi33 how does that motherfucker dare
I'll show him how welcoming I can be
:starts sending him private messages with gifs about cute cats:
 
I think I've answered my question now anyway, thanks for humouring me
 
9:46 AM
@towc I'm surprised by that
 
10:03 AM
Hello guys.
Can anyone explain why we get the following error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404.
 
@AndroidNewBee well because that's a cross-domain request I imagine
 
they block all the requests outside their domain
 
@Delidragon 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 message moved to Trash can
@Delidragon 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
 
10:19 AM
someone know why fadeout() dosnt work=?
  AFRAME.registerComponent("foo", {
    init: function() {

      document.querySelector("#playbox").addEventListener("click", (e) => {
        this.el.emit("bar");

        document.querySelector("#playbox").fadeOut( "slow" );
        document.getElementById('playbox').setAttribute('scale', {x:0,y:0,z:0});
        var videoEl_1 = document.querySelector('#leinwandintro');

        setTimeout(function (){
        videoEl_1.play();
          }, 1000);

          })
 
@littlepootis that I don't know lisp?
I am surprised that I've gone all this time without learning lisp
 
user9674579
Hi @ towc :)
 
user9674579
10:34 AM
Any one here ?
 
@Delidragon Looks like you're setting its scale to 0 before it can fadeout
when you call .fadeOut, it doesn't do it right away, it's asynchronous
 
user9674579
Hi...
 
@Neil when i erase the scaleline it still not fadeout i guess i have somewhere a syntaxmistake but i cant find it
 
user9674579
It shows AFRAME undefined
 
user9674579
Is it an external JS library ?
 
10:39 AM
@Delidragon You're not closing properly the call to addEventListener
Or no, I read that wrong, sorry
 
-.-
 
woop woop, github is being slow, and apparently making some jenkins stuff fail
 
open up the debugger and see if you have javascript errors
 
user9674579
@ towc, can you un-ban me ?
 
we need a revenge github, just like git was a revenge on I think mercurial
how about gitgit
 
user9674579
10:42 AM
 
user9674579
Is Github now under Microsoft ?
 
@DwijBavisi I don't have the power to unban you
@DwijBavisi google it
or there's literally 2 links there explaining what's happening
 
user9674579
@towc Okay, I'll find someone elese...
 
console says: document.querySelector(...).fadeOut is not a function
 
hello guys
0
Q: CORS not working in chrome but working in firefox

SherlockGot a very weird issue wherein cors (POST) request is not working in chrome but working in firefox FIREFOX REQUEST: Host: <some data> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 Accept: application/json Accept-Language: en-US,en;q=0.5 Accept-Encodin...

need help
 
user9674579
10:46 AM
@Sherlock How can you post a SO question ? How to do this ?
 
user9674579
hello
 
@Delidragon you are using a jQuery function on a javascript ones. If you want to use jquery functions, you have to import jQuery and select your element with jQuery's selector ( $(...).fadeOut )
@DwijBavisi again, ask it to the person whom has banned you. Talk to him.
 
@DwijBavisi Just paste the link
 
user9674579
@ BenFortune thanks
 
@KarelG i use <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> can you overlook this =? I really guess its something stupid.   <script>
  AFRAME.registerComponent("foo", {
    init: function() {

      document.querySelector("#playbox").addEventListener("click", (e) => {
        this.el.emit("bar");

        document.querySelector("#playbox").fadeOut();

        var videoEl_1 = document.querySelector('#leinwandintro');

        setTimeout(function (){
        videoEl_1.play();
 
10:55 AM
@Delidragon It's not enough to add the library.
jQuery is called using $ normally
You can't mix and match in whichever way you want based on what you had for breakfast this morning
 
I have a question, what is the advantage of adding a script tag in body of a HTML ?
 
hmm ok soo is my code fixable? or should i search for another solution then writing it with jquery?
 

« first day (2790 days earlier)      last day (2172 days later) »