system modeler – How to perform the return flow from one volume to the higher volume by modeling language?

It is a simple idea that I want to solve the same equations in a finite volume when the variable x of the next volume is calculated smaller than 0. Due to the characteristic of the modeling language, it is really difficult for me to do the cycle. I hope someone can help me with this. Thank you!

model Model
  parameter Real L = 10;
  parameter Real r = 5;
  parameter Integer N = 20;
  Real x(N)(each start = 0);
  if noEvent(x(1) >= 0 and x(1) < L) then 
    der(x(1)) = r;
    der(x(1)) = 0;
  end if;
  for i in 2:N loop 
    if noEvent(x(i - 1) >= L and x(i) >= 0 and x(i) < L) then 
      der(x(i)) = r - 1 * time;
    elseif noEvent(x(i) < 0) then 
      der(x(i - 1)) = r - x(i - 1);
      der(x(i)) = 0;
    end if;
  end for;
end model;

The code simply cannot dose when the time> 8s. And the Mworks show the message:

Error: Failed to solve linear system at Time = 7.99999989157494
Error: Failed to solve linear system at Time = 7.99999989157489
Error: Failed to solve linear system at Time = 7.99999989157489

postgresql – How to return unique classified results?

I have a database with the results of the races. Each race has the name of the competitor and the time they obtained in that range. If I wanted to return the top 10 competitors by time, how can I do that? I can already return the 50 best times / races, but I am not sure how to return to the 50 best runners, so that the time shown is the best.

javascript – Return value from an id in Angular with Firebase

I am creating an online store in Angular, where I ready the products by category, I would like you to call {{product.id_category}} instead of giving me only the long ID that Firebase has, I would like that by some function or pipe I am not sure, I will return the name of the category that I also have saved in another list in Firebase.

I have seen several Angular tutorials, however none with this characteristic of knowing any I will be grateful they recommend.

international travel – H1 visa holder – 2 return flights instead of multi-city flights

I am planning to travel to India from the United States through London.
I am an H1 holder with a valid visa stamp.

Now, instead of booking a SFO-> LON-> BOM-> SFO Multicity ticket, I am planning to book 2 return flights: SFO<->Lon and Lon<->BOM, since this is much cheaper.

The only thing here is that I will have to make sure I have enough time to return to London, since I will have to check-out and check-in again.

Could someone suggest if this is feasible and any other complications that may arise due to the status of my visa?
Would American immigration take place at the London airport?

Thank you.

web applications: how to return the results of asynchronous tasks to a web page

I have a web API implemented in a flask (python) that provides a URL endpoint that a user can access.

Use Celery Task Queues to start tasks that may take 5 minutes to process.

At the moment, my API returns a 202 immediately while the task is being processed.

How do I return the result of an asynchronous task to a web page?

amazon web services – Asymmetric return paths in a with a NAT in a VPC?

To better understand how AWS VPCs (and NATs in general) work, I was reading this question where the goal was to have the following:

# GOAL   local
A.B.C.D/32      nat-451b3be9       igw-b4ac67d0  

This is what intrigued me:

Also note that the configuration you are trying will allow outbound connections, but will never allow incoming connections (initiated from outside) from the ABCD address to anything on this subnet, because the return path is asymmetric through the NAT gateway .

The NAT gateway is not designed to be created on any subnet for which it provides NAT services. Instances reach external resources through the route table of their subnet (points to NAT-GW for instances without public IP, points to IGW for instances with public IP) and NAT-GW reaches the Internet through its route table Subnet (points to IGW).

If an instance is using its own public IP, it must route the responses through IGW because that is where the incoming traffic comes from, and it cannot attempt to exit through NAT-GW because the outside pair would see the response coming from the source Incorrect IP if traffic was translated.

I am trying to understand exactly why I would allow outbound but not inbound traffic. This is what I am thinking: let's say the EC2 instance has an elastic IP and is in a subnet with a routing table like the previous one. The NAT is then in a separate subnet. Tell A.B.C.D initiated a connection to the elastic IP of EC2. The connection would not enter the VPC, would the routing table send it through NAT, which would then go to the instance and then return through NAT? However, since it was sent through NAT, the address was translated (as stated above) and the same would drop the packet since it did not come from the IP of the EC2 instance. Is this the right understanding? It will still reach the EC2 instance, but the response packets will never be received by A.B.C.D?

exploit – apache struts 2 s2-057 does not return shell?

I do a pentest for a private server protected by Cloudflare. I already omit WAF and obtained the real IP for the server, then I scanned it by acunetix and found a:
Apache Struts2 Remote Command Execution (S2-052)

** note : please dont give me bad rate for my bad english ... sorry

POST /ar/ictc/news.jsp HTTP / 1.1 Content Type: application / xml
Connection: cookie to keep alive:
JSESSIONID = 52BBFD11275ED433FC29F21A17E0CC58; __ cfduid = dc8abdec85d56bcd4bd2106719f5ac58f1565510723; PHPSESSID = 54a4gj6btfcigqbupokaa2rli0
Authorization: Basic YW5vbnltb3VzOmFub255bW91cw == Accept: / /
Accept-Coding: gzip, deflate Content length: 5650 Host:
User Agent: Mozilla / 5.0 (Windows NT 6.1; WOW64) AppleWebKit / 537.21
(KHTML, like Gecko) Chrome / 41.0.2228.0 Safari / 537.21

When I try to exploit it, I used the ping -n myserverip command to capture the ping request by tcpdump without success 🙁 and I try to get the reverse shell by netcat and by python and … etc. without success
The payload I used:


I don't know what the problem is and why I didn't get shellback. when I scan the server after overlooking WAF by nmap it shows that there is no firewall

Watch this :

Before BYPASS cloudflare:
enter the description of the image here

After BYPASS cloudflare:
enter the description of the image here

c – Chain-based return function pointer

I have the following function that takes a string and returns a function pointer; it is currently a long if-else block; that continues to grow this will make it difficult to maintain.

The logic of this function is repeated but the type of return has changed.

typedef int (*FP)(char** params, int numberOfParams); 
typedef int (*FP1)(int x); 

static FP getFunction1(char* name)
  if(strcmp(name, "str1") == 0)
      return fun1; 
  else if(strcmp(name, "str2") == 0)
      return fun2; 

static FP1 getFunction2(char* name)
  if(strcmp(name, "str1") == 0)
      return fun3; 
  else if(strcmp(name, "str2") == 0)
      return fun4; 

Is there a better way to refactor this to eliminate duplicate code?

Graphical user interface design: why do scroll bars return to the original scroll distance when the mouse is dragged too sideways?

I think it is a means to provide the ability to cancel a half executed command. Imagine that a user has 45% less than a long page. The user tries to perform a drag operation on the contents of the window (perhaps to move an icon or select text), but accidentally "catches" the slider on the scroll bar, which causes the page to move to X % down and let the user have to try to find their original place. To mitigate this scenario, the scroll bar is designed so that users can "scroll" from the slider and therefore cancel the command. Since scrolling occurs as the slider moves, users can see that they scroll instead of selecting text or any other reason, so they have the opportunity to realize the error and recover before releasing the button of the mouse

This behavior is not exclusive to scroll bars. Command buttons, menu items, check boxes and option buttons are also canceled if the user turns the control without releasing the mouse button. These other controls do so with approximately 0 pixel deviation. I think that the slider on the scroll bar has a "buffer zone" of ~ 100 pixels because dragging is difficult to do, so it allows the user a range of error when deliberately scrolling to avoid accidentally canceling a scroll.

I don't know if it really works. That is, I don't know if users who accidentally activate these controls react by turning the control without releasing the mouse button. I guess the vast majority of users (and not a few UI designers) are unaware of this feature of the controls. On the other hand, perhaps the natural reaction to clicking wrongly on something is "jumping", a generalization of proximity heuristics. Maybe users make these cancellations without really realizing.