teleren/devto huggingface dataset:
PyQt5: The Quick and Easy Guide
Tags: python, pyqt
Published: 2021-04-03 11:56:00

PyQt5 is a software toolkit for creating **graphical user interfaces (GUIs)** for Python programs. Written in Python, it runs on Linux, Windows and Mac OS X. It uses the [Qt framework](https://qt.io), which is written in C++. PyQt5 is released under the GPLv3.

PyQt5 is an updated version of the original PyQt toolkit. PyQt4 was written for Qt 4 but has continued to work with Qt 5 for the most part. 

However, some features of Qt 5, such as Qt Quick, are not supported by PyQt4 and so were not included in PipyQt4. The new PyQt5 inherits all of PyQt4’s features while adding support for these new features.

If you are new to Python PyQt, I recommend [this course](https://gum.co/pysqtsamples)

## Hello world

The Qt widget library lets application developers create rich GUI applications for the desktop and a variety of mobile devices. 

The Python bindings for Qt are provided by the package PyQt5.  In this tutorial, you will learn how to start using Python to develop GUI applications that use the Qt widget library. 

You will need to have Python 3.6 or later installed on your computer before you begin. If you don’t, please go [here](https://python.org) for details about downloading and installing Python 3 on your computer.


All of the basics should be the same for other OSes. You can find the [tutorial here](https://pythonpyqt.com/pyqt-hello-world/). 

![pyqt hello world](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj0fumv98rhzuje5tu7t.png)

The first step is to [install QT5](https://www.qt.io/).

The next steps are to install PyQt5 and set it up to use with Python 3.4. I recommend installing PyQt5 like so:

    pip3 install PyQt5

You can then run the code below to try it out:

```python
import sys

from PyQt5.QtWidgets import QApplication, QWidget

if __name__ == '__main__':
    app = QApplication(sys.argv)

    w = QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Hello World')
    w.show()

    sys.exit(app.exec_())
```

PyQt comes with many widgets like [buttons](https://pythonbasics.org/pyqt-buttons/), [tabs](https://pythonspot.com/pyqt5-tabs/), [sliders](https://pythonprogramminglanguage.com/pyqt5-sliders/), [images](https://python-commandments.org/pyqt-qpixmap/) and lots of others.
4 great Machine Learning tools
Tags: machinelearning
Published: 2021-04-03 11:52:55

Hey! In my new job I got to know a few great Machine Learning tools which I want to share 🤖:

1. MLFlow: A platform for the Machine Learning lifecycle, meaning you can log all your experiments there with graphs/visualizations so you can see which model performs the best.

2. BentoML: A framework for deploying ML models and embedding your models into a REST Api super easy and fast.

3. Streamlit: Embed your ML project in your own Web app to make it interactive (Input and output via a GUI) and see results.

4. Kedro: A framework for creating data science pipelines (e.g. a module for data preparation, one for training the model and one for evaluation)

Which ML tools can you recommend? Have a nice Easter weekend! 🐇 :)
Simple Shopping cart with HTML & CSS
Tags: html, css, webdev
Published: 2021-04-03 11:37:50

Hello, today I created this Simple Shopping cart with HTML & CSS  but this is not responsive but is very easy to do a responsive website easy to edit this shopping cart design. I hope you like also comments about your thoughts. For more content follow me on Instagram @developer_nikhil27.
Thank you!

Checkout my new post:-
https://dev.to/nikhil27b/simple-f-q-only-using-html-css-4aa


{% codepen https://codepen.io/NikhilBobade/pen/PoWmJwN %}
Open Source tools for monitoring I/O & Storage
Tags: linux, storage, computerscience, monitoring
Published: 2021-04-03 11:36:01

| No. | Name | Metrics | Open Source | Special Comments |
| --- | ---- | ------- | ----------- | ---------------- |
| 1 | sysstat |IOPS count, CPU load, number of tasks created, average load statistics by date, Virtual memory, paging and fault stats, CPU interrupt count, Network throughput, File system utilization | Yes | - |
2 | darshan | Average I/O cost per Process, IOPS count, Access Size (POSIX)|	No | Only Derivative works allowed | 
3|grafana|	-|Yes|It is a graphing tool, needs an external data source|
4|iosnoop|I/O Latency|Yes|-|
5|iolatency|Latency distribution, Block I/O queue time.|Yes|-|
6|bitesize|Block I/O size Distribution|Yes|-|
7|syscount|Syscall count by syscall name|Yes|-|
8|uiuc-recorder|Number of I/O function calls|Yes|-|
9|iotop|	I/O utilization|Yes|-|
10|iostat|IOPS count, storage utilization, request response latency|Yes|-|
11|hpcmd|GFLOP/sec, memory bandwidth, algorithmic intensity, network avg transfer rates, utilization and memory usage of GPUs|Yes|-|
12|smartctl|Prediction of storage device failure, throughput performance|Yes|It checks the S.M.A.R.T status of the storage devices|

### If you want to know more about these tools 

> We published a survey paper. You can find it here: 
[Survey of Open Source Tools for Monitoring I/O & Storage Performance of HPC Systems](https://www.researchgate.net/publication/348919968_Survey_of_Open_Source_Tools_for_Monitoring_IO_Storage_Performance_of_HPC_Systems)
7 things to consider before starting to refactor Code
Tags: refactoring, codenewbie, codequality
Published: 2021-04-03 11:32:15

Refactoring code isn't easy. It is probably one of the hardest things to do in programming. Here are 7 things to consider before starting to refactor any code.

## 1. Get to know your Code

Take a look at the whole code first and find out its strengths and weaknesses. Make notes about what problems are actually solved very well and where the original writers took shortcuts or hacks to make the thing work and which solutions are actually holding your further development back. Only if you get the whole picture you are able to make reasonable decisions where to start first. You probably want to fix the hacky solutions first before doing "cosmetic" changes.

## 2. If it's not broken, don't fix it.

Code that works properly without decreasing performance or impacting the application in a highly negative way can probably left as it is. Hacks mentioned in point 1 can result in a poor performance or bugs nobody understands, so fix those. If a solution just looks not nice to you but works, leave it as it is for now.

## 3. Leave out personal preferences

Personal preferences are not a reason to refactor code! Just because you don't like the structure it doesn't mean it is wrong and needs to be changed.

## 4. You don't need that new fancy library / framework!

New technology isn't a reason to refactor code, too. Just because there's something new it doesn't mean it is better. A new technology should come with a highly positive impact on the application to be justified. Don't ride the hype train. also consider that new things may not be as battle proven as they should be to be used in production environments.

## 5. Resist the urge to _just_ rewrite everything.

Existing code, especially if it was shipped to production, may contain sensible workarounds and fixed bugs you don't know. Rewriting everything from scratch can lead to serious issues you can't even imagine yet. Only fix something if it's really broken or results in a poor performance.

## 6. Take small steps

Many small and easy changes will push the refactoring forward faster than doing one big change. Make incremental changes to the codebase. One big change might consume too much work and time to be completed properly, so you quickly loose the motivation to continue working on it. Collect the "low-hanging fruits" first.

## 7. Make sur all tests pass

Before committing and shipping any refactored code, make sure **all** tests pass. Resist the urge to find workarounds and cheat on tests. If tests fail, find out why. Old tests might have some clues on obscure bugs.

---

This article was first published on [my Blog](https://blog.kovah.de/en/2021/7-things-to-consider-before-refactoring-code/).
Flutter Redux Tutorial - A simple practical Flutter Redux example
Tags: flutter, redux
Published: 2021-04-03 10:47:41

Flutter Redux Tutorial - A simple practical Flutter Redux example

https://grokonez.com/flutter/flutter-redux-tutorial-flutter-redux-example-a-simple-practical

In this Flutter Redux tutorial, we’re gonna introduce main concept of Redux: what it is, how to work with Redux Store, Action, Reducers. Then we will practice to understand all of them with a simple practical Flutter Redux example.

<!--more-->
<h2>Flutter Redux Overview</h2>
<h3>Redux</h3>
Redux is a state container that helps applications to manage state.
=> Whenever we wanna read the state, look into only one single place - Redux Store.
=> Managing the state could be simplified by dealing with simple objects and pure functions.
<h4>Redux Store</h4>
Store holds the current <em>state</em> so that we can see it as a single source of truth for our data.
<pre><code class="language-java">
@immutable
class MyAppState {
  final int counter;
  MyAppState(this.counter);
}

final store = new Store<MyAppState>(counterReducer, initialState: MyAppState(0));
</code></pre>
<h4>Redux Action</h4>
Action is payload of information that is sent to Store using <code>store.dispatch(action)</code>.
Action must have a <code>type</code> property that should typically be defined as string constants. It indicates the type of action being performed:
<pre><code class="language-java">
{
  'type': Actions.INCREMENT
  'number': 3
}

{
  'type': Actions.DECREMENT
  'number': 2
}
</code></pre>

https://grokonez.com/flutter/flutter-redux-tutorial-flutter-redux-example-a-simple-practical
Urly - Command Line URL Unshortener
Tags: node, javascript, opensource
Published: 2021-04-03 10:47:38

I hate when someone tell me to click a link for a content and... I view that it's a shorten URL.
> _Me_ - Why have you shorten this URL?
> _Other_ - Because it was too long...
> _Me_ - No, I have no problem with long URLs, it's because you want **track** me!

**Do you think this?**
Ok, now you can unshort URLs with the simple command line app Urly, built with Node.js, compiled for who can't use NPM and, obviously, opensource!

**Preview**
![Urly_Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vtzhsmqge59u0n1mnw58.gif)

Discover, share, contribute and download at [Urly repository](https://github.com/Bellisario/Urly).
If you weren't a dev, you'd be a...
Tags: healthydebate, productivity, javascript, discuss
Published: 2021-04-03 10:18:42

> an astronaut🚀, a cook👩‍🍳, a dancer🕺 (maybe not this one), a policeman👮, a footballer⚽ (only if I lose my brain)...

So, do you understand what we're going to talk about here?

---

`Hello World!` [My last #healthydebate](https://dev.to/devlorenzo/series/11376) generated really lots of interactions 🥳! So I decided to create another one, it feels so good to talk with other devs! 

The question of the day is: *"If you weren't a dev, you'd be a..."*

**Question time:**  <-- To help you answer the big question above
* When you were a child, what did you dream of being when you grew up?
* What are the three jobs you would never do?
* What do you consider yourself good at? So what other job could you be successful in?
* If you were forced to change your career, you would be a...

---

Ps: Hey, if you're not a full-time dev (yet), what is your current job? If so, are you working on becoming a programmer?

---

Remember the comment!

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqefvymp8s1dxngaeseu.png)

---

Check these articles about [how programmers love to code](https://dev.to/devlorenzo/how-do-you-love-to-code-2l29) / [best operating system for dev](https://dev.to/devlorenzo/windows-or-mac-4f8k)

{% link https://dev.to/devlorenzo/how-do-you-love-to-code-2l29 %}

{% link https://dev.to/devlorenzo/windows-or-mac-4f8k %}

---

Recommended reading:

{% link https://dev.to/devlorenzo/the-ultimate-compilation-of-cheat-sheets-100-268g %}

---

Think about that carefully, because you are always on time for
![Change!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2kow46jejieflg8yc2uj.gif)
 

Or, and I don't blame you for it, you can always stay that way, I can't say it's negative...
![Image of Jim Carrey tapping on a pc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e89lu65mu1pat0f3c7h2.gif) 

---

Thanks for reading ❤️

---

## **[Subscribe to my Newsletter!](https://chipper-motivator-3112.ck.page/05710ea3d3)**
A loooong, and fun, weekly recap for you 
Free PDF version of my articles
Highly customizable inbox
That's --> free <-- and you help me!
IMAP Migration Tool
Tags: migrationimap, importimap, exportimap
Published: 2021-04-03 10:06:37

IMAP Migration Tool is the standalone utility with exceptional features to backup all the emails of IMAP locally on your PC. It easily moves all the emails in bulk to Office 365, Live Exchange, Gmail, Yahoo, Hotmail, Thunderbird, etc. This tool can easily export IMAP emails to several webmail clients such as Gmail, Yahoo, Outlook, Thunderbird, and IMAP Migration to Office 365. It can easily create backup IMAP Emails into different file formats such as PST, PDF, MSG, MBOX, EML, EMLX, OST, and many other file formats. IMAP Migration Tool can carry out the conversion of multiple IMAP Emails at a time. The tool easily executes the bulk conversion Emails of your IMAP email server. It is a time-savvy utility for any user. Users need not carry out the conversion process of the IMAP emails one by one instead you can convert entire IMAP emails along with all attachments at once. 
Read More Visit @ https://www.mailconvertertools.com/imap-mail-backup/
Time
Tags: awesomitylab, codeofafrica, taskforce, timemanagement
Published: 2021-04-03 09:57:42

I can't believe it's already been 5 weeks now, these weeks passed by so fast.

We started this week with the good old Team Building session as usual. This one was particularly interesting as we shared pictures of ourselves that teammates did not know to show them more about ourselves. It was cool getting a glimpse of everyone's life outside of work.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0r95iv8h2765pudzpq8.jpg)
This last week we also got a very interesting presentation about Time Management by a Software tester who works with CoA and a fellow developer who works in Nigeria. It was a very insightful presentation as they gave us a very interesting take on Time Management strategies and some hacks we can use to accomplish more while giving less. Some of the key ways/strategies used for better Time Management I took from it are Knowing yourself (How do you work? when are you most effective?), plan ahead, organize yourself (Find a routine and stick to it) and the 80/20 rule (find the 20% of your work that yields 80% of the results and dedicate most of your efforts to it). The 80/20 rule can however be perceived differently for different situations, that is just my personal take on it.

Thursday was extra fun though. We chilled with the Awesome team, played games, watched a movie, had good food, etc. I have to stay, we really closed the week in style. The guys are like a family, it's amazing. I look forward to more memorable moments like that.

That sums it up for the fifth week and on we go into the sixth. Next week will most likely be packed with work on client projects in Wordpress which I am curious how it turns out. Looks like I'm going to pick up something else completely new. Let's see how we do.
Don't Treat One Like Another
Tags: todayilearned, python
Published: 2021-04-03 09:35:17

One day, someone has asked on Discord:

```py
>>> import numpy as np
>>> my_list = [[1,2], [2,3], [3,4], [4,5]]
>>> [1,3] in my_list
False
>>> my_array = np.array(my_list)
>>> [1,3] in my_array
True
```

_Why `numpy` is doing so?_

They are not the same as we already know. So, why do we expect them to behave the same? Every programming language, library, and whatsoever has its own implementation. True, it is all about different implementations, after all. We can even have this weirdo:

```py
>>> a = 1
>>> b = 1
>>> a == b
True
>>> a is b
True
>>> a = 9999
>>> b = 9999
>>> a == b
True
>>> a is b
False
```

See? So, it is not ever a good idea to treat anybody the same way, for you and I are unique~ Although, in some ways, we are still comparable.

By the way, if you are curious of the two, you can follow up by reading:

- https://stackoverflow.com/a/30690604/8791891
- https://stackoverflow.com/a/15172182/8791891

Take care!
Multer - Build RestAPI to upload a MultipartFile to NodeJS/Express
Tags: multer, multipartfile, node, express
Published: 2021-04-03 09:22:32

https://grokonez.com/node-js/multer-build-restapi-to-upload-a-multipartfile-to-nodejs-express

Multer - Build RestAPI to upload a MultipartFile to NodeJS/Express

<style>
table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
}
tr:nth-child(even) {
    background-color: #e6eeff;
}
th, td {
    padding: 5px;
}
th {
    text-align: center;
}
</style>
In the tutorial, we show how to use Multer middleware for building a RestAPI to upload MultipartFile to NodeJS/Express web-application.

Related posts:
- <a href="https://grokonez.com/node-js/nodejs-restapis-how-to-create-nodejs-express-restapis-post-get-put-delete-requests">NodeJs/Express RestAPIs – POST/GET/PUT/DELETE requests</a>

<!--more-->
<h2>Multer - Upload MultipartFile</h2>
Multer is a NodeJS middleware for handling <code>multipart/form-data</code>. It will not process any form which is not multipart (<code>multipart/form-data</code>). To install Multer module, use below command:

<pre>
npm install multer --save
</pre>

Follow below segment code to build RestAPIs for handling a uploaded file:

<pre><code class="language-javascript">
const multer = require('multer');

var storage = multer.diskStorage({
	destination: (req, file, cb) => {
	  cb(null, __basedir + '/uploads/')
	},
	filename: (req, file, cb) => {
	  cb(null, file.fieldname + "-" + Date.now() + "-" + file.originalname)
	}
});

var upload = multer({storage: storage});

app.post('/api/uploadfile', upload.single("uploadfile"), (req, res) => {
  console.log(req.file);
  res.json({'msg': 'File uploaded successfully!', 'file': req.file});
});
</code></pre>

Multer provides a <strong>diskStorage</strong> engine that we have a full control on storing files to disk.

<pre><code class="language-javascript">var storage = multer.diskStorage({
	destination: (req, file, cb) => {
	  cb(null, __basedir + '/uploads/')
	},
	filename: (req, file, cb) => {
	  cb(null, file.fieldname + "-" + Date.now() + "-" + file.originalname)
	}
});

var upload = multer({storage: storage});</code></pre>

<ul>
<li><code>destination</code> is used to determine within which folder the uploaded files should be stored.</li>
<li><code>filename</code> is used to determine what the file should be named inside the folder.</li>
</ul>

How the below segment code work?

<pre><code class="language-javascript">app.post('/api/uploadfile', upload.single("uploadfile"), (req, res) => {
	...
});</code></pre>

-> Multer adds a <strong>file</strong> object to the request object. <code>req.file</code> is the <em>uploadfile</em> file.

https://grokonez.com/node-js/multer-build-restapi-to-upload-a-multipartfile-to-nodejs-express
Satisfy your very first user
Published: 2021-04-03 09:18:28

I have good news for you. When you launch something, your first user appears very quickly. And it's you.

First, you solve your pain, and then you solve this pain for others.

But there is also bad news: resolving pain for you may not wholly solve others' pain. Or maybe it's not so painful for them. Pretty harsh, right?

I have been thinking about this for a month since my previous post. When the previous issue was in the email boxes, PoC had already been working and meeting my needs. I received a report every morning.

![report](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tix7wqou9l58yn4yw3w5.png) 

I've made a lot of useful but not important improvements this month. This time I will skip them and the technical details of their implementation.

> Tell me, are you interested in reading low-level implementation details? Please reply to this letter with even one sentence, to let me know. Interested in your opinion.

Among handy things, the name is first.

OhMyCode

It seems easy and friendly to me. And not even overused by other products.

Next, I realized that my pain solvers are quite specific, and it isn't actually a pain for others. Two out of two, yeah?

Why specific? I am interested in very particular data very peculiarly grouped—for example, the total downloads of all releases' assets. And I don't need info about new commits in the repository because only I have the right to push and merge.

But why it isn't a pain for others? I can't find a similar service, so I decided to ask the audience if they would find it helpful. I prepared a post with a link to the waitlist, published it on several subreddits, IndieHackers, and HackerNews.

And didn't get any reply or upvote. It's good that I've already gathered a dozen people interested in the beta; because of such a result, the project could be curtailed.

So I decided to go with something simple so people could try it. But the current version is not suitable at all. Just because it solves only my problems.

Next, I'll try to abstract from them and make a simple MVP that will be useful for more people.

And while I'm working on it, you might find handy [SourceKarma](https://sourcekarma.vercel.app). Simple tiny service to discover how people react to your comments on GitHub. I want to do something just that "easy".