Ejemplo n.º 1
0
 public function testInsertWithClearRequired()
 {
     $n = 0b10001111100;
     $m = 0b10011;
     $i = 2;
     $j = 6;
     $this->assertEquals(0b10001001100, Insertion::insert($n, $m, $i, $j));
 }
Ejemplo n.º 2
0
 public static function insert($label, $tex)
 {
     $number = Insertion::Label($label);
     Insertion::Init('left', 0);
     echo '$$' . $tex . '$$' . PHP_EOL;
     Insertion::Col('right');
     echo 'Eqn [' . $number . ']' . PHP_EOL;
     Insertion::Fini();
 }
Ejemplo n.º 3
0
 public function deleteAction($id)
 {
     $id = $this->filter->sanitize($id, array("int"));
     $insertion = Insertion::findFirst('id="' . $id . '"');
     if (!$insertion) {
         $this->flash->error("insertion was not found");
         return $this->dispatcher->forward(array("controller" => "insertion", "action" => "index"));
     }
     if (!$insertion->delete()) {
         foreach ($insertion->getMessages() as $message) {
             $this->flash->error((string) $message);
         }
         return $this->dispatcher->forward(array("controller" => "insertion", "action" => "search"));
     } else {
         $this->flash->success("insertion was deleted");
         return $this->dispatcher->forward(array("controller" => "insertion", "action" => "index"));
     }
 }