I need to play some audio files in loop without spaces in Flutter. I tried to use the "audioplayers" package with MP3 and OGG formats. And also tried to start before the end of the file, without success. Is there any cross platform solution for that? Crossfade looping is also the solution, but I can't find the package for this.

# Tag: loop

## How could I resolve the newly installed RAM that causes the infinite reset loop?

I am trying to update the RAM of an old laptop. I don't have many specifications, but the ones I have:

- Previous RAM: Hynix PC2-5300 (DDR2-667) 1 GB 667 MHz SO-DIMM
- New RAM: Corsair ValueSelect VS4GSDSKIT800D2 4GB DDR2 (SODIMM) 800Mhz

(Let me know if more information is required)

Every time I replace these, the laptop starts to reboot constantly (it doesn't even reach the Windows screen).

When I replace the old ones, the laptop seems to work fine. Are the new RAM memories that I am trying to place not compatible? Or are they defective? What exactly does the problem I have mean?

## nonlinear: ODE nonlinear closed loop system and response

I started using Mathematica 12 and had difficulties. That is, I want to compare the results of the calculation of a closed Simulink system and in Mathematica.

I searched the Internet a bit and found an implementation of non-linear state spaces. Having written my code, I found a difficulty, namely the implementation of the integration.

Help me to understand.

https://reference.wolfram.com/language/ref/NonlinearStateSpaceModel.html

```
nsys = NonlinearStateSpaceModel[{{u Subscript[x, 2], Subscript[x, 2] == Integral[Subscript[x, 1]]}, {Subscript[x, 2]}}, {Subscript[x, 1], Subscript[x, 2]}, u]
OutputResponse[nsys, Sin
Plot[%, {t, 0, 5}]
```

## python: move objects in loop in graphics.py

While it seems to be on the right track, its code still has a `global`

variable that you don't need. You can simplify that code a lot using something like this:

```
OFFSETS = {"w": (0, -1), "Up": (0, -1), # weird coordinate system...
"a": (-1, 0), "Left": (-1, 0),
"s": (0, 1), "Down": (0, 1),
"d": (1, 0), "Right": (1, 0)}
def get_offsets():
for key, offset in OFFSETS.items():
if keyboard.is_pressed(key):
return offset
return 0, 0
```

This only returns a tuple of changes for each key defined, and zero otherwise.

You should do as little as possible within your cycle (since that affects performance). You can configure the graphic options once before the cycle if you then continue to modify the objects instead. With the `Rectangle`

that's easy, since you can overwrite the `p1`

Y `p2`

attributes Both `Point`

objects have an internal `_move`

method you can use (or code it yourself):

```
class Point:
...
def _move(self, dx, dy):
self.x += dx
self.y += dy
```

Another small performance optimization is to do nothing if the rectangle does not move. I would also add a `if __name__ == "__main__":`

protect to allow import from this module without running the game and follow the official Python style guide, PEP8, which recommends adding spaces around operators. It also recommends placing imports of different modules on separate lines and not using unnecessary parentheses.

With these changes you get this for your `main`

:

```
def main():
x = 0
y = 0
radius = 10
speed = 20
lower_left = Point((width / 2) - radius, (height / 2) - radius)
upper_right = Point((width / 2) + radius, (height / 2) + radius)
player = Rectangle(lower_left, upper_right)
player.setFill("green")
player.setWidth(2)
player.draw(win)
while True:
dx, dy = get_offsets()
if dx != 0 or dy != 0:
player.undraw()
dx, dy = dx * speed, dy * speed
lower_left._move(dx, dy)
upper_right._move(dx, dy)
player.p1, player.p2 = lower_left, upper_right
player.draw(win)
update(10)
if __name__ == "__main__":
main()
```

In addition, you may want to search for a different keyboard event handler, the `keyboard`

The module requires administrator rights (at least on UNIX). I know that I would certainly not just run a game that needs that. In other words, I would at least read all the source code so that there is no hidden exploit in it (which was still possible with the code you have so far), but I will probably stay on the safe side and not play it at all.

## Using .htaccess to redirect traffic causes a redirect loop

I am trying to redirect users to a different url when they access my web application from a particular url. For example, if they use `1.2.3.4:80`

To visit the web application, I want to redirect them to `1.2.3.5:8989`

.

This is my `.htaccess`

case file:

```
RewriteEngine On
RewriteCond %{HTTP_HOST} !http://1.2.3.4:80$ (NC)
RewriteRule ^(.*)$ http://1.2.3.5:8989$1 (L,R=301)
```

When I access the site using `1.2.3.4:80`

redirects to `1.2.3.5:8989`

but repeatedly concatenates it in the url bar. For example:

`1.2.3.5:8989/1.2.3.5:8989/1.2.3.5:8989/1.2.3.5:8989`

etc.

I also get the error `ERR_TOO_MANY_REDIRECTS`

.

## Reinvent the wheel: Truncate the list in Python so that the loop skips the first item in the list?

I'm reimplementing the `min()`

It works like an exercise (EDIT: not all the functionality of the python std library function, just the minimum of a list of numbers). Here is my code:

```
def my_min(num_list):
minimum = num_list(0)
for num in num_list(1:):
if num < minimum:
minimum = num
return minimum
```

My question is: how bad is it? `num_list(1:)`

in the for loop? And are there other optimizations I could do to the code?

My intention when truncating the list is to avoid comparing the first element of the list with itself. While it is insignificant in terms of wasted time and resources, it seems to me that it lacks elegance.

## java – Infinite Loop in the AStar algorithm (A *)

Very well, I have encountered a problem in which when I try to find a path that cannot be reached because it is blocked, it will be repeated and repeated continuously (the list & # 39; open & # 39; is ALWAYS full). I understand that the open set cannot contain things that the closed set contains. I can't understand where the open set is getting things from the closed set.

I make sure to check if the neighbor is inside the closed set, so it should not be added to the open set. I'm confused…

```
public static LinkedList
``` findPath(World world, Node start, Node goal) {
final PriorityQueue open = new PriorityQueue<>();
final HashSet closed = new HashSet<>();
open.add(start.setHeuristic(start.heuristic(goal)));
Node current = null;
Node best = start;
while (!open.isEmpty()) {
current = open.poll();
if (current.equals(goal))
return construct(start, current);
closed.add(current);
Tile tile = world.getTile(current.getX(), current.getY(), current.getZ());
ArrayList neighbors = tile.getNeighbors();
for (Tile n : neighbors) {
if (n == null)
continue;
Node neighbor = new Node(n.getGlobalX(), n.getGlobalY(), n.getZ(), current);
neighbor.setCost(neighbor.distance(current));
neighbor.setHeuristic(neighbor.heuristic(goal));
if (closed.contains(neighbor))
continue;
closed.add(neighbor);
if (!n.isWalkable())
continue;
if (neighbor.equals(goal))
return construct(start, neighbor);
double tentative_cost = current.getCost() + current.distance(neighbor);
if (!open.contains(neighbor) || tentative_cost < neighbor.getCost()) {
best = neighbor;
neighbor.setCost(tentative_cost);
open.add(neighbor);
}
}
}
return construct(start, best);
}
private static LinkedList construct(Node start, Node goal) {
LinkedList path = new LinkedList<>();
Node last = goal;
while (!last.equals(start)) {
path.addFirst(last);
last = last.getParent();
}
path.addFirst(start);
return path;
}

Node class

```
package com.entity.world.path;
import java.util.Objects;
/**
* @author Albert Beaupre
*
*/
public class Node implements Comparable
``` {
private final int x, y, z;
private final Node parent;
private double cost, heuristic;
public Node(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
parent = this;
}
public Node(int x, int y, int z, Node parent) {
this.x = x;
this.y = y;
this.z = z;
this.parent = parent;
}
public double distance(Node from) {
double dx = Math.pow(Math.abs(from.x - x), 2);
double dy = Math.pow(Math.abs(from.y - y), 2);
return Math.sqrt(dx + dy);
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getZ() {
return z;
}
public Node getParent() {
return parent;
}
public double getCost() {
return cost;
}
public Node setCost(double cost) {
this.cost = cost;
return this;
}
public double getHeuristic() {
return heuristic;
}
public Node setHeuristic(double heuristic) {
this.heuristic = heuristic;
return this;
}
public double getF() {
return cost + heuristic;
}
public double heuristic(Node goal) {
double dx = Math.abs(x - goal.x);
double dy = Math.abs(y - goal.y);
return Math.sqrt(dx + dy);
}
@Override
public int hashCode() {
return Objects.hash(x, y, z);
}
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (o instanceof Node) {
Node n = (Node) o;
return x == n.x && y == n.y && z == n.z;
}
return false;
}
/**
* {@inheritDoc}
*/
public String toString() {
return "(x=" + x + ", y=" + y + ")";
}
/*
* (non-Javadoc)
*
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public int compareTo(Node o) {
return Double.compare(getF(), o.getF());
}
}
```

## Rt representation theory: strong conjecture without loop for uniserial modules

Leave $ A $ Be an algebra of Artin. The strong conjecture without loop indicates that a simple $ A $-module with $ Ext_A ^ 1 (S, S) neq 0 $ It has infinite projective dimension.

This conjecture was recently demonstrated for quiver algebras and, therefore, finite-sized algebras on an algebraically closed field at https://www.sciencedirect.com/science/article/pii/S0001870811002714.

Question: A uniserial $ A $-module $ M $ with $ Ext_A ^ 1 (M, M) neq 0 $ have infinite projective dimension?

## In a subset of $ mathbb {R} ^ 2 $ that is not simply connected, is there a simple loop that does not contract at one point?

Earlier I asked In what topological spaces the existence of a non-contractable loop to a point implies that there is also a simple non-contractable loop?

Given the wide scope of this question, I propose this special case as an independent question:

In a subset of $ mathbb {R} ^ 2 $ that is not simply connected, is there a simple loop that does not contract to a point?

## Factory reset (software repair) Sony Xperia XCompact (and all other Xperia smartphones) that have software problems such as a boot loop

I would like to share how you can reset your Xperia even if it no longer starts (starts)! Not only does it help break a boot loop, it also helps unlock your phone if you forgot your smartphone's lock credentials. Of course, your data on the phone will be deleted.

I will answer my question immediately, which is allowed by the battery exchange rules (at least it used to be)