teleren/devto huggingface dataset:
Googling how Google was made..
Tags: startup, motivation, googlecloud
Published: 2021-05-03 14:20:34

Google, a firm that began with just a search engine today is the mother of all software developments going around the world. You can name a software and you will find that Google already has one or is developing the same. This happened because apart from the correct working methodology, Larry Page and Sergey Brin used google as their tool for advertising google. In terms of the User Satisfaction stories that they were unknowingly creating worldwide it was predictable that this firm was going to get fourfold revenues to their investment. 
The most interesting part understood here was the systematic approach that google used and it technically never stopped improving, it could be one of the reasons why Google overpowered Yahoo or maybe Microsoft in this case but that’s a debate for some other day.
Google didn’t just stop when their Search Engine was a massive hit, besides improving the search results there were separate teams deployed to research on the availability of Document Sharing Platforms, Video streaming portals, how they can use Satellites for their benefit and many more. The learning was to build a good base and then capitalize, for example google earth was just  developed to view different fascinating places of world from a satellite’s perspective but this curiosity laid the foundation for making a system that can use AI to trace paths and roads from the satellite images, then applying the concepts of Graph Theory  and developing Navigation System that laid foundation for Google Maps that make us feel like the entire world is a familiar place again as I said, Base first then smart strategy and in the end Capitalize. 
Google also has been in the center of learning when it comes to entrepreneurship. It taught how you can make more money from revenues; it was in 2004-05 that google was having shares priced at $100 which was too high at that time. It came into sheer dominance today because they were among a few rare firms who believed AI will drive them to success and to add, they are developing self-driving cars based on AI as well. The Research and Development aspect were very well managed by Google, which is paying dividends to the firm Today, be it a decision to make their own browser suggested by Sunder Pichai or may be the decision to acquire YouTube. Google ad-words is one such idea that has absolutely revolutionized the way how advertisements were performed. You talk about buying a laptop and you get an add for the same as soon as you step onto any web portal, they have been absolutely Spot On with their customer research and accuracy. The concept of Google-ads initially faced backlash as they saw Frauds happening abruptly based on Pay per click basis, the firm, this time looked to optimize the solution and today we can find that the adds now are not based on attracting random customer they are no more generalized, they are being personalized slowly.
Made Weather App from React
Tags: react, css, javascript
Published: 2021-05-03 14:02:27

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7sp0wqyo1vlfmsxe8z79.png" alt="">
Hello everyone😃😃😃, I have made weather app. Please go through it as this is my first mini project using reactjs.

Link for the application : 
https://sanu-coder.github.io/weather-app/

Source code Link : 
https://github.com/sanu-coder/weather-app/tree/master
Enviewer is an extension that lists the configuration values of ASP.NET Core
Tags: dotnet, middleware, configuration, nuget
Published: 2021-05-03 13:59:38

---
title: Enviewer is an extension that lists the configuration values of ASP.NET Core
published: true
description: Enviewer is an extension that lists the configuration values of ASP.NET Core.
tags: dotnet, middleware, configuration, nuget
//cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40uxz3sk7eralltp1qz9.png
---

The middleware in ASP.NET Core is useful because it allows new features to be added without affecting the original behavior.

When developing an application using ASP.NET Core, you may want to know the configuration values registered in `Microsoft.Extensions.Configuration.IConfiguration` .  
For example, if you are developing microservices using YAML files.

I have published a NuGet package called Enviewer to help myself. This will make it easier to see the configuration values of `IConfiguration`.

https://www.nuget.org/packages/Enviewer/

# Getting Started

1. Install the standard Nuget package into your ASP.NET Core application.

    ```
    Package Manager : Install-Package Enviewer -Version 1.0.0
    CLI : dotnet add package Enviewer --version 1.0.0
    ```

2. In the `Configure` method of `Startup.cs`, insert middleware.

    ```csharp
    app.UseEnviewer();
    ```

    By accessing `/enviewer` in your browser, you can view all the environment variables registered in `Microsoft.Extensions.Configuration.IConfiguration`.
    
    ![sample](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40uxz3sk7eralltp1qz9.png)

I used these documents when I developed my package.

[Write custom ASP.NET Core middleware | Microsoft Docs](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/write?WT.mc_id=DT-MVP-5002209)

[Test ASP.NET Core middleware | Microsoft Docs](https://docs.microsoft.com/en-us/aspnet/core/test/middleware?WT.mc_id=DT-MVP-5002209)
MySQL for Data Analytics
Tags: sql, data, analytics
Published: 2021-05-03 13:31:33

To learn SQL from basics I have uploaded all the related files in Github and the link is provided below.

# The following topics are covered:-
### 1)DDL
### 2)DML
### 3)DCL
### 4)TCL
### 5)Keys
### 6)Relational Schema
### 7)Data Types
### 8)Constraints
### 9)Operators
### 10)WildCard Characters
### 11)Aggregate Functions
### 12)GROUP BY, ORDER BY
### 13)WHERE (vs) HAVING
### 14)LIMIT
### 15)JOINS 
### 16)UNION (vs) UNION ALL
### 17)SubQueries
### 18)EXISTS (vs) IN
### 19)Views
### 20)Stored Routines
### 21)Advanced SQL Topics like Triggers, Variables, INDEX, CASE etc

Link to access all the related files:
https://github.com/ruthvikraja/SQL
YAGNI & KISS Principles
Tags: cleancode, programming, software, productivity
Published: 2021-05-03 13:27:21

## YAGNI 

YAGNI stands for **You Ain’t Gonna Need It**. It’s a principle from software development methodology of Extreme Programming (XP). This principle says that you should not create features that it’s not really necessary.

Ron Jeffries, one of the co-founders of the XP, once said:

```Always implement things when you actually need them, never when you just foresee that you need them.```

It means that you should not implement functionality just because you think that you may need it someday, but implement it just when you really need it. 

*Benefits of YAGNI principle*

1- Avoid spending time with implementations that were not even necessary, and maybe will never be used.

2- With more unnecessary code you write, you may discard write unit tests for them! and then you will start having more issues regarding code quality tools.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/go4gab84r59zjsg4lwna.png)


## KISS Principle

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i5gs9d0j108aso07th9j.gif)

**KISS** is an acronym for Keep It Simple, Stupid. This principle says about to make your code simple. You should avoid unnecessary complexity. A simple code it’s easier to maintain and easier to understand.

*How to apply KISS principle in code?*

You should eliminate duplicated code, remove unnecessary features, also don’t use unnecessary variables and methods, follow know standards of code development, also you should separate the responsibilities of your classes and the responsibilities from the layers of the project.

**Conclusion**

As you can see, The difference between them as you may expect from the header photo, it’s that YAGNI focus on removing unnecessary functionality and logic, and KISS focus on the complexity.



References

The Pragmatic Programmer — David Thomas and Andrew Hunt

Software Architect’s Handbook — Joseph Ingeno

Extreme Programming Installed — Ron Jeffries, Ann Anderson, Chet Hendrickson
How to implement simple Factory Pattern in Node.js
Tags: node, factory, pattern
Published: 2021-05-03 13:25:28

https://grokonez.com/design-pattern/implement-simple-factory-method-pattern-node-js-example

How to implement simple Factory Pattern in Node.js

Instead of using class constructors or <code>new</code> keyword to create an object of a class, we can abstract this process. So, we can determine the type of object at run-time, by the time of generating that class object. The implementation seems like Factory Method, but simpler than Factory Method. This simple Factory is not treated as a standard GoF design pattern, but the approach is common to any place where we want to separate the code that varies a lot from the code that does not vary.

In this tutorial, <a href="https://grokonez.com" target="_blank" rel="nofollow noopener noreferrer">grokonez</a> shows you how to do it in NodeJs.

<!--more-->
<h2>Nodejs simple Factory Pattern example</h2>
<h3>Overview</h3>
In this example, we have 3 types of cars: Audi, BMW, Mercedes. The car generating process depends on the input string <code>"Audi"</code> or <code>"BMW"</code> or <code>"Mercedes"</code>.

<code>CarFactory</code> is the Factory class. In the client, we won't use <code>new</code> keyword but <code>create()</code> method to create a new car:
<pre><code class="language-javascript">
const BMW = CarFactory.create('BMW');
</code></pre>
<h3>Sample Structure</h3>
<img src="https://grokonez.com/wp-content/uploads/2019/04/nodejs-simple-factory-pattern-example-sample-structure.png" alt="nodejs-simple-factory-pattern-example-sample-structure" width="679" height="249" class="alignnone size-full wp-image-17627" />
<h2>Implement simple Factory Pattern in Nodejs</h2>
<h3>Create default class</h3>
This <code>Car</code> class is a parent class for <code>Audi</code>, <code>BMW</code>, <code>Mercedes</code> class that we're gonna create in the next steps.

<em>default_car.js</em>
<pre><code class="language-javascript">
class Car {
    constructor(name) {
        this.name = name + '-' + Math.random().toString(36).substring(2, 15);
    }

    showInfo() {
        console.log(`I'm ${this.name}`)
    }
}

module.exports = Car;
</code></pre>
This class has constructor method that assign a generated id to the car's name and a <code>showInfo()</code> method to show the <code>name</code> field.
<h3>Create subclasses of default class</h3>
Now we create 3 classes: <code>Audi</code>, <code>BMW</code>, <code>Mercedes</code> that extends default <code>Car</code> class above.

More at:

https://grokonez.com/design-pattern/implement-simple-factory-method-pattern-node-js-example

How to implement simple Factory Pattern in Node.js
CloudFormation Example for an IAM User with Rotating Credentials
Tags: aws, security, cloud, devops
Published: 2021-05-03 13:15:08

---
title: CloudFormation Example for an IAM User with Rotating Credentials
published: true
tags: [ aws, security, cloud, devops ]
canonical_url: https://thomasstep.com/blog/cloudformation-example-for-an-iam-user-with-rotating-credentials
---

I had a need for an IAM User not too long ago and wanted to create a CloudFormation template instead of going through the console. I do not create IAM entities too often, so I figured that this would be a good time to cement my knowledge into a template. I wanted the user to have CLI access for some automation, which meant that I needed to also create an access key. While I was looking through the documentation for access keys I noticed an interesting field: `Serial`.

`Serial` is a field specific to CloudFormation that accepts an integer. If that integer is increased, the access key is rotated. This is a cool feature that I knew I wanted to test out.

After creating an IAM User, I wanted to create an access key for that user based on a `Serial`, and after that access key was created, I wanted to store the credentials in a secret. Whenever the credentials needed to be rotated, it should be as simple as incrementing the `Serial` and grabbing the new credentials from the secret. Here is what I came up with.

```yml
Parameters:
  Serial:
    Type: Number
    Description: Increment this to rotate credentials

Resources:
  IamUser:
    Type: AWS::IAM::User
    Properties: 
      ManagedPolicyArns: 
        - arn:aws:iam::aws:policy/AdministratorAccess
  AccessKey:
    Type: AWS::IAM::AccessKey
    Properties: 
      Serial: !Ref Serial
      Status: Active
      UserName: !Ref IamUser
  AccessKeySecret:
    Type: AWS::SecretsManager::Secret
    Properties: 
      Description: !Sub "These are the credentials for the IAM User ${IamUser}"
      SecretString: !Join
        - ""
        - - '{"AccessKeyId":"'
          - !Ref AccessKey
          - '","SecretAccessKey":"'
          - !GetAtt AccessKey.SecretAccessKey
          - '"}'

```

This template is also available in my [`aws-cloudformation-reference` repository](https://github.com/thomasstep/aws-cloudformation-reference/blob/21543313e993c2183c95846255a1fcfa350f9870/iam/iam-user.yml). I also [made a video of me creating the template](https://www.youtube.com/watch?v=hcEWgwP2xzk) in case the process of building and deploying something like this from scratch is of interest.
TIL There are public clouds that still offer Redis 3
Tags: todayilearned, cloud, otc
Published: 2023-05-19 20:40:22

---
title: TIL There are public clouds that still offer Redis 3
published: true
date: 2021-05-03 13:11:00 UTC
tags: TIL,cloud,otc
canonical_url: https://www.zufallsheld.de/2021/05/03/til-there-are-public-clouds-that-still-offer-redis-3/
---

The Open Telekom Cloud provides [Redis](https://redis.io/) as a Service called [Distributed Cache Service](https://docs.otc.t-systems.com/usermanual/dcs/en-us_topic_0054235826.html).

The used Redis version is 3, first published on 1 Apr 2015. The latest 3.0.x release was published on 28 jan 2016. The current version is 6.2.2, published on Mon April 19 2021.

Redis supports TLS communication since version 5.
Inject Properties from Properties File using Spring Environment
Tags: environment, spring
Published: 2021-05-03 13:01:54

https://grokonez.com/spring-framework/inject-properties-from-properties-file-using-spring-environment

Inject Properties from Properties File using Spring Environment

We can load properties value from Properties file to <strong>Spring Environment</strong> just by using <strong>@PropertySource</strong> annotation. This tutorial shows you the simple way to get them from <strong>Environment</strong> object.

Related Articles:
- <a href="https://grokonez.com/spring-framework/spring-core/inject-properties-from-properties-file-using-value-annotation">Inject Properties from Properties File using @Value annotation</a>
- <a href="https://grokonez.com/spring-framework/spring-core/inject-properties-from-properties-file-using-configurationproperties-annotation">Inject Properties from Properties File using @ConfigurationProperties Annotation</a>
- <a href="https://grokonez.com/spring-framework/spring-core/use-spring-factory-method-create-spring-bean">How to use Spring Factory Method to create Spring Bean</a>

<!--more-->
<div id="tuttoc" class="jsa-toc"></div>

<div id="tutcontents">
<h2>I. Technology</h2>
- Java 1.8
- Maven 3.3.9
- Spring Tool Suite – Version 3.8.1.RELEASE (It's OK if you use Eclipse)
<h2>II. Overview</h2>
<h3>1. Project Structure</h3>
<img src="https://grokonez.com/wp-content/uploads/2016/10/springenvironment-structure.png" alt="springenvironment-structure" width="694" height="390" class="alignnone size-full wp-image-1587" />
In this example, we have 2 ways to access Properties from <strong>Environment</strong>:
- get <strong>Environment</strong> from <strong>Application Context</strong> wherever we wanna use it.
- use a seperate properties bean object to get <strong>Environment</strong> in the configuration class.

Both of them call method <strong>Environment</strong>.<em>getProperty</em>("property_key") to get property value for corresponding <strong><em>property_key</em></strong>.
<h3>2. Step to do</h3>
- Create Maven project
- Add Dependencies & Plugins
- Add Properties File
- Create Properties Class
- Create Configuration Class
- Create MainApplication Class
- Run Application &amp; Enjoy Result
<h2>III. Practice</h2>
<h3>1. Create Maven project</h3>
- Open <strong>Spring Tool Suite</strong>, on <strong>Menu</strong>, choose <strong>File</strong> -&gt; <strong>New </strong>-&gt; <strong>Maven Project</strong>.
- Check <strong>Create a simple project</strong>, choose Workspace Location and click <strong>Next</strong>.
- Fill all fields in Artifact group box, then click <strong>Finish</strong>.
<h3>2. Add Dependencies & Plugins</h3>
Open <strong>pom.xml</strong>, add:

More at:

https://grokonez.com/spring-framework/inject-properties-from-properties-file-using-spring-environment

Inject Properties from Properties File using Spring Environment
Importance of destructuring in react hooks
Tags: react, webdev, javascript
Published: 2021-05-03 13:00:50

Have you realized that we are using destructuring every where with react hooks. Take a look at this simple example 

```
const [counter, setCounter] = useState(0);
```

We are using destructuring here, to get statevalue and state updater function. But why does it have to be this way always.

well here is my take on explaining why destructuring is important. Take a look at this sandbox. Its a simple counter component that updates every second. 

{% codesandbox n28hz %}

If you check the logs on the console. They will be something like this

```
counter updated new value is 0 
setCounter  updated 
counter updated new value is 1 
counter updated new value is 2 
counter updated new value is 3 
counter updated new value is 4 
counter updated new value is 5 
.
.
.
.
```

Now suppose we don't use destructuring for useState hook and accept it as array in which `state[0]` is our counter value and `state[1]` is counter updater function. Check the sandbox

{% codesandbox ectty %}

and check the logs on console too

```
counter updated new value is 0 
setCounter  updated 
counter updated new value is 1 
setCounter  updated 
counter updated new value is 2 
setCounter  updated 
counter updated new value is 3 
setCounter  updated 
counter updated new value is 4 
setCounter  updated
.
.
.
.
```

What does this mean. It means following set of conclusions
1. Any hook gets called during rerender too
2. The return value of hook on each rerender is not referentially the same (except if you are returning primitive values from hook)
3. Always destructure values from hook for sake of simplicity in the code.
4. useEffect dependancy are shallow checked for equality. 

I hope you like or understood what I am trying to explain here. If you have any suggestion please comment it down below.
Improving your Rails mailers with `email_address_with_name`
Tags: ruby, rails, webdev
Published: 2021-05-03 13:50:06

---
title: Improving your Rails mailers with `email_address_with_name`
published: true
date: 2021-05-03 13:00:00 UTC
tags: ruby,rails,webdev
canonical_url: https://boringrails.com/tips/rails-mailers-email-address-with-name
---

In almost all email programs, you can add a display name before your email address like so:

```
To: Matt Swanson <matt@example.com>
```

It’s a small touch, but it is a more human-readable way of addressing an email. Rails provides a helper utility to format email addresses in this style without resorting to manual string manipulation.

## Usage

Use `email_address_with_name` to add a name in-front on an email address in a standard way

```ruby
ActionMailer::Base.email_address_with_name("swan3788@gmail.com", "Matt Swanson")
=> "Matt Swanson <swan3788@gmail.com>"
```

This helper is available in all Rails mailers.

```ruby
class UserMailer < ApplicationMailer
  default from: 'notifications@example.com'

  def welcome_email
    @user = params[:user]

    mail(
      to: email_address_with_name(@user.email, @user.display_name),
      subject: 'You have a new message'
    )
  end
end
```

## Options

This helper handles `nil` gracefully as well.

```ruby
ActionMailer::Base.email_address_with_name("swan3788@gmail.com", nil)
=> "swan3788@gmail.com"
```

And it handles escaping characters automatically:

```ruby
ActionMailer::Base.email_address_with_name("mike@example.com", "Michael J. Scott")
=> "\"Michael J. Scott\" <mike@example.com>"

ActionMailer::Base.email_address_with_name("chip@example.com", 'John "Chip" Smith')
=> "\"John \\\"Chip\\\" Smith\" <chip@example.com>"
```

## Additional Resources

Rails API: [ActionMailer::Base#email\_address\_with\_name](https://api.rubyonrails.org/classes/ActionMailer/Base.html#method-c-email_address_with_name)

* * *
[![](https://boringrails.com/images/twitter-banner.png)](https://twitter.com/_swanson)
How to inject Collection in Spring
Tags: spring, collection, inject
Published: 2021-05-03 12:53:57

https://grokonez.com/spring-framework/how-to-inject-collection-in-spring

How to inject Collection in Spring

Spring supports us the way to inject Collection with type: List, Set, Map and Properties. So we can pass a bundle of direct data values or reference of beans to Collection Objects.

The tutorial shows you how to use XML configuration to do those things.

Related Post:
<a href="https://grokonez.com/spring-framework/spring-core/use-spring-factory-method-create-spring-bean">How to use Spring Factory Method to create Spring Bean</a>

<!--more-->
<div id="tuttoc" class="jsa-toc"></div>

<div id="tutcontents">
<h2>II. Technology</h2>
- Java 1.8
- Maven 3.3.9
- Spring Tool Suite – Version 3.8.1.RELEASE
- Spring Boot: 1.4.0.RELEASE
<h2>III. Overview</h2>
<h3>1. Goal</h3>
<pre><code class="language-java">
public class CustomerService {

	Set<String> serviceSet;
	Map<Integer, String> channelServiceMap;
	List<Customer> customerList;
	Properties language;
}</code></pre>
To build an application that runs with bean <strong>customerService</strong> of class <strong>CustomerService</strong> which has many members under Collection Types: List, Set, Map, Properties (with primitive datatype and Java Class Objects):
<img src="https://grokonez.com/wp-content/uploads/2016/09/injectcollection-bean-goal.jpg" alt="injectcollection-bean-goal" width="400" height="544" class="alignnone size-full wp-image-1176" />
<h3>2. Project Structure</h3>
<img class="alignnone size-full wp-image-1163" src="https://grokonez.com/wp-content/uploads/2016/09/injectcollections-projectstructure.jpg" alt="injectcollections-projectstructure" width="323" height="295" />
<h3>3. Step to do</h3>
- Create Spring Boot project
- Create DataModels
- Create a Service
- Create Spring Bean Configuration File
- Create a Web Controller
- Run Spring Boot Application &amp; Enjoy Result
<h2>IV. Practice</h2>
<h3>1. Create Spring Boot project</h3>
- Open <strong>Spring Tool Suite</strong>, on <strong>Menu</strong>, choose <strong>File</strong> -&gt; <strong>New </strong>-&gt; <strong>Spring Starter Project</strong>, then fill each fields:
<img src="https://grokonez.com/wp-content/uploads/2016/09/injectcollection-startproject.jpg" alt="injectcollection-startproject" width="645" height="437" class="alignnone size-full wp-image-1164" />

More at:

https://grokonez.com/spring-framework/how-to-inject-collection-in-spring

How to inject Collection in Spring
JavaScript Interview Question #37: What's the type of a single argument provided to the split function?
Tags: javascript, webdev, beginners, codenewbie
Published: 2021-05-03 12:49:53

![js-test-37](https://learn.coderslang.com/js-test-37.png)

What's the output?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

In this code snipped, all the arguments provided to the function `split` will be collected and placed in a single array `args`.

The fact that we provide a single argument `hello`, doesn’t change the expected behavior.

As all arrays are objects in JavaScript, we’ll see the string `object` printed to the console.

---

**ANSWER**: the output will be `object`.

[Learn Full-Stack JavaScript](https://js.coderslang.com/sign-in)