teleren/devto huggingface dataset:
Go Type Casting: Starter Guide
Tags: webdev, go, datastructures, tutorial
Published: 2023-07-07 10:39:33

There are two ways of converting types in Go: Implicit conversion and Explicit conversion.

## Implicit Conversion

Implicit conversionImplicit conversion occurs when Go converts the type of a value automatically. For instance, when we assign an integer value to a float variable, Go will automatically convert it to a float type. Here is an example of implicit conversion:

```go
package main

import "fmt"

func main() {
  var a float32 = 5.6
  var b float64 = a

  fmt.Printf("a = %v, b = %v\n", a, b)
}
```

## Explicit conversion

Explicit conversion occurs when we use the casting syntax to convert a value to a different type. The casting syntax in Go is similar to other programming languages, as it requires enclosing the value in parentheses and specifying the type in front of them. Here is an example of explicit conversion:

```go
package main

import "fmt"

func main() {
  var a float64 = 5.6
  var b int = int(a)

  fmt.Printf("a = %v, b = %v\n", a, b)
}
```

In the code above, the value of variable a is explicitly cast to an integer, and it is assigned to variable b. The int function is used to perform the type conversion, and the resulting value is truncated to an integer.

[Continue Reading](https://younisjad.medium.com/a9c1811670c5)
AWS Elastic Load Balancer
Tags: aws, elb, loadbalancer
Published: 2023-07-07 10:32:10

As it name implies, it's a single point of contact for clients that stabilize or equalize user traffic accessing a service. It ensures delivery of traffic to only healthy targets by monitoring target groups, using health checks configuration. It is simple to integrate with other AWS services to increase the security architecture of your Application, for example, by  allowing or blocking requests based on the rules you set in Web ACL using AWS WAF, more on that later.

Here is how AWS defines ELB

Elastic Load Balancing automatically distributes your incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses, in one or more Availability Zones. It monitors the health of its registered targets and routes traffic only to the healthy targets. You can select the type of load balancer that best suits your needs.

**Types of Elastic Load Balancers**

- Application Load Balancer
- Network Load Balancer
- Gateway Load Balancer
- Classic Load Balancer

Next, Hands-on using Application Load Balancer
SORT THE COLORS LEETCODE SOLUTION C++ OR SORT 0 1 2 IN AN ARRAY
Tags: beginners
Published: 2023-07-07 10:02:24



Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.

We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.

You must solve this problem without using the library's sort function.

 

Example 1:

Input: nums = [2,0,2,1,1,0]
Output: [0,0,1,1,2,2]
Example 2:

Input: nums = [2,0,1]
Output: [0,1,2]
 

Constraints:

n == nums.length
1 <= n <= 300
nums[i] is either 0, 1, or 2.
 

SOLUTION C++:

`class Solution {
public:
    void sortColors(vector<int>& nums) {
    int n=nums.size();
    int low = 0, mid = 0, high = n - 1; // 3 pointers

    while (mid <= high) {
        if (nums[mid] == 0) {
            swap(nums[low], nums[mid]);
            low++;
            mid++;
        }
        else if (nums[mid] == 1) {
            mid++;
        }
        else {
            swap(nums[mid], nums[high]);
            high--;
        }
    }
    }
};`
What is Cross Join in React?
Tags: react
Published: 2023-07-07 09:48:15

In React, there is no specific concept of a "cross join" like in SQL. React is a JavaScript library for building user interfaces, and its primary focus is on managing the component hierarchy and rendering UI elements based on data and state changes.

React follows a unidirectional data flow, where data is passed from parent components to child components through props. Components in React can be composed hierarchically, with parent components passing data down to their child components.

In the context of React, the concept of joining data is typically handled by combining data from multiple sources and passing it down the component hierarchy as props. This allows child components to access and display the relevant data based on their specific requirements. By obtaining [React Course](https://www.edureka.co/reactjs-redux-certification-training), you can advance your career in React. With this course, you can demonstrate your expertise in applications using React concepts such as JSX, Redux, Asynchronous Programming using Redux-Saga middleware, Fetch data using GraphQL, many more fundamental concepts, and many more critical concepts among others.  

To achieve the effect of a "cross join" in React, you would typically need to perform the data manipulation or combination outside of React, such as in your application's state management or data transformation layer. Once the data is combined or joined, it can be passed down to the React components as props, enabling them to render the UI based on the combined data.

React components are primarily responsible for rendering the UI and managing the user interactions within that UI. They are not intended to handle complex data manipulation or joining operations. Instead, React encourages a separation of concerns, where data processing and manipulation are handled by other parts of the application, and React components focus on presenting the data and managing the user interface.

In summary, React itself does not have a concept of a "cross join" as found in SQL. React is primarily concerned with managing the component hierarchy and rendering UI elements based on data and state changes. Joining or combining data from multiple sources is typically handled outside of React, and the combined data is passed down to React components as props for rendering.
Seeking Guidance and Knowledge: A Call to Senior Developers
Tags: webdev, softwareengineering, community, javascript
Published: 2023-07-07 09:44:25

👋 Hey there, fellow developers! As a new full-stack developer, I'm excited to be part of this community. However, I'm facing a challenge—my company's new project lacks senior developers to guide me. That's why I'm reaching out to experienced professionals like you. Let's connect and learn together!

As a full-stack developer, I handle various aspects of software development. But without senior mentors, I feel the absence of valuable guidance. That's where you come in. If you're an experienced developer, I'd greatly appreciate your insights and wisdom.

Whether it's sharing best practices, tips, or lessons learned, your knowledge can help me navigate complex challenges and grow as a developer. Together, we can bridge the gap and foster a supportive environment for learning.

To all the senior developers out there, I'm here, eager to connect with you. Your guidance can make a significant difference in my professional journey. Let's connect, share knowledge, and empower each other. Reach out to me, and let's embark on an enriching learning experience together!
STOCK BUY AND SELL 1 AND 11 leetcode solution C++
Published: 2023-07-07 09:41:10

STOCK BUY AND SELL I:
ou are given an array prices where prices[i] is the price of a given stock on the ith day.

You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.

Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.

 

Example 1:

Input: prices = [7,1,5,3,6,4]
Output: 5
Explanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5.
Note that buying on day 2 and selling on day 1 is not allowed because you must buy before you sell.
Example 2:

Input: prices = [7,6,4,3,1]
Output: 0
Explanation: In this case, no transactions are done and the max profit = 0.
 

Constraints:

1 <= prices.length <= 105
0 <= prices[i] <= 104


SOLUTION C++:

```
class Solution {
public:
    int maxProfit(vector<int>& prices) {
        int n=prices.size();
        int maxpro=0;
        int minprice=INT_MAX;
        for(int i=0;i<n;i++){
            minprice=min(minprice,prices[i]);
            maxpro=max(maxpro,prices[i]-minprice);
        }
        return maxpro;
    }
};


```





STOCK BUY AND SELL II :
You are given an integer array prices where prices[i] is the price of a given stock on the ith day.

On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day.

Find and return the maximum profit you can achieve.

 

Example 1:

Input: prices = [7,1,5,3,6,4]
Output: 7
Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4.
Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3.
Total profit is 4 + 3 = 7.
Example 2:

Input: prices = [1,2,3,4,5]
Output: 4
Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4.
Total profit is 4.
Example 3:

Input: prices = [7,6,4,3,1]
Output: 0
Explanation: There is no way to make a positive profit, so we never buy the stock to achieve the maximum profit of 0.
 

Constraints:

1 <= prices.length <= 3 * 104
0 <= prices[i] <= 104



SOLUTION C++:


class Solution {
public:
    int maxProfit(vector<int>& prices) {
        
        int n=prices.size();
        int maxpro = 0;
        for (int i = 1; i < n; i++) {
            if (prices[i] > prices[i - 1])
                maxpro += prices[i] - prices[i - 1];
        }
        return maxpro;
    }
};
How to create a closing menu icon using HTML and CSS
Tags: css, html, webdev, tutorial
Published: 2023-07-07 09:37:23

**A step-by-step guide on how to create a menu icon that transforms to close icon on hover.**

![Closing Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idzh7qlmdmnwloghgv9p.png)

**<u>HTML</u>**
For HTML we’ll need a container with 3 div elements — one for each line.
Container will have a class “menu_icon”.

```html
<div class="menu_icon">
    <div></div>
    <div></div>
    <div></div>
</div>
```

**<u>CSS</u>**
For CSS, first we’ll style the container.
We’ll display child elements in column using flexbox and add a little gap between them.
Then we’ll set the width to 8 px, which means that every line will be 8 pixels wide.
Since this element should be clickable, and should close a menu on click, we’ll set cursor to pointer.

```css
.menu_icon {
    display: flex;
    flex-direction: column;
    row-gap: 2px;
    width: 8px;
    cursor: pointer;
}
```
Now we’ll style the lines.
First we’ll set height for each line to 1 pixel and background color to black.
Then we’ll round the borders by setting border-radius to 1 pixel.
And lastly, we’ll add transition of 200 milliseconds so that every change on hover (that we’ll set later) is smooth.

```css
.menu_icon div {
    height: 1px;
    background-color: black;
    border-radius: 1px;
    transition: .2s;
}
```
Now we’ll style all 3 lines when “menu_icon” is hovered.
We’ll just add transition of 200 milliseconds to each line to make upcoming changes smooth.

```css
.menu_icon:hover div {
    transition: .2s;
}
```
Now we’ll style the first line on “menu_icon” hover.
We’ll set color of this line to red by changing background-color, and we’ll rotate it a bit.
This line now represents half of the close button and will slowly (200ms) rotate and change it’s color to red.

```css
.menu_icon:hover div:first-child {
    background-color: rgb(202, 34, 0);
    transform: rotate(40deg) translate(2px, 2.2px);
}
```
Now we’ll style the second line.
We’ll just set opacity to 0, to hide this element on hover.

```css
.menu_icon:hover div:nth-child(2) {
    opacity: 0;
}
```
And lastly, same as on the first line, we’ll set third’s line background color to the same red and rotate it a bit.
First and last line should slowly rotate and form X shape, while second line should disappear.

```css
.menu_icon:hover div:last-child {
    background-color: rgb(202, 34, 0);
    transform: rotate(-40deg) translate(2px, -2.2px);
}
```
Clicking on this element should close a menu.
And that’s it.

Thank you for reading. ❤️
What was your win this week?
Tags: discuss, weeklyretro
Published: 2023-07-07 09:30:00

---
title: What was your win this week?
published: true
description: Looking back on this past week, what was something you were proud of accomplishing?
tags: discuss, weeklyretro
published_at: 2023-07-7 09:30
---

Hey everybody 👋

Hope that y'all all have wonderful weekends. 

Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Making a tasty meal 🧆

---

![Jackie Chan licking his lips](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hs2hm4w88sib805ewc3.gif)
Build in Public: Week One Check-in
Tags: beginners, learning, discuss
Published: 2023-07-07 09:28:00

---
title: Build in Public: Week One Check-in
series: build in public monthly challenge
published: true
description: Join Virtual Coffee as we spend the month of July building in public!
tags: beginner, learning, discuss
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhsb2axu1sna401hlpe0.png
# Use a ratio of 100:42 for best results.
published_at: 2023-07-07 09:28 +0000
---

Hi friends :wave:

It's check-in time for the [Virtual Coffee Build in Public Challenge](https://dev.to/virtualcoffee/join-virtual-coffee-for-the-build-in-public-the-power-of-daily-standup-and-demo-challenge-35kb)! This is a challenge where you commit to sharing your progress on a project publicly, on a weekly basis.

**Tell us how you did this week.** You might share things like: 

- What did I accomplish this week?
- What are my goals for next week?
- What challenges am I facing?
- How can we help you?

And if you haven't started yet, that's ok too! Just jump into the check-ins when you're ready.
ServiceNow
Published: 2023-07-07 09:26:51

__**ServiceNow Integration Solutions**_
Connect ServiceNow to enterprise applications in the cloud or on-premises with SyncSnow. Migrate or synchronize data along with attachments. Verify the data before moving to target platform. Supports ServiceNow-ServiceNow, ServiceNow-Jira, ServiceNow-Oracle, ServiceNow-MySQL and many more platforms. With SyncSnow you can replicate your ServiceNow data in local database. SyncSNow also support data transfer from on-premise ServiceNow to cloud ServiceNow instance.


_**ServiceNow Integrations**_
   With real time and bi-directional servicenow integration with 
    on premise system. Organizations can fully integrate business 
    processes across HR, legal, finance, procurement, operations, 
    marketing, and facilities departments. It automates vital 
    business processes and shorten development cycles, increase 
    customer satisfaction and drive revenue growth.

_**ServiceNow Data Replication**_
 Data replication is a common solution for supporting data 
  integration requirements. Most important benefits of data 
  replication is disaster recovery and business continuity, local 
  backup, offload reporting and business intelligence. If primary 
  source fail a replicate can be swapped in immediately. Access to 
  your data even if your internet or cloud application service 
  provider is not available.

_**ServiceNow-Application Development**_
 Whether architectural and strategic advice, professional 
  implementation and integration services, or some form of managed 
  support services, our strong team of experienced professionals 
  can offer you what you need and customize services according to 
  our clients need. Clients are able to reach out to us with any 
  requirement on Servicenow integrations, be it customization or 
  application development. 

_**ServiceNow-Implementation**_
 Powerful, streamlined platform that helps you rapidly reduce 
  costs, lower risk, improve business agility, and boost IT 
  innovation. From battle-tested implementation methodology to 
  ongoing post-implementation support, we offer full-service 
  solutions to suit your needs.
[Digest] Java, Kotlin, Spring, Cloud, and More - Episode 3
Tags: digest, java, cloud, spring
Published: 2023-07-07 09:20:00

*I have a few ideas for bigger posts, and one of them is in progress now, so stay tuned. And in the meantime, here is what I found interesting this week.*

🌱 [URL Matching in Spring Boot 3](https://www.baeldung.com/spring-boot-3-url-matching): what's changed in URL Matching in Spring Boot 3, could help during migration from Spring Boot 2.

🐘 [Gradle 8.2 Release Notes](https://docs.gradle.org/8.2/release-notes.html): new Gradle version 8.2 is released, which contains more improvements in Kotlin DSL.

🐘 [Gradle 7.6.2 Release Notes](https://docs.gradle.org/7.6.2/release-notes.html): also, a new patch for Gradle 7.6 is released, which addresses two security vulnerabilities.

🤖 [Reactive Programming Made Easy](https://blog.jetbrains.com/idea/2023/06/reactive-programming-made-easy): how IntelliJ IDEA helps developing with reactive stack including debugging.

🦄 [The best UUID type for a database Primary Key](https://vladmihalcea.com/uuid-database-primary-key/): why random UUID is a bad choice for a primary key in a database.

🌪️ [EventStorming Modelling Tips to Facilitate Microservice Design](https://medium.com/nick-tune-tech-strategy-blog/eventstorming-modelling-tips-to-facilitate-microservice-design-1b1b0b838efc): some tips on how to conduct [Event Storming](https://www.eventstorming.com/) efficiently, so that it does not feel like a waste of time.

---

*Dream your code, code your dream.*
FIND THE DUPLICATE NUMBER LEETCODE SOLUTION C++
Tags: beginners
Published: 2023-07-07 09:04:30


Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive.

There is only one repeated number in nums, return this repeated number.

You must solve the problem without modifying the array nums and uses only constant extra space.

 

Example 1:

Input: nums = [1,3,4,2,2]
Output: 2
Example 2:

Input: nums = [3,1,3,4,2]
Output: 3
 

Constraints:

1 <= n <= 105
nums.length == n + 1
1 <= nums[i] <= n
All the integers in nums appear only once except for precisely one integer which appears two or more times.
 



C++ SOLUTION :

```
class Solution {
public:
    int findDuplicate(vector<int>& nums)//LINKED LIST CYCLE METHOD 
     {
        int slow = nums[0];
        int fast = nums[0];
        do {
            slow = nums[slow];
            fast = nums[nums[fast]];
        } while (slow != fast);
        // Find the "entrance" to the cycle.
        slow = nums[0];
        while (slow != fast) // WHENEVER  2ND TYM FAST AND SLOW POINTER MEETS IT GIVES DUPLICATE NUMBER  (EITHER THE FAST OR SLOW )
        {
            slow = nums[slow];
            fast = nums[fast];
        }
        return slow;
    }
    
};
```
AmSone Integrations
Published: 2023-07-07 08:51:45

**ServiceNow implementation and integration **
 [Technology Partner] 

**About**
ServiceNow Technology Partner.[ Specialised in ServiceNow Implementation, Integrations, Custom Application development, administration and support ]. 

AMSone
AMSOne established in the year 2018 with the aim of providing you with ServiceNow integration services and product to help your organization to take maximum advantage of integrations. With our product, Integrating your data in real time with ERP and business applications. It provides a complete set of solutions for all integration needs around ServiceNow. It makes integration simple and easy to use. It significantly reduces the work required to build, maintain and develop. We have high customization and configuration possibilities. We provide expert services that provide customization mapped to your specific needs. We work to understand the uniqueness of our clients and vision, so we can customize our services according to clients’ needs and supports their success .

1. Better service and cost management
2. Get customized services according to the complexity and need of your business
3. Quick implementation results in less turn around time .


**ServiceNow**
ServiceNow is a cloud based platform, which was mainly developed for workflow and process automation as per the ITIL principles The Now Platform from ServiceNow provides an Application Platform-as-a-Service (a PaaS). 
That means it is a cloud-based computing model which provides the infrastructure needed to develop, run, and manage applications.
 It is not limited to a specific department or function, but encompasses the entire enterprise. 
The Now Platform from ServiceNow provides a modern, easy-to-use, service management solution in the cloud .
**
Keturah Reserve
Published: 2023-07-07 08:50:35

Keturah Reserve [https://dubai-property.investments/property/keturah-reserve/](https://dubai-property.investments/property/keturah-reserve/) is a new collection of premium townhouses in Mohammed Bin Rashid City of Dubai. 4-5-bedroom townhouses will be fully furnished and have modern amenities. In addition, there will be swimming pools, recreation areas with barbecue and green spaces with developed sports and social infrastructure.
The houses will be built in a modern high-tech style. The main attraction of the complex will be a park with plants from different countries. Residents will receive a wide range of services, such as:
• fitness rooms and a spa;
• restaurants and cafes;
• sports grounds;
• yoga and meditation areas;
• a cinema;
• children’s playgrounds and much more.
The complex is under constant video surveillance and round-the-clock security.