teleren/devto huggingface dataset:
CSS3 - Part 7 of Frontend Development Series
Tags: css
Published: 2019-09-23 10:09:21

According to our guideline - [roadmap.sh/frontend](https://roadmap.sh/frontend), CSS3 is the next section.

You can find a list of all articles in this series here - [Frontend Development Series](https://dev.to/dillionmegida/frontend-development-series-3004)

CSS3 is the latest version of CSS.
It works with the previous versions but adds new interactive and attractive features to elements on a page.

### History of CSS
According to [Wikipedia](https://en.wikipedia.org/wiki/Cascading_Style_Sheets),
`CSS` was introduced by Hakon Wium Lie on October 10, 1994.

> Style sheets have existed in one form or another since the beginnings of Standard Generalized Markup Language (SGML) in the 1980s, and CSS was developed to provide style sheets for the web.

-----

> `CSS1` was released on December 17, 1996
It had support for colors and backgrounds, text formatting, alignments, margins and classification of groups of attributes.

-----

> `CSS2` was developed by the W3C and published as a recommendation in May 1998

It was a superset of CSS1 which adds extra features like positioning styles (absolute and the likes), media types, new font properties and so on.

-----

> The earliest `CSS 3` drafts were published in June 1999.

It added more features to CSS2. Examples are animations, transitions, 3D elements and choice of fonts.

Learn more about [CSS History in wikipedia](https://en.wikipedia.org/wiki/Cascading_Style_Sheets)

### Conclusion
CSS3 is the latest version of CSS which brings life and interactions to webpages. It also aids in less use of javascript in order to achieve certain interactions.

That's all for CSS3. We've actually covered some of these extra capabilities in previous articles if you noticed : )

Check out all articles so far on the series here - [Frontend Development Series]([Frontend Development Series](https://dev.to/dillionmegida/frontend-development-series-3004))
Cloudways Coding Challenge: Win $500 Free Credits and Goodies
Tags: showdev, coding, webdev
Published: 2019-09-23 10:07:43

---
title: Cloudways Coding Challenge: Win $500 Free Credits and Goodies
published: true
description: 
tags: #showdev #coding #webdev
cover_image: https://www.cloudways.com/blog/wp-content/uploads/Coding-Challenge-Cloudways-2019.jpg
---

Maintaining its high standards to keep the dev market in focus, Cloudways has now announced a [Coding Challenge Contest](https://www.cloudways.com/en/coding-challenge.php) where all enthusiastic community developers are invited to participate. The coding challenge contest gives all the dev millennial a chance to demonstrate their skills and get their name registered amongst the best.

It is a platform that encourages all the coders who are new to the field and want to get exposure with some practical means. The challenge will provide fierce competition amongst the best coders to show off their skills and claim exciting prizes. The first challenge to beat up is to build a “Website Speed Test Tool”The winners will be awarded **FREE $500 Cloudways hosting credit** for one year, and will receive **FREE goodie bags** as well.

[<img src="https://www.cloudways.com/blog/wp-content/uploads/Coding-Challenge.png">](https://www.cloudways.com/en/coding-challenge.php)

Not only that, but the winner will also get recognition throughout the community and will be announced via our social channels. So, it will be a real worthy experience to take part in this competition, as it will hone your dev skills and will give you a chance to compete with some of the top minds in the market. The participation is free for all via registering through Gleam. Just submit your entries and start participating in one of the top coding competitions of 2019.
Why does NSEpy returns empty dataframe

Tags: nsepy, python, pandas
Published: 2019-09-23 09:32:40

# The frustration

You are half way thru downloading data for 100 stocks and suddenly you realize that half of the dataframes are empty. What just happened, NSE's website probably detected that there are too many requests from your IP and now you are blocked. But the question is do you really need to download the same data every time?

# Typical analysis cycle
Lets consider you are running an analysis every week on last one month data-

```Python
from datetime import date,timedelta
from nsepy import get_history

def download_data_for_month():
    end_day = date.today()
    start_day = end_day - timedelta(30)
    stock_price_df = get_history(symbol="SBIN", start=start_day, end= end_day)
    return stock_price_df

def do_some_analysis(df):
    """ Some Cool Analysis """

df = download_data_for_month()
do_some_analysis(df)
```

# What's wrong with above example-
* The script downloads data every time you run it and in an development cycle you might change your code frequently, multiple times a day or even hour. Why would you download data on each iteration? It not only slows down YOUR development productivity, but also loads the NSE's website.
* Consider you are running the script every week, incremental data change is for just 7 days but you are still requesting data for the whole 30 days.

# What can we change

Have separate scripts for downloading and analysis

download_data.py
```Python
def download_data_for_month():
    end_day = date.today()
    start_day = end_day - timedelta(30)
    stock_price_df = get_history(symbol="SBIN", start=start_day, end= end_day)
    return stock_price_df


df = download_data_for_month()
df.to_pickle('SBIN.pkl')
```

analysis.py
```Python
import pandas as pd
def do_some_analysis(df):
    """ Some Cool Analysis """

df = pd.read_pickle('SBIN.pkl')
do_some_analysis(df)
```
CronJob-Expressions (Automate Tasks in Azure)
Tags: azure, webdev, beginners
Published: 2019-09-23 09:28:03

This post is mostly for me to remember and to look it up, when I need it again, but I hope, you might find it usefull as well.

There are tasks, which are run repeatedly over and over again. One of the most common might be a cleanup job for a database. 

I personally prefer events, when something happens, but sometimes you do not have an event, and that is, when you need to run tasks on a schedule. 

In Azure you basically have two options, to execute those:

1. Azure WebJobs
2. Azure Functions

The former runs as part of a WebApp for as long as it takes. The second runs "serverless" for a maximum of 10 minutes.

Both, however, take a CronJob-Expression as their scheduling information. So here are some information about those.

A CronJob-Expression is a string of mostly numbers and some literals describing the execution time/interval of a cron job in the following format:

`second` `minute` `hour` `day` `month` `day of the week`

Each of those data entries will create a set of restrictions to the time of execution and the result will be the combination of all those sets. 

The rules:
1. There is no empty set. If you don't want it to run, just don't schedule it.
2. `,` is used to list single data entries e.g. 1,5,7,35
3. `-` is used to list an inclusive range e.g. 1-5 = 1,2,3,4,5
4. `*` is used to set the value to "any". 
5. `/` sets an interval for the reoccurence. *No lists or ranges for reoccureances.*
7. Literals `MON`, `TUE`, `WED`, `THU`, `FRI`, `SAT`, `SUN` can be used for the day of the week. *No Range, when using literals. Use 0-6 instead, starting with SUN = 0.*

Lets have a look some examples:

|Expression|Description|
|--|--|
|0 * * * * *|Every minute|
|0 1/2 * * * *|Every other minute|
|*/1 * * * * *|Every second|
|0 0 * * * *|Every hour|
|0 0 0 * * *|Every day|
|0 30 11 * * *|Every day at 11:30:00|
|0 0 5-10 * * *|Every hour between 5 to 10|
|0 0 0 * * SAT|Every saturday|
|0 0 0 * * 6|Every saturday|
|0 0 0 * * 1-5|Every workday (Monday to Friday)|
|0 0 0 * * SAT,SUN|Every saturday and sunday|
|0 0 0 1 1 *|Every year 1st january|
|0 0 0 1-7 * SAT|Every first saturday of the month at 00:00:00|

Lets have a closer look at some of these:
`0 1/2 * * * *`:
The seconds are `0` -> only at full minutes.
The first time to execute, the minute must be `1` and after that every other minute `/2`.
All other entries can have any value -> every hour at every day.
It runs every odd minute.

`*/1 * * * * *`:
This could have been written also `* * * * * *` and will be executed every second until it is stopped.

`0 0 0 1-7 * SAT`:
That one is bit more interesting.
It exutes only at midnigth, since the parts that describe the time of the day are all set to zero. Execution is also restricted to the days within the range 1 through 7 (the first week) of the month and to Saturdays. To rephrase that a bit,  it will be executed at midnight of every Saturday within the first week of every month.

When scheduling in Azure keep in mind, that times are given in UTC.
How far should you take clean coding?
Tags: cleancoding
Published: 2019-09-23 08:36:54

I've been thinking about something for quite some time. I'm a strong advocate for clean coding, and that a professional programmer should be allowed time for doing their job right. With that, I mean fixes and features should be done cleanly, and, if needed, legacy code adjacent to what the programmer is working on should be refactored (within reasonable limits). Indeed, certain levels of refactorings and renovation of legacy code should be included in the estimate for the story.
However, now and again, reality happens. Perhaps a bug was found, and it needs to be corrected, tested and distributed asap. There might not be enough time to do the refactoring that part of the code you're in so desperately needs. Alternatively, given the limited time frame, you may not want the risk a possibly complex refactoring adds. Should a professional programmer still enforce clean coding principles? At what cost should these principles be enforced?
There is always the option to make a quick fix, test it and ship it, but also write a story for the backlog on the need for renovation. Of course, we all know how hard it can be to get that story prioritised and scheduled for action.
I want your views on this, so please join the discussion.
How to go back to a previous commit in git
Tags: git, tutorial
Published: 2019-09-23 07:16:19

Have you ever accidentally committed the wrong files to git, but you hadn't pushed your commit up to origin yet and just want to tidy up? 

All is not lost, it's quite easy to recover from this, though the commands to do so are not very intuitive. Unfortunately git doesn't have an undo command, however you can undo this quite easily using git reset. 

If you want to add some files or edit the commit message, you can use git commit with the amend option: 

```ruby
git commit --amend
```

This will add whatever changes you have queued up to the previous commit (for example you may have seen a typo in your comments for the commit), and it will also let you edit the commit message for the previous commit. 

If you want to get rid of the commit, while keeping the changes to your files, use git reset with HEAD~ to indicate the previous commit or a commit hash to go back to a specific commit:

```ruby
git reset HEAD~
```

This will perform a reset of the git index (but not the changes themselves). So your files will still be as you had them, but the git index will be reset, and you can start your commit again (making modifications, not adding all the files etc). It's as if your previous commit just didn't happen. 

If you committed changes that you just want to throw away, and you don't want to keep at all, you can also do a hard reset: 

```ruby
git reset --hard HEAD~
```

Or if you want to get rid of a few commits, the last commit hash you want to keep: 

```ruby
git reset --hard a1b2c3
```

But *beware, this could delete or change files*, and will reset the state of all the files to the previous commit, so use it with care. Usually you're better doing a soft reset. 

*Only ever do this if you haven't pushed the commits to origin.* 

If you have published the commit, you should instead publish another reverting commit, instead of rewriting history (which can cause other people lots of problems).
Rich Dad Poor Dad Lessons Learned Notes Part 2
Tags: devjournal
Published: 2019-09-23 03:06:18

---
title: Rich Dad Poor Dad Lessons Learned Notes Part 2
published: true
description: Just wrote lesson I learned from the book Rich Dad Poor Dad
tags: #devjournal
---

⦁	Money is an illusion, the government can make money by printing it, but rich people can make money by creating other things/jobs.
⦁	Being rich is not about how much money you make, its about how much money you keep and how many generations you keep it for.
⦁	To be rich you must be financially literate.
⦁	Accounting may be super boring but to be rich long term the lessons it teaches are important.
⦁	you must understand the difference between an asset and a liability.
⦁	The difference between an asset and a liability iis not words but what the numbers are telling you.
⦁	An increase in cash doen't make you rich if you just increase your spending.
⦁	A good mindset can be the one who always pushes to do things that others don't think possible.
⦁	Owning a home is a liability not an asset.
⦁	The greatest losses are those from missed oportunities.
⦁	Start an investment portfolio as early as possible.
⦁	You'll never be rich if your only source of income is your paycheck.
⦁	Wealth is how much money your money is making.
⦁	Always reinvest your excess cash into the assests.
⦁	Mind your own business. Basically when you work all your lives for a job, you're actually working for your boss, the company, the government, and the bank before you work for yourself.
⦁	Buy real assets not personal effects that lose value as soon as you get home.
⦁	Keep expenses low, reduce liabilities, and build a solid asset base.
⦁	Start collecting assets by using something you love. ( I love tech, so tech stocks will be more valuable to me then other things.)
⦁	Once a dollar goes into your asset columb it becomes your employee, and you should never let it out.
⦁	The rich buy luxuries last while the poor and middle class buy luxuries first.
⦁	Buying a luxury on credit often causes people to regret a luxury because the cost becomes a burden.
Is Flutter Desktop ready for experimentation?
Tags: linux, windows, flutter, javascript
Published: 2019-09-23 06:53:00

---
title: Is Flutter Desktop ready for experimentation?
published: true
description: We look into how to run Flutter on Linux, Windows and on the web. What is the current status and what can you achieve if you want to try it out.
tags: Linux, windows, flutter, JavaScript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/rxyi2209plg4h6kzn391.jpg
---

{% youtube o9tvDL-UHqA %}

We look into how to run Flutter on Linux, Windows and on the web. What is the current status and what can you achieve if you want to try it out.
Lessons I learned at a startup
Tags: career, motivation, startup
Published: 2019-09-23 11:21:49

---
title: Lessons I learned at a startup
published: true
canonical_url: https://stereobooster.com/posts/lessons-i-learned-at-startup/
tags: [career, motivation, startup]
---

## Course changes overnight

Startups are looking for their business model. A startup can start with one idea but become mature with a different one, for example, youtube started as a dating site

<!--more-->

![](https://thepracticaldev.s3.amazonaws.com/i/gbvpmeouc6dhdt1bpsj0.jpg)

Image source: [@spencernoon](https://twitter.com/spencernoon/status/1016713164610732035?s=20). "Fact check": [I have no confirmation of the fact, this is more a legend](https://mashable.com/2011/02/19/youtube-facts/).

Amazon started as a book store, now it is one of the biggest online retailers and the biggest cloud provider.

This means that you can start with one idea and end with a different one. For developers, it means that some work that they have been doing over three months can be discarded in one day.

Don't get attached to the code. Or find a way to make it open-source.

## Small team

The startup is a small team. Which means that everybody would be pretty busy and maybe shifting roles.

Be ready to help your teammates with some tasks beyond programming, for example, product decisions.

## Fight against time

Startups often fight with time - to make sure you did not run out of money or to make sure somebody else won't deliver your idea first.

It is hard to guess what will work and what will not, so [prototyping](https://www.youtube.com/watch?v=d5_h1VuwD6g) is your best friend. Throw some quick PoC enough to test your hypothesis and let it fail (or sustain) fast. Show it to colleagues, show it to potential clients, show it to investors and ask what they think about it.
Face ID In iPhone X
Tags: iphone, technology
Published: 2019-09-23 06:39:47

Apple announced a new and expensive edition of its popular smartphone - iPhone X - in September. The company subsequently made iPhone X available in more than 55 countries and territories. In addition to featuring an edge-to-edge OLED display, iPhone X also comes with a number of out-of-box features to challenge the dominance of Android platform <a href="http://buyunlockediphone.com/top-10-best-iphone-7-unlocked-gsm-comparison/">can i use an unlocked iphone with tmobile</a>.
Goの標準ライブラリでWebサーバーを立ててHello, Worldする
Tags: go, japanese
Published: 2019-09-23 06:26:41


Goの標準ライブラリ `net/http` を利用すれば、簡単にWebサーバーを実装することができます。

```shell
# goファイルを作成する
$ touch server.go
```

以下のような、コードを書くことでWebサーバーを実装できます。

```go
package main

import (
	"fmt"
	"net/http"
)

func main() {
	// ルーティングを設定する
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, "Hello, World")
	})
	// ポート8080番でサーバーを起動する
	if err := http.ListenAndServe(":8080", nil); err != nil {
		panic(err)
	}
}
```

以下のコマンドを実行後、ブラウザなどで  
[http://localhost:8080](http://localhost:8080)  
にアクセスすると、Hello, Worldが出力されます。

```shell
$ go run server.go
```

上記コマンドを実行した際とは別のターミナルセッションで、curlコマンドでアクセスしてみます

```shell
$ curl localhost:8080
Hello, World
```

以上、Goの標準ライブラリ `net/http`でWebサーバーを建てて、Hello, Worldする手順でした。
GoでのHello, World
Tags: go
Published: 2019-09-23 06:20:41

GoのインストールからHello, Worldを出力するまでの手順です。

## MacにGoをインストールする

```shell
$ brew install go
$ go version
go version go1.12.7 darwin/amd64
```

## Hello，Worldの実装

```shell
$ touch hello.go
```

```go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World")
}
```

## Hello, Worldプログラムの実行

```shell
$ go run hello.go
Hello, World
```
CloudFormationで作成したEC2 Auto Scaling Groupスタックが削除されない？
Tags: aws, japanese
Published: 2019-09-23 05:17:08

CloudFormationスタックとして作成したEC2 Auto Scaling Groupが削除されなかった際に調べたことを記載します。


CFn(CloudFormation)でEC2 Auto Scaling Groupのスタックを作成して、スケーリングの検証を行った後、  
作成したスタックを削除してもEC2 Auto Scaling GroupとEC2インスタンスの削除がされなかったことがありました。


## 結論
何もしなくても10分程度待てば削除されました。


## 確認したこと
- スタック削除の操作後、マネジメントコンソールでEC2 Auto Scaling Groupを確認しても`削除中`の表示はない
- 維持インスタンス数、最小インスタンス数、最大インスタンス数が `0` になっていた。
- EC2 Auto Scaling Groupに紐付いているEC2インスタンスの起動ステータスは`動作中`のまま
- 手動でEC2 Auto Scaling GroupとEC2インスタンスを削除すると、スタックも削除される


## 調査したこと
公式ドキュメントの『[自動スケーリンググループの削除](https://docs.aws.amazon.com/cli/latest/reference/autoscaling/delete-auto-scaling-group.html)』では下記のように記載されていました。

> Auto Scalingグループを削除する前にすべてのインスタンスを終了するには、UpdateAutoScalingGroupを呼び出して、Auto Scalingグループの最小サイズと必要な容量をゼロに設定します。
> To terminate all instances before deleting the Auto Scaling group, call UpdateAutoScalingGroup and set the minimum size and desired capacity of the Auto Scaling group to zero.

今回のCFnスタック削除でのAutoScalingGroup削除では、上記の方法が取られているようです。

CFnで構成管理するまでは、

1. マネジメントコンソールからAuto Scaling Groupを作成する
2. 検証
3. マネジメントコンソールからAutoScalingGroupを削除する
4. 紐付いているEC2インスタンスが削除されることを確認

という手順を行っており、AutoScalingGroup削除操作の数秒後にはEC2インスタンスの削除が始まっていたので、  
AutoScalingGroupを削除するとほぼ同時にEC2インスタンスも削除されるものだと思っていました。

## 課題や知らなかったこと
- 利用するサービスのドキュメントは大雑把でもいいので一通りは読んでおくべき。
- 設定次第で挙動は異なるし、使用するサービス毎にデフォルトの挙動が異なるのを念頭においておく必要がある。

## 参考
- [自動スケーリンググループの削除](https://docs.aws.amazon.com/cli/latest/reference/autoscaling/delete-auto-scaling-group.html)
- [CloudFormationでのAutoScalingGroup配下のインスタンス入れ替え方法](https://qiita.com/ryo0301/items/f0c2d155874b14427dc6)
- [AWS AutoScallingGroupの削除に失敗する](https://www.ted027.com/post/aws-autoscalling-suspend/)
- [AWS CloudFormation構成のAutoScalingインスタンスを式年遷宮みたいに入れ替える方法2つ](https://dev.classmethod.jp/cloud/two-ways-replacing-update-on-cloudformation/)
CodeDeployでAutoScalingGroupに対してデプロイした際のロールエラー
Tags: aws, japanese
Published: 2019-09-23 03:34:53

## エラー内容
`The IAM role arn:~~~ does not give you permission to perform operations in the following AWS service: AmazonAutoScaling.`


## 解決方法
現在 CodeDeployに割り当てている IAMロールのポリシーに、以下のポリシーを追加するだけです。

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:PassRole",
                "ec2:CreateTags",
                "ec2:RunInstances"
            ],
            "Resource": "*"
        }
    ]
}
```


## 参考
- [StackOverflow](https://stackoverflow.com/questions/53731017/simple-iam-issue-with-codedeploy)
- [https://h2ik.co/2019/02/28/aws-codedeploy-blue-green/](https://h2ik.co/2019/02/28/aws-codedeploy-blue-green/)
Using fiddler as Proxy for NPM, Maven, Gradle
Tags: npm, fiddler, webdev, productivity
Published: 2019-09-23 03:16:13


Usually downloading packages has been pain over corporate networks. One way is to switch to personal network now and then to download packages.
Here is a work around for this, use any proxy server providing your credentials. But thing is everytime I change my password I break my head to finally realize the packages are not downloading because of the old credentials in the proxy settings. This is how I get around this, using [Fiddler](https://www.telerik.com/download/fiddler).

Once you have downloaded fiddler, open fiddler and then under rules menu check `Automatically Authenticate` 

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/h06snueiez35f4ys7g3o.jpg).

### For NPM

Set using following commands

```shell
npm config set proxy http://localhost:8888/
npm config set https-proxy http://localhost:8888/
```
  
OR 


do this manually, open `C:\Users\<user name>\.npmrc` and set proxy to the port fiddler is running on like below

```conf
proxy=http://localhost:8888/
https-proxy=http://localhost:8888/
strict-ssl=false
```

`strict-ssl` is set to false to ignore certificate validation, Use this with caution there are a lot packages that are malicious.
now try `npm -i <packagename>`

### For MAVEN

Open `C:\Users\<user name>\.m2\settings.xml` and add this follwing section in `settings` node

```xml
<proxies>
    <proxy>
        <id>optional</id>
        <active>true</active>
        <protocol>http</protocol>
        <host>localhost</host>
        <port>8888</port>
        <nonProxyHosts></nonProxyHosts>
    </proxy>
    <proxy>
        <id>optional</id>
        <active>true</active>
        <protocol>https</protocol>
        <host>localhost</host>
        <port>8888</port>
        <nonProxyHosts></nonProxyHosts>
    </proxy>
</proxies>

```

### For GRADLE

Add this below properties in root folder of `gradle.properties`

```conf
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=8888
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=8888
```

Hope this Helps!

_Originally Posted on [Bitsmonkey](https://unrealnerd.github.io/blog/2019/09/22/npm-proxy)_
_Photo by Jonathan on Unsplash_