Posts

Showing posts from December 10, 2018

Unexpected behavior of doctrine entity manager

Image
up vote 0 down vote favorite I have a helper service that links me to a database on the fly. $databaseName = 'db_x'; $em = $this->entityManagerProvider->get($databaseName); I can use this entity manager like this: $car = new Car(); $car->setName('Audi'); $em->persist($car); $em->flush(); It works good! Object was inserted to my db_x But If I run repository method on this entity manager: $em->getRepository('AppEntityCar')->findById(1); Then entity manager try run on my default database, not db_x. How it is possible? My service to switch database: namespace AppUtilsDatabase; use DoctrineORMEntityManager; use DoctrineORMEntityManagerInterface; class EntityManagerProvider { /** * @var EntityManagerInterface */ protected $entityManager; ...

Can all of the first and second differences of a Costas array be at least 3 in magnitude?

Image
up vote 0 down vote favorite A Costas array $pi = d_1 d_2 ldots d_n$ (one-line form) of order $n$ is a permutation $pi in S_n$ such that the $n-r$ differences $d_{r+1} - d_{1} , d_{r+2} - d_{2} , ldots , d_n - d_{n-r}$ are distinct for each $r$ , $1 leq r leq n-1$ . Find an example of a Costas array $pi$ for some $n$ such that the $2n-3$ inequalities $|d_2 - d_1| , |d_3 - d_2| , ldots , |d_n - d_{n-1}| geq 3$ and $|d_3 - d_1| , |d_4 - d_2| , ldots , |d_n - d_{n-2}| geq 3$ hold or else prove that no such permutation exists. Remarks: No such Costas arrays have been found using Beard's database of Costas arrays out to order $1030$ (the database is available at https://ieee-dataport.org/open-access/costas-arrays-and-enumeration-order-1030 and is exhaustive out to order $29$ .) Costas arrays are known to e...