time machine – Migration Assistant won’t copy (some) files, though running through smoothly without error

we’re just migrating my wife’s MacBook Pro to a new one, both most recent macOS versions via a TimeMachine backup. In the process all files are selected, Migration Assistenten on the new mac runs through smoothly without any errors. Except that it’s a lot faster than expected, and faster than it first estimates to be. We’re roughly talking about 200 Gb of data, it first estimates to take around 1:30 (h:min), but then finishes after just a couple of minutes. After rebooting the Pictures and Music folder for example are empty, haven’t fully explored, what else might be missing. The missing data definitely is on the time machine backup.

Any ideas on what might have gone wrong here? Might try skipping the time machine backup and using Migration assistant directly Mac to Mac.

One more thought: old Mac used case-sensitive Apple File System, new Mac doesn’t – might that be the source of the „error“? Thanks for your help!

Sascha

python – Getting Graph and Block Animation to Run Smoothly Together

I have been working on some code that produces a live graphic of a graph and blocks moving. It works in theory but does not look like how I want. The animation runs very slow when showing both the graph and the blocks together (a code of each alone works much better). How can I get them to work together smoothly?

I am also open to any other advice regarding this code on how I can improve its readability, speed, and functionality.

Thanks!

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import keyboard
import pandas
 
# =============================================================================
# Parameters
# =============================================================================
time = 10  # maximum time for the simulation
h = 0.05  # step size
steps = int(time/h)  # number of steps
order = 4  # two second order equations
 
ICs = (0, 0, 0, 1, 0)  # intial conditions; t0, x1, x1dot, x2, x2dot
m1 = 1.0  # kg; mass 1
m2 = 3*m1  # kg; mass 2
k = 3.0  # N/m; spring constant
F = 2.8  # N; forcing force
us = 0.5  # static friction coefficient
uk = 0.3  #k inetic friction coefficient
g = 9.81  # m/s^2; gravity

side1 = m1  # side length of mass 1
side2 = m2  # side length of mass 2

parameters = {'m1':m1, 'm2':m2, 'k':k, 'F':F, 'us':us, 'uk':uk, 'g':g}
units = {'m1':'kg', 'm2':'kg', 'k':'N/m', 'F':'N', 'us':'', 'uk':'', 'g':'m/s^2'}

# For logging the data to a CSV
All_Values = {'t':(), 'x1':(), 'v1':(), 'x2':(), 'v2':()}

# =============================================================================
# Intializing Arrays
# =============================================================================
vars = np.empty(shape=(order,steps))  # each row is another var, i.e. x1,x2,...
 
# Set initial conditions for each var
for i in range(order):
    vars(i)(0) = ICs(i+1)
    
K = np.zeros(shape=(4,order)) # Each row is k1, k2, k3, k4 for each var
t = np.empty(steps)
t(0) = ICs(0)

# =============================================================================
# Resets the arrays
# =============================================================================
def setup():
    global K
    # Initializing vars array
    vars = np.empty(shape=(order,steps))  # each row is another var, i.e. x1,x2,...
     
    # Set initial conditions for each var
    for i in range(order):
        vars(i)(0) = ICs(i+1)
        
    K = np.zeros(shape=(4,order)) # Each row is k1, k2, k3, k4 for each var
    t = np.empty(steps)
    t(0) = ICs(0)

# =============================================================================
# ODE function
# =============================================================================
def ODE(t, var, varsprev):
    # variables are as defined in the 'parameters' dict
    m1 = parameters('m1')
    m2 = parameters('m2')
    k = parameters('k')
    F = parameters('F')
    us = parameters('us')
    uk = parameters('uk')
    g = parameters('g')
    
    # spring force based on the initial and current length of the spring
    l_eq = vars(2)(0) - vars(0)(0)  # equilibrium length
    l_current = var(2) - var(0)
    F_s = k*(l_current - l_eq)
    
    # static friction until it can no longer fight the spring force
    static = m1*g*us
    kinetic = m1*g*uk
    if F_s <= static:
        F_f = F_s
    else:
        F_f = kinetic
        
    dx1dt = var(1)  # v1 = x1dot
    
    # Adjust the sign of friction
    # c = 0, no friction; c = 1, friction left; c = -1, friction right
    c = 1  # assume friction left unless if-else below says otherwise
    # if the block is moving to the left, friction to the right
    if var(1) < 0:
        c = -1
    # if the block isn't moving, depends on direction of spring force
    elif var(1) == 0:
        # spring pushing left, friction to the right
        if F_s < 0:
            c = -1
        # no velocity nor spring force, no friction
        elif F_s == 0:
            c = 0
    dv1dt = 1/m1 * (F_s - c*F_f)
    
    dx2dt = var(3)  # v2 = x2dot
    
    # chose that mass 2 does _not_ experience friction
    dv2dt = 1/m2 * (-F_s + F)
    
    return(np.array((dx1dt, dv1dt, dx2dt, dv2dt)))

# =============================================================================
# Plotting function
# =============================================================================
plt.ion() # set interactive mode on 
fig, (graph, block) = plt.subplots(2, 1, figsize=(8,10))

fig.suptitle(f'Double Spring Mass with Partial Friction Using RK4 (stepsize: {h})',
             y=0.94)

def Plotting(i):
    # GRAPH
    graph.cla()  # clear what is currently graphed
    graph.plot(t(:i), vars(0,:i), label=f'x1')
    graph.plot(t(:i), vars(1,:i), label=f'v1')
    graph.plot(t(:i), vars(2,:i), label=f'x2')
    graph.plot(t(:i), vars(3,:i), label=f'v2')
    
    graph.annotate(f'time = {round(t(i),1)}s', xy=(0.5, 0.98), 
                 xycoords='axes fraction', ha='center', va='top')    
    
    graph.set_title('Graph')
    graph.set_xlabel('time (s)')
    graph.set_ylabel('position (m)')
    
    graph.legend(loc=2)  # upper left

    # =========================================================================
    # BLOCKS
    block.cla()  # clear what is currently graphed
        
    m1x = vars(0)(i)
    m2x = vars(2)(i)
    
    COM = (m1*(m1x-side1) + m2*(m2x+side2))/(m1 + m2)   
    windowOffset = abs(max((m1x-side1) - COM, (m2x+side2) - COM, key = abs))+side2
    
    block.set_xlim(-(COM+windowOffset),COM+windowOffset)
    # plt.ylim(0,1.5*side2)
    
    mass1 = patches.Rectangle((m1x-side1,0), side1, side1, facecolor='#1f77b4')
    
    mass2 = patches.Rectangle((m2x, 0), side2, side2, facecolor='#ff7f0e')
    
    # Spring color based on length from equilibrium
    l_eq = ICs(3) - ICs(1)  # equilibrium length
    l_curr = m2x - m1x  # current length of spring
    
    if (l_curr == l_eq):
        c = 'k'
    elif (l_curr > l_eq):
        c = '#d62728'
    else:
        c = '#2ca02c'
    
    spring = patches.ConnectionPatch(xyA=(m1x,side1/2), coordsA = 'data',
                                     xyB=(m2x, side1/2),coordsB='data',
                                     linewidth = 2,
                                     color = c)
    
    block.add_patch(spring)
    block.add_patch(mass1)
    block.add_patch(mass2)
    
    block.axis('equal')
    
    block.annotate(f'time = {round(t(i),1)}s', xy=(0.5, 0.98), 
                  xycoords='axes fraction', ha='center', va='top')
    
    block.set_title('Block Animation')
    block.set_xlabel('Position (m)')
    
# =============================================================================
# User parameter change
# =============================================================================
def paramUpdate(i):        
    update = True
    
    # print parameters and values
    def printParams():
        print("nCurrent parameters and values: ")
        
        for j in parameters:
            print(j, '=', parameters(j), units(j))
    
    changed = False  # if a parameter is changed, this ensures plot resets
    while update==True:
        try:
            printParams()
            # ask for parameter to change
            key = input("Which parameter would you like to change? (or type "n" to resume plotting) ")
            
            # if 'n', resume plotting from the current i
            if key == '' or key == 'n':
                return (-1 if changed else i)
            
            # check to see if the parameter exists (i.e. key exists)
            if key not in parameters.keys():
                raise KeyError
            
            # if the value is not convertable to float, throws 'ValueError'
            value = float(input("What is the new value? "))
            
            parameters(key) = value  # change the parameter value
            
            printParams()
            changed = True  # a change has been made; plot will reset
            
            while True:
                resume = input("Would you like to continue changing parameters? (y/n) ")(0).lower()
                if resume == '' or not resume in ('y', 'n'):
                    print("Please answer with 'y' or 'n'. ")
                else:
                    update = True if resume == 'y' else False
                    break
        # catching errors
        except KeyError:
            print("nPlease enter a valid parameter.")
        except ValueError:
            print("nPlease enter a valid value.")
    return -1
        
    

print('Press "z" to pause')
print('Press "c" to resume')
print('Press "x" to save and quit')
print('Press "v" to adjust parameters')



# =============================================================================
# main loop that calculates each var value using RK 4th order method
# =============================================================================
pause = False
i=0
while i<(steps-1):
    if i == 0:
        setup()
    
    # calculates each k value
    K(0) = h * ODE(t(i),       vars(:,i),          vars(:,i-1))
    K(1) = h * ODE(t(i) + h/2, vars(:,i) + K(0)/2, vars(:,i-1))
    K(2) = h * ODE(t(i) + h/2, vars(:,i) + K(1)/2, vars(:,i-1))
    K(3) = h * ODE(t(i) + h,   vars(:,i) + K(2),   vars(:,i-1))
    
    # combines k values using RK4 method
    vars(:,i+1) = vars(:,i) + 1/6 * (K(0) + 2 * K(1) + 2 * K(2) + K(3))
    
    # updates time
    t(i+1) = t(i) + h
    
    # Plotting every fourth calculation to speed up plotting
    if (i%4 == 0):
        Plotting(i)
        fig.canvas.draw()
        plt.pause(0.01)
    
    # exit
    if keyboard.is_pressed('x'):
        plt.pause(0.01)
        break
    
    # update parameters
    if keyboard.is_pressed('v'):
        i = paramUpdate(i)
        
    # pause and resume
    if keyboard.is_pressed('z'):
        pause = True
    while pause:
        if keyboard.is_pressed('c'):
            pause = False
        if keyboard.is_pressed('x'):
            plt.pause(0.01)
            break
        if keyboard.is_pressed('v'):
            i = paramUpdate(i)
            pause = False
        
    i+=1

print("Done")
 
plt.show()
# plt.close()  # closes the plot at then end


# Saving values to a CSV
All_Values('t') = t
All_Values('x1') = vars(0)
All_Values('v1') = vars(1)
All_Values('x2') = vars(2)
All_Values('v2') = vars(3)

df = pandas.DataFrame(All_Values)

df.to_csv('Value_Output.csv', index = False)
```

When key pressed rotate until lifted if key up smoothly revert to original position and if rotate too far die

public int speed = 100;
    public float maxrotation = 30f; //To Set Max Rotation

    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (transform.rotation.eulerAngles.x > 0)
        {
           
            transform.rotation.eulerAngles.x - 1; //there is an error on this line saying "Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement"
            
        }
        if (transform.rotation.eulerAngles.x < 0)
        {
           
            transform.rotation.eulerAngles.x + 1; //there is an error on this line saying "Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement"
            
        }
        if (Input.GetKey(KeyCode.A))
        {
            //Set a rate at which we should turn
            float turnSpeed = speed * Time.deltaTime;
            //Connect turning rate to horizonal motion for smooth transition
            float rotate = Input.GetAxis("Horizontal") * turnSpeed;
            //            //Get current rotation
            //            float currentRotation = gameObject.transform.rotation.z;
            //            //Add current rotation to rotation rate to get new rotation
            //            Quaternion rotation = Quaternion.Euler (0, 0, currentRotation + rotate);
            //            //Move object to new rotation
            //            gameObject.transform.rotation = rotation;
            gameObject.transform.Rotate(Vector3.left * rotate);
        }
        if (Input.GetKey(KeyCode.D))
        {
            //Set a rate at which we should turn
            float turnSpeed = speed * Time.deltaTime;
            //Connect turning rate to horizonal motion for smooth transition
            float rotate = Input.GetAxis("Horizontal") * turnSpeed;
            //            //Get current rotation
            //            float currentRotation = gameObject.transform.rotation.z;
            //            //Add current rotation to rotation rate to get new rotation
            //            Quaternion rotation = Quaternion.Euler (0, 0, currentRotation + rotate);
            //            //Move object to new rotation
            //            gameObject.transform.rotation = rotation;
            gameObject.transform.Rotate(Vector3.left * rotate);
            
        }
        if (transform.eulerAngles.x > maxrotation)
        {
            Application.LoadLevel(Application.loadedLevel); //kills player and reloads scene
            scorecript.scoreValue = 0; // sets score to zero
        }
        if (transform.eulerAngles.x < maxrotation - (maxrotation * 2))
        {
            Application.LoadLevel(Application.loadedLevel); //kills player and reloads scene
            scorecript.scoreValue = 0; //sets score to zero
        }

    }

photo editing – Underwater: Edit and Join separated layers smoothly

As I really enjoy underwater photography, I am wondering how does one end up with a final image like the one I share below:

Unedited on the left, desired effect on the right:

Original Image After Edits

Source: https://www.instagram.com/p/CApGLcCHStN/

This edit seems to complex for Lightroom as it doesn’t have a Channel Mixer so I presume the photographer used Photoshop or GIMP. There one can copy a blue/green channel and convert it to red.

In this case, it seems that the photographer is using two separate layers and adds the people separately, so that he can get a darker background.

Assuming that to get an image like the one shown above the photographer is not only using a pure picture and color grading, but editing multiple layers of underwater images and join them smoothly, how does one edit and join edited layers, from underwater images, in a subtle way?

Windows 10 – Stuttering video playback on the second monitor when used only, smoothly when using both displays

My setup is as follows: A 2560 x 1080 monitor (LG 29UM69G-B) that is connected via an HDMI cable to a Gigabyte Aero 15 laptop (Geforce RTX 2070 Max-Q, i7-9750H, 16 GB RAM, 970 Evo 1 TB SSD, Windows 10) is connected.

I am not using the laptop's built-in display, just the monitor (projection setting "second screen only") and have recently noticed that offline 1080p MKV videos stutter when viewed on this monitor. The strange thing is that these videos play smoothly on the same monitor when using the built-in display (projection setting "Extend", video playback in full screen mode on the monitor).

What I've tried so far has mostly been before I realized that playback is only nervous when using the monitor – switch from PotPlayer to VLC to MPC-HC, update drivers, make sure the dedicated GPU is used, codec and Change hardware acceleration settings. My next step would have been to buy a USB-C cable instead of HDMI (the laptop doesn't have a display connector), but since the current setup seems to allow for smooth playback, I think this must be a strange software problem and hope someone can help me fix this.

Unit – Why doesn't scaling an object in one direction (forward) start smoothly?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Raise : MonoBehaviour
{
    public float maxScale = 10f;
    public float speed = 1f;

    private Vector3 v3OrgPos;
    private float orgScale;
    private float endScale;

    void Awake()
    {
        v3OrgPos = transform.position - transform.forward;
        orgScale = transform.localScale.z;
        endScale = orgScale;
    }

    void Update()
    {
        ResizeOn();
    }

    private void ResizeOn()
    {
        transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y, Mathf.MoveTowards(transform.localScale.z, endScale, Time.deltaTime * speed));
        transform.position = v3OrgPos + (transform.forward) * (transform.localScale.z / 2.0f + orgScale / 2.0f);
        /*if (Input.GetKeyDown(KeyCode.S))
        {
            endScale = maxScale;
        }
        else if (Input.GetKeyDown(KeyCode.R))
        {
            endScale = orgScale;
        }*/

        endScale = maxScale;

    }
}

If I use the S and R keys when I press S, the scaling starts smoothly.
However, if you don't use the buttons and start scaling while running the game, there will be some delay, or it looks like the first frame is scaling it by one like a jump effect. Then the scaling continues smoothly.

But the first image, or the first time it looks like it is scaled once and then continued smoothly, does not scale smoothly when the game is run from the beginning.

Change the object position smoothly in unit

I'm doing something like this game – https://youtu.be/1cYkK6u42Ms
I've done everything necessary, but as you can see at the beginning of the video, the instantiated car is changing lanes smoothly. In my game I only have one problem that my car changes lanes, but not as smoothly.
A point to the car: –
My car is reversing on the Z axis because my bike is not moving with the treadmill system.

Here's what I do when I want to change lanes.

For example, if my car is in the left lane, the x position according to my game is -0.6, which is what I did in the code


Transform CurrentPositionZ;

void update() {
CurrentPositionZ.position = transform.position;
if(transform.position.x == -0.6f)
{
      Vector3 pos = new Vector3 (0, transform.position.y, CurrentPositionZ);
      transform.position = pos;
}
}

I set the X position on Vector3 pos to 0 because I want the car to go to 0 on the X axis.

However, the car drives directly to the 0 position on the X axis. It's not really smooth.
Here is a video of my game's bug: – https://drive.google.com/file/d/1rKXXaMhlEI7v5PYNABTnEtgxJp1UEZYZ/view?usp=drivesdk

help please

Unit – Move the camera smoothly like the middle mouse button from Google Earth

I can roll the die if it is a direct throw that is not smoothed but is executed immediately:

Enter image description here

I was hoping it would run smoothly, but it just doesn't want to work or at least it's very slow:

Enter image description here

The first order trans.up is the first GIF, the second, commented out is the second GIF:

using System.Diagnostics.CodeAnalysis;
using UnityEngine;

(SuppressMessage("ReSharper", "Unity.InefficientPropertyAccess"))
public class Example2 : MonoBehaviour
{
    #region New region

    public Transform Target;

    public Camera Camera;
    public float CameraSpeed;
    private float CameraDistance;
    private Vector3 CameraZ;
    private Vector3 CameraXY;

    private Vector3 Mouse;
    public Vector3 MouseSpeed;

    private void Reset()
    {
        CameraSpeed = 2.0f;
        MouseSpeed = new Vector3(+0.25f, -0.25f, 0.25f);
    }

    private void OnGUI()
    {
        if (GUILayout.Button("Reset"))
        {
            Camera.transform.position = Vector3.back * 1.5f;
            Camera.transform.LookAt(Target.position);
            UpdateDirectionAndDistance();
        }
    }

    private void OnEnable()
    {
        UpdateDirectionAndDistance();
    }

    private void UpdateDirectionAndDistance()
    {
        var vector = Target.position - Camera.transform.position;
        CameraZ = Vector3.up;
        CameraXY = vector.normalized;
        CameraDistance = vector.magnitude;
    }

    private void Update()
    {
        var mouse = Input.mousePosition;
        var delta = mouse - Mouse;
        Mouse = mouse;

        var xAxis = Quaternion.identity;
        var yAxis = Quaternion.identity;
        var zAxis = Quaternion.identity;
        var trans = Camera.transform;

        if (Input.GetMouseButton(0))
        {
            xAxis = Quaternion.AngleAxis(delta.x * MouseSpeed.x, trans.up);
            yAxis = Quaternion.AngleAxis(delta.y * MouseSpeed.y, trans.right);
            zAxis = Quaternion.identity;
        }
        else if (Input.GetMouseButton(2))
        {
            xAxis = Quaternion.identity;
            yAxis = Quaternion.identity;
            zAxis = Quaternion.AngleAxis(delta.x * MouseSpeed.z, trans.forward);
        }

        CameraXY = xAxis * yAxis * CameraXY;
        CameraZ = zAxis * CameraZ;

        var time = Time.deltaTime * CameraSpeed;

        trans.position = Vector3.Slerp(trans.position, -CameraXY * CameraDistance, time);

        trans.up = zAxis * trans.up;
        // trans.up = Vector3.Slerp(trans.up, zAxis * trans.up, time); // does not work, extremely slow

        trans.rotation = Quaternion.LookRotation(Target.position - trans.position, trans.up);
    }

    #endregion
}

Here is Google Earth Roll when you hold / drag / release the middle mouse button:

Enter image description here

Question:

How can I implement smooth rolling like with XY axes?

magento2 – Is there a way to check if the data migration tool has ended smoothly?

My data migration went yesterday and it was taking so long. It was only about 50% in 7 hours, so I left my computer on and never let my computer sleep.

I check out 11:00 p.m. from TeamViewer and it was still running and was 70% complete.
I got back to work this morning at 9 a.m. and only found that my Windows computer had restarted. Most likely it was updated automatically.

Is there any way to check if the data migration has finished?

And is it normal for you to take so much time to migrate data? I have a DB of 45 GB.

Please suggest.

Scroll – This option allows you to scroll smoothly on non-Apple mouse movements

I started using a Logitech G600 and customizing it with Folivora, and the power of the combination is incredible. It speeds up my workflow and makes it more intuitive.

However … I miss the terrible scrolling of my Magic Mouse / Trackpad. The jerky, clicking, jumping scroll really rubs against me.

Is there a way to scroll my non-Apple mouse smoothly?