from yolo import YOLO
yolo = YOLO()
image_path = "foto.png"
detections = yolo.predict(image_path)
for detection in detections:
print(detection)
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
Console.WriteLine(dialog.SelectedPath);
}
/\bлох\b/gi
string inputText = "Привет, меня зовут Иван и я не лох";
string pattern = @"/\bлох\b/gi";
string replacement = "";
string result = Regex.Replace(inputText, pattern, replacement);
Debug.Log(result);
if (enemes.Count > 0) {
target = enemes[0];
Distance = Vector3.Distance(enemes[0].transform.position, transform.position);
SeeEnemy = true;
if (enemes.Count >= 2)
for (int i = 1; i != enemes.Count; i++)
if (Vector3.Distance(enemes[i].transform.position, transform.position) < Distance) {
Distance = Vector3.Distance(enemes[i].transform.position, transform.position);
target = enemes[i];
}
}
if (other.tag == "Enemy")
{
enemes.Remove(other.gameObject);
if (enemes.Count == 0) {
transform.parent.gameObject.GetComponent().NoTarget();
} else {
transform.parent.gameObject.GetComponent().PlayerVision(enemes);
}
}
Collider2D[] Player = Physics2D.OverlapCircleAll(attackPos.position, attackRange, player);
for (int i = 0; i < Player.Length; i++)
{
GameObject playerObject = Player[i].gameObject;
playerObject.GetComponent<SomeComponent>().TakeDamage(damage);
}
User::observe(UserObserver::class);
import { useHistory } from 'react-router-dom';
function handleSubmit(event) {
event.preventDefault();
// Получаем значения из инпутов
const input1 = event.target.input1.value;
const input2 = event.target.input2.value;
// Проверяем, заполнены ли инпуты
if (!input1 || !input2) {
// Если нет, выполняем редирект на специальную страницу ошибок
const history = useHistory();
history.push('/error');
return;
}
// Если инпуты заполнены...
}
render() {
return (
<form onSubmit={handleSubmit}>
<input name="input1" />
<input name="input2" />
<button type="submit">Submit</button>
</form>
)
}
async def init_after(ctx):
asyncio.create_task(Song.my_after(ctx))
async def play(ctx):
# ...
await ctx.send("Сейчас играет: {}".format(names[0]))
async def init_after(ctx):
# ...
await ctx.send("Сейчас играет: {}".format(names[0]))
using MySql.Data.MySqlClient;
string connectionString = "server=yourserver;user id=yourusername;password=yourpassword;database=yourdatabase";
MySqlConnection connection = new MySqlConnection(connectionString);
connection.Open();
class PopupHandler {
private ajax: Ajax;
constructor() {
this.ajax = new Ajax();
}
open(action: string, title: string): void {
this.ajax.setRequest({ action, title });
this.ajax.resultProcessing('.popup__ajax');
}
}
const handler = new PopupHandler();
<a href="#popup" class="popup-link" onclick="handler.open('two', '#TWO')">Попап №2</a>
Assembly assembly = Assembly.LoadFrom(@"путь к скомпилированному файлу");
Stream stream = assembly.GetManifestResourceStream("mainVoice.mp3");
using (MemoryStream memoryStream = new MemoryStream())
{
stream.CopyTo(memoryStream);
byte[] resourceBytes = memoryStream.ToArray();
}
using (StreamReader reader = new StreamReader(stream))
{
string resourceText = reader.ReadToEnd();
}
#-*- coding: utf-8 -*-
from threading import Thread
from time import sleep
def counter() -> None:
i = 0
while(True):
sleep(0.8)
i += 1
print(i)
def cmd() -> None:
while(True):
print(f'\x1b[FCommand: {input()}')
Thread(target=counter).start()
Thread(target=cmd).start()