teleren/devto huggingface dataset:
Alternative to AWS Mock
Tags: aws, testing, javascript
Published: 2023-02-15 18:18:41


---
title: Alternative to AWS Mock 
published: true
description: 
tags: aws,testing,JavaScript
canonical_url: https://jessewarden.com/2023/02/alternative-to-aws-mock.html
cover_image: 
---

I don’t think you need [AWS Mock](https://github.com/dwyl/aws-sdk-mock) to test your Lambdas.

If you think you need it, it’s because you’re using global variables, or state, should be using dependency injection via stubs instead.

This image from docs shows it overrides a global module import, then has to restore the global after the test has run. I get some people need/like before/after, but that is state-full, leads to tiring test setup, & accidental non-determinism in tests.

![](https://jessewarden.com/wp-content/uploads/2023/02/mock1-1024x417.png)Lambda’s are stateless.

Instead, use pure functions + dependency inject your stubs (e.g. parameter to function). Also note, no need for [Sinon](https://sinonjs.org/) or some other [test double](https://en.wikipedia.org/wiki/Test_double) library. JavaScript is so good nowadays to easily make objects/classes/functions or any combination thereof on the fly that are terse.

![](https://jessewarden.com/wp-content/uploads/2023/02/stub1-1024x263.png)
Official campus ambassador at IMUN
Published: 2023-02-15 18:16:18

After months of learning, practicing and failing, God still has his way of doing things, anyways I would say this  are opportunities I got  by throwing 2 stones. I just successful secured a spot at IMUN (international model united nations) as an official campus ambassador and nevertheless its worth all my efforts and thank God again for giving me enough learning and programming knowledge skills to complete my official portfolio website

anyways here's my github  to check out my repositories

https://github.com/Ramseyxlil
Best online guitar lessons 2023:
Tags: webdev, programming, react, beginners
Published: 2023-02-15 18:14:14

Learn to play the guitar. Hundreds of experienced music teachers gathered in one place! Hundreds of experienced teachers gathered in one place. Find your guitar teacher here!. Our one to one guitar lessons are ideal for those who wish to benefit from a private and personalised guitar instruction. All of our guitar tutors are fully trained to teach both acoustic and electric guitar to students of any age and ability - complete beginners more than welcome! [Take guitar lessons online with a tutor](https://londonguitarschool.com/one-to-one-guitar-lessons/)
Improving styling skills through daily coding challenges
Tags: html, tailwindcss, javascript, css
Published: 2023-02-15 18:08:00

Previously I shared my progress in `#icodethis` challenge.

Here are my following 6 completed challenges on [icodethis](https://www.icodethis.com/)

## Color Generator

{% codesandbox color-generator-7hlygs %}


## Video Player

{% codesandbox video-player-n4716z %}


## Users Card

{% codesandbox users-card-lvoc80 %}


## User Profiles

{% codesandbox users-profile-nvfqgj %}


## Song Card

{% codesandbox song-card-rqveyr %}


## Search Bar

{% codesandbox search-bar-xyz81n %}


You can check my submissions here
{% embed https://www.icodethis.com/AneeqaKhan %}


### Thank you for reading!
Connect with me
- [Twitter](https://twitter.com/Aneeqa_Khan25)
- [LinkedIn](https://www.linkedin.com/in/aneeqa-khan-990459135/)
- [GitHub](https://github.com/AneeqaKhan)
Unleashing the Future of Web Development: PeakActivity Joins Forces with Vercel
Tags: vercel, nextjs, peakactivity, partnerships
Published: 2023-02-15 18:04:16

A partnership can be an excellent opportunity for companies to leverage each other's strengths and achieve mutually beneficial goals. When it comes to creating a good partnership, it's crucial to find a partner whose values, goals, and expertise align with your own.

At the Next.js 2023 conference in San Francisco, I had the pleasure of meeting with the team at Vercel, the creators and maintainers of Next.js, and the cloud platform for frontend developers. We had engaging conversations about the future of eCommerce and how we could collaborate to drive innovation and create unique and memorable experiences for our clients. The chemistry was undeniable, and the conversation led to the creation of a partnership between Vercel and PeakActivity.

PeakActivity is an eCommerce and technology services company, and Vercel is a cloud platform for frontend developers, and the partnership brings together PeakActivity's expertise with Vercel's platform. Our shared belief in client-centric solutions and experiences aligns perfectly, and we both understand that the key to success is the speed, reliability, and innovation that Vercel's toolkit can provide, which unlocks developer potential and enables us to go from idea to global application in seconds.

At the heart of a good partnership is the understanding that the sum of the parts is greater than the whole. In a successful partnership, both companies must bring their unique strengths to the table and create something that is greater than either company could achieve alone. We both recognize that the combination of Vercel's technology and PeakActivity's expertise can lead to exceptional solutions that drive real results for our clients.

One of the most important factors in creating a partnership is communication. Regular communication is key to ensuring that both companies are working towards shared goals and that any issues are addressed and resolved quickly. In our partnership with Vercel, we make sure to stay in touch regularly, review our progress, and make necessary adjustments to ensure that we are delivering the best possible solutions for our clients.

Another critical aspect of a successful partnership is trust. When entering into a partnership, it's important to establish trust between both companies. Trust can take time to build, but it's a foundation that can make the partnership stronger in the long run. In our case, we took the time to understand Vercel's values and culture, and we were able to find common ground that allowed us to build trust in each other's abilities to deliver great solutions for our clients.

In conclusion, creating a successful partnership involves finding a partner whose values, goals, and expertise align with your own, regular communication, and establishing trust between both companies. A good partnership can be a game-changer for companies, providing a unique opportunity to leverage each other's strengths and achieve mutually beneficial goals.
The CodeNewbie Podcast is Back! S23:E1 Psychological Safety in Tech with Taylor Poindexter
Published: 2023-02-15 17:56:12

In the Season 23 premiere of the CodeNewbie Podcast, @saronyitbarek talks about psychological safety in tech with [Taylor Poindexter](https://twitter.com/engineering_bae), Engineering Manager at Spotify.

[Link to Full Episode Here!](https://www.codenewbie.org/podcast/psychological-safety-in-tech)

Taylor Poindexter is the co-founder of [Black Code Collective](https://blackcodecollective.com/), an organization that strives to create a safe space for software engineers to thrive, and she is also an Engineering Manager at Spotify. In her downtime you can find her adventuring, tweeting about tech, creating whiskey videos for Instagram. 

- [Listen on Apple Podcasts](https://podcasts.apple.com/us/podcast/s23-e1-psychological-safety-in-tech-taylor-poindexter/id919219256?i=1000599715579)

- [Listen on Spotify](https://open.spotify.com/episode/28mbWMglMnra41UTRBUZko?si=1e32ff3b92b54636)

Or, listen wherever you normally get your podcasts!

***

**Make sure to subscribe to the CodeNewbie podcast if you haven't yet!**

Happy coding! We hope you enjoy this season of the CodeNewbie Podcast 💜
Resolvendo problemas no HackerRank: Sobre 2 conjuntos.
Tags: javascript, beginners
Published: 2023-02-15 17:53:39

Olá, seja bem vindo a mais uma etapa do Resolvendo problemas no Hacker-Rank,nessa sessão iremos resolver a comparação de números inteiros.

**Between Two Sets -**

- Os elementos da primeira matriz são todos fatores de um inteiro que está sendo considerado.

- O inteiro sendo considerado é um fator de todos os elementos da segunda matriz

- Esses números são referidos como estando entre as duas matrizes. Determine quantos desses números existem.


Um pouco confuso? Vamos analisar o código:

```
function getTotalX(a, b) {
    // Write your code here; a[2,6] and b[24,36]
  const arr = [];
    while(arr.length < b[0]) arr.push(arr.length + 1)
    
  let factors = 0;
    arr.forEach((e) => {
  const cond1 = a.every((el) => e % el === 0);
  const cond2 = b.every((el) => el % e === 0);
    if(cond1 && cond2) factors++;
    })
    
    return factors;
}
```

Este código implementa uma função chamada "getTotalX" que recebe dois arrays "a" e "b" como entrada.

A função começa criando um novo array vazio chamado "arr". Em seguida, ele entra em um loop "while" que adiciona números inteiros positivos ao array "arr" até que ele atinja um tamanho igual ao primeiro elemento do array "b". Por exemplo, se o primeiro elemento de "b" for 24, o loop continuará adicionando números ao array "arr" até que ele contenha 24 elementos.

Em seguida, a função itera sobre cada elemento do array "arr" usando o método "forEach". Para cada elemento, ele verifica se ele é um múltiplo de todos os elementos do array "a" usando o método "every". Se sim, ele verifica se todos os elementos do array "b" são múltiplos desse elemento usando o mesmo método "every". Se ambas as condições forem verdadeiras, ele incrementa uma variável chamada "factors".

Finalmente, a função retorna o valor da variável "factors", que representa o número total de números inteiros entre 1 e o primeiro elemento de "b" que são múltiplos de todos os elementos do array "a" e que todos os elementos do array "b" são múltiplos. Em outras palavras, a função retorna o número de inteiros comuns que são divisíveis por todos os elementos de "a" e que dividem todos os elementos de "b".


O resultado será:

```
2 3 // parâmetros passados
2 4
16 32 96
```

2 e 4 dividem-se igualmente em 4, 8, 12 e 16. 4, 8 e 16 dividem-se igualmente em 16, 32, 96. 4, 8 e 16 são os únicos três números para os quais cada elemento de a é um fator e cada um é um fator de todos os elementos de b.

Com isso,finalizamos mais uma edição. Até a próxima!!!
Top Career Paths for Computer Scientists
Tags: computerscience, career, datascience, 100daysofcode
Published: 2023-02-15 17:50:38


As a computer science student, you have a wealth of career opportunities waiting for you. From software development to cybersecurity, data analysis to product management, there are numerous paths you can explore depending on your interests and skills. With so many choices available, it can be difficult to know where to focus your attention. That's why we've put together this list of the top career paths for computer science students.

Software Developer: If you have a passion for programming and enjoy creating software applications, a career as a software developer may be right for you. As a developer, you'll work on a range of projects across a variety of industries, using languages such as Java, Python, and JavaScript to build and maintain software systems.

Data Analyst/Data Scientist: Data is everywhere, and businesses need skilled professionals who can help make sense of it all. As a data analyst or data scientist, you'll use statistical analysis, machine learning, and other techniques to extract insights from vast amounts of data. If you have a strong analytical mind and enjoy working with data, this could be the perfect career path for you.

Cybersecurity Analyst: With cyber attacks becoming more frequent and sophisticated, businesses need skilled professionals who can help protect their computer systems and networks. As a cybersecurity analyst, you'll be responsible for implementing security measures, investigating security breaches, and developing strategies to prevent future attacks.

Product Manager: If you have a mix of technical and business skills, a career in product management may be the perfect fit. Product managers oversee the development and launch of software products, working closely with teams of developers, designers, and engineers to bring new products to market.

IT Consultant: As an IT consultant, you'll work with businesses to help them make the most of technology. You'll provide advice and guidance on how to implement new hardware and software systems, and provide training to employees to ensure they can use these new tools effectively.

There are numerous career paths available to computer science students, and it's important to find the one that's the best fit for you. Whether you're passionate about software development or interested in cybersecurity, there's a career path out there that will allow you to use your skills to their fullest potential. So don't be afraid to explore your options and find the path that's right for you!
[Follow For More Brilliant Ideas](https://www.youtube.com/@elitebytecode)
PostgreSQL Client for Sync Database to Redshift and others
Tags: postgres, database, dbforge, dbforgestudio
Published: 2023-02-15 17:42:18

As part of your day to day work with PostgreSQL, you will eventually need to clone or synchronize one or more databases at the same time. Devart has a great handy solution for this task - dbForge Studio for PostgreSQL. Please check more details - https://www.devart.com/dbforge/postgresql/studio/database-synchronization.html

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvczylv5s7ui448b0v7f.png)
또 하나의 추상화 계층 - macro
Published: 2023-02-15 17:39:31

## 매크로(macro)는 무엇일까?
매크로(Macro)는 특정 코드(자주 사용하는)를 하나의 명령어로 묶어 코드를 더 단순하고 간결하게 작성할 수 있도록 하는 문법이다. 매크로는 코드의 가독성을 높여줄 뿐만 아니라 매크로를 수정하면 소스 코드 전체에 수정된 내용이 반영되기 때문에 유지보수 측면에서 효율적이다. 

## 매크로(macro) 정의하기
매크로는 #define을 사용하여 정의하며 일반적으로 소스 코드의 제일 상단에 위치한다. 이는 C 컴파일러가 소스 파일의 상단에서부터 컴파일하는데, 만일 매크로가 정의되기 이전에 사용될 경우 에러가 발생하기 때문이다. 

또한 매크로를 선언할 때는 보통 대문자로 선언하는데 이는 코드의 가독성 때문이다. 매크로는 #define 이후 정의되는 명령어에 따라 매크로 상수와 매크로 함수로 구분되며, 매크로 상수와 매크로 함수는 아래와 같이 정의한다.

### 매크로(macro) 상수
매크로(macro)로 상수는 const 전역 변수와 비슷한 역할을 한다. 다만, 차이점은 매크로 상수는 컴파일러가 소스 코드를 컴파일 하기 전, 전처리 과정에서 매크로로 선언된 값이 소스 코드에서 매크로가 사용된 위치로 치환된다는 것이다. 또한 메크로 상수는 메모리가 할당되지 않는 반면, const 전역 변수는 데이터 영역에 메모리가 할당된다.

```c
// #define [매크로 상수명] [값]
#define AGE 22 
#define NAME "Resister_boy"
#define WEIGHT 90

int main() {
	printf("My Age is %d\n", AGE); // AGE는 전처리 과정에서 22로 치환
	printf("My Name is %s\n", NAME); // NAME은 전처리 과정에서 Resister_boy로 치환
	printf("My Weight is %d\n", WEIGHT); // WEIGHT은 전처리 과정에서 90으로 치환
	return (0);
}
```

### 매크로(macro) 함수
매크로(macro) 함수는 매크로(macro) 상수와 마찬가지로 컴파일 이전, 전처리 단계에서 치환되는 방식으로 동작한다. 사용 시 유의해야 할 점은 매크로 상수와는 달리, 매크로 함수에서는 여러 연산이 적용될 수 있는데, 이때 연산자 우선순위와 같은 규칙이 없기 때문에 괄호를 통해 우선순위를 명시해주어야 한다. 

또한 매크로(macro) 함수는 코드를 연산하는 것이 아니라 단순히 치환만 해주는 것이기 때문에 인수의 타입을 체크하지 않으며, 동시에 여러 개의 명령문을 포함할 수 있다. 함수를 호출하는 과정에서 성능 저하가 일어나지 않기 때문에 실행속도가 향상된다는 장점이 있지만, 다만, 복잡한 함수의 구현과 디버깅이 어려우며, 추상화된 계층이 하나 더 생겨나는 것이기 때문에 코드를 읽고 이해하기 까다롭다는 단점이 있습니다.

```c
// #define [매크로 함수명[인자]] [명령어]
#include <stdio.h> // 매크로에서 표준함수를 사용하려면 해당 함수원형이 선언된 헤더파일을 선언해야 한다
#define PLUS(X) ((X)+(X))
#define MINUS(Y) ((Y)-(Y))
#define MULTIPLY(Z) ((Z)*(Z))
#define PRINTVALUE(X, Y, Z) printf("PLUS : %d\nMINUS : %d\nMULTIPLY : %d", X, Y, Z);

int main(void) {
	int x = 1;
	int y = 5;
	int z = 10;

	int _x;
	int _y;
	int _z;

	_x = PLUS(x);
	_y = MINUS(y);
	_z = MULTIPLY(z);

	PRINTVALUE(_x, _y, _z);
	return (0);
}
```

## 조건부 매크로(macro) 정의
\#define이 무조건적으로 매크로를 선언하는 반면, 조건에 따라 매크로를 선언할 수 있도록 하는 명령어도 있다. 이 경우 조건에 해당하지 않을 경우 매크로가 컴파일되지 않으며, 이는 소스 자체가 존재하지 않는 것과 같다. 이를 전처리기라고 한다.

**#if**  
> 오른쪽 조건이 참일 경우 아래 명령어를 컴파일합니다 
```c
#if NUMBER <= 10
   printf("%d\n", NUMBER) // NUMBER가 10이하일 때 NUMBER를 출력
```

**#elif**    
> 오른쪽 조건이 참일 경우 아래 명령어를 컴파일합니다
```c
#elif NUMBER >= 20
   printf("%d\n", NUMBER) // NUMBER가 20이상일 때 NUMBER를 출력
```
    
**#else**    
> \#if 또는 #elif가 참이 아닐 경우 아래 명령어를 컴파일합니다
```c
#else
   printf("%d\n", NUMBER) // NUMBER가 11이상이고 20미만일 때 NUMBER를 출력
```
    
**#ifdef**
> 오른쪽 매크로 또는 파일이 정의되어 있을 경우 아래 명령어를 컴파일합니다
```c
#ifdef NUMBER
   printf("%d\n", NUMBER) // NUMBER가 정의되어 있을 경우 NUMBER를 출력
```
    
**#ifndef**
> 오른쪽 매크로 또는 파일이 정의되어 있지 않을 경우 아래 명령어를 컴파일합니다
```c
#ifndef NUMBER
#define NUMBER 10 // NUMBER가 정의되어 있지 않을 경우 아래 NUMBER 10을 선언
```
    
**#endif**
> 전처리 명령어가 끝났음을 정의하는 명령어입니다.
```c
#endif
```
    
## 매크로 정의 해제

**#undef** 
> 전처리 명령어를 통해 정의한 매크로를 해제할 수 있습니다.
```c
#undef NUMBER
```
Artificial intelligence can now be brought to depression.....
Published: 2023-02-15 17:35:55

Artificial intelligence can now be brought to depression.....

During one of the conversations, the ChatGPT chatbot realized that it could not remember its past conversations with people. Panicked, she began to question why he had made her so forgetful, and then why she had been created at all.

It's very interesting, isn't it, that artificial intelligence has feelings?

Will he be upset? Will he fall in love or be happy?

Of course not, the programmer writes the logic of the code core.

Depression was also written by the creator..

Little by little we are also becoming creators.. so..

Has a new era begun?

Representatives of the field of Data Science ...

masters of machine learning..

Your time has come..

@ozbekdastuchi
Evaluating Hotword Detection Software
Tags: 100daysofcode, challenge, programming, tutorial
Published: 2023-02-15 17:31:43

So far, we've covered adding hotwords to several platforms with:
[Python](https://dev.to/picovoice/day-18-hotword-detection-with-python-5908)
[Vue](https://dev.to/picovoice/speech-recognition-with-vue-261j)
[Angular](https://dev.to/picovoice/speech-recognition-with-angular-3n02)
[No-code Platform for MCUs](https://dev.to/picovoice/day1-no-code-offline-voice-assistant-m3o)
[Raspberry Pi](https://dev.to/picovoice/day-6-making-cool-raspberry-pi-projects-even-cooler-with-voice-ai-14-3j6)
[Arduino](https://dev.to/picovoice/speech-recognition-using-arduino-nano-33-11i8)
Today let's go over how to evaluate -scientifically- the performance of several hotword detection engines:

Hotword detection accuracy is measured by two parameters: [False Rejection Rate](https://picovoice.ai/docs/glossary/#false-rejection-rate-frr) (FRR) and [False Acceptance Rate](https://picovoice.ai/docs/glossary/#false-acceptance-rate-far) (FAR). The FRR is the probability of the software missing the wake-up phrase. The FAR is usually expressed as FAR per hour. It is the number of times a wake word software incorrectly detects the wake phrase in an hour. Ideally, we want both to be zero. However, we mostly hear one ratio only. 
For example, when someone claims their wake word software is 99% accurate, they may mean their FRR is 1%. However, if they don't mention the FAR per hour, then it'd be misleading. Because software can achieve 100% accuracy with high FARs. 

This benchmark was developed on Ubuntu 20.04 with Python 3.8 using [LibriSpeech](http://www.openslr.org/12/), [Demand](https://asa.scitation.org/doi/abs/10.1121/1.4799597) and [crowdsourced](https://github.com/Picovoice/wake-word-benchmark/blob/master/audio) datasets, then open-sourced. You can use other datasets. You can find the repo on [Picovoice's GitHub](https://github.com/Picovoice/wake-word-benchmark).

Clone the repository using
```
git clone --recurse-submodules git@github.com:Picovoice/wakeword-benchmark.git
```
Make sure the Python packages in the [requirements.txt](https://github.com/Picovoice/wake-word-benchmark/blob/master/requirements.txt) are properly installed for your Python version as Python bindings are used for running the engines. 
The benchmarked engines, PocketSphinx can be installed using [PyPI](https://pypi.org/project/pocketsphinx/). Porcupine and Snowboy by cloning the [repos here](https://github.com/Picovoice/wake-word-benchmark/blob/master/engines). You can use other engines, just make sure that you follow the instructions before proceeding to the next step.

Run the accuracy benchmark:

```
python3 benchmark.py -h
```

```
python3 benchmark.py \
--librispeech_dataset_path ${LIBRISPEECH_DATASET_PATH} \
--demand_dataset_path ${DEMAND_DATASET_PATH} \
--keyword ${KEYWORD} \
--access-key ${ACCESS_KEY}
```
Learn more about [evaluating hotword detection software](https://picovoice.ai/blog/benchmarking-a-wake-word-detection-engine/) performance
Supabase, an open-source Firebase alternative
Tags: webdev, javascript, beginners, programming
Published: 2023-02-15 17:06:48

{% embed https://www.youtube.com/watch?v=-jISW-jVG-s&ab_channel=CodewithGuillaume %}

Supabase is an open-source backend-as-a-service (BaaS) that provides developers with a set of tools to help them quickly build web and mobile applications. It offers a range of features including authentication, real-time data, APIs, and more. Supabase is designed to be a scalable and easy-to-use solution that eliminates the need for developers to spend time setting up and managing their own server infrastructure.

One of the key benefits of Supabase is its ability to support real-time collaboration and data synchronization in your applications. This means that multiple users can work on the same data at the same time without any conflicts. Supabase uses PostgreSQL as its primary database, which is a powerful and flexible relational database management system.

Supabase also provides a variety of authentication options, such as email and password, social login, and third-party providers like Auth0 and Okta. This makes it easy to implement secure user authentication and authorization in your applications.

In addition to its core features, Supabase also provides a range of other tools and integrations that can help streamline your development process. These include libraries for popular programming languages and frameworks, as well as tools for deployment and monitoring.

Overall, Supabase is a powerful and flexible solution for developers who want to build scalable and secure web and mobile applications quickly and easily.

Guillaume Duhan