teleren/devto huggingface dataset:
Mozilla’s Legacy
Tags: internet, programming, firefox, mozilla
Published: 2022-10-25 23:41:59

---
title: Mozilla’s Legacy
published: true
date: 2021-04-20 22:28:37 UTC
tags: Internet,programming,Firefox,Mozilla
canonical_url: https://www.ericsbinaryworld.com/2021/04/20/mozillas-legacy/
---

A few days ago I read this article over at Tech Republic about how, [Mozilla’s greatest achievement is not Firefox, but the Rust programming language](https://www.techrepublic.com/article/rust-not-firefox-is-mozillas-greatest-industry-contribution/). They point to Firefox’s declining numbers in the face of Chrome and Chromium-based browsers and I’m inclined to agree with the author. There is, of course, a kind of poetry to this. Although Netscape was one of the first dot-com companies and beat Microsoft to the punch at creating the first mainstream web browser, it’s not Netscape Navigator which is its greatest legacy. Instead it’s spinning off into Mozilla and, the most poetic part, the creation of the Javascript programming language. (Javascript was written in just a week and a half and [this episode of Red Hat’s Commandline Heroes podcast does an excellent job documenting it](https://www.redhat.com/en/command-line-heroes/season-3/creating-javascript))

It’s also not unprecedented in the tech world – Bell Labs, the research arm of AT&T’s greatest contributions to tech have nothing to do with telephones. Their researchers invented transistors (basis of modern computers), the C programming language (pretty much every operating system and most video games until recently were written in C), the UNIX operating system (between UNIX and its kinda-descendent Linux – a good portion of the research computers and the Internet run on these OSes), and many other technologies. So it wouldn’t be the worst legacy for Mozilla to have. 

Rust, in case you’re unfamiliar, is a low-level language like C but it has safety mechanisms that should help reduce the number of bugs that can be exploited by the bad guys – at least at the operating system and driver level. Google has indicated it will begin using Rust in Android. Linus Torvalds has mentioned he’s not opposed to it in the Linux kernel. I believe I’ve also seen articles saying that Microsoft is considering using it for future versions of Windows. 

I don’t think it would be a good thing for us to end up back in a place where there’s only one browser – Chromium and its clones, but if Firefox dies, at least Mozilla will have given the world Rust. (Also, Firefox was originally called Phoenix… just as it rose from Netscape’s ashes, maybe something else would rise from Firefox)
Detectar problemas no Pub/Sub do Google Cloud
Tags: pubsub, gcp, portugues
Published: 2021-04-20 22:26:19

# Sobre
“O Pub/Sub é um serviço de mensagens em tempo real totalmente gerenciado que permite o envio e o recebimento de mensagens entre aplicativos independentes.”

## Termos Utilizados
consumidor = assinante/subscriber
produtor = publicador/publisher
mensagens = eventos/itens da fila

# Detectando Problemas
Existem alguns tipos de problemas que podem ser detectados observando o monitoramento das mensagens de uma fila:

a) Os consumidores não conseguem acompanhar o ritmo/volume das mensagens
b) Mensagens travadas
c) Perda de dados

Para verificar a causa podemos checar:

### Produtor
Quem produz/publica as mensagens

#### Meio 
A ferramenta em uso, no caso o PubSub

#### Consumidor
Quem consome as mensagens

Para entender melhor como solucionar esses problemas você pode checar também na documentação oficial, como por exemplo:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyshki8atthaihf4npaz.png)

# Exemplo
Processo com pico no consumidor:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/niub9gqgikmisol0gs7t.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mryqnfz9iz68us5e1llt.png)


Olhamos para duas métricas, como no quadro da documentação visto acima, “oldest_unacked_messages“ e “unacked messages”.

Ou seja os consumidores pegaram a mensagem para processamento mas não confirmaram se realizaram o processamento ou não gerando um aumento no tempo de vida das mensagens.

A solução como diz a documentação poderia ser aumentar o número de consumidores ou pods para realizar o trabalho, ou bug,  mas como vemos nos gráficos foi temporário e provavelmente os pods escalaram para a demanda assim resolvendo o problema.

# Referências
https://cloud.google.com/pubsub/docs/monitoring
https://cloud.google.com/monitoring/api/metrics_gcp#gcp-pubsub
Top tools to make powerful resume
Tags: resume, cv, adobe, microsoft
Published: 2021-04-20 14:35:42

Resume/CV is an crucial part for applying in job/internship/trainee opportunities and hence one cannot just take it simply for granted.

I have been searching for 5 days about various tools to create a powerful resume and then I stumble upon these few softwares.

* **Adobe Indesign**
> If you ask me personally, then adobe Indesign is the best when it comes to resume creation but i simply don't know how to use it and it is not free.😭

* **Adobe Illustrator**
> After Indesign, this is the second best software for resume creation. It provides you with great functions and features to make resumes more readable by ATS. But again, I don't know how to use this and it is not free.😢

* **Microsoft Word**
> Preferable by majority of people since many are familiar with the interface and features it provides. MS word is simply great for creating decent resumes in less time.🤩

* **Google docs**
> Here comes another useful tool. The only advantage this provides over MS word is that you can make changes in your resume anytime, anywhere and on any device. Rest all the functionalities and features are similar to MS word.🤩

* **Overleaf**
>* Overleaf is an online *LaTex* editor. Overleaf provides great templates for resume. You can just have one and make changes in it.
>* LaTex is a document preparation system for high-quality typesetting and it is the most preferable. If you have a programming background then LaTex will be easy to use.  And if you  don't, then try out online resume editors([Creddle](http://creddle.io/),[novoresume](https://novoresume.com/),[canva](https://www.canva.com/)).

You have other useful resources? Then write it out in comments🤗✨.
Passings args into Rspec Shared Examples
Tags: rspec, testing, rails
Published: 2021-04-20 22:07:03

It is convenient to have shared examples for testing to DRY up our tests and tests models or controllers that share code. An example could be an extend or include in a model or a before action in a controller.

Create your shared example in the support directory (make sure it auto loads by adding `Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }` to your spec_helper)

```
RSpec.shared_examples 'good stuff' do
  it 'runs some tests' do
    expect(arg).to be_valid
  end
end
```

Then pass in args as a block in your test:
```
  it_behaves_like "good stuff" do
    let(:arg) { create(:something) }
  end
```

Now you've got yourself a bunch of green tests with little effort!
The vulnerability of insecurely deleting password manager exports
Tags: security, password, bitwarden, lastpass
Published: 2021-04-20 22:05:43

In the past couple of weeks I've read many posts about moving from _Lastpass_ to _Bitwarden_ or another service. As a developer and IT-security student I'm always thinking carefully about the tools I use everyday.


Don't get me wrong - password managers are the way to go if you want to contain the consequences regarding a data leak on a site you're registered. But when doing something like the migration of your passwords to a new service, you can easily find yourself creating a new attack vector for people or bots that try to steal your identity.

When you export your `passwords.csv` file from _Lastpass_, for example, you should not forget about it or just delete it after the migration process is finished.

## 🗑 Why deleting or using `rm passwords.csv` isn't enough
When deleting a file, it will usually be moved to the trash bin by your operating system, unless configured differently. It should hopefully not be necessary to point out, that anyone can still access the file.

The next thought would be to use something like `rm -rf passwords.csv` to bypass the trash bin. Yes, you've apparently deleted the file. But what has truly happened in the background is a simple process of telling the disk that this specific data block is free (to use).
**The data selected when using the normal _delete_ operation or executing the `rm` function is still physically there!**
![Security vulnerability](https://cdn.dribbble.com/users/2071065/screenshots/7091033/media/3e54730e79d826680ef0544f882e6ebc.png?compress=1&resize=400x350)

## 🧲How to safely delete your export file
After you have completed the migration of your passwords, you should "delete" the file safely, as otherwise all you passwords will still be stored on your computer in plaintext.

If you're not familiar with the console, you can use a tool like [_File Shredder_](https://www.fileshredder.org/). You can find [more information](https://www.fileshredder.org/fileshredder-help.php) for the easy process on their website.

Otherwise you can use `shred` on unix systems to **delete and overwrite** the selected file(s). An example usage with 10 iterations could be:
```plaintext
shred -fuz -n 10 passwords.csv
```
The `-f` operator forces the overwrite, `-z` overwrites the file with zeros to hide the operation, and `-u` finally deletes the overwritten file.
More information about the _shred_ command can be found [here](https://wiki.ubuntuusers.de/shred/).

## Conclusion
In times where we all are registered on hundreds of sites, one of your passwords can be leaked very easily. Therefore, it should be common practice to use a password manager and different and random passwords for each site.
If you then remember these simple steps, you can prevent a leak of one of the most important things in your life - your password database.
Keep it safe and keep it close! 🔒


###### Image credit goes to [Ivan Haidutski](https://dribbble.com/Ivan_Haidutski)
Inline member variables in C++
Tags: cpp, cpp17, programming, 5days5blogposts
Published: 2021-04-20 21:59:40

Say we need a class member variable (non-const). Global variables should be best avoided, but let's ignore that for now and focus on the solution.

This is a bad choice most often:

```cpp
struct S {
    static int i;
};
// somewhere in cpp file:
int S::i = 0;
```

The definition (`int S::i = 0;`) needs to be placed in a single translation unit in the whole project, otherwise we get an error indicating multiple definition of `S::i`.

In pre-C++17 world we need to find some workaround of this problem. One way is to go with a static member function:

```cpp
struct S {
    static int& getStatic() {
        static int i = 0;
        return i;
    }
};

// sample use: ++S::getStatic();
```

Another way is to use templates:

```cpp
template <typename T>
struct S
{
    static int i;
};

template <typename T>
int S<T>::i = 0;

using static_instance = S<void>;
// sample use: ++static_instance::i;
```

That makes a lot of boilerplate and obscure code. Our problem is solved by *inline variables* in C++17. That looks simple and serves well:

```cpp
struct S {
    static inline int i = 0;
};

// sample use: ++S::i;
```

The *inline variable* has an *external linkage* if our class is not inside an *unnamed namespace* (i.e. when the class has *external linkage* too). It enables the possibility of more than one definition of the variable (hence no *multiple definition* errors). The variable must be declared *inline* in all the translation units and it always has the same memory address. All the definitions have to be identical, otherwise we break *one definition rule*. That may lead to hard to detect problems if we are not cautious.


```cpp
// one translation unit, S has external linkage
struct S {
    static inline int i = 3;
};

// another translation unit, S has external linkage
struct S {
    static inline double i = 3.14159;
};

```

The code in the example above is invalid, but it compiles and can behave unexpectedly.

Static *constexpr* members are *inline* by default.


Interesting resources:
- [inline specifier](https://en.cppreference.com/w/cpp/language/inline) on [en.cppreference.com](https://en.cppreference.com)
- [How to initialize static members in the header](https://stackoverflow.com/questions/18860895/how-to-initialize-static-members-in-the-header) on [stackoverflow.com](https://stackoverflow.com)
- [How do inline variables work](https://stackoverflow.com/questions/38043442/how-do-inline-variables-work) on [stackoverflow.com](https://stackoverflow.com)
"Weird" testing job interview questions
Tags: testing, career, 5days5blogposts
Published: 2021-04-20 21:36:43

I don't think I had many testing job interviews. Less than 10. I am with my 4th employer. But how many is _many_? 

On my first software testing job interview my future employer did not ask me _standard_ questions related to testing like: 

* _What software development methodology did you use?_
* _What's the difference between validation and verification?_ 
* _Could you tell us about your experience with automatic testing?_ 
* _Are you an [ISTQB](https://www.istqb.org/) certified tester?_

I had a non-tech-related background and the answer to those questions would probably be: "_I have no clue, sorry_".

**The _fun_ began, when I was looking for my _next_ employer.**

**_How would you test a clock? A pen? A paper cup? A soda machine?_**

When it comes to soda machine, you probably have a rough idea on how to test it. You would possibly like to check at least if:
* the alphanumeric keyboard/buttons work as intended
* it accepts the currency it was intended for
* if it accepts real money
* it accept cards?
* it doesn't give the soda cans for free
* it returns the correct amount of cans for the value of money inserted
* it returns the right cans of soda
* it returns the correct amount of change (if needed)

**But for the other inquires I asked miscellaneous sets of questions in return**:
* What kind of clock? Digital, mechanical, online or maybe sundial? 
* What kind of pen? Ballpoint, gel, rollerball or ink pen? Or maybe a quill?
* What kind of cup? For hot / cold beverages? How many milliliters will it fit?

Those replies were not necessarily wrong. The first question however should be: **_"What does the client want to do with that clock / pen / cup?"_**

Maybe the client intended that the paper cup is not to be drink from, but to be shot at from a rifle in an amusement park? 
Maybe the pen was ordered by NASA to be used in space for writing purposes? 
Maybe the clock will be a colossal monument of astrological clock, celebrating [Richard of Wallingford](https://en.wikipedia.org/wiki/Richard_of_Wallingford)?

Those "weird" questions' main purpose is to show the recruiter the way you think. But the client's and / or the end user's context is an important factor and it will reflect on the end goal - the quality outcome. Having a solid grasp of the actual product requirements makes the use cases, the entry and exit criteria, and every other testing activity much easier and relevant to the case. As such, the questions that seem strange to ask the candidate on an interview at first, serve their purpose.
Web socket and HTTP(s); Intro to simple differences
Tags: webdev, node, computerscience, javascript
Published: 2021-04-20 19:30:21

In telecommunication a [**duplex**](https://en.wikipedia.org/wiki/Duplex_(telecommunications)) communication system is a **point to point** system composed of 2 or more connected devices.
And it can be:

- **Full-duplex system, simultaneously** or bi-directional at time
![Screenshot_2021-04-20 Duplex (telecommunications) - Wikipedia(1)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l548oj5c0onjkw8mu24o.png)
 
 
 
- **Half-duplex system**, communication is **one direction at time**
![Screenshot_2021-04-20 Duplex (telecommunications) - Wikipedia](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uogwfrip1q9famex8mbl.png)

**HTTP 1.1**, HyperText Transfer Protocol is a **Half-duplex system**. 

So writing chat applications using i.e. LAMP Stack, (Linux, Apache, Mysql & PHP), it involve: 
- Actively sampling the status of the server (Polling) for changes
- Keep track timestamp and 
- It’s slower than it should be.

**Socket** have traditionally been the solution for real-time chat application are architected, supplying a bi-directional (**Full-duplex**) communication channel between the client and the server. It actually use the URI format.
```bash
ws://userinfo@host:port/path?query#fragment
```

This is just a start to wrap your mind around in case you want to understand how [socket.io](https://socket.io/get-started/chat)

It also contains very helpful [examples](https://github.com/socketio/socket.io/tree/master/examples)
Validating OAS3.X YAML spec files against the OAS3.0 spec in Java?
Published: 2021-04-20 19:24:31

I am new to this forum and this is really more a question than a post. Hopefully this is OK.



I would like to be able to validate OAS3.X compatible YAML spec files against the OAS3.0 spec (https://spec.openapis.org/oas/v3.1.0). The built-in capabilities in swagger-parser and openapi4j appear to give inconsistent results. For instance the swagger-parser is not flagging that 'decimal' is not a valid data type in OAS3 etc. How could I write a validator from scratch in Java that would load the OAS3 spec and then validate the YAML spec files against it? (Note: In openapi4j, if the URL points to the OAS3.0 spec file, the parser quits with an exception.)

Thanks!
Dark/Light theme switcher for your Website.
Tags: webdev, webdesign, uidesign, theme
Published: 2021-05-18 05:49:30

---
title: Dark/Light theme switcher for your Website.
published: True
date: 2021-04-20 19:13:32 UTC
tags: WebDevelopment,WebDesign,UIDesign,theme
canonical_url: https://magbanum.tech/darklight-theme-switcher-for-your-website
---
![Dark light theme switcher](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qt6lj1jd7g0ep4c58x5r.png)
Nowadays, the use of dark UI has been increased by web developers to make their websites more effective in low light. Popular websites with the dark mode are [GitHub](https://github.com/), [Youtube](https://www.youtube.com/), [Medium](https://medium.com/), [FreeCodeCamp](https://www.freecodecamp.org/) and [Hashnode Blogs](https://magbanum.tech). Not only websites but lots of mobile apps like Chrome, Instagram, Whatsapp have dark UI in them. ![Dark_UI.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618935217682/1fjocIMB_.png)Some advantages of the dark UI are,

- It reduces the energy consumption as the use of pixels are reduced (more effective on OLED and AMOLED screens.
- Reduces eye strain in low light conditions.
- Reduces screen glare and blue light
- Make your website or app look amazing

But using the dark mode in bright conditions can cause eye fatigue. Hence, in order to make it user friendly, we will need something for the visitor to be able to switch between dark and light theme as per its need. That's where the Dark/Light theme switcher is introduced.

Dark/light theme switcher can be created using HTML, CSS and JavaScript for any Website. I have provided the source code for such a button that I used in one of my project [#magbanum.blog](https://magbanum.live/blog/index.html). I hope you will find it helpful.

HTML:

[https://gist.github.com/magbanum/71f8b83057e30e0d8549f8193c19d38c](https://gist.github.com/magbanum/71f8b83057e30e0d8549f8193c19d38c)

CSS:

[https://gist.github.com/magbanum/017ab397dd6eef0f0a807f5f4fc3f2d3](https://gist.github.com/magbanum/017ab397dd6eef0f0a807f5f4fc3f2d3)

JavaScript:

[https://gist.github.com/magbanum/ef286bb67dff238c97e9df8d2eabcfaf](https://gist.github.com/magbanum/ef286bb67dff238c97e9df8d2eabcfaf)

Do visit the [GitHub repo](https://github.com/magbanum/dark-light-theme-Switcher) for more information.

Do you have a dark mode on your website? let me know by commenting below.
61 Tabs and Picking What Not To Learn
Tags: browsers, learning, tabs
Published: 2021-04-20 18:52:57

I use search engines a bunch because I learn a bunch. Since I learn a bunch I use what I call the "Learn, not Learn" model inspired by Dave Geddes in his [post](https://mastery.games/post/what-not-to-learn/). It goes like this while looking for a solution for whatever you are doing at the moment, you encounter a bunch of options. Since it is not possible to learn and know everything, you choose what you want to know, and deliberately pick what not to learn. Learn React, not Vue. Learn Figma, not Sketch. Learn about anime, not Quantum Physics.

![Dave Geddes' mind map of what not to learn](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvehk2a6jg04opoinyzy.jpg)
_Dave Geddes' mind map of what not to learn. [source](https://mastery.games/post/what-not-to-learn/)_

Then you stick to it, and in your search, you encounter things from the 'not going to learn' category - you close the tab and move to the next one. It is can be vividly illustrated with competing technologies in front-end development, and I'm sure this can be applied to multiple areas of knowledge.


![[My "Lean, not Learn" framework for Figma]](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ut1lppu1zhc75goa3u9x.png)
_[My "Lean, not Learn" framework for Figma](https://www.figma.com/community/file/956682448128019934/Pick) because I use Figma for everything._

At this very moment, I have 61 tabs open in the browser. Result of my investigation into GraphQL + Azure + Typescript data storage solution. All 3 are in my 'to learn' category. As a result, I've added Cosmos DB and Appolo Server to the 'learn' column and things like MongoDB, TypeGraphQL, and .Net.Core to the 'not going to learn' category.

![61 tabs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xkswuxoi9k9500lpyd2y.png)


As a result, out of 61 pages, probably a good 30% are not relevant for me because of the choices I've already made.

What if I could easily understand which tabs are relevant and which can be closed? What if the browser could know about my "Learn, not Learn" framework, and what do I have in each category?

What if I could say "This thing is nay, I do not want to read about it, please warn me if the page talks about it" before I've read half of the page?

What about the browser extension for that? 🤔

What about I build one.

Follow me on Twitter [@ykovzel](https://twitter.com/ykovzel) for more ✌