teleren/devto huggingface dataset:
Advent of Code 2020 Solution Megathread - Day 15: Rambunctious Recitation
Tags: adventofcode, challenge
Published: 2020-12-15 15:36:42

---
title: Advent of Code 2020 Solution Megathread - Day 15: Rambunctious Recitation
published: true
description: Playing number memory games with elves.  Predicting iterations.  I thought we were on vacation!
tags: adventofcode, challenge
series: Advent of Code 2020
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/2cme5css8jcy5besvdqc.png
---

I was certain that C would really help me with the bit fiddly puzzles, but yesterday kicked my booty and left me slapping together something ugly but functional in Python.  I switched over after encountering a realloc bug in my custom hashmap implementation.  So.  I've got some more studying to do on that front.  Hopefully you had a better day.

## The Puzzle

In [today’s puzzle](https://adventofcode.com/2020/day/15), we're hanging out with the elves!  They're playing a number game that involves remembering the last time a particular number was said and generating an infinite sequence from that.  I'm thinking that there may be some tricks learned from past years that may be applicable here, but I'll confirm once I've gone through it and submitted my solution.   Good luck!

## 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

Updated 07:36AM 12/15/2020 PST.

| Language   | Count |
|------------|-------|
| Rust       |     2 |
| Haskell    |     2 |
| JavaScript |     2 |
| COBOL      |     1 |

Merry Coding!
AppSignal is Free for Open-Source Software & "For Good" Projects
Tags: monitoring, devops, news
Published: 2020-12-15 15:22:33

Whether you write code to save the bees, build the latest CMS, or teach others to become a developer: we've got your back. We've always offered AppSignal for free to maintainers and do-gooders who asked, such as Elixir School, Code::Stats and the MEANS Database. Starting today, we want to spread the word to all open-source maintainers and volunteer organizations that AppSignal is 100% free for them.

## Standing on the shoulders of giants

Applications are built on the shoulders of giants, also known as "open-source software maintainers." Without them, every one of us would continuously need to reinvent the wheel and keep it spinning. Thankfully, these – mostly unpaid – developers spend countless hours going through issue lists, fixing bugs, and speaking with the community. They release the result of their dedication and hard work under licenses that allow the rest of the world to reap the benefits.

Other, equally giant developers use their talents to write and run software that makes the world a better place. Some of them maintain apps that redistribute excess food or arrange help for the elderly. Others take a global approach to teaching others how to write code or find their dream job as a developer. Voluntarily.

It's our honor to offer AppSignal for [Ruby](https://www.appsignal.com/ruby), [Elixir](https://www.appsignal.com/elixir), [Node.js](https://www.appsignal.com/nodejs), and [JavaScript](https://www.appsignal.com/javascript) for free to all you giants out there. Enjoy our Error Tracking, Performance Monitoring, Server Monitoring, Metric Dashboards, Anomaly Detection, and Workflow features. Use them while developing or to monitor your demo app, project's homepage, or cluster of forty servers.

## How to apply for a free AppSignal account

To apply for a free AppSignal subscription as an OSS maintainer or volunteer-run organization, [start your free trial](https://www.appsignal.com/) and tell us a bit about your project [over email](mailto:support@appsignal.com) or the in-app chat. Our review process is quick and there to ensure your project aligns with our vision and code of conduct.

If your nonprofit organization isn't run solely by volunteers, also make sure to reach out! We offer a 25% discount on our regular pricing.

## Be a giant

By providing free AppSignal, we hope to enable open-source maintainers and other do-gooders to write even better software, and to broaden shoulders for future generations to stand on. On behalf of them and us: thanks for your hard work.
How to add a pressed effect on button click using css
Tags: css, html, tutorial, stackfindover
Published: 2020-12-15 15:18:43

In this tutorial, we are going to learn how to add a pressed effect on a button using CSS. This effect is a part of modern UI design and is used on many websites. This effect allows the user to experience an interaction with the button element as compared to the normal behavior.

We’ll take advantage of the active pseudo class. This class is added to an HTML element automatically when it is clicked.

We can use CSS transform property to add a pressed effect on the button when it is active. CSS transform property allows us to scale, rotate, move and skew an element.

```
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Pressed effect on button</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="style.css" />
    <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap" rel="stylesheet">
  </head>
  <body>
    <div class="animated_btn">
      <button class="btn">Click me</button>
    </div>
  </body>
</html>

```
<a href="https://youtu.be/68Jgw0PsWoM" rel="dofollow">For Video Tutorial</a>

<a href="https://blog.stackfindover.com/how-to-add-a-pressed-effect-on-button-click/" rel="dofollow">Full Source code</a>


###Pressed Effect On Button###
{% codepen https://codepen.io/stack-findover/pen/XWpONjb %}
First Steps #01
Tags: devjournal
Published: 2020-12-15 15:16:00

# **About me**
Hello 👋 I am David Ricardo. I am a Master's Student and a Game Developer Hobbyist.

I really like to create and do stuff but this time was different. Because one of the best parts when creating something is to show it to someone and that last part was missing me...

I don't talk too much but I will talk the way that I know.
I don't know the best way to teach or show something but I will do my best in my own way.

### **Time to clean the Dust**
I will start by showing some old projects because they can be useful for someone (we never know).

Sharing our knowledge with each one it's a good way to learn, improve, and grow as a developer, programmer, and everything else! ✌️

Good luck with all your projects and keep going!

*******
I let this part for last because I don't like that much to ask for people to follow me, but if you want to take a look at my work and what I am/was doing you can found it on my social media

Twitter:  [https://twitter.com/DavidCRicardo](Link) 
Youtube:  [https://www.youtube.com/c/DavidRicardo97](Link) 
Github:  [https://github.com/DavidCRicardo/](Link)
WebOCR - Camera Text Extraction
Tags: dohackathon, machinelearning, node, javascript
Published: 2020-12-15 15:07:04

## What I built
**WebOCR** is a minimalistic app for devices with a camera. Recognize and copy text from photos made on your mobile device or any other device with camera access.

### Category Submission: 
Program for the People

### App Link
https://nevolin.be/webocr/

or

https://webocr-colcw.ondigitalocean.app/

### Screenshots
![camera ocr](https://dev-to-uploads.s3.amazonaws.com/i/mya1aoaa5zxs1fjkfnoh.jpg)

![camera ocr](https://dev-to-uploads.s3.amazonaws.com/i/ybnzfbuq8pz6w8s6o7ze.jpg)

### Description
1. visit the app (on pc or phone)
2. allow camera access
3. aim at some text and click the button
4. wait a few seconds for the image to be processed
5. the detected text will be shown below

note: none of the video/photo content is stored, everything is processed in-memory and removed immediately after processing for privacy reasons.

The OCR system does a pretty good job, especially with numbers and special characters. However it's definitely not perfect and can produce inaccuracies. This solution uses TesseractJS as underlying OCR system.



### Link to Source Code
https://github.com/healzer/WebOCR

### Permissive License
MIT

## Background
Optical Character Recognition (OCR) is a pretty important technology but not many junior developers know about it. It's an intelligent system and should be used a lot more in daily business. Its learning curve is very low and can easily be integrated into business pipelines.

The idea behind WebOCR is to have some tool to quickly extract text from a picture taken with a phone, in my opinion it should be a default app that comes with Android/iOS devices.

The accuracy of the system is not always 100% but comes very close, and is very convenient for extracting URLs, phones, addresses, serial codes, etc.

### How I built it 
It's pure JavaScript/jQuery/HTML on the front-end, nothing fancy. And NodeJS for the back-end with Express and TesseractJS as additional libraries.

You can deploy it yourself in a matter of seconds. My app runs on a basic $5 digitalocean cloud app.

### Additional Resources/Info
There are two ways to carry out OCR: client-side and server-side (default). 

Client-side OCR runs in the browser, it is much slower but could be tweaked using more workers. For these configurations you should consult TesseractJS's API docs. To enable client-side OCR use the function `localProcessImg()` instead of `serverProcessImg()` inside `/public/main.js`.
Bipolar Sigmoid vs Tanh Activation Functions
Tags: machinelearning, python, datascience, deeplearning
Published: 2020-12-15 14:56:11

The activation functions play an important role in determining the output of the neural network. The aggregated value of the network is fed into the activation function to find the output value.

Input ---> Neural Network (Computation and Aggregation) ---> Activation Function ---> Output

Bipolar sigmoid and tanh (tan hyperbolic) are the continuous activation functions which give us a gradual output value in the range [-1, 1]. The shape of the both graphs look similar, but is not exactly similar. The slope of tanh graph is more steeper than the bipolar sigmoid. 

```
import numpy as np 

#Bipolar Sigmoid
y1 = (np.exp(x)-1)/(np.exp(x)+1)

#Tanh
y2 = (np.exp(2x)-1)/(np.exp(2x)+1)
```

Hence, it could be observed that tanh has the factor of '2x' and bipolar sigmoid has the factor of 'x'. So after taking derivative of both functions the tanh has more value which explains its steeper slope than bipolar sigmoid.
App Development
Published: 2020-12-15 14:45:37

Mobile application often referred to as mobile app or simply an app which is first used for emails, calendars etc. But at present there has been a huge demand for apps and will be increasing as the world is digitizing and there will be requirement of apps like GPS, order trackers, ticket bookings and a lot more.
Basically there are two main methods to develop an app.

from scratch through coding
websites

A typical mobile app project is made up of three integral parts: back-end/server technology, API(s) and the mobile app front-end.

Back-End/Server Technology This part includes database and server-side objects necessary for supporting functions of your mobile app. If you are using an existing back-end platform, then modifications may be needed for supporting the desired mobile functionality.An Application Programming Interface (API) is a method of communication between the app and a back-end server/database.

Mobile App Front-End The front-end is the native mobile app an end-user will use. You can utilize almost any web programming language and databases for the back-end. For native mobile apps, you have to choose a technology stack required by each mobile OS platform. iOS apps can be developed using Objective-C or Swift programming language. Android apps are primarily built using Java or Kotlin. After quality assurance testing, release the application into play store, ios store and ready for installation.
Tech Stack for DEV X DO Hackathon Project
Tags: dohackathon, react, node
Published: 2020-12-15 14:35:37

### Right To The Point

The tech stack for my project is very unique. I will be going with MongoDB as my database and yeah this is a MERN stack project but it isn't. Express JS is not my backend web server but Neuron JS is. If you have seen my post where I introduce Neuron JS then you know what it is but if you don't then Neuron JS is my own web server framework and this project will prove how awesome my framework is. Next up is frontend where I am using my favorite, your favorite REACT JS!!!! Not a big surprise there though. This is the main tech stack for the project. And please check out Neuron JS because if you won't then when I will show you the final product you will be racing to use it.
Matt's Tidbits #85 - Fixing build issues in Bitrise
Tags: mattstidbits, bitrise, tidbittuesday
Published: 2020-12-15 14:34:15

[Last time I shared an in-depth look at JVM Options.](https://medium.com/@matthew.b.groves/matts-tidbits-84-jvm-options-explained-45b51c20e85f) This week, I have a quick tidbit about resolving build issues in Bitrise.

It happens to everyone. Inevitably, your CI system will fail to build your app, and you'll have no idea why.

This week, my project experienced an error that looked like this:
```
Ensure required Android SDK components
Retrying…
Failed to ensure android components, error: output: Picked up _JAVA_OPTIONS: -Xms512m -Xmx2g
FAILURE: Build failed with an exception.
* What went wrong:
Could not load compiled classes for settings file '/bitrise/src/settings.gradle' from cache. Expected class file /root/.gradle/caches/jars-8/c09e2a1b661a58f8283b8fe94748d8fd/settings.jar/settings_2fggozq45hw451w290ssabnr7.class does not exist.
> settings_2fggozq45hw451w290ssabnr7
```

I don't know about you, but at this point in 2020 this looks like mostly gibberish to me. Thankfully, one of my coworkers was able to decipher this a little better than I was, and had the idea to clear Bitrise's cache.

Thankfully, his idea did the trick! So, if you're using Bitrise, how do you clear the caches? You can find the instructions here: https://devcenter.bitrise.io/builds/caching/about-caching-index/#downloading-and-deleting-caches

I'm not sure why the cache became seemingly corrupted, and I'll probably never know. I'm ok with that though, because as Phil Karlton, one of the developers of Netscape famously once said:
> There are only two hard things in Computer Science: cache invalidation and naming things.

Sometimes you have to be ok with a little uncertainty. ;-)

What are your favorite CS quotes/maxims/sayings? Share in the comments below! And, please follow me on Medium if you're interested in being notified of future tidbits.

*This tidbit was discovered on December 10, 2020.*
how to download and install MongoDB on windows
Published: 2020-12-15 14:34:08

     Follow the below steps to install the proposed file


MongoDB is a document-oriented NoSQL database used for storing large volumes of data. MongoDB is a database that appeared until the mid-2000s. It falls under the category of NoSQL databases

  Figure 1: To Get the Download File of MongoDB from Website


![m1](https://dev-to-uploads.s3.amazonaws.com/i/qc5cuhi77ax855sfjw58.png)

    Step 1:

 Open the file. We have installed for 64-bit version with the name as “MongoDB-win32-x86_64-2008plus-ssl-v3.4-latest-signed”. It is saved in the Local Disk C:/, click on the file where you’ve saved it to start the wizard.

Figure 3
![m2](https://dev-to-uploads.s3.amazonaws.com/i/hkt4ef5e305hcd7w5ygq.png)


     Step 2: Click “Next“.

Figure 4
![m3](https://dev-to-uploads.s3.amazonaws.com/i/g1r8tujl00pshkbekqg8.png)

      Step 3:

 Tick the check box next to ‘I accept the terms in the License Agreement’ and again click on “Next“.

Figure 5
![m4](https://dev-to-uploads.s3.amazonaws.com/i/m4zv0ufhgcd3nkntt48w.png)
 
     Step 4:

 Click “Complete” to install all the features of MongoDB. As for “Custom”, this option would be used to install only the specific components of MongoDB and also if a user wants to change the location of where the installation must be done.

Figure 6
![m5](https://dev-to-uploads.s3.amazonaws.com/i/k7xp54zpdfizvcme2sem.png)
 
        Step 5:

 Click “Install” to begin the installation drive.

Figure 7

![m6](https://dev-to-uploads.s3.amazonaws.com/i/2x1i1ctbv798ertw54hv.png)
 
Figure 8
![m7](https://dev-to-uploads.s3.amazonaws.com/i/7yqp6yutnw9l6u5bbymy.png)

       Step 6:

 After the installation has been finished. Simply, click “Finish“.

Figure 9
![m8](https://dev-to-uploads.s3.amazonaws.com/i/rnw3dwd30v9qc18vmvs8.png)
Marketing digital: como oferecer serviços sendo freelancer?
Tags: freelaweb, freelancer, mercado, servicos
Published: 2020-12-15 14:32:25

O mundo digital se expandiu e aumentou o contato entre empresas e seus públicos online. Com a necessidade de estar mais presente no online, até mesmo as pequenas empresas precisaram se posicionar nos canais digitais, seja nas redes sociais ou em seu próprio site, por exemplo. Por isso, a área de marketing digital ganhou destaque. 

 

Para atuar com marketing digital é necessário ser um profissional qualificado e, entender de, pelo menos, uma de suas vertentes. Ou seja, o marketing digital engloba muitas áreas de atuação. Veja abaixo alguma das que mais se destacam:  

 

Social media:  responsável por cuidar das redes sociais. Contudo, um social media pode ser voltado para a parte de conteúdo escrito (comunicação e redação), design das postagens e/ou atendimento (contato com os clientes que surgem via chat ou comentários). Por isso, a parte de social media pode contar com diversas áreas de atuação, inclusive um profissional voltado para analisar métricas e desempenho das mídias sociais. 

 

SEO: responsável por posicionar seu site de forma orgânica nas páginas de busca, como o Google, por exemplo. Para isso, esse profissional precisa entender de Conteúdo e dominar ferramentas para análises de posicionamento e analytics. 

 

Mídia paga: responsável por criar e coordenar campanhas pagas das mídias digitais, como redes sociais e Google, por exemplo. Este profissional acompanha a performance do site, acessos e conversões obtidas. 

 

Por isso, quem deseja atuar como freelancer para ter uma renda extra ou até mesmo trabalhar integralmente com marketing digital deve conhecer ao menos uma dessas vertentes, visando um único objetivo: gerar vendas ao seu cliente. Busque manter-se atualizado com cursos e conteúdos de qualidade da área do marketing digital. Além disso, converse com outros profissionais da área. 

 

Lembre-se: esta área é ótima para conseguir mentoria e se aperfeiçoar cada vez mais. Por isso, faça bom uso do seu tempo. 

 

Como oferecer seus serviços em marketing digital? 
 

Com seus conhecimentos teóricos, é hora de buscar clientes e colocar o que sabe em prática. Para isso, busque atualizar seu perfil no LinkedIn, focando suas especializações no marketing digital para atrair pessoas que buscam profissionais no seu perfil para contratar como freelancer. Além disso, esteja presente nos marketplaces de serviços, como o FreelaWeb, e demais plataformas de freelas. 

 

Crie os anúncios dos serviços específicos que você deseja ofertar. Neste momento, você deve ser seu próprio consultor de marketing digital. Por isso, escreva boas descrições dos serviços, precifique de maneira adequada e esteja disposto para responder possíveis contratantes que te chamarem. 

 

Redação: Alice Bachiega
HELP! Windows won't update and I'm stuck behind!
Tags: help, important, windows, watercooler
Published: 2020-12-15 14:31:06

I've tried a handful of the the remedies provided by [this site](https://windowsreport.com/error-code-0x80070003-windows-update/#2). And none of them have worked, I've been up all night trying to figure out how to update Windows.
It keeps failing, and keeps providing the error `Some update files are missing or have problems. We'll try to download the update again later. Error code: (0x80070003)`, I'm trying to install `2020-12 Cumulative Update for Windows 10 Version 2004 for x64-based Systems (KB4592438)`.
<br/>
If anyone knows how to fix this, please let me know quickly, and as soon as possible.
<div style="font-weight:bolder">
##<b><center><b>Thanks!<br/>Cheers!</b></center></b>
</div>
Quick Bash: Check Argument Count
Tags: bash
Published: 2023-01-06 01:11:52

---
title: Quick Bash: Check Argument Count
published: true
date: 2020-12-15 14:25:11 UTC
tags: Bash
canonical_url: https://brandonrozek.com/blog/quickbashargcount/
---

I’ve been writing more bash scripts recently and I noticed that I often check for the number of arguments before validating them in my scripts. I’ll share that small snippet here for my future self.

```
#!/bin/sh

set -o errexit
set -o nounset
set -o pipefail

show_usage() {
    echo "Usage: script [arg1]"
    exit 1
}

# Check argument count
if ["$#" -ne 1]; then
    show_usage
fi

```
CSS project to sharpen your skills
Tags: html, css, animation, youtube
Published: 2020-12-15 14:15:52

{% youtube p8HBw7m0_J4 %}
In this post and video, I'm gonna show you how to create a CSS folder and files in it. It's an animated project just to sharpen your CSS skills.

See on Codepen
{% codepen https://codepen.io/Firdavsi_Q/pen/qBNoeYQ %}

`Time Codes for the video`:
Times Codes:
0:00 Intro
01:08 Adding HTML tags
02:24 Split the screen
02:50 Styling the body tag
05:35 Styling the back of the folder
07:00 Styling the small box
09:00 Styling the papers/files inside the folder
12:08 Styling the papers using nth-child selector
13:50 The Curtain or front page of the folder
17:26 Animating the folder and all the files
Format a Date interval in Java
Tags: java
Published: 2020-12-15 14:14:59


At the time of this writing, there are a gazillion ways to print dates in Java:

* SimpleDateFormat (deprecated, use java.time instead)
* [Joda time](https://www.joda.org/joda-time/) (deprecated, use java.time instead)
* [Threeten](https://www.threeten.org/) (deprecated, use java.time instead)
* [Java 8 Date/Time API](https://www.baeldung.com/java-8-date-time-intro) (also known as java.time) <== This. You should be using this. Use this.

The problem is, how do we print a date interval in Java? None of these libraries supports this particular use case. `Duration` is not a date interval, and neither is `Period`. [`ZonedDateTime.format`](https://stackoverflow.com/questions/42425393/how-to-format-a-zoneddatetime-to-a-string) is great, but only supports a single date. There are no libraries out there to format an interval of dates, as far as we could see.

Enter `String.format`, best described in the javadoc for [`Formatter`](https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html). This is a method typically used to interpolate values inside Strings:

```java
String.format("foo %s", "bar"); // return "foo bar"
```

This method also supports internationalization when passing a Locale as first argument. You know where we are going, right?

```Java
var start = parseISO8601("2020-01-02T10:10:00Z");
var end = parseISO8601("2020-02-03T10:10:00Z");

Locale locale = Locale.ENGLISH;

// please don't do this in real code - use .properties instead
String pattern = "en".equals(locale.getLanguage())? 
  // "January 2 - February 3, 2020"
  "%1$tB %1$te - %2$tB %2$te, %1$tY",

  // 2 de enero - 3 de febrero de 2020
  "%1$te de %1$tB - de %2$te %2$tB de %1$tY";

return String.format(locale, pattern, start, end);
```
According to the docs, `"%1$te"` can be used to:

* `%1$` is the first argument
* `t` indicates that it's a date
* `e` tells to extract the day of the month

The same date can be used more than once, and the order can be rearranged depending on the locale. The rest is playing with other options: extract the year, month names, whatever. Go crazy.