teleren/devto huggingface dataset:
Python Type Hints: Code readability perspective
Tags: python, codereview, beginners, programming
Published: 2023-07-11 18:02:58

This article is a quick introduction to type hints for beginners who’ve started programming in Python. If you’re an experienced programmer, then I suggest checking out more advanced articles or documentation.

Python is a dynamic language, where data/variable types aren’t generally defined. This makes Python flexible and convenient for developers because you don’t have to rigorously define and track variable types.

When we’re reading code base of bigger projects, especially libraries, “Type Hints” help us to know which object types are associated with which variables. If you’re coming from a statically typed languages(C/C++, Java, TypeScript, etc), then you’ll already be familiar with type declarations and you know its importance while debugging or understanding code base.

With Python 3.5, type hints officially became part of the language.

*Type hinting is a formal solution to statically indicate the type of a value.*
### Syntax of Python Type Hints
Type hints involve a color and a type declaration after the first invocation/declaration of a variable.
```
name: str
age: int

name = input("Enter your name: ")
age = int(input("Enter your age: "))

```
### Type hinting Python functions
Type hints can be implemented in Python functions to document the values they accept and return.
```
greeting = "Hello, {}, you're {} years old"

def greet(user:str, age:int) -> str:
    return greeting.format(user, age)

name = input("Enter your name: ")
age = int(input("Enter your age: "))

print(greet(name, age))
```
Similarly, you can apply type hints to container objects, classes, etc. Check out following sources to take a deep dive into type hints in Python:
- [Python Docs
](https://docs.python.org/3/library/typing.html)
- [Type Hints Cheatsheet](https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html)
Geddit - A Reddit client without their API
Tags: webdev, android, javascript, opensource
Published: 2023-07-11 17:54:09

	
Hey everyone!

I've built an open-source Android app that allows you to browse Reddit without using their API. Basically, the app uses JSON feeds of Reddit to replicate various endpoints.

What this means is that you can browse Reddit without an account and get posts, comments, images, videos and nsfw contents without having to deal with ads etc.

In it's current state it has just the basic functionality and I am planning to add more features soon. I'd be happy to hear what you think and get an insight from your feedbacks.

[APK Releases](https://github.com/kaangiray26/geddit-app/releases)
VPN IKEv2
Tags: vpn, ikev2, ios, macos
Published: 2023-07-11 17:51:01

Hi, 

Really know why you need VPN?
But there is no time to do it yourself.

We can do this for you.

For ios and macos you can use IKEv2, old and stable vpn type.

quest to get one:
- goto https://www.alienskit.com/
- register
- login
- balance recharge
- look video howto order service and vpn conect
{% embed https://youtu.be/C7nDmkHUG1Q %}

--
Thank you for your time,
with sincere respect, Alienskit.
7 Things Worth Knowing About Lambda Functions
Tags: lambda, serverless, aws, tutorial
Published: 2023-07-11 17:42:39


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6qfwth1yvsqib05y52ed.png)

1️⃣ With AWS Lambda, you only pay for the actual execution time of your functions. This pay-per-use pricing model provides cost-efficiency, as you're not billed for idle or unused resources. It also allows you to scale your applications based on demand without worrying about provisioning resources.

2️⃣ Lambda functions in AWS offer a serverless computing environment, where you can run your code without managing the underlying infrastructure. This means you can focus on writing your code and let AWS handle the rest, including scaling and availability.

3️⃣ Lambda functions are designed for event-driven architectures. They can be triggered by various events such as file uploads, database updates, or incoming API requests. This event-driven approach enables you to build highly responsive and scalable applications.

4️⃣ Lambda functions in AWS support multiple programming languages, including Python, Java, Node.js, C#, and more. This flexibility empowers developers to use their preferred language and leverage existing codebases seamlessly.

5️⃣ Lambda functions can easily integrate with various AWS services, such as S3, DynamoDB, SQS, and SNS. This integration allows you to build powerful serverless workflows, perform data processing, and create event-driven architectures across different services.

6️⃣ AWS Lambda automatically scales your functions based on the incoming request load. It can scale from a few requests per day to thousands of requests per second, ensuring that your applications can handle traffic spikes and maintain high performance.

7️⃣ AWS provides a user-friendly interface and command-line tools for deploying and managing Lambda functions. You can easily update your code, configure function triggers, monitor execution logs, and set up alerts for errors or performance metrics.


By embracing serverless computing and leveraging the power of event-driven architectures, developers can focus on writing code and delivering value without worrying about infrastructure management.


If you are interested in the lambda function, you can take a look at my blog 📄https://lepczynski.it/en/ or check what video tutorials 🎞️ I have prepared. Below are some suggestions:



📌 How to read write files on s3 using lambda function - python & boto3 - https://www.youtube.com/watch?v=zIm-B33ChIk

📌 API Gateway & Lambda - How to use API_KEY | security - https://www.youtube.com/watch?v=X5qWliStXnE

📌 How to find all GP2 volumes in all regions using Lambda Function? https://www.youtube.com/watch?v=DfBpW2LEIz8

📌 AWS Lambda Function & S3 trigger - How to copy files from one bucket to another - https://www.youtube.com/watch?v=Gvi_1H5HgzE



You can find more tutorials on my YouTube channel 🎬 https://www.youtube.com/@WojciechLepczynski
How do you say... "/etc"?
Tags: linux, discuss, watercooler
Published: 2023-07-11 17:38:22

How would you pronounce this file system directory name commonly found on linux and unix-like systems? 

> Contains system-wide configuration files and system databases; the name stands for et cetera[14] but now a better expansion is editable-text-configurations. Originally also contained "dangerous maintenance utilities" such as init,[6] but these have typically been moved to /sbin or elsewhere. Needs to be on the root filesystem itself.

`/etc` stands for Et Cetera which is a Latin expression used in English to mean `and other (similar) things`, or `and so forth`. 

Translated literally from Latin, et means 'and', while cētera means 'the rest'; thus the expression translates to 'and the rest (of such things)'.

But if you had to tell another person to put a file in the `/etc` directory, how would you say it? 

Listen to a few examples from technology professionals on the latest episode of "How Do You Say?"

{% youtube 8w1L6uU0bLs %}

Want to see more tech word pronunciations by tech professionals?  Find them on [Youtube](https://www.youtube.com/@appmap/shorts).  New videos ship every Friday.
Git cheatsheet
Published: 2023-07-11 17:11:45

# Git Cheatsheets and Tricks
Git is a powerful and versatile version control system that has become an essential tool for software development teams and individual developers alike. In this article, we'll cover some Git cheatsheets and tricks that will help you improve your Git skills.

## Git Cheatsheets
A Git cheatsheet is a quick reference guide that summarizes the most commonly used Git commands and their usage. Here are some common Git commands that you might find on a Git cheatsheet:

## Initialize a repository
`git init                # Initialize a new repository
`

## Clone a repository
`git clone <repository_url>   # Clone an existing repository
`

## Working with branches
```
git branch                  # List all branches
git branch <branch_name>    # Create a new branch
git checkout <branch_name>  # Switch to a branch
git merge <branch_name>     # Merge a branch into the current branch
git branch -d <branch_name> # Delete a branch

```

## Commiting changes
```
git status               # Show the status of your changes
git add <file_name>      # Stage changes for commit
git add .                # Stage all changes for commit
git commit -m "message"  # Commit staged changes with a message

```

## pulling and pushing changes
```
git remote add origin <repository_url>  # Add a remote repository
git push -u origin <branch_name>        # Push changes to a remote repository
git pull origin <branch_name>           # Pull changes from a remote repository

```

## View commit history and differences
```
git log             # Show commit history
git diff            # Show differences between current changes and previous commit
git diff <commit>   # Show differences between current changes and a specific commit

```

## Undoing changes

```
git reset <file_name>    # Unstage changes for a specific file
git reset                # Unstage all changes
git checkout <file_name> # Discard changes for a specific file
git checkout .           # Discard all changes
git revert <commit>      # Undo a commit by creating a new commit with the opposite changes

```

## tags

```
git reset <file_name>    # Unstage changes for a specific file
git reset                # Unstage all changes
git checkout <file_name> # Discard changes for a specific file
git checkout .           # Discard all changes
git revert <commit>      # Undo a commit by creating a new commit with the opposite changes

```

## stash 

```
git stash        # Stash changes
git stash list   # List all stashes
git stash apply  # Apply the most recent stash
git stash drop   # Drop the most recent stash

```
⚠️ Puppet Forge will be on maintenance on July 19th, 11 AM UTC
Published: 2023-07-11 17:05:51

Hi Puppet community 👋,

We are planning a [Forge](https://forge.puppet.com/) maintenance on Wednesday, July 19th starting at 11 AM UTC.

The downtime is scheduled to be < 3 hours. Please ensure you have a backup plan in case your pipelines and regular processes depend on the Forge.

In case you are wondering what time is 11 AM UTC in your region, [here is a link with the time zone comparison](https://www.timeanddate.com/worldclock/converter.html?iso=20230711T110000&p1=202&p2=179&p3=919&p4=307&p5=3332&p6=236&p7=240&p8=1440).

Visit our Status Page for updates:
https://puppet.statuspage.io/

Thanks!

Ecosystem Team @ Puppet by Perforce
Python trick that generates a random password using the `secrets` module
Tags: python, tutorial, coding, programming
Published: 2023-07-11 17:02:38

a Python trick that generates a random password using the `secrets` module

```python
import secrets
import string

def generate_password(length):
    characters = string.ascii_letters + string.digits + string.punctuation
    password = ''.join(secrets.choice(characters) for _ in range(length))
    return password

password = generate_password(12)
print(password)
```

In this code snippet, we import the `secrets` module, which provides secure random number generation suitable for generating passwords. We also import the `string` module to access the various character sets available.

The `generate_password` function takes a parameter `length` to specify the desired length of the password. It creates a `characters` string by combining lowercase letters, uppercase letters, digits, and punctuation symbols. Then, it uses a loop and the `secrets.choice` function to randomly select characters from the `characters` string and concatenate them together to form the password.

Finally, we call the `generate_password` function with a length of 12 and print the generated password.




---


**Hey see Me on GitHub**
{% embed https://github.com/PythonPlumber %}
The lexer
Published: 2023-07-11 16:32:34

The lexer is a surprisingly simple component of a compiler. It mainly consists of a bunch of if-statments. The lexer will break up the code in seperate lines and analyze them one by one.

### 1. Tokens 

But before looking at the lexer, let's take a better look at tokens. A token is a very simple array that consists of a Type and a Value:
`{ Type = TYPE_NAME, Value = TOKEN_VALUE }`

The `Type` property describes the type of token like:
* a statement
* a number
* a variable

The `Value` property can have different meanings depending on the type:
* the statement type
* the number value
* the variable name

a token can have even more properties depending on the type.

### 2. The lexer

Let's see how the lexer will break down this example line into tokens:
`var y = x + 2`
I will use the `string` variable in the code examples to represent the part we are currently looking at.

the first part is `var`. We will insert a variable declaration token:
``` lua
if string == "var" then
    pushTokens({Type = "statement", Value = "var"}) -- puts the token at the end of the tokens list
end
```
Now we have created our first token using the lexer!

Next up is `y`. This is a variable, but the lexer doesn't know this. Luckily, it is able to look at the previous token and see that it's a declaration, so it will add the `y` variable to the variable list.

``` lua
if prevToken.Type == "statement" and prevToken.Value == "var" then -- the previous token declares a variable
    pushTokens({Type = "variable", Value = string}) -- put new token in the token list
    table.insert(localVariables, string) -- put new variable in the variable list
end
```

Next we have `=`. This is a simple case of adding a new token with Type `assigner` and value `=`:
``` lua
pushTokens({Type = "assigner", Value = "="})
```

now the variable `x`. We will say we defined `x` earlier in the code somewhere, so the lexer already knows it's a variable. If it wasn't defined and the previous token is not a variable declaration token then the lexer should throw an error.

``` lua
if table.find(localVariables, string) then -- A variable exist with name x?
    pushTokens({Type == "variable", Value = string}) -- Let's add it!
elseif prevToken.Type == "statement" and prevToken.Value == "var" then
    pushTokens({Type = "variable", Value = string})
    table.insert(localVariables, string)
else
    error("Unknown variable " .. string)
end
```

all thats's left are `+` and `2` these will be converted into these simple tokens:

``` lua
{Type = "operator", Value = "+"}
{Type = "number", Value = "2"}
```

Now we have fully generated all of our tokens:
``` lua
[Type = "statement", Value = "var"},
{Type = "variable", Value = "y"},
{Type = "assigner", Value = "="},
{Type = "variable", Value = "x"},
{Type = "operator", Value = "+"},
{Type = "number", Value = "2"}
```

This is a basic overview of the lexer. The more additions you add to your language, the complexer the lexer will become, so be sure to keep your code nice and tidy!
Lookup in 1 min
Tags: excel, datascience, dataengineering, beginners
Published: 2023-07-11 16:57:38

This is a handy function when you need to look up something quickly and easily.

LOOKUP has two forms: vector and array. The vector form is simpler and more common, so I'll focus on that one. The vector form of LOOKUP has three arguments:

- lookup_value: This is the value that you want to find in a row or column. It can be a number, text, a logical value, or a reference to a cell.
- lookup_vector: This is the range that contains the values that you want to match with lookup_value. It can be a row or a column, but it must be sorted in ascending order.
- result_vector: This is the range that contains the values that you want to return from the same position as lookup_value. It can be a row or a column, but it must be the same size as lookup_vector.

For example, let's say you have a table of products and prices like this:

| Product | Price |
|---------|-------|
| Apple   | $1    |
| Banana  | $2    |
| Cherry  | $3    |
| Date    | $4    |
| Eggplant| $5    |

If you want to find the price of a product, you can use LOOKUP like this:

`=LOOKUP("Cherry",A2:A6,B2:B6)`

This formula will return $3, because "Cherry" is in cell A4, and $3 is in cell B4.

You can also use LOOKUP to find the product name for a given price, like this:

`=LOOKUP(4,A2:B6,A2:A6)`

This formula will return "Date", because 4 is in cell B5, and "Date" is in cell A5.

That's it for this blog post. I hope you learned something new about LOOKUP in Excel. If you have any questions or comments, feel free to leave them below. Thanks for reading!
Demystifying Frontend System Design Interviews: Insider Tips and Practical Advice
Tags: frontend, systemdesign, interview, javascript
Published: 2023-07-11 16:48:05


**Introduction**:
Frontend system design interviews are relatively new compared to backend system design. In these interviews, several key pillars are assessed to evaluate a candidate's abilities:

1. Communication
2. Problem-solving
3. Decision making
4. Collaboration
5. Identifying context

**Tips for Frontend System Design Interviews**:

- Understand and clarify requirements before proposing a solution. Take the time to grasp the requirements and context thoroughly. This showcases your problem-solving mindset.
- Fulfill essential requirements before diving into details. For LLD (_low-level design_) questions, focus on specific components, responsibilities, state management, and API design (Look at it as how you want data from the backend). For HLD (_high-level design_) questions, approach the problem step by step, considering available resources and utilizing helpful online design resources (links provided below).
- Check whether you are on right track by asking for feedback in middle of the conversation.
- Be conscious to take hints. Sometimes you are going totally off track but you have to be ready to accept hints.
- Engage in a conversation rather than treating it strictly as an interview.
- Utilize online whiteboard tools (such as Exlidraw or Zoom Whiteboard) if they are part of the interview process.
- Propose alternative approaches whenever possible.
- Take a bird's eye view of the problem initially and zoom in as needed during the discussion. Keep in mind that a 45-minute interview may not cover all aspects, but aim to touch on concepts like accessibility, optimization, security, and reliability.

To find more resources on frontend system design, please refer to the first comment of my original LinkedIn post. {% embed https://www.linkedin.com/feed/update/urn:li:activity:6997269892479541249/ %}

**Conclusion**:
By following these tips and utilizing available resources, you can better prepare for frontend system design interviews. Remember to approach the conversation with confidence, actively participate, and demonstrate your understanding of key design principles.
62 berufliches Vorwärtskommen: Phasenwechsel in der IT?
Tags: deutsch, career, motivation, discuss
Published: 2023-07-11 16:17:00

Moin Moin,

Ich denke, dass wir in den letzten Jahrzehnten eine Art „Aufbauphase“ in der IT hatten. Vieles musste erstmalig entwickelt werden ( Betriebssysteme, Standards, … ). Ich denke, dass sich in den letzten Jahren ein Wandel abgezeichnet hat zu einer anderen Phase. Dieser Wandel muss ggf. noch reflektiert werden. Ich meine, dass wir über einiges bereits Gesprochen haben, insbesondere im Bezug auf uns IT-Fachkräfte.

Zur Zeit ist vieles an Software bereits etabliert. Es existieren Standards die viele Bereiche der IT regeln. Unsere Technologie ist so weit entwickelt worden, dass es Computerprogramme gibt, die Software entwickeln – in einer ernstzunehmenden Qualität.
So meine ich zu erkennen, dass es keinen großen Bedarf an Neuentwicklungen gibt. In vielen Projekten geht es darum, bereits etablierte Systeme zu warten, weiter auszubauen oder die anfallenden Daten auszuwerten. Es geht häufig nicht darum eine neue Art von Software einzuführen, bspw. den ersten Website-Builder oder das erste CRM. Ich sage nicht, dass es keine Neuentwicklungen gibt, ich sage, dass dies nicht mehr der Fokus unserer Fachrichtung zu sein scheint.

1) Meinst du einen Phasenwechsel zu erkennen?
2) Wo siehst du zur Zeit den Fokus unserer Fachrichtung?

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Oder auch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
부산 출장 마사지로 피로와 스트레스 해소, 오파야안마와 함께하세요!
Published: 2023-07-11 15:47:25

안녕하세요! 여러분에게 특별한 소식이 있어요. 오늘은 부산 출장 마사지 서비스에 대해 알려드리고 싶어요. 만약 여러분이 피로와 스트레스로 지친 상태라면, 오파야안마가 여러분을 도와줄 거예요!

오파야안마는 최고 수준의 전문 마사지 테라피스트들로 구성된 출장 마사지 서비스입니다. 부산 내 어디서든 여러분을 찾아가서, 집에서 편안하게 휴식을 취할 수 있도록 도와줄 거예요. 저희 테라피스트들은 여러분의 건강과 행복을 최우선으로 생각하며, 전문적인 기술과 경험을 바탕으로 최고의 서비스를 제공할 거예요.

오파야안마는 다양한 마사지 테크닉과 몸의 피로를 풀어주는 전문적인 접근법을 갖추고 있어요. 여러분이 원하는 마사지 스타일에 맞게 선택할 수 있으며, 근육 이완, 스트레칭, 혈액순환 개선 등 다양한 효과를 얻을 수 있어요.

여러분의 편안함과 건강을 위해 오파야안마가 여러분을 위해 준비되어 있어요. 출장으로 인해 바쁜 일상을 보내고 계신다면, 지금 바로 저희와 연락하여 예약을 하세요. 부산에서 편안하고 고품질의 출장 마사지 서비스를 경험해보세요. 여러분의 피로와 스트레스가 사라지고 건강과 행복이 찾아올 거예요!

visit: [https://www.opayaanma.com/](https://www.opayaanma.com/)

#오파야안마 #부산출장마사지 #피로해소 #스트레스해소 #건강과행복 #편안함
Support Open-Source Project (Crowdfunding)
Published: 2023-07-11 15:27:24



[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jkmquc08c1whzg92bps6.png)](https://lfx.linuxfoundation.org/tools/crowdfunding)


There are lots of ways to support open-source project.

Cloudforet is a series of LF projects.
The Linux Foundation supports open source software development through crowdfunding. Crowdfunding is a way of raising large amounts of money from a large number of people through small donations. The Linux Foundation uses crowdfunding to raise money for open source software development and to reward developers.

Based on this Crowdfunding, open-source project can do many activities like supporting of development, marketing and meetings.

> 
Open source software is free for everyone to use. It makes our lives more convenient and enriching. Please donate to support open source software.


If you love open source software, please donate to support open source software.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ifaypj2ffrfst2y3ygsk.png)

# Happy to Support Cloudforet
https://crowdfunding.lfx.linuxfoundation.org/projects/66cbfb93-7cfd-467b-bedc-406c447c2240



See [Cloudforet](https://cloudforet.io) Project
Postgres SQL for Dummies: Heap Only Tuple and Index-Only Scans (Part 7)
Published: 2023-07-11 15:25:05

In the previous part we learnt about VACUUM processing that helps with cleaning the dead tuples. Heap Only Tuple (HOT) was introduced in version 8.3 to reduce the need for VACUUM processing. It optimises the usage of index and table pages. Index-Only Scans were introduced in 9.2 to reduce the I/O costs by directly using the index key with the table pages when all entries of SELECT are available in the index. In this part lets explore these two features.

## Heap Only Tuple (HOT)
Instead of inserting the new tuple in the table in case it needs to be inserted in the same table where the old one exits, HOT takes a different approach. It uses two bits `HEAP_HOT_UPDATED` bit and the `HEAP_ONLY_TUPLE` bit to manage the states. They both occur in old and new tuples respectively in the `t_informask2` field. It is important to note that HOT is not available in some cases such as when the key value of the index tuple is updated.

## Index-Only Scans
When a select query is being executed using the index, Postgres checks the visibility of the tuples using the visibility map and if all the tuples on the page are visible, ii directly uses index tuple's key without using the table page. Otherwise it has to read the page for visibility. This reduced the I/O overhead and costs.
Vue Version 2 with TypeScript
Tags: vue
Published: 2023-07-11 15:10:15

I was applying for React jobs and unexpectedly I receive a coding challenge with a company that uses Vue Version 2 with TypeScript on Friday. In preparation I'm quickly trying to learn the basics of Vue2.

If anyone knows a GitHub repo with some typical Vue2 and TS code that has industry standard coding styles that would be amazing. Thanks!