teleren/devto huggingface dataset:
Who is to blame when a project fails?
Tags: blame, blamegame, projectfailure
Published: 2020-09-22 07:38:55

Large projects continue to fail, often with disastrous results for the organizations involved. Do you know the reasons they fail and how to avoid them? Why does this kind of thing keep happening?

Let’s discover the ways to secure a stable and efficient development lifecycle of yours.

##It’s not me, it’s you
How many business relationships have ended with those words? Blame and game — two words that should never be joined together.

The blame game is no fun to play and there are never any winners. The truth is, project success depends on each and every team member. Every single person’s motivation and proficiency matter.

Actually, there are so many reasons that the project fails: unclear project requirements, lack of timely testing, lack of experienced project manager, poor communication, etc. Blame isn’t a good thing on any project, regardless of whether resources are collocated or not. In fact, you would waste your time looking for who is blamed, better try to take it, and find new solutions to rescue from failure.

##Who is to blame?
All projects are like a Boat where a leader will show the direction, motivate the team members, and provide them with positive energy from time to time to make sure that all team members remain committed towards a single goal of achieving the project completion milestones.

But often we have seen that leaders forgot to do the above-said part i.e., but expect a good result and start pinpointing fingers to an individual by saying he has a wrong attitude and has not got the right skill set to drive the boat or the project. This eventually results in confusion & misunderstandings.

Product Owners or customers /stakeholders are set to be involved throughout the Sprint Activities and Development efforts and play a very crucial role in the success of a product.

He ensures that the Product Backlog items are transparent & clearly expressed and everyone in the team holds the same understanding of the item.

Remember every project is teamwork and it is the coordination among leaders and other team members which determines the success of the project.

**Ruslana** is a Lead Generation Manager at [JetThoughts](https://www.jetthoughts.com/). Follow her on [LinkedIn](https://www.linkedin.com/in/ruslana-brykaliuk-970016135/).
>  *If you enjoyed this story, we recommend reading our [latest tech stories](https://jtway.co/latest) and [trending tech stories](https://jtway.co/trending).*
Leetcode September Day14
Tags: python, computerscience
Published: 2020-09-15 07:10:59

Problem - 

>You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night.

>Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police

Example = 
"""
Input: nums = [1,2,3,1]
Output: 4
Explanation: Rob house 1 (money = 1) and then rob house 3 (money = 3).
             Total amount you can rob = 1 + 3 = 4.
"""
Intuition - One approach could be to be greedy i.e. pick the max out of three rob it , move on and again pick the max out of the other 3 possibilities.

However, we can miss some cases here, as we don't know what values lie in future. 
Consider following scenario - `[2,4,8,40]`
If we are greedy we will pick 8. But if we pick 4 we would be able to pick 40 as well and result will be 44.
So, greedy won't work here. We need to enumerate all possibilities/states. So, we will do that. And we will use memoization to reduce the Time Complexity. And because we are using memoization, we term it as a dp solution.
Solution - 
```
class Solution:
    def rob(self, nums: List[int]) -> int:
        cache = {}
        def dp(idx):
            if idx < 0:
                return 0
            else:
                res = cache.get(idx, None)
                if res is not None:
                    return res
                else:
                    res = max(dp(idx-1), dp(idx-2) + nums[idx])
                    cache[idx] = res
                    return res
        return dp(len(nums)-1)
        
```
Announcing Jupiter Release 0.5.0
Tags: jupiter, post
Published: 2020-09-27 05:15:18

---
title: Announcing Jupiter Release 0.5.0
published: true
date: 2020-09-22 07:20:05 UTC
tags: jupiter,post
canonical_url: https://horia141.com/announcing-jupiter-0.5.0.html
series: "Jupiter Dev Log"
---

As promised, the `0.5.0` release comes much faster than the `0.4.2` one. It includes a single change, namely [smart list](https://jupiter-goals.readthedocs.io/en/stable/concepts/smart-lists/). It’s a significant addition however, and the first foray outside task-planning for Jupiter.

Smart lists essentially are lists. You can use them to build lists of books to read, movies you’ve watched, etc. Long term, there’s gonna be some actual smartness added to them - syncing with YouTube, or Amazon, or Spotify, but right now they’re pretty basic.
#webDev #VanillaJS
Published: 2020-09-22 07:11:36

#Performance
<b>LuxTech Academy</b> had a <em>100daysofcode</em> challenge .I am half of the days and I learned something quite interesting 
Every javascript beginner is always told to  master the basics first the exceed to the intermediate level.Something funny is they are not told  how to improve .So today we shall discuss on perfomance on arrays.

<b>Should work with the front of an array or the back of an array?</b>

Working on the end of an array would boost your performances.<code>push() & pop()</code> work fast compared to <code>shift() & unshift()</code> 

When working with <code>shift()</code>  the following happens:-
<ul>
<li>The element with the index <code>0</code> is removed</li>
<li>All elements to be moved to the left</li>
<li>Update the length property</li>
</ul>
<b>The more elements in the array, the more items to move , the more  memory operation to perform</b>

As for  <code>push() & pop()</code> no moving of  array items is involved.<code>pop()</code> cleans the index and shortens the length
Hence working with the <b>end of an array is more effective</b>
Selenium: Determining the effective background color 
Tags: java, selenium, testing, tutorial
Published: 2020-09-22 07:01:19

Recently I did some Selenium test bugfixes (basically trying to solve problems QA engineers were lost at). One of the problems was trying to determine effective background color of a div. 

Let’s see this example html

```html
<!DOCTYPE html>
<html lang="en">
<head>
    ...
</head>
<body style="background-color: black;">
    <div id="myDiv" style="color: white;">DEV.TO</div>
</body>
</html>

```
My goal was to get the background color of `#myDiv`. 

The obvious solution what I tried was getting the css property background color from that element.

```java
WebElement element = driver.findElement(By.cssSelector("#myDiv"));
element.getCssValue("background-color");

```

This gets me `rgba(0, 0, 0, 0)` instead of the expected black.

I googled a bit and found an solution that should compute effective property via JavaScript. It looked like this.

```java
WebElement elemement = driver.findElement(By.cssSelector("#myDiv"));
String computedStylePropertyScript = "return window.document.defaultView"
                 + ".getComputedStyle(arguments[0],null).getPropertyValue(arguments[1]);";
((JavascriptExecutor) driver).executeScript(computedStylePropertyScript, elem, "background-color");
```

Still gets `rgba(0, 0, 0, 0)`.

Why is that? 

I googled a lot more and find out that modern browsers treat `rgba(0, 0, 0, 0)` as transparent color and will mark as effective one. 

Not good for me.
So, my solutions need to be to go in, find parent div and check color of that. If it’s still transparent go deeper.  To make this not infinite loop let’s end on body tag. If we find no color until that, there is probably no color specified. 

My code looks like this.

```java
private String getBGColor(WebElement elementToSearch) {
    WebElement current = elementToSearch;
    while(isTransparent(current.getCssValue("background-color"))) {
        if (current.getTagName().equals("body")) {
            return null;
        }
        // Find Parent
        current = current.findElement(By.xpath("./.."));
    }
    return current.getCssValue("background-color");
}

private boolean isTransparent(String color) {
    String colorMod = color.replaceAll("\\s+","").toLowerCase();
    return Arrays.asList("transparent","","rgba(0,0,0,0)").contains(colorMod);
}
```

You can call it like this.

```java
WebElement element = driver.findElement(By.cssSelector("#myDiv"));
getBGColor(element);
```

And it works, it gives you the correct black color. 

But. There are always some buts. It’s naïve implementation, if you have absolutely positioned elements (your element is not rendered in the parent div) this will break down. 

---

If this is interesting to you, you can follow me on [Twitter](https://twitter.com/pavel_polivka).
Learn Data Science - Full Course for Absolute Beginners
Tags: datascience, python, machinelearning
Published: 2020-09-22 06:58:44

Learn Data Science is this full tutorial course for absolute beginners. Data science is considered the "sexiest job of the 21st century." You'll learn the important elements of data science. You'll be introduced to the principles, practices, and tools that make data science the powerful medium for critical insight in business and research. You'll have a solid foundation for future learning and applications in your work. With data science, you can do what you want to do, and do it better. This course covers the foundations of data science, data sourcing, coding, mathematics, and statistics.

💻 Course created by Barton Poulson from datalab.cc.
🔗 Check out the datalab.cc YouTube channel: https://www.youtube.com/user/datalabcc
🔗 Watch more free data science courses at http://datalab.cc/

⭐️ Course Contents ⭐️
⌨️ Part 1: Data Science: An Introduction: Foundations of Data Science
  - Welcome (1.1)
  - Demand for Data Science (2.1)
  - The Data Science Venn Diagram (2.2)
  - The Data Science Pathway (2.3)
  - Roles in Data Science (2.4)
  - Teams in Data Science (2.5)
  - Big Data (3.1)
  - Coding (3.2)
  - Statistics (3.3)
  - Business Intelligence (3.4)
  - Do No Harm (4.1)
  - Methods Overview (5.1)
  - Sourcing Overview (5.2)
  - Coding Overview (5.3)
  - Math Overview (5.4)
  - Statistics Overview (5.5)
  - Machine Learning Overview (5.6)
  - Interpretability (6.1)
  - Actionable Insights (6.2)
  - Presentation Graphics (6.3)
  - Reproducible Research (6.4)
  - Next Steps (7.1)
    
⌨️ Part 2: Data Sourcing: Foundations of Data Science (1:39:46)
  - Welcome (1.1) 
  - Metrics (2.1)
  - Accuracy (2.2)
  - Social Context of Measurement (2.3)
  - Existing Data (3.1)
  - APIs (3.2)
  - Scraping (3.3)
  - New Data (4.1)
  - Interviews (4.2)
  - Surveys (4.3)
  - Card Sorting (4.4)
  - Lab Experiments (4.5)
  - A/B Testing (4.6)
  - Next Steps (5.1)

⌨️ Part 3: Coding (2:32:42)
  - Welcome (1.1)
  - Spreadsheets (2.1)
  - Tableau Public (2.2)
  - SPSS (2.3)
  - JASP (2.4)
  - Other Software (2.5)
  - HTML (3.1)
  - XML (3.2)
  - JSON (3.3)
  - R (4.1)
  - Python (4.2)
  - SQL (4.3)
  - C, C++, & Java (4.4)
  - Bash (4.5)
  - Regex (5.1)
  - Next Steps (6.1)
         
⌨️ Part 4: Mathematics (4:01:09)
  - Welcome (1.1)
  - Elementary Algebra (2.1)
  - Linear Algebra (2.2)
  - Systems of Linear Equations (2.3)
  - Calculus (2.4)
  - Calculus & Optimization (2.5)
  - Big O (3.1)
  - Probability (3.2)
          
⌨️ Part 5: Statistics (4:44:03)
  - Welcome (1.1)
  - Exploration Overview (2.1)
  - Exploratory Graphics (2.2)
  - Exploratory Statistics (2.3)
  - Descriptive Statistics (2.4)
  - Inferential Statistics (3.1)
  - Hypothesis Testing (3.2)
  - Estimation (3.3)
  - Estimators (4.1)
  - Measures of Fit (4.2)
  - Feature Selection (4.3)
  - Problems in Modeling (4.4)
  - Model Validation (4.5)
  - DIY (4.6)
  - Next Step (5.1)

{% youtube pRJkERVL2qE %}
Which is better Python or C++?
Tags: python, csharp, career
Published: 2020-09-22 06:52:17

Programming Languages are tools. Tools selection comes after deciding what you want to do. Asking this question means that you are beginner and don’t know which programming language to learn. So In this case Selecting Python is better 

when you start to learn programming. Python is simple but powerful, You will learn about Abstraction and how to solve your problems quickly.

When you start programming using a simple and very productive language like Python you will love it because you will make big progress in little time and you will face little problems.

After you learn programming this way (The simple way) you will beat the fear of programming, You already learn how to write programs, how to debug them, and how to create something useful. Later you may face limitations in the language 

itself (Need for more performance, Implementation of more advanced algorithms that play with pointers, etc). In this case you can learn C or C++ and you can write extensions for Python in these languages.

Later you can develop complete projects in C or C++. Your knowledge in Python will help you during learning C or C++. What you will find different is just Static Typing, Memory Management and some other simple concepts.

So Learning Python Then C Then C++ —-> Better Chance of Success

But Learning C Then C++ Then Python —-> You May Hate Programming

So why starting with C/C++ is not right in 2020 ?

Because your progress will be slow, You will live a lot with old fashion software before you jump to libraries for GUI, Games, Web and more. You will face challenge (Many Crashes that you will find it hard to solve while you are less 

patient!)

This doesn’t mean that learning C or C++ as your first language is not possible. Sure It’s possible and we teach these languages in the University, But we understand the students feelings when they start learning these language and spend 

most of their time in the console/terminal window while they see in the practice more high level languages in usage.

C/C++ is very important in many domains (Low Level Programming, High Performance Software, Real-time Application, Operating Systems, Game Engine, Embedded Systems, etc)

When you start to think about working in these domains, You will find C/C++ is a better match than other scripting language that maybe more perfect for many web applications.

Meet the Experts for Better Guidence : https://nareshit.com/python-online-training/
Neovim auto select suggestions using coc-vim
Tags: vim, tutorial
Published: 2020-09-22 06:49:08

I do a lot of pair programming using `vi` and `tmux` so I try to accommodate those I pair with by adding features into `vi` that are similar to those in other IDEs.

I have been pairing with a colleague over the past few days and I noticed that every time a suggestion dialog would appear we ended up on the next line down and partially typed word above.  Come to find out that Intellij has this nice option to autocomplete suggestions by auto selecting them as you type and auto filling if return is pressed.

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

Here is what I did to get this to work.

## Requirements

- neovim 4.4 or greater
- [coc-vim](https://github.com/neoclide/coc.nvim)

I am going to just copy a segment from the coc-vim README and plug it into the `~/.config/nvim/init.vim` file.

```
" --------------------------------------------------------
" SETTINGS START

set completeopt=longest,menuone

" SETTINGS END
" --------------------------------------------------------

" --------------------------------------------------------
" COC-VIM TAB SETTINGS START

" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

function! s:check_back_space() abort
  let col = col('.') - 1
  return !col || getline('.')[col - 1]  =~# '\s'
endfunction

" Use <c-space> to trigger completion.
if has('nvim')
  inoremap <silent><expr> <c-space> coc#refresh()
else
  inoremap <silent><expr> <c-@> coc#refresh()
endif

" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
" <cr> could be remapped by other vim plugin, try `:verbose imap <CR>`.
if exists('*complete_info')
  inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>"
else
  inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
endif

" COC-VIM TAB SETTINGS END
" --------------------------------------------------------
```

Then add the following setting to `~/.config/nvim/coc-settings.json` file.  In `vi` execute `:CocConfig`

```
"suggest.noselect": false
```
PSR-7 routes processing in Mezon Router
Tags: php, psr7, framework, router
Published: 2020-09-22 06:44:45

Originally Mezon Router was not designed to be PSR-7 compatible. But one of the latest features have made it possible. You can use middleware for this purpose. For example:

```php
$router = new Router();
$router->addRoute('/user/[i:id]', function(\Nyholm\Psr7\Request $request){
    // work here with the request in PSR-7 way

    $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory();

    $responseBody = $psr17Factory->createStream('Hello world');
    $response = $psr17Factory->createResponse(200)->withBody($responseBody);
    (new \Zend\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response);
});

$router->registerMiddleware('/user/[i:id]', function(string $route, array $parameters){
    $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory();

    $creator = new \Nyholm\Psr7Server\ServerRequestCreator(
        $psr17Factory, // ServerRequestFactory
        $psr17Factory, // UriFactory
        $psr17Factory, // UploadedFileFactory
        $psr17Factory  // StreamFactory
    );

    return $creator->fromGlobals();
});
```

The best thing about it - if you don't use PSR-7 in your project, then you don't "pay" for it )

# Learn more

More information can be found here:

[Twitter](https://twitter.com/mezonphp)
[Mezon Framework](https://github.com/alexdodonov/mezon)

## It will be great if you will [contribute](https://github.com/alexdodonov/mezon-router) something to this project. Documentation, sharing the project in your social media, bug fixing, refactoring, or even [submitting issue](https://github.com/alexdodonov/mezon-router/issues) with question or feature request. Thanks anyway )
[Java] Adding Shadow Effects to Shapes in PowerPoint
Tags: java, powerpoint, shadoweffect
Published: 2020-09-22 06:39:54

In a PowerPoint document, adding shadow effects to shapes can enhance the three-dimensional sense of these shapes and make them look more vivid. This article will introduce how to add shadow effects to shapes in PowerPoint by using Free Spire.Presentation for Java. In addition to the PresetShadowEffects shown in this article, you can also add InnerShadowEffect, OuterShadowEffect and SoftEdgeEffect, etc.

**Installation**
**Method 1:** Download the [Free Spire.Presentation for Java](https://www.e-iceblue.com/Download/presentation-for-java-free.html) and unzip it. Then add the Spire.Presentation.jar file to your project as dependency.

**Method 2:** You can also add the jar dependency to your maven project by adding the following configurations to the pom.xml.

```xml
<repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.presentation.free</artifactId>
        <version>2.6.1</version>
    </dependency>
</dependencies>

```


**Add Shadow Effect:**

```java
import com.spire.presentation.*;
import com.spire.presentation.drawing.*;
import java.awt.*;
import java.awt.geom.Rectangle2D;

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

        //Create a Presentation instance
        Presentation ppt = new Presentation();

        //Get the first slide
        ISlide slide = ppt.getSlides().get(0);

        //Add a shape to slide.
        Rectangle2D rect = new Rectangle2D.Float(120, 100, 150, 300);
        IAutoShape shape = slide.getShapes().appendShape(ShapeType.RECTANGLE, rect);

        //Fill the shape with a picture
        shape.getFill().setFillType(FillFormatType.PICTURE);
        shape.getFill().getPictureFill().getPicture().setUrl("C:\\Users\\Administrator\\Desktop\\cow.png");
        shape.getLine().setFillType(FillFormatType.NONE);
        shape.getFill().getPictureFill().setFillType(PictureFillType.STRETCH);

        //Set shadow effect
        PresetShadow presetShadow = new PresetShadow();
        presetShadow.setPreset(PresetShadowValue.BACK_RIGHT_PERSPECTIVE);
        presetShadow.getColorFormat().setColor(Color.lightGray);

        //Apply the shadow effect to shape
        shape.getEffectDag().setPresetShadowEffect(presetShadow);

        //Save the document
        ppt.saveToFile("output/ShapeShadow.pptx", FileFormat.PPTX_2013);
    }
}
```

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