teleren/devto huggingface dataset:
Terminal progress bar with python
Tags: python
Published: 2019-07-09 11:05:13

---
title: Terminal progress bar with python
published: true
description: python 
tags: python
cover_image: https://cdn.pixabay.com/photo/2018/07/21/19/51/horse-3553269__340.jpg
---
The module tqdm lets you create a progress bar. This lets you make nice progress bars:

<img src="https://raw.githubusercontent.com/tqdm/tqdm/master/images/tqdm.gif">

### Why the name tqdm? 

The developer thought it's a good name. It is an abbreviation for "I love you so much" in Spanish (te quiero demasiado). 

Por favor?

<img src="https://media.tenor.com/images/9048c0768b80d55ff7fea876a4380521/tenor.gif">

Salright. 

### Create progress meter

Instantly make your loops show a smart progress meter - just wrap any iterable with tqdm(iterable), and you're done!

    from tqdm import tqdm
        for i in tqdm(range(10000)):
            ...

Creates

    76%|████████████████████████████         | 7568/10000 [00:33<00:10,      229.00it/s]

### Demo

The code below creates several <a href="https://pythonspot.com/threading/">threads</a>.

You see, it can be used both on the current thread and with several threads.

    #!/usr/bin/python3
    import time
    import tqdm
     
    def work1():
        time.sleep(1)
    def work2():
        time.sleep(1)
    def work3():
        time.sleep(1)
    def work4():
        time.sleep(1)
    def work5():
        time.sleep(1)
    def work6():
        time.sleep(1)
     
    def worker():
        work_set = [work1, work2, work3, work4, work5, work6]
        return work_set
     
    def main():
        a = worker()
        for i in tqdm.tqdm(range(6)):
            b = a[i]()
     
    if __name__ == '__main__':
        main()
                
Then:

    100%|████████████████████████████████████| 6/6 [00:06<00:00,  1.00s/it]

Resources:
* <a href="https://tqdm.github.io/">tqdm module</a>
* <a href="https://pythonbasics.org">Python tutorial</a>
* <a href="https://www.w3schools.com/python/">w3 Python tutorial</a>
* <a href="https://pythonprogramminglanguage.com/">Articles on Python</a>
How to survive in the web development industry
Tags: webdev
Published: 2019-07-09 13:54:15

---
title: How to survive in the web development industry
published: true
tags: Web Development,web development
canonical_url: https://kevinhq.com/how-to-survive-in-the-web-development-industry/
---

I have been in the web development industry since 2010. I begin as an amateur front-end developer during my time at the university. After that, I got my first full-time job for two years. Then, I started to work remotely and sometimes, freelancing. So, how to survive for long in the web development industry? Some… 

[Read More »How to survive in the web development industry](https://kevinhq.com/how-to-survive-in-the-web-development-industry/)
paint with tkinter
Tags: python, tkinter
Published: 2019-07-09 10:32:30

---
title: paint with tkinter
published: true
description: python, tkinter
tags: python, tkinter 
cover_image: https://cdn.pixabay.com/photo/2010/12/13/09/59/artistic-2063__340.jpg
---
Tkinter is a module to build Graphical User Interfaces (GUI). That is desktop software, likely the one you are using right now.

Most desktop software is all about buttons, text fields and that kind of stuff. What about paint? The fun stuff? How do you create a paint window.

![](https://thepracticaldev.s3.amazonaws.com/i/lf1vjak4qi3afy0el1vd.png)

In the code below a canvas widget is created, on which you can paint.

An important method is

    #!/usr/bin/python3
    def test_drag(self,event):
       self.canvas.create_oval(event.x,event.y,event.x+1,event.y+1)
    
That creates an oval on the mouse position. The +1 means the size. You can change the size, like

    #!/usr/bin/python3
    def test_drag(self,event):
       self.canvas.create_oval(event.x,event.y,event.x+10,event.y+10)

Ok so what does the code look like?

    #!/usr/bin/python3
    from tkinter import *
    
    class application(Frame):
        def __init__(self,master):
            super().__init__(master)
            self.master=master
            self.pack()
            self.createWidget()
    
        def createWidget(self):
    
            self.canvas = Canvas(
            self,width=200,height=200,bg='white')
            self.canvas.pack()
            self.canvas.bind('<Button-1>',self.mouseTest)
            self.canvas.bind('<B1-Motion>',self.test_drag)
            self.canvas.bind('<KeyPress>',self.keyboard_test)
            self.canvas.bind('<KeyPress-a>',self.press_a_test)
            self.canvas.bind('KeyRelease-a',self.release_a_test)
    
        def mouseTest(self,event):
            print('{0},{1}'.format(event.x,event.y))
            print('{0},{1}'.format(event.x_root,event.y_root))
            print('{0}'.format(event.widget))
    
        def test_drag(self,event):
            self.canvas.create_oval(event.x,event.y,event.x+1,event.y+1)
    
        def keyboard_test(self,event):
            print('keycode:{0},char:{1},keysym:{2}'.format(event.keycode,event.char,event.keysym))
    
        def press_a_test(self,event):
            print('press a')
    
        def release_a_test(self):
            print('release a')
    
    if __name__ == '__main__':
        root = Tk()
        root.geometry('200x200')
        app=application(root)
        root.mainloop() 
            
Enjoy drawing!

![](https://thepracticaldev.s3.amazonaws.com/i/73in34p72x2jcmm932on.png)


Learn more:
* <a href="https://pythonbasics.org/tkinter/">Tkinter tutorial</a>
* <a href="https://pythonbasics.org/">Python tutorial</a>
* <a href="https://gumroad.com/l/ErLc">Tkinter course</A>
React tldr; Optimize Components with React.memo, useMemo, and useCallback
Tags: react
Published: 2019-07-09 10:27:35

- With React.Memo, if a component returns the same result given the same props, wrapping it in memo can result in a performance boost.

- useMemo allows you to memoize the results of a function and will return that result until an array of dependencies change.

- useCallback can prevent unnecessary renders between parent and child components.

Source: https://headway.io/blog/react-optimize-components-memo-usememo-usecallback/
Bulma CSS - Open-Source Components
Tags: bulma, css, appseed
Published: 2019-07-09 10:24:54

---
title: Bulma CSS - Open-Source Components
published: true
description: Open-source components for Bulma CSS, released under the MIT license.
cover_image: https://github.com/app-generator/static/blob/master/bulma-css/bulma-css-components-intro.gif?raw=true 
tags: bulma, css, appseed
---
Hello Coder, 

If you're using **[Bulma CSS](https://appseed.us/apps/bulma-css)** in your development, maybe it is a good idea to spare a few minutes of your time and look at this [open-source](https://github.com/bulma-css-templates/bulma-components) library with more than 50 components styled with Bulma, and released under the MIT license. Ever used **[Bulma CSS](https://appseed.us/apps/bulma-css)** before? Find out more on this short [tutorial written especially for beginners](https://dev.to/sm0ke/bulma-css-a-tutorial-for-beginners-af2). Thank You!

--- 

![Bulma CSS Components - Admin Dashboards.](https://raw.githubusercontent.com/app-generator/static/master/bulma-css/bulma-css-components-admin.jpg)

---

## What's in the box

Components are grouped by visual usability criteria (footer, hero, navbar ..), and styled directly on top of Bulma (no Javascript dependency) as [pug](https://pugjs.org/api/getting-started.html) templates, which makes them very easy to extend and customize.  
 
---

## How to use the project

To use the [bulma components](https://github.com/bulma-css-templates/bulma-components) project and the components, just type:

```
# Clone the repo
$ git clone https://github.com/bulma-css-templates/bulma-components.git
$ cd bulma-components

# Install dependencies
$ yarn

# Run dev server with live preview (Browsersync)
$ yarn start 

# Or make a production build
yarn build
```    

--- 

## Components

Here is a shortlist, to visualize the full library please access [Bulma CSS - Components](https://components.bulma-css.com/) online. 

 - [Admin](https://components.bulma-css.com/admin.html)
 - [Blog](https://components.bulma-css.com/blog.html)
 - [eCommerce](https://components.bulma-css.com/ecomm.html)
 - [FAQ's](https://components.bulma-css.com/faq.html)
 - [Gallery](https://components.bulma-css.com/gallery.html)
 - [Forms](https://components.bulma-css.com/sign-in.html)

--- 

## Screen Shots

![Bulma Css Components - eCommerce.](https://github.com/app-generator/static/blob/master/bulma-css/bulma-css-components-ecomm.jpg?raw=true)

<br />
 
![Bulma Css Components - Footers.](https://github.com/app-generator/static/blob/master/bulma-css/bulma-css-components-footers.jpg?raw=true)

<br />
 
![Bulma Css Components - CTA.](https://github.com/app-generator/static/blob/master/bulma-css/bulma-css-components-cta.jpg?raw=true)


--- 

## Links

 - [Bulma Components Sources](https://github.com/bulma-css-templates/bulma-components) - published on Github
 - [Bulma Components Demo](https://components.bulma-css.com/)
 - [Bulma Css Tutorial](https://dev.to/sm0ke/bulma-css-a-tutorial-for-beginners-af2)
 - [Bulma Css Resources](https://blog.appseed.us/bulma-css-resources-curated-list)
 - [Bulma Css Apps](https://appseed.us/apps/bulma-css)
 
--- 

> Thank you!
One-Handed Vim
Tags: vim
Published: 2019-07-08 19:41:02


Vim takes a lot of dexterity and practice.  Speed comes with time and a lot of muscle memory. It's a big investment, but worth it.

And then you break your hand.

![mono](https://thepracticaldev.s3.amazonaws.com/i/szqmawsr4t9da62l7wik.jpg)

That's OK.  You can still work [at a decent pace](https://www.youtube.com/watch?v=wvSW6W3Xdu8).  Here are some tips.

## Macro Everything

### Basic

First, add a macro to edit and to source your vimrc.  You will need to edit it a lot.

```
" edit this file
:nnoremap <leader>ev :vsplit $MYVIMRC<cr>

" re-source this file
:nnoremap <leader>sv :source $MYVIMRC<cr>
```

Going forward, you can open, change, save, and source your runtime config in no time.


Add mappings for write and quit.
```
:nmap <leader>ww :w<cr>
:nmap <leader>qq :wq<cr>
```

### Common Structures

As you're writing code, you will recognize structures you use a lot.  Add insert mappings for them.  For example, in insert mode, if I want to `reduce` an array, I can type ...

```js
foo.rrr
```

and it will be swapped with

```js
foo.reduce((acc, value) => {
  return {
  ...acc,
  }
}, {})
```

Take the time to write these.  You'll have to goof around to find what you like, hence the quick source thing we did at the beginning.  Here are some I'm using for JavaScript.

```
" insert if block
" if () {
"
" }
:imap iii if () {<cr>}<esc>kwa

" insert braces
" {
"
" }
:imap {{{ {<cr>}<esc>O

" insert brackets
" [
"
" ]
:imap [[[ [<cr>]<esc>O

" insert arrow fn
" () => {
"
" }
:imap ((( () => {{{return

" map loop
:imap .mmm .map((item) => {<cr>return item<cr>})<esc>kA

" reduce loop
:imap .rrr .reduce((acc, value) => {<cr>return {<cr>...acc,<cr>}<cr>}, {})<esc>kkA

" console
:imap ccc console.log()<esc>i
```


## Efficient Moving

Take a moment to think about what you're navigating to.  Lazy `kkkkkjjjjkj` crap doesn't work well in one-hand mode.  Look at relative line numbers.  Move to them properly.

* Go up 17 lines with `17k`.
* Go to the next r with `fr`.
* Go to the first blank line above you with `{`.
* Go down 3 folds with `3zj`.

Brush up on your movements a bit and take the time to do them [correctly](https://medium.com/usevim/vim-101-quick-movement-c12889e759e0).

Use `<C-o>` and `<C-i>` a lot.  As you hit the wrong keys, you'll bounce around a lot.  These take you back or forward.

Don't be a purist.  Sometimes the mouse is faster, especially when you're
confused.


## Avoid Typing

Especially if you're typing really long entity names, use [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) or something to auto complete for you.  This avoids typos and can be much faster.  This includes when opening files.


# Slow is Smooth, Smooth is Fast

That's an Infantry motto that applies well here.  I'm going to take these next many long weeks to practice deliberate movement and optimizations.  Yeah, it will suck, but I'll come out the other end even faster.
Understanding how to use Task and ValueTask
Tags: dotnet, webdev, tutorial, beginners
Published: 2019-07-09 09:25:20

In this video, Stephen Toub chats with Rich about ValueTask and how it might help reduce allocations and memory usage for your asynchronous .NET code.

{% youtube jO1CnFvM9Mw %}

**Thanks for reading** ❤
If you liked this post, share it with all of your programming buddies!
Follow us on **[Facebook]( https://www.facebook.com/moriohdotcom)** | **[Twitter]( https://twitter.com/moriohdotcom)**

### Further reading
☞ [Build amazing web apps with ASP.NET Core 3.0](https://morioh.com/p/e26153483474)
☞ [Moving from Node.js to .NET Core](https://morioh.com/p/1a4ca4cbe1cf "")
☞ [.NET or Java for Web Development](https://morioh.com/p/5437036e2066 "")
Software AG unveils webMethods Service Designer
Tags: webmethods, integration, designer, tool
Published: 2019-11-05 09:39:39

---
title: Software AG unveils webMethods Service Designer
published: true
tags: #webmethods, #integration, #designer, #tool
canonical_url: http://techcommunity.softwareag.com/techniques-blog/-/blogs/software-ag-unveils-webmethods-service-designer
---

# A lightweight integration and development tool

At its North America [User Group Conference](https://www.softwareag.com/us/company/events/20190627_North_America_User_Group_New_York.html) in New York on June 27, 2019, [Software AG](https://www.softwareag.com/corporate/default.html) unveiled [webMethods Service Designer](https://www.softwareag.com/corporate/products/webmethods_integration/default), a lightweight integrated design and development tool for building and running integrations and APIs. This tool provides users free access with a one-year valid license to tools such as Software AG Designer with the Local Service Development plugin and Unit Test Framework. It also includes webMethods Microservices Runtime, Software AG’s light-weight API development and runtime environment. Easy to install and to set up, the bundle comes with a simplified view of the Service Development perspective coupled with VCS integration capabilities, along with the Eclipse E-Git plugin. It can be used for developing, editing, testing and debugging APIs and their underlying services.

## **webMethods Service Designer: Free download\***

Sized slightly less than 500 MB, this free download is available in the [Software AG TECHcommunity](http://techcommunity.softwareag.com/ecosystem/communities/public/webmethods/contents/downloads/webmethods-service-designer). Users can get started by just downloading the zip file, where they can extract it and get started creating APIs and services instantly. The free download includes:

- webMethods Service Development plugin for designing and developing Integration Server assets (such as services, document types, triggers, and web service descriptors) and managing them with version control.
- webMethods Unit Test Framework for creating unit tests for the services, included in Continuous Integration for build verification.
- webMethods Microservices Runtime (referred to as Local Development Server) for deploying and testing the assets.
- JDBC Adapter for connecting to and integrating with SQL-based databases.

The download is available [here](http://techcommunity.softwareag.com/ecosystem/communities/public/webmethods/contents/downloads/webmethods-service-designer/index.html).

Users are welcome to share their feedback in [Software AG's Techcommunity](http://tech.forums.softwareag.com/techjforum/forums/show/336.page).

_\*The bundle is for assessment purpose only and hence not supported officially by Software AG global Support_
Enterprise Management System powered by ARIS
Tags: aris, enterprise, management, system
Published: 2019-10-07 12:19:14

---
title: Enterprise Management System powered by ARIS
published: true
tags: #aris, #enterprise, #management, #system
canonical_url: http://techcommunity.softwareag.com/techniques-blog/-/blogs/enterprise-management-system-powered-by-aris
---

# Gain full control of your changing business with ARIS

**Your business is changing – shouldn’t you change with it? But how? By creating an Enterprise Management System powered by ARIS you can go from strategy to operational excellence!**

**![](http://techcommunity.softwareag.com/documents/10157/10630400/EMS_1.jpg/539ba7d8-e007-4aa8-8116-e74fa3fcbcf1?t=1563190814086)**

Change is constant in today’s world. But how can you prepare your business for change? With an Enterprise Management System powered by ARIS, your organization can drive fundamental transformation initiatives and achieve measurable results.

Follow these three pillars of successful transformation:

**1. Transform: Turn vision into results** 

The foundation of a successful transformation is always a clear business strategy, an understanding of processes and KPIs to measure and visualize the performance. With an Enterprise Management System powered by ARIS you can easily execute your strategical transformation by reducing failures and clearly defining processes.

**2. Optimize: Achieve Operational Excellence**

An Enterprise Management System powered by ARIS involves and aligns the whole organization. Retain engaged and productive employees who can easily find and consume information and – take advantage of data-driven decision-making and continuous improvement processes.

**3. Control: Secure your license to operate**

Business operations compliance is essential. An Enterprise Management System powered by ARIS provides you with complete risk insights while continuously checking your process conformance.

![](http://techcommunity.softwareag.com/documents/10157/10630400/EMS_2.jpg/58400e88-9a62-44c8-b04c-165a0f8d9210?t=1563190822651)

As a result, with an Enterprise Management System powered by ARIS you can achieve an end-to-end alignment of your organization.

To build such an adaptive Enterprise Management System, you need a supporting tool, and this is ARIS. ARIS gives you the keys to gain control over your transformation and evolves to a strategic asset for your business. Dive into the nine ARIS essential elements of business transformation - check out our newest [e-book](http://www.softwareag.com/corporate/innovation/enterprise_management_system/ebook.html) and see how ARIS can help.

If you want to learn more visit our [Enterprise Management System microsite](https://www.softwareag.com/corporate/innovation/enterprise_management_system/default.html):

- **Learn** how customers use ARIS as a strategic asset
- **Read** our practical guide “Solving The 3 Core Problems of Strategic Change in 4 Steps”
- Register to upcoming webinars & watch **webinar** recordings

Gain control of your changing business with an Enterprise Management System powered by ARIS!
Reminder about REST
Published: 2019-07-09 08:52:25

### GET
idempotent method to retrieve data out of API endpoint

**200** returned when resource is found
**404** returned when resource is not found
**400** returned when a request is shaped incorrectly

### POST
not idempotent creates new resource via API resource collection endpoint

**201** should be returned containing created entity
**200** or **204** returned when resource is created but cannot be identified by URI or returned in response body

### PUT
used to update/replace resource addressed by resource identifier 

**200** or **204** returned to identify successful completion
**201** returned when resource has been created
**404** returned when resource not found

### DELETE
used to delete resources addressed by resource identifier

**200** returned when action has been performed and response contains status describing entity
**202** returned when the action has been queued
**204** returned when action has been performed but response does not contain status describing entity
**404** returned when resource not found

### PATCH
used to partially modify a resource 

**200** returned when action has been performed and response contains status describing entity
**202** returned when the action has been queued
**204** returned when action has been performed but response does not contain status describing entity
**404** returned when resource not found

### HEAD
used to find out based on response headers what response would be returned if GET method was used
Somebody can tell me why my array can not display in my page 'Home.js' please?
Published: 2019-07-09 08:05:00

import React from 'react';
import Home from './Home';


function Li (props){
    return li {props.value} /li
}

const List = props =>{
    const numbers = props.numbers;
    const listItem = numbers.map((number) =>
   //     Li value={number}  key={number} /
    )
    return (
     //   ul{listItem}/ul
    )
}



export default List;

//*****************
import React from "react";
import List from './list';


function Home () {
    const numbers = [1,2,3,4,5];
    return (
        <div>
            <h1>Home Page</h1>
            <List numbers={numbers} />
        </div>
    )
}


export default Home;
Howto: Drop-down list with branches from Gitlab project
Tags: jenkins, gitlab, howto
Published: 2019-07-09 07:59:18

In the previous receipt about Drop-down list for values we learned how-to choice any component from Jira or project name from Gitlab.
On the next step we need in branch selector for choosen project.

Prerequisites:
- [Active Choices plugin](https://wiki.jenkins.io/display/JENKINS/Active+Choices+Plugin)
- Gitlab token for API

Step 1: In job configuration add parameter Active Choice Reactive Parameter

Step 2: Set name for your parameter (for example GIT_BRANCH)

Step 3: Set value for Referenced parameters as COMPONENT

Step 4: Select Groovy script and add next groovy-code

```groovy
import groovy.json.JsonSlurperClassic

def projectName = COMPONENT
def gitlabUrl = "https://gitlab.domain.org"
def gitlabApiToken = "SecretToken"
def per_page = 128

def url = "curl -k -H PRIVATE-TOKEN:${gitlabApiToken} ${gitlabUrl}/api/v4/projects?search=$projectName"
def json = url.execute().text.replaceAll("\r\n", "")
def data = new JsonSlurperClassic().parseText(json)
def project = data.find { it.name == projectName }
def projectId = project.id

url = "curl -k -H PRIVATE-TOKEN:${gitlabApiToken} ${gitlabUrl}/api/v4/projects/${projectId}/repository/branches?per_page=${per_page}"
json = url.execute().text.replaceAll("\r\n", "")
data = new JsonSlurperClassic().parseText(json)
def list = []
data.each { branch ->
    list += branch.name
}
return list
```