« first day (3293 days earlier)      last day (1638 days later) » 
00:00 - 13:0013:00 - 00:00

12:22 AM
@forresthopkinsa any idea why var global = this;?
 
context?
 
this is a finicky keyword in JS so it's pretty standard to defer it to another variable that won't get unexpectedly rebound
 
ok
any idea which to use? vm, WorkerThreads, or fork?
 
morn
 
12:34 AM
morn
 
12:56 AM
afternoon
@JBis I'd use vm
unless you need it to run in parallel
 
@thangtran 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.
 
@forresthopkinsa yeah I do, going with worker threads will change if needed
Any reason for the undefined?
 
 
6 hours later…
6:39 AM
mornin everyone
 
hola
 
or i should say afternoon
hey neil hows it going
 
morning for me
still waiting for the coffee to set in
 
where are you from again
 
Italy
 
6:40 AM
italiano
 
yup
 
that's cool
literally missed work today
woke up at 2pm LOL
 
ouch
what did they tell you when you came in late?
 
i texted my supervsior
i woke up late, will be in office by 3
she was like its fine just take some rest
idk if it was sarcasm
or she actually meant it
 
if it was sarcasm, you'll hear it again, I'm sure :P
 
6:43 AM
haha lol
u use JS at work?
 
nah, I used it much more at my previous job
 
I'm mostly a java programmer
 
java is my favorite
 
I dabble in Kotlin, but unfortunately for work they just want java
 
6:46 AM
except for the time when I had a multi-threading module, I hated java
 
there are some important concepts to learn with multi-threading
 
yes
the teacher wasnt any good at teaching
i was literally o nyoutube all day tryinng to learn
 
maybe the teacher didn't even know
 
lol nah he did know his stuff
probaby expected us to self study as well
 
what helped me most was to think of a thread like a debugger line
with multiple threads means multiple debugger lines potentially
 
6:50 AM
our assignment was basically a bus station
we had to simulate ticket machines, ticket inspectors, waiting areas, bboarding into buses
all worked cool until the lecturer made customers walk in faster, that generated a dead lock
 
yeah
when you're dealing with multiple threads, it is likely one will be 100% occupied and another will not
you just want to be sure that the resources you're sharing won't create a deadlock situation
 
7:07 AM
Hi All
i have a array as below
myOrder = [1,1,1,0,0,2,2,2]

i want to get the below output
// output [0,0,0,2,2,2,1,1,1]
here im not suppose to use the temp variable, also if i can use swap
how can i acheive it.
i tried to compare and use splice function in es6, but i dont achieve it completely.
can someone suggest some approach.
 
@SamSam return [0,0,0,2,2,2,1,1,1];
 
@SamSam what for logic do you expect it to be?
the Array's .sort accepts a function. Use it to define your ordering
@BartekBanachewicz you don't say?
 
@KarelG note how this very simple program produces the expected output :)
 
function getRandomNumber() {
    return 4;  // chosen by fair dice roll
                   // guaranteed to be random
}
@BartekBanachewicz can't deny that logic. Based on the requirements given, this is the simplest program to achieve that goal :)
 
Eh Bartek, you've missed the "output" string. No, it ain't the expected output.
 
7:19 AM
also the comment
so return "// output [0,0,0,2,2,2,1,1,1]"; actually
 
^^
 
/\ /\
 
@Antonio 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.
 
@Neil it has to be this
async function getRandomNumber() {
  const val = await throwDice();
  return val;
}
then it instructs a midget or some creature in our pc to throw it
if he does not respond. Too bad. He has rights on some spare time.
Or she.
Or it.
 
Also, you gotta love it when someone comes in with a regex question and says, "I want to be able to match "XXXaa4772313724"
as if that somehow made it clear
 
7:26 AM
@KarelG How dare you offend the non-ternary people
 
@Neil using === is ok tho.
 
== === === is false, but == == === is true
 
@Neil yeah. I'm seeing so many underspecified questions lately.
"I'm writing a program to process some data, but the output is wrong"
my dude, that's literally half the site
 
"halp! fix it!"
 
listen to this and tell me what you think
I had it on repeat for like an hour now and I think I still don't get it
oh, looked up the band finally, it's "experimental". there.
 
7:34 AM
Mmm... Is there any active question here?
 
OP questioned why there is a bad operand error (in Java). Then he came with
> int e = (a&1==0)?a:b;// error: bad operand types for binary operator '&'
yeah
 
i don't even know what that does.. get a if it is even? otherwise b?
 
@Neil is supposed to
 
a&1==0 does not work due of operator precedence
 
7:36 AM
but apparently doesn't work?
@KarelG what
 
don't forget that the question is in Java
 
fuck me if know the java op precedence by heart
 
Ah! I see. a&1==0 in java means a & (a === 0) in js?
 
(a&1) == 0 is the way to go
 
i mean yeah it's something you figure out eventually
the commonly ugreed upon method is extracting subexpressions as helper variables
until it either works or breaks at a smaller scale
 
7:40 AM
this is not the first time I see someone struggling with operator precedence
Saw other two cases in two days
 
y'know, at least it's a type error
 
🤔 is that not a basic thing people should be aware of? Keh, they came with ugly code. Might not be a surprise.
 
8:40 AM
caprica or ୧༼ಠ益ಠ༽୨ riot
 
no.
 
no?
୧༼ಠ益ಠ༽୨
 
Hey folks, is anybody familiar with Google Closure Compiler?
The Closure Compiler mangles property names which is causing my code to break.
Does anybody know of a way to disable this?
I know that I can replace .property names with ["property"] names but I can't do that everywhere.
 
8:53 AM
@AaditMShah you need to use object literals (with other words: quoted strings)
like
let obj1 = {
  foo: 11, // not ok -> will be mangled
  'bar': 22, // won't be mangled
}
or use an "extern" interface. It has been a while tho. *digs*
 
Right, I know that you can use string properties. However, as I said before that's not an option for me. It'd be too much work to convert all the properties to strings, and it might break things. For example, if the object has the original name but the place which uses the object has the mangled name.
 
9:15 AM
that does not get mangled ...
 
10:06 AM
I've this code in my angular app
declare let ga: Function;
declare let fbq: Function;
.
.
.
ga('set','page',y.url);
ga('send','pageview');
fbq('track', 'PageView');
pixel is collecting data while navigating via routes but ga('send',,) doesn't send data
It collect data on initial loading only.
y is the instance of NavigationEnd
And there's this code in contact form and fbq is working here but ga doesn't
ga('send', 'event', 'Contact Form', 'submit', '');
fbq('track', 'Contact');
 
I’ll just drop this here and see what happens ;-)
5
A: Code Block Language Identifier and "How to Format" Help Box

Martijn PietersWhen you use ```[language] (or <!—- language: [language] -->) where the language hint doesn’t start with lang-, the actual language to use is taken from the default language setting for the tag named language. So ```javascript takes the language setting listed at the bottom of the javascript tag ...

 
10:25 AM
Hello EveryOne !
Anyone here can help me with an advice ? To how i make my own Email client ?
In node or python ?
 
@Hemant learn how to make a formal request using POP3 or IMAP
probably you should have a handler for each type of e-mail protocol you have
 
Use what you are most comfortable with. Both languages would be capable.
 
I'm more comfortable in node.js
Can you please elaborate this to me, step by step so i can easily manage this?
@Martijn Pieters means just as formal steps to complete this my email client module
 
@Hemant the e-mail protocols have a means for you to do whatever you want from reading e-mail to marking them read to deleting them from the server
you need to create a very simple interface which, provided the e-mail server, protocol, and credentials, you can let a user do any of these operations
once you've done that, you can polish the interface and make it look prettier
 
Yeah ! right.
thanks for this better advice :)
you made my day !!!
 
10:37 AM
@MartijnPieters I think javascript is better than js. I mean the tag is better than synonym
Otherwise it'll confuse when SE add support for more languages
 
May this be starred ^
 
wtf
the person that comes up with one of these are worthy to get a b-slap with my balloon axe
 
10:57 AM
@KarelG <3
I have to say SwiftUI/Vue is angular done right
but then again, I might be biased, because its closer to react still
wish it'd compile to Web
 
@SagarV not sure what you are saying. There is a tag synonym and there is lang-js and lang-javascript.
So with my change to the default highlighter for you can now use all four.
Oh, and ecmascript, should you do be inclined ;-) any of the tag synonyms, actually.
 
that's not a ^ language
 
@KarelG doesn’t matter. If there’s a tag for it and it is a synonym or has lang-js set as the highlighting language then it’ll work.
 
@MartijnPieters ```js is working but ```javascript doesn't
 
So why are there tag synonyms? Accessibility?
 
11:07 AM
heh it is close to 2 million questions already o.o
 
@SagarV thats just how markdown is formatted. That doesnt have to do with the tags
I guess they could make an interpreter for ```js and its synonyms, but its easier just typing js
 
@SagarV have you tested that just now or is that just your past experience?
 
@MartijnPieters now
 
Hmmmm, perhaps there is some caching that needs to clear still.
 
Is it normally supposed to work?
 
11:10 AM
Because ` ```javascript ` should just pick up the language from the tag now.
 
honestly Ive never formatted with anything besides ` ```js ` so I wouldnt know
 
@MartijnPieters i.stack.imgur.com/1jT9P.png --no-onebox
 
@TaylorS it was broken before because the tag had lang-default, see my linked post above.
 
Yeah. caching might be the problem
 
Ah I see now
 
11:11 AM
@SagarV grumble 😖
 
@KarelG ya, but if i use sort, it will directly sort in either ascending or descending order.
 
@SamSam there is another comment below it
4 hours ago, by KarelG
the Array's .sort accepts a function. Use it to define your ordering
so create a function that accepts two values and give it an ordering number you need
(but idk the logic behind that output from yours)
 
How much more can I improve the look of this page? https://skylerspark.github.io/

Ive already added smooth transitions with JS among other things
Im stumped again .-.
I guess I could work on the projects page...*sigh*
 
@SagarV works for me, actually.
See i.stack.imgur.com/8vjBJ.png (Chrome on iOS).
 
@MartijnPieters yeah. it was my browser. A hard reload fixed it
 
11:16 AM
This school's image blocking system is so aggravating... cant even see screenshots on here, much less profile pictures
I can only see a few profile pictures from people who signed up with stackoverflow with google
 
@TaylorS align the title to left and menu to right
 
I like it centered?
 
@TaylorS they are blocking all of imgur most likely.
 
Yes, it just so happens SO uses imgur for everything.
actually, the site at its current stage right now, allows the screen to function and look good on all PC Screen sizes, and on ipads
If I centered left, itd probably ruin it for ipads :(
 
@TaylorS ah then ok. The links doesn't have cursor:pointer. Is that intended or missed?
when using a without href, pointer cursor should be added manually
browser won't do that
 
11:20 AM
I use cursor default because I like the minimal design
I only use cursor: pointer; on links in the page content (Like in the contact page)
the Title and Main Links in the top bar are minimal, unselectable, and unchangeable.

Basically just Static Text-Buttons
Honestly Im still trying to make my site function on ipads and phones.
It works somewhat nicely on landscape mode on small ipads, and it works perfectly on ipad larges (like the ipad 2) and the ipad pro
but on phones its just squished
 
@SagarV I've a pending task to finish. Anyone have any experience with this?
The ping target is the question.
 
Hey guys, can someone help me with a JS question?
 
no </joke> --- just ask don't ask to ask
!!welcome zadders
 
Capricas been dead for days
 
ahahahah okayy ty, I'll link my question then, been trying to figure this out for days now
https://stackoverflow.com/questions/58484613/how-to-see-updated-list-without-refreshing-the-page/58486697?noredirect=1#comment103334262_58486697
 
11:34 AM
rLemon is also dead lul
Or just zzZZZ
 
ooops
 
Oh yeah I just remembered
 
@jandy jsfiddle.net/fyKzV/15 how is this code?
 
I saw Madara Uchiha on iosgods .-.
lol I almost completely forgot
was surprising though, didnt think of her as much of an ios game hacks type of person
but, it IS a programming forum, so to be expected I guess.
 
@zadders if you're going to preventDefault of a submit button, then just call it a button and not a type="submit"
let submit buttons submit by default
 
11:37 AM
@TaylorS Watch Naruto
He is a literal god
see ^
 
Naruto.... heckanoooo
Ill stick to DrSTONE and Bokunohero
 
That is where MadaraUchiha is from
 
@Neil So I'd just remove hte //type="submit" since the form is a onSubmit anyway?
 
Oh, well the only reason I thought it was her was because they had the same Profile Picture
 
11:38 AM
the person was talking to DiDA (forum admin)
,-,
I cant tell on this place...
 
wait do you have a crush on @MadaraUchiha ? or something?
 
???
,-, Since when did you come up with this...
 
right now!
 
@zadders depends.. are you ever submitting the form?
 
Welp... Thats a big No
 
11:40 AM
if you're exclusively making ajax calls, then the usage of forms should be for convenience
 
I'm not on iOSGods, Madara Uchiha is an anime character, and so it not that uncommon a nickname.
Also, both Madara the character, and myself, are guys :)
 
yeah, if i remove type="submit" then the form doesn't get submitted. But if i leave it there, it gets submitted and the API is updated. But since the page isn't refreshing, the list isn't updated @Neil
 
ga('set','page','/portfolio');
ga('send','pageview');
 
@MadaraUchiha pfffft
 
on console also not doing anything
 
11:42 AM
That seems more like the very reason why you chose the name
to stay anonymous 😛
 
@TaylorS DrStone is legit godly tier T.T so is boku no hero, but naruto and boruto are actually realy good too
 
--- or ahem that might just be a rogue wood/shadow clone :P
 
@ShrekOverflow pseudo-anonymous anyway, but yes.
 
oh hai dievardump
 
@zadders well you'd need to update it yourself
 
11:44 AM
love this chat in this timezone
 
the approach should switch from letting the server prepare the page to you loading the information to show through ajax
 
I use Madara Uchiha as a nickname as a longstanding tradition of using nicknames from animes, but the reason for using a nickname to begin with is that it's simple to prove who I am on Stack Overflow IRL, but not simple of scrubbing my name from everywhere should I choose to.
 
@Neil What do you mean by that? How could I go go about updating it myself through ajax?
 
@zadders make a backend request for the information you want to see updated on the page
then access it through ajax
or simply send the updated information together with the reply that goes with your original request
 
@Neil hmm, I don't actually know how to do that. Are there any sources I can look at to try and learn how to?
 
11:46 AM
well without knowing what backend you're using
 
I'm really new to JS and React so a lot of it is really unfamiliar to me
 
you need to ask the server for a json holding all the information you require, rather than asking the server for a web page
 
I'm only working on the front-end pages for this project I'm doing for work. So theres only a set list of pages I've been given access to
 
if the only way to see the page with the updated data is to reload, then you must reload
you can't really get around that
this would be your approach if you wanted to achieve the same thing without reloading
but that also means you need to be able to ask the server for the data (json) minus the page
 
11:49 AM
Is there no way to reload an individual component without refreshing the page?
for example I'd only reload my HelpList.tsx component instead of the whole HelpAdmin.view.tsx page
 
@zadders Sure there is, react components update whenever either their props or their state changes.
So you either get new information in an ancestor, and pass it down as props to the component, or you get the new information in the component, and setState it.
(Alternatively, you manage business state outside of React with a library like MobX or Redux, but those have their own ways of doing things)
 
So let's say I've got my function that allows me to create a "card" and adds a new set of data to the API. How could I then update or reload the state with the new set of information I'm submitting?
 
Quick question if anyone knows how to fix this:

Im making the CSS hover effect the div with the class of .projText to make it rise a little, and show the text inside of it per project. However, it seems, that on the first box, whenever it expands the height, it pushes the entire projects section down a little
how can I make it so it doesnt push it (I know this isnt JS but there isnt a CSS Chat)
I like the look of it, but I also dont really want it like that.
 
@TaylorS How about you just set the box-shadow effect to animate and expand, which gives it the effect of it hovering without it actually moving?

so for example lets say you have a .card, make it so it's

.card {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
and then

.card:hover {
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
the animation of the shadow will make it feel like the div is rising
obviously you can play around with the pixels and colour shading to suit your likings, but this is just the smoothest one I found for myself
 
12:06 PM
oh. I see
I was looking for those "ease in text" effects
the text is hidden until you hover
but it always results in this, Ive tried Overflow, z-index, among other things
Ill try using something other than divs I guess...
 
Ahh I see what you mean, I've never worked with those ease in text effects tbh, but it is weird that it pushes everything else down
 
well its a child element, youd think that a child element ahead of the behind elements with z-index would smoothly go over it :L
Ok, so turning them all to span tags and being a little hacky with margins, I think I got it to where its not half bad/too ugly...
 
Have you tried displaying it as a grid?
 
shudders... grids...
Perhaps I should just make a JS animation with onmouseover
 
I tried setting all your <span>'s to <div>'s which seemed to have a similar effect to changing them all to <span>'s
but it makes cards display vertically rather than horizontally
 
12:14 PM
Eeck... thats wierd
 
@TaylorS css grids is an useful tech imo...
 
I agree with Karel, grids has made styling pages much easier for me
 
Well, perhaps Ill just set all their positions to absolute, and then add a hidden element above the proj div, and when I hover over proj divs, it will expand above the box, rather than inside it
 
All im facing one issue with my mongoose mapping
this.Model.findOne({
            _id: record._id.toString()
        }).exec((err, dbRecord) => {
            dbRecord.merge(record);
            dbRecord.save(saveErr => {
                if (saveErr) {
                    return next(saveErr, null);
                }
                next(null, null);
            });
        });
 
outside of it, I can also set the z-index and position to not push upwards
 
12:15 PM
below is my code but the problem is it return null in dbRecord and hence i get the error of undefined
 
Sam Sam stop trying to ping the whole room lol.... also if that worked, it would be horrible and abusive
 
also there is data with that record Id
@TaylorS Ya, indeed my mistake, wrongly added @
 
Honestly, if this chat thing had @all, id cry (Not literally)
 
@MadaraUchiha forgot to tag you in my previous message
 
12:31 PM
@SamSam .exec is just ... why don't you use the callback way?
(if you are doing the promise way: just do .exec() at the end and do a check further in chain)
 
hi anyone knows react js
i'm getting an error unexpected use of 'event' no restrcited-globals
 
@Atulkumar THAT IS A LINTER ERROR
and, you have forgotten to pass the event parameter
event is also a global
 
12:50 PM
@ShrekOverflow tries still getting the same error i'm posting my code here have look and tell me what to change in that :-
 
Learn to code
 
sendMessage(e)
{
e.persist()
if((e.keyCode==13||e.which==13) && !event.ctrlKey){

let data={
senderId:this.state.currentUser,
recieverid:this.props.rid,
senderName:this.props.sName,
message:this.state.message.replace(this.state.message.charAt(this.state.message.length-1),'')
}
if(data.message.length>0)
{
this.socket.emit('messagesent',data)
let {onNewMessageArrival}=this.props
onNewMessageArrival(data)

}
this.setState({
message:''
})
}else if((e.keyCode==13||e.which==13) &&e.ctrlKey)
{
this.setState({
return(
<div>
<textarea rows="3" className="msg-write-div"
disabled={this.props.isDisabled}
onChange={this.handleChange.bind(this)}
onKeyPress={e=>this.sendMessage(e)}
value={this.state.message} />
</div>
);
 
read your code line by line
 
Help vampire
 
your error is literally screaming
 
12:52 PM
id know because im also sortof one
but im getting better
 
oh my
 
@ShrekOverflow i did still i'm not getting the desired results
 
not all help vamps are vamps
some are just dumb
 
True
 
@Neil yeah i ain't doin it
 
12:52 PM
Im a smart cookie, I just give up sometimes when I find something I physically cant understand
other people just copy pasta like its spaghetti night
^O^
 
If you want understanding feel free to ask us
your picture looks < 18, so I assuming you are new
 
someone needs to star that
>other people just copy pasta like its spaghetti night
I guess nobody got the pun from the awkward silence
 
oh I got it
 
,-,
lol
 
┌─┐
┴─┴
ಠ_ರೃ
 
12:59 PM
@ShrekOverflow please tell me i'm not getting any clue about it ?
 
lol damn ascii faces
Atul Kumar you have to research
 
ERROR dependency reading not found
 
i'm confused a bit.
 
@EchoDino 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.
 
@TaylorS i have tried and tested everytinh then i'm asking it here
 
00:00 - 13:0013:00 - 00:00

« first day (3293 days earlier)      last day (1638 days later) »