teleren/devto huggingface dataset:
Forever 21
Tags: javascript, beginners, showdev
Published: 2022-12-16 22:50:03

This week in class we worked through creating a JavaScript Blackjack game.

Given starter code, our goal was to create logic that followed the basic rules of the game Blackjack: 

- Player or Dealer wins at 21 or whomever is closer without going over 21.
- Dealer stands after 17.
- An Ace (11) can also be worth 1.
- Cards aren’t duplicated unless multiple decks are used.

I set some stretch goals for myself to disable buttons that weren’t needed, such as disabling Hit and Stand until Deal was clicked, disabling Deal after one click, and disabling Hit after Stand was clicked.

I also wanted to list the total, show a “You Won/Lost” message, and flip the Dealer’s cards over at the end of the game.

I started out feeling comfortable dropping into someone else’s code and began just console logging the object to see what was being produced. From there I chose a simple shuffle algorithm to shuffle the created deck and and moved on to creating a function that would create and append the card element, making one for the Player and one for the Dealer, deleting any dealt cards from the deck after they were appended.

Moving on, I created the logic for the three existing buttons, learning how to disable and re-enable them, and then added in another button right below them to refresh the page and start a new game. 

From there I worked on the logic that was run by clicking the buttons. On Deal I would call both element creation functions twice. On Hit, I would call both functions once and on Stand I would call only the Dealer’s function. 

Additionally, because I wanted to turn off certain buttons in certain card total situations and needed to add in logic for if the Dealer reached 17, I also needed to create a counting function to update the Player and Dealer totals after each click. 

My counting function tracked the current Player/Dealer total by reducing the two global arrays that each held how much each card in their hand was worth and from there I created four if/else sections to handle the different paths. One handled anyone at 21, one recursively handled going over 21 but having an ace, one handled if either the Player or Dealer went bust, and the last one handled if the Dealer hit 17 and the Player hit Stand. 

Consequently, each resulting section would update the inner text to include the final Player total and either a win or lost statement. They also disabled the buttons that were not needed in each situation and once the game was over, all the Dealer’s cards were flipped over and their total was revealed. 

This was done through a suggestion from our cohort teacher, letting the CSS class content style supersede any src set to the element until that class's style was removed, revealing its underlying src.

Overall, I had fun designing the logic for this game and working through accounting for each game path possibility.

If you'd like to play it:
https://meg-div.github.io/blackjack/

Here's the code:
https://github.com/Meg-Div/blackjack
New Links
Published: 2023-07-09 23:51:14

---
title: New Links
published: true
date: 2022-12-16 22:47:35 UTC
tags: 
canonical_url: 
---

As we round out the year, there are several new addresses I’d like people to use to contact me or get my book.

First, raywenderlich.com has re-branded to [Kodeco](https://www.kodeco.com/books/). Still the same great content created by terrific people, but with a fresh new design that makes it easier to follow the learning path that you prefer.

If you want to read my macOS by Tutorials book, it’s now at [kodeco.com/books/macos-by-tutorials](https://www.kodeco.com/books/macos-by-tutorials).

![Book Cover](https://troz.net/images/book_cover.png)

As we all know, Twitter is in meltdown and I no longer use it. I’d love it if you came over to Mastodon. People on Mastodon are friendly and sharing. It feels much more like a community.

[Movetodon](https://www.movetodon.org) is a great tool for finding your twitter friends on Mastodon and [Fedi.tips](https://fedi.tips) is a useful site for learning how to use Mastodon effectively.

My suggestions are:

- Be nice!
- Don’t stress about choosing a server, you can follow anyone from any server and you can transfer your account to a different server if you change your mind.
- Follow hashtags as well as people, and add hashtags to your posts.
- Use **Favorite** to tell people you liked their post and **Boost** to share with your followers.
- Add hashtags using UpperCamelCase to assist screen readers e.g. #AdventOfCode, not #adventofcode.
- Follow me: [@troz@mastodon.social](https://mastodon.social/@troz)

I look forward to seeing you there.

I’ve added a [Mastodon](https://mastodon.social/@troz) link to my web footer, but I also created a [LinkTree](https://linktr.ee/trozware) to gather all my links into one place.

And finally, if you want to support my work, please [buy me a coffee](https://ko-fi.com/H2H3BU7SI).
A/B testing development - A developer overview (Part - 1)
Tags: cro, frontend, javascript, ux
Published: 2022-12-16 22:09:42


I am not a marketing guy or CRO expert, I am a developer. As a developer, Selling a product is not my concern but after working with CRO agencies for a long time, I have learned that how customer behaviour is changing based on the change of UI and UX, which leads them to buy your products. In traditional software development, We mostly depends on the final design of our product but it doesn't work most of the cases.

To get feedback of our system, We need to check with our customer if our existing system is increasing the CRO rate or not. CRO(Conversion rate optimisation) is very important for an online business because it can bring you more customer engagement and more sell.

So, How can we check with customer by changing two or more number of UI/UX variations and know which one is bringing more CROs? We can update your production logic to show various variations(or Experiments) to random customer and see which one is working. But this is very time consuming for developers and bad for production code to maintain so many redundant code in production which will not be use in near future. To solve this problems we have A/B testing tools to rescue.

What is A/B testing? According to wikipedia 'A/B testing (also known as bucket testing, split-run testing, or split testing) is a user experience research methodology. A/B tests consist of a randomised experiment that usually involves two variants (A and B), although the concept can be also extended to multiple variants of the same variable. It includes application of statistical hypothesis testing or "two-sample hypothesis testing" as used in the field of statistics. A/B testing is a way to compare multiple versions of a single variable, for example by testing a subject's response to variant A against variant B, and determining which of the variants is more effective.

![A/B Testing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7duj3ch57ouhkj31co7w.png)

In simple word, You are running an experiment by your customer to see, Which user experience is more effective for your business. I remember, I have worked with a top cinema booking site of Europe. Where we have just increased 67% sell by changing the CTA(Booking Button) colour from blue to green and It was just unbelievable to me. We had launched 4 variations of CTA. I also remembered we had increased 40% customer engagement on a search bar of a travel agency by just updating the search functionality. Which had the direct relation with their sell.

There are many ways of A/B testing development Front End, Back End, API, CDN etc. In our next blog [Part 2](https://dev.to/faroqueabdullah/ab-testing-development-a-developer-overview-part-2-39la), We will discuss about different ways of A/B testing, how A/B testing tools works and architecture of A/B testing tool. Until then Happy Coding!!
Solving FizzBuzz
Published: 2022-12-16 20:41:00


![Image of FizzBuzz](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2j4pdbmdcle6oypi7toi.png)

---

A common way to quickly assess a candidate's coding abilities is to use the well-known programming problem FizzBuzz. The objective is to create a program that prints the numbers from 1 to a specified number, but instead of printing the number for multiples of 3, it prints "Fizz," and for multiples of 5, it produces "Buzz." Print "FizzBuzz" when the given number is a multiple of both 3 and 5.

For example, the output of FizzBuzz for the numbers 1 to 15 would be:


```
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
```

---

Here is a straightforward JavaScript version of FizzBuzz using an if statement:

```
for (let i = 1; i <= 100; i++) {
  if (i % 3 === 0 && i % 5 === 0) {
    console.log("FizzBuzz");
  } else if (i % 3 === 0) {
    console.log("Fizz");
  } else if (i % 5 === 0) {
    console.log("Buzz");
  } else {
    console.log(i);
  }
}

```

---

This program iterates through the numbers from 1 to 100 using a for loop. The loop outputs "FizzBuzz" if the current number is a multiple of 3 and 5 (checked using the modulo operator%). "Fizz" is printed if the number is only a multiple of 3. "Buzz" is printed if the number is just a multiple of 5. If the number is not a multiple of 3 or 5, it is printed as is.

Although this implementation is quite simple, there are a few considerations to keep in mind. The sequence of the if statements is crucial first. A number that is a multiple of both 3 and 5 should be regarded as a "FizzBuzz" rather than a "Fizz" or a "Buzz," so the check for "FizzBuzz" must come before the checks for "Fizz" and "Buzz."

Second, even though the else statements are optional, they can improve readability by indicating clearly what should happen when a number is not a multiple of 3 or 5. The code would continue to function without the else statements, although it could be less evident what is happening.

---


## Conclusion

In this blog we talked about a common way to quickly assess a candidate's coding abilities using a programming problem called FizzBuzz. And showed you a way to solve the programming problem.
Sendwyre API - Alternative for Stripe
Published: 2022-12-16 20:24:35

SendWyre is a financial technology company that provides a platform for businesses to send and receive payments globally. The company offers a range of products and services, including a payment API (Application Programming Interface) that allows businesses to integrate SendWyre's payment functionality into their own systems and applications.

The SendWyre API allows businesses to perform a variety of payment-related tasks, such as:

1. Accepting payments from customers in multiple currencies
2. Sending payments to other businesses or individuals
3. Managing and tracking payment transactions
4. Setting up recurring payments
5. Implementing fraud prevention measures

The SendWyre API uses a REST (Representational State Transfer) architecture and returns responses in JSON format. It is designed to be easy to use and integrate into a variety of systems and applications. Businesses can use the SendWyre API to build custom payment solutions that meet their specific needs and requirements.

To use the SendWyre API, businesses will need to sign up for a SendWyre account and obtain an API key. Detailed documentation and resources are available to help businesses get started with the API and integrate it into their systems.
Contact: https://mudassirali.com
Components of Operating System
Published: 2022-12-16 20:35:44

An operating system is a substantial and intricate system that can only be built by dividing it into manageable pieces. These components have to be clearly specified system components with defined inputs, outputs, and functions.

Although Windows, Mac, UNIX, Linux, and other operating systems do not all have a common OS system structure, they do share comparable OS system components including file, memory, process, and I/O device management.

A range of computer system components all function together thanks in large part to the operating system’s components. An operating system is composed of the following elements, for example:

- Process Management
- File Management
- Network Management
- Main Memory Management
- Secondary Storage Management
- I/O Device Management
- Security Management
- Command Interpreter System
How to connect ASP.NET Core code to MS SQL server
Tags: webdev, beginners, programming, tutorial
Published: 2022-12-16 20:14:51

To connect your ASP.NET Core code to a Microsoft SQL Server database, you will need to follow these steps:

- Install the necessary NuGet packages:
Install the `Microsoft.EntityFrameworkCore.SqlServer` package, which includes the Entity Framework Core provider for Microsoft SQL Server.

```
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
```

- Create a connection string:
Create a connection string that specifies the server name, database name, and any necessary authentication information. The connection string should be in the following format:

```
"Server=server_name;Database=database_name;User Id=user_id;Password=password;"

```

- Configure the DbContext:
In your DbContext class, override the `OnConfiguring` method and use the `UseSqlServer` extension method to specify the connection string and any other options. For example:

```
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    optionsBuilder.UseSqlServer("Server=server_name;Database=database_name;User Id=user_id;Password=password;");
}

```

- Create your entity classes:
Create POCO (plain old CLR object) classes to represent the entities in your database. These classes should be decorated with the `[Table]` attribute and the properties should be decorated with the `[Column]` attribute.

- Create a `DbSet` for each entity:
In your `DbContext` class, create a `DbSet` property for each entity in your model. For example:

```
public DbSet<Product> Products { get; set; }

```

- Run migrations:
Use the `Add-Migration` and `Update-Database` commands in the Package Manager Console to apply your entity model to the database.

```
dotnet ef migrations add InitialCreate
dotnet ef database update

```

- Use LINQ to query the database:
In your code, use LINQ queries to retrieve and manipulate data from the database. You can use the `DbSet` properties to access the entities in your model.

Thanks for reading...
**Happy Coding!**
EasyTailwind: a package to supercharge your Tailwind
Tags: webdev, javascript, react, css
Published: 2022-12-16 19:21:27

Hello, humans!

We all love Tailwind, but there's one thing that I'm sure is not to everyone's liking: 

Classes get large fast! It's messy and hard to find what is going on there...
I mean: 
```js
"text-lg font-medium text-black hover:underline hover:decoration-black sm:text-base sm:text-blue-500 sm:hover:decoration-cyan-500 lg:text-2xl lg:text-green-500 lg:hover:decoration-amber-500"
```

No more! Enter EasyTailwind:

https://www.npmjs.com/package/easy-tailwind

This is a little utility to be used with Tailwind and gives you superpowers!

What if instead of writing that large class you could write:
```js
e(
  'text-lg font-medium text-black',
  {
    hover: 'underline decoration-black',
    sm: [
      'text-base text-blue-500',
      {
        hover: 'decoration-cyan-500',
      },
    ],
    lg: [
      'text-2xl text-green-500',
      {
        hover: 'decoration-amber-500',
      },
    ],
  }
)
```

Not only it's faster to write and read, but it's also easier to understand exactly what it's doing, don't you think?

Start playing around with it here: https://stackblitz.com/edit/easy-tailwind?file=src/App.jsx

And again the package: https://www.npmjs.com/package/easy-tailwind
Method level tracing
Published: 2022-12-16 18:56:31

I have enabled Honeycomb tracing for my Java application by just adding the java agent jar when starting the application. I can see tracing from web endpoints down to the SQL queries. 
However, I am unable to see class and method level details. For example, when serving a request from the endpoint, the Java method might call to many Java methods in another packages and/or classes. But these are not showing in Honeycomb.
The question of the day...
Tags: socialmedia, discuss, watercooler
Published: 2022-12-16 18:32:09

**To keep Twitter, or not to keep Twitter?**

That...is the question. And it's a tough one! 

dev.to started as a Twitter account, and it's grown into an ecosystem of more than a dozen accounts since then. As the steward of that ecosystem for the better part of the past year, it breaks my heart to watch the platform become what it has over the past few months. 

We have no plans in the works to leave Twitter, even as [we've established a presence on Mastodon](https://mastodon.social/@ThePracticalDev), but I want to know what _you're_ thinking. 

Will you stay, or are you ready to leave it behind? If you're in the latter camp, what alternatives have you tried or considered?

_cover image: [Alas, Poor Yorick! 90s Kids Edition](http://www.theperennialstudent.com/blog/2015/4/21/modern-interpretations-of-shakespeare-disneys-the-lion-king)_
Comunicação não-violenta aplicada na carreira em tech
Tags: braziliandevs, career
Published: 2022-12-16 18:14:14

> _Fonte da imagem de topo: [Associação Clube](https://www.associacaoclube.com.br/clube/noticias/comunicacao-nao-violenta-como-ela-pode-melhorar-a-sua-vida)_

#### Como pessoa da área de tech, você é lobo ou girafa?

Quem entrou na área pensando que só ia se comunicar com a telinha do computador (como eu pensava), deu de cara com uma realidade completamente diferente.

**Em tecnologia, comunicação é TUDO.** Tecnologia só existe para resolver problemas da sociedade, ou seja, **de pessoas para pessoas**. Por isso, saber dialogar e negociar de forma empática faz toda diferença.

A **metodologia da Comunicação Não-Violenta** envolve o exercício de pensar no outro, no receptor da mensagem, antes de talvez nós mesmos. Bebendo muito da doutrina milenar do Budismo, a CNV implica em uma comunicação mais leve, compassiva e que se preocupa em como a mensagem será recebida tanto quanto no que está sendo dito.

Para isso, podemos dividi-la em 4 passos:

---

## Os 4 passos da CNV


![Os 4 passos da CNV, explicados no texto abaixo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uk8vha0hgygk236ngy8g.png)
> _Fonte da imagem: [Nube](https://www.nube.com.br/blog/2021/03/25/comunicacao-nao-violenta-melhora-a-interacao-entre-equipes)_

### 1. Observação
Durante uma conversa ou discussão com outras pessoas, o primeiro passo é parar e observar a situação. Neste momento, deixe de lado julgamentos e interpretações pessoais.

### 2. Sentimento
Essa é a hora de entender quais são os **seus sentimentos**. Nesta conversa, o que você sente? Raiva, tristeza, alegria?

Mapeie seus sentimentos e compreenda que eles são responsabilidade sua, e não de outras pessoas envolvidas na conversa.

### 3. Necessidade
Identifique quais são suas necessidades que não estão sendo atendidas e foque nelas. Tome cuidado para não enfatizar em _como_ você quer fazer isso, **e sim no desejo genuíno**. 

Exemplo: quero construir uma aplicação segura. Não importa qual linguagem você vai usar, e sim o que você realmente busca.

### 4. Pedido
Expresse o que gostaria para o outro e, se possível, seus sentimentos. **Entenda que a pessoa pode atender o seu pedido ou não.**

Muitas vezes imaginamos que a pessoa já sabe o que queremos, mas muitas vezes não é o que acontece. Nosso trabalho é transmitir nosso desejo de forma objetiva para que as pessoas na conversa compreendam nosso ponto.

---

Caso queiram se aprofundar no assunto, o livro “[Comunicação não-violenta](https://www.amazon.com.br/Comunica%C3%A7%C3%A3o-n%C3%A3o-violenta-relacionamentos-profissionais-ebook/dp/B097YV5ZL7/)” do **Marshall B. Rosenberg** dá muito mais exemplos, e o foi o próprio psicólogo Marshall que criou essa abordagem.

E aí, vão implementar a metodologia da comunicação não-violenta em suas conversas? ☺️

---

> 📝 **Co-autor do texto:** [André Luiz Ferreira Jr.](https://www.linkedin.com/in/drefer/)
Web accessibility
Tags: web, frontenddesign, webdeveloper, designforothers
Published: 2022-12-16 18:13:56

as a web developer you should try to ensure that everyone can access and enjoy the internet almost like an architect that needs to design a building with ramps and rails so that it is accessible by all. You need to build a website in a certain way to improve accessibility.
When the Web accessibility Initiative or W. A. I. was launched in 1997. Tim Berners-Lee, W3C Director and inventor of the World Wide Web said:

> The power of the Web is in its universality.
Access by everyone regardless of disability is an essential aspect.> 
**So what does Web accessibility means?**
web accessibility means that websites, tools, and technologies are designed and developed so that people with disabilities can use them. More specifically, people can:
•	perceive, understand, navigate, and interact with the Web
•	contribute to the Web
A common misunderstanding of web accessibility is that it refers to visual disabilities but in fact it includes all disabilities that affect interaction with websites such as audio and visual disabilities, cognitive and neurological disabilities and physical and speech disabilities. 
So can we say that web accessibility is a requirement for developing websites?
Well actually yes, in 2016 web accessibility is becoming a need in many industries.
The European Union approved the web accessibility directive which requires websites and mobile applications of public section bodies to be accessible to those with disabilities.
So let's see how accessibility is provided to those with different disabilities:
web screen reader: 
People living with disabilities often use assistive technologies to aid them in browsing the web screen reader software can read the content of websites ad everything that is happening on the device.
Screen readers are used not only by blind and vision impaired users but also by those with reading or learning difficulties.
Speech recognition software:
A tool that can turn spoken words into computer commands or dictate inputting text.
This is useful for people who may not be able to use a mouse or keyboard due to physical or neurological disabilities, subtitles and video scripts and videos provide assistance to those with audio and visual disabilities.
And there are many different tools to provide and help with making the web more accessible.
It is good practice to think of accessibility from the beginning of a project, it is a lot harder to rework the project to be accessible later on.
If you use the correct html structure and appropriate elements as a foundation, it will greatly improve accessibility.