teleren/devto huggingface dataset:
Building a QR code generator with Ruby on Rails
Tags: ruby, rails, qrcode
Published: 2021-08-06 22:43:50

Today many applications use QR codes.

QR codes are used for many different purposes, like tickets, restaurant menus, payments, sharing a contact or a URL, etc.

A QR code may seem magical to non-tech users, but it is actually very simple. **QR codes are simply a different way to write text: instead of using the normal alphabet, that is easily read by humans, we use different signs that are easily read by a machine**. 

Since you can write any text inside a QR code, you can also write a URL for example. URLs are one of the most common contents of QR codes. A mobile device that scans a QR code, reads the text, and finds a URL, may decide to open that link.

For example, if you have a restaurant menu online you can simply take the URL of the menu and convert it into a QR code: in this way users that scan the QR code will open the restaurant menu. That is exactly how a QR code menu works. And indeed this post is based on the work that I have done for [BuonMenu](https://buonmenu.com), a QR code menu for restaurants built with Ruby on Rails.

## The code

We want to build a simple page with Ruby on Rails that given an arbitrary text or a URL as an input, generates the QR code and allows the user to download it.

First of all create a new Rails application (or open an existing one).

Then add [this gem](https://github.com/whomwah/rqrcode):

```ruby
# Gemfile

gem 'rqrcode'
```

And run `bundle install`.

Then create these routes:

```ruby
# config/routes.rb

controller :pages do
  get :qr_code_generator
  get :qr_code_download
end
```

Then the controller:

```ruby
# app/controllers/pages_controller.rb

class PagesController < ApplicationController
  def qr_code_generator; end

  def qr_code_download
    send_data RQRCode::QRCode.new(params[:content].to_s).as_png(size: 300), type: 'image/png', disposition: 'attachment'
  end
end
```

This is the code of the view:

```erb
<%# app/views/pages/qr_code_generator.html.erb %>

<h1>QR code generator</h1>

<%= form_tag :qr_code_download, method: :get do |f| %>
  <div class="field">
    <%= label_tag 'Text or URL' %>
    <%= text_field_tag :content, nil, required: true %>
  </div>

  <div class="actions">
    <%= submit_tag 'Generate QR code' %>
  </div>
<% end %>
```

Basically the view is to display a form where the user can add his text or URL and then it sends a request to `qr_code_download` which actually generates a PNG for the QR code. The QR code will be downloaded on the user device since we use `disposition: 'attachment'`.

Finally, if we prefer to display the QR code instead of downloading it, we can use a method similar to `qr_code_download` but with `disposition: 'inline'`.
Complete Pac-Man JavaScript Tutorial For Beginner and Intermediate Using Pure JavaScript and Canvas
Tags: javascript, gamedev
Published: 2021-08-06 23:25:10

{% youtube Tk48dQCdQ3E %}

In this tutorial we are going to build Pac-Man using pure JavaScript. Every step of the process will be explained. This is a great tutorial for beginner and intermedia developers. Learn game fundamentals such as the game loop, building a tile map, keyboard input, animation, collision detection and simple enemy AI.

I hope that you enjoy this tutorial!
Thoughts Per Line
Tags: discuss, healthydebate
Published: 2021-08-06 23:21:07

Just rambling and poking for other minds to explore.

This is coming from somebody just learning, really don't know much at all.

As each line is generated, how many thoughts do you process?

Do you simply keep typing, add a comment, make an actual log of these questions? 

Do you instantly search up methods for the best way to have it performed or possibly list each different way it can be performed and do your own analytics?

Do not consider time based or job related tasks, even though it could apply. Just your own personal learning.

What is the best way(s) to see which is best? 

I ask because of while learning, there is exploration. In programming, I'm curious of...

Is there really a best way for most things that is "known"?

Is it good to "think too much", when the point of it is seeing it as an art, which one way could be used so many other ways and possibly provide better results?

It is all for the point of optimization, expandibility, etc.

To have the least do the most, right?

Having heard the term numerous times, "don't think, just code" is something, well. I've heard it enough to have it stuck in my head, but don't agree with it.

Shouldn't programmers be innovators, thinkers, creaters? I'm unsure, but a lot of the times speaking to (Not to people here..) "developers" I was really let down with their way of thinking and "curiousity" of how things work. It made no sense to me, and this was the majority of them as well and not only developers, but people of "tech nature".

(Again, nobody here. Just frequent run ins to random places I checked out trying to solve things.)

So let that be something to be added to the (oh so many but not listed) questions if you want. Opinions and thoughts on that?

Not sure what this is meant for exactly, just the rambling way. Curious of how others are thinking and enjoy reading views on things such as this.

Is programming still an unexplored world (just like bug hunting) where the well known functions can work in ways for the better?
5 Great Resources for Beginners in Coding
Tags: beginners
Published: 2021-08-06 22:47:13

Do you want to learn how to code, but feel overwhelmed and don't know where to start? 

Don't worry- you're not alone, and the feeling is normal! There is an overwhelming amount of information out there regarding programming, and some of it may not look very beginner-friendly.

The great thing about the internet is that there are many ways to learn new things. We have hours of resources and content at our fingertips. 

Here are a few of my favorite websites that I've come across in my programming journey that have been super helpful for me to go from an Office Manager with zero coding experience to a Junior Developer.

## freeCodeCamp

![FreeCodeCamp Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/446knpk9wtxhd4us7utx.jpeg)

freeCodeCamp is a nonprofit organization whose mission is to help you learn how to code for free! Not only are the resources very beginner-friendly and comprehensive, but there are *over 300+ hours* worth of material *per subject*. With subjects like Responsive Web Design, Data Visualization, and JavaScript Algorithms and Data Structures, you are bound to find something that tickles your fancy and meets your needs.


## W3 Schools

![W3 Schools Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qb6w69ql9at42t8bvjar.png)

Need a little bit of everything in a clear, coherent, and very simple manner? Me too. Forgot how to center a div? Me too. I often head over to W3 Schools for lots of fundamental HTML and CSS reviews. W3 Schools is a great resource for both beginners and non-beginners alike!


## SoloLearn

![Solo Learn Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvzdf80tpdgd58noj197.png)

SoloLearn is a great resource to learn the fundamentals of your programming language of choice through multiple choice and fill-in-the-blank quizzes, as well as coding challenges along the way. There are tons of Q&As, discussions, and even a code playground to showcase your work or browse other users' work. 


## Udemy

![Udemy Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbwuwblsv1lc3av8di9v.png)

There are tons of courses on Udemy that are free and extremely good! I learned [JavaScript fundamentals ](https://www.udemy.com/course/javascript-essentials/) through this free video on the platform, and also can vouch for a few other paid videos. 


## Kaggle

![Kaggle Logo] (https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmea7flzx4b75nwpjmaq.png)

If you are into data science or analytics, Kaggle is the spot! There are often coding competitions that anyone can enter as well as tutorials and guides on how to start your journey into data, machine learning, and AI.


Remember that you learn what you put into each lesson. Sometimes that means we take an extra day or two to understand WHY we need so many curly braces in JavaScript. Knowledge doesn't come overnight, but we can lend each other a hand to help overcome this huge learning curve for beginning programmers!
Emmet: Writing code can be Easier
Published: 2021-07-21 23:38:28

Writing code, it's easy to make mistakes. A misspelled word on occasion, forgetting a closing tag in an HTML file, The smallest of mistakes can be hidden once the application becomes large enough. Recently, I found out about a plug-in called emmet that seems like it could possibly cut down on lines of code that I would've normally typed out manually, resulting in less mistakes. So far it seems like a plug-in that I will be making great use of in the future. 

One cool thing emmet allows you to do is seen when writing out tags. If you wanted a simple pair of div brackets normally you'd type them out. 

```
<div></div>
```
Using emmet you simply type out the word div, press enter and the result would be the same. 

![Screen Shot 2021-07-21 at 7.17.35 PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b63ns527em0kkc3c87vv.png)

Another great thing about emmet is that if you wanted to give the element or a class you can do that as well. 

```
div#blach
```
would give us 

```
<div id='blah'>
<div> 
```

Once again, less typing less chance of an error on your part. You can even to the same with a class as well. 

```
div.blach
```
would give us 

```
<div class='blah'>
<div> 
```

If you're familiar with CSS you may notice similarities in how one would tell emmet we want an id or class vs a CSS declaration of an id or a class as well. As stated before, I'm in the early stages of purposefully using emmet, so I'm learning it all as I go. I wanted to share what I've learned and maybe point other beginners in the right direction. Finding cool things like this keeps me at my computer and excited for what I may find next. Happy Coding!
Can't click on html element
Tags: angular
Published: 2021-08-06 22:40:30

Hi,
I've set up a new angular application and I've created a couple of pages. In one of the pages, I've inserted an <a href> element with a link, and tried clicking it, but nothing happened.

I right clicked and inspected the element, only to find that the element it would highlight is the angular component (the app-xxx element, to be precise), instead of the actual element I had clicked. My suspicion was that the click didn't actually make it to the <a> element, so I moved it out of the angular component, directly under the body tag, and it worked!

So the question is: why do clicks stop at the angular component and don't go all the way to the html element?
JavaScript Beginners Guide - Array
Tags: javascript, beginners, codenewbie, learning
Published: 2021-08-06 22:40:07

Here is a printable guide to arrays. These are commonly used simple array functions and how they work with examples.

This is the first of a new series I am doing let me know if there is a better format you would prefer!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elav5fyk3nrqaqveme5m.png)
Day 425 : Nobody
Tags: hiphop, code, coding, lifelongdev
Published: 2021-08-06 22:39:40

_liner notes_:
- Professional : Took the day to make sure I tied up any loose ends before the weekend. I finally finished up the rough draft of a blog post with screenshots and sent it to the project manager of the relevant SDK so they can look it over and make sure everything I said is as accurate as possible. Looking to get it submitted to be published next week.

- Personal : Last night, I was able to get the media server working locally. I didn't stream anything to it yet, I think I'll have to deploy it so that the camera I'll be using can access the server and send the feed to it. I went through some tracks for the radio show. Don't remember if I watched any anime though.

![A tree growing on a rock in a lake in Fairy Lake, BC, Canada with a background that looks like it could be a waterfall](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8q6nq8js8ng3s2ath4bb.jpg)

So there is a Fortnite Live event happening. I'm constantly amazed at how they can stream these events with so many people all over the world logged in at the same time. I just thought of a couple of side projects that I wanted to do where the node media server I am setting up would be great. I didn't even think of them when I was setting it up. I wanted to use it for a completely different project for a thing that nobody asked for. haha. So many projects, so little time. haha. Going to finish up getting ready for the radio show and put together some stories for Sunday. Oh and it's Bandcamp Friday, so I'll be buying some music from dope artists!

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 234OiGtOvII %}
Dev log for Wonder Wanderer 2: Day 6 #LOWREZJAM 😁
Tags: devjournal, javascript, challenge, gamedev
Published: 2021-08-06 22:13:16

### What did I do today? ###

Today I managed to create my own collision system on map and also jumping and other skills! I can manage to create more gravity hazards (and other ones) from now! I am also thinking to change palette of the game.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sy3e5vnuzx16bq22xvk0.gif)
<figcaption>It works!</figcaption>
Types of Machine Learning: Deep Learning
Tags: article
Published: 2021-08-09 18:36:28

---
title: Types of Machine Learning: Deep Learning
published: true
date: 2021-08-06 22:12:56 UTC
tags: Article
canonical_url: https://reinforcement-learning4.fun/2021/08/06/types-of-machine-learning-deep-learning/
---

Deep Learning is a branch of Machine Learning specialized in Artificial Neural Networks with multiple intermediary layers.

Neural Networks with multiple layers can approximate very complex non-linear functions.

That’s why Deep Learning has been very successful in CV (Computer Visions), NLP (Natural Language Processing), and Reinforcement Learning.

Deep Learning architectures include: Convolutional Neural Networks Recurrent … [Continue reading Types of Machine Learning: Deep Learning →](https://reinforcement-learning4.fun/2021/08/06/types-of-machine-learning-deep-learning/)
import {make, selectBase, unselectBase
} from "./dml";
...all we need to create a TodoList - noRAV
Tags: dml, javascript, norav
Published: 2021-08-06 21:43:56

This post will be part of a tutorial on building a TodoList using Javascript with **noRAV** ie : no React, no Vue, no Angular.

Stay tuned.

Resistance : #noRAV ;-)
An Introduction
Published: 2021-08-06 21:41:22

![Melodic Development](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nc59q5sggwcdc8d0i3m4.png)

In the year 2001, I began work as a web application developer at an industrial equipment company in Grand Rapids, Michigan. The only experience I had before getting the job was working with Dreamweaver and Flash to create a simple website for my college rock band. I’m not sure how I fooled them into hiring me (actually I do, but that is another story…), however this started me on the path of becoming the Senior Software Engineer that I am today.

The first language I taught myself was PHP, and after that moved very quickly onto HTML, CSS, and JavaScript. I’ve also worked extensively with C#, done a little python, worked with Node, and a whole bunch of other languages. I’ve worked with more frameworks and libraries over the years than I can remember. Lately I’m heavily invested in Angular and AngularJS, but I have a lot of interest in Vue and React as well.

I’ve always loved teaching myself new things, and I enjoy being presented with problems that need to be solved. I’ve been able to work on a myriad of different software solutions over the years. Planned maintenance software for industial equipment, completely custom CRM systems, employee performance systems built on top of Microsoft Dynamics CRM (as well as a pile of other custom CRM based solutions), and now that I work for an educational company I work on classroom based software solutions like curriculum and assessment.

A key interest of mine has always been understanding how things work, and teaching myself the newest technology with whatever spare time I can come up with. I’m a married man with six kids so that spare time is hard to come by, but when I can get it I like to spend it learning and trying to grow my abilities.

I’m also a fan of music. I love to write and record music. Writing music and sharing it with people I find has a similar effect to making software. I love to be creative and make something that I can share with others in order to help them with something they are facing, or working through. This is where I got the idea for Melodic Development. I want to learn, create, and share as much as I can to help other developers who are also just trying to learn and become better at what they do.
 
I hope that what I share can be of use to anyone looking to learn along with me.

*NOTE*: This was originally posted on [Medium](https://medium.com/melodic-development/an-introduction-b53002c2c34d) a while back. Trying to get something rolling (again).
First week in my first internship
Tags: work, programming, life
Published: 2021-08-06 21:14:17

So as I said in a post before that I had an interview for an internship I am doing with an Austrian company called Beeanco and now that I have got the job and this week is my first week I am going to talk about my experience.

## What is Beeanco?

So from what I understood Beeanco is a software as a service platform where it links sellers with customers so that a customer can shop environmentally friendly where it showed the customer everything they need to know about the seller and the product.

## What I am doing ?

My role in the company is as a full-stack engineer where I work with some front-end and back-end tasks depending on what needs to be done.

Now that we got the Q&A that I can think of a way let's talk about how it all went.

So after the interview, I got an email where they thanked me for coming to the interview and them saying that they were really impressed by my skills so they want to offer me the position and I had to sign an NDA to not leak any details about what I am working with or any company secretes (So don't ask for it).

after that, I had another meeting where we went through the order of stuff in the company and all the communication channels that we use and I even got added to the Github repo so I can start work.

This being my first "real" job as a full-stack developer I was and still am a bit lost because I am used to working alone where I know how everything works and don't need to write comments and such because I am the only one who is going to see the code (I know that is not good practice but I am self-taught so give a break). So working with a company and with a team is a new thing for me and I am really excited about this because this is going to be something that I am going to gain a lot of experience from and that is going to help me in my professional life a lot.

I am going to keep updating my journey through this internship whenever something interesting happens so anyone who is reading and is new to programming can also learn with me and take some notes.
What Does "Right To Repair" Mean to You?
Tags: discuss, hardware, news
Published: 2021-08-06 20:56:42

For me, **Right to Repair** has always been the build quality of items that I use on a daily basis. Which given the right knowledge & access to the right parts. You can continue to use that product for a longer time. Thereby the product becomes cheaper to own in the long term basis despite they can be expensive to buy.

Heck, I can even have the option to don't do it myself. Which I can find skilled craftsman or company to do the repairs for me. 

This spawned a cottage industry surrounding the product or a brand displaying their care for the customers. Bringing them tons of good will and brand loyalty like some of these great examples are [Allen Edmonds Recrafting Services](https://www.allenedmonds.com/discover/our-story/recrafting.html) or [Red Wings Repair](https://www.redwingshoes.com/customer-service-contact-us/repairs.html). 

This was precisely why I personally own 2 Allen Edmonds dress shoes for that specific reason. Because I could repair these shoes in my own country (Singapore) or ship them back to the US even when Allen Edmonds doesn't sell their shoes in my country.

So what does **Right to Repair** mean to you?
yq - read YAML on terminal
Tags: devops, kubernetes, gui, go
Published: 2021-08-06 20:52:28

# yq

`yq` lets you read YAML files easily on the terminal. You can find key/values easily.

{% github arriqaaq/yq %}

## Motivation

Reading yaml configurations for k8s file becomes ardent through the terminal. `yq` helps reading/searching through the YAML easy. It uses [tview](https://github.com/rivo/tview) and is inspired by [tson](https://github.com/skanehira/tson).

[![asciicast](https://asciinema.org/a/KHvEQmiSnBNWOiGsPKE4v9Om3.svg)](https://asciinema.org/a/KHvEQmiSnBNWOiGsPKE4v9Om3)

## Installation


### Grab the latest binary

```shell
$ cd "$(mktemp -d)"
$ curl -sL "https://github.com/arriqaaq/yq/releases/download/v0.1.0/yq_0.1.0_$(uname)_amd64.tar.gz" | tar xz
$ mv yq /usr/local/bin
# yq should be available now in your $PATH
```

## Usage

```shell
NAME:
   yq 

USAGE:
# from file
$ yq < test.json

# from kubectl
$ kubectl get pod kube-dns -n kube-system -oyaml | yq
```

## Bindings
### YAMLtree 

| key    | description                    |
|--------|--------------------------------|
| s      | hide/show current node              |
| S      | collaspe/expand all value nodes           |
| / or f | search for key/values                   |
| q | quit                   |