How to plot a set of complex numbers with given argument and absoulute value bounds

I want to plot the following complex numbers $ $ z \in \text{(complex numbers)}:\pi/4 < \arg (z) \leq 5 \pi/4,\ 1 \leq |z| < 2 $ $

I don’t know how to graph it so that it would look like 2D without any unecessary details. The closest I found how I want it to look is, when I looked at how graphing of parametric function looks. I tried to use contour plot to graph it, but I just can’t seem to do it…

ContourPlot[ Im[F[z[x, y]]], {3 pi/4 < arg (z) <= 5 pi/4, 1 <= abs (z) < 2}, {x, -.2, .2}, {y, -.2, .2}, PlotRange -> All, Contours -> Range[-5, 5, .5], ContourLabels -> True]

Does anybody know how to graph my set?

Scene2D: How do i set a png’s bounds as the actor bounds?

I have two buttons (custom png images, kind of rectangle shaped but with very rounded corners) extending from actor in a screen, and they act whenever you click on them. The problem is, my buttons have rounded corners. And since the setBounds() method only lets me set rectangular bounds for them, they are pretty inaccurate.

So, is there any way to make the bounds of the actor coincide with my png image’s bounds, or at least make them more accurate? Or am i going in the wrong direction here?

PS: I already know about the hit() method and how you can override it to "modify" the bounds of an object, but i don’t have a Circle to get an area from and apparently my math skills aren’t enough to find some formula that somehow gets the perimeter of a circle given a certain x or y point.

Index was outside the bounds of the array [closed]

int[] damageNumbers = new int[4] { 5, 10, 15, 20 }; int rand = UnityEngine.Random.Range(0, 5); enemyDamage = damageNumbers[rand]; 

The Unity documentation and the code explanation in the code editor states that the max value is exclusive, so if I want the random value to be from 0 to 4, I put int (0, 5).

For some reason Unity is getting an IndexOutOfRangeException and it says it is the 3rd line in my code, why is that? Thanks in advance. 🙂

what is an example of out of bounds read in order to leak sensitive information?

I Am trying to understand a little bit better behind the scenes on bypassing aslr by reading the bytes in the memory of a process, but how can I make an example of an info leak in WIN32? my code does the leaks of bytes , but how can I check the image base based on those bytes?

#include <stdio.h> #include <string.h>  int main(int argc, char **argv) {     char a[16];      strncpy(a, "0123456789abcdef", sizeof(a));      //... lots of code passes, functions are called...     //... we finally come back to array a ...      printf("%s\n", a); } 

Numerical solution of Triple Integration of a Region with Variable Bounds?

I am asked to calculate the mass of the region bounded above by the plane (2x + 3y - z = 2) and below by the triangle on the xy-plane with vertices (0,2),(1,0),(4,0). The density is proportional to the distance from the plane to the xy-plane, so the function is d(x,y,z) = kz.

My limits are:

0 ≤ z ≤ (2x + 3y - 2)

(1 - 0.5y) ≤ x ≤ (4 - 2y)

and 0 ≤ y ≤ 2.

My code is:


but Mathematica doesn’t return a number (if I’m correct, it should be 19k).

Instead I get: k(3-1.5y)(-2+2x+3y)^2.

However if I integrate the function step-by-step:


I do get a numerical value.

Is there a certain syntax that Mathematica requires that I’m not aware of?

FactorSquareFree::lrgexp: Exponent is out of bounds for function FactorSquareFree. Error

I’m trying to make a two-dimensional contour plot of the temperature of a plate. This is my initial function:

T[x_, y_] :=   (20/Pi) Sum[((-1)^(n + 1)/     n) Exp[(-n Pi y)/10] Sin[(n Pi x)/10], {n, 1, i}] 

The function has been acting how I expect it to, so I believe everything is correct with that.

When I tried to plot it, I used:

ContourPlot[T[x, y] /. i -> 1, {x, 0, 10}, {y, 0, 10}] 

I keep getting the error FactorSquareFree::lrgexp: Exponent is out of bounds for function FactorSquareFree. This will display three times before the systems suppresses the error and then runs without output until I quit the kernel.

I tried to look at the FactorSquareFree function itself to see if I could figure out where it was going out of bounds. Doing that, I got:

FactorSquareFree[T[x, y] /. i -> 1] -(1/Pi)  10 I E^(-(1/5) I Pi (x + I y) -     1/5 Pi (I x + y)) (E^((2 I Pi x)/5 +       1/10 I Pi (x + I y)) - E^(     1/5 I Pi (x + I y) + 1/10 Pi (I x + y)) +      E^(1/5 I Pi (x + I y) + 1/5 Pi (I x + y))       Log[1 + E^(-(1/10) I Pi (x - I y))] -      E^(1/5 I Pi (x + I y) + 1/5 Pi (I x + y))       Log[E^(-(1/10) I Pi (x - I y)) (1 + E^(          1/10 I Pi (x - I y)))] -      E^((2 I Pi x)/5) Log[1 + E^(1/10 I Pi (x + I y))] +      E^(1/5 I Pi (x + I y) + 1/5 Pi (I x + y))       Log[1 + E^(1/10 I Pi (x + I y))]) 

Looking through that, I don’t see anywhere where the exponent should get very large running from {x,0,10} and {y,0,10}.

Everything I have looked up related to this problem has been too complicated for me to understand what solution people were giving. Especially since the issue is with an internal function for ContourPlot, I’m at a loss of what to change or try.

Thank you for your help!

Optimize Max-flood algorithms bounds

In distributed algorithms, The Max Flood algorithms finds the leader in a network of processes In O(diam) time and with |E|*diam (|E| is the number of edges in the graph) message complexity. With some optimization in the algorithm we can reduce these message complexity. We can improve the algorithm by each process sending the max UID’s only when a changed occurs(the process finds a new max UID).
My problem is The no one has mentioned the complexity bounds of these improvement. How ever I faced these problem in Nancy Lynches Distributed Algorithms book:

>     3. For the OptFloodMax algorithm, either prove a smaller upper bound than >     O (n^3) on the number of messages or exhibit a class of digraphs and cot- >     responding UID assignments in which the number of messages is omega(n^3) 

After lots of searching in the internet and the books I couldn’t find any answer to help me. I couldn’t. Where does the n^3 bounds come from and which bound is the correct one?

Efficiently computing lower bounds over partially ordered sets

I have a list of sets that I would like to sort into a partial order based on the subset relation.

In fact, I do not require the complete ordering, only the lower bounds.

If I am not mistaken, each lower bound should define one separate component of the respective graph – and this component should be a meet-semilattice.

What would be the most convenient space and time efficient way to solve this problem? Perhaps there is a way that does not require to build the entire graph? Perhaps there is a known algorithm under a better terminology than what I have naively described above?

I am aware that the time and space requirements are underspecified above, but I would be happy about any suggestions, whether they are proven to be optimal or not…

Background: I am currently building an entire graph database that holds all the edges between the sets and then look for the nodes that have no generalizations, but this is quite complicated, slow and requires a lot of (disk) space. The list mentioned above contains roughly 100 million sets.

HLSL : Offset and length were out of bounds

//Vertex Shader Constants  float4x4 World; float4x4 View; float4x4 Projection; float4x4 WorldViewIT;  //Color Texture  texture Texture;  //Normal Texture texture NormalMap;  //Specular Texture  texture SpecularMap;  //Albedo Sampler  sampler AlbedoSampler = sampler_state  {      texture = <Texture>;     MINFILTER = LINEAR;       MAGFILTER = LINEAR;       MIPFILTER = LINEAR;       ADDRESSU = WRAP;       ADDRESSV = WRAP;  };  //NormalMap Sampler  sampler NormalSampler = sampler_state  { texture = <NormalMap>;   MINFILTER = LINEAR;   MAGFILTER = LINEAR;   MIPFILTER = LINEAR;   ADDRESSU = WRAP;   ADDRESSV = WRAP;  };  //SpecularMap Sampler sampler SpecularSampler = sampler_state {  texture = <SpecularMap>;   MINFILTER = LINEAR;   MAGFILTER = LINEAR;   MIPFILTER = LINEAR;   ADDRESSU = WRAP;   ADDRESSV = WRAP;  };  //Vertex Input Structure  struct VSI {  float4 Position : POSITION0;   float3 Normal : NORMAL0;   float2 UV : TEXCOORD0;   float3 Tangent : TANGENT0;   float3 BiTangent : BINORMAL0; };  //Vertex Output Structure  struct VSO {  float4 Position : POSITION0;  float2 UV : TEXCOORD0;   float3 Depth : TEXCOORD1; float3x3 TBN : TEXCOORD2; };  //Vertex Shader  VSO VS(VSI input) { //Initialize Output  VSO output;  //Transform Position   float4 worldPosition = mul(input.Position, World); float4 viewPosition = mul(worldPosition, View); output.Position = mul(viewPosition, Projection); //Pass Depth   output.Depth.x = output.Position.z; output.Depth.y = output.Position.w; output.Depth.z = viewPosition.z;  //Build TBN Matrix   output.TBN[0] = normalize(mul(input.Tangent, (float3x3)WorldViewIT)); output.TBN[1] = normalize(mul(input.BiTangent, (float3x3)WorldViewIT)); output.TBN[2] = normalize(mul(input.Normal, (float3x3)WorldViewIT));  //Pass UV   output.UV = input.UV;  //Return Output   return output; }  //Pixel Output Structure  struct PSO { float4 Albedo : COLOR0; float4 Normals : COLOR1; float4 Depth : COLOR2; };  //Normal Encoding Function  half3 encode(half3 n) { n = normalize(n); = 0.5f * ( + 1.0f);  return n; }  //Normal Decoding Function  half3 decode(half4 enc) { return (2.0f * - 1.0f); }    //Pixel Shader  PSO PS(VSO input) {  //Initialize Output   PSO output;  //Pass Albedo from Texture   output.Albedo = tex2D(AlbedoSampler, input.UV); //Pass Extra - Can be whatever you want, in this case will be a Specular Value   output.Albedo.w = tex2D(SpecularSampler, input.UV).x;  //Read Normal From Texture   half3 normal = tex2D(NormalSampler, input.UV).xyz * 2.0f - 1.0f;  //Transform Normal to WorldViewSpace from TangentSpace  normal = normalize(mul(normal, input.TBN));  //Pass Encoded Normal = encode(normal); //Pass this instead to disable normal mapping  // = encode(normalize(input.TBN[2]));    //Pass Extra - Can be whatever you want, in this case will be a Specular Value  output.Normals.w = tex2D(SpecularSampler, input.UV).y;  //Pass Depth(Screen Space, for lighting)  output.Depth = input.Depth.x / input.Depth.y;  //Pass Depth(View Space, for SSAO)  output.Depth.g = input.Depth.z;  //Return Output   return output; }  //Technique  technique Default { pass p0 {     VertexShader = compile vs_3_0 VS();     PixelShader = compile ps_3_0 PS(); } } 

This is my current shader… it is producing a “Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection” argumente axeception… I don’t understand what’s wrong with it….

Any help is appreciated.

Rackoff’s coverability bounds in case the addition vectors of VAS and the target vector are from {-1, 0, +1}?

In “The covering and boundedness problems for vector addition systems”, Rackoff considers a VAS $ (v,A)$ of dimension $ k$ and size $ n$ and derives an upper bound of $ 2^{2^{(\log_2 3)n(\log_2 n)}}$ on the length of nonnegative covering executions.

Let us consider the case $ A\subseteq \{-1,0,+1\}^k$ , $ v\in\mathbb{N}_{\geqslant 0}^k$ and the vector to cover being from $ \{0,1\}^k$ .

What would be a good upper bound on the length of covering nonnegative executions in terms of $ k$ ? Using Rackoff’s Thm. 3.5, $ \lvert A\rvert \leqslant 3^k$ and $ n=\mathcal{O}(3^k+\|v\|_1)$ (where $ \|\cdot\|_1$ returns the 1-norm of a vector) would yield an upper bound of $ 2^{2^{\mathcal{O}(3^k+\|v\|_1)\log_2(3^k+\|v\|_1)}}$ . We need to remove the dependency of the bound on $ v$ and tighten the bound.

It seems to me that a better bound would result from a better bound on $ f(k)$ with respect to $ k$ (rather than to $ n$ ), where $ $ f(0)=1$ $ and $ $ f(i+1)\leqslant (2^n f(i))^{i+1} + f(i)\qquad\text{for $ i\in \mathbb{N}_{\geqslant 0} \cap [0,k[$ }.$ $ Any ideas of how to bound $ f(k)$ by an expression in $ k$ (where $ n$ is dervied from our setup)? If I interpret the proof of Thm. 3.5 correctly, we could probably get something like $ 2^{(3k)^k}$ as an upper bound on the length of covering nonnegative executions. Can you confirm or reject this or provide further ideas or literature citations?