teleren/devto huggingface dataset:
My Experiences In Professional Python
Tags: python
Published: 2020-01-31 23:14:31

Ah, Python. What a great language! I use it for number crunching and related data tasks professionally, as an easier to use (and often faster) alternative to VBA. To prove it, at least for my use cases, some stats are in order...

First, a dashboard that I used to run monthly until the data source vanished took 2.5 days to run by hand. It was slow and productivity-sucking, so I automated it in VBA. This reduced the run time to 14 hours - better, but still slow. So I rewrote things again in Python. The run time now? 10 minutes! Talk about time saved...

Secondly, another one of my more popular reports, analyzing usage of the various PDF publications we produce - originally, the controller script for this was in VBA, and it was SLOW, taking almost 3 days to run! Like the last one, it was rewritten in Python - however, one part of the processing step has ideal parallelism: I have to process a bunch of independent rows of data the same way, making it a perfect task to divide up among CPU cores with the `multiprocessing` module. After additional tweaks and optimizations, the typical run time is just a smidge under 4 minutes; a fast-path, where the results of some of the processing can be loaded from a saved file, takes as little as 13 seconds!

Finally, my most recent Python thing I have been doing is generating an HTML to-do list, so I can open it up in a browser and see, at a glance, what I have on my plate. This had a short-lived VBA version too - but performance wasn't the driving factor behind a rewrite. Rather, it was VBA lacking robust HTML and regular expression support. Later additions defined the structure of the data files used in object form, which enables both strict error checking and MUCH better error reporting. One of the data files is a CSV, which I update by hand, so it's easy to make errors like forgetting a comma or not quoting text with commas embedded in it. The script will detect these problems and tell you not only where it stopped parsing, but also what error it found. Examples of error messages:

* File 'data.csv', line 2, item 4: '2020-1-09' is not a valid ISO date!
* File 'data.csv', line 34: Found 21 items, expected 23!
* File 'data.csv', line 5, item 13: 'Highets' is not a valid priority!

This makes fixing the error easy, as I know exactly where to look. Contrast with the Python runtime's much less helpful errors:

* ValueError: '2020-1-09' could not be parsed as datetime
* TypeError: 'Highest' not valid for int() in base 10
* No error.

As for future work, I am looking into scientific Python libraries to further accelerate the heavy-duty data lifting work I do, in particular with the publication usage report, which has to ingest over 100 GB of raw data, and merge it with data from a second source to produce the final result. To some extent these can run concurrently, but they are still slow put together. Shame I can't speed up downloading the data files.

Oh, and a shout-out to @ronsoak for inspiring me to write this!
Pure Css Phenakistoscope Animation
Tags: css, animation, html
Published: 2020-01-31 22:58:18

---
title: Pure Css Phenakistoscope Animation
published: true
description: 
tags: #css #animation #html
---

Hello!
Checkout my most recent codepen, a Phenakistoscope with pure CSS!

The Phenakistoscope was the first widespread animation device that created a fluid illusion of motion.

<img src='https://dev-to-uploads.s3.amazonaws.com/i/vi1ms1c93q6djlb52w81.gif'>


{% codepen https://codepen.io/Pixmy/pen/gObNEgX %}
Statements in  C++
Published: 2020-01-31 21:59:32


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/26vsnw2nw4o4wmjwwt3o.png)


What is C++? C++ is an object-oriented programming language. It is an extension of the C programming language. The C programming language was built primarily as a system programming language. Over time people build an extension to the C programming language like C++. C++ is a great programming language for situations in high performance and precise control over memory. You can build different types of applications in C++. The different types of applications are video games, real-time systems such as manufacturing or transportation, high-performance trading application, and productively/office applications. Next step in the article, I would talk about some of the basics of C++ such as making statements. 

In C++, they have different types of statements. C++ have Declaration statements, jump statement, expression statement, component statements, selectional statements, iterations statements, and Try blocks. I know that's a lot of different statements. I'm only going to go over expression statements, selection statements, and Iteration statements. 

What are expression statements in C++? Before I answer that, let's review statements in C++. A statement is a block of code that does something. Most statements in C++ are mostly assignments or functional calls.

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

When this code runs in the console, it prints 'I like to code'. The previous code snippet is a function call which means its an expression.
Next, I will talk about compound statements. 
Compound statements or blocks are sequences of statements enclosed by curly braces. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/09vfyqfi1r24jfsnap4f.png)

Iteration statements are repeated statements that execute so code. Some iterations statements are for loops, do-while loops, and while loops.
 While loops: 
 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gyz8a3bqh9luvciyr783.png)

for loop: 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4s0fxyv8mqo16vvlwylc.png)

do-while loop:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/p5ik9hh1h1pgtez0726f.png)

C++ is an object-oriented programming language that is a populator. I'm still learning more about C++. I just briefly went over the statements in C++. It's a lot of documentation on C++ so I encourage you to learn more about it. If you want to build video games or real-time fast applications, C++ is a great programming language to use to build out those applications.
Now hiring Software Developers - C++ & Qt
Tags: hiring
Published: 2020-01-31 20:36:56

<strong>If you are interested, please <a href="https://www.stoutsystems.com/job/2996">apply on our website</a>.</strong>

ABOUT US
Stout Systems is the software consulting and staffing company Fueled by the Most Powerful Technology Available: Human Intelligence. Our company was founded in 1993 and is based in Ann Arbor, Michigan. Stout provides expert level custom software development, technical staffing services and direct-hire technical recruiting services. 

THE JOB 
We are searching for several Software Developers to join our client's embedded automotive software team.

This role is open to strong C++ developers with at least two years' professional C++ programming experience and some commercial experience with Qt.

LOCATION
Farmington Hills, MI (remote not available at the moment)

COMPENSATION
Up to $110K commensurate with skills and experience

Note that in some cases our client prefers to engage candidates in a six-month contract-to-hire. If that were to be the case, you would initially be an employee of Stout Systems working on assignment with our client. During the contracting portion of the assignment you would be eligible for Stout Systems' benefits. Upon completion of the contract phase, you would convert to direct employment with our client.

EDUCATION
Bachelor or Master's degree in Computer Science, Computer Engineering or equivalent degree preferred, but may not be required for highly experienced candidates.

OVERVIEW
You will part of a team working on developing business logic and HMI software for automotive infotainment systems.

REQUIRED
Excellent knowledge of C++ and the ability to demonstrate it.
Experience with Qt in an embedded automotive environment. For the right candidate, Qt experience in a comparable environment would be acceptable.

PREFERRED
Experience with QNX.
Understanding of the V-model.
Familiarity with Scrum or Kanban or other agile methods.
Software integration and build management knowledge.
Ability to work well with a team.


APPLY 
<strong>If you are interested, please <a href="https://www.stoutsystems.com/job/2996">apply on our website</a>.</strong>



_Please feel free to leave questions in the comments section._
Angular 9|8|7 NgClass and NgStyle Tutorial with Examples
Tags: angular987, angular, ngclass, ngstyle
Published: 2020-01-31 21:53:55

---
title: Angular 9|8|7 NgClass and NgStyle Tutorial with Examples
published: true
description: NgClass and NgStyle in Angular 9/8/7 will be explored in detail in this article. As far as class manipulations in Angular are concerned, whether it is toggling, removing or adding, we have plenty of options before us.
tags: Angular 9|8|7 ,Angular ,NgClass, NgStyle
---
The post [Angular 9|8|7 NgClass and NgStyle Tutorial with Examples](https://www.positronx.io//angular-7-ngclass-and-ngstyle-explained/) appeared first on [positronX.io](https://www.positronx.io).

NgClass and NgStyle in Angular 9/8/7 will be explored in detail in this article. As far as class manipulations in Angular are concerned, whether it is toggling, removing or adding, we have plenty of options before us.
We will be able to bind a property to single classes. Alternatively, we can depend on the fantastic NgClass directive available in Angular.

Here in this article, we are going to take a closer look at class bindings. Moreover, we will be examining Angular 7 NgClass directive in detail. We will look into the best practice ideas and the syntaxes.


 [Click here to read more](https://www.positronx.io//angular-7-ngclass-and-ngstyle-explained/)
What's the future of the JAMstack?
Tags: jamstack, jamuary
Published: 2020-01-31 21:48:44

In the last 5 years since its inception, the JAMstack has grown from relative obscurity to a vibrant community of headless CMSes, pluggable APIs and SSGs. With such meteoric growth, also came the broadening of the JAMstack category. Today, the JAMstack is more than just some JavaScript, APIs and Markup served statically from a CDN. Single Page Applications (SPAs), serverless functions and even edge workers (arguably) are categorized (or at least self categorize) as “JAMstack” and have all furthered the confusion around an already elusive term. Though the growth of the JAMstack category has been fairly organic, it's success is due *in no small part* to significant advancements of the web as a platform. Modern CDNs for one are incredibly capable of handling complex business logic and operations (like redirects) that were once reserved to the origin server. The emergence of technologies such as edge workers, and functions at the edge have also made it easier to architect complex application and pushes the boundary of what's possible on the browser. With the JAMstack approaching maturity, these developments are only expected to continue and a JAMstack site today may very well not look anything like a JAMstack site of the future. Nevertheless, exciting times lie ahead for the JAMstack and we hope you'll join us on this journey to building scalably, securely and fast. 

This post marks the end of #JAMuary. Thank you to all readers and followers, until next year, spread the JAM.
You can publish docker images without running docker - here's how
Tags: docker, github
Published: 2020-01-31 21:37:49

Over the last past days I've published and used a couple docker images without starting docker on my local machine.

*This guide is aimed at people who are already familiar with writing Dockerfiles.*

To get started you need a docker hub account and a github account. You don't need git or docker installed on your machine.

## The Github Repo

Head over to Github and create a repository. The name and description don't need to follow any conventions. I name my repos which are used for docker hub something like "docker-my-image-name".

Once the repository is set up, create a new file. You can do this through your browser. Name it Dockerfile and add the content you want. As an example we'll create one to deploy applications with the serverless framework.

```
FROM node:lts-slim

RUN npm install -g serverless
```

![Github Repo](https://dev-to-uploads.s3.amazonaws.com/i/oocbzm77l1ivjcq76kzv.png)

The Dockerfile is all you need. Feel free to add a readme or license.


## The Docker Hub Build

Now log in to Docker Hub and create a new repository there. Give it a nice name and an informative description.

![Docker Description](https://dev-to-uploads.s3.amazonaws.com/i/qdbhyanazz6is2312oa8.png)

Scroll down a bit and connect to the Github repository you created earlier. You might have to grant Docker Hub read access to your account.

![Docker Build](https://dev-to-uploads.s3.amazonaws.com/i/y6wfrch9b2e77vrck2lz.png)

Once you filled out all the settings, assuming you saved the Dockerfile in your repository click on "Create & Build". Otherwise click on "Create" and then go save the Dockerfile.

![Docker Progress](https://dev-to-uploads.s3.amazonaws.com/i/fkrdmf0somqpr6c9uxkx.png)

Depending on how busy the free platform is, your job might be queued for more than ten minutes. A little bit later your docker image will start building.

If nothing went wrong, your image is now available with `docker pull yourname/yourimage:latest`.
How can I stop a PostgreSQL query automatically when the table is locked?
Tags: help, postgres, sql
Published: 2020-01-31 21:32:07

---
title: How can I stop a PostgreSQL query automatically when the table is locked?
published: true
tags: help, postgres, sql
---


I have a bash script that creates new partitions for the tables in the database. I'm currently having a problem with locked tables - when this script runs and tries to create partitions for a table that is being used otherwise, it gets stuck. All I need is to find a way to stop the script after a certain amount of time when the table is locked, but so far I haven't succeeded.

This is the code block where the problem occurs:

```bash
>&3 2>&4 psql -h $host -d $database -U $database_user -t -e -c "ALTER TABLE ${schema}.${table} SPLIT DEFAULT PARTITION START (date '${partition_date_to_create}') INCLUSIVE END (date '${exclusive_date}') EXCLUSIVE INTO (PARTITION \""${partition_name}"\", PARTITION ${default_partition_name})"
```

It's part of this block:

```bash
  do
    partition_name="${partition_date_to_create//-/}"
    if [ -n "${existent_partition[*]}" ] && [[ "${existent_partition[*]}" == *"$partition_name"* ]]; then
        log_info "Table ${table} already has partition '${partition_name}'. Skipping creation."
        continue
    fi

    log_info "Creating partition '${partition_name}' for table ${table}..."
    exclusive_date=$(date --date="${partition_date_to_create} +1 day" +%F)
    >&3 2>&4 psql -h $host -d $database -U $database_user -t -e -c "ALTER TABLE ${schema}.${table} SPLIT DEFAULT PARTITION START (date '${partition_date_to_create}') INCLUSIVE END (date '${exclusive_date}') EXCLUSIVE INTO (PARTITION \""${partition_name}"\", PARTITION ${default_partition_name})"

    if [ "$?" -eq 0 ]; then
      log_info "Created partition '${partition_name}' for table ${table}."
    else
      log_error "Error creating partition '${partition_name}' for table ${table}."
    fi
  done
 ```

What I have tried so far:

- Set the variable `ON_ERROR_STOP` to `ON`;
- Configure `LOCK_TIMEOUT`;
- Configure `STATEMENT_TIMEOUT`;
- Disable the autocommit feature and commit manually.

Can anyone offer me an insight on what I'm doing wrong?
Awesome-blogs Contributors wanted
Tags: contributorswanted, beginners, codenewbie, opensource
Published: 2020-01-31 21:02:20

---
title: Awesome-blogs Contributors wanted
published: true
description: Contributors wanted for awesome-blogs
tags: contributorswanted, beginners, codenewbie, opensource
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/xwr5j7vdcgd90rkv1mmf.jpeg
---

Over the years i have stumbled on some __awesome tech blogs__ while learning something new or updating knowledge on something forgotten, and over the years i tend to forget about them.

What if these awesome tech blogs by some awesome writers were documented somewhere and categorized by stacks so someone can have a place to check and see where others are learning from, this led me to create [Awesome-blogs](https://github.com/rapulu/awesome-blogs).

I would love people to contribute to these repo with their own awesome tech blogs or tech blogs they have stumbled on which was/is a great help to them. You might be helping someone somewhere without knowing.

You don't have to be a programmer/developer to contribute, this good for someone who is looking for where to contribute on github.
pnpm v4.9 comes with command completion!
Tags: pnpm, node, javascript
Published: 2020-01-31 20:56:55

Command completion in bash, zsh, fish is awesome! Unfortunately, even though there are thousands of great command-line tools in the npm registry, I cannot recall any (except the npm CLI) that comes with command completion.

A few weeks ago [nikoladev](https://github.com/nikoladev) suggested to [implement autompletion in pnpm](https://github.com/pnpm/pnpm/issues/2229). After a brief investigation, I have found a brilliant tool that helps with autocompletion of CLI apps written in Node.js. This tool is called [tabtab](https://github.com/mklabs/tabtab) and is currently not maintained, so I [forked it](https://github.com/pnpm/tabtab) and added autocompletions to pnpm👌.

To set up autocompletion, just update [pnpm](https://github.com/pnpm/pnpm) to v4.9 and run `pnpm install-completion`.

Let's see what you can do with it.

Type `pnpm <tab-tab>` and see all the available commands:

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

Type `pnpm remove <tab-tab>` and see the list of dependencies currently installed. This also works with `pnpm update` and `pnpm outdated`.

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

Type `pnpm --filter <tab-tab>` and see the list of projects in the workspace:

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

Type `pnpm run <tab-tab>` and see the list of available scripts:

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

Type any command, type tab-tab and see the list of supported options:

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

Type an option and see the possible values:

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

And these are just a few examples! Happy tabbing😃

In a future version of pnpm we will also add descriptions to completions😍
100 days of code pt. 2!
Tags: 100daysofcode, challenge, adventofcode, codenewbie
Published: 2020-01-31 20:27:11

2019 was a busy and confusing year. Going from school to university, ignoring prep courses or public tenders, made me feel lost and insecure about myself. A federal university is way bigger than the neighborhood school where I spent the largest 4 years of my life. An university student's lifestyle is also way different if you compare it with a second year student, for example. That, obviously, depends on the school and the university the student had enrolled.

I came into the Computer Science course without any prior (relevant) knowledge in Programming, Informatics, or even Calculus. After the year ended, I realized I didn't needed it that much.

But anyways, I was totally lost, letting things happen so I could get used to my new academic life, until the bomb came: I would have to repeat 3 subjects.

After crying a river, I woke up and realized that, if I didn't (actually) studied, I would be in the same place forever. So I studied and I think things got right after it.

While I was studying, other opportunities came, like Python Nordeste and my first 100 days of code, which I did inspired by Ana Paula from [Ana no Terminal blog](https://instagram.com/ananoterminal). It was my debut as a "tech sub-blogger", since I only posted about BTS, cute things and rants to that date. I was so proud of myself that I created [LinaLina Study](https://instagram.com/linalinastudy), my studygram which I use to register my study life.

Unfortunately, LLS is not so active now, because of some little problems that ocurred on my notebook, [which I've talked about last post](https://dev.to/linasdias/i-m-finally-back-3fe).

But, leaving this introduction aside, I'm only writing here to announce that I'm re-starting 100 days of code tomorrow, February 1, and ending it by May 11. This year, my main focus will be "Python and web development", and I'm going to stop searching for BTS memes for each Twitter post I make.

See you tomorrow!
Laravel 6 | Polymorphic Relationship Example Tutorial
Tags: polymorphic, relationship, laravel
Published: 2020-01-31 20:26:04

Hello Artisan 

In this tutorial i am going to show polymorphic relationship laravel tutorial. In this tutorial i will show step by step many to many polymorphic relationship example from scratch.

In this article, you can understand how to create polymorphic many-to-many relationships with migration with a foreign key schema for one to many relationships, use sync with a pivot table, create records, attach records, get all records, delete, update, where condition and everything related to many to many polymorphic relationship.

https://www.codechief.org/article/polymorphic-relationship-in-laravel
Setup Code Editor – JavaScript Series – Part 11
Tags: javascript, codenewbie, tutorial, beginners
Published: 2020-01-31 20:23:25

Up until now we just worked with the console. But now we’ll work on a code editor.

I’m mostly a vscode fan so I’m going to use vscode. You can use whatever you want.

For folder I’ll create like –

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

There is nothing in css or js file. Now we’ll include this with the index.html

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/53k56pejb0ue62ppnyus.png)

I’m using the live server extensions to run the files.

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

Now we’ll just console in our script.js file and we can see the result on our console of the website.

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

I am using the live server extension which give me the way to run live the code

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

I use the prettier which helps me to easily arrange the code, so I don’t have any messy codes.

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

Is this lot to take or this is easy ?

You can see the graphical version here
{% instagram B7_t0Zcg2s- %}

Source Codes - { Check commits }
{% github nerdjfpb/javaScript-Series %}

Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/javascript-part-11/). You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/)!
How many of you use Apache NiFi?
Tags: bigdata, nifi, apache, discuss
Published: 2020-01-31 20:14:04

I work on a data integration project, in which data is ingested via NiFi to the cloud.

Is this software used by you or do you recommend another one for Big Data, IOT or another application?

We really like NiFi, because It is highly scalable, resilient, allows back pressure and is open source :)

https://nifi.apache.org/