How can I get the basic Unity player controller to move based on a gameobjects rotation?

I am making a basic movement script based off of the built in playercontroller in Unity. I am trying to get the Player gameobject to move forward based on its own rotation (i.e. if it is rotated to 90 degrees, it will go forward in the direction it is facing and not based off of its transform values), but I can’t figure out how to change it.

How can I do this?

What’s the use of a wide-column NoSQL db such as Cassandra over a K-V store or a document based db?

Say we’re making a simple photo app. This link says that we can store the image in S3 and now have a URL. Great. Next, we need a mapping of a UserID to the many images they’ve created. For this, it recommends Cassandra where the key would be UserID and the value would be the list of PhotoIDs stored in different columns.

However, why can’t we use a document DB like mongo instead? It can have something like:

{
    “UserID” : abc
    “PhotoIDs” : {
           url1,
           url2,
           url3,
            ..
      }
}
    

Or a persistent K-V store like DynamoDB?

What is Cassandra’s column-based storage giving us here that these don’t?

I realize that the unbounded nature of photoURLs could be an issue. Say a user has 10,000 photos, adding one to this would mean fetching the 10,000 item large document, adding to it and then updating the document. But does cassandra solve that? Would it be able to have 10k columns for that one prolific user?

linear algebra – Reference on classifying real subspaces of complex vector spaces (based on restricted complex structure)

Every complex vector space can also been seen as real vector space. If we now choose a real subspace, it may not be a complex subspace (in particular, if it is of odd real dimension).

If the complex vector space was equipped with an inner product (for example, a Hilbert space), we can restrict the imaginary unit (also known as linear complex structure) to any real subspace using the orthogonal projection. We can then classify the types of real subspaces based on the spectrum of this “restricted complex structure”. In particular, if the restricted complex structure squares to minus identity, i.e., is itself a complex structure, the real subspace is also a complex subspace. In general, the spectrum encodes how being a complex subspace is violated.

I worked this out for myself, but I’m confident that this is standard material in linear algebra of complex vector spaces. However, the standard introductory text books that I checked do not discuss real subspaces of complex vector spaces and their classification in the above way.

Do you know of a standard reference that I could cite when discussing this (in particular, the above mentioned classification based on the spectrum of the restricted complex structure)?

hash – Why do transaction/blockchain based gambling sites use such complicated methods for proving fairness?

Doesn’t the block hash or the transaction id provide enough entropy
(for example, by using block_hash % 37 to generate a random number between 0 and 36)?

Block Chain Roulette determines the lucky number as a function of the hash of newest block in the chain:

Everytime a new block is created on the Bitcoin block chain, the roulette wheel is spun and a random number between 0 and 36 is generated… random hash = hmac_sha512(secret hash, block hash)
the random decimal integer is then multiplied by 37 and divided by (72057594037927935 + 1), decimal places dropped, resulting in a number between 0 and 36. 14 hex charecters are used because this represents a maximum random number of 72057594037927935, a number which is divisable equally by 37 (Or at least very very close to being equally divisable, when working with such large numbers). This ensures each number between 0 and 36 has an equal probability of being chosen. Continue reading…

SatoshiDice determines win/lose by using a pre-determined secret as well:

The lucky number used to determine the winner of games is simple. It is simply the first bytes of hmac_sha512(secert,txid:out_idx). That would be the secret string as the key and the transaction ID of your bet transaction as the data.

Can someone generate a transaction in such a way that its hash is known ahead of time?
Edit: It seems like the second part of the question has already been answered.

arrays – Returning random integer from interval based on last result and a seed

Suppose we have an interval of integers (a, b). I would like to have a function that returns random members from within the interval, without repetitions. Once that all members within the interval are explored, the function would start to return the same first random sequence again, in the same order.

Example: a=1, b=5

3, 1, 4, 5, 2, 3, 1, 4, 5, 2, 3, 1, 4, 5, 2, ...

This would be easy to achieve by shuffling an array of all elements between a and b, and repeating it once the array is finished. However, this would take too much memory space, and this is not suitable for my case (I might have millions of elements).

Instead, the function I’d like to have would be more or less like this:

f(a, b, n, seed) -> n+1

Where:

a - start of interval
b - end of interval
n - last element returned from list
seed - self-explanatory
n+1 - next random element from list, calculated by using the seed and the last element returned (n)

The trick is knowing some way to get a non-repeated number from the interval based only on the element returned before and the seed. In the end, it would behave like a circular list randomized at its initialization, but without using memory space.

Show woocommerce products based on select category using acf

Basically i want to show all the products from a specific category that i select using acf dropdown field.

Google Data Studio – displaying a chart based on pivot table, without showing the pivot table?

My raw data is in Google Sheets, with one of the columns representing categories that should act as filter. As a tryout, we’ve created pivot tables in Sheets, and charts on those pivot tables.

Now I’ve got to recreate those charts as a Data Studio report.

Looked at some basic tutorials, but I’m probably missing something crucial:

  • If I use the pivot table data from Sheets as data source, then I can’t apply a filter on the categories (they are in the pivot tables).

  • If I create a pivot table in Data Studio on the raw data, I couldn’t find an option to (1) not show this pivot table and (2) use this pivot table as input for a chart.

Any help is appreciated.

performance – Time to FCP changes based on order of and tags

I was troubleshooting why one particular page took a full second longer to reach FCP compared to similar pages for mobile according to Google’s Page Insights. The difference ended up being the order of two tags at the beginning of the page.

3.4 seconds to FCP

<h2>heading</h2>
<p>some paragraph</p>

versus 2.5 seconds to FCP

<p>opening paragraph</p>
<h2>heading</h2>

In the first scenario, Google Page Insights gave a logo from the header as the FCP content. But with the second scenario, Google would display either text from the <p> or <h2> tag for the FCP content.

Why would the order of these two simple tags change the FCP content from text to an image header?

domain driven design – Serialization in REST API: Generating Representations Based on a Model

I am developing a RESTful API using .NET technology to implement the service.

The part that I am having problems with is the dynamic nature of the representation types that the service will return.

For example, let’s say I have a Person model, and the Person has a bunch of Beyblades toys they can battle other people with.

My model would look something like:

public class Person{
  public guid ID {get; set;}
  public string Name {get; set;}
  public List<Beyblades> Beyblades{get; set;}
  //...
}

The API will return a list of People by going to “urlpeople”. The representation for the people returned will contain the person’s ID, name, and a link to “urlbeybladesperson-ID” that can be followed instead of the serialized list of their Beyblades (if they have any).

Seems pretty straightforward, but the implementation of a dynamically generating links for lists-of-things (and not the list’s themselves) is what I’m trying to find the best solution for.

My initial thought was to create templates for the representations returned. The template would check the model in order to output the correct representation data. For example, the template would check if the person has any Beyblades, and if so it would generate the link (instead of the serialized list of Beyblade models); likewise, it would generate a self link for each person as well.

The problem with this solution is that if my API is to support JSON (Hal), XML, and say HTML as possible representation output types, I would have to manage at least 3 templates whenever something in the model were changed.

My next thought is to design a serialization framework by implementing a series of MediaTypeFormatter types that would naturally consider my business logic to convert lists into appropriate links; however, this too could become problematic while maintaining the API since there would have to be some sort of standard mapping between lists of things and API URLs and this may not be apparent when changes are made.

Since REST is not a new thing, I was wondering if .NET already has tools for serializing models into a RESTful representations?

Or if there was a best practices document/tutorial on this topic?

Or maybe I’m conceptually going about this wrong and someone here could point me in the right direction?

I realize that REST and OO doesn’t seem go hand-in-hand, so maybe there isn’t anything like what I am seeking. It just feels like I’m inventing a wheel that someone has probably already done.

Need HA in Mysql GTID based replication

I am using GTID based replication in mysql 5.7.I have few question

 1.How we can ensure here slave databases is consistent with master
   database ?
 2.How failover will work if master is down ?
 3.How to ensure High Availability in Mater/slave GTID replication ?````