Мне 14, и это лето я решил посветить изучению языка c++, в то время , как мои одноклассники курят, и считают это чем-то крутым.
Я хочу создавать игры на языке c++
возможно ли, создать хороший проект одному?
И вообще, какой уровень знаний нужен для этого?
Я просто сомневаюсь, что valve может нанять таких людей в backend
$str = '1234145577';
$mask = '+7(###)###-##-##';
$i = 0;
$result = preg_replace_callback(
'/#/',
function ($m) use ($str, &$i) {
return $str[$i++] ?? $m[0];
},
$mask
);
echo $result;
Смысл двух разных вариантов для операторов "and" и "or" в том, что они работают с различными приоритетами (смотрите таблицу Приоритет выполнения операторов).
&&
- 15 строка, =
- 19 строка, and
- 23 строка.$bool = true and false;
=> ($bool = true) and false;
$bool = true && false;
=> $bool = (true && false);
str.split('=').pop()
// или
str.slice(str.indexOf('=') + 1)
str.replace(/[^=]*=/, '')
// или
str.match(/(?<==).*/)[0]
// или
/[^=]*$/.exec(str).shift()
new URLSearchParams(str).get('sort')
DO UPDATE SET ... WHERE condition
melkij=> create temp table foo (item int primary key, d date, price numeric);
CREATE TABLE
melkij=> insert into foo values (1, '2021-07-30', 100) on conflict (item) do update set price = excluded.price, d = excluded.d where excluded.d > foo.d;
INSERT 0 1
melkij=> table foo;
item | d | price
------+------------+-------
1 | 2021-07-30 | 100
(1 строка)
melkij=> insert into foo values (1, '2021-08-01', 110) on conflict (item) do update set price = excluded.price, d = excluded.d where excluded.d > foo.d;
INSERT 0 1
melkij=> table foo;
item | d | price
------+------------+-------
1 | 2021-08-01 | 110
(1 строка)
melkij=> insert into foo values (1, '2021-07-20', 80) on conflict (item) do update set price = excluded.price, d = excluded.d where excluded.d > foo.d;
INSERT 0 0
melkij=> table foo;
item | d | price
------+------------+-------
1 | 2021-08-01 | 110
(1 строка)
[[:<:]], [[:>:]]
These markers stand for word boundaries.
The Spencer library supports word-beginning and word-end boundary markers ([[:<:]] and [[:>:]] notation). ICU does not. For ICU, you can use \b to match word boundaries; double the backslash because MySQL interprets it as the escape character within strings.
fs.writeFile(file, data[, options], callback)#
History:
- file
<string> | <Buffer> | <URL> | <integer>
filename or file descriptor- data
<string> | <Buffer> | <TypedArray> | <DataView> | <Object>
- options
<Object> | <string>
- encoding
<string> | <null>
Default: 'utf8'- mode
<integer>
Default: 0o666- flag
<string>
See support of file system flags. Default: 'w'.- signal
<AbortSignal>
allows aborting an in-progress writeFile- callback
<Function>
- err
<Error> | <AggregateError>
When file is a filename, asynchronously writes data to the file, replacing the file if it already exists. data can be a string or a buffer.
When file is a file descriptor, the behavior is similar to calling fs.write() directly (which is recommended). See the notes below on using a file descriptor.
The encoding option is ignored if data is a buffer.
If data is a plain object, it must have an own (not inherited) toString function property.
...
fs.write
). После этого нужные пункты оглавления подсветятся желтым и вы легко найдете нужный. with recursive cat as (
select id, id top from landcategory where parent_id is null
union
select lc.id, top from landcategory lc join cat on (cat.id = lc.parent_id)
)
select lc.*, childs from landcategory lc join (
select top, array_agg(id) childs from cat
group by 1
) t on (t.top = lc.id)