Crash when creating RenderTargetViews for Cubemap

I want to create a cubemap and I want to render to it and later sample from it for reflections. However, It crashes when I try to create the faces for the cubemap. Here is my code:

RenderTargetCube::RenderTargetCube(ID3D11Device* device, int resolution, DXGI_FORMAT format) {      D3D11_TEXTURE2D_DESC desc = {};     desc.Width = resolution;     desc.Height = resolution;     desc.MipLevels = 1;     desc.ArraySize = 6;     desc.Format = format;     desc.SampleDesc.Count = 1;     desc.SampleDesc.Quality = 0;     desc.Usage = D3D11_USAGE_DEFAULT;     desc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;     desc.CPUAccessFlags = 0;     desc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;      HRESULT res = device->CreateTexture2D(&desc, NULL, &Texture);     throwIfFailed(res);      D3D11_RENDER_TARGET_VIEW_DESC viewDesc = {};     viewDesc.Format = desc.Format;     viewDesc.Texture2DArray.ArraySize = 6;     viewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;     for (int i = 0; i < 6; i++) {         viewDesc.Texture2DArray.FirstArraySlice = D3D11CalcSubresource(0, i, 1);         res = device->CreateRenderTargetView(Texture.Get(), &viewDesc, RenderTargetView[i].GetAddressOf()); // crash here         throwIfFailed(res);      } 

and here is the message I receive:

D3D11 ERROR: ID3D11Device::CreateRenderTargetView: The Dimensions of the View are invalid due to at least one of the following conditions. MipSlice (value = 0) must be between 0 and MipLevels-1 of the Texture Resource, 0, inclusively. FirstArraySlice (value = 1) must be between 0 and ArraySize-1 of the Texture Resource, 5, inclusively. With the current FirstArraySlice, ArraySize (value = 6) must be between 1 and 5, inclusively, or -1 to default to all slices from FirstArraySlice, in order that the View fit on the Texture. [ STATE_CREATION ERROR #137: CREATERENDERTARGETVIEW_INVALIDDIMENSIONS]

I dont quite understand the error message, especially the last part about ArraySize, why does it want it to be between 1 and 5 and not 0 to 5?

When creating a race in Pathfinder, can you give them two racial types instead of one? [duplicate]

I noticed in the Advance race guide for Pathfinder, that most of the races have a single type except for hybrid races like half-orcs which have two for the Humanoid type.

So when your creating a race in Pathfinder, are you able to combine two racial types or is it just one type only?

Creating trigger from one database table to another database table postgresql

I have two database say db1 and db2. And two tables user_auth_table in db1 and user_table in db2. Now I want to trigger a function which sync up few values in both tables for each new row or on each new insertion in user_auth_table.

I have tried to write on my own and creating trigger in db1. But the error says user_table doesn’t exist. Which I know why I am getting this error. Any suggestion to target the tables outside the db ?

CREATE TRIGGER sync_user_table AFTER INSERT ON user_auth_table for each row execute procedure syncAndMaintainUsersTable()  create or replace function syncAndMaintainUsersTable() returns trigger as $  BODY$   begin if NEW.user_uuid<>OLD.user_uuid then     insert into user_table values (NEW.user_uuid, CURRENT_TIMESTAMP, NEW.provider); end if; return new; end; $  BODY$   language plpgsql; 

How to avoid the guidance cantrip from dominating the game without creating any benefit?

The guidance cantrip is bothering me – not because it makes ability checks easier but because it does not have a relevant opportunity cost and because it disrupts the flow of the game. Any time a skill check is required that can be foreseen players can just use the cantrip. I find this very annoying, since it causes a lot of extra dice rolling and discussion without any meaningful decisions that would add anything to the game.

I do know that the spell requires concentration, that I can create opportunity costs through my content and that I could just ban the spell outright. This was extensively discussed in this question: Casting Guidance cantrip for every roll?

I could ban the spell but I would like to avoid that and creating additional complications specifically for this spell is a lot of work. Are there other, easier solutions?

User defined function for creating Row only listing first column of matrix or first element of a vector

I cannot figure out why my rowNameValue[] is only listing the first part of a column or vector. Below is the code.

objectName = Function[Null, SymbolName[Unevaluated[#]], {HoldFirst}]; ClearAll[m, b] m = {{1, 0, -5}, {0, 1, 1}, {0, 0, 0}}; MatrixQ[m] b = {1, 4, 0}; VectorQ[b] rowNameValue[symbol_, name_ : Null] := Block[{id, fn},    id = If[Head[name] === String, name, objectName[symbol],       objectName[symbol]];    id = If[MatrixQ[symbol] || VectorQ[symbol], Style[id, Bold], id,       id];    fn = If[MatrixQ[symbol] || VectorQ[symbol], MatrixForm,       TraditionalForm, StandardForm];    {Row[{id, " \[Rule] "}, " "], Apply[fn, symbol]}    ]; dataIn[m_, b_] = Block[{}, Grid[{     rowNameValue[m, "m"],     rowNameValue[b, "b"]     }]] dataIn[m, b] 

Creating a top-hat distributed random number generator

enter image description here

I have this Fortran code which generates a flat distribution as it produces a single random number centered on 0. The function GRNDM (Geant 4 random number generator) produces equally distributed random numbers between the values of 0 and 1. RDUMMY is the name of the vector filled with the random number and the argument “1” states the length of the vector: i.e. GRNDM here will produce a single random number between 0 and 1. The second line then produces random numbers in the interval [μ−σ2,μ+σ2].

I was wondering if there was a way of changing it to produce random numbers with a top hat distribution?

Creating responsive 3 x 3 gallery box

Hello I am trying to create a flex grid which has 3 by 3 image gallery which is responsive,

Currently this is going on a wordpress page and this is the code to my image using openseadragon.
So I need this image:

<div id="materials-0158" class="suarrmaterials-zoomable-image" style="height:460px; width:310px;" data-image="2020/05/DSC_0158-1.jpg"></div>

to appear three times next to each other and three on the bottom, I will update the images and add more image boxes once i get the correct…

Creating responsive 3 x 3 gallery box

When creating a character above 1st level, can you give them the effects of spellcasting services?

Page 199 of the DMG explains how new characters can start with magic items, even those they choose to make themselves (with the assumption these items were created some time before the character became a PC)

But let’s say a non-spellcaster wants to give themselves an extra point to an ability score. If they have 27,500 gp, they could start with a Manual of Quickness of Action and either use it immediately or possibly say they’ve used it already and begin with an inherent +1 bonus to Dexterity.

That book costs 27,500 gp. Using the formula on page 129 of the PHB, however, it would only cost 26,530 gp to have a 17th-level wizard cast wish on them as a service. For an 8th-level character (or a higher-level character with lots of other gear), that’s the difference between getting the bonus, and not.

Can the character simply decide to begin with this effect present (or a different spell with a permanent duration, like enlarge person+permanency, since 9th-level wizards are easy to find in large cities) and 26,530 gp less, or since the DMG only describes starting with magic items, must they spend 27,500 gp for the magic item?