$numbers = 2;
for ($i = 0; $i < 14; $i++)
{
$numbers .= mt_rand(0, 9);
}
$l_1 = ($numbers[0] * 2) >= 10 ? ($numbers[0] * 2) - 9 : $numbers[0] * 2;
$l_2 = ($numbers[2] * 2) >= 10 ? ($numbers[2] * 2) - 9 : $numbers[2] * 2;
$l_3 = ($numbers[4] * 2) >= 10 ? ($numbers[4] * 2) - 9 : $numbers[4] * 2;
$l_4 = ($numbers[6] * 2) >= 10 ? ($numbers[6] * 2) - 9 : $numbers[6] * 2;
$l_5 = ($numbers[8] * 2) >= 10 ? ($numbers[8] * 2) - 9 : $numbers[8] * 2;
$l_6 = ($numbers[10] * 2) >= 10 ? ($numbers[10] * 2) - 9 : $numbers[10] * 2;
$l_7 = ($numbers[12] * 2) >= 10 ? ($numbers[12] * 2) - 9 : $numbers[12] * 2;
$l_8 = ($numbers[14] * 2) >= 10 ? ($numbers[14] * 2) - 9 : $numbers[14] * 2;
$str = $l_1 + $l_2 + $l_3 + $l_4 + $l_5 + $l_6 + $l_7 + $l_8;
$str = $str + $numbers[0] + $numbers[2] + $numbers[4] + $numbers[6] + $numbers[8] + $numbers[10] + $numbers[12] + $numbers[14];
$l = 0;
for (; ($str % 10) !== 0; $str++) $l++;
$numbers .= $l;
public class Ctls{
public const string Text = "System.Windows.Forms.TextBox Text: ";
}
if(Ctls.Text == obj.Name) /* do something*/;
Єсть строка var obj = (Control)sender; надо узнать кокой компонент шас находиться в obj например Label или TextBox.
if(sender is Label){
}
else if(sender is TextBox){
}
else{
// что то по умолчанию
}
а какой минимальный набор знаний нужно иметь чтобы
получить первую работу фронтендом
но не больше 6 месяцев
using System;
using System.Diagnostics;
namespace ConsoleApp19 {
class Program {
struct Cell {
public string type;
public string player;
public bool isUnit;
}
public static void Main() {
const int size = 1_000;
object[,,] objs = new object[size, size, 3];
Cell[,] cells = new Cell[size, size];
Stopwatch timer = new Stopwatch();
timer.Start();
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
objs[i, j, 0] = "type";
objs[i, j, 1] = "player";
objs[i, j, 2] = false;
string type = (string)objs[i, j, 0];
string player = (string)objs[i, j, 1];
bool isUnit = (bool)objs[i, j, 2];
}
}
timer.Stop();
Console.WriteLine(timer.ElapsedMilliseconds);
timer.Reset();
timer.Start();
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
cells[i, j].type = "type";
cells[i, j].player = "player";
cells[i, j].isUnit = false;
string type = cells[i, j].type;
string player = cells[i, j].player;
bool isUnit = cells[i, j].isUnit;
}
}
timer.Stop();
Console.WriteLine(timer.ElapsedMilliseconds);
}
}
}
$text = 'клиент: краеугольный менеджер: желтый цвет';
$pattern = '/(клиент|менеджер):\h*(.*?)\h*(?=$|клиент:|менеджер:)/';
preg_match_all($pattern, $text, $matches);
$result = array_combine($matches[1], $matches[2]);
var_dump($result);