teleren/devto huggingface dataset:
( YouTube Tutorial ) Multi-Conditional Booleans For Games
Tags: programming, tutorial, gamedev, csharp
Published: 2020-12-25 14:51:52

# What are multi-conditional booleans?
Multi-Conditional booleans, as the name suggests, are bool values that can be true or false under multiple conditions. For example, in your game you might have conditions under which your player character is invincible. Let's consider two states: The player is invincible if they are equipped with a *Shield* or they are invincible for 5 seconds after they choose to *Revive* in the game.

# What happens if you implement these with a single boolean?
Suppose you have a boolean called *_invincible* that is set to *true* or *false* depending on the current player state. Now the player dies in the game and chooses to *Revive*. You set the bool value to *true*. Now before 5 seconds elapse, the player equips the *Shield*. You again set the boolean to *true* (or you may check if it's already true and not set it to the same value). After 5 seconds of *Revive* elapse you set the boolean to *false*, and now we have a problem. The player is equipped with a *Shield* and is NOT invincible.

# How do multi-conditional booleans help with this?
Multi-conditional boolean is a wrapper class, that uses bitwise operations to determine the final state of the boolean. We reserve bits of an integer, one for each condition under which the player can be invincible. In the example above, we will reserve the first bit for *Revive* and the second bit for *Shield*. We set the corresponding bit to '1' or '0' depending on if that particular condition is *true* or *false*. The multi-conditional boolean is false when all the bits are set to 0, i.e the integers value is 0. If it is greater than 0 then the multi-conditional boolean is true.

In the following tutorial, I show you how to implement multi-conditional booleans in your games using Unity and C#.

[Multi-Conditional Booleans](https://youtu.be/peckZFJCWXE)

P.S: For more tutorials and game dev content please **SUBSCRIBE!**
Advent of Code 2020 Solution Megathread - Day 25: Combo Breaker
Tags: adventofcode, challenge
Published: 2020-12-25 14:40:44

---
title: Advent of Code 2020 Solution Megathread - Day 25: Combo Breaker
published: true
description: We're hacking our hotel room on Christmas!
tags: adventofcode, challenge
series: Advent of Code 2020
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/wir9vpb23y9kxur8qh2b.png
---

Christmas Christmas Christmas Christmas Christmas!

## The Puzzle

In [today’s puzzle](https://adventofcode.com/2020/day/25), we finally made it! But we have to hack our way into our room by spoofing the key card’s cryptographic handshake.

Thank you so very much for working through these with me. It’s been really fun seeing everybody’s solutions and working together on these. Whatever you are celebrating or not celebrating this season, I wish you a very blessed Christmas from our family and I hope your 2021 is filled with lots of love and joy. Thanks for being an amazing community and merry coding!

## The Leaderboards

As always, this is the spot where I’ll plug any leaderboard codes shared from the community.

```
Ryan's Leaderboard: 224198-25048a19
```

If you want to generate your own leaderboard and signal boost it a little bit, send it to me either in a DEV message or in a comment on one of these posts and I'll add it to the list above.

## Yesterday’s Languages

TBD (on mobile now!)

Merry Coding.
Merry Christmas!
Tags: php, phalcon, phalcon4, phalcon5
Published: 2021-03-31 18:33:14

---
title: Merry Christmas!
published: true
date: 2020-12-25 14:35:48 UTC
tags: php,phalcon,phalcon4,phalcon5
canonical_url: 
---

The Phalcon Team wishes all of our friends, contributors, developers and users of the framework a Merry Christmas!. We hope that the new year will bring health and happiness to you and your loved ones!<!--more-->

> **A huge thank you to all of our contributors and the community!!**

2020 certainly has been an _interesting_ year to say the least. We did go through it through, and in a few days 2021 will be with us. Looking forward to newer and better things and v5 of course (which is coming along nicely)!

<3
🎄 Deck the Halls 🎄
Tags: codepen
Published: 2020-12-25 14:19:13

<p>Sing along with a silly fractured Christmas Carol.
Decorate the page with Christmas ornaments.
Have a crazy bit of Yule-Tide fun!</p>

{% codepen https://codepen.io/orvilleChomer/pen/QWKvvWB %}

Merry Christmas!
Day 2 of 100DaysOfCode: Decimal to Binary
Tags: 100daysofcode, python, beginners, codenewbie
Published: 2020-12-25 14:12:42

This second day of my #100daysofcode. I gave my time to learn new concept about Python from Coursera in a topic Python Data Structure(File read/write and lists) etc. Again I completed one challenge. Here is a code which was converting Decimal to Binary using python.

```python
dec = int(input("Enter a decimal number. "))
curr_dec = dec
rem = 0
octal = []
num = 2
while True:
    if curr_dec % num == 0:
        rem = 0
        curr_dec = int(curr_dec/num)
        octal.append(rem)
    else:
        if curr_dec < num:
            octal.append(curr_dec)
            break
        rem = curr_dec % num
        curr_dec = int(curr_dec/num)
        octal.append(rem)

octal = octal[::-1]
x = [str(i) for i in octal ]
x = "".join(x)
print(x)


```

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 2 of <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> <br>Decimal to Binary conversion.<a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a> <a href="https://twitter.com/hashtag/programming?src=hash&amp;ref_src=twsrc%5Etfw">#programming</a> <a href="https://twitter.com/hashtag/CodeNewbie?src=hash&amp;ref_src=twsrc%5Etfw">#CodeNewbie</a> <a href="https://t.co/NmttA1HSsK">pic.twitter.com/NmttA1HSsK</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1342473080438837248?ref_src=twsrc%5Etfw">December 25, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Fetch year-wise month list if have post in a particular month in WordPress
Tags: wordpress, php, programming
Published: 2020-12-25 14:08:48

Hey Namaste 🙏,

In a one of the recent project, We have a requirement like need to display year-wise months at the right side of the page and on click any month have to display a list of the blog post of that month using ajax and have to disable month if there no any posts. 

Check below screenshot for the better understanding.

![Screenshot_3](https://dev-to-uploads.s3.amazonaws.com/i/u8ke6yjemsss11oiltdk.png)
 
For this, We used MySQL query,foreach and array. Please check below code.

If have a blog post in the month then values will set true. 

Below is array output, you can use it anyplace as per your need.

{% gist https://gist.github.com/YuvrajKhavad/b9c3458e1940d8570f2a294ce8055237 %}
How to embed Google Maps
Tags: typescript, react
Published: 2020-12-25 14:04:37

When I try to embed a map to show the access information to certain point, there're sooo many articles to explain the way to do it.

After taking one day to research the best practice and successfully did it, I found 99% of the articles addressing it too complex.

I want to make it super simple here(in just 6 STEPS).

But be careful, my solution only works as long as you can search and find your destination in Google Maps.

Okay, then let's begin.

**1. Search and find your point in Google Maps**
**2. Tap share button**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/taj66rgw49gsr0bq6bx9.png)
**3. Choose 'embed a map'**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/r6w4hvbh194ej59y2mso.png)
**4. Copy its HTML**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9h5sngadoen2ddyonbzh.png)
↓
Go to your favorite code editor
↓
**5.Declare a object for the map**
```
const AddressMap = () => {
  return (
    <div className="google-map-code">
      [the HTML you just copied]
    </div>
  )
}

export { AddressMap }
```
**6. Insert it to your JSX code**
`<AddressMap />`

That's it.
Does this work for you?

Welcome any comment and feedback.
Happy coding:)
Create gradient text
Tags: css
Published: 2020-12-26 02:21:37

---
title: Create gradient text
published: true
date: 2020-12-25 13:41:57 UTC
tags: css
canonical_url: https://phongduong.dev/blog/create-gradient-text/
---

You can create text with a single color or combine multiple colors to create gradient text with CSS. In this tutorial, I will show you how to create gradient text using [`background-clip`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip) CSS property.

[`background-clip`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip) sets an element's background extends underneath its border box, padding box, content box or within the foreground text. You will use `text` value for this property in this tutorial.

You create a paragraph first.

```pug
p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
```

The paragraph needs a background with a gradient color. You set the `background-clip` property to `text` value. It is the main point of this tutorial.

```scss
p {
  background-image: repeating-linear-gradient(#01fd69 2rem, tomato 3rem);
  background-clip: text;
}
```

You won't see the color of the text changes because you only set the background and the paragraph is still using the default color. To change it, you set the `color` of the paragraph to `transparent` value.

```scss
p {
	background-image: repeating-linear-gradient(#01fd69 2rem, tomato 3rem);
	background-clip: text;
	color: transparent;
}
```

Now you can see the text with two colors: green and tomato. There is an interesting thing that you can create gradient text for a specific element of the text like the first line or the first letter with CSS `pseudo-element`

To create gradient text for the first line of the text you change the CSS code above

```scss
p::first-line {
	
}
```

For the first letter 

```scss
p::first-letter {
	
}
```

This is full code of the project. I create three paragraphs for three examples.

{% codepen https://codepen.io/phongduong/pen/KKgmMaV %}
Advent of Code 2020: Python Solution Day 25
Tags: adventofcode, python, challenge
Published: 2020-12-25 13:40:58

Finally the last day. I have not scored any ranks but this was a fun challenge and I am grateful to know about this challenge. For this day, we had only one part challenge and which was not that hard. But again I took code from [here.](https://github.com/fdouw/aoc20/blob/master/day25)

My repository with all solution is available [here.](https://github.com/q-viper/Adevent-Of-Code-2020) And write some blogs about ML on my GitHub Page at [q-viper.github.io](https://q-viper.github.io).

```python
my_input = """
12578151
5051300
"""

test_input = """
5764801
17807724
"""

my_input=my_input.split("\n")[1:-1]


card_pkey = int(my_input[0])
door_pkey = int(my_input[1])


card_loopsize = 0

temp = 1
while temp != card_pkey:
    temp = (temp * 7) % 20201227
    card_loopsize += 1
print(f"Card's Loopsize: {card_loopsize}")

door_loopsize = 0
temp = 1
while temp != pk_door:
    temp = (temp * 7) % 20201227
    door_loopsize += 1
print(f"Door's Loopsize: {door_loopsize}")

temp = 1
for i in range(loopsize_card):
    temp = temp * door_pkey % 20201227
print(f'Part 1: {temp} (card -> door)')
```
Parse Markdown Frontmatter In MDX, Remark, and Unified
Tags: markdown, javascript, react, plugin
Published: 2020-12-25 13:38:08

Today I created a small Unified/Remark plugin called [remark-parse-frontmatter] to help easily parse frontmatter in a Markdown or MDX document using either [mdxjs] or [remarkjs] or [unifiedjs].

In case you don't know what is Unified/Remark is, Unified provides an interface for processing content like Markdown, HTML, JSX, etc, in an extremly modular design which allows writing and using plugins easy (but sometimes also feel a bit fragmented).

## What is frontmatter in Markdown?

Frontmatter is the first block in a Markdown document that starts and ends with a line `---`. Frontmatter defines a Markdown document's metadata.

For example, this is the frontmatter of this article you're reading:

```md
---
title: Parse Markdown Frontmatter In MDX, Remark, and Unified
description: >-
  Leverage Unified/Remark plugin ecosystem to easily parse frontmatter in your
  Markdown or MDX documents.
tags: [markdown, javascript, react, plugin]
published time: 2020-12-25
---
```

Markdown frontmatter is supported by Github and most popular code editors which help writing and maintaining them more fun.

## Parse frontmatter with remark-parse-frontmatter

[remark-parse-frontmatter] provides 2 essential features when working with frontmatter:

-   Parses the YAML content of a markdown and turns that into a JavaScript object for usage.

-   Validates the object using [revalidator].

This plugin requires plugin `remark-frontmatter` to be applied first (which reads the text and turns into a syntax tree, not a JSON object, and has no validation).

```js
const processor = remark()
  .use(require("remark-frontmatter"))
  .use(require("remark-parse-frontmatter"))
  .freeze();

const file = processor.processSync(`
---
title: Hello, World!
---
`);

console.log(file.data.frontmatter);
```

⬇️

    {
      title: "Hello, World!"
    }

Remember to first install the plugin:

```bash
yarn add remark-parse-frontmatter
```

Check out [the NPM package][remark npm] and [the plugin's repository][remark-parse-frontmatter] for more details.

<!-- Links -->

[remark-parse-frontmatter]: https://github.com/phuctm97/remark-parse-frontmatter

[remark npm]: https://www.npmjs.com/package/remark-parse-frontmatter

[mdxjs]: https://mdxjs.com

[remarkjs]: https://remark.js.org

[unifiedjs]: https://unifiedjs.com

[revalidator]: https://github.com/flatiron/revalidator
6 Steps to Build a Website on Magento from Scratch
Tags: ecommerce, magento, magento2, webdev
Published: 2020-12-25 13:26:15

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

Magento 2 eCommerce platform doesn’t need to be introduced. If you stay on top of eCommerce news, you probably have heard about the Magento capabilities.

Magento indeed provides multiple opportunities to turn your website into an efficient tool for money making and your business promotion. Magento-based stores promise the highest performance, so it will never disappoint your target audience at the last minute.

If you are still asking the question “Why Magento?”, here are prime examples of the world-famous brands, which choose Magento: Ford, Samsung, Land Rover and more. 

Here we list some of the most essential steps to launch your own eCommerce website, powered by Magento:

## **Selecting a template for your upcoming web-store**

That’s the first step you should start your eCommerce journey with, as template is a basis of your project. Here are some tips on how to successfully pick a template:

- Investigate some pre-existing Magento websites that perform in the same business niche;

- Make a small layout that will reflect a structure of your potential website (paper and pen will be enough for this mission);

- Relying on a ready layout, choose a template;

- Make sure a chosen template is compatible with all existing browsers;

- Ensure your template is mobile-friendly;

- Check if your desired template supports RTL and includes all the features that may be useful in the nearest future.


## **Choosing a hosting**

There are 3 standard types of hosting for Magento 2 websites:

- *Virtual hosting*. It’s considered to be the most economical option that fits web-stores with several thousand pages (however, if it’s not enough, you can buy additional memory). This hosting is mostly suitable for websites that doesn’t expect to have more than 1500 visitors per day;

- Focus on *virtual dedicated server*, if your website has a wider product catalogue and is visited by over 15000 users every day;

- *Dedicated server* is the most expensive kind of hosting, as you may guess, but it’s certainly worth it. Usually stores of enterprise level opt for dedicated servers.

There are still much more steps to discover. [This article](https://dinarys.com/blog/how-to-build-a-magento-2-website) contains the most interesting part, so don’t miss it!
Problemas con Docker en Windows 10
Tags: docker, windows10, wsl2, kaspersky
Published: 2020-12-25 02:43:20

Es posible que instalaras Docker en Windows 10 con WSL2 y te encuentres con un error como este:

```
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
```

El problema posiblemente sea que el servicio ``LxssManager`` está desabilitado puedes revisarlo si pulsas la combinación Windows + R y escribes ``services.msc``

![2020-12-24 19_30_35-Window](https://dev-to-uploads.s3.amazonaws.com/i/jzs8umcbffrz49mp2sse.png)

Para solucionar esto debes abrir la consola CMD como Administrador 

![Screenshot (2)](https://dev-to-uploads.s3.amazonaws.com/i/548uizwcvqxvabc40jh4.png)

y luego ejecutar el siguiente comando desde la terminal:

```
sc config LxssManager start=auto
```

![2020-12-24 19_35_46-Window](https://dev-to-uploads.s3.amazonaws.com/i/gf83uu4jgkldfnhrghdi.png)
  
> **Nota Importante**:
> Si tienes el antivirus Kaspersky te va a saltar una alerta y te va a pedir que elimines el cambio, en este caso debes ignorar la petición y eventualmente si dentro del antivirus le dices reparar este error, docker va a dejar de funcionar y vas a tener que hacer los pasos nuevamente
🎅24 days of #JavaScriptmas
Published: 2020-12-25 13:04:39

This are my solutions for the #JavaScriptmas , i  had a really great time solving this challenges

JavaScriptmas Solutions:

Day 01 :
https://scrimba.com/scrim/co45b4812ba6ea4c46fdeaee1
Day 02
https://scrimba.com/scrim/co6694bc1909c8e70eb9992c8
Day 03
https://scrimba.com/scrim/co18643e490e93283e6575ceb
Day 04
https://scrimba.com/scrim/coe1d4d98b3da2f97d850456c
Day05
https://scrimba.com/scrim/co35c47eaa54680fba5c2d386
Day 06
https://scrimba.com/scrim/cof2e4348a0acd1a48d54927d
Day 07
https://scrimba.com/scrim/coaaf4740aef96e118ab7734e
Day 08
https://scrimba.com/scrim/coa254992a730b110aca0f83f
DAy 09
https://scrimba.com/scrim/co20346d8acb5eb96591cf373
Day 10
https://scrimba.com/scrim/co7204f4b9fab0ce59df387a6
Day 11
https://scrimba.com/scrim/co9424e4187b17f81223eb4e3
Day 12
https://scrimba.com/scrim/coa394ad4b2315726ef851a89
Day 13
https://scrimba.com/scrim/co444426194c5c8797652948c
Day 14
https://scrimba.com/scrim/co1f64658a87c21d29d998231
Day 15
https://scrimba.com/scrim/coc21467ba4ea1660d703e2d5
Day 16
https://scrimba.com/scrim/cod3946bbb536ce2bcd0217af
Day 17
https://scrimba.com/scrim/cofee4328b78c4a883ac83647
Day 18
https://scrimba.com/scrim/coad548aca7676ec46be37913
Day 19
https://scrimba.com/scrim/co0ef44f49c7f6ebf15cb4286
Day 20:
https://scrimba.com/scrim/co72741a8b322018a2d6bfdb9
Day 21:
https://scrimba.com/scrim/co189437fbfe63b71114d900f
Day 22:
https://scrimba.com/scrim/coa8b4e469803d140100c82e4
Day 23:
https://scrimba.com/scrim/co71e4ee5a81e1a10e38f6191
Day 24:
https://scrimba.com/scrim/co8b84bb19cd7accdf7d56ea1
Daily Developer Jokes - Friday, Dec 25, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-12-25 13:00:19

---
title: "Daily Developer Jokes - Friday, Dec 25, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Dec%2025%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12593f93b65.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*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:___ I love you and I only love you. Does that turn you on?

___AND GATE:___ No.
 -->
Object Cloud Mapper
Published: 2020-12-25 01:10:25

Backend code is boring, why not automate it. OCM allows you to only focus on frontend logic. All you need to do is to define a couple of typescript classes, type a cli command to get a working application, including both frontend and backend. OCM will deploy services to the cloud and create database tables. Here is a quick example:

We use a typescript class (src/Catalog/Private/Product.ts) to represent a table

```ts
import * as Biz from '@ocmts/biz';

@Biz.published
export class Product extends Biz.ActiveRecord {
  public name: string;
  public price: number;
}
```

Define some initial products (src/init/Catalog/Private/Product.json)

```json
[
  { "name": "keybord A", "price": 100 },
  { "name": "mouse B", "price": 102 }
]
```

Then deploy them into the cloud:

```sh
ocm model update
```

In frontend code (src/Catalog/Ui/React/demo.tsx), we can query the products using:

```ts
import * as Biz from '@ocmts/biz';
import { Product } from '@/Catalog/Private/Product';

const scene = new Biz.Scene();
const products = await scene.query(Product, { name: 'mouse B' });
```

## Cloud Neutral

Cloud service providers want to lock you in via their lambda and other private offerings. OCM allow you to use plain old typescript object, instead of private APIs to talk to the cloud services.

![cloud-neutral](https://dev-to-uploads.s3.amazonaws.com/i/1kc17mes1cwk4tfsnh8b.png)

## Is it free?

OCM will soon be [open sourced](https://ocm.to) under the Apache License. If you are interested in, join our [slack channel](https://join.slack.com/t/ocm-sm75180/shared_invite/zt-kpch1ee8-9tj_5eUgdbwewfhBkj3kWQ).
Applying SOLID to an organization
Tags: startup, discuss
Published: 2020-12-25 12:24:25

[SOLID Principles][solid] can be applied to many things. Classes, modules, systems... why not apply them to an organization as a whole? 🤔

I intend to write an article's series to see how each letter of SOLID applies to an organization and answer:

- How this _Principle_ applies to an _Organization_?
- Are there any other _Principles_ that aim to focus on the same already known by the _Industry_?
- Is it useful to apply this _Principle_ to an _Organization_ at all?
- Implications of applying and not applying the _Principle_.

---

Before I even start writing the first article about _Single-responsibility principle_ applied to an _Organization_, what do you think? Is it applicable SOLID to an organization at all?

![thinking](https://media.giphy.com/media/3o7TKTDn976rzVgky4/giphy.gif)

[solid]: https://en.wikipedia.org/wiki/SOLID