teleren/devto huggingface dataset:
QuizNerd for Android
Tags: 2020devgrad, octograd2020, showdev, githubsdp
Published: 2020-05-21 09:23:33

---
title: QuizNerd for Android
published: true
description: I just graduated from KIT and Udacity, and this was my final project.
tags: 2020devgrad, octograd2020, showdev, githubsdp
---

## My Final Project
While in 2020 I graduated from [KIT](https://kit.edu) with a Master's – which I am extremely thankful about – there even was another graduation for me a bit earlier. In 2018 I obtained the [Udacity Android Developer Nanodegree](https://www.udacity.com/course/android-developer-nanodegree-by-google--nd801) and here is my final project. 

QuizNerd is a multiplayer quiz game developed for programmers and IT enthusiasts. You can challenge your friends and compete in matches that consist of a large variety of different programming questions.

It comprises over 800 different questions in 9 categories, including Android, C++, C#, HTML, Java, JavaScript, PHP, Python and Swift. 

![](https://res.cloudinary.com/practicaldev/image/fetch/s--ZLZyRMMn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oww9i27vntbgtyr8cmko.png)

## Demo Link
[![](https://raw.githubusercontent.com/muety/quiznerd-android/master/assets/badge.png)](https://play.google.com/store/apps/details?id=com.github.n1try.quiznerd)

## Link to Code
{% github muety/quiznerd-android %}

## How I built it 
It's a native Android app, written in Java. I did not use any architectural framework, but only plain Android APIs and a few common libraries like Apache Commons, [OkHttp 3](http://square.github.io/okhttp/), [Project Lombok](https://projectlombok.org/) (must-have for any Java project if you asked me) and the usual Android support libraries. As a backend it uses Google's [Firebase](https://firebase.google.com/) and the pixely, nerdy avatars are generated by a great open-source web service called [DiceBear](https://avatars.dicebear.com/).

While creating this project, I learned a lot about using Google's cloud service on the one hand. On the other hand, I got familiar with publishing and maintaining an app on Google's public app store. 

GitHub's student developer pack helped me along the way, especially in form of GitKraken Pro for easier source code management and free DigitalOcean VMs. 

## Additional Thoughts / Feelings / Stories
Although this project is not directly related to my studies at university, I probably would not have been able to realize it without them. Studying at KIT has sparked a whole new fascination for software development for me and all the knowledge I gained – including theory, practice and soft skills – got me where I am now. I encourage anyone to never stop learning!
Pastanaga 2.0
Tags: reactnative, github, graduation, graphql
Published: 2020-05-21 13:45:15


## Pastanaga 2.0


## https://devpost.com/software/pastanaga-2-0
 

## https://github.com/jamipuchi/Pastanaga-2.0



### Inspiration

We were inspired by the original game, called the pastanaga, which consists of eliminating other players by touching them with a carrot: You are only given the name of a player (that you know it's a student), and you have to find him and "kill him with the carrot". If you are successful, next, you will have to kill the person your last victim was trying to "kill", until there's just one winner. We thought that this hackathon would be a great opportunity to bring this awesome game to more people in the university context by using technology to play it.

###What it does

In only **36 hours**,we developed Pastanaga2.0. It is a complete mobile game, for both, **Android** and **iOS**, with power-ups and  animations. It uses **FIB API v2** to get UPC schedules from the students, and using **geolocation services**, it is able to know if students are in class, rewarding them with virtual coins if that's so. The students can buy different power ups to help them find their "victims", and can try to kill them with the app, again, using geolocation services. We think this will motivate students to go to class, meet new people and create a community. We also have an **admin panel** to manage all the different games and players, and a **landing page** to advertise our product.

###How we built it

The three members of the team were already familiar with **react native** and we decided to use it for our front end of the app. We decided to use **GraphQL** for the back end since we thought it was interesting to learn and we could benefit from it.

###Challenges we ran into

We had smooth sailing from the beginning... Just kidding, it is a software project ;). We ran into some problems trying to communicate the admin app and the server because of some CORS policy the server had activated by default. We also ran into some other problems that we were able to solve after some time thinking about them.

###Accomplishments that we are proud of

We are proud of designing the **UI/UX** in such a short period of time and obtaining a result I am quite proud of. It is really user friendly and just complex enough that the user can dive into it without fear but with a good sense of exploration and have a lot of fun! We also think we have a cool product, a playable game, and a robust implementation. We know it is posible to play it without any major inconveniences!

###What we learned

We learned a lot about **patterns** in react and react native, how to do them better and how to optimize them. We also learned how to optimize our time to put out the most work in the least amount of time possible.

###What's next for Pastanaga 2.0

We hope we can bring the app into production if the campus wants to implement it so the students can have some fun and also be incentivized to come to class.
Daily Challenge #246 - Readable Specification Pattern
Tags: challenge
Published: 2020-05-21 13:44:17

---
title: Daily Challenge #246 - Readable Specification Pattern
published: true
series: Daily Challenge
description: Specification pattern is one of the OOP design patterns. 
tags: challenge
---
Specification pattern is one of the OOP design patterns. Its main use is combining simple rules into more complex ones for data filtering. For example, given a bar menu you could check whether a drink is a non-alcoholic cocktail using the following code:
```
drink = # ...

is_cocktail = IsCocktail()

is_alcoholic = IncludesAlcohol()

is_non_alcoholic = Not(is_alcoholic)

is_non_alcoholic_cocktail = And(is_cocktail, is_non_alcoholic)

is_non_alcoholic_cocktail.is_satisfied_by(drink)
```
But, this code is terrible! We have to create lots of unnecessary variables, and if we were to write this specification in one line, the result would be getting more and more unreadable as its complexity grows:

```
drink = # ...

And(IsCocktail(), Not(IncludesAlcohol())).is_satisfied_by(drink)
```

You don't want to write such code. Instead, you should implement a much more beautiful specification pattern by:

- using the &, |, ~ operators instead of creating superfluous And, Or, Not classes
- getting rid of those annoying class instantiations
- calling the specification directly without any is_satisfied_by methods

Make something like this instead:
```
drink = # 
...(IsCocktail & ~IncludesAlcohol)(drink)
```

To do so you have to create a class Specification which will be inherited by other classes (like aforementioned IsCocktail or IncludesAlcohol), and will allow us to do this magic.

Note: whenever a class inheriting from Specification (e.g. IsCocktail) or a complex specification (e.g. IsCocktail & ~IncludesAlcohol) is called, instead of constructing and initializing a truthy/falsey instance, True/False must be returned.

Try it out and tell us what you've made!
***
_This [challenge](https://www.codewars.com/kata/5dc424122c135e001499d0e5) comes from FArekkusu on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Android and Machine Learning Integration
Published: 2020-05-21 13:43:04



We all know about Zoom Online sessions or classes where most of the student of UG programs are mocking about their appearance on live chat and they found a way to get away from this by small tricks like just join the meeting but not
attentive towards the class.
So what would be the solution to this problem?  Think a little!
We all know, how cool a mobile app or desktop looks, when it can come to online live streaming of media such as video calls on different platforms like Hangout, Microsoft Teams, and Zoom.
Now the matter of crux for this problem is to handle it with Artificial Intelligence. Of course there's always a way to solve the real-world sitch like this.
How would artificial intelligence make a difference here?
There's an algorithm in the AI kit provided by Google in 2017 for the detection of the face through the device camera by locating the face coordinates and later save them besides it follows the movement of the coordinates 
with device. 
Why do I mention the coordinates?
Actually the algorithm is designed in such a way that it can even detect the human emotions from the face like smiling, crying, etc.
What would be the basic plan for implementation in Android OS?
User Interface: Creating the easy to understand and systematic interface for the android application on Prototype making software which would contain all the animatic transitions required in the app.

Schema Design: For making a good database for application there has to be normalization of rough schema design which would allow the app to attach with the database efficiently after the creation of the database.

MVVM architecture: A Model view ViewModel pattern selection is really important for open source projects so that if the app extended to the upper level in the future then-new developers can understand the project easily.

Database: Creation of database from the decided schema in the format such as offline or realtime database.

Designing of XML components: For making the application efficient and small in size there has to be a perfect selection of the components for XML layouts.

JAVA/Kotlin coding: To make the whole thing into a realistic project, MVVM pattern-based coding for various functions and services.

Testing: To make sure the app is working perfectly it has to be tested either alpha-testing, beta-testing, or google based firebase automatic testing has to be done to find the bug and later fix them.


In the next Tutorial I'll show you the first part of the implementation of the application in android studio itself.
how to build anything from scratch
Tags: webdev, react, javascript, html
Published: 2020-05-21 13:40:15

Hello All 
In this article, I am going to you about how to build anything from scratch by my point of view but I am sure you will not regret it.
Let's Begin 
Key Principles:-
* Imagine 💭
* Create a wireframe or sketch 📖📗🖍🖌✏
* decide language or framework you like 📌
* Learn the framework from scratch and go for it 📖
* And then start work from scratch and done then ship(Delpoy) it🛠⚙🛒🤾‍♂️ 

# Detail Explanation 

* Imagine 
<br>
In this category, you can take example of thing like when you dream at night go to the mars moon some US people come to india Dharmshala some go to paris and Newyork times square/NYC like that you have to imagine how your app will look like for example see below what i did 👉🔽
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/08xsm73rt32g4meyzzck.png)
like that you can do it.😊👍
* Create a wireframe or sketch
<br>
In which wireframe or sketch you make things like doodles that you do in classes and in childhood days on backside/inside of books (Caution I still do it 😅) you can do a thing like for example see below what I did 👉🔽
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/08xsm73rt32g4meyzzck.png)
* Learn the framework from scratch and go for it
<br> 
if you having knowledge of particular framework already then you can start work from scratch but if your beginner in that language or in the framework you have to learn it from scratch with prerequisites  and then you can do things in that hope you got my point 😊👍

* And then start work from scratch and done 
<br>
Lastly start with new energy your going to do the thing i can do it you can do it we can do it believe in yourself you can do it 👍
Thank you hope you got my points 👍🤾‍♂️
![](https://media.giphy.com/media/3og0IPMeREHpEV0f60/giphy.gif)
Interactive Java JVM Monitoring on Kubernetes - Configuring VisualVM to use JMXMP
Tags: java, visualvm, monitoring, jmx
Published: 2020-05-21 13:11:18

This is part 2 of a 2-part series.


Despite feature requests to do so and some work to create a plugin, VisualVM does not ship with JMXMP configured by default.   The following recipe has been tested with VisualVM 2.0.1.

If we used Maven to enable our application, we have a copy of the required java archive (jar) in the .m2 directory.  The simple way is to add that jar to the class path using the `--cp:a` option.   This jar would normally have to be "endorsed" to be used, but starting from the directory where it is found allows things to work. 

```powershell
cd C:\Dev\.m2\repository\org\glassfish\external\opendmk_jmxremote_optional_jar\1.0-b01-ea
C:\Dev\Java\visualvm_201\bin\visualvm.exe --cp:a opendmk_jmxremote_optional_jar-1.0-b01-ea.jar
```

You can also create a shortcut on your desktop to run the command.  Use the `Start In` option to select the directory where the jmxremote jar is found.

### Adding a remote host

When accessing a remote host such as KubeSail, add it using the `add remote host` option
![image](https://user-images.githubusercontent.com/678663/82157843-d6b23e80-9851-11ea-8444-6ab5f8299fdd.png)

### Configure a connection

Under the new host (or under Local if connecting locally), right-click and use `Add JMX Connection`.   Use the accessible address.  

- If running locally, this will be localhost, and the syntax will be `service:jmx:jmxmp://localhost:1098`
- if remote, the external address obtained by querying the pod. 
  In our example, that yields`service:jmx:jmxmp://54.151.2.??:300??`  (the port is the one listed in the NodePort configuration as explained in [Part 1](https://dev.to/jflamy/interactive-java-jvm-monitoring-on-kubernetes-part-1-exposing-jmxmp-5c3f).)

![image](https://user-images.githubusercontent.com/678663/82157887-24c74200-9852-11ea-8351-a6f2f6c8add0.png)

- Double-clicking on the new connection will open it, and the name of the monitored application will be shown.  You can then use the various tabs to monitor, examine or sample the application.

![image](https://user-images.githubusercontent.com/678663/82157944-9f905d00-9852-11ea-8331-318e88f14b2c.png)
My Final Year Project
Tags: swamim
Published: 2020-05-21 13:37:26

# Sound Classification Device for Hearing Impaired

## My Final Project
 I used a Raspberry Pi 3 Model B to run the Sound Classification and show the recognized sound as text in a display device. This was done to keep the whole device mobile. The same code can also be run on a mobile phone.

## Demo Link
 https://youtu.be/3iwV4GQ_njk

## Link to Code

 https://github.com/Swamim18/Sound-Classification

## How I built it

 I built the project using Javascript ml5.js and p5.js libraries and html to extract and display the result in the web browser. I also used teachable machine platform to train the model.


[Final Note]: # (CONGRATULATIONS!!! You are amazing!)
CSS - input floating label animation ✨
Tags: showdev, webdev
Published: 2020-05-21 13:32:50

Input elements are often used in web development. But using only a placeholder to describe the fields [are harmful](https://www.nngroup.com/articles/form-design-placeholders/).

So let's create a floating label with very little code. Check out the code in this CodePen and try out the result.

{% codepen https://codepen.io/gautemo/pen/vYNbXPN %}

I have used some JavaScript to detect when the field has a value, but that could also be done with required or placeholder and a not selector.
```html
<input type="text" required/>
```
```css
input:not(:invalid) + span
```
or
```html
<input type="text" placeholder=" "/>
```
```css
input:not(:placeholder-shown) + span
```

Also I'm looking forward to the `lh` unit in CSS which [are coming](https://developer.mozilla.org/en-US/docs/Web/CSS/length), so I don't have to specify the line-height.

But, remember that [floating labels are problematic](https://medium.com/simple-human/floating-labels-are-a-bad-idea-82edb64220f6), as this has some of the drawbacks mentioned in that article.
Binomo trading platform – registration and sign-on
Tags: binaryoptions, broker, binomo, trading
Published: 2020-05-21 13:31:05

Simple and easy signing-on is no less catching. The minimum deposit amounts to just $10 at Binomo, and the site allows to open upwards of $1 transactions. That’s why even new entrants will have no difficulty in stepping over the threshold and starting to trade online.
https://binary-investment.com/en/binomo-registration-account
May 21st Side Project Check-in
Tags: discuss, watercooler, checkin, sideprojects
Published: 2020-05-21 13:27:24

---
title: May 21st Side Project Check-in
published: true
description: 
tags: discuss, watercooler, checkin, sideproject
series: Side-project Checkin
---
# Morning/Afternoon dev.to fam!
How's your week been? Any new projects in the works? Looking to have someone review your code before you release it? Have you released your project recently? Let's share in the comments below!
Configuring SQL for High Availability in Terraform
Tags: codeproject, technology, availability, terraform
Published: 2020-06-22 18:18:40

---
title: Configuring SQL for High Availability in Terraform
published: true
date: 2020-05-21 12:57:40 UTC
tags: CodeProject,Technology,availability,Terraform
canonical_url: 
---

Hello All, a short post this week, but as we talk about availability, chaos engineering, etc. One of the most common data elements I see out there is SQL, and Azure SQL. SQL is a prevelant and common data store, it’s everywhere you look.

Given that, many shops are implementing infrastructure-as-code to manage configuration drift and provide increased resiliency for their applications. Which is definitely a great way to do that. The one thing that I’ve had a couple of people talk to me about that isn’t clear…how can I configure geo-replication in TerraForm.

This actually built into the TerraForm azure rm provider, and can be done with the following code:

```
provider "azurerm" { subscription\_id = "" features { key\_vault { purge\_soft\_delete\_on\_destroy = true } }}data "azurerm\_client\_config" "current" {}resource "azurerm\_resource\_group" "rg" { name = "sqlpoc" location = "{region}"}resource "azurerm\_sql\_server" "primary" { name = "kmack-sql-primary" resource\_group\_name = azurerm\_resource\_group.rg.name location = azurerm\_resource\_group.rg.location version = "12.0" administrator\_login = "sqladmin" administrator\_login\_password = "{password}"}resource "azurerm\_sql\_server" "secondary" { name = "kmack-sql-secondary" resource\_group\_name = azurerm\_resource\_group.rg.name location = "usgovarizona" version = "12.0" administrator\_login = "sqladmin" administrator\_login\_password = "{password}"}resource "azurerm\_sql\_database" "db1" { name = "kmackdb1" resource\_group\_name = azurerm\_sql\_server.primary.resource\_group\_name location = azurerm\_sql\_server.primary.location server\_name = azurerm\_sql\_server.primary.name}resource "azurerm\_sql\_failover\_group" "example" { name = "sqlpoc-failover-group" resource\_group\_name = azurerm\_sql\_server.primary.resource\_group\_name server\_name = azurerm\_sql\_server.primary.name databases = [azurerm\_sql\_database.db1.id] partner\_servers { id = azurerm\_sql\_server.secondary.id } read\_write\_endpoint\_failover\_policy { mode = "Automatic" grace\_minutes = 60 }}
```

Now above TF, will deploy two database servers with geo-replication configured. The key part is the following:

```
resource "azurerm\_sql\_failover\_group" "example" { name = "sqlpoc-failover-group" resource\_group\_name = azurerm\_sql\_server.primary.resource\_group\_name server\_name = azurerm\_sql\_server.primary.name databases = [azurerm\_sql\_database.db1.id] partner\_servers { id = azurerm\_sql\_server.secondary.id } read\_write\_endpoint\_failover\_policy { mode = "Automatic" grace\_minutes = 60 }}
```

The important elements are “server\_name” and “partner\_servers”, this makes the connection to where the data is being replicated. And then the “read\_write\_endpoint\_failover\_policy” setups up the failover policy.
as a developer, what do you regret the most?
Tags: discuss
Published: 2020-05-21 13:22:06

There was a recent quora question, where a newbie developer asked:
"as a developer, what do you regret the most?"

A seasoned developer replied: "What I regret the most is that I spent too much time on the technical side. Learning the latest frameworks. And learning all new languages. But not finishing any side project. Always starting but not completing. A jack of all trades and master of none."

Do you also have something to share?
How to Download YouTube videos in Python.
Tags: python, pytube, download, youtube
Published: 2020-05-21 13:14:21

---
title: How to Download YouTube videos in Python.
published: true
description: Download Youtube Video With Pytube Library In Python.
tags: python, pytube, download, youtube
---

## Hello everyone!
### This tutorial is "How to Download Youtube videos in Python.
#### _________________________________________________
### Download Pytube Library
```python
pip install pytube # python2
```
```python
pip3 install pytube # python3
```
```python
pip install pytube3 # if not work with pytube.
```
### First of all, we need to import Pytube library :
```python
import pytube
```
### After that, You need copy the URL of the Youtube video :
```python
url = 'https://www.youtube.com/watch?v=4SFhwxzfXNc'
```
### Load url in function Youtube :
```python
 youtube = pytube.YouTube(url)
```
### Set Streams Resolution :
```python
video = youtube.streams.first()
# or
video = youtube.streams.get_highest_resolution()
```
### Download Video :
```python
video.download() # In Same Folder
# or
video.download('/Downloads') # In Other Folder
```
### Get Information of Video :
```python
video.title # Title
video.video_id # Id
video.age_restricted # Age
```
### Streams Format :
```python
video.streams.all()
stream = video.streams.all()
for i in stream:
  print(i)
```
### Example 1 :
```python
import pytube

url = 'https://www.youtube.com/watch?v=4SFhwxzfXNc'

youtube = pytube.YouTube(url)
video = youtube.streams.first()
video.download('../Video')
```
### Example 2 :
```python
import pytube

print("Give URL:")
url = input()

pytube.YouTube(url).streams.get_highest_resolution().download('../Video')
```

#### I hope you liked it!

###### Library Creator : https://github.com/nficano/pytube