teleren/devto huggingface dataset:
Kotlin Lamda, 2024-03-18
Tags: kotlin
Published: 2024-03-18 03:22:30

람다식은 우리가 마치 value처럼 다룰 수 있는 익명 함수

1) 메소드의 파라미터로 넘겨줄 수 있다
2) return  값으로 사용할 수 있다

```
//람다의 기본 정의
val lamdaName : Type = { argumentList -> codeBody }
```

```
//첫 번째
val square : (Int) -> (Int) = { number -> number*number }
//두 번째
val square = { number : Int -> number*number }

fun main(){
   println(square(12))
}
```

```
val square = { number : Int -> number*number }
val nameAge = { name : String, age : Int -> "My name is ${name} I'm ${age}"
}

fun main(){
   println(square(12))
   println(nameAge("example", 50))
}
```

타입 추론 가능 하려면 어떻게 써야 하는 지
중괄호 사용 시 함수도 똑같이 변수 안에 넣을 수 있다

```
fun main(){
   val a = "A said"
   val b = "B said"
   
   //String class 사용
   println(a.pizzaIsGreat())
   println(b.pizzaIsGreat())
}

//this는 String 오브젝트 그 자체를 가르킴
val pizzaIsGreat : String.() -> String = {
   this + "Pizza is the best!"
}
```
확장 함수 예시

```
fun main(){
   println(extendString("C", 66))
}

//this가 가르키는 것은 확장 함수가 불러줄 오브젝트 
fun extendString(name : String, age : Int ) : String {
   val introduceMyself : String.(Int) -> String = {"I'm ${this} and ${it}years old"}
   return name.introduceMyself(age)
}
```
파라미터가 하나 일 때 it을 사용 가능

```
fun main(){
   println(calculateGrade(66))
}

// 파라미터가 여러 개일 경우를 대비해서 소괄호 써줌
val calculateGrade : (Int) -> String = {
   when(it){
      in 0..40 -> "fail"
      in 41.70 -> "pass"
      in 71..100 -> "perfect"
      else -> "Error" //else를 써주지 않으면 에러 발생
   }
}
```

```
fun main(){
   val lamda = { number : Double -> number == 4.3213 }
   println(invokeLamda(lamda))

   println(invokeLamda({true}))
   println(invokeLamda({ it > 3.22 }))

   // 마지막 파라미터
   println(invokeLamda{ it > 3.22 })
}

//파라미터를 넣는 람다식
fun invokeLamda( lamda : (Double) -> Boolean ) : Boolean {
   return lamda(5.2343)
}
```

function의 마지막 파라미터가 람다식일 때 생략이 가능

```

button.setOnClickListener{
   //to do
}

```
코틀린 인터페이스가 아닌, 자바 인터페이스여야 함
인터페이스는 딱 하나의 메소드를 가져야 함

익명 내부 함수는 람다식으로 표현을 위의 조건 두 개 충족 

_참조 : Code with Joyce_
C++ Урок #9
Tags: programming, cpp, tutorial, beginners
Published: 2024-03-17 14:10:17

## Do While loop
Привет, друзья! Сегодня мы поговорим о цикле do-while в языке программирования C++. Цикл `do-while` предоставляет возможность выполнения блока кода, пока определенное условие истинно. Одним из главных преимуществ цикла do-while является то, что он гарантированно выполнит блок кода хотя бы один раз, даже если условие не истинно с самого начала. Давайте рассмотрим его подробнее.

```
#include <iostream>

using namespace std;

int main()
{
    int count = 1;

    do 
    {
        cout << "Номер: " << count << endl;
        count++;
    } while (count <= 5);

    return 0;
}
```
Как это работает:

Сначала программа выполняет блок кода внутри `do`.
После выполнения кода программа проверяет условие после ключевого слова `while`.
Если условие истинно, программа возвращается к выполнению блока кода внутри `do`. Если условие ложно, выполнение цикла прекращается, и программа переходит к следующему за циклом оператору.

В этом примере цикл do-while выводит номера от 1 до 5 на экран. Даже если условие `(count <= 5)` не истинно с самого начала, блок кода внутри do выполнится хотя бы один раз.

Изучение цикла `do-while` открывает новые возможности для эффективного управления потоком выполнения программы в C++. Продолжайте практиковаться и экспериментировать с различными циклами! Удачи в изучении C++! 🚀
Kotlin class, 2024-03-18
Tags: kotlin
Published: 2024-03-18 02:13:34

```
class Human constructor(name : String){
   val name = name
   fun eating(){
      println("YUMMMMMYYYY")
   }
}

fun main(){
   val human = Human("example")
   human.eating()
   
   println("this human's name is ${human.name}")
}
```

```
class Human (val name : String){
   fun eating(){
      println("YUMMMMMYYYY")
   }
}

fun main(){
   val human = Human("example")
   human.eating()
   
   println("this human's name is ${human.name}")
}
```

같다

```
class Human (val name : String = "defalut"){
   fun eating(){
      println("YUMMMMMYYYY")
   }
}

fun main(){
   val human = Human() // 디폴트 값을 줘서 생성 가능
   human.eating()
   
   println("this human's name is ${human.name}")
}
```

```
class Human (val name : String = "defalut"){
   init{
     println("New human has been born!")
  }

   fun eating(){
      println("YUMMMMMYYYY")
   }
}

```

init 인스턴스 생성 시 어떤 동작을 하길 원하는 것을 적어줄 수 있음 / 주 생성자이기 때문에 가장 먼저 실행

```
//주 생성자
class Human (val name : String = "defalut"){
   //부 생성자
   constuctor(name : String, age : Int) : this(name){
      println("my name is  ${name}, ${age}years old")
   }

   init{
     println("New human has been born!")
  }

   fun eating(){
      println("YUMMMMMYYYY")
   }
}

```

```
open class Human (val name : String = "defalut"){
   constuctor(name : String, age : Int) : this(name){
      println("my name is  ${name}, ${age}years old")
   }

   init{
     println("New human has been born!")
  }

   fun eating(){
      println("YUMMMMMYYYY")
   }

   fun sing(){
      println("Laralll")
   }

}


class Korean : Human(){
   override fun sing(){
      super.sing()
      println("라랄라랄")
   }
}

fun main(){
   val korean = Korean()
   korean.sing()
}
```

코틀린은 기본적으로 파이널 클래스를 가지고 있다. 그렇기 때문에 open을 붙여줘야 한다. 오버라이드를 할 때도 같다

super을 붙여주면 부모를 그대로 가져올 수 있다
상속은 하나밖에 못한다

_참조 : Code with Joyce_
GenAI : Witness Automated Test Cases Generation in Action, let’s build, all local
Tags: ai, machinelearning, datascience, development
Published: 2024-03-18 02:03:27

## Snap Webpage Screenshots, Let AI Craft Test Cases

[Read detailed article at](https://medium.com/@learn-simplified/genai-witness-automated-test-cases-generation-in-action-lets-build-ebc7f5ce0afb)

Problem:
Traditional software testing for web forms is time-consuming and error-prone.

Solution:
Explore how AI, particularly large language models (LLMs), can generate test cases, saving time and enhancing bug detection.

Overview:
Dive into the process of leveraging GenAI's capabilities, including LLaVa, Ollama, and Streamlit, to automate test case generation.

The Process:
* Upload web page form screenshots effortlessly.
* Witness LLaVa in action as it analyzes form structures and generates tailored test cases.
* Experience the AI's ability to produce customizable test cases for diverse scenarios.
* View the neatly organized test case results in a user-friendly format.

Coding Journey:
Explore the code behind the scenes, building an intuitive interface for users to upload web page images and generate test cases automatically.

Installation Guide:
Follow step-by-step instructions to set up and run the application, all local.

Next Steps:
Join me in this journey to streamline QA testing and stay tuned for more exciting developments!
React Hooks
Tags: reacthook, react, beginners, learning
Published: 2024-03-18 02:02:36


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r4fhhqg42kr0faas831f.png)
Hooks are functions that start with the name use (e.g., useState, useEffect).
They allow functional components to:
1. `useState`: Allows functional components to manage state.
2. `useEffect`: Performs side effects in function components, similar to lifecycle methods in class components.
3. `useContext`: Provides a way to access the context in functional components.
4. `useReducer`: Alternative to `useState`. It's usually preferred for managing more complex state logic.
5. `useCallback`: Returns a memoized callback function.
6. `useMemo`: Returns a memoized value.
7. `useRef`: Returns a mutable ref object.
8. `useImperativeHandle`: Customizes the instance value that is exposed when using `ref`.
9. `useLayoutEffect`: Similar to `useEffect`, but fires synchronously after all DOM mutations.
10. `useDebugValue`: Used for displaying custom hook labels in React DevTools.

Rules for Using Hooks:
- hooks can be only used in the react component
- It can be only used in top-level( it must be not called in nested code statements)
Why Graph Based RAG Is The Future?
Tags: machinelearning, ai, database
Published: 2024-03-18 01:59:44

## You need to ground LLMs w/ Graphs Not Vectors for Enterprise AI, next part we will build one !

[See Detailed Article at](https://medium.com/@learn-simplified/why-graph-based-rag-is-the-future-4a8b3ad3c68f)

🔹 Businesses are increasingly turning to Generative AI for leveraging their wealth of knowledge and data. However, relying solely on language models may not provide a comprehensive understanding of internal data due to their reliance on public sources.

🔹 Enter RAG - a game-changer in enterprise AI! By combining data retrieval with language generation, RAG ensures more accurate and insightful responses to queries.

We all know this, but.... how you do RAG, using vectors ? if yes, keep reading !

💡 Let's explore how Graph-Based RAG addresses the shortcomings of vector-based retrieval

🔸 Vector-based methods face challenges. Graph-Based RAG offers a seamless solution by maintaining semantic relationships, supporting diverse data types, and facilitating efficient updates.

🔸 Imagine your data as a dynamic map, where each piece of information is a destination connected by meaningful pathways. With Graph-Based RAG, navigating through vast datasets becomes more intuitive and effective.

🔸 Looking ahead, Graph-Based RAG promises a smarter approach to data processing, enabling organizations to unlock valuable insights and drive innovation.

🌈 Ready to go on this exciting journey towards the future of enterprise AI? Let's connect and explore the limitless possibilities together! 🚀🔗
Exciting News! 🚀 Introducing My GitHub Repository for CSS Battle Solutions
Tags: webdev, github, css, challenge
Published: 2024-03-18 01:57:28

I'm thrilled to share that I've launched a new GitHub repository featuring my solutions for challenges from CSS Battle! 🎉

## GitHub Repository: [GitHub Repo Link](https://github.com/jithesh-poojari/css-battles)

In this repository, you'll find my creative solutions to various CSS Battle challenges. Each solution showcases my skills in front-end web development and offers insights into different approaches to problem-solving.

### Why Explore the Repository?

- **Learning:** Explore different techniques and approaches to solving CSS challenges.
- **Inspiration:** Get inspired by creative solutions and enhance your front-end coding skills.
- **Community:** Connect with fellow developers, share feedback, and collaborate on innovative ideas.

### Important Note:

While the solutions in this repository are provided for learning and reference purposes, I encourage you to use them as inspiration rather than direct copies. Embrace creativity and explore your own unique solutions to the challenges!

### Get Involved!

Feel free to explore the repository, try out the solutions, and share your thoughts and feedback. Your contributions and insights are highly valued!

Let's inspire and empower each other to become better developers! 💻✨

Happy coding! 🚀
Its all about influence : PageRank in Graphs, why bother?
Tags: machinelearning, datascience, database, ai
Published: 2024-03-18 01:55:18

## Its all about influence : PageRank in Graphs, why bother?


Let’s not try to sell “Product A” to Aniket, Find out what Product Aniket mostly likely going to buy !

Is it the graph influencing your next purchase?

[See detailed article w/ code example](https://medium.com/@learn-simplified/its-all-about-influence-pagerank-in-graphs-why-bother-52c44045114f)

📝 Article Summary:

Graph Insights: Explore the dynamic relationships between products and customers, revealing key insights for better recommendations.

Revolutionizing Algorithms: Dive into the world of PageRank, the algorithm that transformed search engines, now redefining product recommendations.

Decoding Influence: Uncover the secrets of influence as PageRank identifies top-performing products beyond the obvious bestsellers.

Hands-On Implementation: Experience the code in action as we visualize product networks and unleash the power of PageRank for personalized recommendations.

📊 Graph Fundamentals: Learn how graphs represent connections between entities, shaping the foundation of modern recommendation systems.

🔍 PageRank Unveiled: Demystify PageRank in layman's terms and understand its pivotal role in determining product importance and relevance.

💡 Why PageRank Matters: Explore why PageRank is the go-to choice for refining product recommendations, delivering personalized experiences to users.

💻 Technical Deep Dive: Journey through code examples as we simulate customer-product interactions, visualize networks, and execute PageRank algorithms to rank influential products.

📈 Interpreting Results: Understand the significance of PageRank scores, guiding businesses in prioritizing and recommending products based on their influence within the network.

💬 Join the Conversation: Let's connect and discuss how PageRank can elevate your product recommendation strategies. Don't miss out on the opportunity to unlock the potential of interconnected data in the digital landscape!
How to draw diagrams efficiently?
Published: 2024-03-18 01:33:12

Unleash the power of Diagram AI - your ultimate solution for effortless diagram creation! Powered by the advanced GPT-4 technology, this browser extension transforms text into visually stunning diagrams with unparalleled accuracy and speed.
Whether you're a student looking to visualize complex concepts, a professional needing to streamline workflow processes, or a designer seeking to bring ideas to life, Diagram AI is your go-to tool. From flowcharts to entity-relationship diagrams, this versatile extension supports a wide range of diagram types, making it the perfect companion for all your visualization needs.
Say goodbye to hours spent manually creating diagrams and hello to instant conversion with Diagram AI. With intuitive editing features, you can easily customize and refine your diagrams to suit your exact requirements. Collaborate seamlessly with colleagues, share your diagrams effortlessly, and take your communication to the next level.
Experience the future of diagram creation with Diagram AI. Enhance your productivity, streamline your workflow, and elevate your visual communication game. Embrace the power of GPT-4 and revolutionize the way you create diagrams. Try Diagram AI today and witness the magic unfold! Download now at: https://chromewebstore.google.com/detail/diagram-ai/klbgbmoinfidmgmjlliilmbofaokkilo
Geting Start with React.js
Tags: react
Published: 2024-03-18 01:31:02


### Virtual DOM in React:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xu5tma1mr4pi2h1teuw4.png)
- **What it is:** A lightweight, in-memory representation of the actual DOM that React uses to efficiently update the UI.
- **How it works:**
1. **Rendering:** React creates a virtual DOM tree when you render a component.
2. **Reconciliation:** When data changes, React creates a new virtual DOM tree and compares it with the previous one to identify differences.
3. **Diffing Algorithm:** React employs a diffing algorithm to determine the minimum changes needed in the actual DOM.
4. **Updating the Actual DOM:** React updates only the necessary elements in the real DOM, minimizing expensive DOM manipulations.
`
React isn't the only library utilizing a virtual DOM strategy; Vue.js also employs it.
Svelte offers a different approach, optimizing applications by compiling components into small JavaScript modules.
`
**Setting up your Environment:**

1. **Install Node.js and npm (or yarn)** [node]([Node.js (nodejs.org)](https://nodejs.org/en))
2. **Create a React App **
```bash
npx create-react-app my-react-app
```

**Core React Concepts:**

1. **Components:** React applications are built using reusable components. These are independent, self-contained blocks of code that define how a part of the UI should look and behave.

2. **JSX:** JSX (JavaScript XML) is a syntax extension that allows you to write HTML-like structures within your JavaScript code. It's a convenient way to define the UI of your components.

3. **Props:** Components can receive data or configuration options from their parent components using props. This allows for building flexible and reusable components.

4. **State:** Components can manage their own internal state using the `useState` hook. State allows components to react to user interactions or data changes and update their UI accordingly.
    

**Building a Basic App:**
1. `cd my-react-app`
2.  `npm start` (or `yarn start`) http://localhost:3000/browser
3.  `create-react-app` includes an `App.js` 

```jsx
import React from 'react';

function App() {
  return (
	<h1>Hello, React!</h1>
  );
}
export default App;
```
Kotlin과 Java의 class 다른점, 2024-03-18
Tags: kotlin
Published: 2024-03-18 01:28:29

코틀린 class 파일은 자바와 다르게 파일명과 클래스명이 일치하지 않아도 된다. 또한 한 파일 안에 여러 개의 클래스 생성이 가능하다.
class 내부에 function[method]을 넣지 않아도 된다

_참조 : 유투브 강의 Code with Joyce_
RedTrack.io - Track. Attribute. Automate. Scale ROI
Tags: affiliate, tracking, tracker, analytics
Published: 2024-03-18 01:27:01

RedTrack is the leading ad tracking, attribution & automation platform, helping top media buying teams around the world get higher ROI from their campaigns. The platform uses machine learning and AI technologies to allow users to track conversions and revenue in real time, making 100% accurate attribution. We send conversion and revenue data automatically via pre-built CAPI integrations with major traffic sources like FB, TikTok, Google Ads, Bing (and others). On top of that, media buyers get 5-minute cost updates at a flat fee and use smart rules to scale winning ads and automated campaign management.

[https://redtrack.io](https://redtrack.io)
A PRIVATE INVESTIGATOR AND RECOVERY EXPERT __ LEE ULTIMATE HACKER
Published: 2024-03-18 01:22:38

I fell victim to a fraudulent crypto asset scam after scammers directed me to their website. I met with Lee through LinkedIn and then communicated through the online app Line. Lee showed me how to set up an account on Crypto.com and gave me the link to their website. I started with $2,000 and got back $4,000 as profit plus the capital on my first trade. Lee then convinced me to invest more capital to earn more profit, I sent almost $30,000 in three separate transactions. At some point, I believed I had made a profit of more than $300,000. But when I tried to withdraw the funds, Liquldohn’s “customer service” told me that my account would be frozen and I would have to deposit an extra  $48,000 to” unfreeze” it. I was devastated at that moment and felt so bad that my hard-earned money was gone. After a few days, I decide to seek for solution to get back my money from the fake company. I  came across a lot of testimonies on the web about one company called  Lee Ultimate Hacker which had helped countless victims recover their stolen, scammed, or duped money on Bitcoin or any other form of digital currency. I contacted them and they promised to help me get my money back and asked me for some info about the company I invested with which I provided. I wasn't fully confident that they could still recover my earned money, I believed the scammer should have already removed the funds from the wallet I sent it to, But Lee Ultimate Hacker has proven me wrong, They can track down any stolen cryptocurrency. No matter how smart the scammer is, always trust and count on Lee Ultimate Hacker to retrieve back whatever you must have lost to online fraud, To seek the assistance of Lee Ultimate Hacker kindly use any of the below contact details. Email:LEEULTIMATEHACKER@AOL.COM Telegram:LEEULTIMATE
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4ee1phxh5759mtaoamw.jpg)
Kotlin Nullable/ NonNull, 2024-03-18
Tags: kotlin
Published: 2024-03-18 01:00:17

```
fun nullcheck(){
   var name = "example"
   var nullName = String? = null

   var nameInUpperCase = name.toUpperCase()
   var nullNameInUpperCase = nullName?.toUpperCase()
}
```
null이 가능하려면 타입뒤에 ? 을 붙여야 한다. 없으면 기본적으로 noNull
두 번째 경우, null이면 nullNameInUpperCase = null
null이 아니면 toUpperCase()를 처리한다

```
val lastName : String? = null
val fullName = name +" "+ (lastName?: "NO LastName")
println(fullName)

```
null일 때 NO LastName 출력
아닐 때 정한 String 값 출력

```
fun ignoreNulls(str : String?){
   val mNotNull : String = str!!
   val upper = mNotNull.toUpperCase()

   val email : String? = "emxample@example.com" 
   //email이 null이 아닐 경우
   email?.let{
       println("My email is ${email}")
   }
}
```

!!는 절대 null타입이 아님을 명시 해줌
 


_참조 : 유투브 강의 Code with Joyce_
Kotlin for과 while, 2024-03-18
Tags: kotlin
Published: 2024-03-18 00:47:17

```
var sum : Int = 0
for ( i in 1...100 ){
    sum+= i
}
println(sum)
```

```
var index = 0
while(index<10){
   println("current index : ${index}")
   index++
}
```
_참조 : 유투브 강의 Code with Joyce_
Issue 36 of AWS Cloud Security Weekly
Tags: cloudsecurity, newsletter, aws, cybersecurity
Published: 2024-03-18 00:25:59

(Summary of Issue 36 of AWS Cloud Security weekly @ https://aws-cloudsec.com/p/issue-36)

**What happened in AWS CloudSecurity & CyberSecurity last week March 11-17, 2024?**

- AWS Application Load Balancer (ALB) duration of HTTP client keepalive for communication between clients and the load balancer now supports a duration ranging from 60 seconds to 7 days, through a load balancer attribute, with the default value set to 3600 seconds. The HTTP client keepalive duration dictates the maximum period ALB maintains an HTTP connection with a client before terminating it. This feature empowers users to gracefully end their connections, particularly useful for deployment strategies like Blue/Green or rollbacks, migrating legacy applications, and during the evacuation of Availability Zones using zonal shift with Amazon Route 53 Application Recovery Controller. 
- AWS Signer container image signing and verification is now supported in Gov US regions. AWS Signer, a managed signing service, to sign images within registries like Amazon Elastic Container Registry (ECR) ensures the validation of only authorized images being deployed to Amazon Elastic Kubernetes Service (EKS) clusters or being utilized within Amazon Elastic Container Service (ECS) clusters.
- AWS Backup has introduced support for conducting restore testing on Amazon EBS Snapshots Archive. This feature enables automated and regular restore tests on backed-up AWS resources, facilitating enhanced data protection. With this enhancement, AWS Backup users can assess recovery readiness, ensuring preparedness for potential data loss scenarios, and measure restoration job durations for Amazon EBS Snapshots Archive to meet compliance and regulatory standards.
- Amazon Verified Permissions has raised the standard quotas for the IsAuthorized and IsAuthorizedWithToken APIs from 30 to 200 transactions per second (TPS). These APIs allow applications to solicit an authorization verdict. Enhancing the default TPS empowers you to consistently authenticate user activities, aligning with the principles of zero trust.
- AWS Marketplace introduced a service-linked role for AWS Marketplace Resale Authorization, enabling AWS Marketplace sellers such as Independent Software Vendors (ISVs), Consulting Partners, and Channel Partners to exchange and approve resale authorizations.(AWS Note: When you create a service-linked role in the AWS Marketplace Management Portal, AWS Marketplace creates the service-linked role for you.)