teleren/devto huggingface dataset:
Counterintuitive ideas
Tags: innovation
Published: 2021-11-26 11:00:55

---
title: Counterintuitive ideas
published: true
date: 2021-11-21 00:00:00 UTC
tags: innovation
canonical_url: https://jhall.io/archive/2021/11/21/counterintuitive-ideas/
---

Many of the best ideas seem stupid at first.

- Let’s create a free software, created by strangers volunteering their time, to compete with the biggest software companies in the world.
- What if the most effecient way to build automobiles isn’t large batches, but rather single-piece flow?
- Writing tests before you write code improves efficiency.
- Adding people to a project makes it later.
- Two programmers + one keyboard produces more, high-quality software than two programmers + two keyboards.
- More code comments corresponds to less readable code.

Yet every one of these ideas has proven successful, at least in many common situations.

The problem, as I see it, is that often the “obvious” answer blinds us to the “correct” answer.

[_Selling the Invisible_](https://amzn.to/3qXeaGf) by Harry Beckwith, calls this the “crab concept”, because crabs move laterally. Sometimes we need to think laterally, rather than following a head-on line of reasoning.

Are you willing, and perhaps more important, _able_ to challenge obvious ideas to uncover counter-intuitive good ideas? Do you have the personal mindset to engage in lateral thinking? Does your company’s management allow it?

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Bitcoin Technology Fundamentals - Tutorial 1 – Bitcoin Addresses
Tags: bitcoin, cryptocurrency, blockchain, digitalcurrency
Published: 2021-11-21 04:51:04

Youtube video - https://www.youtube.com/watch?v=1_unima-FR8&t=242s

#Bitcoin, #cryptocurrencies, #cryptocurrency #cryptonews #cryptotrading #cryptocurrencies #cryptoadoption #bitcointrading #bitcoinmining #bitcoins #bitcoincash #bitcoinvalue

Bitcoin Technology Fundamentals

In this video series, we will cover Basic to advanced bitcoin technology.

********************************************************************
I am Amitesh Raikwar.
Master of Technology in Electronics & Communication Engineering
Bachelor of Engineer in Electronics & Communication Engineering
I also have Blockchain certification from IBM.
Issued on: 06 JAN 2019 | Issued by: IBM
Verify: https://www.credly.com/go/Ulzl1eEi

********************************************************************
If you wanna support our channel please donate in the below-given link of Paypal / Paytm

________
Paypal
:- https://paypal.me/amiteshraikwar?coun...

Paytm 
:-  Rs. 100/-   - https://paytm.me/d-OGoZn
  Rs. 1001/-  https://paytm.me/MgL-psh
  Rs. 5000/-  https://paytm.me/PR-YL5c
[Solved] enzyme: TypeError: Adapter is not a constructor
Published: 2021-11-21 04:48:32

I get this error using typescript on jest. I found multiple solutions and even the ones that should have to work with my case don't do it.

Now I will review all the solutions to store them in a single place. 

#### 1- Simple mistake

```ts
import { configure } from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
configure({adapter: new Adapter()})
```

Try import your Adapter using the default import and the problem will probably be solved.

```js
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({adapter: new Adapter()})
```

#### 2- I'm using Typescript 😑

Apparently this rarely will work with Typescript, if this is your case, try again the `*` import with a little modification.

```ts
import { configure } from 'enzyme';
import * as ReactSixteenAdapter from 'enzyme-adapter-react-16';
const adapter = ReactSixteenAdapter as any;
configure({ adapter: new adapter() });
```

This time we are parsing our import variable into an `any` type. This solution worked for me 😀.

In case any of these alternatives work for you, feel free to share another one you've tried.

Bays 🍖
Dev.to posts with canonical url idexing on google, why?
Tags: discuss, meta, help
Published: 2021-11-21 04:36:58

Hello guys, i have a blog https://devswisdom.com/ whenever i create a post on my blog i repost it here and add the canonical URL pointing to the original content so google knows that which page is original and to only index that page and not the post which is here.

But all my reposts are getting indexed on google in spite of added canonical tags, here is an example.

If you type "AWS Artifact" on Google, you will see my post on Dev.to
https://dev.to/shivangchauhan7/what-is-aws-artifact-2641

But canonical tag is added on this post and it should not show up on google, the original post is here
https://devswisdom.com/what-is-aws-artifact/

Please help me with this, admins/moderators.
Self-Taught Developer Journal, Day 1: Start a Website and Pep Talk
Tags: beginners, todayilearned, devjournal, codenewbie
Published: 2021-11-21 04:18:43

Today I learned....

## How to start building a website
I had my first experience pair programming today! My friend, [Dwayne](https://twitter.com/dwayne_devs), walked me through making my first website.

We created a navigation bar and hero section. 

[*"A hero section is a full screen section typically consisting of a background image, or video, or illustrations, or animations, with text and sometimes a call to action.*"](https://mbcreative.ca/blog/15-hero-section-design-inspiration/)

I also learned about CSS pseudo-classes. I added the ":hover" keyword to my navigation bar links to change the button color whenever the mouse hovers over them.

[*"A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s)."*](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes)

## To not underestimate myself
I am halfway through the first chapter The C Programming Language. I discovered I retained a lot more than I thought from when I learned about C in CS50. I am going to keep reading through to see if there's any gaps I might be missing.

## It's okay to feel lost
Today, I definitely still felt lost about what I am doing. After some reassurance from a fellow self-taught developer on Twitter, I was able to snap myself out of it. I am planning to join [Virtual Coffee](https://virtualcoffee.io/) and attend my first meet up next Thursday afternoon. I am hoping that joining a community will give me the support I need to make it through.

Please refer to [Starting My Self-Taught Developer Journey]( https://dev.to/jennifer_tieu/starting-my-self-taught-developer-journey-2dga) for context.
Singleton Design Pattern in PHP
Tags: oop, php, singleton, programming
Published: 2021-11-21 04:18:28

`Singleton Design Pattern` is a creational design pattern for Object Oriented Programming. 
Singleton Pattern ensures that only one object of that class exists and provides a single point of access to it for any other code.

In these scenerios, we need a Singleton class instance - 
1. If we don't want to recreat any object second time, then we need to use a way like Singleton.
2. If there is a possibility of Memory optimization and one specific class must call one time, then we use singleton pattern.

Creating a Singleton instance is very simple - 
```php
<?php

class SingletonPatternExample
{
    /**
     * Singleton Instance
     *
     * @var SingletonPatternExample
     */
    private static $instance;

    /**
     * Private Constructor
     *
     * We can't use the constructor to create an instance of the class
     *
     * @return void
     */
    private function __construct()
    {
        // Don't do anything, we don't want to be initialized
    }

    /**
     * Get the singleton instance
     *
     * @return SingletonPatternExample
     */
    public static function getInstance()
    {
        if (!isset(self::$instance)) {
            self::$instance = new self();
        }

        return self::$instance;
    }
}
```
So, we can use this like -
```php
<?php

// We have to call getInstance() static method
$singletonPattern = SingletonPatternExample::getInstance();

// Call our doSomething() method.
$singletonPattern->doSomething();
```

We can't call Singleton like this - 
```php
$singletonPattern = new SingletonPatternExample();
```
It will throw an exception.


Get More example with Extendable Singleton Pattern with trait  and re-usable pattern for PHP - 

https://devsenv.com/tutorials/how-to-make-a-singleton-design-pattern-in-php
Find the closest Color from the Tailwind CSS Color pallet
Tags: tailwindcss, vue, design, webdev
Published: 2021-11-21 03:45:36

## Tailwind CSS color matcher


put your Hex Code and edit the ranges to find the closes match to your color from the tailwind CSS color pallet,

![Screen Shot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eblfikexqggl5c1x5vyx.png)

I'm using the HSL value to compare and find the best match for the color  that you want to find. 
The Background of the result section will use the input value as color, this will help you compare visually to see the best match

## Link

[Tailwind CSS color matcher](https://moh-slimani.github.io/tailwind-css-color-matcher)
[Github](https://github.com/moh-slimani/tailwind-css-color-matcher)
Contributing to Telescope
Published: 2021-11-21 03:42:43

# Overview
Telescope is an open source that combines both web server and client application showing blogs of all Seneca's student who are joining open source class. It is not only a way for Seneca students to contribute to, but a website that people can see the thoughts, journeys of them in the open source world. Contributing to Telescope made me feel happy. 

# Task
My task was getting the number of posts through posts service and displaying it to our newest dashboard page. I used <code>fetch</code> to get the data from the posts service. The data returned back was from the header of the fetch:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kv68o6b0t4f6rx9mvkhf.png)
This file will connect to the <code>index.html</code> which will be shown up to the website:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zenn8meymjf55wdp1mzz.png)
Another important thing was that I needed to add a <code>cors</code> feature to Satellite options in order to get the header from the fetch:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/029rr9vsa83a9rg8dee8.png)

# Challenge
Since I completely new to this project, so for the first time, setting up everything was tough. Installing Docker took me almost 3 days, and to run the website locally, I had to read the documents as well as asking some other people in Telescope project. After everything worked, I sent a Pull Request and this was a big deal for me. I had to fix a lot of things related to the design and files structure. Also I faced many issues related to pushing and rebasing that made me have to aborted and re-made my commits over and over again. After all, everything ran smoothly and all the requests of changes have been accepted.

# Final thought
Although this project was very tough and complicated, I learnt a lot and understood more deeply the concept of Git as well as Cors and Content Security Policy. Also, it made me more confident to contribute more features to Telescope in the future. 

# Links
Telescope repo: https://github.com/Seneca-CDOT/telescope
Issue: https://github.com/Seneca-CDOT/telescope/issues/2419
PR: https://github.com/Seneca-CDOT/telescope/pull/2476
code every day with me
Tags: javascript, programming, 100daysofcode, algorithms
Published: 2021-11-21 03:41:54

##--DAY 25--
Hi, I am going to make #100DaysOfCode Challenge. Everyday I will try solve 1 problem from leetcode or hackerrank. Hope you can go with me until end.
**Now let's solve problem today:**
Problem: Utopian Tree
Detail: [here](https://www.hackerrank.com/challenges/utopian-tree/problem)
My solution (javascript):
```js
function utopianTree(n) {
    let height = 1;
    if(n==0) return 1;
    for(let i=1;i<=n;i++){
        if(i%2!=0) height*=2;
        else height++;
    }
    return height;
}
```
-->*If you have better solution or any question, please comment below. I will appreciate.*
Code Smell 104 - Assert True
Tags: poo, testing, tdd, cleancode
Published: 2021-11-21 03:10:05

*Asserting against booleans makes error tracking more difficult.*

> TL;DR: Don't assert true unless you are checking a boolean

# Problems

- Fail Fast Principle

# Solutions

1. Check if the boolean condition can be rewritten better

2. Favor assertEquals

# Context

When asserting to a boolean our test engines cannot help us very much. 

They just tell us something failed.

Error tracking gets more difficult.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/c54f0b1ee42d6a1aff640507e0bdf625)
```php
<?

final class RangeUnitTest extends TestCase {
 
  function testValidOffset() {
    $range = new Range(1, 1);
    $offset = $range->offset();
    $this->assertTrue(10 == $offset);    
    //No functional essential description :(
    //Accidental description provided by tests is very bad
  }  
}

// When failing Unit framework will show us
//
// 1 Test, 1 failed
// Failing asserting true matches expected false :(
// () <-- no business description :(
//
// <Click to see difference> - Two booleans
// (and a diff comparator will show us two booleans)
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/edf0b1c3339451662bb000055ef5d782)
```php
<?

final class RangeUnitTest extends TestCase {
 
  function testValidOffset() {
    $range = new Range(1, 1);
    $offset = $range->offset();
    $this->assertEquals(10, $offset, 'All pages must have 10 as offset');    
    //Expected value should always be first argument
    //We add a functional essential description 
    //to complement accidental description provided by tests
  }  
}

// When failing Unit framework will show us
//
// 1 Test, 1 failed
// Failing asserting 0 matches expected 10
// All pages must have 10 as offset <-- business description
//
// <Click to see difference> 
// (and a diff comparator will help us and it will be a great help
// for complex objects like objects or jsons)
```

# Detection

[X] SemiAutomatic 

Some linters warn us if we are checking against boolean after setting this condition.

We need to change it to a more specific check.

# Tags

- Test Smells

# Conclusion

Try to rewrite your boolean assertions and you will fix the failures much faster.

# Relations

{% post https://dev.to/mcsee/code-smell-101-comparison-against-booleans-3aic %}

{% post https://dev.to/mcsee/code-smell-07-boolean-variables-3koj %}

# More Info

- [Fail Fast](https://dev.to/mcsee/fail-fast-48dm)

# Credits

Photo by <a href="https://unsplash.com/@joeldevriend">Joël de Vriend</a> on <a href="https://unsplash.com/s/photos/truth">Unsplash</a>  

* * *

> I've finally learned what 'upward compatible' means. It means we get to keep all our old mistakes.

_Dennie van Tassel_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Learning Github Actions - The Great Site Generator 
Tags: cpp, opensource
Published: 2021-11-21 03:09:50

This week I learned about the great uses of Github Actions for this project. I [created a workflow](https://github.com/drew5494/the-great-site-generator/actions/workflows/learn-github-actions.yml) that runs CMake and make on a linux system to compile and run the project. It then runs a command to ensure the project passes all tests with Google Test.  

My partner, @JLi used Catch2 to test his project. It looks very similar to Google Test and I was able to add another test to his project. This test is able to [check if folders are read by the program](https://github.com/joshuali7536/LennahSSG/pull/25). It was fun writing tests for someone else's project as I enjoy ensuring everything is running as smooth as it can be. 

Now that Ive used CI, I realize how useful it can be for testing pull requests in projects before accidentally merging them with mistakes. I hope to keep using it in my future projects!
GM from Tech by Choice
Published: 2021-11-19 22:27:06

The mission of Tech by Choice should be one that everyone supports and benefits from. To see our vision come true, we must be transparent and community-driven. There should never be one person filling every role to keep things going.

Being a membership-based nonprofit with a flat org structure is not enough to support the vision I have for the Tech by Choice community. I spent the last year searching for ways I can genuinely help and sustain the growth of Tech by Choice. To my surprise web 3 has offered a solution through its support of Decentralized Autonomous Nonprofit organizations [Read more about DAOs here](https://medium.com/blockchannel/what-is-a-dao-how-do-they-benefit-consumers-f7a0a862f3dc). We’ve partnered with a Black female NFT artist during the giving season that will create a generative art project to highlight the importance community has with ensuring tech is diverse [view the project here](http://www.communiteanft.art/). We will use a percentage of the funds raised to work with a DAO consultant to support the structural change of Tech by Choice. We will continue to behold our nonprofit status, but our structure internally will change to better support the community and our mission.

Historically when an organization makes a significant change like this, people fear that they will water down what they do. For us, this is the complete opposite. This change will help us support our members more directly and communally. To prove this point, the very first proposal I will submit for our community is to find a way to help our members deal with the [Black Tax](https://www.vox.com/the-highlight/22323477/personal-finance-black-tax-racial-wealth-gap). This is a topic I’ve been vocal about and one that I know the Tech by Choice community has brought up as well. Through this new structure, we will find a way to elevate this burden for our members. 

This is just one example from me, a single member of the community. I know together we will create programs and funds that will support several burdens our members face. But to get there, we have to do this together.   


The Tech by Choice community is one I care for deeply. I will always make time for our mission to ensure marginalized people know tech has a space for them. I hope those who read this message will see this change as me shifting my power and status within this organization as a way to keep it going. I hope people do not make this change as I walk away from giving up on our community.


Valerie Phoenix 
Founder of Tech by Choice
Creating a Custom Connector – Part II
Tags: development, connectors, flow, powerautomate
Published: 2022-06-15 17:22:48

---
title: Creating a Custom Connector – Part II
published: true
date: 2021-11-21 00:43:00 UTC
tags: Development,connectors,flow,PowerAutomate
canonical_url: https://barretblake.dev/2021/11/creating-a-custom-connector-part-ii/?utm_source=rss&utm_medium=rss&utm_campaign=creating-a-custom-connector-part-ii
---

In part I of this post, I demonstrated how to create a custom connector. Now, we'll follow up with a short post on how to use that custom connector in a flow.

The post [Creating a Custom Connector – Part II](https://barretblake.dev/2021/11/creating-a-custom-connector-part-ii/) first appeared on [Barret Codes](https://barretblake.dev).
String Compression Algorithm: JavaScript
Published: 2021-11-21 00:34:08

I recently completed a coding challenge. One of the tasks was to write a string compression algorithm. This is a very popular algorithm, and I will be writing about how to solve it here. 

The task: 
Given a string of letters, if there are consecutive repeating characters, append the character followed by the number of times it is seen. If the character appears only once, do not include a number. 
Ex: compress a string 'aabbcddd', to 'a2b2cd3'


The first steps we'd have to take are: 
1. Split the string into an array to be able to iterate through it 
2. Create a new string, which would hold the compressed version 
3. Create a for loop to iterate through the first string 

```
function compress(string){
let compressed = ""
let stringArray = string.split("")
for (let i = 0; i < stringArray.length; i++){

     }
}
```


Next, we would need to keep track of several things within the for loop:
1. The current count of the consecutive letters with each iteration 
2. The letter that is being counted. 

The function will now look like this: 

```
function compress(string){
let compressed = ""
let stringArray = string.split("")
for (let i = 0; i < stringArray.length; i++){
     let count = 1 
     let letter = stringArray[i]
     }
}

```


We will need to create a while loop to compare letters. The loop will have two conditions: 1) if i is less than the length of stringArray -1, 2) if the current letter in the iteration is the same as the neighboring letter 

When both conditions are met, both the count and index positions will be incremented 

```
function compress(string){
let compressed = ""
let stringArray = string.split("")
for (let i = 0; i < stringArray.length; i++){
     let count = 1 
     let letter = stringArray[i]
    while (i < stringArray.length - 1 && stringArray[i] === stringArray[i + 1] {
   count++
   i++
  }
 }
}
```


For the final part, we want to add the letter and the number of times it appears to the compressed string. Then we want to return the string. 
```
function compress(string){
let compressed = ""
let stringArray = string.split("")
for (let i = 0; i < stringArray.length; i++){
     let count = 1 
     let letter = stringArray[i]
    while (i < stringArray.length - 1 && stringArray[i] === stringArray[i + 1] {
   count++
   i++
  }
if (count === 1){
 compressed += letter 
  } else { 
  compressed =+ letter + count}
 }
}

return compressed
}
```

aaaand done!
Virtual Theatre 
Published: 2021-11-20 23:10:19

Hi, Everyone
I am Django developer. I am doing freelance from last 4 years. One of my client want a virtual theatre website like "scener"

scener reference website.
https://www.scener.com/

Summary: what scener do allow user to login with Netflix, Amazon prime account. User can host a party movie streaming and can will invite the audience to watch movie together. No user can login without Netflix or amazon account. Netflix and amazon account is must to get in party. 

Netflix and Amazon not providing any API to get stream. They only provide movies metadata.

Problem: How I can show Netflix movie stream to y platform. I have to create a Video player that will syn in front of Netflix, amazon movie stream. 
In which language technology should I develop the player. 
Maybe I am not getting right how I can develop this platform.
what react can help me with it ? 

Please anyone suggest from where should I start or give road map to get complete the project using react js, java-script.



Thanks
Yes, these are emoji buttons
Published: 2021-11-20 23:07:52

Take a look at this horrid button in CSS. Click on it.
{% codepen https://codepen.io/ManuTheCoder/pen/JjyVdPr %}
```css
<button style="padding:0;border:0;background:transparent;outline:0;font-size: 100px" onclick="if(this.innerText=='🔲'){this.innerText='🔳'}else {this.innerText='🔲'}">🔲</button>
```
The purpose of this post is to let you know that you can use emojis in JavaScript, CSS, and HTML.