teleren/devto huggingface dataset:
A instrução if e else
Tags: java
Published: 2024-07-09 22:02:21

- A forma completa da instrução if é:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3hdjn3ruz5mgngjnbxxl.png)

- A cláusula else é opcional.

- Se a expressão condicional for verdadeira, as instruções dentro do if será executado. Caso contrário, se houver, as instruções do else será executado.

- Nunca ambos serão executados.

- A expressão condicional que controla if deve produzir um resultado booleano.

- Exemplo: para demonstrar if e outras instruções de controle, será criado um jogo de adivinhação simples. Na primeira versão do jogo, o programa pede ao jogador uma letra entre A e Z. Se o jogador pressionar a letra correta no teclado, o programa exibirá a mensagem Right.

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

- Esse programa interage com o jogador e lê um caractere no teclado.

- Usando uma instrução if, ele compara o caractere com a resposta (K).

- Se K for inserido, a mensagem Right será exibida. O K deve ser inserido em maiúscula para o programa funcionar corretamente (Java diferencia maiúscula e minúscula).

- Exemplo: a próxima versão usa else para exibir uma mensagem quando a letra errada é escolhida.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ae54r7j3gc6f84j3f8m.png)

** Ifs aninhados**

- Um if aninhado é uma instrução if que é alvo de outro if ou else.

- Ifs aninhados são muito comuns em programação.

- Em Java, uma instrução else sempre se refere à instrução if mais próxima dentro do mesmo bloco que ainda não estiver associada a um else.

- Exemplo:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uusy87tvw5nsqr5k5rwi.png)

- O else final não está associado a if(j < 20) porque não está no mesmo bloco.

- O else final está associado a if(i == 10).

- O else interno é referente a if(k > 100) porque é o if mais próximo dentro do mesmo bloco.

- Exemplo: um if será adicionado para melhorar o jogo de adivinhação fornecendo ao jogador uma explicação sobre um palpite errado.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/025v5qj4em8mn91kvuv4.png)


**A escada if-else-if**

- Uma estrutura de programação comum baseada no if aninhado é a escada if-else-if.

- As expressões condicionais são avaliadas de cima para baixo.

- Quando uma condição verdadeira é encontrada, a instrução associada é executada e o resto da escada é ignorado.

- Se nenhuma condição for verdadeira, a instrução else final será executada.

- O else final frequentemente age como uma condição padrão.
Se não houver um else final e todas as condições forem falsas, nenhuma ação será executada.

- Exemplo:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wwevylavbt864qlqrn0k.png)

O programa produz a saída abaixo:
 x is not between 1 and 4
 x is one
 x is two
 x is three
 x is four
 x is not between 1 and 4
🚀 Launching FidForward! 🚀
Tags: react, node
Published: 2024-07-08 16:54:15

Today, Bernardo and I are excited to launch FidForward in private beta!

We're looking for companies with 10-50 employees willing to pilot the next generation of performance management.

With two pilot programs already running successfully (achieving a 30-50% improvement in eNPS), we’re eager to expand FidForward to more companies to validate these results further.

If you’re a founder seeking to implement performance management or a larger company aiming to elevate your current system, please reach out to me!

🔗 Learn more about FidForward at [FidForward.com](https://fidforward.com)
Common Lisp VS C: a testimony
Tags: lisp, commonlisp, c, programming
Published: 2024-07-08 16:58:40

_I like testimonies. Here's one on Lisp vs C. About execution time, speed of development, length of programs, ease of development._

---

I find SBCL produces highly performant code, and is even faster with a small number of well-placed type declarations. I have a Lisp vs C story: I'm a mathematician and was doing some research on the Cops and Robbers game in graph theory with a friend of mine who is a computer science professor and has worked in the past as a professional programmer. We needed some data on which graphs have winning strategies for the cops and decided to independently write code to compute them so we could vet the results against each other.

I wrote my code in Common Lisp and ran it with SBCL; he wrote his code in C. 

My program was 500 lines and his was 4,000 lines. My program was faster than his and it's no mystery why: I tried several different optimizations my friend also thought of, but didn't implement because it would have been another 1,000 lines or so. I also find my program much more readable than his, just because of the length: even if you are 5 times as fast at reading C than Lisp, his program is still 8 times as long!

---

by @oantolin@mathstodon.xyz on Mastodon (https://framapiaf.org/@oantolin@mathstodon.xyz/112746475805471440)

and... that's it o/
Evotto: Drive Your Dreams - Transforming Journeys into Unforgettable Adventures
Published: 2024-07-08 17:00:01

Embarking on the journey of "Evotto" -an evolution to automobile , offers an opportunity to connect with transport readers by making them feel the freedom and excitement of exploring new destinations in the comfort of our rental vehicles. We engage our audience by sharing vivid ways, highlighting unique vehicle features, and offering expert travel tips that resonate with their desires and needs. The key is to create an immersive experience that speaks directly to their wanderlust, using evocative option that ignites their imagination. By focusing on the emotions and experiences our services facilitate, you transform mundane transactions into memorable adventures. Let our automobile evolution be a beacon, guiding potential customers through the vast sea of rental options to your doorstep, promising an unforgettable journey.
Tente isso 3-1 : Construa um sistema de ajuda
Tags: java
Published: 2024-07-09 22:02:55

Este projeto constrói um sistema de ajuda simples que exibe a sintaxe das instruções de controle Java. O programa exibe um menu contendo as instruções de controle e então espera que uma seja selecionada. Após a seleção, a sintaxe da instrução é exibida. Nessa primeira versão do programa, só há ajuda disponível para as instruções if e switch. As outras instruções de controle serão adicionadas em projetos subsequentes.

1. Crie um arquivo chamado Help.java

2. O programa começa exibindo o menu a seguir:
 Help on:
  1. if
  2. switch
 Choose one:

 Para exibi-lo, você usará a sequência de instruções mostradas aqui:
 System.out.println("Help on:");
 System.out.println("  1. if");
 System.out.println("  2. switch");
 System.out.print("Choose one: ");

3. Em seguida, o programa lerá a seleção do usuário chamando System.in.read( ):
 choice = (char) System.in.read();

4. Uma vez que a seleção tiver sido lida, o programa usará a instrução switch mostrada a seguir para exibir a sintaxe da instrução selecionada.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6e8xyhxjmp0n2wkycfwu.png)

Observe como a cláusula default captura escolhas inválidas. Por exemplo, se o usuário inserir 3, não haverá uma constante case correspondente, fazendo a sequência default ser executada.

5. Aqui está a listagem inteira do programa Help.java:

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

6. Resultado.
 Help on:
  1. if
  2. switch
 Choose one: 1
 The if:
 if(condition) statement;
 else statement;
Python_In_Tamil-001
Tags: python, learning, programming, basic
Published: 2024-07-08 17:06:10

Dear All,
I am Govindarajan from Thanjavur. I teach Basic Python through OnLine. I am a PCEP and PCAP.
Ok, let us start learning Basic Python.
1. Install python from python.org as per your computer system.

2. In windows, in the search bar, type cmd, cmd page will get opened. Write python at the cursor location and press Enter. If you see Python with the version number of the python, then it is confirmed that python is installed in your system. If not, go to the point number 1 above.

3. Then, in the search bar, type IDLE. Click on IDLE with right side mouse and click Run as administrator. you will see a new window titled as IDLE Shell python version number. This window is called as Shell window or Console window.

4. In the shell window, click File => New File. Another window with a title as untitled will open. This window is called as Editor window. we will write all our codes/program in this Editor window. It will be saved as python file(.py extension). 

5. Type ('Hello World') with a file name as BP001, save it(Ctrl + s), click Run, click Run Module F5 (or Fn + F5), the code will get executed and you will see Hello World in your Shell Window.

6. Great !!!. You have successfully completed your first program in Python. Congratulations.

Let us meet tomorrow in 'Python_In_Tamil-002'.

Thanks and Regards.
Govi.
https://www.youtube.com/@Python_In_Tamil
Git User Credentials
Published: 2024-07-08 17:09:21

So i always wondered why i do a git push to a certain repository but notice that i see a different user as the committer, and not the account i cloned from. so the problem is this - i clone from repo A with username A1, but while doing a git push i noticed that the commit done was from username B1, even though they all belong to me but it should be username A1 with the commit.

The issue is that the git credential on your local machine was set to global hence the terminal uses it for commits. so how to change that...

Navigate to the git directory 

```
cd <git directory>
```

check for the credentials list to see the default

```
git config --list
```

here you can see the global username and email
All you need to do is to add another username in our case here the username and email of A1

```
git config user.name "<username>"
git config user.email "<email>"
```

if you want to override the default and make A1 the default

```
git config --global user.name "<username>"
git config --global user.email "<email>"
```

To switch to a different user credential, run the following commands with the desired user name and email:

```
git config user.name "New Name"
git config user.email "new.email@example.com"
```

If you want to switch to a global user credential, add the --global flag to the commands:

```
git config --global user.name "New Name"
git config --global user.email "new.email@example.com"
```

Remember that the user credential settings are stored in the .git/config file within your local repository. If you want to view or edit this file directly, you can open it with a text editor.

What does this solution solve, it can solve some ssh issues, some wrong user commit and some serious headache lol
Internal Error: No such file or directory @ rb_sysopen - /box/script.js when using Judge0 API
Published: 2024-07-08 17:21:52

I'm encountering an issue while trying to execute code using the Judge0 API. The response I receive from the API is as follows:

json
Copy code
{
  "stdout": null,
  "time": null,
  "memory": null,
  "stderr": null,
  "token": "4957159e-0921-44fa-82a6-b9d4b202f276",
  "compile_output": null,
  "message": "No such file or directory @ rb_sysopen - /box/script.js",
  "status": {
    "id": 13,
    "description": "Internal Error"
  }
}
Setup
I set up Judge0 using the provided .config and docker-compose.yml files. There were no additional files included in the configuration.

Issue
When I use the following route: submissions/?base64_encoded=false&wait=false, I get the error mentioned above. It seems that the Judge0 server cannot find or create the script.js file.
Git Dual Boot Files Modified Solution
Tags: git, linux, microsoft, dualboot
Published: 2024-07-08 17:23:26

So there is a problem that you might face which is if you use dual boot or switched from windows to linux or vice versa That the files in your git are shown as modified but when you try to pull it says already uptodate. 

This issue often occurs due to differences in how Windows and Linux handle line endings in text files. Windows typically uses CRLF (Carriage Return and Line Feed) for line endings, while Linux uses LF (Line Feed) only. Git can detect these differences and mark files as modified even if their contents haven't changed.


On windows machine configure 

> `git config --global core.autocrlf true`


On Ubuntu configure

> `git config --global core.autocrlf input`

if the issue still presists

> `git add --renormalize .`

at last if there is still issue you can make a commit and this will solve the issue. If you do not want to make that commit just delete the folder and clone it from remote (Github) again.

Thanks
Python class first day
Tags: python
Published: 2024-07-08 17:36:06

Hi all,
Today I joined the python class run by Kaniyam Foundation. First day of class today they taught basic installation and instructions and how to create blogs. It was very useful for me. And they taught basic Python programming.

Basic program 
👇👇👇

```
Print("hello world")
```

I will write about the daily activities of this python class in this blog in coming days.
Glue work makes the dream work
Tags: womenintech, testing, career
Published: 2024-07-08 17:42:05

Glue (Verb): To integrate different parts of a system together that would otherwise be incompatible.

**Glue is complex**

Being the Glue can be a lot of different things, from Coding, design or just being the human being amongst it all. People are not always rewarded for doing it well. It’s testing or Quality Engineering it’s often seen as just piecing things together but in reality it takes a lot of communication, documentation, writing, evaluating vendors or designs and how to implement the. It is so much more complicated than just “piecing things together”. In testing or Quality Engineering we often have to solve problems for ourselves. Testing tool evaluation for example.

Your job title says “Quality Engineer”, but you seem to spend most of your time in meetings. You’d like to have time to prevent bugs, but nobody else is onboarding the junior engineers, updating the roadmap, talking to the users, noticing the things that got dropped, asking questions on design documents, and making sure that everyone’s going roughly in the same direction. If you stop doing those things, the team won’t be as successful. But now someone’s suggesting that you might be happier in a less technical role. If this describes you, congratulations: you’re the glue. If it’s not, have you thought about who is filling this role on your team?

> “the less glamorous and often less promotable work, that needs to make a team successful.” — Tanya Reilly

Gluework is not a new concept in tech. Women have been talking about it for years, my fave Tanya Reilly who did a great talk about it in 2018.

Every senior person in an organisation should be aware of the less glamorous — and often less-promotable — work that needs to happen to make a team successful. Managed deliberately, glue work demonstrates and builds strong technical leadership skills. Left unconscious, it can be extremely career limiting. It pushes people into less technical roles and even out of the industry. We need to talk about how to allocate glue work deliberately, frame it usefully and make sure that everyone is choosing a career path they actually want to be on.

If you are not being paid for this Glue Work and it is detrimental to your progression — stop doing it. Stop being the unofficial lead. If you keep doing glue work — you will only get better at being glue. Make sure to focus on your own technical skills.

I am still a Staff Quality Engineer at heart, awesome woman in tech, UN Women Delegate and I believe in the value of curiosity and empathy in testing. I do all my own stunts, love food, travel, my friends, family, music and art.

If you enjoyed this story, please share to help others find it. Feel free to leave a comment — I am open to insight, learning and discussion.
Pergunte ao especialista - If/else ou switch
Tags: java
Published: 2024-07-09 22:03:19

Sob que condições devo usar uma escada if-else-if em vez de um switch ao codificar uma ramificação com vários caminhos?

Resposta:
Em geral, use uma escada if-else-if quando as condições que controlam o processo de seleção não dependerem de um único valor. 

Exemplo:

 if(x < 10) // ...
 else if(y != 0) // ...
 else if(!done) // ...

Essa sequência não pode ser recodificada com um switch porque todas as três condições envolvem variáveis diferentes – e tipos diferentes. Que variável controlaria o switch? 
Você também terá que usar uma escada if-else-if ao testar valores de ponto flutuante ou outros objetos que não sejam de tipos válidos em uma expressão switch.
What a W.I.T.C.H!
Tags: testing, exploratorytesting, webdev
Published: 2024-07-08 17:53:05

## Exploratory testing using a Witch.

Erm - pardon?  

I love a heuristic. Does not mean I always remember them, so take my advice — i’m not using it.

Here’s an exploratory testing heuristic using the acronym W.I.T.C.H.

## **W.I.T.C.H Heuristic**

**W — Workflows**


- Explore common and edge workflows: Identify typical user journeys and uncommon paths. Test each step, transitions, and decision points. If you have enough experience, then hell yeah — use your Oracle knowledge!
- Integration points: Check interactions between different system components and third-party services. Ensure data consistency and flow.
- Error Handling: Validate how the system handles errors, including user errors, system errors, and edge cases.

**I — Inputs**

- Variety of inputs: Test with different data types, lengths, and special characters. Include valid, invalid, and boundary inputs.
- Data formats: Ensure the system can handle different formats like JSON, XML, CSV, etc., if applicable.
- Input sources: Test inputs from various sources such as forms, files, databases, APIs, etc.


**T — Time**

- Time-based conditions: Check how the system behaves at different times, such as leap years, time zones, and daylight saving changes. Yes it’s 2024 but you might be surprised how often hidden third parties do not cope with time changes.
- Performance testing: Assess the system’s response time, throughput, and load handling capabilities.
- Timeouts and delays: Verify the handling of network delays, server timeouts, and user session timeouts.
- How much time do you have to do your exploratory testing? What is the priority based on that.


**C — Context**

- User context: Understand different user scenarios, roles, and permissions. Test features specific to each user type.
- Environment context: Test across various environments like development, staging, and production. Ensure compatibility with different operating systems, browsers, and devices.
- Business context: Ensure alignment with business rules, workflows, and objectives. Validate against business requirements and user expectations.

**H — Heuristics and History
**

- Common heuristics: Use known heuristics like RCRCRC (Recent, Core, Risky, Configuration, Repaired, and Chronic) to guide testing. There are so many available online or via Ministry of Testing.
- Historical data: Analyse past bugs, user feedback, incident reports and anomaly detection logs — well any logs. Focus on areas with frequent issues or something you think is strange...
- Exploratory testing: Continuously adapt testing based on findings. Use exploratory charters to guide and document testing sessions.


I am a Staff Quality Engineer, awesome woman in tech, UN Women Delegate and I believe in the value of curiosity and empathy in testing. I do all my own stunts, love food, travel, my friends, family, music and art.

If you enjoyed this story, please share to help others find it. Feel free to leave a comment — I am open to insight, learning and discussion.
Hello World
Tags: programming, python, beginners, learning
Published: 2024-07-08 18:01:26

Today, I joined a free online course on Python by the Kaniyam Foundation. And, this blog is to document my progress throughout the course.

In the first live session this evening, a lot of course details were shared. Helpful information was provided regarding the installation of Python on our machines. As is customary, we began by learning to print "Hello, World!" using the `print` statement. Towards the end of the session, the importance of free and open-source software (FOSS) was also emphasized.
Introducing CurlDock: Simplify API Testing with Docker and Curl
Tags: curl, api, docker, devtools
Published: 2024-07-08 18:26:33

Hey Dev.to community!

I'm excited to share CurlDock, a lightweight open-source tool I've been working on to simplify API testing and curl script management.

## What is CurlDock?

CurlDock combines the power of curl with the convenience of Docker, offering a user-friendly interface for creating, editing, and executing curl commands. Built with Rust and React, it's designed for simplicity and ease of use.


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

## Key Features

- 🐳 **Dockerized**: Easy setup and consistent environments
- 🖥️ **User-Friendly Interface**: Similar to Postman or Insomnia
- 📁 **Git-Friendly**: Store scripts as .sh files for easy version control
- 🔒 **Network Isolation**: Access endpoints within your Docker network

## Quick Start

Getting started with CurlDock is as easy as running a Docker command:

```bash
docker run --name curldock --rm -e SCRIPTSFOLDER="/scripts" -v $(pwd)/scripts:/scripts -e PORT="2080" -p 2080:2080 inigoetxaniz/curldock
```

Then, just open `http://localhost:2080` in your browser!

## Why CurlDock?

- **Simplicity**: Focus on core functionality without unnecessary complexity
- **Local-First**: Designed for local development environments
- **No Authentication**: Reduced complexity for improved usability
- **Developer Control**: You manage your own security measures

## Try It Out!

I'd love for you to give CurlDock a spin and share your thoughts. 

Check out the [GitHub repository](https://github.com/ietxaniz/curldock) for more details!

Happy API testing! 🚀
Animated text underline in CSS only
Tags: css, web
Published: 2024-07-08 18:06:57


![Animated underline](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ywrh3bagekowdxoiyde.gif)

```css
.animated-underline {
    position: relative;
    text-decoration: none;
}

.animated-underline::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 100%;
    height: 0.125em;
    background-color: hsl(200deg, 100%, 50%);
    transition: transform 320ms ease;
    transform: translate(-50%, 0%) scaleX(0);
    transform-origin: right;
}

.animated-underline:hover::after {
    transform-origin: left;
    transform: translate(-50%, 0%) scaleX(1);
}
```