teleren/devto huggingface dataset:
Add Two Numbers
Tags: datastructures, leetcode, interview
Published: 2022-04-16 18:02:15

<h2><a href="https://leetcode.com/problems/add-two-numbers/">2. Add Two Numbers</a></h2><h3>Medium</h3><hr><div><p>You are given two <strong>non-empty</strong> linked lists representing two non-negative integers. The digits are stored in <strong>reverse order</strong>, and each of their nodes contains a single digit. Add the two numbers and return the sum&nbsp;as a linked list.</p>

<p>You may assume the two numbers do not contain any leading zero, except the number 0 itself.</p>

<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/02/addtwonumber1.jpg" style="width: 483px; height: 342px;">
<pre><strong>Input:</strong> l1 = [2,4,3], l2 = [5,6,4]
<strong>Output:</strong> [7,0,8]
<strong>Explanation:</strong> 342 + 465 = 807.
</pre>

<p><strong>Example 2:</strong></p>

<pre><strong>Input:</strong> l1 = [0], l2 = [0]
<strong>Output:</strong> [0]
</pre>

<p><strong>Example 3:</strong></p>

<pre><strong>Input:</strong> l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
<strong>Output:</strong> [8,9,9,9,0,0,0,1]
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li>The number of nodes in each linked list is in the range <code>[1, 100]</code>.</li>
	<li><code>0 &lt;= Node.val &lt;= 9</code></li>
	<li>It is guaranteed that the list represents a number that does not have leading zeros.</li>
</ul>
</div>

## Python Solution.

```

class Solution:
    def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
        
        head = None
    # Reference of head which is null at this poin
        temp = None
    # Carry
        carry = 0
    # Loop for the two lists
        while l1 is not None or l2 is not None:
            
        # At the start of each iteration, we should add carry from the last iteration
            sum_value = carry
        # Since the lengths of the lists may be unequal, we are checking if the
        # current node is null for one of the lists
            if l1 is not None:
                sum_value += l1.val
                l1 = l1.next
            if l2 is not None:
                sum_value += l2.val
                l2 = l2.next
        # At   this point, we will add the total sum_value % 10 to the new node
        # in the resultant list
            node = ListNode(sum_value % 10)
        # Carry to be added in the next iteration
            carry = sum_value // 10
        # If this is the first node or head
            if temp is None:
                temp = head = node
        # for any other node
            else:
                temp.next = node
                temp = temp.next
    # After the last iteration, we will check if there is carry left
    # If it's left then we will create a new node and add it
        if carry > 0:
            temp.next = ListNode(carry)
        return head
        
```
My journey so far in AWS and how Certifications helps in starting it…
Tags: aws, cloudskills, cloud
Published: 2022-04-16 17:17:53

From Last few years we all have been hearing a lot about AWS certifications and companies moving towards cloud adaption. 

I am no different and also got attracted towards cloud and then eventually to AWS.

My cloud journey started in September 2019 where my first interaction with it was with Google Cloud and for that I bought Linux academy subscription for year.

Being a developer in my whole career I found sudden jump to it overwhelming and realised its probably not for me and gave up.

Please read below blog post if you find this information useful.

[Link](https://vikasmishrablog.medium.com/my-journey-so-far-in-aws-and-how-certifications-helps-in-starting-it-db8a9699e849)
Life Learnings in NutShell
Published: 2022-04-16 17:01:44

## An Entrepreneur


**Chapter of Believe**
The most humble, powerful and supportive word that I have realized as a Social Engineer and Social Human Researcher is _Beleive_. You will never we succeed if you are not capable to believe in Believe.
> If you are working to be rich then first Feel rich 💫

- If you want earlier money then first find the reason to why you will have money

- If I conclude the golden statement "Nothing is Impossible in this world" in a single word it will be **Believe**


This Blog will never complete 
**To be continued**
Golang Stream All Lines From Stdin
Tags: beginners, shell, go
Published: 2022-04-17 08:21:17

---
title: Golang Stream All Lines From Stdin
published: true
date: 2022-04-16 17:00:01 UTC
tags: Beginner,shell,golang
series: "Sunday Snippet"
canonical_url: https://clavinjune.dev/en/blogs/golang-stream-all-lines-from-stdin/
---

 ![Sunday Snippet #13 golang stream all lines from stdin](https://clavinjune.dev/img/sunday-snippet/image.png "Sunday Snippet #13 golang stream all lines from stdin")

## write.sh
```shell
#! /bin/sh

set -euo pipefail

for i in {1..100}; do
    echo "$i"
    sleep 1
done
```

## main.go
```go
package main

import (
	"bufio"
	"encoding/base64"
	"log"
	"os"
)

func main() {
	l := log.New(os.Stdout, "[STREAM] ", log.Lshortfile|log.LstdFlags|log.Lmsgprefix)
	s := bufio.NewScanner(os.Stdin)

	for s.Scan() {
		t := s.Text()
		b := s.Bytes()

		// for example process the input to b64
		b64 := base64.StdEncoding.EncodeToString(b)
		l.Println(t, "=>", b64)
	}
}
```

## Usage

```shell
sh write.sh | go run main.go
2022/04/10 20:55:25 main.go:20: [STREAM] 1 => MQ==
2022/04/10 20:55:26 main.go:20: [STREAM] 2 => Mg==
2022/04/10 20:55:27 main.go:20: [STREAM] 3 => Mw==
2022/04/10 20:55:28 main.go:20: [STREAM] 4 => NA==
2022/04/10 20:55:29 main.go:20: [STREAM] 5 => NQ==
2022/04/10 20:55:30 main.go:20: [STREAM] 6 => Ng==
^Csignal: interrupt
```
Faster Startup with Caching
Tags: unrealengine, pixelstreaming, metaverse, gamedev
Published: 2022-04-16 16:58:46

---
title: Faster Startup with Caching
published: true
description: Cutting cold starts by half and beyond.
tags: unrealengine, pixelstreaming, metaverse, gamedev
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vdk6ql7ygd5qk8r1bitz.jpeg
canonical_url: https://make.live/blog/faster-startup-with-caching
---
As part of maturing the platform we have looked to really focus on our cold starts (and we will continue to do so for the foreseeable future). Cold starts meaning when your project has not had traffic for a little while the Make Live platform scales your GPUs down to zero.

We believe getting cold starts as fast as possible is key to help bring Pixel Streaming to more people with the most cost effective solution to not pay a single cent when no traffic is visiting your project. Not only does it bring a huge cost benefit but it also opens up the possibility of deploying larger and higher fidelity worlds and experiences with consistent and acceptable startup times.

We are happy to release a **huge improvement** we have made this week using a fairly common concept relatable to lazy loading.

We have found that it cuts start up time in half or more depending on the size of the project once an initial GPU has spun up to serve the first user. Once an initial version of your project has started we cache various parts of the project data aggressively.

Subsequent launches are able to take advantage of the now cached version of your project, resulting in much faster and consistent start up times. Once a new version of your project is uploaded the cache gets invalidated and the cycle repeats.

This is **available as standard to all projects at no extra cost**, you can check out all of the projects on our [community page](https://make.live/community) that now take advantage of this feature.

For example the [bakery](https://launch.make.live/make-live/bakery) is one of the larger projects at around 3GB in total size, cold starts now only take approx. 1 minute 30 seconds, previously it would take around 5 minutes.

With the new cache feature in place all projects should be fully running at around the 1 minute 30 second mark after an initial start up.

We are excited to see what you create and share!
Flutter Firebase Auth Course
Tags: flutter, firebase, auth, flutterfire
Published: 2022-04-16 16:21:34


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0r3qepbox2p2rzclvxi5.png)
Learn about Firebase Authentication with Flutter that includes Email/Password Signup & Login, Google Sign In, Facebook Sign In, Phone Verification, FlutterFire CLI & State Management using Provider which works on Android, iOS and Web!

Link: https://youtu.be/u8H652UY-L8
Part Three: CI/CD
Tags: cicd, aws, beginners, cloud
Published: 2022-04-16 15:54:48

After researching the different CI/CD tools (Jenkins, Github Actions, etc.), I decided to go with CodePipeline since I'm already working in AWS, and most of the updates were to my frontend code, not the infrastructure (remember I've been building this site manually the entire time and hadn't used IaC). Up until CodePipeline I was just editing my website code in GitHub, downloading it, then uploading to S3. It was ~~torture~~ not the most efficient workflow. Being able to push new code and have the site update automatically was a game-changer. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1218ytyca9gas2m68ly9.jpeg)

Now I'm embarking on a rebuild of my site using IaC, something I was supposed to do way earlier in this challenge. I've decided to go with [Terraform](https://cloud.hashicorp.com/products/terraform), even though [AWS SAM](https://aws.amazon.com/serverless/sam/) was the recommendation. What can I say...I like to live dangerously. Stay tuned :)
A comprehensive home surveillance solution, wrapped up in a single app!
Tags: raspberrypi, android, iot
Published: 2022-04-16 15:43:15

Collaborating my long forgotten interest in IoT and recently developed interest in android development, this is my first honest attempt to try to code an android app that helps us surveil from all the Raspberry Pi Cameras installed and configured in this app.

Hello World! I present to you *My PiCams* android application. I am not much of a blogger so there won't be much writing here. The code for this application is available on [GitHub](https://github.com/sudoashraf/myPiCams). Please feel free to visit it / use it as per your need.

**NOTE:** I haven't licensed my code yet since this is my first work getting published and I am still figuring things out. That being said, most of my work is derived from open source and if any IP violation / incorrect or missing citation is detected please reach out to me to get it rectified.
Why Is It So Important To Go To Meetups
Tags: programming, discuss, career, meetup
Published: 2022-04-16 15:40:30

Someone asked me: _"why do you go to so many meetups?"_

Despite what you think, it's not because of the cold pizza or warm beer...

Ok. In all seriousness, here are some of my reasons:

## - Get out of your comfort zone
It's a great opportunity to meet cool strangers from the industry, and get used to telling what it is that you are doing/working on.
Socializing is important to us humans, even if you are more introverted.

## - Get assurance of your roadmap 🗺
Seeing others use the same technologies and tools as you do, makes you feel that you are on the right track.

I went to a GraphQL meetup and they used the [gql playground](https://github.com/graphql/graphql-playground) and a similar schema generator to what I was using, and it made me feel relevant. 

## - Get another perspective
See what is new in the industry.
It seems like every week there is a _new technology that is going to change everything_, but in meetups, you can really see what is really being used in production.

## - Learn about a new technology
This is obvious. learn learn learn! and never stop.
A meetup is a great place to get acquainted with the basics of a new technology.


## - Expose yourself to new things 
Yeah yeah, it's very similar to the last one, BUT, this one focuses on exploring <u>**new fields**</u> and <u>**new possibilities**</u> to the career trajectory, meetups don't have to be technical, they can be about soft skills (not less important than hard skills, some say even more important).


## - Help others 🥷🏼
There are a lot of new developers that are looking for guidance at the beginning of their journey.
The brave ones will ask you directly, but sometimes a little help from your side is needed. 

## - Quality time with your co-workers after office hours 
Not much to say here except, that it's a nice balance between job and fun 🍻 

## - Learn how to talk in front of an audience from the people themselves 🦾
Pick up small things that you liked and learn from the more experienced people, you'll also notice that no one really knows what they are doing, but they are getting out of their comfort zone which is always a good thing.


## - Ask questions 💬
You can ask the people sitting next to you or ask the lecturers themselves.

## - Find your next job 👨‍💻👩‍💻
Usually, the lecturers come from hiring companies, which is a great way to expand your connections and your job search.


## - Eat and drink for free 🍕🍺
Don't have high expectations though...and sometimes...you'll be surprised for the better 🔥 


### Bonus ⚡️
**Bring a notebook** and write down everything from a new buzz word to a cool thing you liked about the meetup.
This helped me to "continue" the meetup after it ended.


## 🙏🏼 Add some reasons of your own in the comment section 👇🏼
Part Two: Building Out the Backend
Tags: beginners, aws, cloud, api
Published: 2022-04-16 15:40:18

This is the part where I wanted to throw my laptop out the window at least twice a week. When I initially read through the [Cloud Challenge](https://cloudresumechallenge.dev/docs/the-challenge/aws/) it was mentioned that this is where a lot of people get frustrated and quit. Building the backend became an endless rabbit hole of researching errors, poring over AWS documentation, piecing together and debugging code, and random screams of joy when I was able to get things work. 

I ~~struggled~~ pushed through.





##Visitor Counter##
I needed to include a visitor counter that displays the number of visits to my site. As of this post, I JUST got this working. Javascript is not a language I knew. At all. 

##DynamoDB, API Gateway, and Lambda##
In order for the visitor counter to retrieve and update its count, I needed to create a database table to store the data (DynamoDB). I also needed a way to increase the count in the database every time someone visited the site (Lambda), and most importantly for the site to be able to communicate with the database (API Gateway).


Full transparency, I've built everything manually up until now. If I didn't skip around while reading the instructions for the challenge, I would've realized that I should've built the infrastructure using an [IaC](https://www.redhat.com/en/topics/automation/what-is-infrastructure-as-code-iac#iac-for-devops) tool (more on that later). I don't feel bad about it though, building the infrastructure manually reinforced my understanding of the different AWS services I've been leveraging in this challenge. 


The next step was building a [CI/CD pipeline](https://www.redhat.com/en/topics/devops/what-is-ci-cd).
House Keeping
Tags: typescript, react, webdev, productivity
Published: 2022-04-16 15:35:19

After working as a React developer for over 2+ years now, there are some things I have learned and some that I have rapidly unlearned. I have worked on numerous projects ranging from fintech, edutech and all the way down to health and lifestyle.

In my day to day, React and Next.js are my daily drivers but Next.js more than React.

And during these times there was one thing that had always bothered me, some devs don't do enough "house keeping".

-----------------------------------------------

## House Keeping?

Yes, house keeping.

In a bid to move fast and deliver projects to client we sometimes leave webs of mess behind. Does the code work? Yes, Is it at it optimum? Maybe not. At the end of the day, the application is delivered to the client and that's the end.

Recently, I started building a project/product of my own, written in Next.js with some extra stuff and a BaaS (back-end-as-a-service).

After reaching a particular milestone, I added a ticket and raised a Github issue named _"Implement proper code documentation in form of comments and code optimization"_.

What this does is that it serves as a reminded that coding or programming is an art as well as it is science, things need to have a definite structure. 

It also saves me from having to start cleaning code when the codebase starts to become a little bit thicker.

---------------------------------------------

![Github issue for code cleanup and optimization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fex0kk715og2f1esnxd6.png)

---------------------------------------------

### Benefits of House Keeping


- **Code is clean**
At the barest minimum this is what you want to achieve, clean code. Readable, maintainable and extensible.

- **You'll be happy writing clean code**
This is the first time in a long time, that I have actually enjoyed writing code, and also the first time in a long time that I want to continue working on a project.

- **Confidence, Typescript is the GOAT**
Working with Typesscript has given me confidence when it comes to writing code, I feel safe knowing things will function the right way. Not just Typescript but any language that has static type checking will help you have confidence in your codebase.

- **Easier documentation**
Documentation becomes way more easier when your code is clean and when each component is where it's supposed to be.

-----------------------------------------------

### Conclusion

I have had the best time writing code on this project, for once I have some much confidence in the work I'm doing. There's a new stride in my step and a new found love for coding that I have never experience before.
#66 Days of Data
Tags: python, datascience, ankitgupta, mrankitgupta
Published: 2022-04-16 15:27:07

## **Learning Python**  👨‍💻

D 56 | 57 of #66daysofdata 📈

Today completed with Statistics - Data Visualization, Probability & Probability distributions, Hypothesis testing, Regression Analysis, 
Project: Boston Housing Data Analysis using Python 👨‍💻

Checkout 👉 [My #66 Days of Data timeline on Github](https://github.com/mrankitgupta/66DaysOfData)

Say me Hi! 
I'll be glad to connect on 
👇

**Twitter** @ [MrAnkitGupta_](https://twitter.com/MrAnkitGupta_)

**Github** @ [MrAnkitGupta](https://github.com/mrankitgupta)

**LinkedIn** @ [MrAnkitGupta](https://www.linkedin.com/in/mrankitgupta)
I'm a Teenage Engineering fanboy!
Tags: design, watercooler, music, discuss
Published: 2022-04-16 15:23:21

I've totally fallen for the Swedish synth-makers and electronic gizmo creators, [Teenage Engineering](https://teenage.engineering/).

They make the [OP-1](https://teenage.engineering/store/op-1/), a portable synth that allows you to make 4-track songs, from it's library of digital drum & synth sounds + sampling capabilities. It also has super interesting sequencers and other weird features that make it play more like a video game than a traditional instrument. 

It's taken over my life for the past month, and I'm completely enthralled. Let me show you a quick video!

{% embed https://www.youtube.com/watch?v=9Pm13Gk1jt4 %}

Kind of wild to me that it's been out for 10 years now. It still feels so fresh and interesting!

They also recently collaborated with [Panic](https://panic.com/) on [Playdate](https://play.date/), a handheld gaming console that features super simple black & white graphics and a hand crank. Oh yeah, and you don't really buy games for it, the system connects to wifi and games are sent to the thing willy nilly. Check it out!

{% embed https://www.youtube.com/watch?v=HdF3CnFvxg4 %}

While I only own the OP-1, the design and philsophy of [Teenage Engineering's products](https://teenage.engineering/products) all seem to follow a pattern. They're a bit [toy-like](https://teenage.engineering/products/op-1/accessories), [modern](https://teenage.engineering/products/ob-4) (but, often with a [retro](https://teenage.engineering/store/po-133-street-fighter/) twist), sometimes a tad impractical (& expensive!), and almost always quirky. Anyway, I feel like they've cracked the code here with me as I find their design and delivery so damn delightful!

So, what are your thoughts? Do you also dig Teenage Engineering? If you're a designer (because I'm certainly not!) can you help to explain to me what Teenage Engineering is doing that is so attractive to me? And devs, what do you think about the software they've been developing for the unique devices they've created?
Popular Machine Learning Deployment Tools
Tags: machinelearning, ai, webdev, beginners
Published: 2022-04-16 15:05:09

Training machine learning models, you may use pytorch or tensorflow. 

But how do you deploy them? Below are some selected tools to serve your machine learning model with introducing much overhead. Go online in no time!

## Tensorflow Serving

[GitHub](https://github.com/tensorflow/serving)

Pro: 
- Tensorflow serving is a good choice to serve your model if you've already used tensorflow to train your models.

Con: 
- If you are not using tensorflow, oops. 
- If you follow the documentations, err, it takes time to setup and debug.
- If your prediction goes complicated, the overhead of writing its handlers, configurations and debug can take a lot of time.

## Torchserver

[GitHub](https://github.com/pytorch/serve)

Pro: 
- Similar as tensorflow, if you are using pytorch, it's a good choice. Backend uses python, which is your main language during training you're familiar with.

Con: 
- Same, if you're not using pytorch, then, not a good choice. also if your prediction goes complicated, the overhead is high.

## Triton

[GitHub](https://github.com/triton-inference-server/server)

Pro: 
- Written in cpp, so it's fast.
- Support multiple machine learning framework.

Cons:
- Written in cpp, inference takes time, and web server in cpp cannot help much, and it become harder to read and debug.
- Really poor documentation. The documentation is more likely for the developers not for the users. And also, a lot of configurations.

## Pinferencia

[GitHub](https://github.com/underneathall/pinferencia)

Pro:
- Support any machine learning framework.
- Pure in Python and just a simple library. Overhead is very low.
- Implementation is intuitive and can integrate with you current codes, which means no matter how complicated your prediction workflow is, you don't need to make many changes. Actually, almost no changes, so you save your time.
- User friendly documentation.

Con:
- Relative young project. But it has a full 100% test coverage which beats all the other candidates, that is being young, also being mature.
- Also about documentations, more example are adding in the progress. You need to find out if you already have the example of your framework: Pinferencia (underneathall.app)


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

---

That is the model serving tools for today, next we will introduce how to deploy your models into kubernetes.