python – code trace question urgent?

Question= Complete a code trace on the following function call by transcribing the function and noting the values of the important variables at the indicated points in the function.**

def accept_hypothesis(mu_hat, mu, sigma, n):

z_score = (mu_hat – mu) / (sigma/n**0.5)

if z_score < 0:
z_score *= -1

P = 0
if z_score < 0.5:
P = 0.5
elif z_score < 1:
P = 0.3
elif z_score < 2:
P = 0.15
else:
P = 0.02

p_value = 2*P

return p_value <= 0.05
answer = accept_hypothesis(5, 20, 4, 16)

awk print question

Can you please explain what this code does? I know 'awk NR==2{print $4} means the 2nd line 4th field of the ${x}_${y}.dat file.

T= 'awk 'NR==2 {print $4*100}'  ${x}_${y}.dat'

Pls help my math question [closed]

Can somebody solve this question its 9th grade for igcse mathematic.

enter image description here

Show that $(x-3)^2=4x-1$ can be simplified to $x^2-10x+10=0$.

Solve $(x-3)^2=4x-1$.

us citizens – Passport Renewal Data Question

You are referring to a question on the online US passport renewal form filler, which reads:

Has your data changed since your most recent document was issued?

If you click Yes, it will then ask you which specific data has changed since your last passport was issued.

The choices are:

  • Last name
  • First name
  • Middle name
  • Place of birth
  • Date of birth
  • Sex

You are not prompted again for the specifics, as you should have already supplied the new data (and the old data, when specifically asked for it) in previous questions.

olympus – Backyard wildlife zoom question factoring distance

I’m quite new to
photograhpy/videography and I only have a limited budget of $800.00US for a lens.

I am using an MFT camera (BMPCC4K) for video and the lens I am considering is the Olympus 12-200mm f/3.5-6.3 lens mostly for it’s zoom capability of 16.6x. It has a 35mm equivalent of 0.46x magnification.

I will always be using this lens outside on sunny days and I will be shooting the video at 24 fps HD. I will always have it mounted on a sturdy tripod for this type of video shooting so IS is not an issue.

The distance from my tripods to the area where I take pictures and record video is approx 70 feet.

My concern is that I will not be able to get close up shots or acceptable video footage being 70 feet away- even with 16.6x zoom and the magnification (.46x 35mm equivalent) because of the smaller format camera and smaller MFT lens.

I have no experience shooting video with MFT lenses but I understand the 12-200mm is a consumer grade lens for wildlife photography and videography- according to the Olympus website and reviews I’ve watched and read.

My previous experience is with a Canon 80D (APS-C sensor) using a 70-300mm IS II USM consumer lens at 29.97 fps in HD.

With that lens I was able to get fairly close pictures and video when fully zoomed in (from 70 feet away) and I am hoping I will be able to get at least the same zoom result FOV with the Olympus 12-200mm on the MFT camera, when shooting video.

The idea is to shoot pics with the Canon 80D and shoot video with the BMPCC4K.

I have watched many videos and have read many reviews and I know the Olympus 12-200mm lens gets soft in the long range and unless it’s super blurry, it doesn’t matter to me that much.

I will be shooting video of our garden too and I understand this lens has a good minimum focus distance, which I hope will be adequate for getting flower and plant footage, but again I have no experience with this lens, so I really don’t know- which is why I’m here:).

Anyway, in a nutshell, I’m just hoping that with the proposed lens (Olympus 12-200mm) I will be able to zoom in and see the critters (squirrels and birds) fairly close like I can with my Canon 70-300mm.

To clarify a bit, I am not hoping to zoom in and see complex detail in bird feathers or look up a squirrels nose lol, but I’m hoping to get video footage of the animals’ bodies filling out the frame when zooming in from 70 feet away.

I’m sure this is a very basic thing to understand but I need to be sure, so I wanted to consult with professionals or at least someone who could assure me I’m getting a proper lens for my backyard video recording activities.

Thanks so much for your time and hope to hear back soon.

Stay safe:).

multithreading – Question on parallelizing ECS Systems

Pipelines

The simplest implementation of ECS will run systems sequentially one after the other. Perhaps you are familiar with the idea of fixing your timestep. Simply running systems sequentially in a predefined order blows past that concept.

The solution is to have pipelines. Then you can have a pipeline for physics, one pipeline for rendering, and another for input, for example. Or as many as you would want. Each pipeline has a different configuration. The first criteria is, of course, how often to run the pipeline.

My suggestion is have pipelines run sequentially, one after the other. Then you can run the systems in the current pipeline concurrently. That way you know that only the systems of the current pipeline are running. For instance, the systems in the rendering pipeline know that the systems in the physics pipeline will not move entities (update their position components) because that is a different pipeline, and pipelines run sequentially.

With that said, if you need to, for example, split the physics pipeline in two, to make sure one stage is completed before running the other, that is ok. Furthermore if a pipeline ends up having only one system, that is ok too. Use this to ensure that you will not have systems stepping on each other.


Read-Write Locks

You can use pipelines to have control over which systems can run concurrently, which allows you to prevent running in parallel systems that may step on each other. However, that can be error prone, as it requires to design you pipelines carefully. There is, of course, another way to ensure this: locks.

As you might know, having system declare what kinds of component they need on initialization is a good idea. It allows some optimizations. For example, if a system wants entities that have two kinds of component, we have a couple options:

  • We can go over every entity and checking if they have the components, every time the system runs.
  • We can keep a list of the entities that match the criteria, and every time one of those components is added or removed we can update that list.

The latter is only possible if the system declares the kinds of components it wants before hand. Plus, multiple systems that want the same set of component kinds can share list. You might also be interested in the concept of Archetypes. Although I prefer to think about these as queries.

Ok, extend that idea to include not only which kinds of components the system will read, but also which kinds of components the system will write (we can assume that write access implies read access). And now you can consider read-write locks on kinds of components:

  • If a system that wants to write a kind of component is running, you cannot run any systems that want to read or write that same kind of component at the same time.
  • Otherwise, multiple systems that want to read (but not write) the same kind of component can run at the same time. Any system that wants to write that kind of component must wait.

On running a system for multiple entities in parallel

A system runs over the components sequentially. One of the talking points of ECS is that they store components contiguously in memory, and to really take advantage of that you want to run over them orderly.

However, that does not mean that running a system in parallel is imposible. Yet, in order to do so we need to consider whether or not that introduces race conditions. A solution is to have a flag indicating if a system should run in parallel or sequentially.

database design – Question about relations between Users and Assets for multiple projects and devices

I work in an organization that has different Users, Projects and (IoT) Devices and I’ve been tasked with creating a generic db that is agnostic towards the specifics of each project and only describes the relations between Users’ assets and each project’s devices. There’s a picture of the db schema I have come up with so far at the bottom.

I laid down the following premises:

  • Projects have Users
  • Users belong to Projects
  • Projects have Devices
  • Devices belong to Projects

So far so good, but now I need to create an Asset resource which basically is something that a user owns and monitors via a device. So for example, if a user is in an agricultural project, an Asset is a Field and if another user belongs to a Smart home project, the Asset represents a House.

I’m having difficulties designing the following cases:

  • User John has Assets in project SmartHome
  • User Jonh has Assets in project Agri
  • There must be only one db entry for John as a user in the db
  • An asset can be monitored by any of the project’s devices.

In my mind there are two ways to go about designing this.

A) (orange lines)

  • We create a generic 1:N relation between Users and Assets,
  • Assets have a reference to the Project (belongs to).
  • Assets and Devices have also a generic N:M relation

B) (purple lines)

  • We take advantage of the N:M relation of Users and Projects as
    expressed in the ProjectUsers table (same for Projects and Devices in the ProjectDevices table).
  • Now Assets table doesn’t have a reference to Projects table since
    ProjectUsers and AssetProjectDevices tables express that relation.

enter image description here

Which would you say is closer to what I’m describing?
Also please post any online content that I should research for this issue.

Thanks for your time

So I have this question in one of my interview practice problem and I’m not that familiar with Java, So how I do make a program like this

A Java program to that performs the following tasks:
(10 Points) Accepts integer input (one integer at a time) from the user.
(50 Points) Inserts the given integer into an integer array of size 10 in ascending order. If the array is full the latest integer input (x) will replace the largest integer in the array that is smaller than x. In order to satisfy this requirement your program must –
Replace any existing value at that index with x
Find the appropriate location (index) to insert x.
(20 Points) Print the current contents of the integer array
(20 Points) Ask if the user wants to continue. If yes go to step 1 else exit the program

real analysis – A question on a simple integral with a singular kernel?

I asked this question on math.stackexchange

https://math.stackexchange.com/posts/4041263/edit

No answers or very useful comments there.
May be it is more appropraite for mathoverflow.

Fix a small $delta>0$ and let $p,q>1$. Consider the integral

$$I(p,q):=intlimits_{1-delta}^{1+delta}
intlimits_{y/2}^{2y}frac{1}{|y-x|^{frac{1}{p}}|1-x|^{frac{1}{q}}}
,mathrm{d}x,mathrm{d}y.
$$

I am trying to show that $I(p,q)$ diverges if $frac{1}{p}+frac{1}{q}geq 1$. I am not sure this is even the case ? Any hints on how to handle this?

Remark: This seems to be related to the failure of the Hardy-Littlewood-Sobolev inequality (HLS) at the endpoint $p=1$. HLS reads:

If $1<p,q<infty$, $fin L^p$ and

$$Tf(x):=int_{mathbb{R}^n} frac{f(y)}{|x-y|^{gamma}}dy$$

Then $$|Tf|_qleq |f|_p$$
if and only if
$$frac{1}{p}-frac{1}{q}=1-frac{gamma}{n}.$$

Many thanks.

mathematical programming – Numerical computing Question

Thanks for contributing an answer to Computer Science Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.