ios – Scaling Assets for Consistency issues on the iPhone XS and the iPhone XS Max

I'm struggling to scale assets between the iPhone X / XS and the iPhone XS Max (including iPhone 8 vs 8 Plus) properly. I would like the asset to be proportionately scaled across the different screen sizes.

To my knowledge, both X / XS and XS Max are used 3x Assets, however, differ in screen resolution: 375pt for X / XS and 414pt for XS max. I designed the asset on Sketch 375pt Width to scale properly 3x on the iPhone X / XS. The asset will display properly on X / XS, but will remain the same size on the XS Max instead of scaling proportionally on the larger display.

I also tried to change the size of the asset 414pt width, but this leads to the opposite result: Looks right on the XS Max, but too big on the X / XS instead of scaling down to be proportional.

I expect that from both screen sizes:
Asset scaled correctly

But I can see that on XS Max (Plus):
Asset not scaled

Ignore the image heights and see how the XS Max asset maintains the same size instead of scaling proportionally?

It seems I could force the assets to scale the XS Max by code by going through each asset and manually scaling it. However, I assume that it should be automatic and I am doing something wrong.

java – Libgdx Box2d TiledMap Scaling

I think I'm doing something completely wrong, but I just do not seem to handle the Box2d pixel-per-meter conversion. Currently I have a tiled map with an object plane that I want to use as a collision box. I have one class to turn the object plane into shapes, and another to turn the units into meters. The problem I have is that I can only get the boxes with the correct size on my card if the pixels are set to 1: 1 per meter.

In the constructor for my level class, I have the following to create all box2d objects:

World = new world (new Vector2 (0f, -9.8f), true);
MapObjects objects = map.getLayers (). Get (collisions). GetObjects ();
for (MapObject object: objects) {
if (object instance of TextureMapObject) {
continue;
}

Shape mold;

if (object instance of RectangleMapObject) {
shape = ShapeFactory.getRectangle ((RectangleMapObject) object);
} else if (object instance of PolygonMapObject) {
shape = ShapeFactory.getPolygon ((PolygonMapObject) object);
} else if (object instance of PolylineMapObject) {
shape = ShapeFactory.getPolyline ((PolylineMapObject) object);
} else if (object instance of CircleMapObject) {
shape = ShapeFactory.getCircle ((CircleMapObject) object);
} else {
continue;
}

BodyDef bodyDef = new BodyDef ();
bodyDef.type = BodyDef.BodyType.StaticBody;
Body body = world.createBody (bodyDef);
body.createFixture (Form, 1);

shape.dispose ();
}
BodyDef bodyDef = new BodyDef ();
bodyDef.type = BodyDef.BodyType.DynamicBody;
bodyDef.position.set (x, y);
Body body = world.createBody (bodyDef);

FixtureDef fdef = new FixtureDef ();
PolygonShape-Shape = new PolygonShape ();
shape.setAsBox (16,16);
fdef.shape = form;
fdef.density = 1.0f;
fdef friction = 0.3f;
fdef restitution = 0.6f;
body.createFixture (fdef);


debugRenderer = new Box2DDebugRenderer ();

This invokes methods in my shapeFactory class that convert MapObjects to shapes.

Package Utils;

import com.badlogic.gdx.maps.objects.CircleMapObject;
import com.badlogic.gdx.maps.objects.PolygonMapObject;
import com.badlogic.gdx.maps.objects.PolylineMapObject;
import com.badlogic.gdx.maps.objects.RectangleMapObject;
import com.badlogic.gdx.math.Circle;
import com.badlogic.gdx.math.Polygon;
import com.badlogic.gdx.math.Polyline;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.ChainShape;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.PolygonShape;

public senior class ShapeFactory {

private ShapeFactory () {}

public static PolygonShape getRectangle (RectangleMapObject rectangularObject) {
return getRectangle (triangleObject.getRectangle ());
}

public static PolygonShape getRectangle (Rectangular rectangle) {
PolygonShape Polygon = new PolygonShape ();

Vector2 size = new Vector2 (
Physics.toUnits (rectangle.x + rectangle.width * 0.5f),
Physics.toUnits (Rectangle.y + Rectangle.Height * 0.5f)
);

polygon.setAsBox (
Physics.toUnits (rectangle width * 0.5f),
Physics.toUnits (rectangle.height * 0.5f),
Size,
0,0f
);

Return polygon;
}

public static CircleShape getCircle (CircleMapObject circleObject) {
return getCircle (circleObject.getCircle ());
}

public static CircleShape getCircle {circle} {
CircleShape circleShape = new CircleShape ();
circleShape.setRadius (Physics.toUnits (circle.radius));
circleShape.setPosition (new Vector2 (Physics.toUnits (circle.x), Physics.toUnits (circle.y)));

return circleShape;
}

public static PolygonShape getPolygon (PolygonMapObject polygonObject) {
return getPolygon (polygonObject.getPolygon ());
}

public static PolygonShape getPolygon (polygon polygon) {
PolygonShape polygonShape = new PolygonShape ();

hover[] vertices = polygon.getTransformedVertices ();
hover[] worldVertices = new float[vertices.length];

for (int i = 0; i <vertices.length; ++ i) {
worldVertices[i] = Physics.toUnits (nodes)[i]);
}

polygonShape.set (worldVertices);

return polygon shape;
}

public static ChainShape getPolyline (PolylineMapObject polylineObject) {
return getPolyline (polylineObject.getPolyline ());
}

public static ChainShape getPolyline (polyline) {
ChainShape chain = new ChainShape ();

hover[] vertices = polyline.getTransformedVertices ();
vector2[] worldVertices = new Vector2[vertices.length / 2];

for (int i = 0; i <vertices.length / 2; ++ i) {
worldVertices[i] = new Vector2 ();
worldVertices[i].x = Physics.toUnits (vertices)[i * 2]);
worldVertices[i].y = Physics.toUnits (vertices)[i * 2 + 1]);
}

chain.createChain (worldVertices);

Rückholkette;
}
}

This also calls methods in my physics lessons that are converted from units to pixels:

Package Utils;


import com.badlogic.gdx.math.Vector;
import com.badlogic.gdx.math.Vector2;

public senior year physics {

public static final float PIXELS_PER_UNIT = 32f;

private physics () {}

public static float toUnits (float pixels) {
returned pixels / PIXELS_PER_UNIT;
}

public static vector toUnits (vector2 pixels) {
Return new Vector2 (toUnits (pixels.x), toUnits (pixels.y));
}

public static float toPixels (float units) {
Return units * PIXELS_PER_UNIT;
}

public static Vector2 toPixels (Vector2 units) {
return new Vector2 (toPixels (units.x), toPixels (units.y));
}
}

If My Pixels Per Unit is 1, it's a perfect match, but physics looks like it's huge.

Enter the image description here

But if my pixel per unit is 32, as I want it, it is far too small.
Enter the image description here

python – Design choices for scaling an app that must execute scheduled API calls and meet deadlines

I have a bottle-based application in Python that lets users schedule certain tasks, which are API calls to other REST services. I have to do these tasks exactly at the scheduled time and repeat them shortly afterwards if they fail.

Normally, I could have a cron job or something similar that simply initiates all tasks that would be done on its own time. In this case, it is really important that all jobs run at 11:00 am within one minute of that time and are often scheduled at similar times. For example, 10 o'clock has many tasks, but at 22 o'clock there are none. This could change as global users begin using the application, but we are not there yet.

I could create my own script to create threads or use it in Python async. I had hoped that there would be something ready to do that with a certain operational readiness, but ideally the solution would be relatively easy to integrate and support.

ggplot2 – How can I reset the y-axis scaling to display only 0 to 100?

I'm trying to create a chart with the x-axis (the type), y-axis the value of the type. The value is% character with many values ​​in the original record.
The result then shows thousands of numbers on the Y-axes. How should I reset the Y-axes from 0 to 100 and then display the representation with goem_point ().

ggplot (mydata, aes (coralType, value))

Result Screenshot

Display – Scaling the user interface across multiple monitors

I've expanded my main display to a big monitor.
Now UI elements like buttons and menus appear slightly larger on my monitor. How can I keep the same UI element sizes on both displays?

Built-in display

monitor

I've tried Gnome Tweak Tool to set the scaling of the font. However, the size of the UI elements is not changed.

Thank you in advance!

Design Benefits of Using a Message Broker for Scaling Web Socket Client to Client Communication

I'm designing a system where exactly two clients need to exchange messages sent by a backend service. My original plan was to use Websockets and connect the clients to a Websocket server. However, this can not be scaled to more than one server without modification. A popular design is the use of multiple websocket servers and broker messages in the backend with a kind of pub / sub-message broker (Redis or similar).

Since my request is for client pair communication only (no chat-like behavior) and I only need one-time delivery, is there any benefit to using a message broker just because the hosts communicate directly with each other? For example, client A sends a message to host A, which sends directly to host B, which sends to client B. I expect several thousand concurrent sessions, each consisting of a couple of clients.

Matrices – Decompose $ A ^ {1} cdot B $ in translation, rotation, scaling

I noticed the following problem in my code:

  • There are 2 transformation matrices $ A, B in mathbb {R} ^ {4 times 4} $
  • $ A, B $ have this shape $ begin {bmatrix} R cdot s && t \ 0 && 1 end {bmatrix} $

  • The goal is to decompose $ A ^ {- 1} cdot B $ in the translation $ t in mathbb {R} ^ 3 $, Rotation $ q in text {quaternion} $ and scale $ s in mathbb {R} ^ 3 $

For the safety check I introduce Round trip (Decomposition and compilation of a matrix):

  • $ comp (dec (A)) == A $
  • $ comp (dec (B)) == B $
  • $ comp (dec (A cdot B)) == A cdot B $

However, if I try to make the tour with

  • $ comp (dec (A ^ {- 1} cdot B)) $

Then I get a relatively large error in the rotation part. What is the reason for this phenomenon? Is it numerically unstable or is the inversion too inaccurate?

Many Thanks


Note: The decomposition is done as described here

monitoring – HTTP Health Check for Beanstalk elastic app triggers scaling / capacity rules

I have an Elastic Beanstalk application running a WordPress application, and I want some monitoring and scaling triggers in case the homepage health checker returns an HTTP response code in the range of 4xx and 5xx, I know the watchdog tab and the capacity tab from the configuration section in Elastic Beanstalk. I see there scaling rules and a health check box. Here's the environmental behavior I'm looking for:

Scaling triggers
- Health check - what is that [home page][1]    (/index.php) - Returns a response status code between 4xx and 5xx
- Start a new instance behind the Elastic Load Balancer, which handles web traffic
- In the meantime, divert all traffic to the maintenance side
- If within 3 minutes no instance within 4xx and 5xx returns from the homepage a response to the status check
- either shrink to two instances or rotate the two "healthy" instances behind the ELB.

Do I have to use the tabs (Monitoring and Capacity) that I mentioned above? Can anyone tell me that the above environment triggers are set up in AWS Elastic Beanstalk?

18.04 – DPI Scaling for Java App on i3

I'm trying to run Xilinx Vivado on Ubuntu 18.04. Under the Ubuntu GNOME session, the application excels well on my HiDPI display (scale of 2). However, I want to run i3, and running Vivado within an i3 session does not cause DPI scaling.

I know of a possible workaround for Java apps, but I can not even find Jvm's call for this program (they launch it from a compiled binary file).

I know that something The GNOME session causes the correct character behavior, but I'm not sure where to look. I have to find the thing and duplicate it in my i3 session.