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
"🤓 Well akchually HTML is not a programming lan..." – HTML o'rganishi endi tugatgan dasturchi
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥13😁9❤2 2 2 2
This media is not supported in your browser
VIEW IN TELEGRAM
2🔥9😁9 3 2❤1🎉1
Ramziddin — Dasturlash haqida
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…
Ertaga 20:00da MVP-ni release qilaman.
Kotta ehtimol bilan ko'p bug-lar🪲 bo'ladi, balki sharmanda bo'laman, lekin qiziq bo'ladi.
Nihoyat nimadir o'zim uchun productionga umrimda birinchi marta release qilvoman.
Kotta ehtimol bilan ko'p bug-lar
Nihoyat nimadir o'zim uchun productionga umrimda birinchi marta release qilvoman.
Please open Telegram to view this post
VIEW IN TELEGRAM
⚡11👍3🔥1
This media is not supported in your browser
VIEW IN TELEGRAM
🔥13 8 4 3
Ramziddin — Dasturlash haqida
Video message
This media is not supported in your browser
VIEW IN TELEGRAM
🔥13👍5
Ramziddin — Dasturlash haqida
Video message
To'g'risi, frontend bilan backendni yozib deploy haqida o'ylamastan ancha osonroq
🔥12
Ramziddin — Dasturlash haqida
@jonlichatbot
MVPni hohlaganingizcha test qilishingiz mumkin
MVP – Minimal Viable Product
MVP – Minimal Viable Product
👍3
Telegram kanalga yuborishdan oldin WebRTC resurlar va Telegram kanalga yuborishdan keyin
Yaxshi lekin, ko'p yemadi
Yaxshi lekin, ko'p yemadi
👍7