« first day (3462 days earlier)      last day (1469 days later) » 

12:00 AM
....
It be best to do all that in CSS
@csscoder so you are talking about the part that says: you ordered [object Object], [object Object]
 
user11867329
Is it possible to play with css selectors from a click event?
 
user11867329
visibility:hidden

When click > visibility:visible
 
It is
 
user11867329
Ye right
 
12:18 AM
let name;
 
@learner 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.
 
How can you find a value from an array of objects?
 
user11867329
@learner by helping me
 
lmao
 
user11867329
@Unbreachable Are you italian?
 
user11867329
12:25 AM
Johnney
 
user11867329
or Paul maybe
 
No....
 
user11867329
Why are you here?
 
Huh?
in this chat?
@learner you can look at 'Array.prototype.find()'
 
user12960916
@Unbreachable yes, the part that says [object Object], [object Object]
 
12:49 AM
@csscoder you can use a map
	let orders = carblist.map(a => a.name);
	let  order = orders.join(' , ');
Then just substitute the output below with { order }
 
user12960916
i get confused with the arrow function things is there another to do it?
 
yep
	let orders = carblist.map(function(a) {
		return a.name;
	});
 
user12960916
it's just making the checkboxes disappear now when i click on them
 
Thats how you been had them...
 
user11867329
1:07 AM
@csscoder What's happening? Its almost like Unbreach is not helping for some odd-to-figure-out reason?
 
user12960916
what do you mean? @OakDev
 
@OakDev what's your problem dude?
 
user11867329
I'm not your dude, buddy.
 
user12960916
he helped you when i entered the chat earlier
 
user11867329
That's how it starts
 
1:10 AM
If you don't want my help, then fine, I won't ever help you again. I'm really trying here, but if you can't see that then fine.
Just don't be in the way when I am trying to help others.
 
user11867329
Reflect on that
 
user12960916
maybe you could take a break if your not getting it and try again later its not that someone doesnt want to help you
 
user11867329
Fairly insightful.
 
user11867329
But it's super simple and I explained it from 4 different angles
 
user11867329
"Oh yeah I get it"
> goes silent
 
user11867329
1:15 AM
sorry, got my panties all twisted up
 
user11867329
like one ball is twisted sideways
 
user11867329
not. cool.
 
user11867329
@csscoder if you're familiar with wordpress+woo, I have an interesting question with bounty (I can set it higher, if needed)
 
1:29 AM
@csscoder the issue you are having is similar to the last one, and will probably be in future issues, and that is because you have to map through them
What you are doing with '{#each carblist as carb}' is actually going through the whole list instead of the names, which isn't what you want
so just do the same as before
{#each carblist as carb}   TO  {#each orders as carb}
 
1:50 AM
@un
 
user12960916
i switched it back and now it has this weird Nan thing
 
@unbreachable wht were you laughin 8 b4?
huh?
 
@csscoder you have to take way more steps than that
 
@unbreachable you said 'lmao' b4? what was dat for?
 
1:53 AM
@learner I thought I was done with this....
 
@unbreachable don't play with me boy
@unbreachable send me yo ig, facebook, sc
 
@csscoder I would like for you to take some time and try to do it by yourself, after some attempts and you still can't figure it out, then i will gladly help you bro
@learner please stop that.
 
@unbreachable how to use .map?
 
@unbreachable do you how to use it react native and return Text?
 
2:02 AM
I don't know react native but if you read the docs then I am pretty sure you will be able to figure it out, it's purpose will not change.
@csscoder to give you some intimation, {orders * carblist.price}, remember 'orders' is an array of the names, it can't possibly act as if it were an int...
 
@unbreachable where do you live
 
In California
 
I need to make a multi-player game via Firestore
Can anyone suggest which feature should I use to keep synchronization among all players?
I do understand about .onSnapshot(doc) for listening to realtime changes
But the problem will be, everyone will be listening to changes
And once the callback is fired, it will do something (probably changing the doc and committing the change)
This will make other players to do something again
Is there a feature like a host and others are recipients in Firestore?
Host broadcasts the change and others adopt the change
Or if there is a better approach, please suggest.
 
2:19 AM
@unbreachable how to turn array of object into strings?
 
@learner JSON.stringify(arrayOfObjects);
 
@ZahidSaeed I don't know much about firebase, as I am just learning that, but have you checked out 'Transactions'?
I guess it's kind of similar to '.onSnapshot()'
 
The transaction is like when you need to perform multiple changes to Firebase objects
And you must be assured that all of them are successfully performed
 
right, and it will always be updating according to when the client changes something
 
In my case, I have a document
Every single player would be listening to that document
 
2:25 AM
oh okay
 
1st player makes a change to the document
Others would react to that change and do another change to that document
This will make others to do something again
and it can occur to a forever loop
I need some sort of pointer
To know its 1st player's turn
Now its 2nd player's turn
Now 3rd and so on
 
 
4 hours later…
6:36 AM
@ZahidSaeed if it's turn-based, should be no issue
the server is the ultimate authority and says when it's a player's turn
and if not, the server still has to tell the player if and when they can act
 
7:15 AM
hi guys i have a questiona on angular
 
I see Neil
DID I SEE NEIL?
BOO BOO
welcome back?
You've been undone from the quarantine spell?
@Doflamingo19 the principle of the room is to just ask your question. You have been here from time to time. You should know that. 🙂
 
7:40 AM
@KarelG well still in lockdown
can't really call it quarantine, since I never caught the virus
 
well yeah lockdown
we have a semi-lockdown here
 
they have a semi-lockdown in switzerland now, and it seems that was a bad idea
 
but be aware that it's possible to have the virus without having actual symptomps
 
people tend to be idiots in general
 
I haven't come into contact with a person outside my home in three weeks
I don't think I have the virus
 
7:41 AM
it goes fine so far here in Belgium. The stats are flattened. Started 3 days ago. So the gov is optimistic
 
oh to be in an intelligent country right now
 
@KarelG I honestly hope they're preparing for the worst though
 
@Neil here, it's a pv + fine (250 EUR) to pay immediately. And the pv gets sent to the court on a later time.
 
very good!!
 
I would probably recover before I get symptomps
 
7:43 AM
@Neil we are prepared. We've been three weeks in this situation
 
get fined for what? semi-lockdown just seems to me like you're just encouraged to remain in your home
 
hi folks
 
@OmarHegazi 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.
 
evening
 
@Neil being outside, but not in motion, grouping, parties, doing unessential movement ect (with respect to the "social distance")
 
7:44 AM
it's 10 am morning here in egypt
 
eg walking around is fine. But don't sit on a bench
 
well good morning then :~)
 
have a good day
 
@KarelG here, they'd fine you for being in a park period
there are police stopping people in cars keeping record of where you started, where you're going and why you're moving
 
in AZ there's a "stay at home order" but absolutely nothing enforcing it
 
7:46 AM
if you don't have a rational reason or you're lying about your destination/starting point, they fine you
 
people don't care, a lot of people here refuse to change their habits at all
 
rational reasons are: returning home, going for essential necessities. full stop
 
HAMMERTIME!
 
good james
 
@forresthopkinsa it's people like that who are dangerous
 
7:47 AM
it's a big chunk of americans
 
maybe you don't have it, but you risk to get infected by acting like that, and then you're no longer risking yourself, you risk others as you may contaminate them
 
especially in redder states like AZ
right
 
my mom told me the other day (lives in SC) that she still goes walking with her buddy
and I'm like ffs, mom.. stay home.. it's not that important that you exercise
 
it's like every other person is doing something like that
and half of them are doing it because they're convinced there is no virus and it's radiation poisoning from 5g towers
 
i hope you're wrong about that
that scares the hell out of me
that kind of reasoning is going to get everyone killed
 
7:50 AM
you would be horrified to see how many people completely believe that kind of thing
it's way worse than you would expect
I've been beyond disappointed in my Facebook friends list lately, people I thought were reasonable
sharing awful conspiracy theories that pose a real danger to national health
and outside of my circles, you go online and that kind of thing is spreading like a brush fire, waayy worse than it normally is
 
@Neil ^ current stats.
you can see it's going to flatten. We still have plenty of i-care units (800 left AFAIK)
 
recovery rate looking almost as bad as the U.S.
ofc that's from lack of testing but still
 
@KarelG the real threat is having too many get the virus that you can't take care of them all
 
yet that does not mean that the measurements are lifted up immediately. The situation will stay for at least until end of this month
 
death rate leaps from like 1% to 10% that way
 
7:53 AM
"flatten the curve"
 
so it's a good sign that Belgium still has plenty of beds
 
@Neil our gov just had luck (well they kinda underestimated it from the start) but the signs from Italy were very clear. So we could act in time
your country just had a bad luck to be the "first hit"
 
well we ourselves should have been prepared the moment it hit china
 
wya Neil
 
it was stupid to assume it was going to stay in china
 
7:55 AM
same story here. There's still critic that our gov acted a bit late.
many of the new COVID-19 positives came mainly from ski-holidays in Italy
 
Boris Johnson definitely deserves to have gotten the virus
 
eh same for Trump
 
he refused testing and held countless meetings with high-ranking government officials
 
his counterpart does too
lol right karel
 
he probably contaminated everyone
 
7:56 AM
ahhha sorry
 
he's now even supporting a medicine that appears to not work. But he did it anyways because he has stakes in it
tsss
that's a whole new level of "idgaf, I'm POTUS"
 
a guy died not far from me because of that
 
from testing medicine against covid-19?
 
hydroxychloroquine yeah
took God Emperor Trump's word for it
killed himself
 
the number of people who would jump off a cliff if someone told them to do it is astounding to me
I heard they did make a breakthrough with a drug that prevents covid-19 from entering cells
 
8:01 AM
I'm glad to hear that
 
8:19 AM
if there are collateral effects, I don't know
 
 
1 hour later…
9:33 AM
Hello
I want to remove the item that is returned from this

random = jobs[Math.floor(Math.random() * jobs.length)]

How can i do that?
 
Hi All
 
@learner remove form the array?
 
im trying to construct an endpoint in nodejs like below for example

localhost:3000/accounts/{accountId}/password/reset?token={token}
the above is my nodejs routing code
when i try to hit it using postman like below, Im getting not found error

localhost:300/accounts/199/password/reset?token=sdfdsfsdfs
 
@learner jobs.splice(Math.floor(Math.random() * jobs.length), 1);
or rather save the index, retrieve that item, then call splice on the array at that spot
 
10:01 AM
Can someone help me return a value from one promise in a chain?
 
@Djave Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
Hi, I'm just trying to find the occurrence of a word in a 2D array using methods. I know I've to use a nested loop but confused what I put for the length for both the for loops.
 
@Newuser 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.
 
@Djave once you enter the promise land, you never leave it
 
@KarelG :)
 
10:06 AM
you can return something from it, but it's always a promise object unless you're in async function
there, you can use await myPromisefunction to have the un-promisified value
 
Would you mind taking a super quick look at this if you fancy some quarantine fun?

https://gist.github.com/djave-co/15ac3cb1d38359dc21e9f622dff0ea07
 
I have to work remotely :P
a semi-lockdown here
 
I have an async function... whether or not that was a good idea I do not know! Because I've had to check if a value exists before I can return. Once this promise completes, that is when I can run my next promise, but its ruined my flow :S
 
uhm are you not worried being stuck in a call loop?
 
I just thought It was the best option to use, what would you suggest?
 
10:11 AM
@KarelG Ah if you're talking to me I had a typo, getGameId() should call itself again if it doesn't find a unique id
 
@Newuser oh forgive me. was talking to djave. Please add your code so that I can see the problem clearly
 
There may be 10 simultaneous games so each time the function is run a 1/100000 chance of it calling itself
 
still a risk :P
just make your createGame async
then adjust it a bit
once done, return the game instance (either new or existing)
that's all
 
Ahh, so put async infront of the function, then id = await getGameId(), then next line return db....?
 
yep
 
10:16 AM
Thank you!
 
I haven't done a huge amount, I'm just confused with the for loops for counting the occurrence of a word in the 2D array
 
@Newuser Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
import java.util.Scanner;
public class LinearSearch2
{
public static void main(String args [])
{
String words[][]{{"cat", "dog","dUck"},{"rabbit", "hen","dUck"},{"dUck","Duck","goose"}};
Scanner sc1 = new Scanner(System.in);
System.out.println("Please enter a word");
String search = sc1.nextLine();
sc1.close();
countStrings(words[][], search);
}
public static void  int countStrings(String words[][], String search)
{
for(int i = 0; i<
 
@Newuser fyi, that's java. Not JavaScript, the language being used here. There is a java room for that :)
but you can go through a two dimensional array by
 
Apologies
 
10:25 AM
for (int i = 0; i < words.length; ++i){
  for (int j = 0; j < words[0].length; ++j) {
     //element is then words[i][j]
  }
}
@Newuser ^ and then visit chat.stackoverflow.com/rooms/139/java for future Java related questions
🙂
just noticed that it's kinda empty
 
Ok thanks
 
@KarelG that's like what, 6 letters difference, man.. hardly anything
 
I cannot count to 6 neil
after which number does it come?
four?
no. that's five
🤔
 
it's three ya idiot
 
not true!
I do not know when six comes! Look: one two three four five sex seven eight nine ten eleven twelve ...
must be a magical number!
 
10:29 AM
ah sex.. the best number ever
 
 
1 hour later…
11:37 AM
How to remove an array with value. I have an array and I have a value that I want from thee array to be remove. Can someone please help!
 
|| mdn Array.prototype.filter
 
@learner you need that
go to the page, read it and get inspired by the examples
 
12:23 PM
@KareIg thanks for helping but it didn't work. I am just getting started I might have written something wrong. Here is my code codeshare.io/50O1zv Please have a look!
 
3 hours ago, by Neil
@learner jobs.splice(Math.floor(Math.random() * jobs.length), 1);
feel free to use the solution that I posted for you 3 hours ago
 
@Neil Yeah I saw your answer! Appreciate it man but idk for some reason it doesn't work can you please edit it here for me codeshare.io/50O1zv
 
||> [1,2,3,4,5,4,1,5,8,].filter(n => n !== 4)
 
@KarelG [4,4] Logged: ``
@KarelG [1,2,3,5,1,5,8] Logged: ``
 
the doc is sufficient for that
 
12:28 PM
||> var a=[1,2,3]; a.splice(1, 1); console.log(a);
 
@Neil "TypeError: console.dir is not a function" Logged: ``
@Neil undefined Logged: [1,3]
 
@learner see my example. starting at index 1, remove 1
 
Hi guys..i want to display as separate selected value in multiselect jquery chosen pls check the following fiddle
 
@Neil please have a look at my code
 
you should be able to use the example I gave you to make it work
nothing personal, but I'm not writing code for you
 
12:44 PM
Hi... If someone can help me solve this error in the README.md of this GitHub repository (see the Update 2 section)... github.com/silviubogan/testing-modules-with-tsify Thank you.
 
@silviubogan 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.
 
@silviubogan did you really create a repo for that? ._.
and ... the error is self-explanatory
you are missing some modules
in node.js is it just a matter of installing the dependencies
lookup in Node.js docs how to add and install dependencies
 
@learner Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
:49059334 No, I didn't say that
Math.random() returns a different value each time it's called
 
@KarelG Thank you.
 
12:49 PM
@Neil so you are saying this code should remove the item that has been randomly selected
const Names = [
    { name: 'Name1', id: 1 },
    { name: 'Name2', id: 2},
]
 btnClick = () => {
  let namePicker = Names[Math.floor(Math.random() * Names.length)]
  Names.splice(Math.floor(Math.random() * Names.length), 1);
 }
 
i want to display as separate selected value in multiselect jquery chosen pls check the following fiddle
please help me how to do this?
 
@learner the first randomly picks a name, and the second randomly removes a name
there's no link between the two, and both are entirely random
you want the name that is picked to be the one that is removed, don't you?
 
Yes please
 
ok, so you tell me.. what is the common link between these two lines which determines which name it's getting?
 
What do you mean? what 2 lines
 
12:54 PM
4 mins ago, by Neil
@learner the first randomly picks a name, and the second randomly removes a name
3 mins ago, by Neil
there's no link between the two, and both are entirely random
I'm starting to lose my patience with you
try to understand what is happening in the code
you're not going to get me to write it for you out of impatience. I'll just stop giving clues
 
@KarelG The error talks about this module: @popperjs/core and I have it installed. The error also suggests that watchify is able to access the dist/esm/index.js file in that package. Also, package.json contains @popperjs/core: "^2.2.1. Please help me. Almost entirely this day was blocked by this issue for me. Thank you.
 
But isn't there a method to remove the Name that has been selected
Like I don't want namepicker to give a name twice in row
@Neil I asked for the answer because I knew I wouldn't get the right answer and it hard for you to explain to somone like me
Don't give me the answer. No hard feelings!
 
ok, but it's also not doing you any favors to give you the right answer
 
I think you can reasonably say "you need to randomly pick an offset, then retrieve the value at the offset and remove the element at the offset"
also here's a thing that happened:
in PHP, 5 mins ago, by Jimbo
Ah, the JavaScript room. You will never find a more wretched hive of scum and villainy.
 
^ true story
 
1:02 PM
@DaveRandom hi DaveRandom
 
@Neil don't worry! Thanks for trying
 
@KarelG ok boomer keith flint
 
You don't know the definition of insanity!
 
doing the same thing something something different outcome, I dunno wasn't really listening, was too busy pouring a drink
 
Hmm anyone knows of another well known movie/book about totalitarianism like 1984 or v for vendetta?
 
1:08 PM
Terry Gilliam's Brazil is absolutely amazing, although a somewhat different vibe
arguably very heavily influenced by 1984, kind of like watching it half-cut when you did a bunch of acid the night before
 
@paul23 Minority Report, Equilibrium, Gattaca, Logan's Run, Brazil, Snowpiercer are all similar in a way
 
oh logan's run is a great shout
 
Also Cloud Atlas but it's really weird
 
Hmm I'm more looking into a film set in a historical perspective time period, akin to the franco regime or ataturk cultural cleansing.
 
Who lives in india
 
1:13 PM
most of the Indians?
 
😂
I meant who lives in India from here
Any of yous?
 
Indians live in america though?
 
@TylerH found the movie not so good tbh
sure I got it but ... +/-
 
@KarelG Yeah, it was definitely one I wouldn't watch again
which is a bummer because it has a great cast and the trailer made it look amazing
 
@paul23 there aren't many in that specific genre
TylerH is kinda on the spot
 
1:17 PM
hi guys
 
Y'all needa watch Money heist
 
Hmm I'm mainly looking for quotes from dystopian stories/historical figures I can put in a quiz... Like "2+2=5".
 
however, there are other "vengeance" based movies (since it's also one of the main plots from V Vendetta)
 
@paul23 your best bet for stuff like that is probably just to google and see who has made blog posts or lists about similar criteria
 
suppose to have a loginService that does the authentication
 
1:18 PM
oldboi is a very good vengeance movie with a ... nice ... plot twist
😁
 
aftercorrect authentication I set this.username=username and this.password=password
 
Well I like the psychologic effects of bending of truth and how it is described there a lot...
 
after the authentication I move in another page and I press f5
the variable this.username became undefined
 
@paul23 I would start here and knock yourself out en.wikipedia.org/wiki/List_of_dystopian_films
 
but service is like singleton
how is it possible?
 
1:24 PM
@TylerH that's ... an odd list
that AI movie from Spielberg is not dystopian imo
 
Dark City has a lot of similar themes
questioning reality and all that
there's that episode of star trek the next generation where they try to force picard to acknowledge something that he can clearly see is not true with the interests of breaking him
 
@KarelG which one is that?
oh, Artificial Intelligenec
I haven't seen that (or most of the ones on that list, I'm sure) so I can't really say.
glancing at the plot summary on the wikipedia article, though, it seems to fit the bill for dystopian
keep in mind dystopia doesn't require an authoritarian or repressive government
just that it's a dysfunctional society in some way compared to today or to our idea of a utopia
 
🚽
 
40% of the world's population being wiped out due to global warming and coastal flooding, and sentient but non-emotive robots walking around seems fairly dystopian
 
1:51 PM
can anyone help me with this stackoverflow.com/questions/61101941/…
 
Any flutter dev here?
 

« first day (3462 days earlier)      last day (1469 days later) »