While True loop - invalid syntax - loops

i get a invalid syntax to something really simple, can you help me. Where is my mistake.
I tried to fix it several times but without success.

Related

UE4 Grenade deal damage

I have a grenade BP which the hero throws and wondering how you would set this up ..
I have tried and works fine but this way is caused by a sphere collision and checks what is inside the collision during detonation.
I tried without casting but this didn't work out very well for me, Is there something else I should be doing?
Please ignore the "get overlapping actors" class filter, I only done that as a test, i usually leave it blank.
ideally id like to try some sort on line trace when the bomb detonates so it can check if its a direct hit rather than triggering even when safe behind cover.
Any help is greatly appreciated, thank you!
Is there casting necessary? say I had 10 other different AI characters, id have to cast through them all right
I tried without casting but this didn't work out very well for me, Is there something else I should be doing?
Please ignore the "get overlapping actors"class filter, I only done that as a test, i usually leave it blank
I found out using a MultiSphereTraceByChannel works much better.

Convering a whole number to this format 120m59s

Ive looked online and searched and asked but no one can answer my question I need to format a whole number Eg: 12059 to look like this 120m59s. Ive tried with moment.js to do it and Im getting an error.
TypeError: moment__WEBPACK_IMPORTED_MODULE_1___default.a.duration(...).format is not a function
if I do it like so data.total ? moment.duration(data.total, 'seconds').format('m [min] s [sec]') : '0'
Could someone please help ?
figured it out - moment.utc(moment.duration(data.total, 'seconds').asMilliseconds()).format('h[h]m[m]s[s]')
Took me a few struggles and costed a handful of hairs but I hear balding is the new thing.

Comparing role positions

Can someone help me?
ERROR: Cannot read property ‘comparePositionTo’ of undefined
Code:
if(message.member.roles.highest.comparePositionTo(message.mentions.members.first().roles.highest) < 1)
Your actual line of code in hastebin has comparePositionsTo instead of comparePositionTo, which is undefined.
The error you gave means that the user that sent the message has no roles.
Also, I highly recommend you do check if the mention is defined or not in your code.
And a 3rd thing - in v12, it's Discord.MessageEmbed(), not Discord.RichEmbed().
Hope this helps!
(sidenote - in the future you should probably copypaste the line of code in question into SO instead of rewriting).

Edit/Insert mode error: Directly after tblbookings.edit

I'm working on my end year project for high school and this problem came up. This code is supposed to filter the database and only work on the data whose ID is bigger than intGroep2 (which is at this point 22). Then it must change the first row's 'pop' column to the value of cb501pop1.checked.
tblbookings.Open;
tblbookings.Edit;
tblbookings['pop'].edit;
tblbookings.filter := 'ID >= '+ inttostr(intGroep2);
tblbookings.filtered := true;
tblbookings.First;
tblbookings['pop'] := cb501pop1.Checked;
The problem arises with the following line:
tblbookings['pop'].edit;
If it is not there, the program gives me an error: 'dataset not in edit or insert mode.' And if it is there it gives me an 'invalid variant operation' error. One other question said to change "edit" to append, but it still gave the same error. Another question suggested that somebody posted already, which I didn't. Nowhere in my code is 'post'. This is supposed to be an easy answer and thus should only be practicing the basics. 'Afterscroll' and other stuff mentioned in other questions isn't supposed to be in the solution since we didn't learn it yet.
Thank you.
EDIT: tblbookings.fieldbyname('pop').edit; gives an error: missing operator.

An integer increments strangely in c

Ok, here is the piece of code where I found it strange:
printf("di consumerthread : mulai isi data, itmsg = %d\n",itmsg);
msgq->data[itmsg]=rec_data;
printf("di consumerthread : selesai isi data, itmsg = %d\n",itmsg);
What I found strange is the output:
di consumerthread : mulai isi data, itmsg = 42
di consumerthread : selesai isi data, itmsg = 98
How come the itmsg variable suddenly changes from 42 to 98 after this line?
msgq->data[itmsg]=rec_data;
Can anybody please tell me how to solve this problem and the cause of this strange output?
Perhaps msgq->data[itmsg] is an alias for itmsg. It could happen. If you inherited this code run a bounds checker on it.
What is the size of the data array? Are you writing off the bounds of it?
It is possible that itmsg is being overwritten by the assignment of rec_data to msgq->data[itmsg]. If they are declared near to each other, this is very possible.
Without being able to know for sure based only on the information in your question, the problem could be multiple threads accessing the same memory location (msgq->data[itmsg]) at the same time, without any kind of proper synchronization.
Do you have two or more threads that both use the itmsg variable? There's nothing in your code snippet that would change the value of that variable, so it looks like it must be another thread that's changing it.
If you're using threads, you'll need to protect any data that they share with a mutex.
Ok, I finally found what's wrong
Sorry if I dont give you enough info because my head is in a mess to explain it in detail..
So, what I did to solve it is:
changing all type of global variable, including itmsg, to static
and all type of procedure and function which use the global variable to static
and it solved all of my problem!
though I still dont know what's static function..
Thanks for all of your help! :D

Resources