programming

Approaching Various Tree Algorithm using Javascript

Approaching Various Tree Algorithm using Javascript

Simple Tree we need to always start with the simple one then step by step we can go to the complex Algorithm. class SimpleTree { constructor(value) { this.value = value; this.children = []; } insertChild(value) { const newChild = new SimpleTree(value); const lastElement = this.findLastChild(this); lastElement.children.push(newChild); return newChild; } findLastChild(root) { if (root.children.length == 0) { return root; } return this.findLastChild(root.children[0]); } traversal(root) { console.log(root.value + ' --> '); root.children.forEach(child => { this.traversal(child); }) } } const simpleTree = new SimpleTree('A'); simpleTree.insertChild('B'); simpleTree.insertChild('C'); simpleTree.insertChild('D'); simpleTree.insertChild('E'); simpleTree.insertChild('F'); console.log(simpleTree) simpleTree.traversal(simpleTree) /* { "value": "A", "children": [ { "value": "B", "children": [ {…
Read More
Secure Your AI Project With Model Attestation and Software Bill of Materials (SBOMs)

Secure Your AI Project With Model Attestation and Software Bill of Materials (SBOMs)

AI projects face security challenges that stem from the difficulties in ensuring model integrity and reliability. The Sleepy Pickle and HuggingFace models' silent backdoors are notable cases of such model security loopholes. They are evidence of the possibility of influencing an AI model's behavior directly or indirectly through malicious or authorized model modifications, manipulations, and adversarial attacks. These model breaches stem from the blind spots that exist during the development and post-development of AI projects. This lack of visibility leaves AI models and data vulnerable to these security compromises. A recent survey by the Linux Foundation advocates adopting transparent and…
Read More
SQL, split values of two columns respectively and count members of their intersection #eg20

SQL, split values of two columns respectively and count members of their intersection #eg20

In PostgreSQL database’s table T, items_current_order field and items_next_order field contain comma-separated strings having duplicate characters and enclosed by braces: We need to add a computed column named count to the table. Rule: Split items_current_order field and items_next_order field respectively into a set having duplicate members and count members of their intersection. Write the following SPL code: derive() function adds a computed column to A1’s table. #3 represents the 3rd field; we can also use name to represent the field. split() function splits each string; @c option means using the comma to separate the string. ^ is the operator for…
Read More
Unlock the Power of Real-Time UI: A Beginner’s Guide to Streaming Data with React.js, gRPC, Envoy, and Golang

Unlock the Power of Real-Time UI: A Beginner’s Guide to Streaming Data with React.js, gRPC, Envoy, and Golang

Written by Naveen M Background As part of our Kubernetes platform team, we face the constant challenge of providing real-time visibility into user workloads. From monitoring resource usage to tracking Kubernetes cluster activity and application status, there are numerous open-source solutions available for each specific category. However, these tools are often scattered across different platforms, resulting in a fragmented user experience. To address this issue, we have embraced the power of server-side streaming, enabling us to deliver live resource usage, Kubernetes events, and application status as soon as users access our platform portal. Introduction By implementing server-side streaming, we can…
Read More
Day 6/10- Websites for Days

Day 6/10- Websites for Days

After 5 days of progressive HTML learning, I'm very happy that we are in the final phase of this all, the project-based section of this course, where I just build websites and challenge myself... A simple user-login & Signup page Link to project User Page HTMl for Sign up page- <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>Signup Page</title> <link rel="stylesheet" href="https://dev.to/ofameh/styles.css" /> </head> <body> <header> <h2>User Login Page</h2> </header> <section> <main style="text-align: center;"> <br/> <br/> <b> <h3> Enter Login Details </h3> <br/> </main> <article class="container"> <br/> <form> <b> <label…
Read More
Windows Powershall Commands

Windows Powershall Commands

Terminal oynasiga kirish uchun "Windows + r" klavishlarini bosib, chap pastki burchakda chiqgan oynaga "cmd" yozilsa terminal oynasiga kiriladi. "cd desktop" yozib terminal ish stoliga o'tiriladi. "mkdir_yaratmoqchi bo'lgan fayl nomi" yozilsa shu nomli fayl yaratib beradi. 3."cd_yaratilgan_fayl_nomi" yozilsa o'sha faylni ichiga kiradi. 4."cls" - "clear" vazifasini bajarib beradi ya'ni tepada yozilgan hamma narsani tozalab beradi. 5."dir" bilan sizda nechta fayl borligini va falyllar ichida nima borligini chiqazib beradi. 6."dotnet new" yozib dotnetda nima vazifalarni qila olishimizni chiqarib beradi. 7."dotnet new console" yozib yangi console loyiha yaratib olsa bo'ladi. 8."dotnet new console -n yaratmoqchi_bo'lgan_papka_nomi" yozilsa shunday nomli papkani o'zi yaratib beradi.…
Read More
Cryptography #0 – Essential Concepts

Cryptography #0 – Essential Concepts

The importance of cryptography goes beyond just understanding why it's cool, but also can be the difference between you being a good or bad dev in the long run. Any respectable system, especially those dealing with user data, will need some type of security, and often it’s in your hands as a dev. So I decided to write this series of articles about cryptography, so you can understand a bit more about the concepts and how everything works! Let’s start with a simple article on the main terms and how they work, and then we'll increase the difficulty with more…
Read More
Windows Commands.

Windows Commands.

windows + R Enter fullscreen mode Exit fullscreen mode Boshqaruv oynasini chaqirib beradi. Boshqaruv oynasiga cmd yoziladi. Bu terminal oynasiga kirib beradi. cd _ Desktop Enter fullscreen mode Exit fullscreen mode Ish stoliga o'tish uchun yozish kerak. dotnet --version: Enter fullscreen mode Exit fullscreen mode sizning kampyuteringizga qanday terminal versiyasi yuklanganligini ko'rsatib beradi. dotnet --list-sdks: Enter fullscreen mode Exit fullscreen mode kampyuterdagi bor sdk versiyalarini chaqirib beradi. clear = cls: Enter fullscreen mode Exit fullscreen mode Oynachani tozalab beradi. clear yozuvi macbooklar uynasini tozalash uchun kerak boladi. cls esa windowslar uchun kerak bo'ladi. mkdir + fayl nomi: Enter fullscreen mode…
Read More
When to Consider Design Patterns

When to Consider Design Patterns

This week, at the study group, our engineer asked a question: Should we follow the design pattern to design and implement the project from the beginning? The design pattern mentioned here refers to GoF's Design Patterns. Meanwhile, there is a related context which suggests that our coding should follow SOLID principle as much as possible, especially the first S and the second O, anyway. Since SOLID principle should be followed as much as possible, then the design pattern should also be taken into consideration from the very beginning, right? No, not really. What are design patterns? The design patterns we…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.