teleren/devto huggingface dataset:
I Joined the Mine To 1 Million STX Mining Challenge
Tags: bitcoin, blockstack, blockchain, mining
Published: 2020-12-14 13:19:24

I am a super fan of [Blockstack](https://blockstack.org/) - the blockchain protocol that invented _[Proof-of-Transfer (PoX)](https://community.blockstack.org/pox)_. And I believe Stacks 2.0 will be [the next DeFi powerhouse](https://gongjunshanghai.com/2020/10/12/bringing-defi-to-bitcoin-ecosystem/). So, I signed up for the STX mining challenge and started mining STX from scratch. 

The whole process of setting up a node on Stacks testnet and running a miner turned out not to be very complicated as I thought, and I wrote about my process [here](https://gongjunshanghai.com/2020/11/11/running-a-stacks-node-and-mining-stx-tokens-for-the-first-time-a-guide-for-all-the-non-tech-savvy-people/).  

[<H2>How to Join the Mine To 1 Million STX Competition</h2>](https://daemontechnologies.co/minestx-challenge)

1. Go to the competition [page](https://daemontechnologies.co/minestx-challenge) and click ["Register"](https://daemontechnologies.co/minestx-challenge)

2. Fill out the information: Your name, contact email

3. Input your testnet Bitcoin address and testnet STX address:
If you're using Windows, here is a [5-minute short video](https://youtu.be/82b8PGoQYpI) of how to get the testnet Bitcoin and STX address;
If you're using Mac, you can check out the step-by-step guild about how to run a tesnet node and mine STX tokens [here](https://gongjunshanghai.com/2020/11/11/running-a-stacks-node-and-mining-stx-tokens-for-the-first-time-a-guide-for-all-the-non-tech-savvy-people/). 

It took me about 30 minutes to set it up, and I'm not that tech-savvy:) 

The Mine to 1 Million competition starts on Tuesday, December 15, 2020. So, go sign up now or during your lunch break or coffee break, and start setting up your node!

Happy mining!
Use inline SVG icons with Laravel
Tags: laravel
Published: 2020-12-14 13:16:07

I used icons in fonts for a long time, just by connecting a file with styles and insert a tag with class names.

```html
<i class="icon icon-home">
```

It was quite simple. But over time, the began to use SVG format instead of fonts. Now, for the same post, it was not required to include styles, but the tag itself became much larger:

```html
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-house" viewBox="0 0 16 16">
  <path fill-rule="evenodd" d="M2 13.5V7h1v6.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7h1v6.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5zm11-11V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z"/>
  <path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z"/>
</svg>
```

If the past could be remembered or rely on the IDE's auto-hints, then the inline tag is more difficult. I started looking for options on how to keep this in mind without complicating it. So I decided to write my own simple package that could display any icons by file name.

```php
namespace App\Providers;

use Orchid\Icons\IconFinder;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function boot(IconFinder $iconFinder) : void
    {
        $iconFinder->registerIconDirectory('fa', storage_path('app/fontawesome'));
    }
}
```

When calling the directory method with the first argument, we pass the prefix to call our icons and the second directory where they are located.

After that, we can call the component in our blade templates:

```blade
<x-orchid-icon path="fa.home" />
```

If you use one or two sets of icons that do not repeat, then it is not necessary to specify a prefix in the component:

```blade
<x-orchid-icon path="home" />
```

You can also list some attributes that should be applied to your icon:

```blade
<x-orchid-icon 
    path="home" 
    class="icon-big" 
    width="2em" 
    height="2em" />
```

As you can see, this is as simple as the past use of the tag with class names. And it is not tied to any set of icons. We independently from our set.

You can find this package on GitHub, in the place with the description: https://github.com/orchidsoftware/blade-icons
My jeans tear down today due to extensive SITTING, what should I replace them with?
Tags: discuss
Published: 2020-12-14 13:07:46

![Some web Photo](https://dev-to-uploads.s3.amazonaws.com/i/3pi4ul7yx5jv8831vbor.jpg)

Hello, dev. I have a genuine question, but let me share a little background first. My nice pair of jeans was torn down today in the crotch area due to extensive sitting I presume. While I probably can fix it in the shop or replace it, I rather move to something more robust, because this was not the first pair that was torn down that way.

And the question is: **what pants should I buy next?** Which one combines practicality, robustness, comfort, and fit the best lifestyle of a developer (who mostly sits)?

P.S. The only option out of choice is sweatpants, they are home wear, and for me, it's critical to separate work and home wear to have at least some stability during the day.
Daily Developer Jokes - Monday, Dec 14, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-12-14 13:00:20

---
title: "Daily Developer Jokes - Monday, Dec 14, 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=Monday%2C%20Dec%2014%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/5e12590a84b94.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:___ What are computers' favorite snacks?

___A:___ Microchips, phish sticks, and cookies. But just a few bytes of each.
 -->
Project 1, Week 3, Day 1
Published: 2020-12-14 12:59:12

Bought myself a domain and a server yesterday. At [c0d3](c0d3.com) we used a proxy server to have multiple projects running on sub-domains off a single domain. Spent this morning trying to set it up, it has been a while. It's another way to say it hasn't been done :)

Was having trouble deciding on a domain name. So got `justdecide.site`. 

Tomorrow, first thing in the morning I want to go over the set up of the server and see what's the problem. From there it's just a case of running the node server. Exciting.
Which tool do you use for making a presentation?
Tags: watercooler, discuss, productivity, career
Published: 2020-12-14 12:57:25

Being in this field or any other field, presenting the ideas, strategy, and goals effectively are really necessary for us, and for that, we need **an effective presentation** that attracts the audience and helps us to deliver it the way we want it to be delivered.

Some people say that the slides should be too simple and animation free and other stuff. But I think that is too boring. According to me, for an effective presentation, we need an effective theme, visual aids, charts that show statistics, and also smooth animations for the transition.

Google slides, LibreOffice Impress and Microsoft PowerPoint are very nice tools to create a presentation, But I found a nicer tool with very rich functionalities that I like very much and that tool is **Prezi**.

See a few samples in the following videos
{% youtube XVl3B1EWhHc %}



I am using Prezi for more than 7 years. It also provides a very cool feature which is **the Prezi video**. It also has many video themes with the presentation props as shown in the following gif.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5mci6baurx4mrys7l7t8.gif)

This way, you can effectively record your session and then can share it with anyone. 

I got appreciation many times from the audience for my presentation and they also have asked what I have used to create such an effective and beautiful presentation!

So, Which tool you use for the presentation?

Happy presenting!
Weekly Challenge 091
Tags: perl, theweeklychallenge, perlweeklychallenge
Published: 2020-12-14 12:48:27

[Challenge 091](https://perlweeklychallenge.org/blog/perl-weekly-challenge-091/)

# TASK #1 › Count Number

## Task

You are given a positive number `$N`.

Write a script to count number and display as you read it.

## My solution

The task mentions a positive number (as opposed to a positive integer), but didn't give an example of what to do with a dot, so my script will only accept integers.

This is one of those tasks where I'm interested in how other Team PWC members attempt it. I'm sure there is a way to do this purely with a regular expression, but after about 10 minutes of trying to find the correct syntax, I abandoned that idea.

In the end I went with something that just works™. I take the first character, and then use a regular expression pattern `/^($char+)(.*)$/` to remove the one or more occurrences of that character. I continue until the string is empty.

Then it is simply a matter of displaying the new number made up of the length and the number for each match.

## Examples

```
» ./ch-1.pl 1122234
21321314

» ./ch-1.pl 2333445
12332415

» ./ch-1.pl 12345
1112131415
```

# TASK #2 › Jump Game


## Task

You are given an array of positive numbers `@N`, where value at each index determines how far you are allowed to jump further.

Write a script to decide if you can jump to the last index. Print 1 if you are able to reach the last index otherwise 0.

## My solution

Like with the first task it is suggested that any positive number is valid. However zero - which is [not a positive number](https://mathworld.wolfram.com/Zero.html) - is used in an example. It also doesn't make sense to have a fractional number, as you can't jump in non whole numbers. So for this task, I only allow non-negative integers.

For this tasks, I have a value `$position` which records my current position.

* I return 1 if the current position is the last index (array length - 1). In this case we have landed on the last index.
* If the current position is greater than the last index I return 0. We have overshot the last index, and therefore no solution is possible.
* I also return 0 if the value at the current position is `0`. In this case we will have an endless loop that will never move forward.
* I then increase the `$position` variable by the value of the current index, and repeat the above tests.

## Examples

```
» ./ch-2.pl 1 2 1 2
1

» ./ch-2.pl 2 1 1 0 2
0
```
helloWorld to Hello World
Tags: todayilearned, javascript, beginners
Published: 2020-12-14 12:38:12

To convert camelCase string to Title Case (ES6)

```js
const convertCamelToTitleCase = (camelCase) =>
  camelCase
    .replace(/([A-Z])/g, (match) => ` ${match}`)
    .replace(/^./, (match) => match.toUpperCase())


//Example: convertCamelToTitleCase('todayILearned')
//Result: Today I Learned
```
web dev. journey pt. i
Tags: webdev, html, css
Published: 2020-12-14 12:34:42

ello everyone!

today is the first day of my web development journey. i have decided to use [this](https://www.codecademy.com/courses/learn-html/) html codecademy course as it seems the best to start from the ground up with the html basics, and see where i get from there.

i also decided to start [this](https://www.codecademy.com/courses/learn-css) css codecademy course as well, but will not be focusing on it until i complete the html course further on.

now i'm not sure how these profiles work, but feel free to check out my codecademy profile [here](https://www.codecademy.com/profiles/thekilluadev).

although i believe that this could be helpful, i do not think that codecademy is the best solution for my learning style. there is no testing what you have learned or such without having to pay for their "pro" plan. i plan to research some different ways to learn code languages.

update: i have just completed the css lesson on codecademy. i feel like the lesson was very general, and could be much more thorough. but, what do you expect for a free lesson. i'm planning on working on the css lesson today, as that is the main section that i am lacking knowledge in.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Tags: mysql
Published: 2020-12-14 12:29:17

This seems to happen every time you restart your machine occurs. The solution is to start your SQL server as it has been turned off when the machine restarted: 
`sudo mysql.server start`

Source: https://stackoverflow.com/questions/15450091/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmp-mys
Create k8s Cronjob To Schedule Delete Expired Files
Tags: devops, kubernetes, cronjob, k8s
Published: 2020-12-14 12:22:34

- Application service processes documents and stores them in EFS volume as their cache, the requirement is to clear files which is older than 7 days.

- Solution: Create a cronjob with expected schedule time, the cronjob will claim a volume of same EFS persistent volume and then check time life of the files.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kbk5mocv1byera6ohf5p.png)
- Note:
-- The service mount path: /app/ and stores files in /app/Documents
-- The cronjob should mount path: /opt/demo/ and then it can see `Documents`

**demo.yaml**
```
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: demo-clean
spec:
  schedule: "0 1 * * SAT"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: demo-clean
            image: busybox
            args:
            - /bin/sh
            - -c
            - find /opt/demo/Documents/ -type f -mtime +7 -exec rm {} \;
            volumeMounts:
            - name: efs
              mountPath: "/opt/demo/"

          restartPolicy: OnFailure
          volumes:
          - name: efs
            persistentVolumeClaim:
              claimName: efs-pvc
```

**Apply yaml file and check**
```
~:/# kubectl get cronjob
NAME              SCHEDULE      SUSPEND   ACTIVE   LAST SCHEDULE   AGE
demo-clean          0 1 * * SAT   False     0        30h             9d

~:/# kubectl get pod
demo-clean-1607838120-7kl2w                            0/1     Completed   0          18h
```
script error
Tags: help, python, jupyter
Published: 2020-12-14 12:14:13

when ever in run a py script in jupyter i am getting this... please help me in resolving this 
DeprecationWarning: should_run_async will not call transform_cell automatically in the future. Please pass the result to transformed_cell argument and any exception that happen during thetransform in preprocessing_exc_tuple in IPython 7.17 and above.
and should_run_async(code)
4 Reasons Why You Should Use An SDK
Tags: beginners, productivity, microsoftgraph
Published: 2020-12-15 08:41:56

---
title: 4 Reasons Why You Should Use An SDK
published: true
date: 2020-12-14 12:07:17 UTC
tags: beginner,productivity,microsoftgraph
canonical_url: https://blog.mastykarz.nl/4-reasons-use-sdk/
---

![#27 4 Reasons Why You Should Use An SDK](https://blog.mastykarz.nl/assets/images/2020/12/banner-tools.jpg)

The apps we build on Microsoft 365 often communicate with APIs to retrieve and store their data. Whether you use Microsoft Graph, SharePoint, or store your data in Azure, you need to communicate with an API.

When building your apps, you have **two choices** to connect to an API: you either **use its SDK** or you **build the web requests manually**. Using SDKs basically means adding another dependency to your project. A dependency that you need to keep an eye out on and update in case there is any known issue. Over the last few years, we've all heard some nightmare stories where a broken dependency would break the whole app. But before you decide, let me give you, what I think, 4 compelling reasons why you should use an SDK.

1. Design-time feedback
2. Implements auth for you
3. Abstracts away API intricacies
4. Takes care of handling edge cases and exceptions

When you build your app, would you rather be surprised when your app breaks on runtime or would you prefer to **see squiggly lines in your code when something's not right**? Oh, and when the API changes: would you rather again find out about it on runtime, or **see what needs to be changed immediately after updating the SDK**?

Auth is often one of the hardest parts of connecting to APIs. **SDKs abstract the auth flow away** often to a single line of code, or maybe two. But that's it.

Despite us having standards for building APIs, not all APIs follow them. Sometimes it's out of necessity that they need to be inconsistent or they need to implement something that is a grey area in the standard. Whether it's a particular use of formatting requests, manipulating request headers, or handling paging, a good SDK will abstract all these intricacies away from you, allowing you to **focus on the task at hand rather than building API plumbing**.

Communication over HTTP is not flawless. In fact, you should always assume that your call will fail and properly handle exceptions. And if the particular API is under heavy load, it could happen that your request will get throttled. An **SDK will implement handling all these exceptions for you**.

So the next time you will build your app think about it: **do you want to build plumbing or do you want to focus on the added value of your app and use SDK to help you make your app more robust and reliable**?

PS. Check out the [Microsoft 366 PnP community website](https://pnp.github.io/#sdks) to see what SDKs you can use for building apps on Microsoft 365.

<small>Photo by <a href="https://unsplash.com/@carlevarino">Cesar Carlevarino Aragon</a> on Unsplash</small>
How to Create the Solar System in AR in 15 Minutes or Less
Tags: tutorial, unity3d, programming, augmentedreality
Published: 2020-12-14 11:29:20

Looking to build an augmented reality (AR) solar system application? Use this solar system demo application created with Unity, AR Foundation, and echoAR. The full demo can also be found on echoAR’s [GitHub] (https://github.com/echoARxyz/Unity-ARFoundation-echoAR-demo-Solar-System).

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

**Register**
If you don’t have an echoAR API key yet, make sure to register for FREE at [echoAR] (https://console.echoar.xyz/#/auth/register).

**Setup**
* Create a new Unity project.
* Clone the [Unity-ARFoundation-echoAR] (https://github.com/echoARxyz/Unity-ARFoundation-echoAR) sample code.
* Clone this repository for prefabs,scenes and custom scripts.
* Follow the instructions on our [documentation page] (https://docs.echoar.xyz/unity/adding-ar-capabilities) to set your [API key] (https://docs.echoar.xyz/unity/adding-ar-capabilities#3-set-you-api-key).
* Set your echoAR API key in the echoAR prefab
* Add the models from the models folder to the echoAR console
* For each model, add the corresponding metadata from the metadata folder on the echoAR console
* Overwrite the existing echoAR/CustomBehaviour.cs script with the new *CustomBehaviour.cs* file
* Overwrite the existing echoAR/RemoteTransformation.cs script with the new *RemoteTransformation.cs* file

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

**Run**
[Build and run the AR application] (https://docs.echoar.xyz/unity/adding-ar-capabilities#4-build-and-run-the-ar-application).

**Notes**
* Touch Drag Button to enable dragging.
* Touch on any planet to get information.

**Learn more**
Refer to our [documentation] (https://docs.echoar.xyz/unity/) to learn more about how to use Unity, AR Foundation, and echoAR.

**Support**
Feel free to reach out at support@echoAR.xyz or join our [support channel on Slack] (https://join.slack.com/t/echoar/shared_invite/enQtNTg4NjI5NjM3OTc1LWU1M2M2MTNlNTM3NGY1YTUxYmY3ZDNjNTc3YjA5M2QyNGZiOTgzMjVmZWZmZmFjNGJjYTcxZjhhNzk3YjNhNjE).

------
**echoAR** (http://www.echoAR.xyz; Techstars ’19) is a cloud platform for augmented reality (AR) and virtual reality (VR) that provides tools and server-side infrastructure to help developers & companies quickly build and deploy AR/VR apps and experiences.*

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wm6hfk2q4fb73jsw90ig.png)
Question on Deadlock | Operating System - M04 P08
Tags: linux, devops, beginners, tutorial
Published: 2020-12-14 11:20:38

**This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the forth module which consists of 8 articles.**

_In this article we will see a question based on the concept of deadlock in an operating system, and try to get better understanding of the concept._

***Question:*** Consider a system with `3` processes that share `4` instances of same resource type. Each process can request a max of **K** instances. The largest value of **K** that will always avoid deadlock is?
***Answer:***
- The value of **K = 2**
- The value of k will be two because, if the value of k is one then also no deadlock will occur but question is asking for maximum value.
- If the value of k will be `3` then deadlock will occur. In that case there could be a scenario that `P1` process has `2` instance of resource and want one more while the other two instance of resource are allocated to `P2` and `P3` who also want more instances of resource to get completely execute, in this case what is happening that no process can completes its execution and hence deadlock will occur.
- Therefore the maximum value of K for which deadlock will not occur will be 2.

_So this was all about a simple question on deadlock in an operating system. Hope you liked it and learned something new from it._

If you have any doubt, question, quires related to this topic or just want to share something with me, than please feel free to contact me.

### 📱 Contact Me

[Twitter](https://twitter.com/r_mishra10)
[LinkedIn](https://www.linkedin.com/in/rahul-mishra-66210b185)
[Telegram](https://t.me/rahul_mishra10)
[Instagram](https://www.instagram.com/rahul_mishra10/?hl=en)

### 📧 Write a mail
<rahulmishra102000@gmail.com>

#### 🚀 Other links

[GitHub](https://github.com/rahulMishra05)
[HackerRank](https://www.hackerrank.com/rahulmishra10201)