🎊 Go 1.22.6 and 1.21.13 are released!
🔈 Announcement: https://groups.google.com/g/golang-announce/c/X4q_-Wf-5g4
⬇️ Download: go.dev/dl/#go1.22.6
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
🔈 Announcement: https://groups.google.com/g/golang-announce/c/X4q_-Wf-5g4
⬇️ Download: go.dev/dl/#go1.22.6
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
GoLand 2024.2 is Out!
⚙️ New refactoring
📦 Many fixes for remote development and dev containers
🚀 Performance improvements
🚄DX and UX upgrades
🛰️ Better support for Go frameworks and Go language features
Learn more: https://blog.jetbrains.com/go/2024/08/05/goland-2024-2-is-out/
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
⚙️ New refactoring
📦 Many fixes for remote development and dev containers
🚀 Performance improvements
🚄DX and UX upgrades
🛰️ Better support for Go frameworks and Go language features
Learn more: https://blog.jetbrains.com/go/2024/08/05/goland-2024-2-is-out/
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
The JetBrains Blog
GoLand 2024.2 Is Out! | The GoLand Blog
Beyond performance improvements and enhanced language support, GoLand 2024.2 introduces a powerful new refactoring to Add method to interface and all its implementations. We’ve also refined remote dev
الگوریتم PickByNestedKey
با استفاده از این الگوریتم شما می توانید value مورد نظر خود را از داخل map های تو در تو بکشید بیرون.
این الگوریتم برای مواقعی که شما میخواهید بصورت implicit با دیتا کار کنید و هیچ اطلاعی از تایپ های داخل map ندارید اما value را میخواهید کمک میکند.
https://gist.github.com/Ja7ad/8fd3b33518f571fbe82caa50ec90385f
تست بنچمارک عملکرد:
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
با استفاده از این الگوریتم شما می توانید value مورد نظر خود را از داخل map های تو در تو بکشید بیرون.
این الگوریتم برای مواقعی که شما میخواهید بصورت implicit با دیتا کار کنید و هیچ اطلاعی از تایپ های داخل map ندارید اما value را میخواهید کمک میکند.
https://gist.github.com/Ja7ad/8fd3b33518f571fbe82caa50ec90385f
تست بنچمارک عملکرد:
goos: linux
goarch: amd64
pkg: github.com/Ja7ad/meilisitemap/utils
cpu: AMD Ryzen 7 5700U with Radeon Graphics
Benchmark_PickByNestedKey
Benchmark_PickByNestedKey/foo.bar.x.y.z
Benchmark_PickByNestedKey/foo.bar.x.y.z-16 8992422 133.7 ns/op 80 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo.bar.x.y.a.0.noscript
Benchmark_PickByNestedKey/foo.bar.x.y.a.0.noscript-16 6467626 182.4 ns/op 112 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo.bar.x.y.a.0.domain
Benchmark_PickByNestedKey/foo.bar.x.y.a.0.domain-16 6328083 188.8 ns/op 112 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo.bar.x.y.a.1.noscript
Benchmark_PickByNestedKey/foo.bar.x.y.a.1.noscript-16 6277484 185.9 ns/op 112 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo.bar.x.y.a.1.domain
Benchmark_PickByNestedKey/foo.bar.x.y.a.1.domain-16 6407796 185.7 ns/op 112 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo.bar.x.y
Benchmark_PickByNestedKey/foo.bar.x.y-16 10424744 111.4 ns/op 64 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo.bar
Benchmark_PickByNestedKey/foo.bar-16 15783884 75.94 ns/op 32 B/op 1 allocs/op
Benchmark_PickByNestedKey/foo
Benchmark_PickByNestedKey/foo-16 22246024 52.19 ns/op 16 B/op 1 allocs/op
PASS
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
Gist
PickByNestedKey
PickByNestedKey. GitHub Gist: instantly share code, notes, and snippets.
🥳 Go 1.23.0 is released!
📝 Release notes: go.dev/doc/go1.23
⬇️ Download: go.dev/dl/#go1.23.0
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
📝 Release notes: go.dev/doc/go1.23
⬇️ Download: go.dev/dl/#go1.23.0
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
7 must-know runtime complexities for coding interviews:
1. 𝐎(1) - 𝐂𝐨𝐧𝐬𝐭𝐚𝐧𝐭 𝐭𝐢𝐦𝐞
- The runtime doesn't change regardless of the input size.
- Example: Accessing an element in an array by its index.
2. 𝐎(𝐥𝐨𝐠 𝐧) - 𝐋𝐨𝐠𝐚𝐫𝐢𝐭𝐡𝐦𝐢𝐜 𝐭𝐢𝐦𝐞
- The runtime grows slowly as the input size increases. Typically seen in algorithms that divide the problem in half with each step.
- Example: Binary search in a sorted array.
3. 𝐎(𝐧) - 𝐋𝐢𝐧𝐞𝐚𝐫 𝐭𝐢𝐦𝐞
- The runtime grows linearly with the input size.
- Example: Finding an element in an array by iterating through each element.
4. 𝐎(𝐧 𝐥𝐨𝐠 𝐧) - 𝐋𝐢𝐧𝐞𝐚𝐫𝐢𝐭𝐡𝐦𝐢𝐜 𝐭𝐢𝐦𝐞
- The runtime grows slightly faster than linear time. It involves a logarithmic number of operations for each element in the input.
- Example: Sorting an array using quick sort or merge sort.
5. 𝐎(𝐧^2) - 𝐐𝐮𝐚𝐝𝐫𝐚𝐭𝐢𝐜 𝐭𝐢𝐦𝐞
- The runtime grows proportionally to the square of the input size.
- Example: Bubble sort algorithm which compares and potentially swaps every pair of elements.
6. 𝐎(2^𝐧) - 𝐄𝐱𝐩𝐨𝐧𝐞𝐧𝐭𝐢𝐚𝐥 𝐭𝐢𝐦𝐞
- The runtime doubles with each addition to the input. These algorithms become impractical for larger input sizes.
- Example: Generating all subsets of a set.
7. 𝐎(𝐧!) - 𝐅𝐚𝐜𝐭𝐨𝐫𝐢𝐚𝐥 𝐭𝐢𝐦𝐞
- Runtime is proportional to the factorial of the input size.
- Example: Generating all permutations of a set.
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
1. 𝐎(1) - 𝐂𝐨𝐧𝐬𝐭𝐚𝐧𝐭 𝐭𝐢𝐦𝐞
- The runtime doesn't change regardless of the input size.
- Example: Accessing an element in an array by its index.
2. 𝐎(𝐥𝐨𝐠 𝐧) - 𝐋𝐨𝐠𝐚𝐫𝐢𝐭𝐡𝐦𝐢𝐜 𝐭𝐢𝐦𝐞
- The runtime grows slowly as the input size increases. Typically seen in algorithms that divide the problem in half with each step.
- Example: Binary search in a sorted array.
3. 𝐎(𝐧) - 𝐋𝐢𝐧𝐞𝐚𝐫 𝐭𝐢𝐦𝐞
- The runtime grows linearly with the input size.
- Example: Finding an element in an array by iterating through each element.
4. 𝐎(𝐧 𝐥𝐨𝐠 𝐧) - 𝐋𝐢𝐧𝐞𝐚𝐫𝐢𝐭𝐡𝐦𝐢𝐜 𝐭𝐢𝐦𝐞
- The runtime grows slightly faster than linear time. It involves a logarithmic number of operations for each element in the input.
- Example: Sorting an array using quick sort or merge sort.
5. 𝐎(𝐧^2) - 𝐐𝐮𝐚𝐝𝐫𝐚𝐭𝐢𝐜 𝐭𝐢𝐦𝐞
- The runtime grows proportionally to the square of the input size.
- Example: Bubble sort algorithm which compares and potentially swaps every pair of elements.
6. 𝐎(2^𝐧) - 𝐄𝐱𝐩𝐨𝐧𝐞𝐧𝐭𝐢𝐚𝐥 𝐭𝐢𝐦𝐞
- The runtime doubles with each addition to the input. These algorithms become impractical for larger input sizes.
- Example: Generating all subsets of a set.
7. 𝐎(𝐧!) - 𝐅𝐚𝐜𝐭𝐨𝐫𝐢𝐚𝐥 𝐭𝐢𝐦𝐞
- Runtime is proportional to the factorial of the input size.
- Example: Generating all permutations of a set.
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
اولین نسخه از زبان GoSharp منتشر شد.
زبان GoSharp یک فورک از Golang هست که قراره فیچرها و بهینهسازیهای زیادی رو داشته باشه.
با اولین فیچری که اضافه شد، شما میتونید فقط با نوشتن یک '?' ، خطا رو بدون نوشتن if err != nil برگردونید.
مخزن گیتهاب
https://github.com/0x9n0p/gosharp
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
زبان GoSharp یک فورک از Golang هست که قراره فیچرها و بهینهسازیهای زیادی رو داشته باشه.
با اولین فیچری که اضافه شد، شما میتونید فقط با نوشتن یک '?' ، خطا رو بدون نوشتن if err != nil برگردونید.
مخزن گیتهاب
https://github.com/0x9n0p/gosharp
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegraph
1. Two Sum
بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۱ Two Sum
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegraph
20. Valid Parentheses
بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۲ 20. Valid Parentheses مسئله Valid Parentheses: فرض کنید رشتهای از کاراکترها به نام s دارید که فقط شامل موارد زیر است: ( -(پرانتز باز) ) - (پرانتز بسته) { - (آکولاد باز) } - (آکولاد بسته) [ - (کروشه باز) ] - (کروشه…
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegraph
21. Merge Two Sorted Lists
بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۳ 21. Merge Two Sorted Lists مسئله: ادغام دو لیست مرتب پیوندی فرض کنید head های دو لیست پیوندی مرتب list1 و list2 به شما داده شده است. وظیفه شما این است که این دو لیست را در یک لیست مرتب ادغام کنید. لیست نهایی باید…
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegraph
121. Best Time to Buy and Sell Stock
week 1 number 4 بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۴ 121. Best Time to Buy and Sell Stock مسئله: محاسبهی حداکثر سود سهام فرض کنید آرایهای از قیمتها به نام prices به شما داده شده است که در آن prices[i] نشاندهنده قیمت سهام در روز iام است. هدف شما…
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegraph
125. Valid Palindrome
week 1 number 5 بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۵ هفته اول125. Valid Palindrome مسئله: تشخیص تقارن کلمه (پالیندروم) یک عبارت زمانی یک پالیندروم (متقارن) محسوب میشود که پس از تبدیل تمام حروف بزرگ به حروف کوچک و حذف تمام کاراکترهای غیر الفبایی و…
Please open Telegram to view this post
VIEW IN TELEGRAM
Telegraph
226. Invert Binary Tree
week 1 number 6 بررسی ۷۵ الگوریتم اساسی در leetcode شماره ۶ هفته اول226. Invert Binary Tree مسئله: معکوس کردن درخت دودویی (Invert Binary Tree) فرضیه: ریشه یک درخت دودویی به شما داده شده است. وظیفه شما این است که درخت را معکوس کنید و ریشه معکوس شده را برگردانید.…
✅ یا فلت فلت باش یا ساختار دهی کن!!!
زمانی که یک پروژه یا پکیج جدید در زبان Go شروع میکنیم، اولین سوالی که پیش میآید این است که ساختار یا layout پروژه چگونه باید باشد؟
در زبان Go، هر پوشه یا دایرکتوری میتواند به عنوان یک package در نظر گرفته شود. وقتی کدی را در این محدوده مینویسید، این کد میتواند به طور مستقل از بقیه پروژه تست شود و همچنین به لحاظ دسترسیهای public/private مدیریت شود.
داشتن یک ساختار منظم برای پروژه بسیار مهم است، اما از همه مهمتر این است که بتوانید به گونهای ساختاردهی کنید که به مشکلاتی مانند import cycle برنخورید.
سوالی که برای برخی مطرح است این است که آیا ساختار فلت (flat) خوب است یا نه؟
شاید از دیدگاه بعضی افراد، فلت بودن نشانهای از کمبود دانش فرد در ساختاردهی پروژه باشد، اما باید بدانید که فلت بودن مزایای خاص خود را دارد. البته این مزایا بیشتر در نوشتن پکیجها قابل مشاهده است تا در برنامههای اجرایی؛ زیرا در برنامههای اجرایی که دارای main هستند، ممکن است با مشکلاتی مواجه شوید. اما برای نوشتن پکیجها، فلت بودن ساختار بسیار مفید است و آزادی بیشتری برای نوشتن یک پکیج خوب به شما میدهد.
پس به طور کلی، فلت بودن ساختار برای پکیجها میتواند بهتر از داشتن یک ساختار پیچیده باشد.
➖➖➖➖➖➖➖➖
☄️ @GoInsights | @GolangEngineers
زمانی که یک پروژه یا پکیج جدید در زبان Go شروع میکنیم، اولین سوالی که پیش میآید این است که ساختار یا layout پروژه چگونه باید باشد؟
در زبان Go، هر پوشه یا دایرکتوری میتواند به عنوان یک package در نظر گرفته شود. وقتی کدی را در این محدوده مینویسید، این کد میتواند به طور مستقل از بقیه پروژه تست شود و همچنین به لحاظ دسترسیهای public/private مدیریت شود.
داشتن یک ساختار منظم برای پروژه بسیار مهم است، اما از همه مهمتر این است که بتوانید به گونهای ساختاردهی کنید که به مشکلاتی مانند import cycle برنخورید.
سوالی که برای برخی مطرح است این است که آیا ساختار فلت (flat) خوب است یا نه؟
شاید از دیدگاه بعضی افراد، فلت بودن نشانهای از کمبود دانش فرد در ساختاردهی پروژه باشد، اما باید بدانید که فلت بودن مزایای خاص خود را دارد. البته این مزایا بیشتر در نوشتن پکیجها قابل مشاهده است تا در برنامههای اجرایی؛ زیرا در برنامههای اجرایی که دارای main هستند، ممکن است با مشکلاتی مواجه شوید. اما برای نوشتن پکیجها، فلت بودن ساختار بسیار مفید است و آزادی بیشتری برای نوشتن یک پکیج خوب به شما میدهد.
پس به طور کلی، فلت بودن ساختار برای پکیجها میتواند بهتر از داشتن یک ساختار پیچیده باشد.
➖➖➖➖➖➖➖➖
Please open Telegram to view this post
VIEW IN TELEGRAM