« first day (2833 days earlier)      last day (2340 days later) » 

19:00
Yes as part of a data join, but not like you're trying to do.
my god my project is so bad
So 100% certain that I can't have an input-less function without side effects return an svg?
Is it me or is Eclipse really flakey with builds?
Not so much the build but managing dependencies
19:15
yes
it should be the definition of flakey on urban dictionary
Eclipse is utter and absolute garbage which should be permanently deleted from the internet and all users must be reimbursed for PTSD therapy.
it's not great but it's a starting point
I wouldn't have a beginner start with IDEA
it's too heavyweight
Yep its the starting point like a volcanic caldera is
so what happened then
No beginner should have to deal with Java, the goal of engineering is to solve problems not create new ones.
19:18
I mean, you've gotta learn java sometime
Not as a first language
and you can pretty easily avoid having to learn it
@ShrekOverflow Embedded systems development makes that impossible due to all the Eclipse-based IDEs for them.
what happened to get you so upset
19:19
I programmed in C, Rust, Swift, Python and JS
and @oboecat's classes are all in Java and are more clueless than a contigous array in Java is about where the data actually is.
@forresthopkinsa I was also sent a > 10k lines hello world
@ShrekOverflow I thought the goal of engineering was job security, in which case Eclipse makes that perfect :P
eclipse is fine
...said no one ever
said every java teacher ever
19:21
@forresthopkinsa and the problem was spectactular apparently the Java ecosystem made the developer completely ignore the fact that their are lower level apis that are perfectly fine to use
teachers don't count
@forresthopkinsa Java teachers are not teachers, they are sadists in academia.
Lol ya wasted a day trying to fix dependencies today, I could have used maven from CMD line isntead
y'all need to calm down
19:22
I am calm :P
I just despise Java and I always will.
There is a guy who daily loses his shit over eclipse, but I think he may have other problems
Java's main problem is that it's too verbose
@BrianJ You know you can be way more productive in Java if you use VSCOde ?
whatever, don't use vscode for java, what are you talking about
pfft
😛
19:23
You mean it's more stable? And you can import maven projects in vscode?
If you use the cli you'll be fine
@BrianJ if you're a professional then use IDEA
^
IDEA is probably best
Lol got me
yeah IDEA has probably got more money behind it than even VS
19:24
That is doubtful
Ya it's a good way to practice your patience using eclipse
eehh it's Jetbrains' main product line
VS is an afterthought of an afterthought for MS
It's pretty good for Angular at least and React
anyway, doesn't matter
Vscode I mean
19:25
vscode is fine as a text editor, I was talking about vs itself
@forresthopkinsa Talking about teachers, one told me classes are the same things as objects. Because its object oriented programming.
@forresthopkinsa VS is bad
VSCode is good
C# > Java
sounds like the teacher was trying to dumb things down
@ShrekOverflow Totally in agreement there
vscode is a code editor, not an IDE
Hey guys. I'm working with a an async interface, and I need to do something like the following. Is there a way to do it without passing a bunch of callbacks around?
19:26
I told my current boss I had the misfortune to use Java in my job, in the interview
And you if your programming language needs an IDE for hello world there is something wrong with it.
In a mainly Java house lol
writeToAsync("data");
var dataGot = waitFor("data that indicates we have everything", timeout);
if(dataGot.indexOf("data in the middle") === -1){
    // failure flow
    return;
}
// parse the first stuff
writeToAsync("data with stuff from before");
var newDataGot = waitFor("data that indicates we have everything", timeout);
// Do more stuff
you don't need an IDE to do hello world in java
@forresthopkinsa no, he failed me in the class this was a viva question
19:27
trivia?
@forresthopkinsa I know, but anything beyond that an IDE (A) is very helpful
well sure
@forresthopkinsa In college we had to go do question . answers
to pass the class, he asked me is the class same as an object, I said no
IMO, if people don't use IDEs for a language, it means that language isn't structured well enough to allow it
well that's dumb, you should've contested that
19:28
lol how'd it go
ended up passing it because the dean liked my explanation better
love it
that's spectacular
@forresthopkinsa There are even more instances that happen
for Example, another question "Which file in Android must be created for the program to run?"
19:29
wut
was it talking about the apk or what
@ShrekOverflow s/liked my explanation better/knew I was right
@forresthopkinsa no idea, just that.
that's an idiotic question in the first place
ok so I guess I can see why you don't exactly have an affinity for programming teachers
19:30
at once instance

`int foo(char * foo){

}`

Was defined as "call by value"
because we are passing the "value of the pointer"
I didn't goto classes much after a few of those only wrote exams and passed classes
in a promise chain... can i get a value that is then placed to the global scope?
in one of the chains
@ChristianMatthew show example ?
return Promise.all(urls.map(url => fetch(url, {mode: 'cors'})))
    .then((resp) => {
      console.log('initial resp ', resp.length);
      return Promise.all(resp.map(status));
    })
    .then(resp => Promise.all(resp.map(contentLength)))
    .then(arrayBuilder)
    .catch(function(error) {
      console.log('Fetch Error :-SSSS ', error);
    })
19:32
-1
Q: Unable to ask new questions or edit questions from Internet Explorer 11

Sonic the Inclusive HedgehogA very recent change that has been deployed is preventing me from asking new questions or editing existing questions using Internet Explorer 11. (Yes, it is a supported browser.) When asking a new question or editing an existing one, the tag bar appears in plain text, and the submit button is al...

I see no global
i need the resp.length
@forresthopkinsa My personal opinion is that CS classes especially the ones like Data Structures should be taught in C and not Java.
@ShrekOverflow Jesus. Where did you study?
@minusnine 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.
19:34
let thisValue = 0;

    return Promise.all(urls.map(url => fetch(url, {mode: 'cors'})))
    .then((resp) => {
      thisValue = resp.length;
      console.log('initial resp ', resp.length);
      return Promise.all(resp.map(status));
    })
    .then(resp => Promise.all(resp.map(contentLength)))
    .then(arrayBuilder)
    .catch(function(error) {
      console.log('Fetch Error :-SSSS ', error);
    })
I mean the reason they do stuff in Java is because you're gonna find more professionals working with Java on a daily basis than C
@forresthopkinsa every software engineer at my company knows C. Very little work here is done in Java. I don't think that claim is valid as a generalization.
    let thisValue;

    console.log('thisValue = ', thisValue);

    return Promise.all(urls.map(url => fetch(url, {mode: 'cors'})))
    .then((resp) => {
      thisValue = resp.length;
      console.log('initial resp ', resp.length);
      return Promise.all(resp.map(status));
    })
    .then(resp => Promise.all(resp.map(contentLength)))
    .then(arrayBuilder)
    .catch(function(error) {
      console.log('Fetch Error :-SSSS ', error);
    })
  }
this is what i mean
i am obtaining a value from the promise chain but how can i access that
@forresthopkinsa Lemme ask you this at what point Link Lists out perform Vectors ?
access what, the length of each request? the sum of the length of each request?
19:37
the length of the reques
which is 20
and where are you trying to access it?
i see you define a variable and update said variable
in the .then(contentlength
if contentLength is defined elsewhere, it can't access it
I'm not arguing for which language is better because that argument will go on forever and there's no real answer to it
😃
19:38
cfml is better
next
Me neither, I am just saying C Is better at the task of explaining how and why data structures work than Java will ever be, because the entire point in Java is to hide memory management.
hmmm... then how can i properly get something that will set a global scope from the initial response of the promise
that's fair, I get you
i don't think you need a global scope
or accessible scope
19:39
@PatrickRoberts of course it's valid. Java is statistically much more widely used.
pass it as an argument
user1596138
lol
look at tiobe or something
@forresthopkinsa This goes against 😃 octoverse.github.com
user1596138
19:41
2
Q: How can I do it by forEach()?

noyon07I already did some work with a search bar and it's working. Now I want to do it with forEach() or filter() instead of for loop with pure Javascript. Here is my HTML and JS code. Can anybody help me? function myFunction() { let input = document.getElementById('mySearch'); let bind = inp...

user1596138
This question needs help badly
user1596138
That title
Bergi answered it, it doesn't need anymore help than that.
also I think a significant Java work comes from Android
which I am betting will move to Kotlin faster than JS moved from Angular to React
user1596138
@PatrickRoberts Love when people answer terrible questions and have 300K rep :)
user1596138
19:43
Slow clap for bergi.....
pfft like github's repo stats represent real businesses at all
as for android and kotlin -- I totally agree
I know Java is still huge in enterprise but from most engineers that I talk to
they quote the reason for using it as "Legacy" not "Choice"
@LadyBird Bergi's an awesome guy, I see him answer tons of JavaScript questions all the time.
it's not 'legacy', people use COBOL for 'legacy'
people use java for 'commonality'
everybody knows it and has worked with it
he answers a lot of duplicates
19:44
> commonality
is subjective, our entire stack is written in Node w/ only the Android & Java SDKs in Java
and yet here you are
knowing java
I have written a fair share of code in Java for "legacy" reasons.
if you're hiring back-end devs, do you think most of them will know java or node
sorry, I'm not a fan of rhetorical questions, I think you get my point
19:46
you might find perfectly great ones who know neither
no idea
because they programmed in C#
i only know one backend dev
@forresthopkinsa I think we are in agreement :D
ok well the answer is that Java is the lingua franca of the back-end community
yeah I mean I get what you're saying
19:47
> lingua franca of the back-end community
I agree that Java is far from optimal for, uh, literally any use case
it is good at consuming resources
and creating garbage
you see what I did there 😃
yeah that was clever
can you use || inside bracket :) syntax like x['get' || 'put']
19:49
that's bracket syntax
@Rick depends on what you expect that to do. If you expect it to return x.get then yes.
if get is undefined I want it to witch to put
'get' is a string..
i think what you need is x.get || x.put
dam that seemed so obvious it hurt. brain fart!
if you expected x['get' || 'put'] to give you x.get or x.put, based on whether or not x has get.
19:52
thanks @PatrickRoberts i am reading through that and i have a question
where would i split the promise in my first return statement?
or the return of the first funciton
function
user1596138
@PatrickRoberts Yep, tons of horrible questions. He's a great guy when it comes to feeding the horrendous quality of content on the site :)
thx @KevinB :)
CircleCi is down and rip me
do you mean me?
user1596138
See him all the time pulling fastest gun in the west answers to the worst questions ever lol. Like that one I just linked
19:53
@LadyBird You mean "making it useful"
user1596138
Why wouldn't he fix it or close it? Dude's got Gold JS badge.
user1596138
@PatrickRoberts LOL. Hell no...
user1596138
How'd you get off ignore just realized who you are
@jake We can setup a call to discuss that 😃 ?
19:56
a useful question an answer does not make
@PatrickRoberts i am trying to split this but it isn't working as expected
or perhaps i am doing it wrong
is this legal
return Promise.all(urls.map(url => fetch(url, {mode: 'cors'})))
    .then((resp) => {
      var resultA = Promise.all(resp.map(status));
      var resultB = resp.length;
      console.log('initial resp ', resp.length);
      return resultA + resultB;
    })
resultA + resultB is weird.
resultA is a promise...
yes but i need resultB to be assccessed in the next .then statement
right... but... resultA is a promise.. it isn't a number or string that you can concat with resultB
yea i thought that was wrong
what is the correct way doing something like this
20:06
return Promise.all([resultA, resultB]) or change the (resp) to async (resp) and return { resultA: await resultA, resultB }
you could return Promise.all(resp.map(status)) and .then off of it, doing the calculation inside the .then
That would also work
return Promise.all(urls.map(url => fetch(url, {mode: 'cors'})))
    .then((resp) => {
      var resultA = Promise.all(resp.map(status));
      var resultB = resp.length;
      console.log('initial resp ', resp.length);
      return resultA + resultB;
    })
    .then(resp => Promise.all(resp.map(contentLength)))
    .then(arrayBuilder)
    .catch(function(error) {
      console.log('Fetch Error :-SSSS ', error);
    })
what is Promise.all(resp.map(status)); doing anyway
i do the .then but i need the value from resultB to be used in the next .then statement calling contenlength
response.ok
20:08
does it need to be in a promise?
mmmmm not really but it still has the same issue
if it weren't in a promise, you could do the calculation directly
I feel like you're making fundamental async mistakes... and in doing so some of the code your showing that you have problems with are problems caused farther up that aren't being presented.
making the whole solution more complex than it needs to be
Is it possible to gererate a jsonpatch from 2 arrays that understands objects moving/deleting/adding inside the array? github.com/Starcounter-Jack/JSON-Patch
For example if you delete the first item it generates "replace" for every item in the array, rather than just a "remove" of the first item
the promise chain is simple really it runs a status and then the calculations in contentlangth - An unknown error has occurred
the issue... which i feel is fundamental... is that i am trying to get a value from the inittial response and carry it through... not just the promise of the respnose - An unknown error has occurred
what seems complicated to me is not being able to carry a variable through the promise chain
In your updated example you haven't broken the chain anywhere like suggested in Bergi's answer
20:19
var tester;

    return Promise.all([urls.map(url => fetch(url, {mode: 'cors'})), tester])
    .then((resp) => {
      var resultA = Promise.all(resp.map(status));
      tester = resp.length;
      console.log('initial resp ', resp.length);
      return resultA + tester;
    })
    .then(resp => Promise.all(resp.map(contentLength)))
    .then(arrayBuilder)
    .catch(function(error) {
      console.log('Fetch Error :-SSSS ', error);
    })
how about that
you can't add anything to a promise
No. Create a variable reference to a .then(), make sure every .then() returns one value, and any .then() expecting multiple values, chain them from a Promise.all(...) of multiple referenced promises.
how do i create a variable reference to a .then
var promise = Promise.all([urls.map...]).then((resp) => {... return oneValue }); and then return Promise.all([promise, someOtherValueIWantToPassIn]).then(([oneValue, someOtherValueIWantToPassIn]) => {...});
hi guys, ive had a crazy long day and am now stuck on an apparent simple java problem, but i cant figure it out. I can reproduce the problem like this (gives classcastexception):

List<Object[]> list = new ArrayList<Object[]>();
list.add(new Object[] {"1","2","3"});
Object[] e = list.toArray();
Object[][] b = (Object[][]) e; <-- classcast here

Any ideas ?
20:26
@KelvinWayne 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.
Can't tell if trolling...
ok perhaps this is the confusing part.
but i think i get what you're saying now
i thnk i get it... the confusing part i that i need a value from that fetch
so essentially i would be doing the exact same fetch again to obtian only the arraylength.
doh wrong room
sorry
and then passing them both in... i think this is what you're saying
@ChristianMatthew if you can get the length from the fetch then just fetch one time .-.
20:29
@PatrickRoberts but that is what i am saying
i get the length because initially it is an array of objects... i.e. [response... 20x's
that number 20... what i need
but eachtime i access the array further it isn't an array it is just a list of objects... in free form
sorry access the response*
I don't even see you using the length later anywhere in your chain, why do you need to pass it on?
yes I need the value... i need the total assets done / total
it's a progress bar
well i guess i won't need it anywhere in the promise chain
i'll need it outside of that
so maybe you're right
Which function needs the length?
it will be outside of this chain
it.. can't be
it will have to be part of the chain, or in a callback that gets called once the chain is complete
20:44
@forresthopkinsa Not sure i would agree there
> Java is the lingua franca of the back-end community
I've been a backend dev for 12 years, have never worked in Java or worked with a person who had worked with Java since University.
why? my urls are an array... i can just count that no?
@KevinB
Hello
0
Q: PUT request doesn't work on Axios

CodeLoverI want to update the data of the row of my table developed with NodeJS on the backend, ReactJS on frontend and MySQL about the database. My Edit class : constructor(props) { super(props) this.state = { clients: [], Prenom: '', ...

can you help me ?
uhm..
the error message tells you what is wrong
Like in great detail
The request resulted in a preflight being sent due to either your additional (unnecessary) headers, or the credentials being sent.
Your server responded to the preflight, but it did so incorrectly
"Access-Control-Allow-Origin": "*", doesn't belong in your put request
20:56
Anyone who knows the name of the syntax where you pass object properties as a function parameter, instead of the object itself?

[{a: 1, b: 2}].map(({a, b}) => console.log(a));

compared to

[{a: 1, b: 2}].map((item) => console.log(item.a));
and on the server, in your CORS settings, you can't use origin '*' if you are using withCredentials
yeah, destructuring, but that only works if the function is called with an object parameter
@KevinB when I remove headers, I get PUT localhost:4000/app/editclient/undefined 0 ()
and what is the new error message?
also, fyi, this.props.match.params.Code is undefined.
and error on backend Error: ER_TRUNCATED_WRONG_VALUE: Truncated incorrect DOUBLE value: 'undefined'
20:59
when I remove headers on axios
which is caused by this.props.match.params.Code is undefined.
How can I fix that ?
No idea. it's caused by code not included in the question
when the edit class is initialized, its props don't include said value
Can I send you the code of edit class ?
i don't think it would help
the important bits of it are in your question
the router you're using for the front-end is where the param is being lost, unless you're doing server-side rendering, in which case i dunno how that'd all be setup
that or the path you're using to get to Code is incorrect
21:05
@KevinB Thanks a lot
function ({foo, bar} = {foo:1, bar:2}) {
  console.log(foo,bar);
}
I resolve that to add :Code on path : { path: '/clients/editclient/:Code', name: 'EditClient', component: EditClient }
what router are you using with react
react-loadable
I want to create a popup of confirmation when I click on delete button
I used SweetAlert, but it doesn't work
@LadyBird Done, he will never know what I did.
21:24
@meagar of course there are exceptions but you're more likely to find a backend dev who knows java than C# or god forbid, javascript
;)
If i want a particular store to only be initialized when it is needed, but then remain initialized and available for future use from then on, would it make sense to do that from within my root store, or should i design it such that it exports an already initialized store so that the next time i import it it's already initialized and just leave the rootStore out of it.
I'm thinking that if i import it with import('../stores/UserStore') and make sure that its default export is an initialized store, any time in the future that i import it during that page load will import the same already initialized instance
and would take advantage of code splitting
21:39
Please how to reset the input of forms on reactjs ?
if the value of the input is based on an observed property, change the observed property back to it's default value
I try that
axios({
method: 'post',
url: '/app/ajouterclient/',
data: client,
withCredentials: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
'Accept': 'application/json',
}
}).then(function(response) {
// empty form
this.setState({ Code: '' });
this.setState({ Prenom: '' });
this.setState({ Nom: "" });
this.setState({ FAX: "" });
this.setState({ Telephone: "" });
this.setState({ Email: "" });
this.setState({ Adresse1: "" });
this.setState({ Adresse2: "" });
}.bind(this)).catch(function(error) {
but when I click button, the form doesn't reset
anyone good with batching processing?
I can batch the array but I am wondering how to process each bach
21:57
So I came across - isocpp.org/blog/2014/06/stroustrup-lists just wondering if any of you experts disagree.
I am not sure, but it sounds like he praises vectors as black magic that solves everything
but I have no clue how vectors are made and what they are meant for
in my view, each collection type has its own purposes
a (hash)set has the purpose of O(1) lookups
a linked list has the purpose of O(1) insertion/removal
a random access list (usually the normal ones) have the purpose of O(1) access (by index) (and support binary searches if sorted)
a tree has a combination of purposes, mostly supporting binary searches and being sorted with an O(1) insertion (which means it is great for sorted collections)
a map is simply a set, except it separates the stored value from the lookup value
just like that, everything has its own purpose
if vectors have O(1) lookups, O(1) access and O(1) insertion, then fine, use it as much as you like, but I don't believe it has these properties
22:13
@Wietlol A vector is more or less ArrayList from Java
but guarantees that your objects will actually be contigious in memory
so... an array?
contiguous elements are a piece of black magic though
in Java, an array of value types would be the equivalent I suppose then
apart from that value types aren't yet released
contiguous elements are a great thing to have for high throughput when copying
copying a tree or linkedlist is super slow compared to copying an array
true dat
I think I would use a binary tree here
> Insert a sequence of random integers into a sorted sequence, then remove those elements one by one as determined by a random sequece of positions.
or maybe not
insertion would require a search for the value (because it is a sorted collection) and then insertion
the removal would require an index access and then the removal
a set has O(1) lookups, but no nearest-value-lookup
so, the best you would get is a tree with O(log n) lookup and O(1) insertion
unlike the vector, which would be O(log n) lookup and O(n) insertion
however, on removal, the tree would have an O(n) index access with an O(1) removal
while the vector has an O(1) index access with an O(n) removal
so naturally... the tree would be more performant right?
except that the insertion and removal of contiguous collections are fast and their impact on performance is far less than the impact on performance of the index access the tree has
22:29
Why is there no Markdown plugin for Gmail ?
I think that the most performant way of doing this would actually be to put things into the tree, then moving them over to a vector and then remove them
Try doing it 😃
prove him wrong :)
I can't for the love of my sanity do benchmarking though
nor would I do this in JavaScript
I'll help you with that and yes you'd need to do that in C++/ C
because afaik Like Java, JS array's just keep references to the actual data
ow, its a C++ post
22:31
@Wietlol I think it'd apply to any language that lets you do memory management like C / Rust / C++
ofcourse std:: stuff didnt give it away :D
I think C# can also do this right?
because List<Int32> does not box the values
no idea what C# will do on lower level
I am not familiar with C++ though
it has been a while since I last used it
i think last time I used it was with high level maths on project euler
23:21
@Wietlol i used it recently to add python bindings in node
after the initial madness of understanding CPython
everything else was a breeze
23:34
is there a way to collapse an array, for example, array =[ , , 25, , 0, , 55 ] 25 at index 2 , 0 at index 3 , 55 at index 5 to -> [25,0,55] 25 at 0, 0 at 1 and 55 at 2?
without iterating over the values?
something has to go over it
so no
23:49
@Wietlol you can watch his talk (it is lacking some context) channel9.msdn.com/Events/GoingNative/GoingNative-2012/…
When is javascript going to get quantum computing capabilities! why is technology moving so slow!
@Rick that statement made me quit
quit what? :)
you do know that was a joke
it wasn't

« first day (2833 days earlier)      last day (2340 days later) »