teleren/devto huggingface dataset:
What Are Cypress Custom Commands? | Cypress Automation | Part X
Tags: javascript, beginners, tutorial, cypress
Published: 2022-06-30 10:09:43

In this Cypress Testing Tutorial video, you’ll understand how to create custom commands in Cypress. [Try LambdaTest now](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=jun30_sb&utm_term=sb&utm_content=tutorial_video)


Know more on LambdaTest Cypress Testing-: [https://www.lambdatest.com/cypress-testing](https://www.lambdatest.com/cypress-testing?utm_source=devto&utm_medium=organic&utm_campaign=jun30_sb&utm_term=sb&utm_content=tutorial_video)


This video is a part of our Cypress Testing Tutorial series for Beginners. In this video, Chris DeSilva (@desilvadev) will help you understand what are Cypress custom commands and how these can be used to change the default behavior of the built-in Cypress commands. It also demonstrates how you can create a new command altogether. This video also deep dives into the major differentiation when it comes to adding new Cypress commands and overwriting existing commands in Cypress framework.

You will also learn 🎫 -: 
🔹What are Custom Commands in Cypress?
🔹How to create Custom Commands?
🔹How do I add a Custom Command?
🔹How do I run a Custom Command?
What Are Cypress Fixtures? | Setting Up Cypress Fixtures | Cypress Tutorial | Part IX
Tags: javascript, beginners, tutorial, cypress
Published: 2022-06-30 10:07:26

In this Cypress tutorial for beginners, you’ll learn “how to set up Cypress fixtures” and “write a test that uses stubbed data.” [Try LambdaTest now](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=jun30_sb&utm_term=sb&utm_content=tutorial_video)


Know more on LambdaTest Cypress Testing-: [https://www.lambdatest.com/cypress-testing](https://www.lambdatest.com/cypress-testing?utm_source=devto&utm_medium=organic&utm_campaign=jun30_sb&utm_term=sb&utm_content=tutorial_video)


Cypress provides a directory named fixtures, which can store multiple “JSON” files representing test data. This is useful for tests that must read the same data over and over again. Thus, fixtures enable data-driven automation in Cypress by saving the test data in JSON format. In this video, Chris DeSilva (@desilvadev) helps you understand "how to use fixtures in test scripts?" Furthermore, you are going to learn how to add Cypress fixtures to mock up some test interactions of the application, which will run locally on your machine.

You will also learn 🎫 -: 
🔹What are fixtures in Cypress?
🔹How to set up Cypress fixtures?
🔹How do you add fixtures to Cypress?
🔹How to create and use fixtures in Cypress tests?
🔹How to use the fixture in test scripts?
What Are Cypress Hooks? | Hooks In Cypress | Cypress Tutorial | Part VIII
Tags: javascript, beginners, tutorial, cypress
Published: 2022-06-30 10:05:38

Cypress Hooks is the construct that helps in performing a particular set of actions before/after each test case or before/after all the test cases in the test suite.
Cypress provides various hooks like before(), beforeEach(), after(), and afterEach() to execute pre and post steps. [Try LambdaTest now](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=jun30_sb&utm_term=sb&utm_content=tutorial_video)


Know more on LambdaTest Cypress Testing-: [https://www.lambdatest.com/cypress-testing](https://www.lambdatest.com/cypress-testing?utm_source=devto&utm_medium=organic&utm_campaign=jun30_sb&utm_term=sb&utm_content=tutorial_video)


In this video, Chris DeSilva (@desilvadev) showcases how hooks can minimize boilerplate and run tasks at different points in the test suite. He also talks about the four common Cypress hooks and when they invoke in a test suite:
➧ before()
➧ after()
➧ beforeEach()
➧ afterEach()

You will learn 🎫 -: 
🔹What are hooks in Cypress?
🔹How do you write the first test in Cypress?
🔹How to use hook in Cypress?
🔹How to define hooks in a Cypress TestScript?
Why I am switching to Ubuntu 20.04 from 22.04
Tags: ubuntu, bugs, beginners, linux
Published: 2022-06-30 09:58:29

Hey there! I am Gautham & It has been a long-time since I posted a video or a 'dev community' post. I've been spending my time at school and watching YouTube videos (_actually lazy to take a video & write a post. sOrrY._)I am going to switch to Ubuntu 20.04 nearly and This is the ReAsoN_!_.

I've taken a love to Ubuntu 22.04 as I am a big fan of customising & I like new features of Ubuntu 22.04 but some of the following things has disappointed me. First Pros then Cons.

## PROS

- Nice customising widgets and things.
- Amazing pre-built screen recording.
- As a Linux _nerd_, It was love at first sight with the distro.
- The new Gnome 42 was an amazing experience. 

## CONS 

- The Screen recording was amazing as a pre-built but cannot record for a long time and low screen recording quality.
- The System hanged many times as I changed the version of Kernel to 5.18 for a solution but It was also not that good.
- The given version of Firefox was not compatible with _gnome extensions_ as It was not connected _as it says_.
- Even though after I managed to install the correct version of Firefox, Only some of the extensions was able to use.
- Was not up to my expectation.

There are also a quite more things but these are the most important this that I think I should include. I've just downloaded the files and Rufus now, At the time this post was _posted_ in the internet. I am also thinking of putting a video about this. One more thing to say is that, I am posting it on Thursday, But I am having class, right? I am not well with my health recently so took 2-days leave. Going to school on Friday. Ok, then!

Thank you,
Gautham G Nair.

**If you also have any problem with Ubuntu 22.04, Please include it below as I am really interested to know your problems and See if I can solve it for you. Thank you for the patience of reading this post and spending your valuable time reading it.**
Leetcode Solutions: Product of Array Except Self
Published: 2022-06-30 09:33:31

Here is the text of problem: 

Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].

The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.

You must write an algorithm that runs in O(n) time and without using the division operation.


Here is my different solution: 


```py

class Solution(object):
    def productExceptSelf(self, nums):
        
        p = 1
        
        zeroCount = 0
                
        if all([num == 0 for num in nums]):
            return nums
        
        for num in nums:
            if num == 0:
                zeroCount += 1
                continue
            p *= num 
            
        p = p if zeroCount < 2 else 0
        
        res = []
        
        includeZero = 0 in nums
        
        for num in nums:
            if num == 0:
                res.append(p)
            
            elif includeZero:
                res.append(0)
            elif num != 0:
                res.append(p/num)
            
        
        return res

```
🎨 From waiting time metrics to Generative art
Tags: api, javascript, webdev, showdev
Published: 2022-06-30 09:27:33

## ❔ Context

Recenlty we have published an API dedicated to waiting time in our (Post)-offices.

👉 See previous episode of the series.


To put in evidence the potential of that API we created an original [`P5*js`](https://p5js.org/) based artwork datavizualization experience around that API.

In this post you'll discover what we could achieve... and if you like it to run it by yourself.

## 🎫 Core real world data display

In our agencies, here is how we display the data to customers :

{% youtube A1MLiBJON2Y %}

## ⌨️ Install artwork

The install process is really straight forward : 

First, clone the repo : 

```shell
git clone https://github.com/opt-nc/generative-art-temps-attente.git
cd generative-art-temps-attente
```

Then boot the solution : 

```shell
docker-compose up -d
docker-compose ps
```

That's it : you can now enjoy the datavisualization.

## 🎨 Enjoy artworks

Many kind of visualizations have been created. See below to discover them.

### 🌌 Orbit

First the default one.

Notice that rotation speed is based on the waiting time.

```
firefox http://localhost
```

### 🌌 Orbit light version

Then a lightest version of the previous one :

```
firefox http://localhost/orbit.min.html
```

### ⛹️ Jumpers

In this visualization each ball is a Post-Office, and the higher a ball is bouncing, the higher waiting queue are important.

```
firefox http://localhost/jumpers.html
```

### 🕳️ Gravity

Then this one where interactions are driven by gravity and speed.
Notice that each ball's mass is relying on the waiting time :

```
firefox http://localhost/gravity.html
```

### 🍿 Live demo

Below a live demo from scratch :

{% youtube 4vmKVhHkdhI %}

## 🙏 Acknowledgements

All that work would have not been possible without talents and highly engaged team members : 

- 👧 [Emilie Bossart](https://www.linkedin.com/in/meilie389/) : first API version
- 👨 [Guillaume Bertherat](https://www.linkedin.com/in/guillaume-bertherat-3b7a071b3/) : visualizations creator
- 🧔‍♂️ [Daniel Santos](https://www.linkedin.com/in/daniel-santos-dev-fullstack/) : enhancements on the API and docker image publish automation

## 🔖 Resources

### 🤓 Source code

{% github opt-nc/generative-art-temps-attente %}

### 🛍️ API on RapidAPI.com

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ua5grlbcbutaktou9y8r.png)](https://rapidapi.com/opt-nc-opt-nc-default/api/temps-attente-en-agence/details)
Enabling virtualenv on jupyter notebook
Tags: python, jupyter
Published: 2022-06-30 09:26:32

## Introduction

Jupyter notebook make life easier for 
- **Begineer** to learn and understand step by step
- **Experts** to explore data,visualiations.
- **Mentors** to create course 
- **Speakers** for demonstration

While exploring same libraries have different versions and you need to test those version separately. They can be installed on separate virtualenvs.

Now in order to make this environment quickly accessible, we need to add this env to jupyter notebook as kernels.

Below are the steps:

## Jupyter

Installation
```
sudo apt install jupyter-core
```

Activate the env and the install `ipykernel`
```
pip install ipykernel
```

Inorder to differentiate different environemnt, you have to name them, Name them with along with packgae version
```
ipython kernel install --user --name=envname_pkg_v1
```

To view all the environment 
```
jupyter kernelspec list
```

Remove environment from jupyter
```
jupyter kernelspec uninstall envname
```
Fresh is out, neat! But are there other "hybrid" frameworks out there?
Tags: typescript, webdev, discuss, deno
Published: 2022-06-30 09:22:05

[Fresh](https://fresh.deno.dev/) just came out, and it really reminds me of [Phoenix](https://www.phoenixframework.org/) which also handles backend development and also hydrates frontend with reactive components.

Of course, there is SSR in React/Vue/Svelte, and we can also think of Meteor.js but it seems to me that this is not the same intention behind it as those "hybrid" frameworks.

Anyway, do you know any other framework that does server side rendering and handles hydration/reactivity too?

You can cite any framework in any language of course!
Packages for Laravel
Tags: composer, laravel, php, package
Published: 2022-06-30 09:19:00

Some really great composer packages to try out:

https://github.com/jeremykenedy/laravel-logger#authentication-middleware-usage
https://github.com/beyondcode/laravel-dump-server
https://github.com/barryvdh/laravel-debugbar
https://github.com/laravel-shift/blueprint
https://github.com/spatie/laravel-backup
https://github.com/spatie/laravel-permission
https://github.com/spatie/laravel-activitylog
https://github.com/realrashid/sweet-alert
https://github.com/rappasoft/laravel-livewire-tables
https://github.com/yajra/laravel-datatables
https://github.com/Labs64/laravel-boilerplate
https://github.com/creativetimofficial/argon-dashboard-laravel
https://github.com/the-control-group/voyager
https://github.com/beyondcode/laravel-er-diagram-generator
https://github.com/spatie/laravel-sql-commenter
https://github.com/spatie/laravel-event-sourcing

The list shall keep growing...
Personal Portfolio Website
Tags: javascript, webdev, beginners
Published: 2022-06-30 09:18:57


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcbjgqbfqws9ovq621lz.jpg)Hey friends, Today in this blog you’ll learn how to create a website which is a Fully Responsive [Personal Portfolio Website](https://codewithnepal.com/personal-portfolio-website/) using HTML CSS & JavaScript. I already shared many blogs on web design stuff like [Navigation Bar, Cards, Image Slider, Owl Carousel, Buttons, and many more]. Similarly, I’d shown how to create a full [business website](https://codewithnepal.com/how-to-create-a-business-website-using-html-and-css/?ref=morioh.com&utm_source=morioh.com) by using HTML & CSS and now it’s time to create a portfolio website.

**Personal portfolio **sites are consistent and should be maintained throughout your work. It offers potential clients a convenient way to view your work while allowing you to expand your skills/experience and services.

You might like this:

1.[JavaScript Projects For Beginners](https://codewithnepal.com/javascript-projects-for-beginners/)
2. [Automatic Image Slider](https://codewithnepal.com/how-to-make-an-automatic-image-sider-in-html-css/)
3. [Sidebar Menu using HTML and CSS](https://codewithnepal.com/how-to-make-an-automatic-image-sider-in-html-css/)
4. [Cool Glowing Effect on Buttons](https://codewithnepal.com/cool-glowing-effect-on-buttons-using-html-css/)

On this site [**Personal Portfolio Website**], there are six sections on one page – Home, About, Services, Skills, Teams, and Contact, and each section is attractive and eye-catching to the user. On the home page of this site, on the top, there is a sticky nav bar with a logo on the left side and some navigation links are on the right side. On the left side of the home page, there are texts which are about the author’s name, profession, and a button labelled “Hire me” as you can see in the image.

What is a personal portfolio website (P.P.W)?
A personal portfolio website is a professional website that provides information about what you do, what services you may offer, and how to contact you or your company. Portfolio websites are an easy way to promote yourself, your brand, or your business.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd9l3po506lsfxeli75g.JPG)

**[For Full Tutorial follow this link.](https://codewithnepal.com/personal-portfolio-website/)**
Memoization in Ruby
Tags: ruby, memoisation, memoization
Published: 2022-06-30 09:03:48

---
title: Memoization in Ruby
published: true
description: Practical examples for memoising method calls
tags: Ruby, memoisation, memoization
---

[Memoization](https://en.wikipedia.org/wiki/Memoization#:~:text=In%20computing%2C%20memoization%20or%20memoisation,the%20same%20inputs%20occur%20again.) is a simple and powerful performance optimisation technique that all Ruby developers should have full command of.
Here I'll go over three memoisation variants, in order of increasing difficulty:
1. Naive `||=`-based memozation 
2. Intermediate `defined?`-based memoization
3. Advanced memoization for methods with parameters

### 1. `||=`

A popular Ruby idiom, pronounced "or-equals", where assignment only happens if the lefthand side is falsey. Use this where you know that any potential assigned values will never be falsey.

```rb
def response
  # it is a common practice to store the memoized value in
  # an instance variable (ivar) of the same name as the method.
  @response ||= expensive_operation
end
```

### 2. `defined?`-based memoization

A less known pattern that is capable of memoizing falsey values. Also useful if `expensive_operation` is a multiline statement.

```rb
def response
  return @response if defined?(@response)
  
  # NB, this is a regular assignment because
  # line above already did the cache check.
  @response = expensive_operation
end
```

### 3. Memoization for methods with parameters

Sometimes it's useful to memoize several values, depending on the arguments given to a method. This approach can only be used if the values the method returns (and that are about to be memoized) are [idempotent](https://en.wikipedia.org/wiki/Idempotence) i.e. remain the same on repeat calls.

It's a good practice to name the ivar in plural of the method name.  
Notice that `memo_key` must be something unique based on the arguments given. Using `Object#hash` is a general approach, but there can be others, for example, args can be of a known type and have a unique identifier returned by `.id`...

```rb
def response(arg1, arg2)  
  @responses ||= {}
  memo_key = "#{arg1.hash}_#{arg2.hash}"

  return @responses[memo_key] if @responses.key?(memo_key)
  
  @responses[memo_key] = begin
    puts "Doing expensive operation"
    expensive_operation
  end
end

> response(:a, :b)
Doing expensive operation
=> something
> response(:a, :b)
=> something

> response(false, false)
Doing expensive operation
=> something_else
> response(false, false)
=> something_else
```
Mi primer Post
Tags: spanish, webdev, programming
Published: 2022-06-30 08:41:32

Buenos días, Mi nombre es Eduardo París, soy desarrollador Web aunque llevo poco ya que anteriormente he trabajado en el desarrollo de software para vehículos.

Empecé en el mundo de la programación al hacer un Grado medio de Sistemas microinformáticos y redes ya que mi afición era la informática. En este curso había un asignatura de desarrollo web donde se aprendía a utilizar HTML, CSS y algunas nociones de Js.
Esto despertó mi curiosidad por la programación e hizo que siguiera haciendo cursos y me especilizara en ello ya que posteriormente estudie el Grado Superior.
 
He creado este post ya que quiero empezar a compartir mis conocimientos con la comunidad además de aprender o corregir errores. Creo que es la mejor forma para aprender ya que al mostrar lo que haces puedes ayudar a los que empiezan y que los que llevan mas tiempo puedan ayudarte a ti.

Principalmente la idea es hablar sobre los proyectos en mente que tengo, aunque también me gustaría añadir todo aquello que piense que pueda ser útil para la comunidad.

Un saludo.
🚨 Robotic devices can be hijacked through cryptographic failures in encryption
Tags: opensource, security, cryptography, encryption
Published: 2022-06-30 08:03:30

> You can often hear security engineers saying “**do not design your cryptosystems, especially if you don’t know anything about them**”.  Nah, ignore it. What can really go wrong?

Imagine you have a radio-controlled ​🚗​💨​ toy car.

It’s very popular and has an open-source firmware with a large community around. Your car uses secure protocol to communicate with remote control and can drive on a long distance. 

**Is it protected from the hijackers now?** Well, we doubt a lot 🤔, as crypto bugs can sit in the code invisibly until it’s too late to notice them.

## What can happen?

🔘 [Static IV in CBC fails to achieve probabilistic encryption](https://www.cossacklabs.com/blog/cryptographic-failures-in-rf-encryption/#predictable-iv-in-cbc-mode)
🔘 [AES-CBC Padding Oracle attack](https://www.cossacklabs.com/blog/cryptographic-failures-in-rf-encryption/#exploiting-aes-cbc-padding-oracle-attack)
🔘 [AES-CTR is broken using fixed nonce](https://www.cossacklabs.com/blog/cryptographic-failures-in-rf-encryption/#breaking-aes-ctr-with-fixed-nonce)
🔘 [Encrypted messages integrity is not protected](https://www.cossacklabs.com/blog/cryptographic-failures-in-rf-encryption/#non-existing-integrity-protection-for-cbc-and-ctr)
🔘 Side channels and [replay attacks](https://www.cossacklabs.com/blog/cryptographic-failures-in-rf-encryption/#replay-attacks)
🙀 and that’s still not all folks.

Read our new article 👉 [Cryptographic failures in RF encryption allow stealing robotic devices](https://www.cossacklabs.com/blog/cryptographic-failures-in-rf-encryption/) 👈 and play interactive demo games to learn how your robotic devices can be stolen from you by someone with a radio antenna.
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes, watercooler
Published: 2022-06-30 08:00:29

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes, #watercooler
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258dec9298.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ What airline do developers prefer when they're in a rush?

___A:___ Delta.
 -->
routerlogin.net not working
Tags: routerlogin, netgearrouterlogin, loginrouter
Published: 2022-06-30 07:55:52

Netgear routers have been used by millions of people around the world. Although the company has tried its best to serve the needs of all its users in the best manner, still some users are getting issues with their [Netgear routers](https://routerloginnnet.com/). To name a few, Why routerlogin.net not working, I can’t access my Netgear router login page; what do I do, How can I log in to my Netgear router, and What is my router login admin password are the most asked questions. If you are troubled by any of these issues, then you have stumbled upon the right page.