teleren/devto huggingface dataset:
Lockdown part 2
Tags: 100daystooffload
Published: 2020-11-15 21:32:55

Here in the UK we are into week two of our second national lockdown. The rules are much like the first, but there is far more activity on the roads than I expected; it really doesn't seem like there has been much change in people's behaviour.

Of course it may be that, like myself, many people have kept their way of life the same ever since the end of March. I often talk to people about this, bemused that anyone has the sense that we ever emerged from a lockdown only to go back into it. For me, I started working from home full time, stopped travelling nearly as much as I used to, avoided busy places even more and that's pretty much how it's stayed.

Because my behaviour has been fairly constant, and because I don't live in an area badly hit by this virus or know people who do, it becomes very difficult to appreciate the changing state of the country. Everything has stayed the same for me. This has had a noticeable effect on my ability to sense time. Because so much of my waking life is broadly similar, telling the time without checking has become surprisingly difficult. And with winter coming, even the daylight seems to conspire to confuse me with its perpetual gloominess: it could be 9am or 3pm and I would struggle to tell the difference.

_I'm publishing this as part of 100 Days To Offload. You can join in yourself by visiting [https://100daystooffload.com.](https://100daystooffload.com)_
Stickers on your laptop?
Tags: watercooler, hardware, laptop
Published: 2020-12-07 09:41:59

The cover photo is my current laptop with just one ~~tatoo~~ sticker. You can see I've become a little more conservative than with my previous two.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/leg8cpahkz2p1hh7l208.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oq64gj2yeas3g8rqb3sz.jpg)

Do you put stickers on your laptop? Just one? Several? How many is too many?
Automate cleaning css rules
Published: 2020-12-07 09:34:08

Hi, dev.to community!

Today I researched normalize.css and I thought about how I could improve css files of plugins.

Each of us wrote css rules for specific browsers and if change supported browsers list for a project the rules remain in code. You may search it and remove, but it so slowly.

Problems that can be solved:
1. your css rules and css of plugins if current project does not support this browser will have been removed
2. If you change supported browsers css rules will have been removed too

I think about a tool for automate it.

For example `input`:

```css
/* only for: IE 10 */
template {
  display: none;
}

a {
  color: red;
}
```

and output will be

```css
a {
  color: red;
}
```

I can do it as `PostCSS` plugin and check `browserslist` for compares.

What do you think about it?
VS Code in Virtual Reality
Tags: webdev, vscode, beginners, tutorial
Published: 2020-12-07 09:21:50

I setup vscode on my virtual reality headset and started coding. This was just a fun experience to see if it was possible, and what could be done. But I ended up really enjoying it!

What I found was that virtual reality has come a long way. You can load up VS Code, your browser, desktop and a number other windows, and have them floating anywhere you want inside your workspace!

I used the HP Reverb G2 to do this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hvflipnzeuusht85pj3h.PNG)

When it came to using React with an example Design, I could code immediately as if I had a multiple monitor setup!

I have a full video that is covering the whole setup if you're interested.

{% youtube LNbP4thMSRQ %}

Summary: (TLDR)
* Resolution looks good for reading text
* Feels like having multiple monitors
* Might change the future of coding
* Heaps of fun!
* Better than coding on the phone!

## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [🎞️ Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [🐦 Twitter](https://twitter.com/adrian_twarog)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Adobe XD to Fully Responsive WordPress Site](https://dev.to/adriantwarog/adobe-xd-to-fully-responsive-wordpress-site-16e0)
* [Adobe XD to HTML Full Process](https://dev.to/adriantwarog/adobe-xd-to-html-full-process-ao6)
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
How to Connect an Android Phone to a Docker Container ? - ADB, Docker, VSCode
Tags: docker, vscode, adb
Published: 2020-12-07 09:13:04

So, You decided to develop in Docker containers. 🐳

That’s a good choice because it solves a lot of problems. 👌🏼
On the other hand, it adds new ones. 😅

Great, We, developers, love to solve problems. 👍🏼🧑🏼‍💻

---

In the video below, I show you how to connect your Android phone, via ADB, to your Linux machine.

No worries, it’s easy as pie.

Follow the steps described in the video below, and you should be able to interact with your android phone from your Docker Container on a Linux Host.

{% youtube eTsKf5Fq0OA %}
<figure>
  <figcaption>Video with French Audio & English Subtitles</figcaption>
</figure>

---

If you are more a reading person, just follow the steps below.

First you have to have VSCode installed as we are going to develop in a Docker Container using VSCode and the Remote Container extension.

Everything you’re doing here is done on a Linux host machine. The steps are different on MacOS or Windows.

I did all of it on an Ubuntu machine, so tell me if you tested it on another distro and it worked (or not).

You have to describe the Dockerfile you are going to use to develop in a Docker Container.

Here is the one I used in the video :
```Dockerfile
# Pull Ubuntu LTS image.
FROM shostarson/base-dev-env:v1

# Labels and Credits
LABEL \
name=”Adb on Linux Host” \
author=”Rémi Lavedrine <remi@github.com>” \
maintainer=”Rémi Lavedrine <remi@github.com>” \
description=”Adb in Docker Container on a Linux Host machine.”

ENV SRC_DIR=/root/home/adb-linux

WORKDIR $SRC_DIR

COPY . .

RUN apt update -y && apt install -y — no-install-recommends android-tools-adb
```

And the .devcontainer.json file that describes the configuration for this container on VSCode.

You just have to add these args to the file :
```JSON
“runArgs”: [ “ — privileged”,
“-v”,
“/dev/bus/usb:/dev/bus/usb” ],
```

Rebuild everything in the Container and you are good to go.

Try adb devices on your Container with your Android phone connected to your host machine. You should see your device as an authorized one.

Tip :

Don’t forget that an Android phone can be connected to only one ADB server at a given time. So if it’s not working get sure that an ADB server is not running on your host machine.

If so, kill it and retry in your Docker Container.

---

I hope you enjoyed it and that it helps you to use Docker and Containers at their maximum possibilities.

*If you like this content, push the like button, that helps spread the message.* 👍🏼
*If you think it can be useful to anyone in your network, share it.* 📨

---

Video produced by [Wild & Secure](https://wildnsecure.com), your consulting firm to all things security and real estate.
If you want to receive weekly quality content about security, subscribe to our newsletter [on our website](https://wildnsecure.com/contact).
Printer steganography or "Is your printer spying on you"
Tags: engineeringmonday, steganography, yellowdots, printers
Published: 2020-12-07 09:03:02

Lately, I’ve been solving information security challenges on [RootMe](https://www.root-me.org/?page=news&lang=en) and I came across an interesting steganography challenge that has surprised me. Just a small digression for those who are not familiar with RootMe which is a platform where you can find a lot of interesting security challenges from different topics like cryptanalysis, steganography, servers security, programming, etc. If you are interested in security, RootMe is the place where you can learn a lot of stuff and have fun at the same time.

![RootMe Challenge #18](https://dev-to-uploads.s3.amazonaws.com/i/6389g1mgah348109rv29.png)

## The challenge
So the [problem](https://www.root-me.org/en/Challenges/Steganography/Yellow-dots) goes like this, you are given a scan of a printed document and your goal is to find the date of printing as well as the serial number of the printer. At first, I didn’t know what to do and I was trying to find clues in the text and the file itself. Of course, there was nothing within the text nor the file that I could use to solve this problem so I decided to read the reference that was given. The reference text described how some printers are using **hidden digital watermarks** called yellow dots or MIC (Machine Identification Code) allowing the printer to mark the identification of the device with which a document was printed and the date of printing. At first, I thought someone has a really good imagination and this challenge is completely fancied, but after some google searches I have found that this is real.

## Why?
Many printers use this type of watermarking and according to Wikipedia it was developed by Canon and Xerox in the mid-1980s but it was kept secret until 2004. According to Xerox, the main motivation behind this watermarking technique was to assure that their printers **won’t be used to counterfeit money**. In 2004 Dutch authorities were using this to track down the counterfeiters who had used Canon printers and this hidden property became public. Also, there are rumors that all major manufacturers of color laser printers entered a **secret agreement with governments to ensure that the output of those printers is forensically traceable.** 

![MIC from Wikipedia](https://dev-to-uploads.s3.amazonaws.com/i/pgxb6lr06r577y2i70ah.png)

Here, you can see how MIC looks on the paper. Every row has a certain number value, and every column has its data purpose in this yellow dots matrix.


If you find this interesting, try to solve the challenge. Good luck and have fun!
The semantics of interaction vs navigation
Tags: webdev, navigation
Published: 2020-12-07 08:59:43

---
title: The semantics of interaction vs navigation
published: true
description: It is commonplace for designers to style both links and buttons to look like “buttons”. But just because something looks like a button, doesn’t mean it is a `<button>`.
tags: webdev, navigation
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0iihmdxpbgytlvfnwtfu.png
---

It is commonplace for designers to style both links and buttons to look like “buttons”. But just because something *looks* like a button, doesn’t mean it *is* a `<button>` .

The general rule is to use `<button onClick="function()">` to control in-page interaction and `<a href="/path/to/link-destination">` to control navigation to a different page<sup>†</sup>.

Examples of where to use a button element include toggling an off-canvas menu or loading more posts. If you are navigating to a different page - use an anchor link.

Never, ever, ever do this:

```html
<button 
  onClick="function(){ window.location.href = '/path/to/new/page.html' }"
>
  Click me
</button>
```

Assistive technologies will announce button and link elements differently and they can be activated in different ways depending on the element - use the wrong one and you run the risk of confusing the user.

---

<sup>†</sup> The in-page “anchor” link is an exception to this. Always use an `<a href="#anchor-link">` tag for that even though the user doesn’t leave the page. This is because it will modify the URL and helps the user find the content.

Again, the same effect can be achieved using JavaScript to manipulate the Browser History API but why would you write extra code to recreate something the browser gives you for free?!

Oh, and if you're missing the "smooth scrolling" that you can add with JavaScript, consider the [fairly well-supported `scroll-behavior: scroll;` property](https://caniuse.com/css-scroll-behavior).
UI Dev Newsletter #33
Tags: webdev, html, css, javascript
Published: 2020-12-01 15:41:47

- ["Yes or No?" — One Checkbox vs Two Radio Buttons.](https://bit.ly/36rieDX)
Sara Soueidan tries to figure out if you have a question with a binary Yes/No answer, is it better to use one checkbox or two radio buttons?


- [Your first attempt at making anything accessible will be awful](https://bit.ly/3qbrDHE)
Sheri Byrne-Haber writes why your first effort at accessibility is unlikely to be outstanding.


- [The Core Web Vitals hype train](https://bit.ly/3fT2ddh)
Katie Sylor-Miller writes about the pros and cons of Core Web Vitals.


- [Thinking Like a Front-end Developer](https://bit.ly/2Jg0RgR)
Ahmad Shadeed explains how to implement a layout in CSS by thinking about the possible solutions, and asking a lot of questions to get it right.


- [Touch Targets on Touchscreens](https://bit.ly/37t805z)
Aurora Harley writes all about how to make usable touch targets for mobile and tablet design.


- [How to Load Fonts in a Way That Fights FOUT and Makes Lighthouse Happy](https://bit.ly/3mn6xnr)
Adrian Bece explains how to set up font loading that not only makes Lighthouse happy but also overcomes the dreaded flash of unstyled text.


- [Prevent layout shifts with CSS Grid stacks](https://bit.ly/36rifaZ)
Hubert Sablonnière explains what layout shift is, which problems might occur and how to use CSS Grid to fix it.


- [Super Tiny Icons](https://bit.ly/2Jg0R0l)
Super Tiny Web Icons are minuscule SVG versions of your favourite logos with average size under 465 bytes!



Happy coding!

[Subscribe to the newsletter here!](https://bit.ly/34155z3)
Confession: I Don't Know Where to Even Begin with Testing My Code
Tags: devjournal, testing, react, codenewbie
Published: 2020-12-07 08:58:39

_This post was originally published on December 7, 2020 on [my blog] (https://alexlsalt.github.io/blog)._

As I'm going through the motions of improving my coding skills each day, there's something that's always been on the periphery of my mind: testing.

Any job description throws it in. Discussions with well-meaning mentors and acquaintances drop the innocent assumption that you're correctly testing the code you run - you know, so that 'your linters dont' yell at you!'

But then I'm like, 'Whaaaaat?'

I'm not sure if I need to be testing my own personal projects or not, but I feel like it's probably a good thing to learn...eventually.

In the meantime, I found [this great article,](https://madeintandem.com/blog/five-factor-testing/) and it helped me start to at least make a little bit of sense of it all.

Any suggestions/recommendations/perspectives for a newbie tester are welcome!



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

P.S. I'm searching for my next role as a Front-End Web Developer! If you have any leads, please let me know! 

My current tech stack: JavaScript ES6, React/Hooks, Redux, Firebase Firestore, Firebase Authentication, HTML/CSS, Git

[Portfolio](https://alexlsalt.github.io/) // [LinkedIn](https://www.linkedin.com/in/alex-morton-creative/) // [GitHub](https://github.com/alexlsalt)
Determining real data types in Javascript using Object.prototype.toString
Tags: javascript
Published: 2020-12-07 08:57:57

Is there an alternative (and maybe better way) to determine data type of variables in javascript other than typeof? Turns out there is one.

Recently, I was looking at some code and found a different way some developers were using to determine the data types using Object.prototype.toString instead of typeof. On further exploration, I found that Object.prototype.toString gives much better results as compared to typeof and can be useful at a lot of places.

Let’s look at some of the results it gives:

{% gist https://gist.github.com/sunil12738/e5e3884cc919f6ed28c0b45fd013fc0a %}

# Application

Though typeof works fine for most of the cases, toString will come in handy covering cases such as
- we need to differentiate between various types in objects (such as arrays, null, object, date)
- we need to get correct data type for primitive variables created using their respective object wrappers (e.g. new Number(10) is a number but typeof will give object)

# Syntax
{% gist https://gist.github.com/sunil12738/a6978ed5a62264692a603e56960d2701 %}

One can also write a wrapper around it or even modify the function prototype to remove the unnecessary characters in the output and get only datatypes

{% gist https://gist.github.com/sunil12738/9160754b9fa9b07a1459f5b2524521ce %}

# Pros vs Cons
- It seems typeof is more compact than toString in its usage as well as the result it returns but toString is more accurate.
  - toString gives more accurate data types which are useful when differentiating between various types of objects (arrays, null, objects, date)
  - toString gives more accurate results in cases if someone has used object wrapper for primitive data types such as new Number/String.
- toString function can be overriden but typeof can’t which seems the only major drawback.

You can read more about the mechanism and working of the function over [here](https://medium.com/better-programming/what-is-object-object-in-javascript-object-prototype-tostring-1db888c695a4).

Overall, Object.prototype.toString is a pretty good method to determine the datatypes correctly in lot of cases.

------
CarPlay is over-take other wifi
Tags: swift, ios
Published: 2020-12-07 08:53:03

We are developing an in-car device, which connects over wifi. But when we trying to connect that device CarPlay is overtaking the connection. We are unable to connect wifi with our device at all.

Is there any way to check the already user connected to CaarPlay?  If so we can ask the user to disconnect that.
I created a light and easy to use PGP encryption tool 🔐
Tags: showdev, javascript, webdev
Published: 2020-12-07 08:49:34

# **[aliceandbob.io](https://aliceandbob.io/)** - a PGP encryption tool

{% github aliceandbob-io/aliceandbob no-readme %}

I once needed to generate a PGP key pair and I thought that I could maybe create my own tool in order to do so, so I made [aliceandbob.io](https://aliceandbob.io/)! 🚀

To make it short, [aliceandbob.io](https://aliceandbob.io/) is a free, light and easy-to-use PGP encryption tool based on OpenPGP.js, an open source implementation of openPGP.

![aliceandbob.io screenshot](https://raw.githubusercontent.com/aliceandbob-io/aliceandbob/master/public/browser-screenshot-1.png) 

Let's have a look to the available and upcoming features! ⤵️

### 🌌 Features currently available 

#### Encryption features
- 🗝️ generate PGP key pairs ([elliptic-curve cryptography(ECC)](https://en.wikipedia.org/wiki/Elliptic-curve_cryptography)),
- 🔒 encrypt messages with a public PGP key, and
- 🔓 decrypt messages with your private key.

#### Available params for encryption
Public keys are currently generated with the following params:
- 📧 your email, and
- 🤐 your passphrase.

#### Additional features
- 📥 download your keys in `.txt` format, and
- 📎  copy/past your keys easily.

### 🛠️ Tech used 
- HTML & CSS - the basis of the web app
- Ruby & Ruby on rails - as I think it would be the easiest way to implement further back-end features and it is currently my favorite web-app framework 
- [Stimulus.js](https://stimulusjs.org/) - a great Javascript framework, simple and modern

### 📚 Library 
For this project, I decided to rely on OpenPGP.js, a JavaScript implementation of the OpenPGP protocol. You can find out more on [openpgpjs.org](https://openpgpjs.org/).

### 🌱 Future developments 
At this stage, no need to install anything, the tool is web-based and the encryption logic is fully client-side. ✌️

Of course, at some point, a desktop implementation would be great as it stays the most secure way to generate PGP keys! 

The web app is regularly updated and the possibility to choose the type of elliptic curve for encryption will be soon added, as well as the possibility to upload your public keys to [HKP servers](https://en.wikipedia.org/wiki/Key_server_(cryptographic)).

### 🍰 [aliceandbob.io](https://aliceandbob.io/) is open source!
This project is open source, so feel free to take a look at the Github repository, watch it, fork it, star it! 🌟

{% github aliceandbob-io/aliceandbob no-readme %}

### 📣 Spread the word!
Don't hesitate to talk about [aliceandbob.io](https://aliceandbob.io/) around you, the more the merrier, don't you think!? 😉

----

If you like the app and would like it to be improved, please consider [buying me a coffee](https://www.buymeacoffee.com/aliceandbobio) ☕! It would help me a lot for the server and domain costs.

I would also like to thanks @liyasthomas for his work. All his projects inspired me a lot when building this app. 💻🙏

I hope you will like it and do not hesitate to let me know if you have any feedback or questions! 

Thank you all for reading! 😊
How to get field values with Reflection and with direct memory access in Java
Tags: java, tutorial, field, values
Published: 2020-12-07 08:45:10

To get field values from an object in Java we are going to use **Fields** component. To start we need to add the following dependency to our pom.xml:

{% gist https://gist.github.com/Roberto-Gentili/536ee2d3f775030d46d82a008da10dbe.js %}

Fields component uses to cache all fields for faster access and in this code snippet we show how to handle the fields of any Java object even of anonymous type:

```java
import static org.burningwave.core.assembler.StaticComponentContainer.Fields;

import java.lang.reflect.Field;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.burningwave.core.classes.FieldCriteria;


@SuppressWarnings("unused")
public class FieldsHandler {
    
    public static void execute() {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        //Fast access by memory address
        Collection<Class<?>> loadedClasses = Fields.getDirect(classLoader, "classes");
        //Access by Reflection
        loadedClasses = Fields.get(classLoader, "classes");
        
        //Get all field values of an object through memory address access
        Map<Field, ?> values = Fields.getAllDirect(classLoader);
        //Get all field values of an object through reflection access
        values = Fields.getAll(classLoader);
        
        Object obj = new Object() {
            volatile List<Object> objectValue;
            volatile int intValue;
            volatile long longValue;
            volatile float floatValue;
            volatile double doubleValue;
            volatile boolean booleanValue;
            volatile byte byteValue;
            volatile char charValue;
        };
        
        //Get all filtered field values of an object through memory address access
        Fields.getAllDirect(
            FieldCriteria.forEntireClassHierarchy().allThoseThatMatch(field -> {
                return field.getType().isPrimitive();
            }), 
            obj
        ).values();
    }
    
    public static void main(String[] args) {
        execute();
    }
    
}
```
In this short article we have learned how to get fields of Java objects and how to handle them and the complete source is available at [this link](https://www.burningwave.org/handling-privates-and-all-other-fields-of-an-object/).
How many domain names do you own?
Tags: watercooler, domains
Published: 2020-12-07 08:37:32

---
title: How many domain names do you own?
published: true
description: 
tags: watercooler, domains
cover_image: https://support.bigcommerce.com/servlet/rtaImage?eid=ka44O000000H3E4&feoid=00N1300000BRtWQ&refid=0EM4O0000016pKm
---
Currently, I only own 1 personal domain for my portfolio.

I also have some projects deployed on Github Pages, Netlify, and Vercel (using their free domain with their name in it) and I plan to buy a dedicated domain for some only if I see the future potential.

How many domain names do you own and how many of them do you actively use?