Commit 67ccb534 authored by Antonios Angelakis's avatar Antonios Angelakis

Finish figures and listings

parent 97787d6f
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
author="Admin" inputFile="titlos.in" outputFile="titlos.out"> author="Admin" inputFile="titlos.in" outputFile="titlos.out">
<Keyword code="alg.geometry"/> <Keyword code="alg.geometry"/>
<ProblemStatement> <ProblemStatement>
Problem statement and description. Problem statement and description.
</ProblemStatement> </ProblemStatement>
...@@ -17,15 +18,15 @@ ...@@ -17,15 +18,15 @@
</OutputFormat> </OutputFormat>
<ProblemConstraints> <ProblemConstraints>
$1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$ $1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$
</ProblemConstraints> </ProblemConstraints>
<Sample rank="1"> <Sample rank="1">
<SampleIn> <SampleIn>
3 3
1 2 3 1 2 3
4 5 6 4 5 6
7 8 9 7 8 9
</SampleIn> </SampleIn>
<SampleOut> <SampleOut>
6 6
...@@ -38,7 +39,10 @@ $1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$ ...@@ -38,7 +39,10 @@ $1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$
<Import guid="std.testlib.1.1" type="checker" /> <Import guid="std.testlib.1.1" type="checker" />
<Checker name="ch" src="check.dpr" style="testlib"/> <Checker name="ch" src="check.dpr" style="testlib"/>
<TestRange from="1" to="42"><In src="tests/%0n"/><Out use="sol"/></TestRange> <TestRange from="1" to="42">
<In src="tests/%0n"/>
<Out use="sol"/>
</TestRange>
</Problem> </Problem>
</CATS> </CATS>
<?php <?php
// Connecting to a MySQL database
$user = "root"; $user = "root";
$pass = "root"; $pass = "root";
$dsn = "mysql:host=localhost;dbname=test";
$charset = "utf8"; $charset = "utf8";
$dsn = "mysql:host=localhost;dbname=test;charset=$charset";
$dbh = new PDO('mysql:host=localhost;dbname=test;charset=$charset', $user, $pass); $db = new PDO($dsn, $user, $pass);
?>
<?php
$query = "SELECT * FROM foo WHERE bar = " . $db->quote($zip); // Executing a simple query
$val = 42;
$query = "SELECT * FROM foo WHERE bar = " . $db->quote($val);
$result = $db->query($query); $result = $db->query($query);
while($row = $result->fetch(PDO::FETCH_ASSOC)) { while($row = $result->fetch(PDO::FETCH_ASSOC)) {
print_r($row); print_r($row);
} }
?>
<?php // Sequential executions of a prepared statement
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)"); $query = "INSERT INTO REGISTRY (name, value)
VALUES (:name, :value)";
$stmt = $db->prepare($query);
$stmt->bindParam(':name', $name); $stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value); $stmt->bindParam(':value', $value);
// insert one row // First execution
$name = 'one'; $name = 'one';
$value = 1; $value = 1;
$stmt->execute(); $stmt->execute();
// insert another row with different values // Second execution with different values
$name = 'two'; $name = 'two';
$value = 2; $value = 2;
$stmt->execute(); $stmt->execute();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment