teleren/devto huggingface dataset:
Java Graphics2D: you don't need double buffering
Tags: java, computerscience, programming, gui
Published: 2022-03-06 17:47:54

If you are into Java programming this might sound to you as a big surprise and almost as a huge heresy. No, you just don't need a `JPanel` and you definitely don't need double buffering.

What you need is just a `JFrame` and buffering with a `BufferedImage`, where you save your `Graphics2D` using `createImage`. You then use `drawImage` to display the saved buffer whenever you need to refresh the whole `JFrame`. Never redisplay your whole `JFrame` with `Graphics2D` primitives, but only with the `BufferedImage`. You can redisplay only parts of the `JFrame`. In this case your `JFrame` "paint" method must know what part to update by selective painting (like highlighting a button when clicked).

This is far much faster than double buffering and you will never see any flickering. Thus you will have the best performance with the same result as using a `JPanel` and double buffering.

But that is not the only advantage. It also allows easily zooming your entire window (by using `setSize` method) because you are dealing with the `JFrame` directly. Every time your window changes size (for example, by clicking on a magnifier lens with "+" or "-" icon) you create a new `BufferedImage` for the redisplay. This concept is a desirable feature when you are dealing with vector graphics interfaces (basically using `Shape` and `Graphics2D`), as zooming can become part of the interface.

It might sound weird to talk about vector graphics and a pixelized `BufferedImage` at the same time. However, a `Shape` is first scan-converted before being displayed. By using a buffer you are just anticipating and cutting down scan-conversion time. This is extremely useful in complex vector graphics interfaces. It is a know fact that what is deterring the generalized use of vector graphics in GUIs, either in embedded applications, either on the web, is that it is quite time consuming.

This will likely change in the near future when hyper high resolution screens will appear and programs will have to deal with a wide range of screen resolutions. Vector graphics will then be the most elegant solution to this problem. Using lots of photos and images in your web sites? If they are only for decoration you will probably be in trouble when this arrives.
How to become a Blockchain Developer ?
Published: 2022-03-06 17:45:58

## Who is a Blockchain Developer ?

blockchain developer is a developer that takes care of optimizing and developing blockchain-related dApps, smart contracts, protocols, and architecture.

It is a responsible position which requires attention to detail, knowledge, and ability to overcome challenges.

## Types of Blockchain Developers

### Core Blockchain Developers

- The core blockchain developers are responsible for architecture development.

### Blockchain Software Developer

- Blockchain Software Developer works differently. His role is to develop and implement the blockchain using the designs created by the core blockchain developers.

## Technical Skills Required

- Understanding blockchain architecture
- Data Structures
- Smart contract development
- Basic understanding of cryptography

## How to become a Blockchain developer ?

Finally , let’s dive into the **steps to become a blockchain developer.**

## Step 1: Learn basics

- Learn about what is decentralization, the use of consensus, also dive deep into cryptography. L
- Lastly, you should learn about the blockchain ecosystem.
    - Enterprise blockchain platforms
    - Blockchain as a Service(BaaS) such as Hyperledger, quorum, Corda and Ethereum Enterprise
    - Learn about popular dApps.

## Step 2: Learn how the blockchain process works.

- With basics complete, now you need to get familiar with **real-world implementation.**
- To get started, start by working through **basic cryptocurrency,** you will be able to appreciate what blockchain has to offer.
- Remember, **cryptocurrency is just one use-case of blockchain**. It is the first use-case of blockchain.
- By going through the whole process, you can **understand how cryptocurrency**, one of the most significant use-cases of blockchain works.

## Step 3: Start coding - Learn from blockchain tutorials

it is now time to dive deep into coding.

For beginners, I would learning Solidity. It will help you create and developer dApps and smart contracts on Ethereum blockchain.  

- Create a simple block
- Create a blockchain out of it
- Understand what is genesis block and implement it
- Adds the blocks to the blockchain
- Validate the chain
- Use it by doing test runs.

If you do everything correct, you will have a basic
working blockchain!

## Step 4: Learn Smart Contracts

A smart contract is also one of the vital blockchain concepts that you need to learn.

- You can use it to automate or add functionality to your dApps.

## Step 5: Read Blockchain Related Content

**Keep reading** blockchain-related content. Many websites offer high-qualíty, blockchain content. I recommend checking out **BlockGeeks** and [**101Blockchains.com](http://101blockchains.com/).**

## Step 6: Keep improving

There is no end to learn
termynal.js: A lightweight and modern animated terminal window #2
Tags: codepen
Published: 2022-03-06 17:43:27

<p>Termynal uses async and await, which is now supported pretty much across all major browsers. Termynal lets you write all input and output in plain HTML, and all styling in plain CSS. Non-JS users will still see the complete code, just no animation. It also comes with a flexible HTML API</p>

<p>Details: <a href="https://termynal.harunpehlivanitdew.repl.co/          termynal " target="_blank">https://termynal.harunpehlivanitdew.repl.co/          termynal </a> </p>

{% codepen https://codepen.io/harunpehlivan/pen/jOaJvQQ %}
How to Clear Cache in Mozilla Firefox [Step by Step]
Tags: webdev, tooling, productivity
Published: 2022-03-06 17:21:53

In this video, I’m gonna show you how you can [clear the cache memory from your Firefox browser](https://www.gadgetsgadder.com/2021/07/clear-cache-firefox.html) application.

I think it’s somewhat important to clear the cache memory over time to ignore frequent lags and high usage of RAM while using the Firefox browser on your personal computer.

Although, cleaning the cache memory can occur a little bit of extra internet usage when you’re going to load any website next time, but it will surely increase the smoothness and performance of your overall browsing experience.

Keeping that note in mind, let’s clean the cache memory.
## Instructions:

- First of all, open the **Firefox browser**.
- Then click on the '**3 lines**' from the left-up corner & click on '**settings**'.
- Then, head over to '**privacy & security**'.
- Then scroll down to '**Cookies & Site Data**' and click on  '**clear data**'. 
- Then, select only '**Cached web content**' and click on '**clear**'.

It’s done. Now restart your Firefox browser & enjoy! And I appreciate it if you [subscribe to the channel](https://www.youtube.com/souvikpaultech) for more videos.

Thank you for watching, bye.
MUI CSS styled-component を使って Slider を上書きしてみる
Tags: react, css, mui
Published: 2022-03-06 16:44:06


# MUI でのスタイリングの 2 種類の比較

https://mui.com/guides/understand-mui-packages/

ThemeProvider, styled　のスタイリング API が存在して、どちらかを選ぶらしい。

前のチームでは ThemeProvider を使っていて
今回のチームでは styled を使っている。

https://mui.com/customization/theming/#nesting-the-theme

Theming で毎回 ThemeProvider を書いてネストするので汚くなりがち。

styled　は　ThemeProvider でのラップと比べて、 export された名前の component を吐き出すので、使用するコンポーネントでテーマを意識しなくていいのが特徴。

## styled の 2つ

```
import { styled } from "@mui/material/styles";
import { styled } from "sytled-component";
```

mui/material からとってくる方法と
styled-component を使う方法がある。

使い方はほぼ同じだと思う。今回は mui/matiral/styles から持ってきて使う。


# 実際に styled で　CRA する

## React, TS, MUI をインストール

https://github.com/mui/material-ui/tree/master/examples/create-react-app-with-typescript

matrial-ui のレポジトリに mui と　ts のスタンダード？がある

```
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/create-react-app-with-typescript
cd create-react-app-with-typescript
```

これで curl でダウンロードしてくる

```
create-react-app-with-typescript % npm i
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

added 1403 packages, and audited 1404 packages in 1
```

cd して npm i する。パッケージが 1403 もあるので 1min かかる。

```json
  "dependencies": {
    "@emotion/react": "latest",
    "@emotion/styled": "latest",
    "@mui/material": "latest",
    "@types/react": "latest",
    "@types/react-dom": "latest",
    "react": "latest",
    "react-dom": "latest",
    "react-scripts": "latest",
    "typescript": "latest"
  },

```

これらの ts, mui, emotion, react, などのライブラリをまとめてインストールできる。


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


npm start するとこの文言が出てくる。

---

## styled を使う

https://mui.com/guides/interoperability/#styled-components

mui.com のガイドの例を見てみる

```ts
import * as React from 'react';
import Slider from '@mui/material/Slider';
import { styled } from '@mui/material/styles';

const CustomizedSlider = styled(Slider)`
  color: #20b2aa;

  :hover {
    color: #2e8b57;
  }
`;

export default function StyledComponents() {
  return <CustomizedSlider defaultValue={30} />;
}
```

mui/material から　 Slider　コンポーネントのライブラリをインポートする
mui/material/stuyles から styled を持ってくる。

そして CustomizedSlider で Slider の色と、ホバー時の色を上書き。


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

出力された通常時のスライダーの色が水色

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

マウスホバーしてる時の色が緑色

になる。

```ts
export default function StyledComponents() {
  return (
    <Box sx={{ width: 300 }}>
      <Slider />
      <CustomizedSlider defaultValue={30} />;
    </Box>
  )
}
```

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

普通に出力されるスライダーと並べると、色の変更が適用されているのがわかりやすい。
Welcome to use the productivity tools provided by ours 😄
Tags: tools
Published: 2022-03-06 17:11:54

Excellent tools have to undergo continuous polishing to achieve a good product experience, welcome to experience our products! 🥳

**Product Links**
https://t.co/ovogN16wjw

**Product introduction video**
https://www.youtube.com/watch?v=HGLBUBTC2T0
vscode themes for night development
Tags: vscode, webdev, beginners, development
Published: 2022-03-06 16:57:13

## **Top 5 VsCode Themes For Night Coders**

_You can install themes in Visual Studio Code in two main ways. You can either visit the marketplace and select the theme you want to download, or you can search in VSCode IDE._

1. [Dracula Dark Theme ](https://marketplace.visualstudio.com/items?itemName=dracula-theme.theme-dracula)


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

2. [Github Dark Theme ](https://marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme)

![Image description](https://user-images.githubusercontent.com/378023/132220037-3cd3e777-55a6-445f-9a2e-da6020ebd78d.png)

3. [Atom One Dark Theme](https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark)

![Image description](https://raw.githubusercontent.com/akamud/vscode-theme-onedark/master/screenshots/preview.png)

4. [Monokai Pro
](https://marketplace.visualstudio.com/items?itemName=monokai.theme-monokai-pro-vscode)

![Image description](https://raw.githubusercontent.com/Monokai/monokai-pro-vscode/master/img/monokai-pro.png)

5. [One Dark Pro
](https://marketplace.visualstudio.com/items?itemName=zhuangtongfa.Material-theme)

![Image description](https://github.com/Binaryify/OneDark-Pro/raw/HEAD/screenshots/editordarker.png)
Do it when you don’t feel like it
Tags: discuss, personal, improvement, growth
Published: 2022-03-06 16:55:38

---
title: Do it when you don’t feel like it
published: true
description: Do it when you don’t feel like it
tags: discuss, personal, improvement, growth
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/758ceuyllgwvlh7omia1.jpg
---

I get it.

Sometimes it's just hard. Like, legit hard. To do.

To do what?

Well, really, anything that's not easy.

You're just stuck. You need a break. A break from being stuck.

But guess what?

That's exactly the time when you need to do it. To do that thing that you've been dreading, or stalling or whatever.

These moments will define you and shape you into a person that does something even when you "don't feel like it".

It will pay off.

Do it 💪

---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/do-it-when-you-dont-feel-like-it/)._

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
build.ai ( + .addvar)
Tags: news, devops, discuss, blockchain
Published: 2022-03-06 16:48:09

<!--discussion post-->

```
var addvar = "addvar"
print(addvar) = "var" + docwrit[title]
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/swvw82wzh8xu9rqg5isa.jpg)
Prismic.io API browser gets blocked by Chrome extension
Tags: chrome, extensions
Published: 2022-03-06 16:22:39

**THE PROBLEM WITH INJECTED STYLESHEETS**
---
Every time I visited the API browser of [Prismic.io](https://prismic.io/) I ran into an issue where the top region is not showing at all. Inspection deems that part as "`display: none`" by an "**injected stylesheet**". After digging into it, those are styles injected by **chrome browser extensions** making the element quite passive. Redefining its styles got me nowhere, still have not figured out why injected stylesheets override page styles in such an aggressive manner.

The culprit was **Ad Blocker**, which is very useful, but unfortunately, it considered `.banner` style as an Ad. The solution was to deactivate the extension on that page.
Open Files with Nvim Remote
Tags: python, vim, tmux
Published: 2022-03-06 16:18:51

---
canonical_url: https://waylonwalker.com/til/nvr-open-files/
published: true
tags:
- python
- vim
- tmux
series: til
title: Open Files with Nvim Remote
---

I recently found a really great [plugin](https://github.com/mhinz/neovim-remote) by [mhinz](https://github.com/mhinz) to open files in neovim from a different tmux split, without touching neovim at all.

## Installation

[neovim-remote](https://github.com/mhinz/neovim-remote) is not a neovim plugin at all, it's a python cli that you can install with pip.  Unlike the repo suggests, I use pipx to install `nvr`.


``` bash
pipx install neovim-remote
```

## How I use it

I have this added to my `.envrc` that is in every one of my projects. This will tie a neovim session to that directory, and all directories under it.

``` bash
export NVIM_LISTEN_ADDRESS=/tmp/nvim-$(basename $PWD)
```

> In my workflow I open a tmux session for each project, so this
> essentially ties a neovim session to a tmux session.

### Open neovim

First open neovim, but with the `nvr` command.  This will open neovim, and look pretty much the same as always.

``` bash
nvr
```

If you try to run `nvr` again in another shell nothing will happen as its already runnin under that address, but if you give it a filename it will open the file in the first instance of neovim that you opened.

``` bash
nvr readme.md
````

## Links

* [GitHub](https://github.com/mhinz/neovim-remote)
Python CMD Progress Bars
Tags: python, programming, tutorial, computerscience
Published: 2022-03-06 16:04:12

Python is one of the most used programming language in the world. Today we're going to create a progress bar in the CMD console.

## <u>Package installation</u>
First of all, you just need to import, by pip, the package <u>[rich](https://rich.readthedocs.io/en/stable/)</u>. In your CMD, write this :

```
pip install rich
```

And then the package will be installed on your computer. 

## <u>The script</u>
After that, you can create a script with the name you want, follow by the `.py` extension. And paste this in it : 

```python
import time
from rich.progress import Progress

with Progress() as progress:

    task1 = progress.add_task("[red]Downloading...", total=100)
    task2 = progress.add_task("[green]Processing...", total=100)
    task3 = progress.add_task("[cyan]Cooking...", total=100)

    while not progress.finished:
        progress.update(task1, advance=0.5)
        progress.update(task2, advance=0.3)
        progress.update(task3, advance=0.9)
        time.sleep(0.02)
```

Nevermind, I'll explain what it does.

The first line just imports the time module. The second line imports the module rich and especially the class **Progress**. The 'with' keyword means that we asign the class **Progress()** to the variable **progress** in the block below. 
The first three variables are tasks as it's written and there are two arguments to pass :

   1. <u>The name</u> : it's a string value to describe what the progress bar does. We see <u>[ ]</u> with colors : it's just to have a colored text on the screen.
   2. <u>total</u> : it's the value that the progress bar goes to. In the exemple, it goes from 0 to 100.

Now there is a while loop and this will run until all the progess bars asigned before will be finished. Below this while, we have three instructions that increase task bars by a certain value each time (with the advance parameter).

And then we stop the script during 0.02 seconds.

In the console, you should have something like this :

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

## <u>Conclusion</u>
Just like this, you have created a simple progress bar using the <u>rich</u> package in python. Don't forget to look at the documentation of rich at this link : <u>https://rich.readthedocs.io/en/stable/</u>

See you in the next topic. Bye Bye coder friends... 👨‍💻
Do not delegate the security to your code if you have don't have to
Tags: secu, cloud
Published: 2022-03-06 15:28:38

In modern web-based development, we moved from an era of custom hosting approaches based on physical servers to a services-based system, where cloud-based technologies host the different composing pieces of our software and manage the communication between them.

The own hosting definitions also became code in this new era, making technologies like [Terraform](https://github.com/hashicorp/terraform), [Pulumi](https://github.com/pulumi/pulumi), and [CDK](https://github.com/aws/aws-cdk) very popular (31.5k, 11.6k, and 8.5k Github stars, respectively) due to their deployment and orchestration capabilities.

As we deploy our code to the inherently secure cloud environments of Amazon, Google, Oracle, and others, we're prone to embrace the misleading assumption that these cloud providers will handle the main security points. At the same time, we remain responsible just for the code programming details.

This shallow thinking often leads to too permissive applications, which can cause issues like data loss or unintended access to other's data because of the underuse of the permissions systems provided on the own environment where they run. These security definitions outside the application code make them easier to test and more complicated to break by the code changes required over the software lifecycle.

The main points to turn these definitions into software development practices are:

- It requires good team-level knowledge about the security options offered by the selected cloud provider. For instance, Amazon has Cognito as its user identity service and IAM for identity and access management.
- The developers need a clear understanding of the boundaries of authentication and authorization and how they impact access to resources. Complex systems like SaaS applications may become more secure if they can segment the data they handle in different places per tenant instead of single storage relying on system rules. The access to the own data containers becomes tied to the user's related authorization before activating any code-level permission.
- Ensure that automation can reliably evaluate these permissions as part of the continuous integration process, ensuring that the permissions granting and denial are in line with the expected behavior as the codebase evolves.
Telangana Sand Booking Status 
Published: 2022-03-06 15:12:06

The monitoring and management of sand can be done easily through this portal launched by the state government. This online portal has been started by the State Mineral Development Corporation and the Department of Industries and Commerce, Government of Telangana.

Those people who make sand in their daily life can do different types of work through this portal [PM Kisan Samman Nidhi Yojana](https://narega.net/pm-kisan-samman-nidhi-yojana/). The main objective of the Telangana Sand Booking portal is to provide sand at affordable rates to the people and bring transparency in the system. This will stop the exploitation of rivers and environment and increase the income of the government. If you want to book sand or want to check the status of your order, you can do so by visiting the official website of SSMMS.
Javascript interview questions
Tags: jrazap, javascript, webdev, interview
Published: 2022-03-06 14:56:12


<h4>Some Repositories contains more than 1000 javascript interview question:</h4>

1. 
[**70 JavaScript Interview Questions**](https://dev.to/macmacky/70-javascript-interview-questions-5gfi)

2. 
[**javascript-interview-questions** ](https://github.com/jrazap/javascript-interview-questions)

3. 
[**javascript-questions**]
(https://github.com/jrazap/javascript-questions)

4. 
[**javascript-interview-questions-1**](https://github.com/jrazap/javascript-interview-questions-1)



Find me on: [jrazap.com](https://jrazap.com/)