Unity 2D animated tiles library: IsSelected variable not working or not present within RuleTileEditor.cs

I have just tried downloading a library which will allow me to add animated tiles to unity. I have been following this tutorial:http://shadowpeakstudios.com/2018/10/22/unity-tutorial-animated-tiles/

It told me to download this library in order to work the animated tiles: https://github.com/Unity-Technologies/2d-extras

After this the tutorial told me to unzip the library and place it into my assets folder. It loaded into my assets folder and then got the following error:

Assetsd-extras-masterd-extras-master\Editor\Tiles\RuleTile\RuleTileEditor.cs(277,26): error  CS1061: 'ReorderableList' does not contain a definition for 'IsSelected' and no accessible extension  method 'IsSelected' accepting a first argument of type 'ReorderableList' could be found (are you  missing a using directive or an assembly reference?) 

Does anyone perhaps know why this error is occuring.

Read actor instance’s text variable for widget when triggered on different objects

What I’m trying to do: (a ‘long story version’ is linked in comment below)

(and another user example is hyperlinked in comment below – i couldn’t post over 8 images and/or links in this first comment*) (there are other similar user questions elsewhere I know)

Short story: I’m trying to make a widget that is triggered by an actor blueprint, and I want the widget to display different text that reflects the public-variable-text edits I make in the editor.

My latest progress includes actors that are titled somewhat according to the hyperlinked user case above so, I have a "door_trigger" and a "doorWidget". I have altered the pin connections so much that I am just going to copy and paste all my screen shots below.

I got to change text asset DoorName by making a public variable called "name," as you’ll see. I can make the trigger show this text on screen and have it disappear when the user leaves the trigger actor, BUT EVERY INSTANCE ALSO SHOWS THIS TEXT VALUE, EVEN THOUGH I CHANGE IT

In the screenshots (some in comment following too) you’ll see the text "3" appear on screen, and it does this for all three of the dummy boxes I made; notice how the second box is supposed to show "dd" (I was just typing random filler content).


alt text alt text alt text alt text alt text

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

enter image description here enter image description here

What is the appropriate SQL statement/s to produce a stacked bar chart for multiple random variable distributions?

The Objective

Graph the difference between the probability distributions of sets of random variables that come from a number of different sources using a stacked bar chart (or another type of graph suited for such visualization).

The Problem

I’m not sure of the right combination of SQL SELECT statement(s)/condition(s) to present the data to the graphing tool in the right way to achieve the objective above.

The Method


Feed the source data stored in Google Cloud Platform (GCP)’s BigQuery into Google Data Studio and use a stacked bar graph to visualize the numerous probability distributions.

The Source Data

I’m dealing with simple binary outcomes, either a heads or tails. One trial (== one second) per source yields between 0 to 200 how many heads (1s) were counted.

The schema of the data we have stored in BigQuery is as follows:

time      | source1 | source 2 | ... sourceN --------------------------------------------- 09:00:00  | 99      | 110      | 95         | 09:00:01  | 101     | 115      | 107        | 09:00:02  | 99      | 91       | 97         | 

For a Single Source

The following works fine if I’m trying to graph the results from just a single source. And as the law of probability would say, the graphed distribution is moreorless in fit with the expected bell curve.

SELECT   source1 AS src1,   COUNT(source1) AS count FROM   `rnddata` WHERE   recorded_at >= "2021-03-11 08:45:00" AND   recorded_at < "2021-03-11 09:45:00" GROUP BY src1 ORDER BY src1 
src1 | count 75   | 1 77   | 2 80   | 2 81   | 5 82   | 6 83   | 20 84   | 10 85   | 14 86   | 31 87   | 33 88   | 48 89   | 74 90   | 74 91   | 89 92   | 107 93   | 133 94   | 135 95   | 168 96   | 160 97   | 192 98   | 190 99   | 195 100  | 189 101  | 197 102  | 191 103  | 188 104  | 180 105  | 201 106  | 130 107  | 128 108  | 107 109  | 96 110  | 64 111  | 65 112  | 45 113  | 40 114  | 19 115  | 22 116  | 18 117  | 9 118  | 8 119  | 6 120  | 3 121  | 4 125  | 1 

For Multiple Sources

I’m thinking that if I can have multiple dimensions (src1, src2… srcN) with a single count column for the metric, then I will be able to graph the dimensions as stacked bars on the X axis and have the count metric set to the X axis.

I imagine the output could be something like this:

src1 | src2 | count 75   | null | 1 77   | 77   | 2 80   | 00   | 2 null | 80   | 5 82   | 82   | 6 83   | null | 20 83   | 11   | null 84   | 84   | 10 

I did a bit of research and experimenting with UNIONS and JOINS and INTERSECTS but couldn’t quiet get the above output. Any advice on how to form such an SQL statement to do that, or offer a better presentation (schema) of the data for the graphing purposes, would be greatly appreciated.

Capturing variable after slash in domain

I’m developing an ecommerce website with WordPress / Shopify API. I’d like to be able to capture discount codes through the URL.

So if the discount code was code40, I’d like the enduser to be able to go to website.com/code40 and have that discount code automatically feed into the checkout. I’ve tried a few different methods, but I’m struggling to get a working solution. I have a good idea on how I’m going to feed the variable into checkout, but I’m struggling with capturing the data after the URL. Is this something I should do through HTACCESS/PHP or maybe JavaScript and a cookie? Any suggestions?

How to fix warning in php : Warning: Undefined variable $nameError in C:\xampp\htdocs\mysql\insert.php on line 84

As a beginner in PHP, I was trying to learn how PHP runs along with MySQL. So I was practicing how to insert data into a database using a form. So far this is what I did.

<?php error_reporting(E_ALL ^ E_WARNING);   define( "TITLE", "GET &amp; POST" );  if( isset( $  _POST["post_submit"] ) ) {          // build a function that validates data     function validateFormData( $  formData ) {         $  formData = trim( stripslashes( htmlspecialchars( $  formData ) ) );         return $  formData;     }          // check to see if inputs are empty     // create variables with form data     // wrap the data with our function          if( !$  _POST["post_name"] ) {         $  nameError = "Please enter your name <br>";     } else {         $  name = validateFormData( $  _POST["post_name"] );     }          if( !$  _POST["post_email"] ) {         $  emailError = "Please enter your email <br>";     } else {         $  email = validateFormData( $  _POST["post_email"] );     }      } 


<head>          <meta charset="utf-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1">      <title><?php echo TITLE; ?></title>      <!-- Bootstrap CSS -->     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">      <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->     <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->     <!--[if lt IE 9]>         <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>         <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>     <![endif]--> </head>  <body>     <div class="container">         <h1><?php echo TITLE; ?></h1>                  <h4>Submitted via $  _GET</h4>         <form action="form_get.php" method="get">             <input type="text" placeholder="Name" name="name">             <input type="text" placeholder="Email" name="email">             <input type="submit" name="form_submit">         </form>                  <hr>                  <h4>Submitted via $  _POST</h4>         <form action="form_post.php" method="post">             <input type="text" placeholder="Name" name="post_name">             <input type="text" placeholder="Email" name="post_email">             <input type="submit" name="post_submit">         </form>          <hr>          <h4>Submitted to current page</h4>                  <p class="text-danger">* Required fields</p>                  <form action="<?php echo htmlspecialchars($  _SERVER['PHP_SELF']); ?>" method="post">                          <small class="text-danger">* <?php echo $  nameError; ?></small>             <input type="text" placeholder="Name" name="post_name"><br><br>                          <small class="text-danger">* <?php echo $  emailError; ?></small>             <input type="text" placeholder="Email" name="post_email"><br><br>             <input type="submit" name="post_submit">         </form>                  <?php                          if( isset($  _POST["post_submit"]) ) {                 echo "<h4>Your info</h4>";                 echo "$  name <br> $  email <br>";             }          ?>                                </div>          <!-- jQuery -->     <script src="//code.jquery.com/jquery-2.1.4.min.js"></script>          <!-- Bootstrap JS -->     <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> 

When I wasn’t using error_reporting(E_ALL ^ E_WARNING) it kept showing this warning message [ Warning: Undefined variable $ nameError in C:\xampp\htdocs\mysql\insert.php on line 84 ].

Can anyone help me why it’s showing that there is an undefined variable? Cause I think I defined this variable at the top portion of PHP code.

And is it a good practice to use the error_reporting() function to suppress the warning message from showing?

put the result of a query into a variable and WITH statement

I need to put the result of a query into a variable.

Just a query, works as successful

DECLARE @count INT = (  SELECT count (*) FROM [AdventureWorks].[Person].[Address]     );  select @count; 

But if I need to use the WITH statement in a query, then I get a syntax error

DECLARE @count INT = (    WITH person_address (id)    as (     SELECT AddressID     FROM [AdventureWorks].[Person].[Address]    )    SELECT count (*)    FROM person_address     );  select @count; 

Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword ‘WITH’.

Msg 319, Level 15, State 1, Line 2 Incorrect syntax near the keyword ‘with’. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.

Msg 102, Level 15, State 1, Line 9 Incorrect syntax near ‘)’.

How do I put the query value into a variable if the WITH clause is used in the SQL statement?

Does the optimized column order for a PostgreSQL table always have variable length types at the end?

There’s a popular and seemingly authoritative blog post called On Rocks and Sand on how to optimize PostgreSQL tables for size to eliminate internal padding by re-ordering their column length. They explain how variable-length types incur some extra padding if they’re not at the end of the table:

This means we can chain variable length columns all day long without introducing padding except at the right boundary. Consequently, we can deduce that variable length columns introduce no bloat so long as they’re at the end of a column listing.

And at the end of the post, to summarize:

Sort the columns by their type length as defined in pg_type.

There’s a library that integrates with Ruby’s ActiveRecord to automatically re-order columns to reduce padding called pg_column_byte_packer. You can see the README in that repo cites the above blog post and in general does the same thing that the blog post describes.

However, the pg_column_byte_packer does not return results consistent with the blog post it cites. The blog post pulls from from PostgreSQL’s internal pg_type.typelen which puts variable-length columns always at the end via an alignment of -1. pg_column_byte_packer gives them an alignment of 3.

pg_column_byte_packer has an explanatory comment:

    # These types generally have an alignment of 4 (as designated by pg_type     # having a typalign value of 'i', but they're special in that small values     # have an optimized storage layout. Beyond the optimized storage layout, though,     # these small values also are not required to respect the alignment the type     # would otherwise have. Specifically, values with a size of at most 127 bytes     # aren't aligned. That 127 byte cap, however, includes an overhead byte to store     # the length, and so in reality the max is 126 bytes. Interestingly TOASTable     # values are also treated that way, but we don't have a good way of knowing which     # values those will be.     #     # See: `fill_val()` in src/backend/access/common/heaptuple.c (in the conditional     # `else if (att->attlen == -1)` branch.     #     # When no limit modifier has been applied we don't have a good heuristic for     # determining which columns are likely to be long or short, so we currently     # just slot them all after the columns we believe will always be long. 

The comment appears to be not wrong as text columns do have a pg_type.typalign of 4 but they’ve also got a pg_type.typlen of -1 which the blog post argues gets the most optimal packing when at the end of the table.

So in the case of a table that has a four byte alignment column, a text column, and a two byte alignment column, pg_column_byte_packer will put the text columns right in between the two. They’ve even got a unit test to assert that this always happens.

My question here is: what order of columns actually packs for minimal space? The comment from pg_column_byte_packer appears to be not wrong as text columns do have a pg_type.typalign of 4, but they’ve also got a pg_type.typlen of -1.

OpenGL GLSL ES 3.10 – Referencing a uniform variable, causes the vertex shader to not draw anything

I have this project, that has a default shader, that just draws models and textures. Recently I decided to add a second shader that does a fancy effect, and is used only on some of the objects drawn.

After compiling the project for Linux or Windows, it all works as expected. When compiling the project to Android, only on specific devices, the new shader doesn’t work, while on other devices I tried, it all works.

My shaders

Below is my default vertex shader specifically made for Android devices, this one works on all devices and draws everything without any editing or effect. As far as I understand, the fragment shaders work, so I’ll omit them.

    #version 310 es      in vec4 position;     in vec3 colour;     in vec2 texCoord;      uniform mat4 matrix;     uniform mat4 matrixProjection;      out vec2 outTexCoord;     out vec4 outColour;      void main() {             gl_Position = matrixProjection *matrix *position;             outTexCoord  = texCoord;             outColour  = vec4(colour.rgb, 1);     } 

I hope this looks fairly straight-forward. matrixProjection is the projection matrix, and matrix is the model-view matrix. They both work as expected and I’m able to render a whole scene without issue.

Now here is a simplified version of my new shader:

    #version 310 es      in vec4 position;     in vec3 colour;     in vec2 texCoord;      uniform mat4 matrix;     uniform mat4 matrixProjection;     uniform float animationCurrent;      out vec2 outTexCoord;     out vec4 outColour;      void main() {             gl_Position = matrixProjection *matrix *position;              if (animationCurrent > 0.0) {                     gl_Position.y += 5.0;             }              outColour = vec4(colour.rgb, 1.0);             outTexCoord  = texCoord;     } 

The only difference of the new shader is the new uniform animationCurrent, and an extra if statement that will modify the gl_Position.y of some vertices. Any object that is using this shader, is not drawn at all on the screen on some devices.

What I’ve tried

From the new shader, if I remove the entire if statement, it all works and it displays objects as-is. If I replace the if statement with if (true) it still works, but it just displays all vertices of objects drawn with it slightly higher. If I replace it with if (false) it still works as expected.

So for some reason, just referencing animationCurrent causes the object to not be drawn.

I also tried replacing the if statement with if (matrix[0][0] > 0.0) and it still draws the object, it looks like there’s something specifically wrong with animationCurrent. I tried adding another matrix uniform variable, and set its value the same way as I do matrix, but it wouldn’t draw the object either.

This should mean that the value of animationCurrent is not relevant, and the fact that it’s a uniform float doesn’t matter either.


The problem occurs on an android phone with this hardware:

Device: Moto E (4) Plus - 7.1.1 Vendor graphic card: ARM Renderer: Mali-T720 Version OpenGL: OpenGL ES 3.1 v1.r12p1-01alp0.62f282720426ab7712f1c6b996a6dc82 Version GLSL: OpenGL ES GLSL ES 3.10 

And this android tablet with similar hardware:

Device: Kindle Fire 8 Vendor graphic card: ARM Renderer: Mali-T720 Version GL: OpenGL ES 3.1 v1.r26p0-01rel0.526d936ea9da20486773a9aaceecd920 Version GLSL: OpenGL ES GLSL ES 3.10 

This is an android tablet where everything works as expected:

Device: Lenovo TB-X505F - 10 Vendor graphic card: Qualcomm Renderer: Adreno (TM) 504 Version GL: OpenGL ES 3.2 V@415.0 (GIT@f345350, I0760943699, 1580221225) (Date:01/28/20) Version GLSL: OpenGL ES GLSL ES 3.20 

And here is a slightly older device that works. I’ve modified the shader a bit to support an older glsl version, but the idea is the same:

Device: Kindle Fire 7 Vendor graphic card: ARM Renderer: Mali-450 MP Version GL: OpenGL ES 2.0 Version GLSL: OpenGL ES GLSL ES 1.00 


My primary goal, is to understand what is causing this. Have I missed something very obvious? Is this a very edge-case bug related to the hardware?

I’m still learning how to support different devices with different versions of glsl, so it’s very likely I’ve missed something.

Any information you have, let me know. I’m willing to try a few things on different devices to find more about this issue.

Increase variable increments of one

The idea is to have image that when i click on it it makes the number below it go up by one. I will post a copy of my html and javascript below.

function increasedigit(digitnumber) {
var x = document.getElementById(digitnumber).innerHTML;
if (x > 9) {
x == 0;
document.getElementById.innerHTML = x;

<div class="two">
<img onclick="increasedigit(digitone)" class="arrowgeneral"…

Increase variable increments of one

Rename a variable in a pattern by an evaluation

I wish to take some expression containing instances of Pattern[], and rename the variables of those patterns based on evaluation featuring the variable.

Let’s say my renaming function is

f[s_Symbol] := Symbol[ SymbolName[s], "2" ] 

which just appends 2 to symbol names:

f[a] >>> a2 

If I try to replace Pattern variables with this function (or any expression), that expression remains unevaluated!

a_ /. a :> f[a] >>> Pattern[ f[a], _ ] 

I assume Pattern holds its first argument.

Naturally my example is strange since simplified; I really intend to replace any symbol (which may or may not be featured in a Pattern) which satisifes certain properties.

a_ /. s_Symbol /; someTest[s] :> f[s] >>> Pattern[ f[a], _ ] 

How can I force Pattern to evaluate its first argument after my substitution?

I cannot just insert an Evaluate into the RHS of my DelayedRule (though that solves my first example), since this just violates the rule delay, and invokes f[s].