## Domestic product and real structure

Let $$V$$ to be a complex vector space of dimension $$n$$ with an inner product $$langle cdot, cdot rangle$$. Is there an "inherited" interior space for $$V$$ seen as a $$2n$$-real vector space? Is this just the real part $$Re ( langle cdot, cdot row)$$?

## opengl – PyOpenGL structure Cubemap ARB does not run with gluSphere

I made a gluSphere rendering in my screen and gave it a map texture of Earth cube. The texture is perfectly visible (see below), but I can not rotate it with the shape. This question is closely related to my problem, but the suggested solutions do not work, but rather produce a beachball effect on my sphere (see below). However, that turns, so I guess that's fine.

What can I do to rotate my texture with the sphere?

Thank you!

(This code is a slightly modified version of this)

``````from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from OpenGL.GL.ARB.texture_cube_map import *
import numpy
from PIL import Image as Image
import sys

angle    = 0.1
texture  = 0
# glTexGeni mode
mode = GL_NORMAL_MAP_ARB

# this loads a cube map from six images
def loadCubemap ( faces, path = ""  ):
texture = glGenTextures ( 1 )
target_map  = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
glBindTexture     ( GL_TEXTURE_CUBE_MAP_ARB, texture )
glPixelStorei     ( GL_PACK_ALIGNMENT,1 )
glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,     GL_REPEAT )
glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,     GL_REPEAT )
glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR )
glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR )
glEnable          ( GL_TEXTURE_CUBE_MAP_ARB )

for face in faces:
if path != "":
file = path + "/" + face
else:
file = face
image  = Image.open ( file )
width  = image.size (0)
height = image.size (1)
image  = image.tobytes()
gluBuild2DMipmaps ( target_map, 3, width, height, GL_RGBA, GL_UNSIGNED_BYTE, image )
target_map = target_map + 1
return texture

#this will check if the OpenGL ARB extension is working
def extensionInit ():
if not glInitTextureCubeMapARB ():
print("ARB_texture_cubemap not working !")
sys.exit ( 1 )

def init ():

glClearColor(0, 0, 0, 1)
glClearDepth ( 1.0 )
glDepthFunc  ( GL_LEQUAL )
glEnable     ( GL_DEPTH_TEST )
glHint       ( GL_POLYGON_SMOOTH_HINT,         GL_NICEST )
glHint       ( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST )

#this will help when resizing the window
def reshape ( width, height ):
glViewport     ( 0, 0, width, height )
glMatrixMode   ( GL_PROJECTION )
gluPerspective ( 55.0, float(width)/float (height), 1.0, 60.0 )
glMatrixMode   ( GL_MODELVIEW )
gluLookAt      ( 0.0, 6.0, 0.0,
4.0, -4.0, 4.0,
0.0, 0.5, 0.0 )

def display ():
global texture, mode

glClear   ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT )
glEnable  ( GL_TEXTURE_CUBE_MAP_ARB )
glEnable  ( GL_TEXTURE_GEN_S )
glEnable  ( GL_TEXTURE_GEN_T )
glEnable  ( GL_TEXTURE_GEN_R )
glTexGeni ( GL_S, GL_TEXTURE_GEN_MODE, mode )
glTexGeni ( GL_T, GL_TEXTURE_GEN_MODE, mode )
glTexGeni ( GL_R, GL_TEXTURE_GEN_MODE, mode )

glBindTexture   ( GL_TEXTURE_CUBE_MAP_ARB, texture )
glPushMatrix    ()
glTranslatef    ( 2, 2, 2 )
glRotate       ( angle,  0, 10, 0 )
glRotate       ( angle,  10, 0 , 0 )

glutSolidSphere(1.5, 10, 10)

glPopMatrix     ()
glutSwapBuffers ()

# keyboard bindings
def keyPressed ( *args ):
key = args (0)
if key == '33' or key == b'x1b':
sys.exit ()

# rotation
def animate ():
global angle
angle  = 0.01 * glutGet ( GLUT_ELAPSED_TIME )
glutPostRedisplay ()

# main function
def main ():
global texture

glutInit               ( sys.argv )
glutInitDisplayMode    ( GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH )
glutInitWindowSize     ( 600, 400 )
glutInitWindowPosition ( 0, 0 )

glutCreateWindow ( "Render the Earth" )
glutDisplayFunc  ( display )
glutIdleFunc     ( animate )
glutReshapeFunc  ( reshape )
glutKeyboardFunc ( keyPressed )

init          ()
extensionInit ()

texture = loadCubemap ( ( "east1.png",
"west.png",
"north.png",
"south.png",
"center.png",
"east2.png" ), "cubemap" )
glutMainLoop()

if __name__ == "__main__":
print("Hit ESC key to quit.")
main()
``````

This is the result of `mode = GL_NORMAL_MAP_ARB`:

That's what I get when I do it `mode = GL_OBJECT_LINEAR` (suggested here):

## Smooth varieties – Simpler methods for calculating homology / cohomology by adding an additional structure

assume $$X$$ is a topological space and I want to talk about its "homology".

There is this notion of singular homology obtained from a singular chain complex. This is not very easy to calculate.

Suppose we assume that there is an additional structure in the topological space. $$X$$, ie the structure of a CW complex, so we can talk about the concept of cell chain complex and from there the notion of cell homology. It's easier than calculating a singular homology.

Suppose further that this topological space $$X$$ (which we supposed to have a CW structure) has an additional structure of a simplicial complex, so we can talk about the notion of simplicial string complex, and then the notion of simplicial homology. This is easier to calculate than cell homology.

Then, it is normal for two homology groups from different approaches to coincide when both have meaning.

Question: Is there an extra (non-trivial) structure that I can add on a
space having a simplicial structure that facilitates the calculation
homology in terms of simpler chain complex than the simplicial chain
complex?

Same is the situation with cohomology. Suppose I have a topological space $$X$$I can speak of its singular cochain complex and the corresponding singular cohomology.

Suppose this topological space $$X$$ has a variety structure, so we can talk about the cochain complex of differential forms and use it to compute the cohomology of topological space $$X$$. It is a standard result that, with correct coefficients, the singular cohomology is identical to the deRham cohomology (deRham theorem).

Question: Is there an extra structure that I can add on a collector
which gives a simpler cochain complex than the cochain complex of
differential forms which gives an easier way of calculating the cohomology of
the multiple? For example, suppose I fix a connection on the tangent
package $$TM rightarrow M$$ variety $$M$$ (or a Riemannian metric on the variety $$M$$), can I produce a simpler file?
cochain complex using the connection that easily calculates cohomology?

If I try to make sense of the concept of cohomology theory by fixing a connection on the tangent beam $$TM rightarrow M$$ (a metric on the collector $$M$$) then it is reasonable to expect that this notion does not depend on the connection choice I have set. Does assuming that there is a flat connection on the tangent beam suggest an obvious cochain complex?

Suppose I ask that the multiple $$M$$ has an additional structure of a Lie group, then there is a simpler cochain complex that calculates the cohomology of the variety more easily than the cohomology of Rham. It is too much to ask, I am looking for results which lie between a cohomology of Rham of multiple structure and strictly inferior to the notion of Lie groups.

All references are welcome.

## javascript – Domain classes in the DDD structure in React?

I build an Electron application using React. I come from the C # and WPF world and I wonder where are my domain classes going? I understand the concept of components, but what about classes without user interface, with a lot of methods?

For example, application for the management of software teams in the company. There is an object `Team`. It does not have user interface, just a few months on it, like `AddMemeber` etc.

Is there room for such classes in the react project? Or should I put it somehow in the component.

## c # – Choose between derived classes and add an additional property in the entity structure

I have the following `StudentGroup` classroom:

``````public class StudentGroup
{
(Key)
public int Id { get; set; }

//the set of peers who will review the work of the StudentGroup
(ForeignKey("PeerReviewGroupId"))
public PeerReviewGroup PeerReviewGroup { get; set; }
public int? PeerReviewGroupId { get; set; }

public IEnumerable GroupMemberships { get; set; }
}
``````

Derived from this class is `PeerReviewGroup`, in which there are two new properties:

``````public class PeerReviewGroup: StudentGroup
{
(ForeignKey("StudentToReview"))
public ApplicationUser StudentToReview { get; set; }
public string StudentToReviewId { get; set; }

(ForeignKey("StudentGroupToReview"))
public StudentGroup StudentGroupToReview { get; set; }
public string StudentGroupToReviewId { get; set; }

}
``````

`PeerReviewGroup` could be attributed to an individual (that is to say `StudentToReview`) or another group (that is to say, `StudentrGoup`). So, one or the other of these values ​​has to be `null`.

Instead, I could drive two classes:

``````public class PeerReviewGroupForIndividuals: StudentGroup
{
(ForeignKey("StudentToReview"))
public ApplicationUser StudentToReview { get; set; }
public string StudentToReviewId { get; set; }
}

public class PeerReviewGroupForGroups: StudentGroup
{
(ForeignKey("StudentGroupToReview"))
public StudentGroup StudentGroupToReview { get; set; }
public string StudentGroupToReviewId { get; set; }

}
``````

I wonder if this is preferable or not, or which approach is the best practice. I think that deriving two classes complicates things. No suggestion?

## c ++ – How can I access a structure that resides in a structure in models?

I have a struct: "`FOuterStruct`"

This is defined in the code so that it contains another type of struct:

``````Struct OuterStruct
{
UPROPERTY(...)
FInnerStruct memberStruct;
}
``````

Now.

When I break a `FOuterStruct` apart from the plans I do not get the `FInnerStruct` as a pin on the resulting node.

How can I change / access this `FInnerStruct`?

## unit – Recommended data structure for storage and quick access to infinite terrain based on blocks of elevation maps

I am aiming to create a heightmap terrain based on pieces in Unity.
I already have a configured and functional multifractal simplex base noise, capable of generating heightfields and meshes at run time … but only individually for the moment.

I'm trying to find the best way to store and access each piece. I already have some elaborate methods for converting global positions into block coordinates and local block barycentric triangle coordinates, so that we can interpolate heights. I used this to create a method for passing a camera-space-world beam through the mesh and iterating over intersections of x / z planes until it is clear. it finds the height intersection – for a quick way to search for the mouse – field position without having to attach physical collision meshes for each piece and use the Unity raycasting. It's all working well.

I am a little puzzled now on how to implement the main infinite grid storage from which I will generate block meshes.

This is intended to be in use in a game with an isometric perspective, revealing the world as units explore the fog of war over time … with the ability to move the camera over the open field pretty quickly, so I suppose there may be a limited possibility to unload previously generated songs … it will be a constantly expanding data set (so I will probably have to look for ways to keep it light on memory)

I think I can be:

1. Create a two-dimensional float array (or maybe a bit short – 64k height levels should probably be sufficient) for the entire terrain and dynamically resize the array as each x / z boundary is pushed back. Generate only the terrain mesh in pieces, to keep each piece of mesh below the Unity 64k-vertex boundary.
2. Create a grid manager class, which has some sort of dynamic data structure that stores the map-chunk objects, and instantiates them / retains the references to the request, each containing its own heightmap (res * res) array.
3. Something else?

I guess Option 2 will generate the most mileage, but I'm not sure what type of dynamic data structure to use. I guess some kind of key / object pair structure, where the key is built from the block coordinates?

Assuming I want to access height values ​​quickly and constantly, across block boundaries, for things like my mouse-ray intersection method, and for the path search code, etc., I suppose that I will need a way to access pieces. it's almost as fast as looking for clue arrays and a complexity of O (1).
Or maybe a way to cache recently viewed or near-camera songs? Or pointers to them, or something?

As you can probably see, I'm a bit new to video games, but I have a VFX experience so I'm very familiar with 3D geometry mathematics and basic scripts. When it comes to designing, structuring and implementing a game, I'm a novice, so any pointer to relevant tutorials would be much appreciated.

## virtual machine – I can not find the directory structure

I have installed the latest version of DrupalVM. Everything works well. I can access Drupal on both my local dashboard and DrupalVM, but I can not locate the Drupal directory structure.

After using `vagrant ssh`I am able to see the Drupal directory structure but not in Windows Explorer.

## c ++ – change the character of a string that is in a structure (struct)

I make a program in C ++ that keeps names, first names, addresses, neighborhoods and cities through the use of structures. After saving them, an option allows the user to edit a letter of all previously registered addresses. For this, it is asked the user to enter the letter that he wishes to edit, then enter a character or letter so that is the replacement of the letter of addresses, for example; the user enters "b", all letters "b" in the addresses must be replaced by the new letter entered by the user. The problem is that the console launches me the following
"segmentation fault sigsegv".

Here is the code I wrote:

``````#include
#include
#include

using namespace std;

struct info{     //creación de la estructura

string dir;
string name;
string lastN;
string barrio;
string city;

};

string dirRemp;   //cadena en donde almaceno la dirección

struct info f(2);

for(int i = 0; i <= 1; i++)
{
cout << "Posicion persona: " << i << endl;
cout << "Ingrese direccion" << endl;
cin >> f(i).dir;
dirRemp(i) = f(i).dir; //aquí guardo lo que llegue a
//f(i).dir para luego reemplazar
cout << "Ingrese nombre" << endl;
cin >> f(i).name;
cout << "Ingrese apellido" << endl;
cin >> f(i).lastN;
cout << "Ingrese ciudad" << endl;
cin >> f(i).city;
cout << "Ingrese barrio" << endl;
cin >> f(i).barrio;
cout << "n";
}

short option;

do
{

cout << "Bienvenido al directorio virtual" << endl;
cout << 1. Reemplazar letra" << endl;
cout << "Eliga una opcion" << endl;
cin >> option;

switch(option)
{
case 1:
short op;
cout << "1. Reemplazar en la direccion" << endl;
cout << "n";

if(op == 1)
{
string reemp;
char remp1;
string rem;

cout << "Reemplazar en la direccion: " << endl;
cout << "n";
cout << "Ingrese letra para reemplazo: " << endl;
cin >> remp1;  //ingresa la letra de referencia
cout << "n";
cout << "Ingrese caracter de remplazo: " << endl;
cin >> rem;   //ingresa la letra para reemplazar la
//referencia

cout << "n";

for (int i = 0; i < (int) dirRemp(i).length(); ++i)
{
//aquí se hace el reemplazo
if(dirRemp(i) == remp1)
{

dirRemp.replace(i, 1, rem);

f(i).dir = dirRemp(i);

for(int i = 0; i <= 1; i++)
{
cout << f(i).dir << endl;
}

}
}
}
break;
default:
cout << "Opcion digitada no existe" << endl;
return;
}

}while(option < 2);

int main(){

ingresoDat();

return 0;
}
``````

## A sandwich algorithm / data structure

$$O (n ^ c)$$ is asymptotically superior to $$O ( log ^ d n)$$ for all possible pairs of values ​​of $$c$$ and $$d$$.

Can you give an example of a problem (or data structure) that has an execution time (or a query / update time)? $$f (n)$$

such as $$f (n)$$ is asymptotically larger than $$O ( log ^ d n)$$ but asymptotically smaller than $$O (n ^ c)$$ for all the values ​​of $$c$$ and $$d$$?