teleren/devto huggingface dataset:
This Week in Python
Tags: python
Published: 2022-03-04 10:19:03


**Fri, March 4, 2022**

This Week in Python is a concise reading list about what happened in the past week in the Python universe. 

## Python Articles

- [Python Benchmarks](https://pybenchmarks.org/) – A list of benchmarks of different Python implementations. 
- [Python Debugging With Pdb](https://realpython.com/python-debugging-pdb/) – `pdb` is the Python debugger of its standard library. Here is a tutorial on how to use it.
- [Peculiar Self-References](https://susam.net/blog/peculiar-self-references.html) – Fun with Python's list. `a = a[0] = [0]` makes a list self-referential with some interesting implications.
- [Mocking in Python Has Never Been Easier](https://peterkogan.medium.com/mocking-in-python-has-never-been-easier-5f9b15e1498f) – Using `pytest`'s Mock Generator to simplify your test writing.
- [Github Issues Migration is coming soon](https://discuss.python.org/t/github-issues-migration-is-coming-soon/13791) – The Python core team decided to move all issues to the GitHub project.

## Projects

- [miniboss](https://github.com/afroisalreadyinu/miniboss) – miniboss is a Python application for locally running a collection of interdependent docker services
- [The Algorithms - Python](https://github.com/TheAlgorithms/Python) – A collection of Computer Science Algorithms in Python
- [FastAPI](https://github.com/tiangolo/fastapi) – Not particularly new, but still a hot candidate for building RESTful web services: FastAPI
- [rich](https://github.com/Textualize/rich) – A lot of Twitter buzz about this excellent terminal library
- [pyTermTk](https://github.com/ceccopierangiolieugenio/pyTermTk) – A toolkit for building interactive terminal applications
pyopendota: Python Package for OPENDOTA API

Tags: python, dota2, api, tooling
Published: 2022-03-04 09:33:38

{% embed https://github.com/hrishikeshrt/pyopendota/ %}
## About OpenDota API

The OpenDota API provides [Dota 2](https://www.dota2.com/) related data including advanced match data extracted from match replays. OpenDota API Documentation: https://docs.opendota.com/

## About `pyopendota`

The `OpenDota` class provided with the package serves as a python interface for the original OpenDota API in the form of a thin wrapper. The class assumes some familiarity with the OpenDota API.

All method calls return serializable python objects, as return by the API, in most cases a dict or a list. Response data is stored as JSON in a local directory (Default: `~/dota2`), to prevent the load on OpenDota API.

## Features
  
- Transparent wrapper for majority of the API calls
- Ability to authenticate using API key
- In-built and cusomizable limit to protect against frequent API calls
- Local file-based storage for frequent requests

### Extra

Apart from the direct API calls, it also lets one "Search by name" for pro players, teams, leagues etc.
Notes on API Modelling
Tags: api, webdev, beginners, programming
Published: 2022-03-04 10:06:45

> Notes where taken from the book  **Designing Great Web APIs By James Higginbotham**


The goal of API modelling is to translate the product requirements into the beginnings of a high-level API design. API modelling ensures that both developers and end users have their goals met.

### 1. Actors/ Users/ Participants

The first step is to identify the participants, sometimes called actors, who will interact with the API. Unlike a user interface, an API design must factor in both humans and non-humans who may interact with your API.

![Actors role in api modelling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xe6r42idqkqnrrga7i33.png)

---


### 2. Activities

Activities are the outcomes that your participants will expect your API to provide. These activities focus on the job to be done, not how to do it.


![Activities for api modelling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o865zyq6xk0503i0z3j9.png)

---

### 3. Steps to achieve those Activities

Break activities into steps that a participant will take to achieve their goal. Goals of a participant or actor will depend upon his needs. 

For example, A developer or business analysts can require the same information for the database but for different purposes. 

You may find that you may be missing some details about how an activity should be performed. This is an indicator that you should involve one or more subject matter experts (SMEs) who can provide greater insight and details into how the system should work. These experts may be business analysts, customers, and/or quality- assurance teams familiar with the requirements.


![Creating steps from activities](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3qldo9goppjru1wsqze.png)

---

### 4. Grouping by resources

Once you have the activities and steps identified, you will begin to see specific business entities emerge. These are your resource candidates that may become actual API resources.

Others may appear to be resources but may instead be activities that will be performed outside of the API itself and therefore won’t become actual API resources.


![Grouping by resources for api modelling](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zceuva3ndm0ko33yiulr.png)

---

### 5. Validation by testing

Once you have an API model defined, you can use the model to validate that it meets the requirements of internal developers, partner or public developers, and the end user. There are three techniques that can help validate your API model:

1. *The API walkthrough*
2. *Use-case validation*
3. *Business-process diagrams*

### Examples of Well designed API

1. [Spotify API](https://developer.spotify.com/) 
2. [Stripe API](https://stripe.com/docs/api)
3. [Github API](https://docs.github.com/en/rest)
Redux in React
Published: 2022-03-04 09:51:20

> **Redux** is a predictable state container for JavaScript apps.

<u>Redux is for JavaScript applications.</u>

- Redux is not tied to React.

- It can be used with Vanilla JavaScript or any JS framework like Angular, React, Vue, etc. 

- Redux is a library for JS applications.

<u>Redux is a state container</u>

- Redux stores the state of your application.

For Example:- consider a react app - state of component
_LoginFormComponent_
`state = {
username:'',
password:'',
submitting: false
}`

- State of an app is the state represented by all the individual component of that app.
_UserListComponent_
`state = {
users : []
}`

- Redux will store and manage this application state.
_Application_
`state= {
isUserLoggedIn = true,
username: 'John',
profileUrl: '',
onlineUsers: [],
isModalOpened: false
}`

<u>Redux is predictable - In what way?</u>

In redux, all state transitions are explicit and it is possible to keep track of them. (i.e) The changes to your application's state becomes predictable.

> Redux can help you manage the state of your JavaScript application in a predictable way. 

**<u>React + Redux</u>**
In React applications where you have considerable no. of components, which share some common state, State management could become troublesome. That's where Redux comes in.

With Redux, your state will come from outside your components.

![React + Redux](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr9pqum1gl1wb1tv2y8e.PNG)

Actually this solution can be doable in React itself with below ways. 

1. **React context** - which prevents prop drilling.
2. **useContext + useReducer** - with these combining hooks.

**React-Redux**

React-Redux is the official Redux UI binding library for React.

**<u>Three core concepts in Redux</u>**

1. A **store** that holds the state of your application.

2. An **action** that describes the changes in the state of your application.

3. A **Reducer** which actually carries out the state transition depending on the action.

**<u>Summary</u>**

- React is a library used to build user interfaces.

- Redux is a library for managing state in a predictable way in JavaScript applications.

- React-Redux is a library that provides bindings to use React and Redux in an application.

Reference [Video](https://www.youtube.com/watch?v=9boMnm5X9ak&list=PLC3y8-rFHvwheJHvseC3I0HuYI2f46oAK).

Thanks for Reading.
Frugal approach to scaling
Tags: adtech, architecture, java, adpushup
Published: 2022-03-04 09:28:33

If you have to design a system that can serve 1B+ ad requests/day or ~200 GB/hour, then most likely your choice is going to be some fancy big data technology. And of course that makes sense too. These numbers would seem like a puny human against the hulk of a tool like Kafka, Spark, Flink, Hadoop and what not. It's easy to design that way.
If you have to design a system that can serve 1B+ ad requests/day or ~200 GB/hour, then most likely your choice is going to be some fancy big data technology. And of course that makes sense too. These numbers would seem like a puny human against the hulk of a tool like Kafka, Spark, Flink, Hadoop and what not. It's easy to design that way.

However, this obvious decision will soon convert into a dilemma if I say that we have this traffic not today, not in the next 6 months, but in future. And we don't want to spend much money right now. And we are already running late because we wanted this system yesterday. And it will be a team of two people, the other guy is a novice.

So, now it's tricky. We have to quickly design and implement a future scale proof system that is affordable and easy to maintain.

At #AdPushup we faced a similar kind of situation. And we came up with a system that recently scaled 10x. I was emotional and hence this article :)

https://medium.com/@udit.jindal/frugal-approach-to-scaling-c4d3b100a608

Do give it a read and let me know your thoughts.

PS-1: That other novice guy was me (Luckily!).

PS-2: If you find this interesting, let me know in the comments, I'll share how we developed an in-house ad auctioning system(based on OpenRTB 2.5) under 21 days.
IELTS Coaching in Chandigarh 
Tags: ielts, ieltscoachinginchandigarh, ieltsinstituteinchandigarh, ieltstraininginchandigarh
Published: 2022-03-04 09:16:19

ThinkEnglish provides best [IELTS Coaching in Chandigarh](https://www.thinkenglish.in/ielts-coaching-in-chandigarh/) which imparts high quality IELTS Training to help aspiring candidates take a successful leap in IELTS Exam.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgcx6pyu7h1nvtwntawb.jpg)
We are the top IELTS Training  Institute in Chandigarh  which understands that candidates have different preferences and choices, therefore  we have designed the courses to meet their best interests.
Intro to Crypto
Tags: blockchain, devjournal, opensource, productivity
Published: 2022-03-04 08:41:25

Crypto currency has been a buzzword for various reasons. The Government of India is making Crypto currency official in India. This is an exciting move and has created a lot of curiosity among the masses. 
To enlighten us all about this technology in detail ,we at HackForChange along with our expert speaker **[Sridhar Gopalakrishnan](https://www.linkedin.com/in/sridhargk/)** , are organizing a webinar.
This webinar will cover the basic principles of blockchain, minting, mining and cryptocurrency. He will discuss the crypto ecosystem and use cases based on blockchain technology. He will also talk about how some of these use cases can be implemented to effect social change.

**_[Sign Up Here](https://www.hackforchange.co.in/events/intro-to-crypto)_** **_or Scan QR_**
Redux
Published: 2022-03-04 08:38:51



Redux is the essential way for state management, it contains three steps: data storing, reducer, and action process. For providing a sensible way to manage the state through a unidirectional data flow. Redux reducer is a JavaScript function that takes two parameters one is the current state and the other is action. It produces the state of an application. Whereas action is the only way for changing the state, sending signal to the store. Firstly, component reads data from the store and then dispatch the actions to the store and update it. For communication and for data sharing purposes across the component it can follow the redux method structure. As in a general way to share data to the state, will have to data lift up to the nearest parents and then go to the next component, it will continue until get to an ancestor component, when reached the ancestor state then it passed down as props to the child. In contrast, Redux has the process of storing data in the central location which holds the entire state of an application. When each component can access the stored state without having to send data to the props from one component to another component. It helps for writing applications that behave consistently, run in different environments (client, server, and native), and these are easy ways to test. Overall, every time the parent component changed the state according to that change occurred automatically to the child component. Therefore, using redux has lots of benefits like debugging an application, networking errors, and easily identifying other bugs, or any changes in the code, actually it is the more convenient way to trace the actions and maintain the whole system.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx61y8dg1cu25dmyahxy.png)
Py-Stopwatch: Measure execution time of your python code segments
Tags: python, performance, stopwatch
Published: 2022-03-04 08:38:45

{% embed https://github.com/hrishikeshrt/py_stopwatch %}


## Features

- Tick-based stopwatch.
- Support for Pause / Resume.
- Support for multiple named-ticks.
- Utility functions for time between different ticks.
- No third party requirements.

## Usage

```python

from stopwatch import Stopwatch
t = Stopwatch()
t.start()
print("Started ..")
time.sleep(0.24)
print(f"t.tick(): {t.tick():.4f} seconds")
time.sleep(0.48)
print(f"t.tick(): {t.tick():.4f} seconds")
time.sleep(0.16)
print(f"t.tick('Named Tick-1'): {t.tick('Named Tick-1'):.4f} seconds")
t.pause()
print("Paused ..")
time.sleep(0.12)
t.resume()
print("Resumed ..")
print(f"t.last(): {t.last():.4f} seconds")
time.sleep(0.12)
print(f"t.tick(): {t.tick():.4f} seconds")
time.sleep(0.12)
print(f"t.tick('Named Tick-2'): {t.tick('Named Tick-2'):.4f} seconds")
t.stop()
print("Timer stopped.")
print("---")
print(f"Total pause: {t.time_paused:.2f} seconds.")
print(f"Total runtime: {t.time_active:.2f} seconds.")
print(f"Total time: {t.time_total:.2f} seconds.")
tij = t.time_elapsed(start_name='Named Tick-1', end_name='Named Tick-2')
print(f"Time between 'Named Tick-1' and 'Named Tick-2': {tij:.4f}")
```
RG58 VS LMR400 Coax Cable: Which one is better ?

Tags: product, writing
Published: 2022-03-04 08:36:35

Conclusion of [LMR400](https://www.utmel.com/productdetail/amphenoltimesmicrowavesystems-lmr400-1398690) and RG58’s differences
RG58 has a significantly higher loss due to changes in insulation and electrical characteristics (attenuation). It's perfect for its initial application, which is mostly in cable television, but not for Helium antenna systems, especially over such a long distance. LMR240 is the basic minimum for 15 meters, however everyone in the community strongly recommends LMR400.
Although LMR400 cable has low loss, it is thicker and less flexible than RG58 or LMR240 cable, making it more difficult to work with. It comes in lengths ranging from 2' to 100' and is designed to be used with antennas and amplifiers that don't come with cabling.
If you want to learn more, try to follow the below link to see the [article about RG58 VS LMR400](https://www.utmel.com/components/rg58-vs-lmr400-which-one-is-better?id=1492).
drop user နဲ့ drop user cascade
Tags: sql
Published: 2022-03-04 08:18:21

drop user cascade နဲလုပ်မယ်ဆိုရင် သက်ဆိုင်ရာ user နဲ့ ပတ်သက်တဲ့ views တွေ၊ schema objects တွေပါ အရင်ဖျက်ပြီးမှ database user account ကို ဖျက်တာ။
drop user ဆိုရင် user account ကိုပဲ ဖျက်တာ။

စဥ်စားရန်။ -- `drop user` ကို ဘယ်ချိန်မှာ လုပ်သင့်လဲ။ ကျန်နေတဲ့ schema တွေကို ဘယ်မှာ ကြည့်လို့ရမလဲ?
ESP12E VS ESP12F: Which one is better?

Tags: product, writing
Published: 2022-03-04 08:15:23

Comparison the difference between the ESP12Eand ESP12F
The ESP12F is an improved version of the ESP12E, with a better peripheral circuit, four laminates plate process, and improved impedance matching. The signal output is better, it is stable with anti-jamming ability, and the PCB antenna has been perfected after professional laboratory testing and ROHS certification. Based on the SPI and the new six IO ports, mouth extraction allows for easier development and a wider range of applications.
The built-in cloud services on the ESP8266-12F allow you to utilize three instructions to control the global remote control feature.
The ESP-12F features a ground-breaking design, a new four-layer board, and a revised antenna. RF performance enhancement extended communication distance by 30 to 50 percent when compared to the ESP-12E! Semi-hole chip technology, metal shielding shell for all IO leads, FCC, CE, and RoHS certification, on-board PCB antenna, 4M bytes Flash.
If you want to learn more, try to follow the below link to see the [article about ESP12E VS ESP12F](https://www.utmel.com/components/esp12e-vs-esp12f-which-one-is-better?id=1441).
osmanip 3.0.0v: output stream tools like color and styles manipulators, progress bars and 2D terminal graphics
Tags: cpp, opensource, tooling, linux
Published: 2022-03-04 08:12:50

Hi everybody, I recently shared this tool with you some weeks ago. For people who don't know this is a library in which you can find and access a wide list of useful output stream tools, in particular:

1) Color, style, cursor and ANSI escape codes manipulators.

2) Progress bars, 100% customizable with messages, colors and styles.

3) 2D terminal graphics and plotting (without GUI).

Other stuff is incoming.

I recently released version 3.0.0 in which I added new improvements (thanks to also other people who helped me) and added a new feature to manage 2D graphics in the terminal (without GUI) and in particular 2D plotting of function (you can see an example in the README).

If someone of you want to contribute with a pull request to fix bugs or add improvements he/she would be more than welcome!

If you like it don’t forget to leave a star on Github! Thanks.

Github repository link: https://github.com/JustWhit3/osmanip
Drop နဲ့ Truncate
Tags: sql
Published: 2022-03-04 08:11:59

Drop ဆိုတာ table နဲ့ ဆက်စပ်တဲ့ဟာမှန်သမျှ ရှင်းလင်းပစ်လိုက်တာ။ ဥပမာ သူရဲ့ သက်ဆိုင်ရာ index တွေ အပါအဝင်။
Truncate ဆိုတာက table ထဲက row တွေကို ရှင်းလိုက်တာ။
အဲတာပါပဲ။
Get a highly targeted list of jobs in your inbox every Monday
Tags: tech, jobs, freelance, employment
Published: 2022-03-04 08:04:25

I built Grazily since I got laid off a month ago. I have been tweaking it to make it give me exactly what I want. 

In my case I want to work with svelte. I hate react. So I need a way to filter out jobs that had the word “react” in them. 

Introducing [Grazily.com](https://Grazily.com) — free for now but will start charging at some point. My goal is to provide enough value where people are happy to pay for its service. 

You can setup multiple search profiles as well. Each search profile will search all the major ATS platforms (which are themselves not publicly searchable)…when it finds a job that matches your keywords (both positive and negative filters) it adds it the a list and sends you one email on Mondays. 

Give it a shot. I applied to 30 jobs on Monday and I already got 8 solid interviews this week with very decent match in what I’m looking to work with. 

Visit https://Grazily.com
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes
Published: 2022-03-04 08:00:04

---
title: "Today's Daily Dose of Programming Humor"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12591e45d64.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why didn't the `<div />` get invited to the dinner party?

___A:___ Because it had no class!
 -->
The history of coding and software engineering
Hack Reactor
December 5, 2019

Published: 2022-03-04 07:55:00






By Kevin Juhasz for Hack Reactor

Engineering has been around for centuries. Software made its debut in 1948 and wasn’t widely called that until 1952. It would be a decade later when the discipline of software engineering was given its name and its due as a form of engineering on the same level as others. For the last 50 years, software engineering has had an interesting trip and become a vital part of shaping and maintaining the world.



1960s

The 1960s were a time when software engineering was accepted as its own form of engineering but was also a time of trouble for the development of software. The software side struggled to keep pace with the hardware and created problems for the field.

1963/1964 – While developing the guidance and navigations systems for the Apollo missions, computer scientist and systems engineer Margaret Hamilton coins the term “software engineering.” Hamilton felt that software developers earned the right to be called engineers.



Read more..https://www.hackreactor.com/blog/the-history-of-coding-and-software-engineering
How to get advanced social media metrics?
Tags: analytics, twitter, javascript
Published: 2022-03-04 07:51:02

It could be twitter (that is my target) but I’m having trouble finding answers. 

What I’d like is a way to enter a keyword like “cats” for example…and get a list of related hashtags that are sorted by number of retweets in a given timeframe.

In plain English I want list of hashtags related to “cats” ordered by most retweets in the last week (or day).
Add Tom Select to Laravel using Laravel MIX
Tags: laravel, webpack, npm
Published: 2022-03-04 07:48:40

This is how to add Tom Select package to youre laravel project


## Installing Tom Select
Open terminal in youre laravel project and install the package

```
npm i tom-select
```


## Applying Tom Select JS
open /resources/js/app.js and add Tom Select js in there

```
window.TomSelect = require('tom-select')
```

## Applying Tom Select CSS
Tom Select functionality will not work with out the css file, add Tom Select CSS to /resources/css/app.css
```
...
@import '/node_modules/tom-select/dist/css/tom-select.default.css';
...
```
There are many css file, select what you like

## Build laravel mix
```npm run development```

## Add app.js and app.css to blade file
Dont forget to add app.js and app.css from public folder
```
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
<script src="{{ asset('js/app.js') }}" defer></script>
```
Done Tom Select has been succesfully add to youre laravel project