teleren/devto huggingface dataset:
I am getting an error while building and compiling my Altcoin, Please help !
Tags: blockchain
Published: 2021-05-06 14:52:16

/usr/local/include/boost/multi_index/detail/ord_index_impl.hpp:1253:26: error: 
      no matching function for call to object of type 'const
      boost::multi_index::detail::ordered_index_impl<boost::multi_index::identity<CTxMemPoolModifiedEntry>,
      CompareModifiedEntry, boost::multi_index::detail::nth_layer<2,
      CTxMemPoolModifiedEntry,
      boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter,
      CompareCTxMemPoolIter, mpl_::na>,
      boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
      boost::multi_index::identity<CTxMemPoolModifiedEntry>,
      CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
      std::__1::allocator<CTxMemPoolModifiedEntry> >,
      boost::mpl::v_item<ancestor_score, boost::mpl::vector0<mpl_::na>, 0>,
      boost::multi_index::detail::ordered_non_unique_tag,
      boost::multi_index::detail::null_augment_policy>::key_compare' (aka 'const
      CompareModifiedEntry')
    return y==header()||!comp_(key(y->value()),key(v));
                         ^~~~~
./miner.h:76:10: note: candidate function not viable: 'this' argument has type
      'const
      boost::multi_index::detail::ordered_index_impl<boost::multi_index::identity<CTxMemPoolModifiedEntry>,
      CompareModifiedEntry, boost::multi_index::detail::nth_layer<2,
      CTxMemPoolModifiedEntry,
      boost::multi_index::indexed_by<boost::multi_index::ordered_unique<modifiedentry_iter,
      CompareCTxMemPoolIter, mpl_::na>,
      boost::multi_index::ordered_non_unique<boost::multi_index::tag<ancestor_score,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
      boost::multi_index::identity<CTxMemPoolModifiedEntry>,
      CompareModifiedEntry>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
      mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>,
      std::__1::allocator<CTxMemPoolModifiedEntry> >,
      boost::mpl::v_item<ancestor_score, boost::mpl::vector0<mpl_::na>, 0>,
      boost::multi_index::detail::ordered_non_unique_tag,
      boost::multi_index::detail::null_augment_policy>::key_compare' (aka 'const
      CompareModifiedEntry'), but method is not marked const
    bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolMo...
         ^
2 errors generated.
make[2]: *** [libbitcoin_server_a-miner.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
Deploy Flask app on Heroku with Github
Tags: flask, heroku, deploy, github
Published: 2021-05-06 14:42:40

---
title: Deploy Flask app on Heroku with Github
published: true
description: An easy tutorial for a quick deploy of a Flask app on Heroku
tags: Flask,Heroku,Deploy, Github
cover_image: https://pixabay.com/get/g87c9a4b9f57134af8e8e60143b44594727723357789d38eacb252e4f7847190bcfda42adcaf8fa9883d48409069fe5ef_1920.jpg
---

Hello guys,

Heroku is an awesome resource if you want to set up a web app.
I recently needed it for a personal project and here is some simple step i had to follow to set up this correctly.

## All starts with an awesome GitHub project

Let's imagine you have develop and awesome flask app in a private GitHub repository:

![Some GitHub repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/445q1rbf6qv10biqsg8r.png)

My code is sooo complicated (`run.py`) :

![My awesome code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxp9096ac29pa9ji7389.png)

And the result is awesome:

> Hello, World!

This result is incredible and i have to share the result with the world to let anyone use this!
I'll then deploy it first on a free resource to see my result online.

## Deploy on Heroku.

For this i'll use Heroku! After creating an account, i'll create my first app.
I set up a name and a region and then discover my dashboard.
You can see and configure a lot of things but we will focus on deploy tab.
I will first select GitHub for deployment method.
After a connection to GitHub profile, you can select the repository (public or private) to deploy by entering the name.

I can now define an automatic or manual deploy. I'll go for a manual, as I didn't set CI. I just have to select the branch and hit deploy.

**Spoiler, as it is, the deployment will fail.**
Heroku needs some extra information to make this awesome project work.

## Some extra needs

First, a list of requirements for the project. Those are listed in my `requirements.txt`. For my tiny project i only need:
```
flask
jinja2
gunicorn
```

Then, a runtime definition (defined in `runtime.txt`). Here are supported version of Python in Heroku :
[Here](https://devcenter.heroku.com/articles/python-support#supported-runtimes)

So i defined my runtime simply as follow

> python-3.9.4

Finally, Heroku web applications require a `Procfile`. This file is used to explicitly declare application’s process types and entry points. It is located in the root of the repository.

> web: gunicorn wsgi:app

(related to my `wsgi.py` file)

This Procfile requires Gunicorn, the production web server. That's why I set Gunicorn in my requirements file.

We can now deploy the wonderful app and enjoy it at the dedicated URL provide by Heroku.

My repositroy is available [here](https://github.com/Drumor/heroku_python_example)
User-defined Exceptions in Python
Published: 2021-05-06 14:40:33

In Python user-defined exceptions ,users can define custom exceptions by creating a new class. This exception class has to be derived, either directly or indirectly, from the built-in Exception class.
#CREATING A USER-DEFINED EXCEPTION CLASS#
Here we created a new exception class i.e. User_Error. Exceptions need to be derived from the built-in Exception class, either directly or indirectly. Let’s look at the given example which contains a constructor and display method within the given class.
```#class MyError is extented from super class Exception
class User_Error(Exception):
  # constructor method
  def __init__(self,value):
    self.value = value
  # __str__display function
  def __str__(self):
    return(repr(self.value))
try:
  raise(User_Error("User defined error"))
  # Value of Exception is stored in error
except User_Error as error:
  print('A New Exception occured:',error.value)```
#CREATING A USER-DEFINED EXCEPTION CLASS (USING MULTIPLE INHERITENCE)#
Derived class Exceptions are created when a single module handles multiple several distinct errors. Here we created a base class for exceptions defined by that module. This base class is inherited by various user-defined class to handle different types of errors.
```# define python user-defined exceptions
class Error(Exception):
  """Base clase for other exceptions"""
  pass
class Dividebyzero(Error):
  """Raised when the input value is zero"""
  pass 
try:
  i_num = int(input("Enter a number: "))
  if i_num ==0:
    raise Dividebyzero
except Dividebyzero:
  print("Input value is zero, try again!")
  print()```
#Creating a User-defined Exception class (standard Exceptions)#
Runtime error is a built-in class which is raised whenever a generated error does not fall into mentioned categories. The program below explains how to use runtime error as base class and user-defined error as derived class.
```# User defined error
class Usererror(RuntimeError):
   def __init__(self,arg):
      self.args = arg
try:
   raise Usererror("usererror")
except Usererror as e:
   print (e.args)```
Awesome CSS tricks every developer should know
Tags: webdev, beginners, html
Published: 2021-05-06 14:30:23

### Smooth scrolling

This technique is super important when you have a button that displays a different part of your web page. Doing it with a simple href="#goToContact" will definitely move quickly but not funny. Having a smooth scroll is funny and professional. Your web visitor deserves the best user experience.

```css
html {
  scroll-behavior: smooth;
}
```

### Resize images to fit

Who didn’t have a headache making an image fit to a place on your web page? 

Here is an example:

```css
img {
    max-width:100%;
    height:auto;
}
```

### Setting an image as cursor

Want to make your cursor special like your web app or website? This can give a unique souvenir to your web visitor, so why not:

```css
body {
  cursor: url("images/cursor.png"), auto;
}
```

### Center anything in 3 lines of code

```css
.center {
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}
```

### Set a limited content in a paragraph

Do you need to display only a few phrases in your paragraph? Again, CSS can do this in one line of code. The -webkit-line-clamp CSS property allows limiting of contents of a block container to a specified number of lines.

```css
p {
  -webkit-line-clamp: 5;
}
```css




References:
- [5 Awesome CSS tricks every developer should know](https://levelup.gitconnected.com/5-awesome-css-tricks-every-developer-should-know-39396d4be992)
How to Remove Background from Any Image in 5 Seconds
Tags: design, webdev, tutorial
Published: 2021-05-06 14:29:14

In this video, I'm showing you how you can remove background from any image in just 5 seconds.

This is a 5-second trick to remove background from an image.

Know more: http://bit.ly/RemoveBackgroundAtOneClick
--- | ---
Watch more: https://bit.ly/SouvikPaulYT

Remove unlimited backgrounds from any type of image for free. No photoshop required. You can remove the background from your smartphone anytime anywhere. (No software needed)

RemoveBg: https://www.remove.bg

Buy me a coffee: https://imjo.in/4AvD73

Connect with me:
Facebook: https://fb.com/thesouvikpaul
Instagram: https://instagram.com/amisouvikpaul
Twitter: https://twitter.com/thesouvikpaul
Page: https://fb.com/amisouvikpaul
FILE HANDALING
Tags: java
Published: 2021-05-06 14:26:55

A file is the name of memory location where we can store data permanently under computer’s hard disk. Java language supports a set of classes in java.io package to create and maintain files. The following are some of the classes we can use to create and maintain files :

FileInputStream
FileOutputStream
FileWriter etc.,

FileOutputStream class :

This class represent data as a stream of bytes. The objects of this class can be used to open and access a file in write mode. The object for this class can be created as below :

FileOutputStream fis = new FileOutputStream(“file-name”,boolean-value); Here, if the boolean value is true, the file can be opened in append mode. If it is false,the data is overwritten from the beginning of the file every time when we execute the program.The following program demonstrates the use of this class.

/* Program to store data into a file using FileOutputStream class */

import java.io.*;

class FileWrite{

public static void main(String args[]) throws Exception {

InputStreamReader isr = new InputStreamReader(System.in);

BufferedReader br = new BufferedReader(isr);

System.out.println(“Enter some text “);

String data = br.readLine();

FileOutputStream fos = new FileOutputStream(“file1.txt”,true);

/* Because data is in the form of String object, convert it into byte array */

byte b[] = data.getBytes();

fos.write(b); /* writes byte array into file.txt */

fos.close();

}

}


FileInputStream class :

This clas represents data as a stream of bytes. The objects of this class can be used to open and access a file in read mode. The object for this class can be created as below :

FileInputStream fis = new FileInputStream(“file-name”);

The following program demonstrates the use of this class.

/* Program to read data from a file using FileInputStream class */

import java.io.*;

class FileRead {

public static void main(String args[]) throws Exception {

FileInputStream fis = new FileInputStream(“file1.txt”);

int size = fis.available(); /* available() returns no. of bytes in file1.txt */

byte b [] = new byte[size];

/* create a byte array of file size */

fis.read(b);

String data = new String(b);

/* convert the byte array to string */

System.out.println(“The contents of file1.txt are : “ + data);

}// end of main

}// end of class


FileWriter class :

This class represent data as a stream of characters. The objects of this class can be used to open and access a file in write mode. The object for this class can be created as below :

FileWriter fw = new FileWriter(filename,boolean-value);

The following program demonstrates the use of FileWriter class.

import java.io.*;

class FileWrite {

public static void main(String args[]) throws Exception {

FileWriter fw = new FileWriter(“file2.txt”,true);

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.println(“Enter some text “);

String data = br.readLine();

// convert data into equalent character array

char ch[] = data.toCharArray();

fw.write(ch);

fw.close();

} // end main

} // end class
Flutter ListView example with ListView.builder
Tags: flutter, listview
Published: 2021-05-06 14:06:47

https://grokonez.com/flutter/flutter-listview-example-listview-builder

Flutter ListView example with ListView.builder

In this tutorial, we're gonna build a Flutter App that shows a <code>ListView</code>. We are using <code>ListView.builder</code> constructor that creates items when they are scrolled onto the screen. The <code>ListView</code> also supports removing item from the list.

More Practice:
- <a href="https://grokonez.com/android/flutter-sqlite-example-listview-crud-operations-sqflite-plugin">Flutter SQLite example – CRUD Operations with ListView & sqflite plugin</a>
- <a href="https://grokonez.com/android/flutter-firestore-example-firebase-firestore-crud-operations-with-listview">Flutter Firestore example – Firebase Firestore CRUD with ListView</a>
- <a href="https://grokonez.com/android/flutter-firebase-database-example-firebase-database-crud-listview">Flutter Firebase Database example – Firebase Database CRUD with ListView</a>

- <a href="https://grokonez.com/android/flutter-dismissible-example-swipe-to-dismiss-remove-item-in-listview">Flutter Dismissible example – Swipe to dismiss/remove Item in ListView</a>

<!--more-->
<h2>Overview</h2>
<h3>Flutter App</h3>
We will build a Flutter App that can display a List of Post objects, we can also click on the circle Remove Button to delete a Post from the List. This will update the UI immediately because we use <code>StatefulWidget</code>.

<img src="https://grokonez.com/wp-content/uploads/2018/07/flutter-listview-example.png" alt="flutter-listview-example" width="263" height="461" class="alignnone size-full wp-image-13529" />
<h3>List of items with ListView</h3>
<h6>Initialize the List</h6>
We will implement <code>initState()</code> method and call <code>setState()</code> to initialize the List.
<pre><code class="language-javascript">
class ListViewApp extends StatefulWidget {
  @override
  _ListViewState createState() => new _ListViewState();
}

class _ListViewState extends State<ListViewApp> {
  final List<Post> items = new List();

  @override
  void initState() {
    super.initState();
    setState(() {
      items.add(new Post(...));
      items.add(new Post(...));
      // ...
    });
  }
</code></pre>
<h6>Use ListView.builder</h6>
To display items on the List, we need to render each Object as a Widget.
So we use <code>ListView.builder</code> with <code>itemBuilder</code> callback that returns built-in <code>ListTile</code> Widget for visual structure.

More at:

https://grokonez.com/flutter/flutter-listview-example-listview-builder

Flutter ListView example with ListView.builder
Difference Between AI and Machine Learning
Published: 2021-05-06 13:58:17

There seems to be a lack of a bright-line distinction between what Machine Learning is and what it is not. Moreover, everyone is using the labels ‘AI’ and ‘ML’ where they do not belong and that includes using the terms interchangeably.
Artificial Intelligence is not a machine or a system. It is a concept that is implemented on machines. When we talk about Artificial Intelligence, it could be making a machine move or it could be making a machine detect spam mail. For all these different implementations of AI, there are different sub-fields, and one such sub-field is Machine Learning. There are applications of Artificial Intelligence that are not Machine Learning. For example, symbolic logic: rules engines, expert systems, and knowledge graphs.

Going for an interview? Do not forget to check out [Interview Questions on Machine Learning](https://intellipaat.com/blog/interview-question/machine-learning-interview-questions/).
Types of Values
Tags: help, javascript, value, string
Published: 2021-05-06 13:57:22

As a javascript learner you should have proper knowledge about values. After Almost twenty five yeas of studying JavaScript, the scientists have only discovered nine such type of values , that you should remember always. 
There are two type of values 
1. Primitive Values
2. Objects And Functions


Primitive Values:
● Undefined​ (undefined), used for unintentionally missing values.
● Null​ (null), used for intentionally missing values.
● Booleans​ (true and false), used for logical operations.
● Numbers​ (-100, 3.14, and others), used for math calculations.
● Strings​ ("hello", "abracadabra", and others), used for text.
● Symbols​ (uncommon), used to hide implementation details.
● BigInts​ (uncommon and new), used for math on big numbers.

Objects And Functions:
● Objects​ ({} and others), used to group related data and code.
● Functions​ (x => x * 2 and others), used to refer to code.

thank you for reading.
happy coading(.)
Ein Lernmanagementsystem ist essenziell für das Lernen im Unternehmen
Tags: elearning
Published: 2021-05-06 13:56:47

Sie könnten selbst Ihre eigene Online-Lernressource starten und Spielprinzipien wie im vorherigen Fallbeispiel mithilfe eines Lernmanagementsystems (kurz LMS) implementieren. In diesem Artikel erfahren Sie, was genau ein LMS ist und wie es Ihnen helfen kann.

Was ist ein LMS?
Ein LMS ist eine Plattform für digitales Lernen, die wichtigsten Merkmale lassen sich aus der Abkürzung ablesen:

L – Lernen. Mit einem LMS können Sie eine alleinige, umfassende Quelle für E-Kurse und Schulungsmaterialien erstellen. Dies wird zu einer einzigartigen Wissensquelle in Ihrem Bereich, sodass Sie die interne Kompetenz Ihres Unternehmens beibehalten und steigern können.

M – Management. Sie können Kurse und Lernende verwalten und Ihre eigene Effizienz verbessern.

Im Gegensatz zu Filesharing-Diensten ist ein LMS nicht nur ein Haufen an Dateien, ganz im Gegenteil, es ist ein gut organisiertes und strukturiertes System, in dem Sie den Schulungsprozess verwalten. Um mit dem Training zu beginnen, fügen Sie einfach Mitarbeiter hinzu und teilen Sie In Kurse ein.

Haben Sie kürzlich neue Mitarbeiter eingestellt? Schicken Sie ihnen Einladungen zum Onboarding-Schulungskurs. Niedrige Umsätze? Bitten Sie Ihre Vertriebsmitarbeiter, mit virtuellen Kunden zu üben.

Dank Funktionen wie einem Kalender können Sie nicht nur Online-Schulungen, sondern auch Präsenztrainings zuordnen und verwalten. Auf diese Weise kann ein LMS eine Art To-Do-App sein, die speziell für E-Learner entwickelt wurde.

S – System. Computersystem, um genau zu sein. Auch wenn Ihre Mitarbeiter in unterschiedlichen Zeitzonen leben, können Sie sie alle trainieren, ohne das Büro zu verlassen. Darüber hinaus automatisiert ein LMS langweilige und mühsame Arbeiten, beispielsweise das Sortieren, die Verarbeitung von Statistiken und das Erstellen von Berichten.

Mit anderen Worten, ein LMS ist wie Ihre eigene Online-Universität. Das System hilft Ihnen bei der Erstellung und Speicherung von E-Learning-Kursen, ermöglicht den Lernenden den Zugriff auf Inhalte und hilft Ihnen bei der Bewertung der Ergebnisse.

Mehr lesen > https://www.ispringlearn.de/blog/what-is-lms
How to fix zsh icons in Visual Studio Code terminal?
Tags: vscode, zsh, beginners, linux
Published: 2021-05-06 13:42:48

Zsh is a popular UNIX shell used by many Linux and macOS users around the globe. It's even more powerful when you use it with a configuration framework like [***Oh my zsh***](https://github.com/ohmyzsh/ohmyzsh) and a fantastic template like [***Powerline10k***](https://github.com/romkatv/powerlevel10k). So, we set up our new shiny shell, everything works great in our terminal. Time to write some code. We run [Visual Studio Code](https://code.visualstudio.com), open a built-in terminal and... something is not right. What happened to our beautiful template? Where are our sexy icons?
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ip3c0g8x3eseff8yc7r.png)

The solutions for that is simple, try to follow the steps below:

1. Download the latest version of Hack Nerd Font, for example from [here](https://github.com/source-foundry/Hack/releases/). Choose the file with `ttf` suffix.
2. Extract it from the archive.
3. Move all `ttf` files to `/usr/share/fonts` directory (or `~/.local/share/fonts/` if you don't want to use them globally).
4. Open Visual Studio Code settings and find `Terminal font` section.
5. Change `Terminal › Integrated: Font Family` attribute from `Monospace` to `Hack Nerd Font`. 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sscxjv1uf0xy5xxcsgrk.png)
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jtb2vw78qh78o0a6y80m.png)
6. You can also change it directly in `settings.json` file (look for it in `.config/Code/User` directory). The property you are looking for is `terminal.integrated.fontFamily`.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tigsu9gidpzqw2f4mx30.png) 
7. Restart Visual Studio Code.
8. Enjoy your new terminal font, which should now look correctly!

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

Ps. It will work the same way for macOS users, but the font installation process is a little different.
Day 53 of 100 Days of SwiftUI
Tags: swift, 100daysofcode
Published: 2021-05-06 13:39:30

I just completed day 53 of 100 days of SwiftUI. Today I learnt about type erasure using the `AnyView` class and also how to save data using `CoreData`.

We all know you are only allowed to return one kind of view in your SwiftUI function. Sometimes, you need to return multiple kinds of views. That's where `AnyView` comes in. It allows you to return multiple kinds of views all you have to do is wrap your view with an AnyView. For example, you can use an `AnyView` like so.
```swift
let switch = 3
var body: some View {
    if switch > 3 {
     return AnyView(TextView("View 1))
    } else {
     return AnyView(TextField("View 2"))
    }
}
```
The code above returns two different kinds of views depending on the value of the switch. You should use `AnyView` sparingly because they reduce the performance of your app. Since SwiftUi no longer knows what kind of views your functions are returning. It won't be able to make any optimisations.
Flutter & Dart: Managing state with BLoC Design Pattern
Tags: flutter, dart, ios, android
Published: 2021-05-06 13:18:02

###Agenda
* Stream
* Cubit
* BLoC

####ติดตามผลงานได้ที่
* **Page:** [https://fb.com/CodeBangkok​](https://fb.com/CodeBangkok​)
* **Group:** [https://fb.com/groups/msdevth​](https://fb.com/groups/msdevth​)
* **Blog:** [https://dev.to/codebangkok](https://dev.to/codebangkok)
* **YouTube:** [https://youtube.com/CodeBangkok](https://youtube.com/CodeBangkok)