teleren/devto huggingface dataset:
Desktop organization with Python
Tags: python, productivity, showdev, tutorial
Published: 2020-09-29 08:28:16

Today I will show you how to build a simple desktop organization script using the watchdog module, which observes the Desktop for any changes. 
The basic idea is when you put a file on a desktop it will automatically be deleted and moved to a given folder. 

```sh
import watchdog.events
import watchdog.observers
import shutil

class Handler(watchdog.events.PatternMatchingEventHandler):
    def __init__(self):
        watchdog.events.PatternMatchingEventHandler.__init__(self, patterns=['*.txt', '*.png', '*.jpg'], ignore_patterns = None,
                                                     ignore_directories = False, case_sensitive = True)

    def on_created(self, event):
        print(f"Created at {event.src_path}")
        if event.src_path.endswith('.txt'): 
            shutil.move(event.src_path, r'C:\Users\Stokry\Desktop\Text_Documents')          
        elif event.src_path.endswith('.png') or event.src_path.endswith('.jpg'): 
            shutil.move(event.src_path, r'C:\Users\Stokry\Desktop\Image_docs')              
    def on_deleted(self, event):
        print(f"Deleted at {event.src_path}")

event_handler = Handler()
observer = watchdog.observers.Observer()
observer.schedule(event_handler, r'C:\Users\Stokry\Desktop', recursive = False)
observer.start()
observer.join()

```
This is a very simple way to do it,  you can build a more complex script.
Variable Naming Conventions
Tags: variables, naming, beginners, codenewbie
Published: 2020-09-29 08:22:49

# Which variable naming convention do you prefer ?

There are various variable naming conventions in use. Some programming languages, libraries, frameworks definitely set a standard and make you get used to that certain one. Others just advise you or give you a choice in terms of convention over configuration. And in some of them you are free to use any of them.
So just to look through them and remember some older conventions, take a look at the list below.

* **twowords** (flat case)
* **TWOWORDS** (upper flat case)
* **twoWords** (lower camelCase)
* **TwoWords** (upper CamelCase, sometimes PascalCase - coming from Pascal PL)
* **two_words** (snake_case)
* **TWO_WORDS** (SCREAMING SNAKE_CASE, CONSTANT_CASE - as all uppercase is mostly used for constants)
* **Two_Words** (Camel_Snake_Case)
* **two-words** (kebab-case, dash-case, lisp-case: coming from Lisp PL)
* **TWO-WORDS** (TRAIN-CASE, SCREAMING-KEBAB-CASE)
* **Two-Words** (Train-Case)



    
There might be other variable naming conventions, but these are mostly known ones around developer community. 
There are some other additions that might be useful, like adding extra info in the variable name, like type of the data to be stored in variable. This is less common nowadays because modern programming languages seem to be less strict to type of the variable. Anyway, in those old days, when it was a must for any variable to have certain data type, they looked like this :


```
// an integer type variable
var iAge;

// a character
var cLetter;

// a float type variable
var fWeight;
```


This is an example from Pascal programming language. Anyway, it was a good tip to use, as it was possible to immediately see the data type to be stored in that exact variable.

## Conclusion

Looking at the list above, I can conclude that mostly used variable naming conventions are "camel case" and "snake case" in many of their variations. 
So are you sticking to certain ones or do you change it according to the tools (programming language, library, framework) you use ?
What is your preferred variable naming convention ?
“Why I decided to study Software Engineering?”
Tags: firstyearincode
Published: 2020-09-28 17:39:03

2020 has been a year for the record books! Partly due for a few unfortunate circumstances: Kobe Bryant's death, Coronavirus, BLM, Chadwick Boseman's death and a crazy election cycle. Despite the negativity in the world, this year has also birthed some positivity in my life...

Prior to the pandemic, I spent 15 years building my Hospitality and Tourism career and with several jobs including my recent Director of Events role. All that growth came to a complete halt in March when my company furloughed all of it's employees. Like many people who were on lockdown, I spent the next two weeks binging Netflix, doing social media challenges, attending virtual happy hours and falling into the dark tunnel world of Tik-Tok! 

In April, I quickly accepted the reality that my industry was not going to bounce back from this pandemic as quickly as I had originally anticipated. Therefore, I began mapping out a  career shift for my peace of mind and future financial stability. I quickly turned to the world of tech, which was my second love behind planning events and curating memorable experiences for people. I reached out to a few friends who were in the industry and they recommended that I look into coding schools. I took their advice and immediately started doing my research.

After countless interviews, conversations, and basic coding prep courses, I was sold on the idea of switching careers to software engineering. I finally settled on Flatiron School for a plethora of reasons, specifically the community that they fostered, which would make diving in the sea of the unknown, more bearable!

I haven't really declared which route I would go with software engineering but I plan on letting my experience learning to navigate which type of developer I become. 

Pssst... I think I'll like front-end development more but stay tuned to see if this remains true in the end.

- - - Jcode out!
What are the 3 approaches of digital transformation?
Tags: digitaltransformation
Published: 2020-09-29 08:21:01

The initial phase in understanding which zones will be affected and what the impacts of digital transformation on your business will be is to comprehend on what premise this progresses the manner in which you maintain the business and communicate with your crowd, your colleagues, and accomplices. 

3 Approaches to Digital Transformation

1-Customer Experience Digital Transformation 

A model that has just become exemplary is the client who addresses the dealer inside a physical store in the event that he can limit certain products on the grounds that the client has recently observed on the web that the contending store sells the items less expensive. 

Get articles like this in your email 

Join 

In this way, deals channels, approaches to promote items or benefits and draw in and connect with purchasers, purposes of contact, language and even costs and item and administration ascribes are influenced by digital transformation, as people in general, progressively, becomes drenched in the virtual universe and feeling glad within it. 

2-Operational Process Transformation 

This is another point that many overlooks. <a href="https://www.testingxperts.com/blog/digital-transformation">Digital transformation</a> isn't just about giving a superior client experience through virtual shopping channels and dexterous client care, incorporated with informal communities. 

Cycle demonstrating ought to have the option to convey expanding an incentive at each phase of the chain, and this can be accomplished through a superior progression of data, cooperation, and collaboration, components in which computerized change can aid an exceptionally pragmatic and emphatic way. 

3-Business Model Transformation 

The entirety of the two columns above may assist with being mindful to the plan of action change, not just in the feeling of changing the very manner by which your association creates and conveys an incentive to the market yet in addition to what the opposition can do in that sense, utilizing advanced change for this. 

An entire vehicle GPS industry was essentially destroyed with Waze, and the accommodation and metropolitan vehicle segments were firmly shaken by activities, for example, Airbnb and Uber. 

Your organization may even need to create "problematic development", however, furthermore, it must be mindful of the means of rivalry, predominantly circuitous, and guard itself against dangers.
How do I fix a Django sitemap HTTP error 500 on Heroku?
Tags: django, python, beginners, question
Published: 2020-09-29 08:16:22

I'm using django sitemap to generate my sitemap.

In local it works normally, I can visit 127.0.0.1:8000/sitemap.xml and see the data. But in production, I got http error 500 (site matching query not exist) when trying to access "domain.com/sitemap.xml". I've been following solutions on the internet, and one of those is from this link

https://dev.to/radualexandrub/how-to-add-sitemap-xml-to-your-django-blog-and-make-it-work-on-heroku-4o11

https://stackoverflow.com/questions/53262018/django-sitemap-xml-throwing-server-error-500-in-production/53265609

But I'm still getting the error. I followed these tutorials exactly, but the error still occured.

https://jawaban.online/scope/outlink/6442/django-sitemap-tutorial-help-crawlers-understand-your-website-2018-youtube/

https://jawaban.online/scope/outlink/17698/how-to-create-a-sitemap-in-django/

https://jawaban.online/scope/outlink/2757/how-to-create-a-django-sitemap-sitemap-one-of-the-most-important-seo-by-erdi-mollahuseyinoglu-analytics-vidhya-medium/


Please kindly help. Thanks
React Wire basic concepts
Tags: react, typescript, reactwire, webdev
Published: 2020-09-29 08:13:49

---
series: React Wire
---

In this post, we will cover the `@forminator/react-wire` basic concepts.

# Wire

A wire is an object that contained a value inside it.

# Create a new wire

The `userWire` hook, returns a new wire.

```tsx
const wire = useWire(null, initialValue)
```
Or you can connect the wire to another wire, called an up-link wire. The value of both wires will be synced all the time.

```tsx
const wire = useWire(anotherWire)
```


# Reading the wire value

The `useWireValue` returns the current value of the wire, and rerender component when the wire value changed.

```tsx
const value = useWireValue(wire)
```

# Changing wire value

The `useWireState` returns `value` and `setValue`. exactly same as default `useState`.

```tsx
const [value, setValue] = useWireState(null, initialValue)
```

You can also pass a wire to the first argument, and the returned value will be synced with the wire.

```tsx
const [value, setValue] = useWireState(wire, initialValue)
```
Yarn 🎊 Hacktoberfest 
Tags: hacktoberfest, node, webdev, npm
Published: 2020-09-28 11:36:40

As you may know, every October the dev community at large starts an event called [Hacktoberfest](https://hacktoberfest.digitalocean.com/). The idea is simple: a whole month specially designed to help onboard people with little to no prior experience contributing to open-source codebases. In return, you get t-shirts, a valuable experience, and maybe will find a community you'll want to be a part of. Win-win!

October is almost there, so it's a good time to think: what are some interesting tasks you could tackle? Not too hard but still impactful? I happen to lead the work on [Yarn](https://yarnpkg.com/), the famous JavaScript package manager, and I can tell you: **we have a bit of everything!** Whether you prefer frontend work or brain teasers, I'm sure we'll find you great project to hone your skills 😃

I've listed some tasks I have in mind, but please feel free to join our little community on [Discord](https://discord.com/invite/yarnpkg)! My fellow maintainers and me will be happy to give you more pointers, ideas, help, and feedback. Until then, happy Hacktoberfest! 🚀

---

- **If you're fluent in React**, we're looking to revamp the [package search interface](https://yarnpkg.com/?q=react&p=1) on our website. We're displaying a lot of information, and we'd like to highlight the most important ones in as few clicks as possible.

---

- **If you're a great technical writer**, we could really use your help refining our documentation. We're often not native english speakers, and I personally make typos, grammatical errors, or sometimes even forget words in the of my sentences.

---

- **If you'd like working on the CLI**, we have various tasks tagged [Good First Issue](https://github.com/yarnpkg/berry/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) that we've identified as being useful without requiring more than a minimal amount of context.

---

- **If you want to take a look at the infra side**, talk with us! There are various places where we'd benefit from better typings, automated workflows, extra tests, or many other small things that let us focus on designing new features.
Why is Integer i=5 valid statement in Java?
Tags: java, tutorial
Published: 2020-09-29 08:06:09

This question came out when I was teaching some Java basics to my friend. 
In Java you have `int` and `Integer`. `Integer` is a wrapper class for `int` so logically you would need to create a new `Integer` like this.
```java
Integer i = new Integer(5);
``` 
You can definitely do this, and it’s completely valid. 
But you can do `Integer i=5;` as well. 
Thanks to something called autoboxing. 

[Boxing]( https://en.wikipedia.org/wiki/Object_type_%28object-oriented_programming%29#Boxing) is the process of wrapping a primitive value as an object of a class of the equivalent type.
[Unboxing]( https://en.wikipedia.org/wiki/Object_type_%28object-oriented_programming%29#Unboxing) refers to the opposite direction, going from object to primitive.

So what is happening in the background. `5` is parsed like `int` by a compiler. Compiler notices that you want to have instance of wrapper class `Integer` so it autoboxes the value into the instance of `Integer`. This is happening in the background, no action needed. 

Autoboxing lets us write nicer code. The following table shows the primitive types and their corresponding wrapper classes.

| Primitive type | Wrapper class |
| -------------  |:-------------:|
| boolean        | Boolean       |
| byte           | Byte          |
| char           | Character     |
| float          | Float         |
| int            | Integer       |
| long           | Long          |
| short          | Short         |
| double         | Double        |
🤦‍♂️ Weekly fail (40/2020)
Tags: fail, lessonslearned, github, issue
Published: 2020-09-29 08:05:53

Last few weeks I've been working on converting a [Gatsby Lumen](https://www.gatsbyjs.com/starters/alxshelepenok/gatsby-starter-lumen) sample site to [Gridsome](https://gridsome.org/) during live [YouTube streams](https://www.youtube.com/watch?v=M178GCJnvKs&list=PLZzkyDUUmn_J_9jLG120URla14RDNQYjO&index=7). I stumbled upon a problem when resolving rich text data and images. The images were just not showing up.

So I used one of my *innovation* days to try and debug the Gridsome source plugin for Kontent. I succeeded in finding the issue! This made me so happy that I immediately wanted to add it as an issue to the plugin repository. So I opened the [plugin repository](https://github.com/CMeeg/gridsome-source-kentico-kontent) on GitHub only to find out someone has [already done that](https://github.com/CMeeg/gridsome-source-kentico-kontent/issues/15) half a year ago. 🤦‍♂️

*Lesson learned:* **Always check Issues on GitHub before debugging.**

But I didn't let this fail win. I went ahead and posted a [pull request](https://github.com/CMeeg/gridsome-source-kentico-kontent/pull/19) with a workaround! 💪
If you are looking for a custom mobile app in healthcare, fitness & pharma domain - LETS TALK!!
Published: 2020-09-29 08:01:20

PROVAB is a leading healthcare app development company, delivering best in class mHealth platform and mobile apps to healthcare companies, hospitals, pharma companies. Custom app development in healthcare domain may include the features and attributes that help patients to regulate and monitor their blood sugar, heart rate and other important parameters. Some of them come with life-saving information that help patients to monitor their drug and medicine intake and notify them when it’s time to take medicines and keep tabs on their regimen and daily schedule.

Visit Website: https://www.provab.com/healthcare-app-development.html

With the help of a healthcare mobile app, one can access crucial and important information anytime and from anywhere and the healthcare sector is no different. Access to information is more important in this sector than in other sectors since critical decisions have to be taken based on the information and data. Mobile apps in the healthcare sector capture all kinds of information from patient and staff related information to patient scheduling and tracking information.
Simple ER Diagram with Qt & QML
Tags: qt, qml, erdiagram, entityrelationship
Published: 2020-09-29 07:57:43

Please [**download the Source Code**](https://github.com/chilarai/er-diagram-qt) of the application to continue further

In this blog, I am going to briefly write the steps to generate a basic ER diagram using Qt & QML. You can use the same logic to create your own ER diagram.

# Objectives
1. Generate the rectangle entities dynamically and connect the last created rectangle to the previous rectangle.

2. On deleting a rectangle, delete all its child rectangle entities and relations

3. On dragging a rectangle, the coordinates of front and back connecting lines should be updated


# Steps to achieve the objectives

We will create 3 separate subcomponents for a **RectangleEntity**, **LineEntity**, and a **DeleteEntity** which will be called dynamically whenever a new entity creation command is applied. Apart from that, a **Button** component is called to fire the entity creation signal from the main file

1. To create a new entity dynamically, we need to use `Qt.createComponent()` and `createObject()`.

2. Save the dynamically generated component instances inside separate `Map()` to be accessed later

3. Lines can be created using `QtQuick.Shapes` (canvas is not required). Bind one ends of a connecting line to the front and back coordinates of two nearby rectangles so that whenever a rectangle is moved, the coordinates of the line are updated as well.

4. Bind the coordinates of the delete button to the left top of each rectangle

5. To move a rectangle, use `drag.target: entityRectangle` inside the MouseArea

6. Lastly, when a rectangle entity coordinates are updated, fire a signal to update the new location of the rectangle using QML signals and slots
My Top 3 Uses for "Docker Info"
Tags: productivity, docker, discuss, codenewbie
Published: 2020-09-29 07:27:53

The very first day I started using Docker I used `docker info` to verify the server was installed correctly on my Mac, **and never used it again!** 😅

But sometimes it's good to have this simple command in your toolbox to get information quickly. Here are my top 3 uses for `docker info`:

### 1. To verify "if" and "which" docker engine is running
It's obvious, I know, but `docker info` can tell you in the simplest way **that the Docker daemon is alive and kicking** and that its API is responding correctly.

It's also a quick way to check **what Docker version you're running on**

```bash
❯ docker info | head
Client:
 Debug Mode: false

Server:
 Containers: 29
  Running: 22
  Paused: 0
  Stopped: 7
 Images: 58
 Server Version: 19.03.12
```

### 2. System resources limit: CPU & Memory
_Are your containers running slowly or not starting at all?_ Check **if your Docker daemon is running with CPU or Memory limits!**

```bash
❯ docker info | grep -e CPU -e Memory
 CPUs: 2
 Total Memory: 1.945GiB
```


### 3. Check engine's proxy settings
If you run Docker in a corporate network, is very common that you need to connect to the internet via a proxy server. If you get connection timeouts it's likely that you don't have the right settings.

```bash
❯ docker info | grep -e Proxy
 HTTP Proxy: http://proxy.mycompany.com:3128
 HTTPS Proxy: http://proxy.mycompany.com:3128
 No Proxy: localhost,127.0.0.1
```

## Did you know...
you can print the full list of information in JSON format with this command?

```bash
# Using "| jq" to prettify the json output, though not mandatory
❯ docker info -f '{{json .}}' | jq
```

### Do you use `docker info` often?
Tell me how in the comments!

Don't forget to follow me if you want to see more content like this!

- [YouTube](https://bit.ly/3hTkyWU) 🎬
- [Twitter](https://twitter.com/castellinmanuel)
- [LinkedIn](https://www.linkedin.com/in/castellinmanuel/)
🤔 My repo is valid for Hacktoberfest?
Tags: hacktoberfest, angular, github, opensource
Published: 2020-09-29 07:37:31

Hello, everybody!

I'm new in the world of events 😀 and I'm seeing that very soon there is the Hacktoberfest event where OpenSource participation is encouraged. I'm very excited to participate in open source projects or create those I can to improve the community. I currently have some projects that have been useful to a part of the community and I would like to know if these projects are valid for the Hacktoberfest.

My repos:
https://github.com/leifermendez/ngx-copilot
https://github.com/leifermendez/swipe-angular-list
https://github.com/leifermendez/twitch-login-sdk
7 Javascript Tips and Tricks
Tags: javascript, webdev
Published: 2020-09-26 09:27:16

# Filter Unique Values
The **Set** object type was introduced in ES6, and along with (...), the **spread operator**, we can use it to create a new array with only the unique values.

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

# Every and Some 
The **every** function returns a boolean. If all elements in the array pass the test, true will be returned. The some function tests whether at least one element in the array passes the test implemented.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6yfmu2rc3u3xblgd71l2.JPG)

# Convert to Boolean
Besides the regular **boolean** values true and false, Javascript also treats all other values as either 'truthy' or 'falsy'.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5j89f1m4ci9gqbcxx358.JPG)

# Convert to String 
The quickly convert a number to a string, we can use the concatenation operator + followed by an empty set of quatation marks.

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

# Convert to Number 
The opposite can be quickly achieved using the **addition operator +**

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

# Quick Float to Integer
if you want to convert a float to an integer, you can use **Math.floor(), Math.ceil(), or Math.round()**. But there is also faster way to truncate a float to an integer using **|**, the bitwise OR operator.

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

# Format JSON Code
the **stringify()** method takes two optional parameters: a replacer function, which you can use to filter the JSON that is displayed, and a space value.
The space value takes an interger for the number of spaces you want or a string (such as '\t' to insert tabs), and it can make it a lot easier to read fetched JSON data.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1d33q6e7iiqfv08rzwc2.JPG)

Happy Coding!