unity – Having multiple different friction values on a single piece of track?

I am trying to figure out a good/performant way to give a piece of track multiple values of dynamic friction. A track piece is 10×10 units in Unity and the idea is to puzzle them together to a big track like the tracks in Trackmania. The game itself features no acceleration, except from gravity. To make things more interesting I want to give each track piece at the start of the scene multiple random friction values within a given range.

Currently I achieve this by making each piece of track consisting of 100 little tiles which are 1×1 units and they get a random friction values assigned. This approach works somewhat fine as long as there are less than 30 to 40 track pieces(3000-4000 tiles) but with more than that the fps are dropping really low. As it is a racing type of game I had to set the “Fixed Timestep” in the project settings to 0.001 to get accurate time measurments and this is hurting the performance as well. With a lower timestep the collision detection with all the little tiles is really bad too.

Is there a more elegant and/or performant way to achieve this in within the unity physics system?

c++ – Assiging values on multiple clients in UE4

I am currently working on a multiplayer game and I am having difficulties on assigning values on variables for each clients. Originally I looped through available clients character from HUD then assigned the calculated the value but I decided to do it inside character blueprint’s instead.

I don’t know why only first clients gets the calculated values but the other client still having the default value.

This is the initial value that I assigned from inside Character C++

MaxHealth = 500;
Health = MaxHealth;

This is how I assigned the value from the Blueprint.

Set Initial Attributes is where I calculated the Health value based on player’s Strength value etc and the reason I’m doing this is because I am planning to retrieve the stats from the datatable in the future. But I don’t know why it becomes like this instead.

This is the correct final value that supposedly assigned on both clients.
First Client

But only first client gets the correct value, not second client.
Second Client

I don’t want to use loop to search the player characters’ inside player character’s blueprint and assigned the value because I don’t think it’s a wise move so I am looking for a better alternative if any. Thanks!

query – MySQL Dynamic Result view with column when values are on same column

I want to create a dynamic value based on election result. I’ve three table.

  1. vote table
  2. Candidate table
  3. Candidate position table.

Here the candidate table and position table is dynamic. its means I haven’t any control on it.

I want to make a view like this:
enter image description here

Here Ballton num come from vote table, president, general secretary and treasurer is come from candidate position table and against each ballot no all column will be populate.

Here are the rest of the table structure:

Vote:
enter image description here

Candidate:
enter image description here

Candidate position:
enter image description here

Filter on Multiple values for same column using Rest api

Is it possible to filter using rest api in sharepoint to Filter on Multiple values for same column ?

plugins – How to capture hidden values with Gravity Forms

I will be using the following code from ActiveProspects and what it do is basically pass some hidden values (in this case basically a dynamic url) to the server along with the form fields which we need to capture and store in our DB. Now I am using Gravity Forms with my WordPress site but I am unable to capture that data.

 <script type="text/javascript">
  (function() {
      var field = 'xxTrustedFormCertUrl';
      var provideReferrer = false;
      var invertFieldSensitivity = false;
      var tf = document.createElement('script');
      tf.type = 'text/javascript'; tf.async = true;
      tf.src = "https://wordpress.stackexchange.com/http" + ('https:' == document.location.protocol ? 's' : '') +
        '://api.trustedform.com/trustedform.js?provide_referrer=' + escape(provideReferrer) + '&field=' + escape(field) + '&l='+new Date().getTime()+Math.random() + '&invert_field_sensitivity=' + invertFieldSensitivity;
      var s = document.getElementsByTagName('script')(0); s.parentNode.insertBefore(tf, s); }
  )();
</script>
<noscript>
    <img src="https://api.trustedform.com/ns.gif" />
</noscript>

The following image shows the hidden data and fields enter image description here

Now here’s a gravity forms help page https://docs.gravityforms.com/using-dynamic-population/ which says how to pass dynamic data but I am not into php much so any help will be well appreciated. As per this help I have added the following code in my theme functions.php but I think its hard coded. So can anybody let me know how to capture this hidden field value and store it.

add_filter( 'gform_field_value_xxTrustedFormCertUrl', 'my_custom_population_function' );
function my_custom_population_function( $value ) {
    return 'Boom';
}

linear algebra – Find values that k may take if $k=detleft(A^3+B^3+C^3right).detleft(A+B+Cright)$

Let $A,B,C$ be $ntimes n$ matrices with real entries such that their product is pairwise commutative. Also $ABC=O_{n}$. If
$$k=detleft(A^3+B^3+C^3right).detleft(A+B+Cright)$$
then find the value or the range of values that $k$ may take.

My Attempt

I tried $k=left(det(A+B+C)right)^2left(det(A^2+B^2+C^2-AB-BC-CA)right)$. but couldn’t go further than this

mysql – How do I sort a table with non alphabetical values?

I’m a non-programmer and want to use the power of SQL to sort my inventory data. Here’s the sample table that I have.

Product | Option_1_Value
Apple | 1 gallon
Apple | Apple
Apple | 30ml
Apple | 4 gallons
Apple | 10ml
Apple | 100ml
Apple | 500ml
Apple | 1 liter
Banana| 4 gallons
Banana| 1 gallon
Banana| Banana
Banana| 10ml
Banana| 100ml
Banana| 500ml
Banana| 1 liter

I want to turn this data to this. How can I query my table to have a result like this below

Product | Option_1_Value
Apple | Apple
Apple | 10ml
Apple | 30ml
Apple | 100ml
Apple | 500ml
Apple | 1 liter
Apple | 1 gallon
Apple | 4 gallons
Banana| Banana
Banana| 10ml
Banana| 100ml
Banana| 500ml
Banana| 1 liter
Banana| 1 gallon
Banana| 4 gallons

python – Are set values faster than using variables

Using variables more convenient when values like MARGIN need to be changed

pygame.draw.line(screen, WHITE, (x - MARGIN, y - MARGIN), (x + TILESIZE, y - MARGIN), MARGIN)
pygame.draw.line(screen, WHITE, (x - MARGIN, y + TILESIZE), (x + TILESIZE, y + TILESIZE), MARGIN)
pygame.draw.line(screen, WHITE, (x - MARGIN, y - MARGIN), (x - MARGIN, y + TILESIZE), MARGIN)
pygame.draw.line(screen, WHITE, (x + TILESIZE, y - MARGIN), (x + TILESIZE, y + TILESIZE), MARGIN)

But if they were already set, would it be faster to do:

pygame.draw.line(screen, WHITE, (x - 1, y - 1), (x + 20, y - 1), 1)#Top
pygame.draw.line(screen, WHITE, (x - 1, y + 20), (x + 20, y + 20), 1)#Bottom
pygame.draw.line(screen, WHITE, (x - 1, y - 1), (x - 1, y + 20), 1)#Left
pygame.draw.line(screen, WHITE, (x + 20, y - 1), (x + 20, y + 20), 1)#Right

Why not in does not return values with null values in my select query on postgresql 11?

I have the following sql script:

CREATE temporary table if not EXISTS the_values (
 key SERIAL,
 value INTEGER NULL 
);

insert into the_values(value) values (null),(1),(null),(2),(3),(4),(5),(6),(10),(null),(null);

select * from the_values where value not in (1,2,3,4,5,6,10); 

And I noticed that the query:

select * from the_values where value not in (1,2,3,4,5,6,10); 

Does not return the rows having value NULL, and that, caught my attention. Therefore, I want to know why that happens. I am interested more about the technical aspect of this phenomenon rather that the obvious solution:

select * from the_values where value not in (1,2,3,4,5,6,10) or value IS NULL; 

Help with function accepting real values

Thanks for contributing an answer to Mathematica Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.