Basic Projection & View matrix

Currently writing a camera component for FNA (basically XNA), and can’t for the life of me figure out why my matrix transform isn’t working as expected. This is how I calculate my view & projection matrices:

// projection // WorldSize is something like 16x9, 20x10, etc. Basically the "simulated" world size. // Zoom is just a float to zoom the camera. var left = Zoom * -WorldSize.X / 2; var right = Zoom * WorldSize.X / 2; var bottom = Zoom * -WorldSize.Y / 2; var top = Zoom * WorldSize.Y / 2; const float near = 0; const float far = 100; var projection = Matrix.CreateOrthographicOffCenter(left, right, bottom, top, near, far); 

and

// view // Position is the position of my Camera, e.g. (10, 15), (6.51, 16.612), etc. var position = new Vector3(Position, 0); var target = position + Vector3.Forward; var up = Vector3.Up; var view = Matrix.CreateLookAt(position, target, up);  // Combine them var combined = projection * view; 

This should, by all the sources I’ve checked, double-checked, and triple-checked, be correct. However when I apply this matrix to my batch or effects it doesn’t show anything at all:

// I would expect a white square to be rendered in the middle of the screen. Since WorldSize is // 16x9 I would expect a 1x1 square to be clearly visible. var batch = new SpriteBatch(); batch.begin(/* the rest */, combined); var texture = new Texture2D(Game.GraphicsDevice, 1, 1); texture.SetData(new []{Color.White }); batch.Draw(texture, Vector2.Zero, Color.White); batch.End();  // Also tried just rendering lines, shows nothing var effect = new BasicEffect(graphicsDevice) {     VertexColorEnabled = true,     View = view,     Projection = projection }; effect.CurrentTechnique.Passes[0].Apply(); graphicsDevice.DrawUserPrimitives(PrimitiveType.LineStrip, vertices, 0, vertices.Length - 1); 

I have checked so many sources and they all do exactly like this. I even tried copy+pasting the matrix source code for a Java project I made some time back that I know works, and that didn’t work either so I don’t think the Matrix transforms are to blame. Anyone know what I’m doing wrong?

Indexed columns in SQL Server do not appear to work for basic queries according to execution plan

Disclaimer: I’m not a DBA. I have picked up a few things from this board in the past that I’m building from.

I have a table of google analytics session start times. I have an index on each column. I want to filter for all sessions that were started between two dates. Screenshot below shows the query, and the index.

Query text and index properties

The query runs quickly but I do not believe it’s using the index based on the Execution plan which both says that there’s a missing index and shows a table scan rather than an index scan:

execution

Why?

Is it because of something about the way I’m searching through the datetime? If instead of looking between dates, I set it equal to a date, the execution plan shows it using the index:

Using index

But it’s not just this table or datetime. Here’s a different table with an index on a varchar column:

metadata index

And a simple query on this one also tells me I’m missing the index:

missing md index

I’m stumped.

Basic manipulations with lists

Suppose I have a list of the following form:

List={{{a,b,c},{d,e,f},{g,h,i}},{{j,k,l},{m,n,o},{p,q,r}}}

I have two questions:

A) How can I convert this to a list of the following form:

Newlist={{a,b,c},{d,e,f},{g,h,i},{j,k,l},{m,n,o},{p,q,r}}

B) How can I access, say, the elements a,d,g,j,m,p?

This is probably a very basic question but I do not have previous experience with Mathematica.

Thank you,

Looking for an assistant that understands basic server operations

Hi All,

I'm looking to hire an assistant on an hourly basic that understands the basics of windows or linux servers. Also someone who is willing to learn. This would involve:

  • writing or re-writing content I give you with direction
  • forum posting on forums I give you
  • Supporting live chat of my web hosting
  • Also fixing very basic server issues

I am posting here as this is the kind of crowd I'd like this person to be from.
Please PM me if you are interested and I will…

Looking for an assistant that understands basic server operations

For a basic unarmed strike, is only the proficiency bonus included in the attack roll, or is the Strength modifier also added?

The Player’s Handbook, Chapter 9, states about attack rolls:

The ability modifier used for a melee weapon attack is Strength

A bit later on it also states about melee attacks:

Instead of using a weapon to make a melee weapon attack, you can use an unarmed strike: a punch, kick, head-butt, or similar forceful blow (none of which count as weapons). On a hit, an unarmed strike deals bludgeoning damage equal to 1 + your Strength modifier. You are proficient with your unarmed strikes.

I’m not sure whether an unarmed strike is considered a “melee weapon attack.”

For a basic unarmed strike (i.e. no Monk, Tavern Brawler or anything else that enhances unarmed strikes), is only the proficiency bonus added to the attack roll, or is the Strength modifier also added?

Clearly the Strength modifier is added to the damage, but I’m asking about the attack roll.

possible corruption or other issue that doesnt show on basic scans?

I have a WP table with about 33000 records that suddenly is taking more than a minute to query. According to optimization tools, everything is good but given the sudden nature of the trouble, I doubt that. We went from those tables taking way less than second to query to between 48-93 seconds now each time. Have confirmed no other load on the server slowing it down so its all down to this. Looking for other places to look or check given the issues?

I don’t understand something very basic about proxies – please help

Hi,

I don’t get all of this proxy thing, I will explain.

1. If I do many searches in google in a short period of time, my IP will get banned from doing further searches – thus I need a proxy – right ?

2. If I buy a proxy IP and do the same thing it then will ban my proxy – right ?

So why do I need a proxy ?  and how will it help me ?

What are the gambling games in the “Black Box” edition of Basic D&D?

I have a vague memory of my father teaching me about dice probabilities from a “mini-game” within the Black box set, at the beginning of being in jail in the salt mines. The other prisoners, is willing to gamble with me, but we use different combinations of dice to see who will roll the higher number. From what I can remember it was from the Escape from Zanzer Tem’s dungeon adventure.

I’m looking to find what exactly those combinations of dice were, and what the rules of the gambling game were.

Does exploration movement rate in Basic D&D (B/X) include trap/secret-door detection?

In the Basic Rulebook for D&D, on page B19, it states that characters can move 120′ in a dungeon per turn (10 minutes). Later it states that this movement assumes players are mapping carefully, searching, and trying to be quiet.

What is meant by ‘searching’? Are characters automatically getting a detect trap and detect secret door roll (every 10′ or per trap/door) as part of this movement rate? It seems unclear what searching exactly means in this context.

Just adding basic token by POST parameter for securing the API. It is safe?

Let’s say I have an address for an API like this:

mywebsite.com/api/mydata 

If accessed, a JSON will appear like this:

[   {     "id":"1",     "name":"John"   },   {     "id":"2",     "name":"Smith"   } ] 

The result defaults will be displaying the entire data if a post has no parameters. If you use post "ID" and the ID parameter value is one of the existing data in the API, it will only display objects from the data selected based on the ID. The API can be accessed by anyone. API needs to be accessed using token parameters to secure the data.

Let’s say I add a token parameter to be able to access data like this:

yourtoken="yourtoken"  if (post_param[token]==yourtoken) {   // Displaying JSON } 

so if you want to open the API, you need to add a token parameter.

Is simple security like this worth using? what vulnerabilities will arise if I use this? is there a better way than this?