teleren/devto huggingface dataset:
How To Develop A Progressive Web Application On An Android Device
Tags: javascript, typescript, vue, programming
Published: 2021-12-02 20:46:17

In the past few weeks, I've been wondering how the whole eco-system of a [Progressive Web Application](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps) (PWA) works. Of course, I need to get my hands dirty and code something to understand it.

My main goal is to provision a local development environment, which hot-reloads (code changed) the application on a physical Android device.

The main challenge was figuring out a way to access the PWA, which runs on my local machine from my Android device (Samsung Galaxy S10). Why? Because [PWA requires HTTPS access](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs#requirements) so using IP addresses is not an option.

Ladies and gentlemen, I present to you - [unfor19/pwa-quasar-local](https://github.com/unfor19/pwa-quasar-local)

>  This project demonstrates how to develop a [Progressive Web Application](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps) (PWA) locally on an Android device, using the [Quasar Framework v2](https://quasar.dev/).

## Final Results

**IMPORTANT**: Images may look weird on DEV.to; unsure why. Go to the GitHub repo [unfor19/pwa-quasar-local](https://github.com/unfor19/pwa-quasar-local) if you experience funny widths and heights

I took screenshots with my Android device to document the whole user experience of installing a PWA for the first time.

### Accessed PWA From Android Device

The `Add to Home Screen` popup appears!

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

### Clicked Add To Home Screen

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

### Clicked Install


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

### Installation Completed


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

### PWA Appears On The Device's Apps List

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

### PWA Has A Cool Splashscreen

That is thanks to [Quasar](https://quasar.dev/) which does it, as always, automatically.


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


### First Run After Installation

The application runs on the device as if it were a "normal application".

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

## Final Words

It was a true joy to work with Quasar since it made the whole process of generating a PWA out-of-the-box without writing a single line of code. So head over to [unfor19/pwa-quasar-local](https://github.com/unfor19/pwa-quasar-local) and do your PWA magic!
Optimising Code - The Devil Lies In the Details
Tags: optimisation, rust, mathematics, maths
Published: 2021-12-02 20:45:18

Optimising code for high performance can be exhausting; where can you squeeze that last bit of speed out of your code? How can you be faster than that one piece of code you found online?

For that, let's take a look at the following example of our [Rust crate](https://github.com/LibRapid/):

```rust
pub fn new(values: &Vec<f64>) -> MathVector {
    let mut len: f64 = 0;
    for i in values {
        len += i * i;
    }
    MathVector { values:    values.clone(),
                 dimension: values.len(),
                 length:    len.sqrt() }
}
```

Among other things - like the for loop for example - one thing is the problem. Can you spot it? The answer is: `len.sqrt()`. Getting the square root of a number is performance-wise extremely expensive - how should we get rid of it? You might guess, that we could implement something like the infamous "[Fast inverse square root](https://en.wikipedia.org/wiki/Fast_inverse_square_root)" algorithm from Quake III. This has one problem though: It's inaccurate. And for something like mathematical applications, this is sometimes **very** unwanted. So we need to solve this in another way.
I got it: Why don't we calculate it only when the value is actually needed? Let's do it!
But firstly, we need to find a value for this field which _cannot_ be occupied by pure chance. 0 is no candidate, as a vector may have the length 0. But what about a negative length? That sounds good. You are not able to have a negative length of a vector because of the nature of mathematics; the length of a vector is calculated by the sum of the squares of all values, and then taking the square root. As the value of a square root is - by definition - never negative, we can say with confidence that a negative number is ideal. Let's take -1. In case of Rust though, we don't need to worry about that; we can just use a `option<T>` to represent the absence of a value.
Now we need to generate a new getter for the field `length`, which only calculates it when actually needed. The code looks like this:
```rust
pub fn length(self: &mut Self) -> f64 {
    match self.length {
        None      => { let mut len: f64 = 0f64; 
                       for i in &self.values {
                           len += i * i;
                       }
                       len = len.sqrt();
                       self.length = Some(len);
                       return len;
                     }
        Some(len) => { return len; }

        }
}
```

As you can clearly see, we check if the length is already set using the logic from our thought; if so, we can just return that. If it is `None` (or -1 in other implementations), we just calculate the length, store it and return the newly calculated length.
And that's it! With just a few more lines of code, we removed unneccessary computations by calculating something only when it is needed. Feel inspired to apply that whereever you can!
Jack Dorsey Resigns, Apple Self-Repair, the Threat of Post-Quantum Cryptography, & more on DevNews!
Tags: news, podcast
Published: 2021-12-02 20:36:48

---
title: Jack Dorsey Resigns, Apple Self-Repair, the Threat of Post-Quantum Cryptography, & more on DevNews!
published: true
description: Listen to S6E5 of the DevNews pod wherever you get your podcasts.
tags: news, podcast
series: DevNews Season 6
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/zoxvbu0494gq3sxtjp4v.png
---

Is our cryptography ready for the quantum leap? We'll talk about that and more in this week's episode of DevNews 👀 

{% podcast https://dev.to/devnews/s6-e5-jack-dorsey-resigns-apple-self-repair-and-the-threat-of-post-quantum-cryptography %}

**Hosts:** @saronyitbarek & @joshpuetz 

**Guest:** 
**Dustin Moody** is a mathematician in the National Institute of Standards and Technology (NIST) Computer Security Division, where he leads the post-quantum cryptography project. He received his Ph.D. from the University of Washington in 2009. His area of research deals with elliptic curves and their applications in cryptography.

In this episode, we talk about the resignation of Twitter CEO Jack Dorsey, and Apple’s new self-service repair announcement. Then we explore the looming threat of post-quantum cryptography.

---

_You can [follow DevNews](dev.to/devnews) to get episode notifications and listen right in your feed_ _— or subscribe on your platform of choice! Plus, if you leave us a review, we'll send you a free pack of thank-you stickers. Details [here](https://airtable.com/shr8oKAIMZgdYnBxx)._ 

## **Quick Listening Links**
- [Apple Podcasts](https://podcasts.apple.com/us/podcast/s6-e5-jack-dorsey-resigns-apple-self-repair-and/id1525581923?i=1000543753321)
- [Spotify](https://open.spotify.com/episode/5Kq4ZoFwK3cuGpvVvha9qF)
- [Google](https://podcasts.google.com/feed/aHR0cDovL2ZlZWRzLmNvZGVuZXdiaWUub3JnL2Rldm5ld3NfcG9kY2FzdC54bWw/episode/aHR0cHM6Ly9kZXZwb2RzLmRldi9wb2RjYXN0cy9kZXZuZXdzLzQ1?sa=X&ved=0CAQQkfYCahcKEwjoyr3b-8X0AhUAAAAAHQAAAAAQCg)
- [Stitcher](https://www.stitcher.com/show/devnews/episode/s6-e5-jack-dorsey-resigns-apple-self-repair-and-the-threat-of-post-quantum-cryptography-88713438)
- [Listen Notes](https://www.listennotes.com/podcasts/devnews-dev-fH8hvsClkWp/)
- [TuneIn](https://tunein.com/podcasts/Technology-Podcasts/DevNews-p1352512/?topicId=168173797)
- [RSS Feed](http://feeds.codenewbie.org/devnews_podcast.xml)
- [DEV Pods website](https://devpods.herokuapp.com/podcasts/devnews/episodes/234)

### _Acknowledgements_ 
- _@levisharpe for producing & mixing the show_ 
- Our Season 6 sponsors: [Cosmos HackAtom](https://www.hackatom.org/) & [Microsoft Azure](https://www.microsoft.com/en-us/dev-community/Event/Register?eventId=DevNewsPodcast_FI2YKJLHvJdZ&ocid=aid3038582)


We hope you enjoy the show this week! 📰
What's your favorite notetaking app?
Tags: productivity, watercooler, help, career
Published: 2021-12-02 20:09:58

Since starting as a full time SWE, I've found myself using multiple note-taking apps:
1. **Notion.** Mostly use for meeting notes. I love the organization and search features. I love that you can add attendees and other properties. But the tablet app is painful to use with a stylus. And because it's so structured, I'm less likely to add notes that don't fit in a predefined section.
2. **Samsung Notes.** For daily tasks and reminders. This replaced the Cambridge Quad notebooks I used to buy in bulk. I bought a Samsung tablet, and now I'm stuck. The handwriting recognition is the best of multiple apps I've tried. Unfortunately the people at Samsung make it impossible to access and edit your notes on desktop or the web.
3. **OneNote.** Which I've been trying to use because it's there and easy to save random screenshots to. But the lack of basic editing features and plugins sucks. The forced notebook and page structure is also pretty limiting. I hate clicking around to find notes and the view easily feels cluttered.
4. **Random sticky notes.** For random thoughts, customer service case numbers, git commands to refer back to, etc.

I would love to use **one** app that does everything these 4 apps do:
1. Organize my notes into groups and structures that I can easily search and get back to
2. Be workable on tablet. I'm not asking for much here. Just let me take notes. Recognize my handwriting and let me edit on desktop or the web.
3. Simple interface that doesn't inhibit random notes or reminders I want to jot down.

Someone suggested Obsidian. Never used it before, but would love to get some feedback from those who have. If there's another app that you swear, please let me know!

Photo by Polina Tankilevitch from Pexels
Komlexität von Algorithmen
Tags: beginners, codequality
Published: 2021-12-02 19:51:11

#Was ist ein Algorithmus? 
EVA Prinzip

###Grundprobleme 
- Berechenbarkeit
- Korrektheit
- Terminiertheit
- Komplexität (Wie lange?)

###Eigenschaften
- Determiniertheit (Kommt dasselbe bei dem selben Input raus?)
- Determinismus (Gibt es immer eindeutig eine nächste Anweisung?)
- Finitheit (gibt es ein Ende?)
- Effektivität (Ist der Effekt jeder Anweisung klar?) 

###Komplextität eines Algorithmus
####O-NOTATION
•Komplexitätsklassen werden in O-Notation angegeben -> f ∈ O(g) 
•Bei dieser Angabe gilt: "g dominiert f" 
•f ∈ O(g) ⟷ es gibt n0, c ∈ ℕ, so dass f(n) ≤ c × g(n) für alle n ≥ n0 
####Häufig benutzte Komplexitätsklassen  
•O(log(n)) 
•O(n log(n)) 
•O(n) 
•O(n2) 
•O(2n)

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

konstant: O(1); 
logarithmisch: O(log n), O(log² n)
linar: O(n)
linar-logarithmisch: O(log n * n)
quadratisch: o(n²)
kubisch: O(n³)
exponentiell: O(2hochn)
falkutlät: O(n!)

Analysen von Programmen
wenn sich mit jeden Schritt das Problem halbiert: logarithmische Komplexität
schleife in schleifen: quadratische
Mount S3 Bucket as a File System Directory [RE#14]
Tags: aws, linux, programming, productivity
Published: 2021-12-02 19:32:59

Over a year ago, we faced a storage-related challenge that involved migrating from standard file system toward a S3-compatible service. The first solution seemed to be defining an abstraction over storage mechanism and develop implementations for both standard file system and S3. While it was a legit solution, any better option that could spare us modifying the codebase was the true winner.

## `s3fs` and FUSE

[`s3fs`][repo] is an open-source FUSE-based file system driver that simply mounts a S3 bucket content as a standard file system directory. One can just install `s3fs` on Debian-based distros via:

```sh
sudo apt-get install s3fs
```

To start using it, first you need to put your ACCESS-KEY-ID and SECRET-ACCESS-KEY at `/etc/passwd-s3fs` with read-only permissions:

```sh
export AWSACCESSKEYID="your-aws-access-key-id"
export AWSSECRETACCESSKEY="your-aws-secret-access-key"
sudo sh -c "echo $AWSACCESSKEYID:$AWSSECRETACCESSKEY > /etc/passwd-s3fs"
sudo chmod 0640 /etc/passwd-s3fs
```

Then create a dummy empty directory to mount bucket content onto:

```sh
mkdir -p ~/my-bucket-mount-dir
```

And finally invoke `s3fs` to mount bucket content:

```sh
s3fs \
    "your-bucket-name" \
    ~/my-bucket-mount-dir \
    -d \
    -o allow_other \
    -o use_path_request_style \
    -o default_acl=public-read \
    -o nonempty \
    -o direct_io
```

⚠️ If, instead of AWS, you're using a third-party S3-compatible interface (e.g., minio), just provide the storage server domain as an option to the above command:

```sh
-o url=https://some-storage-server-domain
```

ℹ️ Of course there are many options that you may want to consider when using `s3fs`. You can google "s3fs" or read its docs via running `s3fs --help` or `man s3fs`.

[repo]: https://github.com/s3fs-fuse/s3fs-fuse

* * *

**_About Regular Encounters_**  
_I’ve decided to record my daily encounters with professional issues on a somewhat regular basis. Not all of them are equally important/unique/intricate, but are indeed practical, real, and of course,_ **_textually minimal._**
Does José Valim prefer dynamic typing or static typing?
Tags: elixir, typing, beam, erlang
Published: 2021-12-02 19:30:24

I am a member of [_Elixir em Foco_](https://elixiremfoco.com/), a podcast about Elixir in Portuguese. We were invited by the organizers of Elixir Brasil 2021 to interview José Valim, the creator of Elixir.

You can watch the video below, if you understand Portuguese:

{% youtube QJiLO5G3xJs %}

I asked a question whose answer I would like to share. I am not a professional transcriber or translator, so take that into account when reading the following answer.

**Adolfo Neto:** Do ​​you particularly prefer statically typed or dynamically typed languages ? If it were just for taste, not for saying what's better or worse for developers.

**José Valim:** Dynamically typed. I agree a lot with the response from the creators of Erlang. When someone asks "why isn't Erlang statically typed?", a lot of people say it is "because the theory for statically typing everything in Erlang isn't complete yet", which is true, this is one of the points. If we think about types, by definition a type system restricts the amount of software you can write because if you can't prove, using the type system, that a software is correct, even if the code makes sense, if you can't prove, the type system won't accept that software you wrote.
So by definition the type system ends up restricting the developer.
Then people say: "Oh, it's because we couldn't type everything from Erlang".
And they (the creators of Erlang) say no. Robert (Virding) in particular says: "no, it's just that we thought typing wasn't going to solve the problems we had to solve at the time." And here comes the whole Erlang perspective: "Look, there isn't a type system that's going to help you solve problems like 'Oh, what happens if the distributed system's connection goes down, or if something goes down'."
So they said that, instead of thinking at the typing level, they said "look, we want to have a system that is fault tolerant", with that whole idea of ​​fault redundancy. Instead of thinking about typing and trying to catch right away all the problems that can exist, which is impossible in complex systems, they wanted a system that, when a failure happens, the system manages to correct itself. I still think this approach, in general, from a software point of view, it's a more robust approach. Typing can give you that false sense of security that there will be no system errors. But going back a bit, it doesn't mean that I think typing isn't important. It means that I'm with the Erlang people: if you have to choose one of the two, I would choose dynamic typing. But maybe it's best to have both. We don't know yet. Perhaps. But in a choice, which was the question you asked me, I prefer the Erlang choice, I prefer dynamic typing with fault tolerance.
The best color palette sites :)
Published: 2021-12-02 19:30:12

## Canva Colors
https://www.canva.com/colors/

## Colors
https://coolors.co/

## Paletton
https://paletton.com/#uid=1000u0kllllaFw0g0qFqFg0w0aF

## Pigment
https://pigment.shapefactory.co/

## Happy Hues
https://www.happyhues.co/

## Color Hunt
https://colorhunt.co/

## Adobe Color
https://color.adobe.com/pt/create/color-wheel/

## Color.lol
https://colors.lol/

---

developed by <a href="https://www.linkedin.com/in/marcusrodriguesdev/" target="_blank">Marcus Rodrigues</a>
HypeStyle CSS
Published: 2021-12-02 19:28:19

Hey everyone!

Ive have been working on a new project called **HypeStyle CSS**

About
HypeStyle CSS is a collection of CSS utilities for web development.

Its very easy to use! 
And i need contributs to help with it!
So if you want and have time then feel free to write an email to me: (contacthypll@gmail.com)



Feel free to give a star ⭐
Github: https://github.com/lassev05/hypestyle
⭐️ CodeCast's Coding Advent: Day Two ⭐️
Tags: webdev, beginners, programming, tutorial
Published: 2021-12-02 19:20:46

![Day Two](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ubxa4gswy5nl014a598k.png)

## DAY TWO
⁠
For the second day of [CodeCast's](codecast.io) coding advent calendar,  we're sharing a tutorial by [Chris Bongers](https://twitter.com/DailyDevTips1) showcasing how to create three different Christmas trees in CSS! Get your CSS Art skills going with this free tutorial. 
⁠
Check it out at [Daily Dev Tips](https://daily-dev-tips.com/posts/three-christmas-trees-in-css/)⁠.

![Example Tree](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgtwbc3smr28qestqjvz.png)

Show off your creations below or share them with us and [Chris Bongers](https://twitter.com/DailyDevTips1) on Twitter!

You can also be sure to follow us on [Instagram](https://www.instagram.com/codecastapp/), [Twitter](https://twitter.com/CodeCastApp), [Facebook](https://www.facebook.com/codecastapp), and [LinkedIn](https://www.linkedin.com/company/code-cast/) to see our daily advent releases there!
Web3? What's the hype all about?
Tags: blockchain, solidity, javascript, web3
Published: 2021-12-02 19:08:11

**Web3** is everywhere but no one really knows what is it. 
All the hype about Nft's, Blockchain, Cryptocurrencies are all part of web3. It' just a next version of the internet.
> The Web3 is a Backend Revolution.

If you think in terms of Code then it's different. Web3 is a collection of javascript libraries that let's you interact with an ethereum node remotely or locally. 
 If you don't know about ethereum, I'll link the ethereum whitepaper below. Also, I'll link a article about the difference between Web2 and Web3. You'll have a better understanding after that.

> [**⟠ Ethereum-Whitepaper**](https://ethereum.org/en/whitepaper/)
> [⚡**Web2 vs Web3**](https://ethereum.org/en/developers/docs/web2-vs-web3/)

Think in terms of something which is completely based on internet and also decentralized(having no central authority). That's Web3. 
Here, people don't access the internet through Facebook, Instagram or whatever but instead individuals themselves who own and control pieces of the internet. **DeFi** which is decentralized finance is an element of Web3 which is getting a lot of attraction these days. Basically, it is financial transactions on the blockchain without assistance from the banks or the government. For example, DAO's or Decentralized Autonomous Organizations use tokens to make ownership and decision-making powers more equitable. It is also a safe place to commit funds to a specific cause. Also, Web3 is almost entirely open source. You can make tons of contributions in this space and meet like minded people like you.

## You can also mint an NFT using just 10 lines of python code 

![Python Code to mint a nft](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9khkbb1l9yayh7afeoul.jpeg)



> ***Making money in Web 3.0 is not that hard***

1. You can sell your article as an nft.
2. Take part in various giveaways. 
3. Help newbies in the web 3.0 space and grow your community.
4. Learn as much as possible but implement the knowledge too by writing articles and Blogs.
5. Learn to code in solidity or Javascript and make projects which will help in making your profile standout.
SPO600 - Week 3
Published: 2021-12-02 18:40:01

From my readings on week 3 of SPO600, I've learned a couple new things about the 6502 language.

Firstly, the utilization of "define". It makes code a lot more readable and simpler because you're setting a value to a word. It's easier to understand "LDA #WHITE" than "LDA $0E".

A similar thing to this is DCB (define constant variable). However you wouldn't want the program to try to execute the code block so you'd want to stop the code beforehand using brk.

Overall this really increases the simplicity of any program, and it's useful to know along with other basics.


In another topic on this week, I learned about math operations.
ADC to add, SDC to subtract, and other misc functions like CLC, SED and ASL
How To Create Extra Large Dummy Files Quickly With Linux
Tags: linux, dd, fallocate, truncate
Published: 2021-12-02 18:28:37

Create a 1GB dummy file using the `dd` command in your home directory.

```
dd if=/dev/random of=$HOME/dummy.data bs=1MB count=1024
```

The problem with the `dd` command is it takes a considerable amount of time to create the file. Especially, if you are creating a large file with dozens of gigabytes it will take a considerable amount of time to write the file. For that kind of situation, we can use the `fallocate` command. It will create a 10GB file within 1~2 seconds.

```
fallocate -l 10G dummy.data
```

Important! `fallocate` command does not work on [ZFS](https://github.com/openzfs/zfs/issues/326) and [Ext3](https://bugzilla.redhat.com/show_bug.cgi?id=563492) file systems.

In addition to the above examples, there is another way to create a large file in Linux using the `truncate` command. This `truncate` command is quite strange, it will create a 50GB file within 1~2 seconds, but surprisingly it will not take such a disk space. So we tried to create a whopping 15TB (Terabyte) file and it worked.

```
truncate -s 15T dummy.data
```