teleren/devto huggingface dataset:
Golang 101: Switch
Tags: go, switch, fallthrough
Published: 2021-10-05 09:13:40

Çoklu sayıda koşulun sınanması durumunda tercih edilir. Sayfa sonuna **fallthrough** ile ilgili bilgi eklendi, daha önce yazıyı okuyanlar o kısmı da tekrardan gözden geçirmelidir.

```golang
package main

import (
	"fmt"
	"time"
)

func main() {

	// Genel Kullanım
	i := 2
	switch i {
	case 1:
		fmt.Println("i değişkeni 1'e eşittir.")
	case 2:
		fmt.Println("i değişkeni 2'ye eşittir.")
	case 3:
		fmt.Println("i değişkeni 3'e eşittir.")
	}

	// Çoklu Değer
	switch time.Now().Weekday() {
	case time.Saturday, time.Sunday:
		fmt.Println("Hafta sonu..")
	default:
		fmt.Println("Hafta içi..")
	}

	// Koşullu Switch
	t := time.Now()
	switch {
	case t.Hour() < 12:
		fmt.Println("Öğleden önce")
	default:
		fmt.Println("Öğleden sonra")
	}
}
```
```
i değişkeni 2'ye eşittir.
Hafta içi..
Öğleden sonra
```
[çalıştır!](https://go.dev/play/p/1YL0cNcx1Qq)

## Genel Kullanım
```golang
	i := 2
	switch i {
	case 1:
		fmt.Println("i değişkeni 1'e eşittir.")
	case 2:
		fmt.Println("i değişkeni 2'ye eşittir.")
	case 3:
		fmt.Println("i değişkeni 3'e eşittir.")
	}
```
Tanımlanan değişken `case` ile eşit ise ilgili işlev gerçeleşir.

## Çoklu Seçim
```golang
	switch time.Now().Weekday() {
	case time.Saturday, time.Sunday:
		fmt.Println("Hafta sonu..")
	default:
		fmt.Println("Hafta içi..")
	}
```
Günlerin Cumartesi ve Pazar olması durumu yani iki koşulunda gerçekleşmesi durumununa örnektir. Koşulun birden fazla sonuca uygunluğu bu yöntemle denetlenebilir.

## Koşullu Switch
```golang
	t := time.Now()
	switch {
	case t.Hour() < 12:
		fmt.Println("Öğleden önce")
	default:
		fmt.Println("Öğleden sonra")
	}
```
Diğer örnekler de `eşit` olması durumu göz önüne alınarak koşul belirtiliyordu fakat sonucun eşit olmaması durumları da `switch` ile denetlenebilir.

**YENİ BİLGİ:** Yeni öğrendiğim `fallthrough` komutu ile sonraki case'e yani koşula geçmesi sağlanabilir.
```golang
    i := 45
    switch {
    case i < 10:
        fmt.Println("i 10'dan küçük")
        fallthrough
    case i < 50:
        fmt.Println("i 50'den küçük")
        fallthrough
    case i < 100:
        fmt.Println("i 100'den küçük")
    }
```
Bu durumda çıktı önce "i 50'den küçük" yazdıracak ve `fallthrough` belirtildiği için sonraki `case`e geçip "i 100'den küçük" yazdıracaktır.
Full-stack infrastructure monitoring solution and my experience with InsightCat. From DevOps newcomer.
Tags: monitoring, devops, security, serverless
Published: 2021-10-05 08:54:05

Hello all!

A little bit about me. I'm a newcomer to the DevOps world and right now I try to understand what should I, as a junior DevOps, know and use to monitor IT infrastructure successfully.

My first major tasks sounded frightened to me at first. But, later, I understood that I just need to find the right solution that is accompanied by automation, so I can confidently rely on it. So, my goal was to find a SaaS to monitor a big IT ecosystem, prevent downtimes, analyze log data, etc.

I went through different blogs, forums, review websites, and the systems I came across everywhere were Datadog, New Relic, Zabbix, ELK, etc. Thanks to my team, we decided to test all of them and then decide which one is our favorite.

We started with Datadog. I can admit as a person, who doesn't have a strong tech background, you can't really understand what to do on the initial steps. Really steep learning curve that doesn't allow you to stay calm when you don't understand how to set the product up. Almost the same picture relates to other products.

Ok, I know that perhaps my scenario isn't for senior DevOps or SecOps specialists. When you've spent years in IT, it's obvious for you, how to write tones of code and configure tools like Datadog. But my case is more about guys who try to figure everything out quickly and hope that this tool will cover all business-critical needs. Especially, when you want your boss to be proud of you :)

So, the choice was https://insightcat.com/. I have never met them before and was curious to try this product.

The first good sign. I set it up quickly without the need to write a lot of code. Wow! I installed the agent by using Telegraf. Then I connected my infra to InsightCat server. And, finally, I started to receive data. Because of auto-discovery, InsightCat explored my system automatically.

My personal favorite parts are Logs and Insights. I worried that I won't find a solution that can display log data in so user-friendly framework.

![log management](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/clp9j9ajq2tmwnckech8.png)
 
And, my need to have downtime prevention was filled by Insights. This tool allows you to see the most important metrics and see whether the figures were increased and get root cause analysis.

![detect downtime](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s907u8w9z4fp0vteeap7.png)
 
I'm not saying that other solutions are bad. Once again, I'm not a deep tech person. Yes, my skills are required to be deeper. But even in my situation, there was a relevant solution.

Good job, guys from InsightCat!

Share your experience if you also used InsightCat or any other products mentioned above. Was a Datadog also difficult for you? Maybe New Relic?

Thank you!
PowerPage - Coding desktop application using javascript/html/css
Tags: javascript, productivity, html
Published: 2021-10-05 08:46:28

I had longed for a web browser which has DB connectivity, so that can coding JavaScript/html/css application like Electron. Finally I aware that can code one by myself.

["PowerPage"](https://github.com/casualwriter/powerpage) (version 0.60) is a lightweight web browser with DB capability and windows accessibility, for rapid development of javascript/html application.

![Screen Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eg6dkylgbqon3he3teve.gif)


"PowerPage" will connect to database, load startup page using Microsoft web-browser control (equivalent to IE11), and communicate with html/js page by pb:// or ps:// protocol to provide below features

* (Run) Call External Program
* (File) Access file system
* (DB) Database Accessibility
* (PB) Call Powerbuilder Windows/Functions
* (Misc) Global variables, sessions information

It is a **portable solution** with **single executable file**. Just download, run and start coding!

More, it released with some useful "sample applications"

1. [Powerpage Markdown Editor](https://github.com/casualwriter/powerpage-markdown) (95 lines of code)
2. [Powerpage Web Crawler](https://github.com/casualwriter/powerpage-web-crawler) (350 line of code)
3. Powerpage Document Framework (160 line of code)


Hope you like it, and have a great day,
Notes on Resilient Services
Published: 2021-10-05 08:45:01

**Resilience** = a systems capability to withstand errors and faults and the effectiveness at recovering.

**Reliability** = the measurement of a system ability to behave as expected for a given time interval.

**Observability** = how well a systems internal states can be inferred from knowledge of its external outputs. A system can be considered observable when it's possible to quickly and consistently ask novel questions about it with minimal prior knowledge.

Detecting and debugging problems is a fundamental requirement if we wish to produce a robust and painless system. Distributed systems are complex and often even locating where a problem is can be time consuming.

The number of possible failure states for any given system is proportional to the product of the number of possible partial and complete failure states of each of its components, and it's impossible to predict them all.

## Scaling:

**Vertical** = Upsize (or downsize) RAM or CPU etc. Technically speaking it's relatively straightforward but a system can only be vertically scaled so much.

**Horizontal** = Adding (or removing) service instances. For example adding more service nodes behind a load balancer or containers in kubernetes / ECS. More replicas = greater design and management complexity, not all services can be horizontally scaled.

## Concurrency is not Parallelism

**Parallelism** refers to the execution of multiple processes simultaneously. The processes must be executing at the same time, which is impossible on a single processor. Multi core processors allow for parallel execution.

**Concurrency** refers to the composition of independently executing procedures. This idea is about structuring a set of managed processes to increase performance regardless of executing the processes in parallel.

We can use the ACP (algebra of communicating processes) describe what concurrency might look like. In this framework processes are considered control mechanisms for the manipulation of data.

For more in-depth reading on process algebra:
http://www.few.vu.nl/~wanf/BOOKS/procalg.pdf
Angular : Service in Angular
Tags: angular, javascript, service, beginners
Published: 2021-10-05 08:37:39

<b>Part 10: Service in Angular | Why & What is Service in Angular</b>

Explained About 
* What is the need of service in Angular ?
* What is Service in Angular ?
* How to Create & Consume Service

{%youtube P8C8UY_2A4c %}
Building a Fast Web Interface in Django for Data Entry
Tags: django, webdev, datascience, beginners
Published: 2021-10-05 08:28:40

In this article I describe a simple strategy to build a fast Web Interface for data entry in Django. The article covers the following topics:

* Overview of Django
* Install Django
* Create a new Project
* Create a New App
* Create your Database
* Build the Data Entry Web Interface

# 1 Overview of Django
Django is a Python Web framework designed to build fast Web Applications. A single instance of Django is called Project. A Project may contain one or more Apps.

Django follows the Model-Template-View (MTV) architecture. MTV differs from the Model-View-Controller (MVC) architecture in the sense that the Controller part is already implemented by the framework itself through templates.

The Django MTV architecture is composed of the following components:

* **Model**: it defines the logical data structure. In practice, a model is a Python class, which represents a single table in the database. All the classes representing the logical structure of the database are stored in a script named models.py.
* **View**: it defines the business logic, in the sense that it communicates with the model and translates it into a format readable by the Template. A view is a Python function, which takes a request as input and returns a Web response as output. All the functions representing the business logic are stored in a script named views.py.
* **Template**: it defines the structure or the layout of a file, such as a HTML file. It is a text document or a Python string encoded through the Django template language. All the templates are stored in a subdirectory of the App named templates.

[https://towardsdatascience.com/building-a-fast-web-interface-in-django-for-data-entry-62f24947ef23](https://towardsdatascience.com/building-a-fast-web-interface-in-django-for-data-entry-62f24947ef23)
#Spring #spring_boot #create_new_proyect #Basic #H2 database #_
Tags: java, spring
Published: 2021-10-05 08:27:54

*Este es un ejemplo básico para inicializar un tipo de proyecto con spring boot.*

Si ingresamos a Spring Boot initializr https://start.spring.io/
podemos crear un proyecto basico o inicial y agregar las dependencias iniciales que deseamos que cuente nuestro proyecto.

En este caso usamos java 8, 

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7yc73h3gtlaywb2qrqat.png)
 
agregando dependencias como: 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkiz0yd6xl3bsptuhh5r.png)

dep. basicas agregadas:
**Lombok** para evitar repetir codigo,
**Validation** con hibernate validator, validar data.
**JPA** usa hibernate como ORM u ODM para la persistencia del proyecto.
**H2 Database**soportada por JDBC, para usar una base de datos de prueba rapida com desarrolador.
**spring devtools** en para mejorar la experiencia del desarollador con livereload y restarts automaticos de servidor.
**thymeleaf** como motor de plantillas
**SPRING WEB** nos proporciona la el contenedor de apache tomcat embebido y para usar el RESTfull en una arq. MVC.

Aceptas, se descarga un comprimido y al descomprimirlo ya tienes tu proyecto básico.


Listo!
11 Ways to be Productive this year!
Published: 2021-10-05 08:23:06


Productivity is a measure of how much work is done in a particular segment of time. Productivity is directly related to managing your time well. Good time management skills are required to be productive. Everyone wants to be productive nowadays. No matter where they work or what they do, they all want to be productive in life. Being productive is very challenging nowadays. Focusing on an important task and eliminating distractions is very difficult in the technology area. Successful are the people who can manage to save time doing productive tasks and eliminate procrastination from their life. In order to be successful in life, you need to stay on the task at hand, avoid distraction, limit the use of social media and complete all your tasks in time. <a href="https://www.coubis.com/blog/11-ways-to-be-productive">Read More..</a>
Pentest network python tool
Tags: showdev, python, cybersecurity, security
Published: 2021-10-05 07:47:00

Hey guys! Hope you all doing well. I just want to show you a project I am working on (https://github.com/medpaf/medsec). 

MedSec is a network utility tool that I developed to perform some network, security administrator and pentesting tasks. Currently, this script can perform a good variety of tasks such as:

- Port scan, including SYN, TCP, UDP, ACK, comprehensive scan;
- Host discovery (scan for up devices on a local network);
- Banner grabbing;
- DNS checks with geolocation information;
- Subdomain enumeration;
- Vulnerability reconnaissance for web applications
- ifconfig (beta);
- ping (beta);
- traceroute (beta);
- IP spoofing;
- Packet sniffing.

Please feel free to leave feedback. Kudos

https://github.com/medpaf/medsec
Top 10 dev.to articles of the week👘.
Tags: webdev, javascript, beginners, productivity
Published: 2021-10-05 07:34:17

DEV is a community of software developers getting together to help one another out. The software industry relies on collaboration and networked learning. They provide a place for that to happen.
Here is the most popular articles published on this platform.
{% post /jburroughs/bookmark-these-8-front-end-websites-now-gl0 %}

{% post /olanetsoft/12-github-repositories-to-help-you-ace-your-job-interview-2a08 %}

{% post /sourcegraph/15-developer-tools-to-make-you-super-productive-2g0a %}

{% post /muthuannamalai12/10-github-repository-every-web-developer-should-know-10pm %}

{% post /devteam/hacktoberfest-2021-is-here-4a3l %}

{% post /santan47/promise-async-await-in-javascript-mlb %}

{% post /collins87mbathi/building-a-dating-app-with-mern-478h %}

{% post /kemyd/the-largest-library-of-ui-components-for-popular-frameworks-51b5 %}

{% post /codesphere/building-a-chrome-extension-in-minutes-3662 %}

{% post /bscript/javascript-security-checklist-af %}
Enjoy these articles.
Follow me for more articles.
Thanks 💖💖💖
Bouncing Ball With CSS
Tags: tutorial, beginners, css, codenewbie
Published: 2021-10-05 07:05:04

What's up?

Have you ever wanted to bounce a ball with CSS for no apparent reason? Well, in this tutorial, I will show you how to do just that. You'll also learn CSS animations along the way.

![A bouncing ball, made with CSS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/536619xeo0752dd3c280.gif)

This time around, I'll just jump straight to the code.

## Our HTML Code:

```html
<div>
</div>

<span>
</span>
```

All we need is a `div` and a `span`. The `div` will act as our ball, and the `span` will act as a shadow. Both will be animated, but we'll get to that when we jump into the CSS code.

---

**NB:** We could literally use almost any element for this purpose. I just choose two that are quick and easy to remember.

---

## Our CSS Code:

To style the ball, we have:

```css
div {
  background-color: red;
  border-radius: 100%;
  height: 50px;
  left: calc(50% - 50px);
  position: absolute;
  right: calc(50% - 50px);
  width: 50px;
  animation: bounce 1s ease-in-out infinite;
  animation-fill-mode: both;
  animation-direction: alternate;
}
```

And to create the shadow, we use:

```css
span {
  border-radius: 100%;
  bottom: 32.5%;
  left: calc(50% - 50px);
  right: calc(50% - 50px);
  position: absolute;
  content: '';
  background-color: black;
  filter: blur(3px);
  width: 50px;
  height: 5px;
  animation: shadow 1s ease-in-out infinite;
  animation-fill-mode: both;
  animation-direction: alternate;
  z-index: -1;
}
```

Our ball is animated via this declaration block, for the animation we're calling 'bounce':

```css

@keyframes bounce {
  from {
    top: 25%;
    transform: scaleX(79.5%) scaleY(65%);
  }
  to {
    top: 55%;
  }
}
```

---

**NB:** You can tweak these property values any way you like. What's important here is the `top:` property, which does the bouncing for us, by moving the ball up and down the page. If you like, you can swap these values and see what it does.

---

Finally, here is the declaration block for the animation, 'shadow'. Again, you can tweak these values any way you like, and see what happens.

```css
@keyframes shadow {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: .5;
    transform: scale(100%);
  }
}
```

You can find the source code for this short tutorial here: [https://codepen.io/rolandixor/pen/mdwZReq](https://codepen.io/rolandixor/pen/mdwZReq)
How to use React icons in Next.js
Tags: react, nextjs
Published: 2021-10-05 07:01:34

Icons are a big part of most websites/applications. So let's take a look at how we can use React icons in a Next.js project.

React icons is one of the most popular icon libraries for React-based projects.
It utilizes ES6 imports meaning we only load the icons we use!

## Loading React icons in Next.js

We first have to add the package to our project by running the following command in your project folder to get started.

```bash
npm i react-icons
```

Then we can get started by importing the icons.
Head over to the [React icons website](https://react-icons.github.io/react-icons) and find the icon you would like to use (use the left-hand search).

Then on the component, we want to use the icon, we can import it like so:

```jsx
import {BsGrid3X3GapFill} from 'react-icons/bs';

<button>
  <BsGrid3X3GapFill />
</button>;
```

Let's put that to use and modify the [grid/list view toggle](https://daily-dev-tips.com/posts/nextjs-toggle-between-grid-and-list-view/) we just created.

## Loading multiple React icons in Next.js

For this, we'll need two icons being a grid and a list icon.
I've chosen both from the same icon set ([bootstrap](https://react-icons.github.io/react-icons/icons?name=bs)).

Let's load both icons:

```js
import {BsGrid3X3GapFill, BsList} from 'react-icons/bs';
```

And then, instead of the plain text we had, let's change that into containing our icons.

```jsx
<div className="flex justify-end p-5">
  <button
    className="px-4 py-2 font-bold text-white bg-blue-500 rounded-full hover:bg-blue-700"
    onClick={() => setToggleViewMode(!toggleViewMode)}
  >
    {toggleViewMode ? <BsGrid3X3GapFill /> : <BsList />}
  </button>
</div>
```

And that's it. We now have our React icons set up in a Next.js application.

You can find the complete code example on [GitHub](https://github.com/rebelchris/next-tailwind/tree/icons).

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
The Complete Web Component Guide: Part 2 — HTML Templates
Tags: javascript, webdev, tutorial, programming
Published: 2021-10-05 07:00:54

[![](https://cdn-images-1.medium.com/max/2000/1*KE5bZMF41HQnn2bupDozcQ.png)](https://medium.com/front-end-weekly/the-complete-web-component-guide-part-1-custom-elements-a627af805df8?source=rss-f6e6b5239e7f------2)

Become an expert in the future of Web Development

{% medium https://medium.com/@mariusbongarts11/the-complete-web-component-guide-html-templates-a957f1ee43fc %}
Undaku SaaS Builder Suite
Tags: nocode, saas, webdev, nocodeplatform
Published: 2021-10-05 06:48:29


The Undaku SaaS Builder Suite has all the great features that are required to build a 
line-of-business app for the customers. Both the user companies and SaaS developer companies can get started with no prior knowledge of coding or need for training. They have built the platform for any business user to build apps for their business or their client's business. 
 
Using the Undaku platform, by simply dragging and dropping elements, with almost no technical knowledge, you can create a complete working product - say to capture and process your transactions or analyze your business data or manage workflows for your day-to-day operations. Undaku SaaS development platform can be used to create any applications, be it an ERP, CRM, Field Service, Customer Service, Customer Engagement or Experience or a ChatBot or anything you name with minimum effort, time, and cost. You can create add-on applications or forms to your existing business applications like SAP, Oracle Cloud, Salesforce, Microsoft Dynamics, or any such business applications.
What are the best css trends??
Tags: discuss
Published: 2021-10-05 06:43:12

So hey!!
Here again for you all. So what's today.. 
I have come up with 2 css trends so that your website looks cool!!

1) Glassmorphism
The most popular trend this year. It is a effect which gives you a blurry glass like background. Blurs the background text/image. I also have a post on it. Check it out on my profile.

2) Neumorphism
It's the popular trend of the past year but still popular. It makes buttons text look like pop - out of the screen . 



No it's the Bye time.. Follow me , heart the pos and if you like it then unicorn it!! Try both the css trends and thank me afterwards. Till then. BYEEEEEE.