teleren/devto huggingface dataset:
Java 8 - Functional Interface
Tags: java, java8, functional
Published: 2020-04-10 14:19:26

In the previous post of this series, we discussed what is lambda expression and how can we write lambda expression. In this post, we will discuss how we can execute lambda expression. As I said, at the end of the last post, we can execute lambda expression by using Java 8's new feature, **Functional Interface**.

##So what is Functional Interface?
The interface containing the single abstract method(SAM) are called Functional Interface. Some of the Functional Interface we may know are: 

| Interface        | method           | 
| ---------------- |:----------------:|
| Runnable         |  run()           |
| Callable         | call()           |
| Comparable       | compareTo()      |
| ActionListener   | actionPerformed()|

In version 1.8, java introduced one annotation ` @FunctionalInterface ` to specify interface as functional interface explicitly. But the annotation is optional. However, it is recommended to write the annotation. It helps prevent any additional abstract method. If the interface with annotation consists of more than one abstract method, then we get a compile-time error saying:
``` 
error: Unexpected @FunctionalInterface annotation
@FunctionalInterface
^
  CustomInterface is not a functional interface
    multiple non-overriding abstract methods found in interface CustomInterface
```

**Note:** Functional interface can have multiple default and static method.

Example 1:
```
@FunctionalInterface
interface A {
    void m1();
} 

@FunctionalInterface
interface B extends A {
}

@FunctionalInterface
interface C extends A {
    void m1();
}

@FunctionalInterface
interface D extends A {
    void m2();
}
```

In the above example, the interface D definition is invalid since it contains two methods: m1() [extended from interface A] and m2().

In the next part, I will write about how lambda expression can be used with the functional interface.
Daily Challenge #223 - Responsible Drinking
Tags: challenge
Published: 2020-04-10 14:07:41

---
title: Daily Challenge #223 - Responsible Drinking
published: true
series: Daily Challenge
description: How much water should you drink for every other drink?
tags: challenge
---
Welcome to the bar!

We recommend you drink 1 glass of water per drink so you're not hungover tomorrow morning. Your fellow coders have bought you several drinks tonight in the form of strings. Return a string suggesting how many glasses of water you should drink to not be hungover.

If you would like to keep things simple, you can consider any "numbered thing" in the string to be a drink. Even "1 bear" => "1 glass of water" or "1 chainsaw and 2 pools" => "3 glasses of water".

**Example Pairs**
Input 0:
"1 beer"
Output 0:
"1 glass of water"

Input 1:
"1 shot, 5 beers, 2 shots, 1 glass of wine, 1 beer"
Output 1:
"10 glasses of water"

**Tests**
hydrate("1 beer")
hydrate("2 glasses of wine and 1 shot")
hydrate("1 shot, 5 beers, 2 shots, 1 glass of wine, 1 beer")

Good luck!
***
_This [challenge](https://www.codewars.com/kata/5aee86c5783bb432cd000018) comes from taylormb 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!_
Remove all falsy values from array in javascript
Tags: javascript, codenewbie, 100daysofcode, codequality
Published: 2020-04-10 13:45:59

Hi folks, Welcome back on another episode of this exciting series called: Javascript useful snippets. In this series of episodes, we are discussing some shortcodes or useful functions, which can help you to make your development more efficient and faster. So, stay tuned till the end…

#### Javascript Useful Snippets — compact() 

Array with massive values, we would like to filter it more often or remove all falsy values ( like 0, NaN, undefined, ‘’, false ) at those times we can use this snippet. the compact() function will take any set of values in an array and return only-n-only truthy values of the array as a result. So, let’s see how it works…
```
const compact = arr => arr.filter(x => Boolean(x));
// const compact = arr => arr.filter(Boolean); or you could write like this
```
In the above syntax, a filter is being used to return an only true value. well, the filter basically works like, you need to pass prediction in callback’s return so if record match with your given prediction then it’ll store it in a new array ( in our case compact ) else record will be omitted.

#### Result : ####
```
const result = compact([ 0, 1, false, 2, ‘’, 3, ‘a’, NaN, ‘e’ ]); // output: [ 1, 2, 3, “a”, “e” ]
```
there you go, as you have seen in the result of output all falsy values ( like 0, false, “”, NaN ) neglect from an array and we got compacted array with our desired values, cheers!!

{% youtube t9-9P3M-shM %}

Now, what if we want to check whether all records of the array are equal or not? Well our next episode it all about it so, stay tuned and keep support me.

Thank you for watching folks, if you found this informative and wanted to make me more content like this please support me on [Patreon]( https://www.patreon.com/tutorialspot).

Subscribe on youtube https://www.youtube.com/channel/UCvNjso_gPQIPacA6EraoZmg
Facebook: https://www.facebook.com/KatharotiyaRajnish/
Twitter: https://twitter.com/tutorial_spot
I've started a personal wiki
Tags: knowledge, wiki
Published: 2020-04-14 17:09:32

---
title: I've started a personal wiki
published: true
date: 2020-04-10 13:45:29 UTC
tags: knowledge, wiki
canonical_url: https://elliehuxtable.com/ive-started-a-personal-wiki/
---

 ![I've started a personal wiki](https://images.unsplash.com/photo-1507842217343-583bb7270b66?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=2000&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ)

You can find it [here!](https://ellie.wiki)

I have lots of projects, some are work, some are for fun, and in all of them I spend a lot of time learning new things

Frustratingly, I can't remember them all :(

I've read a lot about the value of keeping an engineering notebook/journal, and it's all something I agree with! I've attempted this in the past, but never really got anywhere with it.

I've tried keeping a `notes.txt` file, but eventually I find organisation becomes a bit of a hassle. Plus I like nice shiny things with emojis and images, my text editor isn't great for those ✨

I've tried paper notebooks - much as they appeal to me, I'm a disaster with them. I lose them, forget them, spend _ages_ finding the perfect pen and paper combo, and then in the end I end up sad because my handwriting is comparable to the death spasms of a spider after falling in an inkwell.

I love looking at the fancy bullet journals some people have, but I have neither the neatness nor the patience to do something like that for myself. Plus I can hardly paste a code snippet onto paper

Really, I want 1) markdown and 2) a nice way of rendering my markdown

So, I've setup a little personal wiki! I'm keeping it separate from my blog because I'd rather have somewhere I feel ok to dump random shitty code snippets without caring too much. Maybe eventually things from there will make their way over here

It's running on my `lab` (something I'll explain another time), and is basically just a hugo static site. You can find the git repo here - [https://github.com/elliebike/wiki](https://github.com/elliebike/wiki)

I'll see how it goes, because generally for writing I prefer to have a web UI that I can access from _any_ device, really easily. But I suspect I'll mostly be wanting to write to this when I'm at a computer anyway. Plus, I've been playing with some mobile SSH clients that are... surprisingly nice 🤔

Let me know if you have any questions
Como gravar cultos em igrejas a baixo custo
Tags: audacity, obs, kdenlive, live
Published: 2020-04-10 13:31:13

Pessoal, compartilhando a experiência para ajudar quem precisar e aprimorar a experiência para outros:

Preciso gravar um culto na igreja e tenho no momento as seguintes fontes de áudio:
* pastor
* órgão de tubos
* alguém que fará alguma leitura

# Desafios
* Estou no momento sem interface de áudio digital e o mixer é muito ruim, pegando da saída de fone vem um ruído absurdo que impossibilita o uso.
* Me parece que a placa de som tem também um nível de ruído bem alto pois ligando o mic direto no notebook continuou com um ruído bem alto.

# Forma de gravação
Passei a gravar o culto sem ser ao vivo para ter como resolver os problemas de captação de áudio e usei o [OBS](https://obsproject.com/) para gravar a transição de slides apenas.

# Captação de áudio
To fazendo usando celulares. Cada um com seu celular usa aplicativo de gravação de áudio. Um celular para o pastor, outro para gravar o som ambiente pegando o órgão de tubos e quem faz alguma leitura. No [OBS](https://obsproject.com/) capto o som ambiente por um mic ligado no pc para ajudar a sincronizar tudo.

# Captação de vídeo
Gravo usando o aplicativo nativo do celular mesmo, cuidado pois consome bastante espaço, no meu caso foi coisa de uns 7Gb para 1h de vídeo.

# Edição
Pego os arquivos de áudio de todos os celulares, faço os cortes em cada áudio de acordo com a fonte de áudio necessária no momento. No [Audacity](https://www.audacityteam.org) aplico compressor, remoção de ruído e normalizo, exporto este áudio. Importo o vídeo do [KDEnlive](https://kdenlive.org) e os trechos de áudio devidamente editados e numerados sequencialmente para facilitar, ajusto o sincronismo com o áudio do [OBS](https://obsproject.com/) alinhando os picos e silêncios e no final renderizo o vídeo.

# Transmissão
No horário do culto inicio um streaming e jogo a chave do streaming no [OBS](https://obsproject.com/), adiciono um source de vídeo para reproduzir o vídeo renderizado pelo [KDEnlive](https://kdenlive.org) mais uma imagem inicial, jogo a imagem antes do vídeo pois não achei no [OBS](https://obsproject.com/) como "dar play" no vídeo e no momento exato faço a transição para o vídeo que começa a reproduzir automaticamente.

Recebemos em uma das redes sociais da igreja o seguinte feedback:
> Além da excelente pregação e Oracao foi muito bem com os cantos e passagens bíblicas 
O som espetacular (sic)

Apesar de não ter utilizado equipamentos top de linha, o feedback foi muito bom!

> **PS**:  O link para as gravações podem ser encontrados no grupo da igreja no Telegram: [@ParoquiaMartinLuther](https://t.me/ParoquiaMartinLuther)
15 Best TYPO3 Extensions For Integrators: Series 2
Published: 2020-04-10 13:29:36

Welcome to the TYPO3 Extensions T3Popular Series 2 to explore what are the Best TYPO3 Extensions for Integrators.
In case you missed Series 1, for TYPO3 Developers checkout Top 10 Popular TYPO3 Extensions For Developers: Series 1

15. TYPO3 Have a Blog: No more 3rd party blog-solution!
14. Render Your TypoScript
13. Dynamic Content Elements (DCE) — Quickly Develop Custom Elements
12. Powerful Frontend Users Management
11. Perfect TYPO3 Bootstrap Template/Theme
10. Defender For Your Content
9. Ke_Searh — Alternatives to Indexed Search
8. Sourceopt — Optimize your TYPO3 Page
7. Mask — Yet Another TYPO3 Template Method
6. Easily Manage & List Your Addresses
5. Enable Images at Our Awesome CKEditor
4. Feature-rich TYPO3 Forms Management
3. Grid Elements — Must have TYPO3 extension for Integrators
2. VHS — Get more Productivity for Fluid
1. News — Most Downloaded TYPO3 Extension

Read whole blog at https://t3terminal.com/blog/15-best-typo3-extensions-for-integrators-series-2/
7 Easy Steps to Satis — TYPO3 Private Packages for Composer
Published: 2020-04-10 13:27:42

When we launched our T3Terminal.com venture, One of the first super demands from our customers was “Support Composer” for premium TYPO3 products too.
Because as the TYPO3 People just love the Composer, the community also has a dedicated composer-server https://composer.typo3.org/
And, you know, we always learn lots from customer’s demand and feedback.

T3Terminal’s free TYPO3 products already have composer support with most popular Packagist.org But for a premium package, it was still manual installation.
What’s the problem?

Step-by-step Guide to Satis
Step 1. Installation of Satis
Step 2. Configure satis.json
Step 3. Generate Satis For Composer Packages
Step 4. Test-drive with Your TYPO3 Private Packages with Composer
Step 5. Webhook between your TYPO3 Private Repositories & Satis
Step 6. Setup Cron to Crawl Automatic TYPO3 Private Packages
Step 7. Secure Your TYPO3 Private Packages at Composer-Server

Read whole blog at https://t3terminal.com/blog/easy-guide-to-satis-typo3-private-packages-for-composer/
30 Ultimate TYPO3 SEO Tips & Techniques
Published: 2020-04-10 13:26:18

Are you looking for good TYPO3 SEO tools & techniques that can help you to improve your TYPO3’s on-site SEO? Then, you are at the correct place.

You may already have found & read a lot of articles about what are the important things you need to take care for SEO. But it’s difficult to find where and how to implement those SEO features into the TYPO3 site.

1. TYPO3 Core SEO Extensions
2. Yoast SEO TYPO3 Extension
3. General TYPO3 SEO Settings
4. TYPO3 Basic SEO Meta-data
5. Social-Media OpenGraph
so on., till 30!

Read full blog at https://t3terminal.com/blog/30-ultimate-typo3-seo-tips-and-techniques/
#TYPO3 #T3Learning #T3Terminal
Top 10 Popular TYPO3 Extensions For Developers: Series 1
Published: 2020-04-10 13:20:52

Do you know there are more than 1500+ free TYPO3 Extensions available at TER (TYPO3 Extensions Repository)? Eager to know which are the top-rated TYPO3 Extensions?

Well, How can we judge which are Most Popular TYPO3 Extensions? Well, we can figure it out by considering how many extensions have been downloaded by TYPO3 developers and users at two places: TYPO3 Extension Repository and Packagist

Top 10 Popular TYPO3 Extensions for Developers
10) Language File Editor — Easier TYPO3 Localization
9) phpMyAdmin — Get MySQL Access within TYPO3 Backend
8) Apache Solr for TYPO3 — Rich and Speed-up Your Site’s Search
7) Site Crawler — Saves Your Time
… 
Read the whole blog at https://t3terminal.com/blog/top-10-popular-typo3-extensions-for-developers-series-1/
5 Simple Steps to Start Your TYPO3 Blog — Download Now Free!
Published: 2020-04-10 13:19:21

Want to create something meaningful in 2020? Why not start a blog? Clueless and confused with choices, we had no idea how to start a blog or how to be a blogger. When should we start? Which blogging platform should we use? How do we choose a blog Template? What is a plugin?

Don’t worry we’ll answer your every curiosity ;)

TYPO3 platform for blogging? Because why not!
Presenting our freebie T3 Clean Blog, TYPO3 Template

Start your dream blogging now in 5 easy steps
Step 1: Choose your domain name and host
Step 2: Set up your blog by installing TYPO3
Step 3: Install Template T3 Clean Blog to your TYPO3 setup
Step 4: Select the best plugins for your blog
Step 5: Start publishing with compelling content
Want to know more about T3 Clean Blog?

Read full-blog at https://t3terminal.com/blog/5-simple-steps-to-start-your-typo3-blog-download-now-free/
Introducing you to the First-ever TYPO3 B2B/B2C store
Published: 2020-04-10 13:17:15

Some great news has arrived!

T3Terminal beta is officially out brought to you by NITSAN Technologies Pvt Ltd
We’re happy to announce the acquisition of T3Terminal, your one-stop destination for rich TYPO3 products. This is a big step for us to pay back to the great TYPO3 community, which will help in better sharing, caring and earning for the TYPO3 community and help us to offer even better services to our clients.
Read more to know us more - https://t3terminal.com!
What music do you like to listen while coding? Here are some of my personal favourites that help me get "in the zone".
Tags: productivity, discuss, motivation
Published: 2020-04-10 13:10:13

I've noticed that listening to music while coding helps me to switch into my [deep work](https://medium.com/swlh/deep-work-how-to-develop-the-most-valuable-skill-of-the-21st-century-5ab655e13a42) mode. 

Although I sometimes listen to generic stuff, like the current Global Top 50 Hits, most of the time I prefer purely instrumental music (with just a touch of vocals sprinkled in the right places). My personal favorites are soundtracks from sci-fi tv-series and movies.

#Why Sci-Fi

![Dune sandworm](https://dev-to-uploads.s3.amazonaws.com/i/19oi2xu2ddz4qvcbjypm.jpeg)

I am a huge fan of the sci-fi genre (also fantasy, but to a lesser extent). Ever since I was a small kid I loved reading novels from great writers like Isaac Asimov (I, Robot), Frank Herbert (Dune), Arthur C. Clarke (The Songs of Distant Earth or 2001: A Space Odyssey) and Carl Sagan (Contact). I also loved watching tv-series like Star Trek, Firefly, Stargate SG1, and movies like Star Wars, Sunshine, The Matrix and Interstellar. This is to name a few. 

That's why my coding playlists have soundtracks like; 

- [Sunshine: Adagio in D-minor](https://open.spotify.com/track/50ExtKr8j9cHTY3OEw282G?si=0tjR-QfNQrqDDLDhj2hIHw)
- [Interstellar: Day One](https://open.spotify.com/track/1wFQuJK6SPvFssKUzSIRwx?si=P-yD4NMFRTGP5ncsTmxo8A)
- [Children of Dune: Inama Nushif](https://open.spotify.com/track/2bqDxQQi37VOK880m5PU8R?si=wnGWGcSBTaSv5vrr5-FvYg)
- [Inception: Time](https://open.spotify.com/track/6ZFbXIJkuI1dVNWvzJzown?si=VywquIkpSTiWY3K71tVLMA)

I don't understand completely why these specific songs (or the sci-fi genre in general) strike an "emotional" chord for me, or how they help me to get "in the zone". I believe it has something to do with my emotional attachment to the stories and characters. Like I'm somehow reliving the experiences I had while watching those tv shows or movies. 

#Today's recommendation

Here is something I've been listening to for the past few days. The season 3 soundtracks of the [2004-2008 Battlestar Galactica TV Series](https://www.imdb.com/title/tt0407362/). 

This TV series is absolutely awesome and a must-see for every Sci-Fi fan out there. But so is the music (mainly because of Bear McCreary's brilliance). 

Anyway, I hope you enjoy this playlist as much as I do. My favourites are: 03-Admiral And Commander, 06-Wayward Soldier and 21-All along the Watchtower.

[Battlestar Galactica Season 3 Soundtrack](https://www.youtube.com/embed/Q9CqxkuSldY)

##What do you like to listen to while coding? Feel free to write any suggestions you have in the comments. :)
How to Design the Best Navigation Bar for Your Website?
Tags: websitedevelopment, webdev, webdevelop, website
Published: 2020-04-10 12:54:50

The navigation bar is the most basic outline factor on a website page. Not exclusively does it rule your clients to sites past the site, but on the other hand, it's the special instrument to give clients a sentiment arrangement. With this in contemplations, it's basic to stick to time-tried outline and incredible conferences.

Utilize these essential standards to enable clients to switch all the more viable through your page.

__BEGIN WITH CONTENT__

Trust it or not, most web locales start in reverse; centrality a planner will suggest route things before breaking down substance prospects. This is completely bizarre — frequently the substance is surely not set up before the look strategy begins. According to fabulous specialists, "Content precedes plan. Outline in the absence of substance isn't planned, its adornment."

It's basic to viable assess and deal with every one of your articles into a sensible and greatly valuable system before considering plan choices.

__TRY NOT TO OVERPOWER__

The real piece of a navigation bar is to offer your client a choice. Baffling a site visitor with an excessive number of arrangements hinders his capacity to quickly pick. A route bar with five to seven direct things is adequate for most web destinations and clients. Besides, it meets exceptionally well in the span of most page plans.

__KEEP IT STRAIGHTFORWARD__

Utilize particular and commonplace musings in the route bar. Never utilize words that a normal client did not know. For instance, utilize "Get in touch with Us," not "Connect" or "We should Chat." Lastly, In The announcement," consider basically "News". 

At long last withdraw out every single unnecessary word that doesn't add anything to the route bar. Fixx Group is a Best web development company in Bangalore, what looks basic however simple to utilize. So dependably keep it straightforward and instructive.

__ACTIVITIES ON THE PRIVILEGE__

Since individuals consider from at the end left to right, they regularly suspect measures interfaces on the right-hand part of the route bar on the grounds that going right demonstrates recommend advancing. The exemption to this control is the "Home" connection, which as a retrogressive measure, ought to be furthermost in the end left.

__STAY AWAY FROM FLASH__

Blaze's most prominent the issue is that it, for the most part, isn't done in a route accessible to show watchers and mobile phones. And keeping in mind that you never need to utilize the genuine route with the show, you can escape with decorating an HTML/CSS Navigation Bar with Display to include vision consideration and keep up awesome.

At last conclusion is that while picking a route bar compose, begin straightforward. Assess your substance completely and ask yourself what your clients need to get to rapidly. All these are the characteristics of a best route bar for a business web design that draw in the clients as well.
Unsafe use of target=”_blank”
Published: 2020-04-10 12:45:16

Developers have been frequently using this attribute to open a new webpage. But this attribute, though looks pretty simple, can create a major security threat to your application.

The threat associated is called [Reverse Tabnabbing](https://owasp.org/www-community/attacks/Reverse_Tabnabbing). The issue is the webpage that we are linking our existing page to gains a partial access to the linking page, or in other words, the target page or url gains a partial access to our parent page from where the user is redirected to a new url. This happens through the window.opener object of Javascript. The attacker can change the window.opener.location to some malicious page and also the parent page. In case the parent page has the same look and feel of the user intended page, he might end up sharing credentials or secure information assuming that the webpage is secure.

To prevent pages from misusing window.opener property, we use rel="noopener". This ensures that window.opener is assigned to NULL. This works in Chrome 49 and above, Opera 36 and above, Firefox 52 and above, Desktop Safari 10.1+ and iOS Safari 10.3+. Though for older browsers, rel="noreferrer" works pretty fine. So, as a combination, we can use rel="noopener noreferrer" attribute.

Also, remember, whenever we open a new window using window.open() property, we’re also vulnerable to this, so, its always advisable to reset the "opener" property.
What Did You Learn This Week --April 10?
Tags: todayilearned, discuss
Published: 2020-04-10 12:43:42

---
title: What Did You Learn This Week --April 10?
tags: todayilearned, discuss
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--TpOOUw4B--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/67bb72156h4y13zl5cio.png
series: this-week-i-learned
---