Implementation of setting multiple values ​​/ objects as valid / invalid

I have a kind of modal in which I have to display data (each represents an object). Any date can be set as valid or invalid. I wonder what the user interface should look like. I think about two options:

  • Radio buttons:
    Enter the image description here
  • Transfer list:
    Enter the image description here

    I'm not sure what's the best solution here. Of course I'm open to other ideas. Any advice from a UX perspective? πŸ™‚ πŸ™‚

Finite element method – FEM simulation: Networking any two objects in an "air" network

Based on this excellent answer to my previous question: FEM: Electric field between two arbitrarily defined forms

I wanted to try other shapes:

(*Define Boundaries*)
air = Rectangle({-5, -5}, {5, 5});
object1 = Rectangle({-2.5, 2.5}, {2.5, 2});
object2 = Rectangle({-2.5, -2.5}, {2.5, -2});
reg12 = RegionUnion(object1, object2);
reg = RegionDifference(air, reg12)

mesh = ToElementMesh(reg, {{-5, 5}, {-5, 5}}, 
  MeshRefinementFunction -> 
   Function({vertices, area}, 
    area > 0.001 (0.1 + 10 Norm(Mean(vertices)))))

But all I get is this:


When I use that Diskeverything works correctly as object 1:

Enter the image description here

So I asked myself: why doesn't it work with other shapes?

vuejs – Displays an array of objects that contain an array in Vue.js

I need to iterate over an array of objects that contain arrays in vue, but when I display them in a table, I can't access each one. I just start in vue js and don't know how to go about it this way

var App = new Vue({
    el: '#app',
            progresion: (
                    c: ('C', 'Dm', 'Em', 'F', 'G', 'Am', 'Bdim'),
                    d: ('D', 'Em', 'F#m', 'G', 'A', 'Bm', 'C#dim'),
                    e: ('E', 'F#m', 'G#m', 'A', 'B', 'C#m', 'D#dim'),
                    f: ('F', 'Gm', 'Am', 'Bb', 'C', 'Dm', 'Edim'),
                    g: ('G', 'Am', 'Bm', 'C', 'D', 'Em', 'F#dim'),
                    a: ('A', 'Bm', 'C#m', 'D', 'E', 'F#m', 'G#dim'),
                    b: ('B', 'C#m', 'D#m', 'E', 'F#', 'G#m', 'A#dim'),
                    Cm: ('Cm','Ddim','Eb','Fm','Gm','Ab','Bb'),
                    Dm: ('Dm','Edim','F','Gm','Am','Bb','C'),
                    Em: ('Em','F#dim','G','Am','Bm','C','D'),
                    Fm: ('Fm','Gdim','Ab','Bbm','Cm','Db','Eb'),
                    Gm: ('Gm','Adim','Bb','Cm','Dm','Eb','F'),
                    Am: ('Am','Bdim','C','Dm','Em','F','G'),
                    Bm: ('Bm','C#dim','D','Em','F#m','G','A')

        console: function(){
            return console.log(this.progresion(0).c(0))

When I run it on the console, it works fine, but when I try to view it with the v-for, an error appears
and I don't know how to show it properly

Nota Base Menor Menor Mayor Mayor Menor Disminuido
res(0).c(0) 24 Engineer Engineer Engineer Engineer Engineer

Unity ScrollRect many objects and animations in canvas

I actually have two questions. Which are connected to each other in my case.

  1. I have a correct scroll setup and over 1000 objects to scroll. I currently instantiate all 1000 objects at once and notice that fps are falling. I use 2D mask and Disbale Pixel perfectly. Both gave a boost in performance, but I still think the bottleneck is that I've already created 1000 objects on the scene. Instead, create what is visible to the eye.

What can I do? I looked in pools. But I couldn't get it to work with my setup. Where I loop onStart through the list of objects and then instantiate them.

  1. After solving the first question, I want to animate these objects. Since these are different player outfits with button components that you can click to buy. And buttons only work inside the canvas and the animator doesn't seem to work inside a canvas. But animate perfectly outside of a canvas.

Should I have these game objects (outfits) inside a canvas or should I have them outside the canvas and use Raycast to get onClick functionality. What is recommended in terms of performance.

Unit: How can collision detection with fast moving objects in 2D be fixed?

I did a simple pong game and it worked well until I tried to increase the speed of the ball. The ball occasionally moves over the walls at increased speed. I have no rigid body for walls and dynamic rigid body for players and the ball. Certainly everyone has colliders. I also check the collision OnTriggerEnter2D and all colliders are triggers. How can I solve this problem apart from hard coding collisions?

Virtual machine – How do VMs and GCs treat objects that still contain active resources but cannot be reached by user code?

I'm building an interpreter in C for a simple programming language.

The interpreter is equipped with a built-in garbage collector. The GC simply marks all objects that are linked from a master (call stack, evaluation stack, loaded modules, etc.) and collects the rest.

I am now writing an extension DLL for the interpreter. The DLL "packs" another C library for graphics (SDL). This library creates objects that represent operating system resources, e.g. B. graphic windows. Now I have to think about how the interpreter and the GC integrate correctly into the "outside world".

In the current situation you could write the following code in my language and it will work fine:

import graphics
window = graphics.new_window()
# ... all the rest

However, the following code is likely to cause problems:

import graphics

Since the result of new_window() will not be saved anywhere, eventually the GC will collect them Window Object. When picking up the Window The object returns the native resources as part of it to the operating system deallocate Implementation called by the GC.

I'm not sure if this is reasonable behavior for a programming language. On the one hand, there is little point in losing the window if we lose the reference to the window.

However, if I remember correctly – in Java (and I assume we can find equivalent examples in most languages), it is common and legal to write code like the following (pseudo-Java):

public void makeWindow() {
    new JFrame();

This would create a GUI window that will appear on the screen and remain visible. And as you can see, the JFrame Object is not saved anywhere. However, the GC won't capture it (or at least not the operating system resource JFrame persumebly wraps).

What is the standard way to implement this in a voice VM?

The only approach I can think of right now is that objects that wrap native resources do Not Release these resources when the GC claims them. The only way to release these resources would be to explicitly call the user code at a dispose Method for the object. Which approach is standard in VM implementations?

c ++ – Drawing outlines around 2D objects OpenGL

I am trying to use OpenGL and shaders to draw an outline around any object, using a different color than the original object, while maintaining compatibility with alpha values ​​<1. I'm just trying to get this to work with just a rectangle. I tried to use x, y, width, and height to determine, but they could not be transformed using view and projection matrices. Using triangles will render a regular rectangle, but I can't figure out how to create an outline around it. While creating a 2D engine, it is important to me to be able to transform into 3D (e.g. rotate the object on all three axes while keeping the outline but no 3D objects are rendered).

Here is my current vertex array:

float vertices(8) = {
    0.5f,  0.5f,
    0.5f, -0.5f,
   -0.5f, -0.5f,
   -0.5f,  0.5f

Here is my vertex shader:

#version 330 core

layout (location = 0) in vec2 inPos;

uniform mat4 transform;
uniform mat4 view;
uniform mat4 projection;

uniform vec4 vsColor;
uniform float vsOutline;
uniform vec4 vsOutlineColor;

out VS_OUT {
    vec4 color;
    vec4 outlineColor;
    float outlineWidth;
} vs_out;

void main() {
    gl_Position = projection * view * transform * vec4(inPos, 0.0, 1.0);
    vs_out.color = vsColor;
    vs_out.outlineColor = vsOutlineColor;
    vs_out.outlineWidth = vsOutline;

Here is my geometry shader, which currently only works as a pass-through:

#version 330 core

layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;

out vec4 fsColor;

in VS_OUT {
    vec4 color;
    vec4 outlineColor;
    float outlineWidth;
} gs_in();

void main() {
    // Draw main triangle (passthrough)
    fsColor = gs_in(0).color;
    gl_Position = gl_in(0).gl_Position;
    gl_Position = gl_in(1).gl_Position;
    gl_Position = gl_in(2).gl_Position;

    // ===UNKNOWN===
    // Outline the object (WIP)
    fsColor = gs_in(0).outlineColor;


Finally my fragment shader:

#version 330 core

in vec4 fsColor;

out vec4 fragColor;

void main() {
    fragColor = fsColor;

    if (fragColor.a == 0) discard;

I'm not sure if I need to create contours in the geometry or fragment shader. I would like an implementation that could work with non-regular forms (like sprites), but this is not currently required. However, it has to work with other shapes like circles and triangles.

Here is a picture of the current condition of my engine, outlining the pink rectangle:
Motor screenshot

The box texture shows how objects can be transformed in the game and how important alpha compatibility is.

c # – Unity, check if all objects marked with GameObject are destroyed

Hello, I'm a total noob, so please don't blame me.
I have this code, but can't find a suitable answer on how to check whether everything marked "Target1" has been destroyed. Most of the answers are either over-complicated or certainly too stupid

public Transform teleportTarget;
public GameObject thePlayer;
public Transform() spawnLocations;
public GameObject() whatToSpawnPrefab;
public GameObject() whatToSpawnClone;

void spawnTargets()
    whatToSpawnClone(0) = Instantiate(whatToSpawnPrefab(0), spawnLocations(0).transform.position, Quaternion.Euler(0, 180, 0)) as GameObject;
    whatToSpawnClone(1) = Instantiate(whatToSpawnPrefab(1), spawnLocations(1).transform.position, Quaternion.Euler(0, 180, 0)) as GameObject;
    whatToSpawnClone(2) = Instantiate(whatToSpawnPrefab(2), spawnLocations(2).transform.position, Quaternion.Euler(0, 180, 0)) as GameObject;
    whatToSpawnClone(3) = Instantiate(whatToSpawnPrefab(3), spawnLocations(3).transform.position, Quaternion.Euler(0, 180, 0)) as GameObject;

private void TeleportPlayer()
    thePlayer.transform.position = teleportTarget.transform.position;

I'm just looking for a way to check that all GameObjects are marked with "Target1" (throughout the game)
are destroyed and then to SpawnTargets and TeleportPlayer.
Previously, I had the bug that they were no longer checked during respawn. It has to be checked all the time. Because otherwise I get stuck because the teleport teleports me all the time. I hope you understand what i mean

I know this is an easy question, but I'm a noob and I'm sorry I wasted your time. Still, I hope you can help me.

java – Does an anonymous inner class use the behavior of game objects correctly?

I am developing a small game that contains a number of different items. I categorize the items into separate classes (consumables, armor, weapons), all of which expand the Item.class. Then I use a main element class, where I basically initialize all the elements and give them their values ​​and sprite files. I also want to give some elements a different behavior. For example, a potion that teleports you, or a potion that makes you stronger. I don't want to create separate classes for each element with different behavior. So now I'm thinking about using an anonymous inner class. The class is only instantiated once.

This is how my simple item class looks:

public class Items implements Iterable{
    private static ArrayList items = new ArrayList();

    public Iterator iterator() {
        return items.iterator();

    public static Item getItem(int id) {
        return items.get(id).clone();

    public static void initialize() {
        addItem(new Armor(0, 1, "Leather Helmet", "Leather_Helmet.png", 30));
        addItem(new Consumable(1, 16, "Apple", "Apple.png", 30));
        addItem(new Consumable(2, 1, "Strength Potion", "Strength_Potion.png", 0) {
            public void consume(Player player) {
                // Do potion stuff

    public static void addItem(Item item) {
        items.add(item.getId(), item);

With the initialize () method, I basically load all different objects into the game. The third point is where I use an anonymous inner class. Is this the "right" way to deal with things? Let me know how I could handle it differently.

Java – concatenate multiple objects in the spring boot

Hello, I'm trying to send an SMS with Twilio API using Spring Boot. I am stuck to chain several objects of my model in one object … bcuz MessageCreator creator = Message.creator (to, from, message); Only the sender's, recipient's phone number and a message are required! But I have other objects to pass in the routed form entries in the frontend.

I have this in my model:
private final string phoneNumber;

private final String age;

private final String gender;

private final String mailAddress;

private final String message;

public SmsRequest(@JsonProperty("phoneNumber") String phoneNumber,
                  @JsonProperty("age") String state,
                  @JsonProperty("gender") String country,
                  @JsonProperty("mailAddress") String physicalAddress,
                  @JsonProperty("message") String message
                  ) {
    this.phoneNumber = phoneNumber;
    this.age = age;
    this.gender = gender;
    this.mailAddress = mailAddress;
    this.message = message;

And in my service;

public void sendSms(SmsRequest smsRequest) {
        PhoneNumber to = new PhoneNumber(smsRequest.getPhoneNumber());
        PhoneNumber from = new PhoneNumber(twilioConfiguration.getTrialNumber());

        String age = smsRequest.getAge();
        String gender = smsRequest.getGender();
        String mailAddress = smsRequest.getMailAddress();

        String message = smsRequest.getMessage()  + "n age: " + age + "n gender: " + gender
                + "n mailAddress: " + mailAddress ;

        MessageCreator creator = Message.creator(to, from, message);


And so I tested with Postman, it just records the phone number, it means that the other linked objects shouldn't be empty.

"phoneNumber": "010010101",
"Embassy" : (
"Age": "twenty five",
"Gender Female",
"mailAddress": "test"

Sorry if I made a noob mistake – "