sharepoint online – Create a content type which can be used on every websitecollection

Stack Exchange Network


Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

table – How can I create a list that always ends in with two 1’s but starts with a variable amount of 0’s

I want to create a variable list like this:

{0, 0, ..., 0, 0, 1, 1}

This list would grow list this, starting with no 0’s, but then gaining more 0’s to the left the larger you want it.

f[0]:={1,1}

f[1]:={0,1,1}

f[2]:={0,0,1,1}

f[3]:={0,0,0,1,1}

f[4]:={0,0,0,0,1,1}

I know that I can create Table[] to create ten 0 by doing

Table[0, 10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

but not an efficient way to have it so that the last two digits are 1.

game design – Is it better to create a scene in blender or in unity?

First of all, I am really new to all of this. This is my first time so its really confusing me if it’s better to create a scene and then import it into Unity or is it better to just create objects like chracters, chairs in blender and scenes in Unity? I just want to recreate a scene of my school and include it in my final project as a Unity game where it will have no function other than walking around and some jumping and fighting? Because my project is not based on the game, it will just help it.

c# – DropDownList para el menú Create,

Quisiera saber que tengo que cambiar actualmente en mi modelo, vista y/o controlador para poder ver los datos a través de un dropdownlist de Organos y Puestos en lugar de solicituar el id de estos.
aquí les dejo mi controlador, la vista y el modelo que tengo para el tipo de edit que tengo actualmente.

Esta es la parte del código en mi controlador en el cual estoy manejando el get y el post para el edit

public ActionResult Editar(int Id)
    {
        EditEmpleadosViewModel model = new EditEmpleadosViewModel();
        using (var db = new sir_cjfEntities())
        {
            var oUser = db.empleados.Find(Id);
            model.Nombre = oUser.nombre;
            model.ApPaterno = oUser.ap_paterno;
            model.ApMaterno = oUser.ap_materno;
            model.Organo = oUser.id_organo;
            model.Puesto = oUser.id_puesto;
            model.ID = oUser.id_empleado;
            model.ID = oUser.id_empleado;
        }
        return View(model);
    }
    (HttpPost)
    public ActionResult Editar(EditEmpleadosViewModel model)
    {
        if (!ModelState.IsValid)
        {
            return View(model);
        }
        using (var db = new sir_cjfEntities())
        {
            var oUser = db.empleados.Find(model.ID);
            oUser.nombre = model.Nombre;
            oUser.ap_paterno = model.ApPaterno;
            oUser.ap_materno = model.ApMaterno;
            oUser.id_organo = model.Organo;
            oUser.id_puesto = model.Puesto;

            if (model.Password != null && model.Password.Trim() != "")
            {
                oUser.contrasena = model.Password;
            }
            db.Entry(oUser).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
        }

        return Redirect(Url.Content("~/User/"));
    }

Mi modelo esta solicitando en los capos de Órgano y Puesto los int “ya que son las FK” pero supongo que tendria que cambiarlas a string porque lo que quiero llegar a pedir es el nombre del estos a traves del id

public class EditEmpleadosViewModel
{
    public int ID { get; set; }

    (Required)
    (StringLength(25, MinimumLength = 1))
    (Display(Name = "Nombre"))
    public string Nombre { get; set; }

    (Required)
    (StringLength(25, MinimumLength = 1))
    (Display(Name = "Apellido paterno"))
    public string ApPaterno { get; set; }

    (Required)
    (StringLength(25, MinimumLength = 1))
    (Display(Name = "Apellido Materno"))
    public string ApMaterno { get; set; }

    (Required)
    public int Organo { get; set; };
    (Required)
    public int Puesto { get; set; };

    (Required)
    (StringLength(25, MinimumLength = 1))
    (Display(Name = "Nombre de Usuario"))
    public string Usuario { get; set; }

    (Display(Name = "Contraseña"))
    (StringLength(25, ErrorMessage = "La {0} debe de contener al menos {2} caracteres", MinimumLength = 5))
    /*(RegularExpression(@"(?=.*W)?(?=.*d)", ErrorMessage = "Debe de Contener al menos "))*/
    (DataType(DataType.Password))
    public string Password { get; set; }

    (Display(Name = "Confirmar Contraseña"))
    (Compare("Password", ErrorMessage = "La contraseñas no coinciden"))
    public string ConfirmPassword { get; set; }
}

Intente cambiar @Html.TextBoxFor(d => d.Organo, new { @class = “form-control” }) por @html.DropDownListFor pero no se si solo haciendo esto baste para coneguir lo que quisiera.

@model SistemadeInformaciónRegional.Models.ViewModels.EditEmpleadosViewModel
@{
    ViewBag.Title = "Edición de Usuarios";
}

<h2>@ViewBag.Title</h2>

<div class="row">
    <div class="col-md-12">

        @using (Html.BeginForm("Editar", "CEmpleados", FormMethod.Post, new { }))
        {
            @Html.HiddenFor(d => d.ID)
            @Html.AntiForgeryToken()
            @Html.ValidationMessage("Error", new { @class = "text-danger" })

            @Html.LabelFor(d => d.Nombre)
            @Html.TextBoxFor(d => d.Nombre, new { @class = "form-control" })
            @Html.ValidationMessage("Nombre", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.ApPaterno)
            @Html.TextBoxFor(d => d.ApPaterno, new { @class = "form-control" })
            @Html.ValidationMessage("ApPaterno", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.ApMaterno)
            @Html.TextBoxFor(d => d.ApMaterno, new { @class = "form-control" })
            @Html.ValidationMessage("ApMaterno", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.Organo)
            @Html.TextBoxFor(d => d.Organo, new { @class = "form-control" })
            @Html.ValidationMessage("Órgano o Área", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.Puesto)
            @Html.TextBoxFor(d => d.Puesto, new { @class = "form-control" })
            @Html.ValidationMessage("Puesto", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.Usuario)
            @Html.TextBoxFor(d => d.Usuario, new { @class = "form-control" })
            @Html.ValidationMessage("Usuario", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.Password)
            @Html.PasswordFor(d => d.Password, new { @class = "form-control" })
            @Html.ValidationMessage("Password", new { @class = "text-danger" })
            <br />
            @Html.LabelFor(d => d.ConfirmPassword)
            @Html.PasswordFor(d => d.ConfirmPassword, new { @class = "form-control" })
            @Html.ValidationMessage("ConfirmPassword", new { @class = "text-danger" })
            <br />
            <div style="text-align:right;">
                <input type="submit" class="btn btn-success" value="Aplicar Edición" />
            </div>
        }
    </div>
</div>

physics – Trying to create a knockback effect between 2 squares (Code in Java)

I’ve been in trouble for weeks now and I don’t understand why it doesn’t work for me! I have tried so many things and I just can not understand.

I try to get one player to get a knockback as soon as another player collide with him. But for some reason the result of this is weird. Here’s the code so you can understand how my physics engine works and the collision detection mechanism.

A little background: I started learning game development a month ago and mainly writing game engines, I don’t have that much background in math, I know overall connection, subtraction, multiplication, division and some fractions. I learned the basics of advanced programming and programming – data structures, algorithms, concurrency, networks, file management and the like.

Now I have been trying for a long time to write a good Collision detection mechanism and physics engine. Now what I was trying to do in the current code is make Player1 fly back when Player1 collides with it. And it works .. But when one player pushes another or makes it fly back, such a strange space is created between them. I would be very grateful if you could read the code and try it out and tell me what I can fix or teach me how to write the engine better.

import java.awt.EventQueue;

import javax.swing.JFrame;

public class Launcher extends JFrame {

    private static final long serialVersionUID = 1L;

    public Launcher() {
        add(new GamePanel());
        
        setTitle("Game Engine");
        
        setResizable(false);
        pack();
        setLocationRelativeTo(null);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }
    
    public static void main(String() args) {
        EventQueue.invokeLater(() -> {
            Launcher launcher = new Launcher();
            launcher.setVisible(true);
        });
    }
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.ArrayList;

import javax.swing.JPanel;

public class GamePanel extends JPanel implements Runnable {

    private static final long serialVersionUID = 1L;

    private final int WIDTH = 800, HEIGHT = 600;
    
    private ArrayList<Entity> entities;
    
    private Player player1;
    private Player player2; 
    
    private Camera camera;
    
    private Thread thread;
    
    public GamePanel() {
        addKeyListener(new KeyListener1());
        addKeyListener(new KeyListener2());
        setPreferredSize(new Dimension(WIDTH, HEIGHT));
        setFocusable(true);
        requestFocus();
    
        entities = new ArrayList<Entity>();
        
        for (int i = 0; i < 100; i++)
            entities.add(new Block(this, i * 60, 500, 60, 60));
        
        player1 = new Player(this, 120, 100, 60, 100);
        player2 = new Player(this, 120 * 3, 100, 60, 100);
        
        entities.add(player1);
        entities.add(player2);
        
        camera = new Camera(this);
        
        thread = new Thread(this, "Game Engine - Main Thread");
        thread.start();
    }
    
    public Camera getCamera() {
        return camera;
    }
    
    public int getWidth() {
        return WIDTH;
    }
    
    public int getHeight() {
        return HEIGHT;
    }
    
    public ArrayList<Entity> getEntities() {
        return entities;
    }
    
    public Player getPlayer1() {
        return player1;
    }

    public Player getPlayer2() {
        return player2;
    }

    /*
     * 
     * Player2 is getting farther before Player1 reaching him and getting to 0 pixels between them
     * 
     * But in the other hand, he pushes him in non realistic way
     * 
     */
    public void tick() {
        player1.tick();
        player2.tick();
    }
    
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
    
        for (Entity entity : entities)
            entity.draw(g);
        player1.draw(g);
        player2.draw(g);
    }
    
    public void run() {
        while (true) {
            tick();
            repaint();
            
            try {
                Thread.sleep(16);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
    
    public class KeyListener1 extends KeyAdapter {
        
        public void keyPressed(KeyEvent e) {
            int key = e.getKeyCode();
            
            if (key == KeyEvent.VK_D) player1.setRight(true);
            if (key == KeyEvent.VK_A) player1.setLeft(true);
        }
    
        public void keyReleased(KeyEvent e) {
            int key = e.getKeyCode();
            
            if (key == KeyEvent.VK_D) player1.setRight(false);
            if (key == KeyEvent.VK_A) player1.setLeft(false);
        }
    }
    
    public class KeyListener2 extends KeyAdapter {
        
        public void keyPressed(KeyEvent e) {
            int key = e.getKeyCode();
            
            if (key == KeyEvent.VK_RIGHT) player2.setRight(true);
            if (key == KeyEvent.VK_LEFT) player2.setLeft(true);
        }
    
        public void keyReleased(KeyEvent e) {
            int key = e.getKeyCode();

            if (key == KeyEvent.VK_RIGHT) player2.setRight(false);
            if (key == KeyEvent.VK_LEFT) player2.setLeft(false);
        }
    }
}
import java.awt.Graphics;
import java.awt.Rectangle;
import java.util.ArrayList;

public abstract class Entity {

    protected GamePanel gp;

    protected int x;
    protected int y;
    
    protected int xDir;
    protected int yDir;
    
    protected int width;
    protected int height;
    
    protected double xVel;
    protected double yVel;
    
    protected Rectangle hitbox;
    
    public Entity(GamePanel gp, int x, int y, int width, int height) {
        this.gp = gp;

        this.x = x;
        this.y = y;
        
        xDir = 0;
        yDir = 0;
        
        this.width = width;
        this.height = height;
        
        xVel = 0;
        yVel = 0;
        
        hitbox = new Rectangle(x, y, width, height);
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getxDir() {
        return xDir;
    }

    public void setxDir(int xDir) {
        this.xDir = xDir;
    }

    public int getyDir() {
        return yDir;
    }

    public void setyDir(int yDir) {
        this.yDir = yDir;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public double getxVel() {
        return xVel;
    }

    public void setxVel(double xVel) {
        this.xVel = xVel;
    }

    public double getyVel() {
        return yVel;
    }

    public void setyVel(double yVel) {
        this.yVel = yVel;
    }

    public Rectangle getHitbox() {
        return hitbox;
    }

    public void setHitbox(Rectangle hitbox) {
        this.hitbox = hitbox;
    }
    
    public void collisionDetection() {
        ArrayList<Entity> entities = gp.getEntities();      
        hitbox.x += xVel;
        
        for (Entity entity : entities) {
            if (hitbox.intersects(entity.getHitbox()) && !entity.equals(this)) {
                hitbox.x -= xVel;
                                
                if (entity instanceof Player) {
                    Player player = (Player) entity;
                    player.setCollidingWithPlayer(true);
                    
                    if (xDir == 1)
                        player.setxVel(7);
                    else
                        player.setxVel(-7);
                }
                
                while (!hitbox.intersects(entity.getHitbox())) hitbox.x += Math.signum(xVel);
                hitbox.x -= Math.signum(xVel);
                xVel = 0;
                x = hitbox.x;
            }
        }
        hitbox.y += yVel;
        
        for (Entity entity : entities) {
            if (hitbox.intersects(entity.getHitbox()) && !entity.equals(this)) {
                hitbox.y -= yVel;
                
                while (!hitbox.intersects(entity.getHitbox())) hitbox.y += Math.signum(yVel);
                hitbox.y -= Math.signum(yVel);
                yVel = 0;
                y = hitbox.y;
            }
        }
    }
    
    public abstract void tick();
    
    public abstract void draw(Graphics g);
}
import java.awt.Color;
import java.awt.Graphics;

public class Block extends Entity {

    public Block(GamePanel gp, int x, int y, int width, int height) {
        super(gp, x, y, width, height);
    }

    public void tick() {
        
    }

    public void draw(Graphics g) {
        g.setColor(Color.black);
        g.drawRect(x - gp.getCamera().getxOffset(), y, width, height);
        
        g.setColor(Color.white);
        g.fillRect(x + 1 - gp.getCamera().getxOffset(), y + 1, width - 1, height - 1);
    }
}
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

public class Player extends Entity {
        
    private boolean right;
    private boolean left;
    
    private boolean collidingWithPlayer;
    private int timer;
    
    public Player(GamePanel gp, int x, int y, int width, int height) {
        super(gp, x, y, width, height);
        
        right = false;
        left = false;
        
        collidingWithPlayer = false;
        timer = 0;
    }

    public boolean isCollidingWithPlayer() {
        return collidingWithPlayer;
    }

    public void setCollidingWithPlayer(boolean collidingWithPlayer) {
        this.collidingWithPlayer = collidingWithPlayer;
    }

    public boolean isRight() {
        return right;
    }

    public void setRight(boolean right) {
        this.right = right;
    }

    public boolean isLeft() {
        return left;
    }

    public void setLeft(boolean left) {
        this.left = left;
    }

    public void tick() {
        if (right && left || !right && !left) {
            if (!collidingWithPlayer)
                xVel = 0;
        } else if (right && !left) {
            xVel = 7;
            xDir = 1;
        } else if (!right && left) {
            xVel = -7;
            xDir = -1;
        }
        yVel += 0.3;

        if (collidingWithPlayer) {          
            timer++;
            
            if (timer % 5 == 0)
                xVel -= Math.signum(xVel);
            
            if (xVel == 0) {
                timer = 0;
                collidingWithPlayer = false;
            }
        }
        collisionDetection();
        
        x += xVel;
        y += yVel;
        
        hitbox.x = x;
        hitbox.y = y;   
        
        if (this.equals(gp.getPlayer1()))
            gp.getCamera().focus(this);
    }

    public void draw(Graphics g) {
        g.setColor(Color.black);
        g.fillRect(x - gp.getCamera().getxOffset(), y, width, height);
        
        g.setColor(Color.pink);
        g.setFont(new Font("Ariel", Font.BOLD, 12));
        //g.drawString("" + weight, x, y + width / 2);
        //g.drawString("Kilograms", x, y + width / 2 + 20);
    }
}
public class Camera {

    private GamePanel gp;
    
    private int xOffset;
    
    public Camera(GamePanel gp) {
        this.gp = gp;
        xOffset = 0;
    }

    public int getxOffset() {
        return xOffset;
    }

    public void setxOffset(int xOffset) {
        this.xOffset = xOffset;
    }
    
    public void focus(Player player) {
        xOffset = player.getX() - gp.getWidth() / 2 + player.getWidth() / 2;
    }
}

I do not know if it is acceptable to insert a link to Git but I will insert anyway. You can download the code from here:

https://github.com/RDev16/Game

updating – Can’t create an Article after an update to Drupal 9.0.2

I have updated from 8.9.2., which had no errors, manually, to Drupal 9.02. – everything ran smoothly, db updates, cash clear, etc. No error logs. But when trying to create a standard Article, the core library gives me the following in the Display Error Alert:

quote “The website encountered an unexpected error. Please try again later.
Error: Call to a member function getAccountName() on null in DrupalnodeNodeForm->form() (line 155 of core/modules/node/src/NodeForm.php).
quote
DrupalnodeNodeForm->form(Array, Object) (Line: 106)
DrupalCoreEntityEntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 532)
DrupalCoreFormFormBuilder->retrieveForm(‘node_article_form’, Object) (Line: 278)
DrupalCoreFormFormBuilder->buildForm(Object, Object) (Line: 73)
DrupalCoreControllerFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
DrupalCoreEventSubscriberEarlyRenderingControllerWrapperSubscriber->DrupalCoreEventSubscriber{closure}() (Line: 573)
DrupalCoreRenderRenderer->executeInRenderContext(Object, Object) (Line: 124)
DrupalCoreEventSubscriberEarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
DrupalCoreEventSubscriberEarlyRenderingControllerWrapperSubscriber->DrupalCoreEventSubscriber{closure}() (Line: 158)
SymfonyComponentHttpKernelHttpKernel->handleRaw(Object, 1) (Line: 80)
SymfonyComponentHttpKernelHttpKernel->handle(Object, 1, 1) (Line: 57)
DrupalCoreStackMiddlewareSession->handle(Object, 1, 1) (Line: 47)
DrupalCoreStackMiddlewareKernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupalpage_cacheStackMiddlewarePageCache->pass(Object, 1, 1) (Line: 85)
Drupalpage_cacheStackMiddlewarePageCache->handle(Object, 1, 1) (Line: 47)
DrupalCoreStackMiddlewareReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
DrupalCoreStackMiddlewareNegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
StackStackedHttpKernel->handle(Object, 1, 1) (Line: 705)
DrupalCoreDrupalKernel->handle(Object) (Line: 19)”

Can’t get the Name properly, what is exactly causing it? My modules, Schema org, 3-16x (the latest), Meta – the latest and Goog Analytics – the latest. Standard Bartik theme.

I will create and set up your facebook business page for $35

I will create and set up your facebook business page

Welcome to my SOCIAL MEDIA MANAGER SERVICES

As you know facebook is the largest online platform to influence your business. So I am here to help you to create a facebook business page for promoting your business. I’m an expert facebook business page creator and have more than 4 years of working experience in this sector. As a social media manager, I ensure that you will be 100% satisfied with my service.

Service List :

  • Fb business page create and optimization
  • Facebook business page Development
  • Call to action set up or CTA button integration
  • Custom page URL setting
  • All custom tabs
  • Automated response
  • Website integration
  • Shop integration
  • Chat bot
  • Add logo/cover photo ( For Standard )
  • Add products
  • Add full details of your business

Why Me:-

  • I’m professional and more experience
  • Provide report and screenshot
  • Design eye-catching cover photo
  • 100% satisfaction guarantee
  • Timely deliver
  • 24/7 friendly communication

So if you need to create facebook business page or fb fan page please click the order button now and let me know what is your requirement.

thank you! Looking forward to working with you.

Regard

Fahim Shahriar

.(tagsToTranslate)facebookmarketin(t)facebookpage(t)socialmedia(t)optimize(t)fbbusinesspage

2d – Trying to create a knockback effect between 2 squares (Code in Java)

I’ve been in trouble for weeks now and I don’t understand why it doesn’t work for me! I have tried so many things and I just can not understand.

I try to get one player to get a knockback as soon as another player collide with him. But for some reason the result of this is weird. Here’s the code so you can understand how my physics engine works and the collision detection mechanism.

I do not know if it is acceptable to insert a link to Git but I will insert anyway. This is the code:

https://github.com/RDev16/Game

I will create premium one product shopify dropshipping store for $80

I will create premium one product shopify dropshipping store

Complete One Product Shopify Dropshipping Store Ready to Instant Sales

I am One Product Shopify Dropshipping Store Expert with all necessary skills required to build a complete and professional one product Shopify Dropshipping store or Shopify Store.

Benefits of a One Product Shopify store?

Focus – Being only one product, You can put all your efforts and time testing various videos and targeting to make huge profits.

High Conversion Rate – Having similar domain name, logo, Product name will result in high conversion rate.


You Will Get:

  • Professional logo
  • High converting one product Shopify theme
  • Responsive design
  • One winning product
  • Engaging homepage content
  • Stunning Description, Gif images, High converting Video
  • High-quality Customized Video For ADs
  • Product Review
  • Create Discount Code
  • Sales Channel setup
  • Conversion boosters (Social proof, countdown timer, etc)
  • Order fulfillment & tracking
  • Customer testimonials
  • Full Store SEO
  • Marketing blueprint

One product shopify store is all about positioning and branding. If you don’t do this right, your business is going to suffer.

Get in touch with me now!

.(tagsToTranslate)Shopify(t)Store(t)dropship(t)Dropshipping(t)One(t)product

2.3 how create guest order on backoffice

  1. Is it possible to create a guest order from the admin panel? It always ask for a customer or creates a new one, some customer just want to order without an account and that’s possible on store front, why not possible on admin? or am I missing some config?

  2. Why when orders are created on admin panel magento don’t send a new order email? I know email sendig is working fine because in storefront it sends the email

Thanks 😀