class A:
def __init__(self, a = []):
self.a = a
class B(A):
pass
o1 = A()
o2 = B()
o1.a.append(17)
print(o1.a)
# [17]
print(o2.a)
# [17]
self.a
для всех экземпляров, созданных без передачи параметра в конструктор, ведут на один и тот же объект список. -render(request, 'NotAnApplication/just.html')
+return render(request, 'NotAnApplication/just.html')
$rsMyCredits = $objDBCD14->queryUniqueObject(
"SELECT Balance FROM tbl_users WHERE UserId = '" . $rs->UserId . "' FOR UPDATE"
);
As the URL is like any other URL, special characters such as those that may be used in the password need to be URL encoded to be parsed correctly.
$stmt = $connection->prepare("INSERT INTO UserStreetid(Id, Streetid) VALUES (?, ?) ON DUPLICATE KEY UPDATE Streetid = ?");
$stmt->bind_param("iii", $datatopush[0], $datatopush[1], $datatopush[1]);
if (!$stmt->execute())
echo"Error:".$qpush."<br>".mysqli_error($connection);
If you are already running mysql, you can execute an SQL script file using the source command or \. command:
mysql> source file_name mysql> \. file_name
create table t (col jsonb);
create index ix_t_col using gin(to_tsvector('pg_catalog.english', jsonb_path_query_array(col, '$.obj.TEXT')));
insert into t values('{
"obj": [
{
"TEXT": "These functions act like their counterparts described above without the _tz suffix, except that these functions support comparisons of date/time values that require timezone-aware conversions.",
"key1": 77,
"key2": "a"
},
{
"TEXT": "Returns target with new_value inserted. If the item designated by the path is an array element, new_value will be inserted before that item if insert_after is false (which is the default), or after it if insert_after is true. If the item designated by the path is an object field, new_value will be inserted only if the object does not already contain that key",
"key1": 99,
"key2": false
}
]
}');
select ts_headline(col, 'function'::tsquery),
ts_headline(arr, 'function'::tsquery)
from (
select col, jsonb_path_query_array(col, '$.obj.TEXT') arr,
to_tsvector('pg_catalog.english', jsonb_path_query_array(col, '$.obj.TEXT')) tsv
from t
) q
where tsv @@ 'function'::tsquery;
jsonb_path_query_array(col, '$.obj.TEXT')
- выделяет все, что у вас по ключу TEXT в массив. Дальше он индексируется "--" . $boundary . "--";
.a**num
будет очень медленным. В питоне есть функция pow, которая имеет волшебный третий параметр и умеет вычислять возведение в степень по модулю очень быстро. PostgreSQL 9.4.13 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
Django supports PostgreSQL 10 and higher. psycopg2 2.8.4 or higher is required, though the latest release is recommended.
host all all all md5
.