Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🐳2👨💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
🐳4🔥1👨💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🐳2👨💻1
const num = 10
console.log( Number.isInteger(num) )
// true
const num = 10.3
if (num % 1 === 0) {
console.log ('Число целое')
} else {
console.log ('Число не целое')
}
// Число не целое
Please open Telegram to view this post
VIEW IN TELEGRAM
🐳3👨💻2🔥1
Пример ниже выполняет несколько вызовов
HttpClient
и обрабатывает их результаты по мере завершения:using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
HttpClient client = new HttpClient();
Task<string>[] tasks = new Task<string>[]
{
client.GetStringAsync("https://example.com/1"),
client.GetStringAsync("https://example.com/2"),
client.GetStringAsync("https://example.com/3")
};
await Task.WhenEach(tasks, async task =>
{
string result = await task;
Console.WriteLine(result);
});
}
}
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🐳2👨💻1
//This is a single line comment
/*This is a multiple line comment
We are in line 2
Last line of comment*/
/// <summary>
/// Set error message for multilingual language.
/// </summary>
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🐳2👨💻1
Please open Telegram to view this post
VIEW IN TELEGRAM
👨💻3🔥2🐳1
Синтаксис:
SELECT DISTINCT column_name FROM table_name
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥4🐳1👨💻1
Примеры:
List<string> people = new List<string>();
Обращение к элементам списка:
var people = new List<string>() { "Tom", "Bob", "Sam" };
string firstPerson = people[0]; // получаем первый элемент
Console.WriteLine(firstPerson); // Tom
people[0] = "Mike"; // изменяем первый элемент
Console.WriteLine(people[0]); // Mike
Длина списка:
var people = new List<string>() { "Tom", "Bob", "Sam" };
Console.WriteLine(people.Count); // 3
Добавление в список:
List<string> people = new List<string> () { "Tom" };
people.Add("Bob"); // добавление элемента
// people = { "Tom", "Bob" };
people.AddRange(new[] { "Sam", "Alice" }); // добавляем массив
// people = { "Tom", "Bob", "Sam", "Alice" };
// также можно было бы добавить другой список
// people.AddRange(new List<string>(){ "Sam", "Alice" });
people.Insert(0, "Eugene"); // вставляем на первое место
// people = { "Eugene", "Tom", "Bob", "Sam", "Alice" };
people.InsertRange(1, new string[] {"Mike", "Kate"}); // вставляем массив с индекса 1
// people = { "Eugene", "Mike", "Kate", "Tom", "Bob", "Sam", "Alice" };
// также можно было бы добавить другой список
// people.InsertRange(1, new List<string>(){ "Mike", "Kate" });
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥2🐳2👨💻2
Пример кода:
<div data-role="page" data-hidden="true" data-custom="12345">Пример элемента</div>
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🐳2👨💻1
Пример:
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
Пример интерактивного элемента:
<style>
#demo-image {
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
</style>
<img id="demo-image" src="path/to/image.jpg" alt="Demo Image">
<input type="range" min="0" max="100" value="50" oninput="updateClipPath(this.value)">
<script>
function updateClipPath(value) {
document.getElementById('demo-image').style.clipPath = `polygon(${value}% 0%, 100% 50%, ${value}% 100%, 0% 50%)`;
}
</script>
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3🐳2👨💻1