This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def permute_all(a, l, r): | |
if l==r: | |
print("".join(a)) | |
else: | |
for i in range(l,r+1): | |
a[l], a[i] = a[i], a[l] | |
permute_all(a, l+1, r) | |
a[l], a[i] = a[i], a[l] # backtrack | |
# Driver program to test the above function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//** | |
// Definition for a binary tree node. | |
struct TreeNode { | |
int val; | |
TreeNode *left; | |
TreeNode *right; | |
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
short* p = (short *)&(pDstResource); | |
std::wstring pointer = L"\t 0x" + std::to_wstring(*p) + L" - "; | |
OutputDebugStringW(pointer.c_str()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Root Signature doesn't match Compute Shader: A Shader is declaring a resource object as a texture using a register mapped to a root descriptor SRV (RegisterSpace=0, ShaderRegister=0). | |
SRV or UAV root descriptors can only be Raw or Structured buffers. | |
[ STATE_CREATION ERROR #882: CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH] | |
When binding a texture object directly to root signature rather than through descriptor table. | |
D3D12 CORRUPTION: ID3D12CommandList::CopyTextureRegion: pResource in the first parameter is corrupt. [ MISCELLANEOUS CORRUPTION #3: CORRUPTED_PARAMETER1] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################## | |
# run this script | |
cmake -DWIN32 -P CMakeList.txt | |
################################################## | |
# control flow | |
if(WIN32) | |
message("You are running on Windows.") | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = my name | |
email = [email protected] | |
[core] | |
editor = vi | |
[alias] | |
aa = add --all | |
bv = branch -vv | |
ba = branch -ra | |
bd = branch -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (UINT subset = 0; subset < m_Mesh.GetNumSubsets(0); ++subset) | |
{ | |
// Get the subset | |
auto pSubset = m_Mesh.GetSubset(0, subset); | |
auto PrimType = CDXUTSDKMesh::GetPrimitiveType11((SDKMESH_PRIMITIVE_TYPE)pSubset->PrimitiveType); | |
pd3dImmediateContext->IASetPrimitiveTopology(PrimType); | |
// Ignores most of the material information in them mesh to use only a simple shader | |
auto pDiffuseRV = m_Mesh.GetMaterial(pSubset->MaterialID)->pDiffuseRV11; |