teleren/devto huggingface dataset:
Select the best GUI toolkit – part 7: pyQt
Tags: toolkit, comparison, gui, qt
Published: 2023-10-22 23:54:32

And finally we reach the end... that is the last of the GUI framework I decided to experiment... pyQt.
<!--more-->
PyQt was developed by the Qt Company and is the base for the KDE, one of the desktop environments used by Linux. 
Its development started in 1990 and was since it's beginning a C framework conceived to provide a common abstraction layer able to render a GUI in different platforms. A complete history can be found in the [wikipedia article](https://en.wikipedia.org/wiki/Qt_(software)#History_of_Qt).
Like WxWidgets, Qt is originally conceived to be a C++ framework, but now as many bindings on other languages, like this [list](https://wiki.qt.io/Language_Bindings). It has ports to almost all operating systems, like Android. Is much probably the most supported GUI framework in different platforms. It started as a GUI framework, but it has grown to be added support for extra stuff like network, mouse, audio, etc. There is a [list of all features here](https://www.qt.io/product/features).
There are two ports of Qt in Python: PyQt and PySide. The first is the original branch comes from the licensing made by the owner of Qt: the Qt Company. The second was created by Nokia when was the licensee of Qt, since it wanna develop software using a different licensing, but Qt Company refused, and so Nokia forked the framework. The code require minimal modifications in order to use one or another, usually it suffices to change the imports from `PyQt` to `PySide`.
There is a visual designer for Qt when you can build the GUI from the grounds-up using drag and drop widgets from a tool
bar. [QT Designer](https://doc.qt.io/qt-6/qtdesigner-manual.html) is free and can be installed along with Qt/PySide.
Qt has a [staggering number of widgets](https://doc.qt.io/qtforpython-6/overviews/widget-classes.html), all descending from the basic class `QWidget`. Almost everything you need is on those classes, I used a `QListView` to build the main panel. For every item in the list there was a `QStandardItem` which represents an Icon which is added to a `QStandItemModel` which is the model to which you add the items.
Dragging and droping the icons inside and from outside or to inside can be implemented through several `drag*`and `drop*` methods in the `QListView` class. To bind widget events with methods you use the `.connect` method to associate them, passing the name of the method to deal with the event.

The program was developed and tested on Windows, and on Mac, because of the separation between icons and executables it required changes to deal with the specificities of each platofrm. There is, the code is not imediatelly portable between platforms.

![QtAppMenuLauncher on Mac](https://codehouse.digfish.org/wp-content/uploads/2023/07/mac-running-qtappmenulauncher.jpg)

The source code for this implementation is available at [GitHub](https://github.com/digfish/QtAppMenuLauncher).
Wholesale auto car spare parts from the UAE (Dubai)
Published: 2023-10-22 23:51:18

## Any detail for any vehicle

The company «APEC» [https://apec-uae.com/about/](https://apec-uae.com/about/) is the fast-growing international organization/holding with 15 years of successful worldwide experience in the field of auto spare parts wholesale & logistics in the Middle East, Europe, Asia, North America, CIS.

The company «APEC» is expanding its business activity and recently set in operation brand new warehouse in UAE, Dubai,  Jebel Ali Free Zone - one of the biggest logistic and industrial areas in the Middle East providing all types of intermodal connections: oversea, overland, over the air.

The company «APEC» has already made huge investments into strong-developed warehouse management system (WMS) including informative web-portal as well as into well-organized brand new and modern warehouse to keep efficient stock to supply customer’s demand.

The company «APEC» has strong and long-standing relationships with many distributors and vendors of genuine and aftermarket auto spare parts worldwide. We developed well-structured & cost-effective logistics from any part of the world. Therefore our sales prices are the most competitive among other wholesalers and traders providing the fastest delivery which is always in time.

## Advantages of working with us

1. «APEC» provides a guarantee for all auto spare parts sold. We cooperate with reliable partners assuring you of the best quality of their production. We are open-minded and loyal to any customer and we are ready to settle any disputable issue serving the interest of our customers. We do our best assuring that our prices will surprise you. If you can get somewhere the better price for the same goods, please give us a call. We are ready to discuss an extra bonus for you, on individual basis.
2. There are special conditions which we provide to our regular customers.
3. Our attentive managers provide full support to each customer concerned.
4. Easy come – easy go approach when placing order and getting it delivered to our customers. An intelligible web interface and simplified search engine will help you to find any item by article, model, YOM, VIN, vehicle type аs well as by its catalogue number. Order placing will take an extremely short time.

We accept all types of payments. This allows our customers to save their time.
Creating a real-time local to cloud synchronizer in Python
Tags: dropbox, python, synchronizer
Published: 2023-10-22 23:46:14

<h2>The idea</h2>
<p>Some cloud storage providers offer a client application that can be installed in the local storage, allowing for a &quot;local mirror&quot; of the remote storage. Usually this synchronization is two-way, the changes on the local system are propagated to the cloud storage and the changes made in the remote storage are reflected in the local mirror. Dropbox since its inception as such app for such purpose, Google Drive used to have one of these, and OneDrive  also have such application. In this article, I will present a 'proof-of-concept' Python application that is able  to make the &quot;first part&quot; of the synchronize, ie, reproduce the local changes in the remote cloud storage.</p>
<h2>The implementation</h2>
<p>Using the official Dropbox Python SDK and the library watchdog, it's possible to crate one such application in around 100 lines of code.
<a href="https://python-watchdog.readthedocs.io/en/stable/index.html">Watchdog</a> allows you to monitor changes in your local file system through events triggered by those changes like 'FileCreated','FileModified','FileDeleted' or 'FileMoved'. For each type of event, there one respective method in an EventHandler subclass which should implement these methods.
To use the Dropbox SDK, you'll have to create one application in the <a href="https://www.dropbox.com/developers/apps?_tk=pilot_lp&amp;_ad=topbar4&amp;_camp=myapps">Developer frontend</a>. Generate one access token that can be used in our application.
This application just have two parameters: the local directory where the file changes will occur and the remote directory  on Dropbox where these changes should be reflect. It's a kind of mapping between that local directory and this remote directory.</p>
<p>NOTE: This code does not perform an initial synchronization of the local files to the directory in the cloud. It only uploads file created or changed during the execution of the program.</p>
{% embed https://gist.github.com/digfish/fd2435c87ca2942b176dac8c19d89b4a.js  %}
Find and explore jobs by category
Tags: webdev, remotework, remotejobs
Published: 2023-10-22 23:35:24

I've been working on a new section of my job portal.

Now, you can explore job opportunities organized by specific categories.

✨ Some of the available categories include:

🌐 Remote, Backend jobs.
🌐 Remote, Frontend jobs.
🌐 Remote, DevOps jobs.
🌐 Remote, Marketing jobs.

Your feedback matters! 💬 Share your thoughts below or reach out to me directly.

I hope you like it and it is helpful for anyone looking for a new job. 🤞 🌟

Link: https://www.opentoworkremote.com/
Clean Code
Tags: books, read, cleancode, programming
Published: 2023-10-22 22:57:17

Hi, my name is **Sérgio Leal**, I'm a software developer from Brazil and here I will make my notes by reading the book Clean Code.

#Cap 1

#### The Code
The programmer never will never be replaced by a code generator(AI), programming is constantly evolving and carrying out updates without generating new errors is a complex task because we will never know where this modification would be reflected.

#### Bad Code
Incorrect code can lead to poor performance, affecting code/project delivery resulting in a company going bankrupt.

#### The cost of having bad code
TDD is very important to avoid problems with changes to one component reflecting negatively on other screens.

> Coffee Break ☕
Creating a virtual machine using PowerShell
Published: 2023-10-22 22:42:09

Go to your Azure Portal dashboard and click on the Cloud Shell icon. A coding environment will pop up below your screen. Select PowerShell and proceed to create your resource group and virtual machine.

Creating a resource group in powershell just requires this command;
`New-AzResourceGroup -Name "ugopowershell" -Location "East US"`

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

Creating a virtual machine in powershell requires this command;

```
New-AzVm `
-ResourceGroupName "[name of your choice]" `
-Name "[virtual machine name of your choice]" `
-Location "[location of choice]" `
-VirtualNetworkName "myVnetPS" `
-SubnetName "mySubnetPS" `
-SecurityGroupName "myNSGPS" `
-PublicIpAddressName "myPublicIpPS"

```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hw0v5mc39pu5j8m1h0zk.png)
Tailwind CSS Linear Gradient Utility Tool
Tags: tailwindcss, css, codepen, webdev
Published: 2023-10-22 22:31:51

While styling a web app that uses Tailwind CSS, it was becoming tedious to setup linear gradients for buttons and backgrounds.

While sites like [hypercolor.dev](https://hypercolor.dev/) can show you some good gradient combinations to use, I wanted to be able to experiment with different combinations by selecting the colors from a palette.

So with the help of OpenAI's ChatGPT (GPT-4), I created a utility tool that lets you select the start and end colors and the direction of the gradient. There's a convenient "copy to clipboard" button too.
https://codepen.io/rudolfolah/full/xxMxabo


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rze1iuwslvp9p7g0ows1.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ieq1b8qhe1133qj7ppyz.png)
NeobrutalismCSS - A Classless CSS Library
Tags: opensource, css, sass, frontend
Published: 2023-10-22 22:29:08

Are you tired of adding bulky CSS frameworks like Bootstrap or Tailwind CSS to your JavaScript or React demos just to make your HTML elements look good? Introducing NeobrutalismCSS – a lightweight and classless CSS library that brings sleek default styles to your HTML elements, without the unnecessary bloat.

[View Demo](https://matifandy8.github.io/NeoBrutalismCSS/) | [GitHub Repository](https://github.com/matifandy8/NeoBrutalismCSS)


Notably, NeobrutalismCSS isn't meant to be a standalone CSS library only. It can seamlessly integrate with other CSS frameworks. This means you can harness the power of NeobrutalismCSS as the foundation for your site and still use your preferred CSS framework in harmony.

Less Opinionated: We offer a cleaner canvas for your styling needs, allowing your creativity to flourish without rigid constraints.

Versatile: Whether you're building a website, a blog, or enhancing an existing CSS framework, NeobrutalismCSS fits like a glove.

Aesthetically Pleasing: We've focused on delivering visually appealing styles that delight the eye.

Extensive HTML Element Support: NeobrutalismCSS is equipped to handle a wide range of HTML elements.

Responsive: Our styles maintain consistency across different browsers, ensuring a seamless user experience.

How to Use NeobrutalismCSS
Using NeobrutalismCSS is a breeze. Simply add the following line to your HTML document:
`<link rel="stylesheet" href="https://unpkg.com/neobrutalism.css">
`
If you're developing a JavaScript application, NeobrutalismCSS can be installed via NPM:

`npm install neobrutalismcss`

For more details about the library, visit our GitHub repository. If you find NeobrutalismCSS useful, don't forget to give it a star!
Convert Flac to Apple Lossless With FFmpeg
Tags: music, apple
Published: 2023-10-22 22:31:31

---
title: Convert Flac to Apple Lossless With FFmpeg
published: true
date: 2023-10-22 22:17:02 UTC
tags: music,apple
canonical_url: https://akrisanov.com/convert-flac-to-apple-lossless-with-ffmpeg/
---

I'm a longtime Apple Music user. Most of my so-called music collection is on the streaming service. However, I occasionally buy rare or remastered releases ripped from CDs. These releases are usually in the FLAC format, which Apple Music doesn't support. But I've found an easy workaround that allows me to organize and play albums on the go.

The centerpiece of the workaround is FFmpeg. So if you don't already have it installed, it's worth installing now:

```shell
brew install ffmpeg
```

_Homebrew Formula_

When the tool is ready to use, navigate to the folder containing the FLAC files and run the following script:

```bash
for file in *.flac; do ffmpeg -i "$file" -acodec alac -vcodec copy "`basename "$file" .flac`.m4a"; done; mkdir flac; mkdir alac; for file in *.flac; do mv "$file" "flac/"; done; for file in *.m4a; do mv "$file" "alac/"; done;
```

_Silly One-liner Converting FLAC to ALAC_

![](https://akrisanov.com/content/images/2023/10/Screenshot-2023-10-22-at-18.26.25.png)
_Susumu Hirasawa – Siren [Limited Edition]_

The bash script converts the audio to the Apple Lossless format (`*.m4a`) and moves the files to the `alac` directory:

![](https://akrisanov.com/content/images/2023/10/Screenshot-2023-10-22-at-18.27.10.png)

Finally, the `alac` directory can be dragged to Apple Music to import the album and upload its tracks to the cloud.

![](https://akrisanov.com/content/images/2023/10/Screenshot-2023-10-22-at-18.27.41.png)
_The Uploaded Album_

---

👉 You probably wonder why this album has no Lossless icon in Apple Music. Well, it turns out the audio quality of the FLAC files wasn't on pair with lossless. So, make sure releases you buy or rip, have a proper audio codec and quality.
Creating a virtual machine using CLI (Bash)
Published: 2023-10-22 21:42:46

Go to your Azure Portal dashboard and click on the Cloud Shell icon. A coding environment will pop up below your screen. Select Bash and proceed to create your resource group and virtual machine. 

Creating a resource group in bash just requires this command;
`az group create --name [the name that you want to use] --location [the location that you want to use]`

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

Creating a virtual machine in bash requires this command;

```
az vm create \
--resource-group [resource group name] \
--name [name of your virtual machine] \
--image Ubuntu2204 \
--generate-ssh-keys
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bvjl5qwg6lzil3uoz1cs.png)
A new Hacktoberfest PR
Published: 2023-10-22 21:37:50


In the middle of October, I finally did my second pull request for Hacktoberfest. It was a small project, but it was something I was looking for as a step up in difficulty from my last pull request.

For my second pull request, I worked on the Screenbows at [repository](https://github.com/manancodes/Screenbows) to address issue [15](https://github.com/manancodes/Screenbows/issues/15). This issue involved creating a random CSS pattern when a button is pressed.

You can find my PR [here](https://github.com/manancodes/Screenbows/pull/31)

To complete this task, I initially reviewed the project's files to understand its functionality. Then, I implemented a simple function that selects patterns from a list and applies them. This video [tutorial](https://www.youtube.com/watch?v=mXrBC_mZfTw&t) was incredibly helpful during my work.

I must admit that it can be challenging to find repositories to work on. It took me until the middle of October to discover my second pull request. However, I'm already working on my third pull request, which I will post about soon.
Glimmer DSL for LibUI Scaffolding + Snake Game
Tags: ruby, desktop, gui, gamedev
Published: 2023-10-22 21:33:29

[Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui) (Prerequisite-Free Ruby Desktop Development Cross-Platform Native GUI Library) versions 0.9.x include support for a new [Glimmer Command](https://github.com/AndyObtiva/glimmer-dsl-libui#glimmer-command), [Application Scaffolding](https://github.com/AndyObtiva/glimmer-dsl-libui#scaffold-application), Custom Component Scaffolding, Custom Component Gem Scaffolding, and more. These features greatly improve Software Engineering Productivity when building desktop applications with Glimmer DSL for LibUI. Glimmer Scaffolding could be thought of as the "Desktop Application" equivalent of Rails Scaffolding and Generators.

Application Scaffolding enables automatically generating the directories/files of a new desktop GUI application that follows the MVC architecture and can be packaged as a Ruby gem that includes a binary script for running the app conveniently.

In fact, I ate my own dog food and used the new Application Scaffolding feature to effortlessly scaffold a Glimmer Snake game (code is included near the bottom of this post):

https://github.com/AndyObtiva/glimmer_snake

![glimmer snake](https://github.com/AndyObtiva/glimmer_snake/raw/master/screenshots/glimmer-dsl-libui-mac-snake.gif)

This is the gemified app edition of the [Snake game example](https://github.com/AndyObtiva/glimmer-dsl-libui/blob/master/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md#snake) that is included in [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui).

Learn more at this blog post (and at the [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer_snake) project and [Glimmer Snake](https://github.com/AndyObtiva/glimmer_snake) game pages):
https://andymaleh.blogspot.com/2023/10/glimmer-dsl-for-libui-scaffolding-snake.html

Happy [Glimmering](https://github.com/AndyObtiva/glimmer_snake)!
Throttling Rails logins with Rack Attack
Tags: rails, security
Published: 2023-10-22 21:28:22

I will show you how to rate-limit your authentication endpoints with **Rack Attack**.

**Rack::Attack** is a middleware for blocking or throttling requests based on rules. It uses the configured cache store of Rails to store the necessary data, but a separate data store can be configured too.

In the examples, I will use **Devise**'s endpoints, but the same setup works with any authentication system, you just need to change the URLs.

Setting up **Rack::Attack** is very simple, you need to add the gem to your project with `bundle add rack-attack`.

Once we have the gem installed, we can add our configuration to an initializer, I use `config/initializers/rack_attack.rb` for that.

To prevent credential stuffing attacks on the login endpoint, you can throttle requests by IP address to a 15 attempts per minute:

```ruby
class Rack::Attack
  throttle('logins/ip', limit: 15, period: 1.minute) do |req|
    if req.path == '/users/sign_in' && req.post?
      req.ip
    end
  end
end
```

The `throttle` call expects the name for the rule and the options as parameters. In the above example, we limit post requests to the `/users/sign_in` path to 15 per minute for the IP address.

We can harden the configuration even more and add another rule to throttle requests with the same email address:

```ruby
throttle('logins/email', limit: 10, period: 1.minutes) do |req|
  if req.path == '/users/sign_in' && req.post?
    req.params['user']['email'].to_s.downcase.gsub(/\s+/, "").presence
  end
end
```

The above rule will throttle login attempts with the same email address to 10 per every minute. This rule prevents brute force attacks.

These two rules will significantly improve the security posture of your Rails app, but depending on your needs, you can introduce additional throttling easily with **Rack Attack**.
Unlock AVX-512 on i5-12600
Tags: intel, avx512, discuss, tutorial
Published: 2023-10-22 21:16:37


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

It is possible to unlock AVX-512 on B660M bios.

At first I climbed to the forum where the bios is picking, I found that someone found something, and, by its naivety, I was going to setup BIOS with the AVX2 turned on and turned off, then compare, find the right byte and change ... I, of course , I didn’t find it, but I found the one who sent me a non -public version of F4 - thanks, - a link in the comment. They fixed the problems of productivity Non -K, but did not turn off the AVX512 - probably because it was removed from the site. Nevertheless, it was updated - and AVX -512 returned already in normal form. With a stress test from the CPU-Z, the frequencies that were scared before, did not notice.

It took time to rewrite the histogram from AVX2 on AVX512, and, I understood the complaints about the difficulty- part of the instructions that were on AVX2 could not be found, and I had to rewrite it differently.

In my case, AVX512 gave an increase of 25%. It was 8.21MS, it became 6.15MS. Not much, but not a few.

Conclusion: CPU 1/2 step closer to the GPU in vectorization, you can use it, and why it was blocked is not very clear.
Linux User living in Latin America? Install this Command-Line translator!
Tags: beginners, tutorial, opensource, spanish
Published: 2023-10-22 20:54:27

Wow, my brain is totally blown today!  Currently, I am living in Latin America as a digital nomad, and discovered an amazing command line translator for Linux!

```bash
sudo apt-get install translate-shell
```

Next edit your ~/.zsrc or ~/.bashrc
and add the following environmental vars

```bash
export SOURCE_LANG=en
export TARGET_LANG=es
```

now apply changes
```bash
source ~/.zshrc
```

Now you can translate!
```bash
trans bueno
```
(Use -I for interactive mode)

Get more help here:
```bash
man trans
```

{% embed https://www.youtube.com/watch?v=cgzCJINeWI8  %}
How to deploy to GitHub Pages using gh-pages package
Published: 2023-10-22 20:35:37

1) First setup GitHub Pages on the GitHub [quickstart](https://docs.github.com/en/pages/quickstart)
2) Install [gh-pages](https://www.npmjs.com/package/gh-pages) package. It can be installed to devDependencies.
NPM
```
npm i gh-pages
```
Yarn

```
yarn add --dev gh-pages
```
3) Add the following line to your scripts in package.json assuming your application is build to dist/spa directory.

![dist/spa directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zs5jv8a36o8d6643jeon.png)
```json
"deploy": "gh-pages -d dist/spa"

```
E.g.
```json
"scripts": {
    "lint": "eslint --ext .js,.vue ./",
    "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
    "test": "echo \"No test specified\" && exit 0",
    "build": "quasar build",
    "deploy": "gh-pages -d dist/spa",
    "postinstall": "patch-package"
  },
```
4) Build your app. In my example to do that I use the following command

```
yarn build
```
5) Deploy app to GitHub pages:

```
yarn deploy
```