teleren/devto huggingface dataset:
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2021-09-06 12:00:25

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258fbc6e41.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ You know what the best thing about booleans is?

___A:___ Even if you are wrong, you are only off by a bit.
 -->
How to Export EML File as PDF?
Tags: eml, pdf, file, export
Published: 2021-09-06 11:59:54

EML files are created by various email clients like Windows Live Mail, Mozilla Thunderbird, Outlook Express, eM Client, IncrediMail, DreamMail and many others. Generally EML extension are emails in plain formatting that consist subject and message content of the body. Portable Document Format short for PDF are one of the most used file format globally. The need to convert any data in PDF may arises anytime as PDF is most acceptable file extension in almost all the fields. 

If you have bunch of EML files to be converted in PDF format then you should try **CubexSoft** [**EML to PDF**](https://www.cubexsoft.com/eml/pdf.html) Converter. The software is specially designed to fulfill all the needs of users who wants perfect EML to PDF Conversion solution. The software is designed by team of experienced software developers. All the functions are programmed after keen analysis of user’s demand market of the file conversion program. 

The tool support to move EML files to PDF on all the Windows editions such as 10, 8, 7, 8.1, Vista, XP, etc. The tool perfectly solve user query how to export EML file as PDF with accuracy. The software save all the EML files with attachments in PDF. For this, it offer 3 different options i.e. Embed Attachments to PDF, Extract Attachments Separately and Convert Attachments to PDF.
 
You can save the resultant file at any location in your PC. The EML to PDF Converter tool also provides PDF Page Setting option for customized creation of PDF file. The software working structure is non-technical therefore perfect for both the technical and non-technical user. You are allowed to created single PDF file for all the EML files or separate PDF file for each EML file.

If you have any doubt left unsolved, then clear them out using demo edition of EML to PDF Converter. The demo edition helps in checking performance of the program with free export of 25 EML files in PDF.
Visual Studio 2022 and .NET Maui
Tags: maui, dotnet, mobile
Published: 2021-09-06 11:47:57

09/06/2021
It doesn't work as billed.

After downloading VS2022 preview, and doing all of the Maui co-installs. I thought I was all set up, in fact the Maui-Check program reported the environment was ready to go.  

# Creating the new Maui solution

Using the (dotnet cli) method of creating a new maui solution: 

<code>dotnet new maui -n HelloMaui</code>

The solution was created but the run failed!

# Wasted time

I spent an hour getting Visual Studio 2022 loaded, then went on for another 45 minutes loading up all the MAUI non sense (warning Java's back and you'll get prompts that your Java isn't up to date from now on, every day!)
# Conslusion

For me it's too early but what's worse is that it's billed as being ready. Doesn't MSFT have a QA team? Apparently not.

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

Shame on Microsoft.

![thumbs down](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7x52tgrhvb5r4984f2x4.jpg)
 

> I have 30 years in IT with at least 15 in WPF.  I'm skeptical  regarding Maui or trusting in MSFT.
 
>Think Silverlight, WPF, WinUI, the un-embeddable WebBrowser, Windows 8, the horrible IE which stunk up the universe for over 10 years. This is Maui today. Microsoft's legacy continues.





JWP2021
best clipping path service provider 2021 | Background   removed service provider | Clip Asia
Published: 2021-09-06 11:45:13

We offer high quality hand drawn clipping paths, advanced photoshop masks, shadow effects, We specialize in high-quality, hand-drawn clipping path services, advanced Photoshop masks, shadow effects, photo remodeling and other Photoshop services.
if you needed your photo then let's start free trail today.


Clipp Asia is photo service provider company. Clipping path, background remove, Image masking, Image retouching service provider. If you need your photo then visit this site. Let's start free trail today.
https://clippasia.com/
dotnet restore --interactive not prompting
Tags: dotnet, cli
Published: 2021-09-06 11:22:17

I recently had a situation where doing `dotnet restore` from the command line resulted in 401 responses and adding the `--interactive` didn't work to prompt for credentials.

After some googling I found a [github issue](https://github.com/dotnet/sdk/issues/10189) indicating that [Microsofts Azure Artifacts Credential Provider](https://github.com/microsoft/artifacts-credprovider) should be installed / updated.

TLDR; run `iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -Force"`.
text editors
Tags: devjournal, vim, ruby
Published: 2021-09-06 11:11:39

**t**his **e**ntry e **x** emplifies **t**he **e**ccentric **d**ark **i**ndent-friendly **t**ext editor **o**f **r**adical **s**ource code writers. huh?

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xkef2fp0unpyi7z5fjok.jpg)

how do I love thee, Vim? let me count the ways.


I love thee to the distance til the last word and the breadth of the text wrap and length of each method. My cursor can reach, when typing shift dollar sign. For the ends of arrow keys and ideal use case. I love thee to the level of every u’s and ctrl + r’s. Most quiet need, by keyboard — standard or mechanical. I love thee freely, as cursors to the left strive for right. I love thee purely, as they turn from single quotes to double using ctrl c s. I love thee with macros put to use, In my old griefs, and with my frustrations with colon w or color q. I love thee with a love I seemed to confuse With my lost cursors. I love thee with thee persistent, multi-level undo tree, extensive plugin system, support for hundreds of programming languages and file formats, among other things; and, if God choose, I shall but love thee better after colon q !(bang).

---

further reading: centimentalcomics.com
MongoDB, Mongoose, and MongoDB Atlas (Cloud Service)
Tags: javascript
Published: 2021-09-06 11:09:25

If you, like me, like short, succinct tech articles (like my previous write-up on [a JS spread syntax gotcha](https://dev.to/damms005/javascript-spread-syntax-gotcha-3c8n) and [use cases of VueJs mixins](https://dev.to/damms005/practical-use-cases-of-vue-js-mixins-5911)); and you like daring tech adventures, then you are going to love this piece of The Three < insert-anything-here™️ > - eers.

IMHO, MongoDB is not just a document store, but one that is great for fast bootstrapping, especially at the ideation stage of a project. This is because at this stage, there may be no concrete decision about db schema, etc.; and things may be changing very fast with respect to db schema.

I recently used MongoDB in a project; and being my first time of using it in production, I must say it really helped in bootstrapping. This advantage of MongoDB was made more obvious to me this time around because I used it alongside [PostgreSQL](https://www.postgresql.org) in this same project. The overhead I had in swapping things around in PostgreSQL was relatively higher than in MongoDB.

The part of [Mongoose](https://mongoosejs.com) in all these is the awesomeness and ease it brings to using Mongoose in NodeJS apps. However, I find that it does not play nice with [MongoDB Atlas](https://cloud.mongodb.com), especially that [a weird behaviour is not documented](https://stackoverflow.com/questions/69070246/how-can-local-robo3t-connect-to-a-remote-mongo-db-instance-but-nodejs-fails-wit/69071273).

Specifically, when you need to use Mongoose to connect to a remote MongoDB Atlas db instance, you must set your `authSource` and `ssl` connection parameters appropriately, so that you won't [spend a decade debugging and wiring things up](https://stackoverflow.com/a/69071273/1823554).

So, there it is. I hope you enjoy this piece. See you in the next one!
Push content to bottom of card
Published: 2021-09-18 17:50:22

---
title: Push content to bottom of card
published: true
date: 2021-09-06 10:25:49 UTC
tags: 
canonical_url: https://dcblog.dev/push-content-to-bottom-of-card
---

 ![Push content to bottom of card](https://dcblog.dev/assets/images/blog/development/card-example.png) 

Want to make sure some card content is always at the bottom of their parent cards? _Read on_ to see how.

In this example, we will be looking at how you would ensure these buttons are always pushed to the bottom of the card.

![](https://dcblog.dev/assets/images/blog/development/card-example.png)

## Step-by-step guide

1. 

Add **`d-flex`** to **`.card-body`**

2. 

Add **`flex-column`** to **`.card-body`**

3. 

Add **`mt-auto`** to the content to be pushed down in **`.card-body`**

To see an example of this in action click [jsfiddle.net/vopxn9h9/](https://jsfiddle.net/vopxn9h9/).

This article was based on this stack overflow question found [stackoverflow.com/questions/48406628/bootstrap-align-button-to-the-bottom-of-card](https://stackoverflow.com/questions/48406628/bootstrap-align-button-to-the-bottom-of-card).

Read more on Bootstrap flex utilities [getbootstrap.com/docs/5.0/utilities/flex/](https://getbootstrap.com/docs/5.0/utilities/flex/).
Help: Same nav and footer in the whole portfolio. 
Tags: help, portfolio, nav, footer
Published: 2021-09-06 10:43:24

Hi guys,

I would like to put the same nav and footer in my entire portfolio and I only want to change it in one place, not change them in all the pages one by one. How would you do it? What do you think would be the best or simple method?

I'm using Html, css and bootstrap.

Here is my portfolio www.danitoranzo.com
Thank you for your help.
Use git bisect to see when you broke the tests
Tags: git, programming
Published: 2021-09-06 10:41:37

I wanted to push a number of commits but my tests failed. Naughty me for not running them more often. Anyway, here's how to use `git bisect` to tell when they started failing.

```shell
git bisect start HEAD origin/main
git bisect run npm test
```

You should get a result something like:

```shell
b73399a404433af29d95fb66d7b7facc1de49aa3 is the first bad commit
```

And then you can run:

```shell
git bisect reset
```

when you're done to exit bisect mode and go about fixing things.

## A bit more explanation

Here are some details if you want them.

### Start

```shell
git bisect start HEAD origin/main
```

The syntax here is `git bisect start <known-bad-commit> <known-good-commit>`.

In the example above I've used `HEAD` as a known bad commit, because it's the latest commit. My example assumes the remote is called `origin` and the branch is `main`.

You could narrow the range further, but this will work well if your tests are fast enough, and you don't have too many commits.

### Run

```shell
git bisect run npm test
```

The syntax here is `git bisect run <command>`, where `command` will exit with `0` if all is well and a non-zero code if not. (Read the docs if this doesn't work because there are some exceptions, but should be a fine assumption in most cases.)

If you don't have an automated way of telling whether things are fine, you can also do your testing manually. Run `git bisect bad` or `git bisect good` to mark commits as good as bad. Git will walk you through it.

## Sources

- https://git-scm.com/docs/git-bisect#_examples
How can I optimize my login system code
Tags: help, beginners
Published: 2021-09-06 09:05:44

I currently started to learn Python, and I love to practice so I can learn a bit more. I have written this login system code in Python in order to learn a bit more programming in Python. It works, (I don't know why 😂) and I was wondering if that's how I should do it or not. And also if I can maybe optimize it. 
The next step, is that I want to implement a registration system by using the hashlib module (that I just heard about it, so it can hash the passwords, and also have a json file that stores all the usernames and passwords) of course I know it's not secure nor anything but just for practicing on my computer.

THE CODE : 

```python
# Login Page
def Menu():
    choice = input("LOGIN (L) |OR| REGISTER (R)")
    if choice == "L":
        LoginPage()
    elif choice == "R":
        Register()
    else:
        return False

def Register():
    print("Currently registration are closed. Please try again later.")
failed_attempts = 3
def LoginPage():
    global failed_attempts
    global username
    username = input("Username :")
    password = input("Password :")
    if username == "admin" and password == "lolipop":
        Success()
    else:
        failed_attempts -= 1
        Failed()

def Failed():
    print("Username or password incorrect.")
    if failed_attempts >= 1:
        #LoginPage()
        print(f"Please try again \nYou have {failed_attempts} attempts remaining.")
        LoginPage()
    elif failed_attempts == 0:
        print("Please try again later.")

def Success():
    print("You are successfully logged in", username)

while Menu() == False:
    Menu()
```

Thank you :)
Data Structures: Bidirectional Map
Tags: oop, computerscience, algorithms, datastructures
Published: 2021-09-06 10:13:14

---
title: Data Structures: Bidirectional Map
published: true
description: Quick tutorial how to implement Bidirectional map on TypeScript language
tags: #oop #computerscience #algorithms #datastructures
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ad6renhvgl49pke8gcjh.png
---

In computer science, a bidirectional map is an associative data structure in which the *(key,value)* pairs form a one-to-one correspondence. Also known as bijective map. [Article on Wikipedia](https://en.wikipedia.org/wiki/Bidirectional_map).

It is not widely used data structure in web development, but in some cases really quite useful, for instance in encryption.

Let's describe our goal. Implement data structure, where following operations are performed in constant time:

* Get value by key
* Get key by value
* Remove record by key
* Remove record by value
* Check for the existence of key
* Check for the existence of value
* Get the size of the map

Implementation below:

```ts
class BidirectionalMap<Key, Value> {
  private readonly map: Map<Key, Value>;
  private readonly inverseMap: Map<Value, Key>;

  constructor() {
    this.map = new Map();
    this.inverseMap = new Map();
  }

  clear(): void {
    this.map.clear();
    this.inverseMap.clear();
  }

  deleteKey(key: Key): boolean {
    if (!this.hasKey(key)) {
      return false;
    }

    const value = this.getValue(key)!;
    this.inverseMap.delete(value);
    return this.map.delete(key);
  }

  deleteValue(value: Value): boolean {
    if (!this.hasValue(value)) {
      return false;
    }

    const key = this.getKey(value)!;
    this.map.delete(key); 
    return this.inverseMap.delete(value);
  }

  entries(): IterableIterator<[Key, Value]> {
    return this.map.entries();
  }

  getKey(value: Value): Key | undefined {
    return this.inverseMap.get(value);
  }

  getValue(key: Key): Value | undefined {
    return this.map.get(key);
  }

  hasKey(key: Key): boolean {
    return this.map.has(key);
  }

  hasValue(value: Value): boolean {
    return this.inverseMap.has(value);
  }

  get isEmpty(): boolean {
    return this.size === 0;
  }

  keys(): IterableIterator<Key> {
    return this.map.keys();
  }

  set(key: Key, value: Value): void {
    if (this.hasKey(key) || this.hasValue(value)) {
      throw new Error('Key or Value already exists');
    }

    this.map.set(key, value);
    this.inverseMap.set(value, key);
  }

  get size(): number {
    return this.map.size;
  }

  values(): IterableIterator<Value> {
    return this.inverseMap.keys();
  }
}
```

Basically we can consider this data structure as extending of Map class. Current implementation could be improved by adding `forEach` method and iterable protocol, which will allow to define iteration behavior of Bidirectional Map. Let me know in comments if your interesting to know, how to do it exactly.
Binary Search vs Simple Search
Tags: algorithms
Published: 2021-09-06 10:00:51

I have been reading Gorkking Algorithms by Aditya Y.Bhargava. The book is one of the most interesting and enjoyable books about algorithms, so I thought I would share insights from each chapter.

Chapter one is mainly  about the differences between simple search and binary search, the differences are as follow:

      “study case searching for number 10 in a list of 10 elements”
      
    • simple search would loop on each element check if it is number 10 in case number 10 is the last element we would loop 10 times to reach our element …. what is the list is 1000,000 elements?
      
    • Binary search is one of the searching algorithms that requires a sorted list as an input and outputs the location of the required element or null if doesn’t exist.
      
    • Binary search works as follow => “we are still working on our 10 elements list”
    1. Low => 0   first element of the list
    2. high => length(list) – 1  the last element of the list
    3. mid => (low + high) / 2
    • check if number 10 is equal to mid if yes … Congratulations number 10 is found
    • if number 10 is greater than mid … update low value to mid and recalculate mid value
    • if number 10 is less than mid update high value to mid and recalculate mid value 
      “IN THIS STEP WE ELIMINATED THE LIST BY HALF”
    • Repeat the past two steps until 10 is found.

    • binary search would find an element in a list of 10 elements in only 3 steps if the element is the last element… if it is a list of 1000,000 elements it would take 20 steps only.
      
    • simple search complexity according to big O notation is O(n).
      
    • binary search complexity is O(log n).
Creating Google Keep Like Top App Bar with Android (Jetpack Compose)
Tags: android, jetpackcompose, appbar
Published: 2021-09-06 09:51:18

Below given videos shows step by step instructions to create Google Keep like top app bar.


{% youtube LowTj_0K_Dk%}

If you want to directly look at the code then here is the link to Github repository for the same - {% github akki-jat/Google-Keep-Like-TopAppBar %}
Configuring Tailwindcss for Laravel
Tags: tailwindcss, laravel
Published: 2021-09-06 09:46:45

Every time I needed to config tailwindcss for a  laravel project I always google search on how to config tailwindcss for laravel.
So, I came up with the idea of writing a blog to document for myself.

## Create Laravel a New Laravel Project
```
laravel new [name of project]
```

## install Composer packages
```
composer install
```

## Install npm Packages
```
npm install
```

From here on we start configuring tailwindcss for laravel

##Install tailwind
```
npm install tailwindcss
``` 

## Generate tailwind configuration file
```
npx tailwindcss init
```
add the purge file directory and i added Mode to use JIT(Just-in-Time). I mostly use jit because I love generating my styles on-demand.
![image1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1otv6zem6icflqwc39n.png) 

## configure tailwind with laravel mix
you need to require tailwind in laravel-mix
![Image2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6t263qmtmj81zzpghhvi.png)

## Include tailwind in your CSS
open ./resources/css/app.css and include tailwind

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

## Import styles to your blade file
```
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
```

## Run npm watch
```
npm run watch
```
you should see this
![Image4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rqdvjfw5q2v1edmdf82h.png)

you can now start adding your classes to your html elements. Your styles will with jit(just-in-time) compiler
Github shortcuts that will make sure that you don't have to use your mouse while browsing 
Tags: github, git
Published: 2021-09-06 09:25:27

You must've heard that pressing the "." key in any Github repository will open it in an online code editor.

But here are a few more shortcuts which will ensure that you don't have to touch the mouse again when using Github

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


### TL;DR

1. Sitewide shortcuts
2. Go to shortcuts
3. Editing code shortcuts
4. Browsing the code shortcuts
5. Notifications
6. Make Changes in a pull request


## Getting started with keyboard shortcuts

Before I bore you out with all shortcuts or make you remember all of them, you just have to press the "?" key or "Shift + /" and you will see a dialog box which has all the shortcuts that work on github.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qgcj4h3z17opetlhuzgf.png)
 

## Site wide shortcuts

- `s` or `/` will focus the search bar

- `j` and `k` will move selection up and down respectively

- `x` to toggle selection

- `o` or `enter` to open selection

- `esc` to close selection



## Go to Shortcuts

- `g` + `c` -> Go to code

- `g` + `i` -> Go to issues

- `g` + `p` -> Go to PR

- `g` + `b` -> Go to Projects

- `g` + `d` -> Go to Homepage of current account

- `g` + `n` -> Go to your notifications



## Editing the source code

- `ctrl` + `b/i` -> Markdown formatting for bolding/italicizing text

- `ctrl` + `k` -> Markdown formatting for creating link

- `e` -> Edit source code

- `alt` + `g` -> Jump to line

- `ctrl` + `shift` + `p` -> Toggle between edit file and preview file
 


## Browsing the source code

- `t` -> Activates the file finder

- `w` -> Switch to a new branch or tag

- `y` -> Expand a URL to its canonical form.

- `i` -> Show or hide comments

- `a` -> Show or hide annotations 

- `b` -> Open blame view.


## Notifications

- `e` -> Mark as done

- `shift` + `u` -> Mark as unread

- `shift` + `i` -> Mark as read

- `shift` + `m` -> Unsubscribe


## Make changes in pull request

- `c` -> Open list of commits

- `t` -> Open the list of changed files

- `j/k` -> Move selection down/up in the list



That was it for this post. If you liked it don't forget to

- Hit the 🧡 button

- Follow @ShubhraCodes for more such informative posts