Microsoft example & # 39; Create a basic effect & # 39; in XNA Game Studio 4.0 Documentation does not work

Why does this example not work? Is it normal that the cubeVertices variable is not actually provided somewhere as a parameter? I am getting an error like this: "The current vertex declaration does not include all the elements required by the current vertex shader. Position0 is missing."

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Test
{
    /// 
    /// This is the main type for your game
    /// 
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        Matrix worldMatrix;
        Matrix viewMatrix;
        Matrix projectionMatrix;
        VertexPositionNormalTexture() cubeVertices;
        VertexDeclaration vertexDeclaration;
        VertexBuffer vertexBuffer;
        BasicEffect basicEffect;
        //VertexPositionNormalTexture


        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            base.Window.AllowUserResizing = true;

        }

        /// 
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// 
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
            this.Window.ClientSizeChanged += new EventHandler(Window_ClientSizeChanged);

            float tilt = MathHelper.ToRadians(0);  // 0 degree angle

            // Use the world matrix to tilt the cube along x and y axes.

            worldMatrix = Matrix.CreateRotationX(tilt) * Matrix.CreateRotationY(tilt);
            viewMatrix = Matrix.CreateLookAt(new Vector3(5, 5, 5), Vector3.Zero, Vector3.Up);

            projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.ToRadians(45),  // 45 degree angle

                (float)GraphicsDevice.Viewport.Width /
                (float)GraphicsDevice.Viewport.Height,
                1.0f, 100.0f);

            basicEffect = new BasicEffect(graphics.GraphicsDevice);

            basicEffect.World = worldMatrix;
            basicEffect.View = viewMatrix;
            basicEffect.Projection = projectionMatrix;

            // primitive color

            basicEffect.AmbientLightColor = new Vector3(0.1f, 0.1f, 0.1f);
            basicEffect.DiffuseColor = new Vector3(1.0f, 1.0f, 1.0f);
            basicEffect.SpecularColor = new Vector3(0.25f, 0.25f, 0.25f);
            basicEffect.SpecularPower = 5.0f;
            basicEffect.Alpha = 1.0f;

            basicEffect.LightingEnabled = false;
            if (basicEffect.LightingEnabled)
            {
                basicEffect.DirectionalLight0.Enabled = true; // enable each light individually

                if (basicEffect.DirectionalLight0.Enabled)
                {
                    // x direction

                    basicEffect.DirectionalLight0.DiffuseColor = new Vector3(1, 0, 0); // range is 0 to 1

                    basicEffect.DirectionalLight0.Direction = Vector3.Normalize(new Vector3(-1, 0, 0));
                    // points from the light to the origin of the scene

                    basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
                }

                basicEffect.DirectionalLight1.Enabled = true;
                if (basicEffect.DirectionalLight1.Enabled)
                {
                    // y direction

                    basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0, 0.75f, 0);
                    basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(0, -1, 0));
                    basicEffect.DirectionalLight1.SpecularColor = Vector3.One;
                }

                basicEffect.DirectionalLight2.Enabled = true;
                if (basicEffect.DirectionalLight2.Enabled)
                {
                    // z direction

                    basicEffect.DirectionalLight2.DiffuseColor = new Vector3(0, 0, 0.5f);
                    basicEffect.DirectionalLight2.Direction = Vector3.Normalize(new Vector3(0, 0, -1));
                    basicEffect.DirectionalLight2.SpecularColor = Vector3.One;
                }
            }

            vertexDeclaration = new VertexDeclaration(new VertexElement()
            {
                new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
                new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0),
                new VertexElement(24, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0)
            } );



            Vector3 topLeftFront = new Vector3(-1.0f, 1.0f, 1.0f);
            Vector3 bottomLeftFront = new Vector3(-1.0f, -1.0f, 1.0f);
            Vector3 topRightFront = new Vector3(1.0f, 1.0f, 1.0f);
            Vector3 bottomRightFront = new Vector3(1.0f, -1.0f, 1.0f);
            Vector3 topLeftBack = new Vector3(-1.0f, 1.0f, -1.0f);
            Vector3 topRightBack = new Vector3(1.0f, 1.0f, -1.0f);
            Vector3 bottomLeftBack = new Vector3(-1.0f, -1.0f, -1.0f);
            Vector3 bottomRightBack = new Vector3(1.0f, -1.0f, -1.0f);

            Vector2 textureTopLeft = new Vector2(0.0f, 0.0f);
            Vector2 textureTopRight = new Vector2(1.0f, 0.0f);
            Vector2 textureBottomLeft = new Vector2(0.0f, 1.0f);
            Vector2 textureBottomRight = new Vector2(1.0f, 1.0f);

            Vector3 frontNormal = new Vector3(0.0f, 0.0f, 1.0f);
            Vector3 backNormal = new Vector3(0.0f, 0.0f, -1.0f);
            Vector3 topNormal = new Vector3(0.0f, 1.0f, 0.0f);
            Vector3 bottomNormal = new Vector3(0.0f, -1.0f, 0.0f);
            Vector3 leftNormal = new Vector3(-1.0f, 0.0f, 0.0f);
            Vector3 rightNormal = new Vector3(1.0f, 0.0f, 0.0f);

            // Front face.
            cubeVertices = new VertexPositionNormalTexture(6);
            cubeVertices(0) = new VertexPositionNormalTexture(topLeftFront, frontNormal, textureTopLeft);
            cubeVertices(1) = new VertexPositionNormalTexture(bottomLeftFront, frontNormal, textureBottomLeft);
            cubeVertices(2) = new VertexPositionNormalTexture(topRightFront, frontNormal, textureTopRight);
            cubeVertices(3) = new VertexPositionNormalTexture(bottomLeftFront, frontNormal, textureBottomLeft);
            cubeVertices(4) = new VertexPositionNormalTexture(bottomRightFront, frontNormal, textureBottomRight);
            cubeVertices(5) = new VertexPositionNormalTexture(topRightFront, frontNormal, textureTopRight);
        }


        private void Window_ClientSizeChanged(Object sender, EventArgs e)
        {
        }

        /// 
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// 
        protected override void LoadContent()
        {






            // TODO: use this.Content to load your game content here
        }

        /// 
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// 
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        /// 
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// 
        /// Provides a snapshot of timing values.
        protected override void Update(GameTime gameTime)
        {
            KeyboardState keyboardState = Keyboard.GetState();

            if (keyboardState.IsKeyDown(Keys.Escape))
                Exit();

            base.Update(gameTime);
        }

        /// 
        /// This is called when the game should draw itself.
        /// 
        /// Provides a snapshot of timing values.
        protected override void Draw(GameTime gameTime)
        {        
            graphics.GraphicsDevice.Clear(Color.SteelBlue);

            RasterizerState rasterizerState1 = new RasterizerState();
            rasterizerState1.CullMode = CullMode.None;
            graphics.GraphicsDevice.RasterizerState = rasterizerState1;

            foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
            {
                pass.Apply();



                // does not work:
                graphics.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList,0,12);

                // also does not work: giving the error ArgumentOutOfRangeException for primitiveCount
                //graphics.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, cubeVertices,  0, 6);

            }

            base.Draw(gameTime);
        }

        protected override void OnExiting(Object sender, EventArgs args)
        {
            base.OnExiting(sender, args);

            // Stop the threads
        }
    }
}

Microsoft Project at MAC

I am trying to install MS Project on my Mac computer but it doesn't work. I need it for my class. Is it possible to install MS Project on IOS? It seems to be limited and I can't find a way to install the software. Any recommendation?

office365: is it possible to reject the installation of Office 365 offered by Microsoft updates?

On my Windows 10 Professional 64 an offer appeared, apparently from Microsoft, to update the computer. One of the suggested features was Office 365. I am still using Office 2003 and want to use it.
Also. Is there any chance to reject Office 365 but accept the update of other features?
If I accept the offered upgrade, would 365 destroy my previous 2003 version? If not, can I later uninstall 365 and 2003 will still work?
Fortunately, the offer also contained the possibility of postponing the installation.

microsoft excel: you need to search for a specific phrase in a cell and then search for another value in another table

Thanks for the help in advance!

I have a table full of campaign data. I need to write a function to see a column "IO Number" on Sheet 2, Column A, in this example "AM262" and then see on Sheet 1, Column C if that name appears. In this example it does, but it looks like this "IO-AM262". If so, go to Sheet 2, find the corresponding exchange rate in C2 and return it.

SO, look at S2, CA and find it at S1, CC and return S2, C1.

More complicated example: find KP1002 in S2, A40 in S1, C24 (text: 2020 | Q2 | Sage | MEA | ZA | Small | Social_SMBS_KP1002) and return R14.95 in S2, C40)

Microsoft Excel: Why don't I have the option to create a drop-down list in data validation?

I've already created many drop-down lists using data validation, but since a few days I can't. I don't understand what may have changed or how I can get it to work again.

When I click on data validation I get:

Data validation settings

And here are the options I get:

enter the image description here

What do I have to do to make it work?

microsoft excel: how to make a value field display the last value in a pivot table

I have a table like this:

enter the image description here

And I would like a pivot table like this:

enter the image description here

Except instead of displaying the sum of the quantity group by Region in the value field, I want to display the last value by date. For example, it will show 300 for Central, 1200 for East, and so on.

I look at the summary options for the value field, but it seems that such operation is not available.

Windows Server 2016: Google Chrome and Microsoft Edge Chrome crash instantly on startup

I have a single Windows server (Windows Server 2016/1607) that has peculiar problems with web browsers.

Both Google Chrome and Microsoft Edge Chrome crash instantly when launched and display the Aw Snap / / This Page is having a problem error respectively even when I open the about: chrome page.

IE11 on the other hand works perfectly.

I first thought it was the Chrome / Symantec bug from a couple of months ago, but I've already implemented company-wide policies to fix that particular problem.

I have tried the following:

  • Reinstall the latest version of Chrome
  • Install the latest version of Edge Chrome
  • Disable Symantec Endpoint Protection (SEP)
  • SEP update to 14.2.xxxx

Google G-Suite Marketplace: No Results: Can't add Chrome Remote Desktop or any Microsoft apps

Sorry if this is not the right place to ask this, but I can't find a better place.

I set up my users with Google G-Suite so they can use Chromebooks and Chrome Remote Desktop to work remotely when dealing with Corona.

I can access the market on Chromebooks that log in as users, but I can't find a way to add CRD and Microsoft apps to the library or computers. When I open marketplace on laptops, a blank page appears saying "No results". In G-Suite manager, when you try to add a service or an app, the market searches appear empty for the remote desktop of Microsoft and Chrome.

Any ideas where I'm going wrong?

no results

microsoft flow: how to show only values ​​in a copy of SharePoint custom list where values ​​are the result of selecting options from dropdown menu?

Ambient

From the Site Contents directory in SharePoint, I created a Custom List via New > App > Custom List.

I created my columns and added entries through the form associated with the list.

Some of the columns are of type Choice and configured to allow multiple selections.

For example:

Service Type:  
 - Groceries - Apples
 - Groceries - Oranges   
 - Groceries - General

(note: multiple options can be selected)    

Desired behavior

Copy a SharePoint list into a CSV file through a recurring Microsoft Flow based on this Microsoft template.

Current behavior

The flow I have created is working.

However, when I open the CSV in Excel, where the values ​​are the result of selecting options from a dropdown menu, the corresponding field has 4 columns (instead of just 1):

ServiceType
ServiceType@odata.type
ServiceType#Id  
ServiceType#Id@odata.type

with the corresponding values ​​of:


({"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":2,"Value":"Groceries - General"})



#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference)



(2) 



#Collection(Int64)

Question

How can I make sure that:

  • Only a single column is displayed for each dropdown field
  • Only values ​​are shown, instead of all 'markup' text from Microsoft

Flow:

enter the image description here
enter the image description here

onedrive for business – How to update Microsoft Form responses when values ​​are updated in the corresponding spreadsheet?

Desired behavior

  1. Public User A Microsoft Form submits filling a connected spreadsheet in real time.

  2. Company Users you can edit responses within the connected spreadsheet.

  3. The data presented in the Responses The Microsoft Forms interface tab reflects the updated values.

Current behavior

Currently after Company Users edit the spreadsheet, the data presented in the Responses Microsoft Forms interface tab shows data as originally entered, instead of displaying the new values.

Question

How can I make the data presented in the Responses Microsoft Forms interface tab shows updated values ​​from connected spreadsheet, instead of original sent values?

Steps to replicate

Create a form through:

OneDrive file list > New > Forms for Excel

This will forward you to the Microsoft Forms interface.

Click on the Responses tab and the Open in Excel link, which will create a spreadsheet where the responses are added in real time.

Edit values ​​in the responses in the connected spreadsheet.

Click on the Responses tab in the Microsoft Forms interface.

The data presented will reflect the values ​​as originally entered, rather than the updated values.