This media is not supported in your browser
VIEW IN TELEGRAM
🔥6❤1
Shunaqa filterni yozishi birinchi marta 2 yil oldin ishxonada o'rgandim
Falsy qiymatlar shunaqa bo'ladi:
// undefined qiymatlarni o'chirmoqchimiz
const exampleList = ["v0", undefined, "vercel", undefined, undefined, "fly.io"]
// shunaqasiga filter qilishimiz mumkin
exampleList.filter(item => item !== undefined)
// yoki shunaqasiga
exampleList.filter(item => item)
// yoki shunchaki
exampleList.filter(Boolean)
Boolean
shunchaki itemni oladi va agar item falsy bo'lsa false qaytaradi, aks holda true qaytaradi.Falsy qiymatlar shunaqa bo'ladi:
null
undefined
false
NaN
0
-0
0n
""
👍15🔥6⚡4 1
Kursimdagi bitta darsni bepul qilib shu yerga yubormoqchiman
❤8🔥5⚡2👍1 1
Forwarded from ramzcoder kursi
Media is too big
VIEW IN TELEGRAM
⚠️ Bu mavzuni React uchun tushunish judayam muhim. Bu mavzuni ustida hamma hooklar ishlidi.
⚡️ Modul 2 — Advanced JavaScript
Dars 4, Qism 1 — Closures
- Closures nima?
- Call stack haqida bilgan narsalarimiz to'g'ri ishlamidimi?
-
#modul2 #dars4
⚡️ Modul 2 — Advanced JavaScript
Dars 4, Qism 1 — Closures
- Closures nima?
- Call stack haqida bilgan narsalarimiz to'g'ri ishlamidimi?
-
useRef
hookga o'xshagan counter
misoli#modul2 #dars4
2 11👍6 3 2❤1🔥1 1
Ramziddin — Dasturlash haqida
ChatGPTga buni yozing va izohda javobini qoldiring: Based on what you know about me, draw a picture of what you think my current life looks like Bu esa manga chizib bergan rasm:
ChatGPTga buni yozing va izohda javobni qoldiring
Manga yozgan javobi:
Based on what you know about me — estimate my IQ
Manga yozgan javobi:
Iyunda bir kuni @FormifyBot ustida ishlagan edim. O'zimcha nimadirlar qilib, boshimi qotirib, ideal holatga keltirishga harakat qilgan edim. Va release holatdan o'zimi uzoqlashtirgan edim (chunki qorqish bo'lgan).
Kecha huddi shu "ideyani" boshqa botda ko'rib qoldim. Iyulda release qilingan ekan. U botda allaqachon 1 000 000 foydalanuvchi bor va har oy u botdan 10 000 odam foydalanadi. Podpiskasi $5 turadi oyiga.
Bu birinchi marta emas. Man ko'p loyihalarni ohirigacha yetqazmagan edim va bir necha oydan keyin huddi shu loyihani boshqa joyda ko'rgan edim.
Hozir man video chat boti ustida ishlavoman, va bu holatda man yoki yana uni tashab qo'yishim mumkin, yoki nimadir release qilaman.
Kecha huddi shu "ideyani" boshqa botda ko'rib qoldim. Iyulda release qilingan ekan. U botda allaqachon 1 000 000 foydalanuvchi bor va har oy u botdan 10 000 odam foydalanadi. Podpiskasi $5 turadi oyiga.
Bu birinchi marta emas. Man ko'p loyihalarni ohirigacha yetqazmagan edim va bir necha oydan keyin huddi shu loyihani boshqa joyda ko'rgan edim.
Hozir man video chat boti ustida ishlavoman, va bu holatda man yoki yana uni tashab qo'yishim mumkin, yoki nimadir release qilaman.
👍8😁8🔥2
Ramziddin — Dasturlash haqida
Video message
20 kun o'tdi va man hali ham bu narsadan mazza qilvoman 🍸
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegram
Ramziddin — Dasturlash haqida
⚡7🔥5👍3😁3 2 1
This media is not supported in your browser
VIEW IN TELEGRAM
🔥43 19❤14🎉4👍2
Kecha birinchi marta advent of code 2024 sinab ko'rgim keldi
Day 1 uchun yechimni Deno-da yozib ko'rdim
Day 1 uchun yechimni Deno-da yozib ko'rdim
const decoder = new TextDecoder("utf-8");
const inputData = await Deno.readFile("./day1-input.txt");
const input = decoder.decode(inputData).slice(0, -1); // slice off empty line
const parsedInput = parse(input);
const output = calc(parsedInput);
console.log(output);
function parse(input: string): [number[], number[]] {
return input
.split(/\n/)
.map((row) => row.split(/ {3}/))
.reduce(
(acc, curr) => [
[...acc[0], Number(curr[0])],
[...acc[1], Number(curr[1])],
],
[[], []] as [number[], number[]],
);
}
function calc([column1, column2]: [number[], number[]]): number {
let distance: number = 0;
while (column1.length > 0 && column2.length > 0) {
const min1 = spliceMin(column1);
const min2 = spliceMin(column2);
distance += Math.abs(min1 - min2);
}
return distance;
}
function findMin(nums: number[]): number {
let index: number = 0;
let value: number = Infinity;
for (let i = 0, curr = nums[i]; i < nums.length; i++, curr = nums[i]) {
if (curr < value) {
value = curr;
index = i;
}
}
return index;
}
function spliceMin(nums: number[]): number {
const index = findMin(nums);
const spliced = nums.splice(index, 1)[0];
return spliced;
}
Ramziddin — Dasturlash haqida
Kecha birinchi marta advent of code 2024 sinab ko'rgim keldi Day 1 uchun yechimni Deno-da yozib ko'rdim const decoder = new TextDecoder("utf-8"); const inputData = await Deno.readFile("./day1-input.txt"); const input = decoder.decode(inputData).slice(0…
Ikkinchisini birinchi marta 👨💻 da yozib ko'rdim 👀
package main
import (
"fmt"
"math"
"os"
"strconv"
"strings"
)
func main() {
dat, err := os.ReadFile("./input.txt")
if err != nil {
fmt.Println("Couldn't read input", err.Error())
}
reports, err := parseReports(dat)
if err != nil {
fmt.Println("Couldn't parse repoorts", err.Error())
}
safeReports := 0
for i := 0; i < len(reports); i++ {
levels := reports[i]
isInitiallyIncreasing := levels[0] > levels[1]
isReportSafe := true
for j := 1; j < len(levels); j++ {
previousLevel := levels[j - 1]
currentLevel := levels[j]
isIncreasing := previousLevel > currentLevel
if isInitiallyIncreasing != isIncreasing {
isReportSafe = false
break
}
difference := math.Abs(previousLevel - currentLevel)
if !(difference >= 1 && difference <= 3) {
isReportSafe = false
break
}
}
if isReportSafe {
safeReports++
}
}
fmt.Println("There are", safeReports, "safe reports")
}
func parseReports(inp []byte) ([][]float64, error) {
reports := strings.Split(string(inp), "\n")
var parsedReports [][]float64
for i := 0; i < len(reports); i++ {
report := reports[i]
levels := strings.Fields(report)
var parsedLevels []float64
for j := 0; j < len(levels); j++ {
parsedLevel, err := strconv.ParseFloat(levels[j], 64)
if err != nil {
return nil, err
}
parsedLevels = append(parsedLevels, parsedLevel)
}
parsedReports = append(parsedReports, parsedLevels)
}
return parsedReports, nil
}
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥13👍2 2⚡1
"Hacker bo'laman" degan odamlar – nimaga hacker bo'lmoqchisiz?
👍18😁9🔥3
ChatGPTda yangi, oyiga $200lik plan paydo bo’ldi — ChatGPT Pro 😳
https://openai.com/index/introducing-chatgpt-pro/
https://openai.com/index/introducing-chatgpt-pro/
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
⚡15❤2
rm -rf node_modules
Lekin
rm
sekin ishlaydi va korzinani o'tqazvoradi. Undan ko'ra trash
install qiling:
brew install trash
Va keyin:
trash node_modules
trash
ancha tezroq va o'chirilgan directoryni korzinadan qaytarishingiz mumkin.Please open Telegram to view this post
VIEW IN TELEGRAM
❤5👍4
🔥8😁4 3 3❤1