teleren/devto huggingface dataset:
Ubuntu 17.10 Üzerine OpenCV Kurulumu
Tags: opencv, linux, ubuntu, tutorial
Published: 2022-01-22 15:55:07

Herkese merhaba arkadaşlar. Bu yazımda Ubuntu’nun şuanki en güncel sürümüne opencv kütüphanesinin kurulumunu anlatacağım. Kendime kurmaya çalıştım ama çoğu kaynak eski olduğu için kütüphane hataları vs. bir sürü hata ile karşılaştım. Epey uğraştıktan sonra huzura erdim ve sizlerle bunu paylaşacağım.

Hazırsak hemen başlayalım.

**NOT:** Hızlı bir internete sahipken kurulum yapmanız faydalı olacaktır.

İlk olarak bazı kurulması zorunlu paketleri kurarak başlayalım.

```Shell
sudo apt-get install build-essential

sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"

sudo apt-get update

sudo apt-get install libjasper1 libjasper-de
```

Şimdi OpenCV kütüphanesinin github reposundan en güncel versiyonunu bilgisayarımızda açtığımız bir dizine klonlayalım. Aynı dizine gerek duyabileceğimiz OpenCV contrib dosyalarını klonlayalım.

```Shell
mkdir OpenCV

cd OpenCV

git clone https://github.com/opencv/opencv.git

git clone https://github.com/opencv/opencv_contrib.git
```

Şimdi dosyaları derleyip çalıştıracağımız bir dizin oluşturalım.

```
cd opencv

pwd                # Bu komut nerede olduğunuzu görmenizi sağlar

~/OpenCV/opencv/   # Bu ise olmanız gereken dizin. Yani klonladığınız OpenCV'nin içinde olmanız gerek.

mkdir build

cd build
```

Derlemek için OpenCV için gerekli bazı ayarlar yapmamız gerek.

```Shell
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/kullaniciAdiniz/OpenCV/opencv_contrib/modules /home/kullaniciAdiniz/OpenCV/opencv/
```

Sonlara yaklaşıyoruz hadi bakalım 🙂

Bu işlem biraz zaman alacak 🙂

```Shell
make -j2
```

Son olarak;

```Shell
sudo make -j2 install
```

Evvvettt bitti 🙂 Hemen kontrol etmek için şu komutu yazalım;

```Shell
pkg-config --modversion opencv
```

Umarım işlemler başarılı olmuştur. Şimdi ise python ile kullanabilmeniz için ufak bir kurulum yapalım.

```Shell
pip3 install opencv-python
pip3 install opencv-contrib-python
```

Herkese iyi çalışmalar. 🙂

---

[https://ilteriskeskin.github.io/posts/ubuntu-opencv-kurulum/](https://ilteriskeskin.github.io/posts/ubuntu-opencv-kurulum/)
organise python imports with isort
Tags: python, webdev, programming, productivity
Published: 2022-01-22 15:37:43

I discovered isort which sorts the python imports... https://pycqa.github.io/isort/

and used it on my lib yesterday...
https://github.com/byteface/domonic/commit/96a91bbf3ee6f672bc1c0e5978f55e45706392aa

Seems like a cool util and will save me manually shifting imports around.
PERSONAL-WEBSITE🧑‍💻
Tags: portfolio, html, css, javascript
Published: 2022-01-22 15:29:38

After the 2,3 days of sleepless nights here is my webpage. It's my first website, completely written in HTML, javascript, CSS. It is built in such a way that  compatible for any type of screen (responsive).it is published on GitHub and domain is from freenoam.
🔗 https://itsmeyaseen.tk/
Writing Clear Code, Not Clever Code
Tags: amazon, aws, career, professionalpractices
Published: 2022-01-22 15:04:07

In [Practices of an Agile Developer](https://www.amazon.com/gp/product/097451408X), Andy Hunt and Venkat Subramaniam outline a huge list of ways to improve yourself as a software developer. While I found almost every tip in the book to be useful, I found one tip to stand out from the rest, considering it pointed out one of my particularly bad habits: **“Write clear code, not clever code”.**

One of my passions as a programmer is figuring out new and better ways to do the same thing. I love refactoring code and finding out what was being done in 10 lines, I could do in 3. Or as a better measure, doing something with one if else block instead of a triply nested if else statement. Usually this works out great. The code is simpler to maintain, and less complex for all involved.

However, in my endless pursuit of smaller, clearer code, I would often end up with smaller, more confusing code. In 2009, as a member of a 7 person agile team, it was very easy to measure how I was doing in this category: How often did another team member ask me what a piece of code did? Once I began looking at these problematic blocks of code, I noticed a pattern, and began to work on resolving the problem. It doesn’t matter what my particular problem was… what mattered was that I began looking for it!

Pay attention to your team members. Look into why they’re asking you about your code. Maybe there is something you do that makes perfect sense to you, but could be written clearer. Consider the next person who’s going to be looking at your code. Chances are, they’ll be happier looking at clearer code, not clever code. You’ll be happier too.
Machine Learning Business Benifits
Tags: computerscience, machinelearning, programming, ai
Published: 2022-01-22 15:01:16

Machine Learning is a means to extract meaningful insights from raw(unfiltered) data to hep us in solving complex problems quickly. Machine Learning Algorithms learn from data provided to find various insights without explicitly programmed for the same. Machine Learning is evolving at a rapid rate is is being driven and integrated with new computing technologies.

Machine Learning helps in increasing the business scalability and helps in improving business operations, so AI tools and ML Algorithms have gained a tremendous boom in the Analytics Community. The boom is because of factors like growing volume and easy availability of data along with faster processing speed and affordable data storage.

Business Benifits of Machine Learning
Customer Lifetime Value Prediction
Customer ifetime Prediction and Customer Segmentation is one of the challange faced my major companies today. The data available with the companies is so huge and can be used effectively to derive business insights. ML helps in it by predicting customer behavior, purchasing pattern and offers the customer with the offers they desire.

Predictive Maintainence
Manufacturing industries use ML to discover meaningful insights and patterns hidden in the factory data which helps in reducing risks asociated with failures and to eliminate unexpected expenses.

Eliminating Manual Process
Manual data entry can result in duplicate as well as inaccurate data and the corrective maintainence is both costly and time-consuming. Using ML Algorithms, error posessed by following manual processes can be removed.

Detecting Spams
ML Algorithms are actively used in detecting spams by creating new rules using Neural-Networks to detect spams and phishing messages.

Recommendation Engine
Unsupervised learning helps in developing recommendation engines by using customer's history and matching it with the inventory to identify the hidden patterns and group similar services together and suggest tem to the customer, making them to for the services.

Medical Diagnostics
ML in medical diagnosis helps healthcare organizations in improving the patient's health and to reduce costs, using superior diagnostic tools and effective treatment plans. The predictions are drawn using patient records and data sets along with the symptoms exhibited by the patient.

Improved Security
ML is being used rapidly to increase the security of an organization by allowing new-generation providers to build newer technologies, which quickly and effectively detect unknown threats.
Deploying a WordPress Website in AWS
Tags: aws, amazonwebservices, wordpress, database
Published: 2022-01-22 14:57:09

Hello! If you're here to get a feel of AWS and its commonly used services, you are in the right place! This guide will get your feet wet with the basic structure of an AWS Application and will surely be an amazing experience to see your own website deployed.

For all experienced AWS users out there, I know what you might be thinking - "Here goes another WordPress guide", but hear me out!

I am creating this guide for beginners who would like to try out AWS Services and deploy their very first AWS Application. What will be the difference between my guide and the others? I will be explaining this as easy as possible, using analogies and laymen's term, so any beginner can understand and appreciate this lengthy process.

For all of you out there who are new to AWS, gear up because this will be an eye-opener of how amazing AWS can be! I will be providing cost estimates and warnings whenever we provision our resources and make sure that everyone is able to follow without worry.
Portfolio
Tags: portfolio, react, tailwindcss, design
Published: 2022-01-22 14:30:53


---
title: Portfolio
published: true
description: DesignPortfolio
tags: portfolio, react, tailwindcss, design
---
### Thank you to everyone who can visit my website. 
 
 ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qsmtycfxgfuqg2j1w8cg.png)
Website:  https://thiraphat.vercel.app/
I developed my first portfolio
Tags: javascript, portfolio, vue
Published: 2022-01-22 14:49:20

I developed my first portfolio!

After spending a couple of days gathering ideas of how it should look and what content to put, I finally took the step into developing my first portfolio.

It took me a bit long to develop the app because of my job which normally lasts 12-14 hours a day 😪 Tiring, right?

A week later, I finally created my very first portfolio and deployed it in Netlify: https://jeash.netlify.app. 

Happily, I then introduced this to my friends and asked for feedbacks. Most were good, but some recommended that I buy my own domain because any domain with ***.netify.app*** would not look so professional especially if it's your portfolio which represents your profession. 

Not long after, I purchased a domain: https://jeash.tech
🎯 Objects in JavaScripts
Tags: javascript, webdev, programming, 100daysofcode
Published: 2022-01-22 14:38:21

In simple words objects is the collection of name-value pairs. Objects is JavaScript are same as dictionaries in Python , hashtable in c and c++ and hashmap in Java.
The "name" part is a JavaScript string, while the value can be any JavaScript value 

There are two ways of creating the object
1 - using object literal (more convenient)
2 - using new keyword
👇

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

A simple example


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5i8fw8apklcz3emnlbj8.png)
The Error «A Disk Read Error Occurred» or «BOOTMGR is Missing» – How to Fix
Tags: beginners, testing, tutorial, security
Published: 2022-01-22 14:36:08

While working with the computer, you must have seen a number of errors, and one of them can be A disk read error occurred. Press Ctrl + Alt + Del to restart or BOOTMGR is missing. Press Ctrl + Alt + Del to restart. Read this article on the causes behind these errors and how to fix them.

Errors like this can be triggered by many factors such as wrong BIOS configuration, a virus infestation, damage to the hard disk and so on. Here are some possible solutions:

## Disable external storage devices
If there are any external devices connected to your computer, such as DVD or USB drives, disconnect them to see if the error appears again.

![Image description](https://hetmanrecovery.com/pic/blog/a157/disable-external-storage-devices.jpg)

## Check the connection
Although your computer worked all right last time, it doesn’t mean that it will work properly the next time you start it. It is quite possible that such an error can be caused by poor contact with the hard disk, so it’s a good idea to test the quality of connection.

![Image description](https://hetmanrecovery.com/pic/blog/a157/check-the-connection.jpg)

## Check the device with other PCs
In addition to a hard disk problem, other PC components may break down as well. That means that you should check the disk operability with another computer which is in good working condition.

## Check the OS boot priority
Choosing a wrong bot priority in BIOS can also result in one of such errors. If your computer has several storage devices, you should check the boot sequence settings.

![Image description](https://hetmanrecovery.com/pic/blog/a157/check-the-os-boot-priority.png)

## Restore MBR or boot sector
Damage to MBR, the Master Boot Record, can also cause read disk errors. To fix it, you will have to bot from a Windows installation disk or USB drive.

![Image description](https://hetmanrecovery.com/pic/blog/a157/restore-mbr-or-boot-sector.jpg)

Click Next. Select Repair your computer.

![Image description](https://hetmanrecovery.com/pic/blog/a157/restore-mbr-or-boot-sector-02.jpg)

Then Troubleshooting

![Image description](https://hetmanrecovery.com/pic/blog/a157/troubleshooting.jpg)
Ethernaut Hacks Level 11: Building
Tags: solidity, ethereum, openzeppelin, smartcontract
Published: 2022-01-22 14:27:10


This is the level 11 of [Ethernaut](https://ethernaut.openzeppelin.com/) game.

## Pre-requisites
- Solidity [interfaces](https://docs.soliditylang.org/en/v0.8.10/contracts.html#interfaces)

## Hack

Given contract:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface Building {
  function isLastFloor(uint) external returns (bool);
}


contract Elevator {
  bool public top;
  uint public floor;

  function goTo(uint _floor) public {
    Building building = Building(msg.sender);

    if (! building.isLastFloor(_floor)) {
      floor = _floor;
      top = building.isLastFloor(floor);
    }
  }
}
```

`player` has to set `top` to `true` i.e. have to reach top of the building.

But `Elevator` won't let you.... if you comply by the `Building` so religiously. So let's not get so disciplined ;)

Alright so, `goTo` calls the contract at `msg.sender` address that implements `Building` interface to determined if `_floor` is last floor.

Okay, then we'll create a contract `MyBuilding` that inherits `Building` and therefore implements `isLastFloor`:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

interface Building {
  function isLastFloor(uint) external returns (bool);
}

interface IElevator {
    function goTo(uint _floor) external;
}

contract MyBuilding is Building {
    bool public last = true;

    function isLastFloor(uint _n) override external returns (bool) {
        last = !last;
        return last;
    }

    function goToTop(address _elevatorAddr) public {
        IElevator(_elevatorAddr).goTo(1);
    }
}
```

But...although we did implement `isLastFloor` we won't use `_floor` param anywhere to determine if it's last floor. We are not obliged to anyway ;)

We just alternate between returning `true` and `false`, so that 1st call will return `false` and 2nd call returns `true` and so on.

Simply call `goToTop` of `MyBuilding`, with `contract.address` of instance. That'll trigger `Elevator` to call `isLastFloor` of our contract - `MyBuilding`. And since second call sets `top` variable, it is set to `true`.

Verify in console:
```javascript
await contract.top()

// Output: true
```

Started from the bottom now we here (`top`) !

_Learned something awesome? Consider starring the [github repo](https://github.com/theNvN/ethernaut-openzeppelin-hacks)_ 😄

_and following me on twitter [here](https://twitter.com/heyNvN)_ 🙏
#23 - Change it up CodeWars Kata (6 kyu)
Tags: javascript, webdev, tutorial, 100daysofcode
Published: 2022-01-22 14:06:04

##Instructions

Create a function that takes a string as a parameter and does the following, in this order:

Replaces every letter with the letter following it in the alphabet (see note below)

1. Makes any vowels capital
2. Makes any consonants lower case
3. Note: the alphabet should wrap around, so Z becomes A

**Example:**

> Input --> "Cat30" 
> Output --> "dbU30" 
> Process --> (Cat30 --> Dbu30 --> dbU30)

---

##My solution:

```javascript
function changer(s) { 
  s= s.toLowerCase()
    
  return s.split(' ').map(word=>
                          
    word.split('').map(letter=>{
      if(letter === 'z' ) return 'A'
      if(letter === '0')  return '0'
      let x = parseInt(letter) ? letter : String.fromCharCode(letter.charCodeAt(letter.length - 1) + 1)
      if(/([aeiou])/g.test(x)) return x.toUpperCase()
      return x
    }).join('')
                          
  ).join(' ')
  
}
```
---

##Explanation
First I changed all the string to lower case.
> s= s.toLowerCase()

---

After that I splitted the string between every space, this for the ones that are strings with more than 2 words



Example:
1-
> Input--> 'foo'
> Output --> ['foo']

2-
> Input --> 'Hello World'
> Output ['Hello', 'World']

---

Then I mapped this array, and I splitted each word of the array
> Input --> ['Hello', 'World']
> Output --> [['H', 'e', 'l', 'l', 'o'], ['W','o','r','l','d']]

---

After this I used a conditional that checked if the letter is 'z' it would return 'A' if it is '0' it would return '0'

> if(letter === 'z' ) return 'A'
> if(letter === '0')  return '0'

---

Then I did the variable x that checked if you can parseInt(letter) it will return letter, because that means it is a number, if not, it will change the letter for the next one in the vocabulary.

> let x = parseInt(letter) ? letter : String.fromCharCode(letter.charCodeAt(letter.length - 1) + 1)

> 'Cat30'
> ['d','b','u','3','0']

---

After that, I used a conditional that checked with a regular expression if the x variable (that represents the next letter in the vocabulary of the original letter), is a vowel, if it is a vowel it'll .upperCase() it

> ['d','b','u','3','0']
> ['d','b','U','3','0']

---
At the end I just joined the word array

> [['I', 'f', 'm', 'm', 'p'], ['x', 'p', 's', 'm', 'E']]
> ['Ifmmp', 'xpsmE']

---

And I joined and returned the last array for the strings that have spaces between them

> ['Ifmmp', 'xpsmE']
> 'Ifmmp xpsmE'


---

**What do you think about this solution? 👇🤔**

[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata](https://www.codewars.com/kata/58039f8efca342e4f0000023)
Distinct absolute array elements
Published: 2022-01-22 14:00:07

## USing the unordered_set:

```
#include<bits/stdc++.h>
using namespace std;

int main()
{
   int arr[]={-3, -2, 0, 3, 4, 5};
   int n=6;
   unordered_set<int>us;
        int count=0;
        for(int i=0;i<n;i++)
        {
            us.insert(abs(arr[i]));
        }
        cout<<us.size();
  
   
    return 0;
}
```
7 Killer JavaScript One-Liners that you must know
Tags: javascript, beginners, programming, tutorial
Published: 2022-01-22 13:50:54

**1. Generate Random String** 
  if you will ever need a temporary unique id for something. this 
  one-liner will generate a random string for you

```
const randomString = Math.random().toString(36).slice(2);
console.log(randomString); //output- r0zf1xfqcr (the string will be random )
```

**2. Extract Domain Name From An Email**
   you can use the substring() method to extract the domain name 
   of the email.

```
let email = 'xyz@gmail.com';
le getDomain = email.substring(email.indexOf('@') + 1);

console.log(getDomain); // output - gmail.com
```

**3. Detect Dark Mode**
  with this one-liner, you can check if the user is using dark mode ( and then you can update some functionality according to dark mode)

```
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').match;
```

**4. Check if An Element is Focused**
to detect if the element has the focus in JavaScript, you can use the read-only property activeElement of the Document object.

```
const elem = document.querySelector(' .text-input');

const isFocus = elem == document.activeElemnt;

/* isFocus will be true if elem will have focus, and isFocus will be false if elem will not have focus */
```

**5. Check If An Array Is Empty** 
this one-liner will let you know if an array is empty or not.

```
let arr1 = [];
let arr2 = [2, 4, 6, 8, 10];

const arr1IsEmpty = !(Array.isArray(arr1) && arr1.length >0);
const arr2IsEmpty = !(Array.isArray(arr2) && arr2.length >0);

console.log(arr1); //output - true
console.log(arr2); // output - false
```

**6. Redirecting User**
 you can redirect the user to any specific URL using JavaScript.

```
const redirect = url => location.href = url

/* call redirect (url) whenever you want to redirect the user to a specific url */
```

**7. Check If A Variable Is An Array**
You can check if any Variable is an Array or not using the Array.isArray() method.

```
let fruit = 'apple';
let fruits = ["apple", "banana", "mango", "orange", "grapes"];

const isArray = (arr) => Array.isArray(arr);

console.log(isArray.(fruit)); //output - false
console.log(isArray.(fruits)), //output- true
```
React Admin Dashboard with Recharts
Tags: html, css, javascript, react
Published: 2022-01-22 13:40:11

## You can get the template from the link proivided in the description of the video.

### Technologies Used :-
+ REACT
+ SASS
+ Styled Components

### Libraries and Assets Used :- 
+ Styled Components
+ React Icons
+ Recharts
+ Google Fonts
+ ScrollReveal

## To learn how to create this template watch the complete video. You can get the template for free from the link provided in the description of the video.

{% youtube bKhfUrUgWng %}

## Please do like the video and subscribe to the channel. It helps and motivates me to create more content like this.
Sum equal to sum
Tags: cpp
Published: 2022-01-22 13:35:33

## Solution

```
#include<bits/stdc++.h>
using namespace std;

int main()
{
   int a[]={4,11,5,13};
   int n=4;
   unordered_set<int>mp;
   for(int i=0;i<n;i++)
   {
       for(int j=i+1;j<n;j++)
       {
           int sum=a[i]+a[j];
           if(mp.find(sum)!=mp.end())
           cout<<1;
           mp.insert(sum);
       }
   }
   cout<<0;
   
    return 0;
}
```
Choose names for Google, not people
Tags: programming, tutorial, watercooler, webdev
Published: 2022-01-22 13:17:16

> "There are only two hard things in Computer Science: cache invalidation and naming things." 
> 
*- Phil Karlton*

AngularJS was released in 2010 and revolutionized modern frontend development. In 2016, the AngularJS team published a new framework, written in TypeScript and incompatible with AngularJS. They also made the baffling choice to call this framework Angular 2.

Mayhem ensued, confused developers talked to each other about incompatible frameworks. The excellent community documentation AngularJS had built in the form of blogs and StackOverflow answers became an active hindrance for people trying to learn Angular. Undeterred by this, the Angular team doubled down and kept releasing incompatible framework versions, only distinguished by a number.

Five years later, the team announced that AngularJS would be discontinued. Immediately they needed to clarify that they would not discontinue Angular but only AngularJS.

Even with the best documentation, users are going to google for information. They are going to read blogs, ask on StackOverflow and copy answers. So to make it easy on them, please:

- Use unique names for major versions ("Android KitKat" instead of "Android 4.4"). They are easier to include in searches.
- Use error codes (like "Error 34") or slugs (like "ERROR_SOME_NAME") in addition to localized, readable messages. Unique strings enable users with different languages than English to contribute.
- As a user, use Software in English. It makes it easier to google for errors ;).

[This post was originally posted on my website, https://heltweg.org if you like it you might want to look at what else I write :)](https://heltweg.org/posts/)