teleren/devto huggingface dataset:
Differences between the 6 types of Hackers
Tags: security, cybersecurity, hackers, beginners
Published: 2022-02-01 21:19:45

# What are the 6 types of Hackers?
When it comes to cybersecurity, things aren’t all that black and white (excuse the pun). Hackers’ hats come in a variety of colors:
- Black-Hat
- White-Hat 
- Grey-Hat
- Green-Hat
- Blue-Hat
- Red-Hat


## What are Black Hats?
Black hat hackers guys who want to use their technical skills to defraud and blackmail others. They usually have the expertise and knowledge to break into computer networks without the owners’ permission, exploit security vulnerabilities, and bypass security protocols. To make money or haram someone, they are ready to do all illegal activities such as: 
- Phishing
- Writing, distributing, and selling malware like viruses, worms, trojan horses, etc.
- Deploying cyberattacks like distributed denial of service (DDoS) to slow down or crash the services.
- Deploying dangerous cyber threats like brute-force attacks, scareware, botnets, man-in-the-middle attacks, malvertising campaigns, etc.

They're using other illegal activities too!

## What are White-Hats?
White-Hats are also known as Ethical Hackers. Instead of Black-Hats, White-Hats are the "good guys" and Black-Hats are the "bad guys", like in Star Wars :). Companies often hire white-hats to test software, which means they do so only with the owner's permission. White-hats use the same activities as black-hats. White-hats find security vulnerabilities, report them, and fix them. They also program tools that detect and then defend against cyberattacks. 

## What are Grey Hats?
These Grey-Hat hackers falls between white-hats and black-hats. Grey hat hackers’ intentions are often good, but they don’t always take the ethical route with their hacking technics. They do it mostly without owner's permission. They find & report the security vulnerabilities then like White-Hats.

## What are Green Hats?
A Green Hat are new/beginners to the field of "hacking". Green Hat hackers are unaware of the security mechanisms and inner workings of the Internet, but they are eager learners and determined (and even desperate) to improve their position in the hacking community. While not necessarily intending to do harm, they may do so when "playing" with various malware and attack techniques.

**As a result, "green hat" hackers can also be harmful because they are often unaware of the consequences of their actions-or, worse, do not know how to fix them.**

## What are Blue Hats?
Blue hat hackers (some blue hats are known as blue hat Microsoft hackers) perform penetration testing and deploy various cyber-attacks without causing damage. Microsoft often organizes such invite-only conferences to test Windows programs. 

## What are Red-Hats?
A red hat is like Robin Hood on the internet. A red-hat hacker could refer to someone who targets systems owning from a black-hat hacker, mostly. Rather than hand a black hat over to the authorities, red hats will launch aggressive attacks against them to bring them down, often destroying the black hat's computer and resources.
DocuClass Lite democratiza la gestión documental

Published: 2022-02-01 21:19:27

Cima Software, una empresa especializada en el desarrollo de tecnología de gestión de información, anunció el lanzamiento de DocuClass Lite, una solución disruptiva y novedosa 100% nube, que pone la tecnología de gestión documental, hasta el momento solo accesible por grandes empresas, finalmente al alcance de todos.

DocuClass Lite permite a las organizaciones gestionar su información empresarial, de manera intuitiva, con los más altos estándares internacionales de seguridad, a bajo costo, sin configuraciones complicadas y sin compromisos o riesgos, al brindar 7 días de prueba gratuitos y al no requerir acuerdos a largo plazo.

“Las organizaciones a nivel mundial, viven en un ecosistema cada vez más descentralizado y sujeto a eventos y factores imprevistos, en el cual los documentos llegan de diferentes fuentes, son recibidos por diferentes personas en diferentes locaciones, tienen diversos formatos y versiones, y deben ser accedidos y gestionados de manera controlada por muchos usuarios, de manera simultánea. Todo ello da lugar a un “caos de información” que no solo genera ineficiencias y altos costos operativos, sino también, pone en riesgo la continuidad del negocio. Para solucionar este problema, las organizaciones, tradicionalmente, han venido adquiriendo sistemas de gestión documental in-situ o nube que requieren mucho tiempo de evaluación e implementación, así como altos costos de licenciamiento e implementación. En consecuencia, muchas de estas iniciativas “paperless” se truncan, ya sea por falta de presupuesto, falta de tiempo disponible para el proyecto o simplemente por las dudas que conlleva tomar una decisión de este tipo”, indicó Nelson Cano, CEO de Cima Software.

Y es por ello que Cima Software lanza al mercado, DocuClass Lite. Una solución que representa un cambio de paradigma, una nueva manera en que las empresas o departamentos de cualquier tamaño, pueden empezar a dar los primeros pasos hacia un ambiente laboral realmente “paperless” sin demoras, sin riesgo alguno, a su propia velocidad, a bajo costo, utilizando tecnología de última generación, y con el conocimiento de que, si sus necesidades crecen, tienen la opción de hacer crecer su sistema fácilmente.

[ver mas...](https://tecnologia.ciudademprendedores.com/ver.php?url=monserratenoticias.co)
Faking progress 📈
Tags: programming, quickread
Published: 2022-02-01 21:13:08

When you need to tell a user approximately how long something will take, what function do you use to calculate the percentage completed? You could use a simple linear progress increase over the estimated time span of the process, but where's the fun in that? 🥸

I propose the following asymptotic function for calculating progress completed, based on an approximate maximum process time:

{% katex %}
 c = 1 - 10^{(\frac{-2.3t}{m})}
{% endkatex %}

where {% katex inline %}t{% endkatex %} is the amount of time that has elapsed since the process started and {% katex inline %}m{% endkatex %} is the approximate maximum amount of time that the process should take. It should go without saying, but *make sure that your elapsed time and maximum time are measured in the same units.*

With this function, you end up with a nice smooth curve as the percentage completed approaches 1.

![Graph of percent complete functions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yitqb4z0zz7tv9sd9dqa.png)

<figcaption>A graph of percent complete functions for 5, 10, 20, and 30 max load times</figcaption>


You should be able to implement this very simply in any programming language. Then just call this function repeatedly with updated elapsed time in order to re-render the percentage displayed to the user.

Here are some code samples to make your life that much easier!

## TypeScript

```ts
function percentComplete(elapsed: number, maxLoadTime: number) {
  return (1 - 10 ** ((-2.3 * elapsed) / maxLoadTime)) * 100;
}
```

## JavaScript

```js
function percentComplete(elapsed, maxLoadTime) {
  return (1 - 10 ** ((-2.3 * elapsed) / maxLoadTime)) * 100;
}
```

## Python

```py
def percentComplete(elapsed, maxLoadTime):
    return (1 - 10 ** ((-2.3 * elapsed) / maxLoadTime)) * 100
```

## C# ## 
```cs
private static double PercentComplete(double elapsed, double maxLoadTime)
{
    return (1 - Math.Pow(10, (-2.3 * elapsed / maxLoadTime)));
}
```

And if you want to play around with the graphs and coefficient, check out [Desmos](https://www.desmos.com/calculator/76w4vm5zf3)!

Thanks for reading! 👋
-Kyle
Tracing vs Transformation for developers
Tags: webdev, motivation
Published: 2022-02-01 21:09:51

With millions of tutorials, Twitter threads, and clones of projects, there's a clear distinction between **tracing** and **transformation**.

---

## Tracing
Tracing has its time and place. If you are examining how an application was built, understanding syntax, and so on. Wordle, Flappy Bird, and Todo List clones have value for beginners.

Revenue in this space is sparse and scrappy, but some clones have gotten traction and made tons of money. 

Is it right to monetize it? In my opinion: Not really, but I'm not a cop.

---

## Transformation
Transformation is a substantial difference, like AskJeeves vs. Google or Facebook vs. MySpace. Transformation falls into two phases: Minor or Major.

**Minor** transformation is more than slight tweaks or coloring outside the lines. Adding six letters to the Wordle game instead of 5 is more like tracing. Making it a PWA is more a transformation, in my opinion. Learning is more abundant than purely Tracing. Tutorials should encourage this, expanding the idea past the end. It's small and meaningful changes. 

**Major** Transformation is much more complex—AskJeeves vs. Google or Facebook vs. MySpace. The idea is the same but a constant refinement of critical points. It's easy to see some inspiration, but the list of differences is vast and expanding. 

---

## Closing

There will always be those tracing others' projects and making cash or getting clout. It's part of the process now. Tracing isn't going to make a lasting product or great developers. It's mostly laziness or lack of creativity. 

Lasting products or ideas either fit into Major Transformation or Creation. Creation is much more challenging.

Suppose you're interested in reading more about Creation. I highly recommend the book Zero to One. 


---

I'll leave you with two questions:
- Is this Tracing or a Transformation? 
- Does it matter if it's Open-Source?
[Uses Tech the Original](https://uses.tech/) vs [Tech Blogs, Launched on Product Hunt](https://tech-blogs.dev/)

![Uses.tech design vs tech-blogs.dev](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lxcmstpb8beaa677cf14.jpeg)


*Sorry for The Office memes, but it's a really good show.*
WunderHub — The Package Manager for APIs (Private Beta Announcement)
Tags: graphql, react, webdev, javascript
Published: 2022-02-01 21:00:14

##### Hello Wunderfans! If you enjoy our content, never miss a blog post or a feature update by subscribing to our newsletter or even better, joining our Discord! Hope you enjoy our latest features and happy coding!




{% youtube gh0orAGQi9s %}
Prefetch Data Before Button Click Livewire - Laravel
Tags: php, laravel, programming, beginners
Published: 2022-02-01 20:33:52

Today we are learning about a feature in Livewire that allows me to fetch data before pressing a key and invoking the api see an example
```php
<div>
   <button wire:click.prefetch="getPrice">Show</button>
   Price: {{ $price }}
</div>
```
in livewire component
```php
public function getPrice() {
   $this->price = Http::get('') ?? null;
}
```
I hope you take advantage of this feature
Source :- https://www.youtube.com/watch?v=e2MMO_b0Yj0
GO CASHLESS: THE RISE OF STABLECOINS AS PAYMENT
Published: 2022-02-01 20:27:42



![Rise of Stablecoins](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fr5atcleheilyqzpxyub.PNG
)


Going cashless is nothing new. In fact, in much of the world, digital payment tools like debit and credit cards, chip and pin, WeChat and contactless payments have replaced the cash economy altogether. However, a whole new cashless payment method is finding its footing—bitcoin wallets. With this, consumers can purchase anything they want as easily and quickly as using social media.

What makes bitcoin wallets appealing is how they make the transaction process fast and efficient through your mobile phone. This technology is becoming widespread as well as adopted, and it paved the way for another payment method: stablecoin.

A stablecoin is a digital currency pegged to a fiat currency, such as the U.S. dollar or the Euro, making it a practical and viable choice for activities that involve payments on a blockchain network for both large and small values. Think of it as a digital wallet that is secure, fast, and affordable, while having the usability of a fiat currency.




_Read the [full article here](https://coingeek.com/bitcoin101/go-cashless-the-rise-of-stablecoins-as-payment/)!_
Save couple of seconds each day by Alfred's workflow
Tags: devex, alfred, programming
Published: 2022-02-01 20:26:54

# Assumptions

I'm working on my private laptop. Each day I must run IDE, iTerm, docker, slack, password manager, browser, maybe spotify. It's not a hard or long task but it takes a couple of seconds. Also is repetitive so it sounds like a good candidate to automate.

# Tool
I chose [alfred](https://www.alfredapp.com/) for this task. Unfortunately is necessary to buy [Alfred Powerpack](https://www.alfredapp.com/shop/) however it's great tool and I can recommend it event without this workflow.

# Implementation

Alfred -> preferences -> workflows -> + -> blank workflow. 

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

On the new workflow create an input trigger and drag some applications from `applications` catalog.

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

Then just connect the input trigger with every selected application.

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

#

# Clean up

Of course closing each application should take a little bit less time, however we can automate it as well.

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

This workflow will look almost the same as the previous one. But instead of `Launch application` will be `Bash script` and paste e.g. `pkill webstorm` or `pkill slack`

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

# Result

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

# Summary

Probably you will spend more time configuring this workflow than calling it manually for next couple of years. However you can little bit reduce amount of stuff to think about.

My workflows: [https://github.com/przemyslawjanpietrzak/dotfiles/tree/master/.alfred(https://github.com/przemyslawjanpietrzak/dotfiles/tree/master/.alfred)
How to find an account balance in SQL?
Tags: sql, sqlserver, tsql
Published: 2022-03-05 17:00:10

---
title: How to find an account balance in SQL?
published: true
date: 2022-02-01 19:39:07 UTC
tags: sql, sqlserver, tsql
canonical_url: https://blog.rajanand.org/how-to-find-an-account-balance-in-sql
series: SQL Interview Questions and Answers
---

## Question:

You have a `transaction_detail` table with a record for each transaction. The transaction type could be debit, credit or refund. You need to add an additional column to track account balance.

Write a SQL query to achieve the expected output.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1643741735004/70s8dDQ_K.png)

## Answer:

Let us create the test data first.

```
-- create test data
USE demo;
GO
CREATE TABLE dbo.transaction_detail (
    date date,
    transaction_type varchar(50),
    amount money
    )
GO

INSERT INTO dbo.transaction_detail VALUES
('2022-01-01','credit',1000),
('2022-01-16','debit',300),
('2022-01-31','credit',150),
('2022-02-04','debit',50),
('2022-02-13','refund',50),
('2022-02-28','credit',400),
('2022-03-21','debit',500)
GO

```

To get the desired result, you can use aggregate function `sum` with window function to calculate the **running total** for each row in a window. But, we have not defined the window (i.e, `partition by` is not defined to define the window) here. Had we have to calculate the account balance for each account, we would have defined the window as account. So this query just calculates the running total for all the records in the table.

```
-- solution
SELECT 
date,
transaction_type,
amount,
balance = SUM(CASE WHEN transaction_type = 'debit' then amount * -1 
              else amount end) 
          OVER(ORDER BY date)
FROM dbo.transaction_detail

-- clean up
-- USE demo;
-- DROP TABLE dbo.transaction_detail

```

This is the solution I have come up with. If you have achieved the output in any other way, let me know in comments. Thank you.

If you would like to receive these interview questions directly to your inbox, sign up for my [newsletter](newsletter.rajanand.org).
How to write a function that only accepts an exact number of arguments
Published: 2022-02-01 20:22:31


How to write a function that only accepts an exact number of arguments

If you find yourself having to write a function that can only accept a predefined number of arguments there are several ways to approach this using vanilla JavaScript , hereI’ll describe 2 simple ways of doing this, using the _arguments object_ and _rest parameters_ (this last one is preferred for ES6 and arrow functions).

## The arguments object:

_arguments_ is an array object accessible inside functions that contains the values of the arguments passed to that function as explained on [https://developer.mozilla.org](https://developer.mozilla.org/)/. 

Let's see this on use:

```
function add(a, b, c) {

      return arguments[0] + arguments[1] + arguments[2];

    };
```
This is the same thing as doing:

```
function add(a, b, c) {

      return a + b + c;

    };
```

In this case, if we want to accept only 3 arguments, no more, no less we could do:

```
function add(a, b, c) {

      if (arguments.length === 3) {

        return a + b + c;

      }

    };
```


## Rest parameters:

The rest parameter allows a function to accept an indefinite number, or in our case defined number of arguments as an array in JavaScript.

Let’s achieve the same as before but with the rest parameters this time:

```
function add(...args) {

      if (args.length === 3) {

        return args[0] + args[1] + args[2];

      }

    };
```

In this case *args* represents the array we access our values from. In order to be accessed it is essential to use the ‘…’. Furthermore, this should be the way to go in arrow functions as previously explained.

I hope this was useful.

Happy coding 🚀
Task Workers in Netflix Conductor - Orkes
Published: 2022-02-01 19:36:18

A worker is responsible for executing a task. Operator and System tasks are handled by the Conductor server, while user defined tasks needs to have a worker created that awaits the work to be scheduled by the server for it to be executed. Workers can be implemented in any language, and Conductor provides support for Java, Golang and Python worker framework that provides features such as polling threads, metrics and server communication that makes creating workers each.

Each worker embodies Microservice design pattern and follows certain basic principles:

Workers are stateless and do not implement a workflow specific logic.

Each worker executes a very specific task and produces well defined output given specific inputs.

Workers are meant to be idempotent (or should handle cases where the task that partially executed gets rescheduled due to timeouts etc.)

Workers do not implement the logic to handle retries etc, that is taken care by the Conductor server.

## Implementing a Task Worker

To create a worker, implement the Worker interface.

```
public class SampleWorker implements Worker {

    private final String taskDefName;

    public SampleWorker(String taskDefName) {
        this.taskDefName = taskDefName;
    }

    @Override
    public String getTaskDefName() {
        return taskDefName;
    }

    @Override
    public TaskResult execute(Task task) {
        TaskResult result = new TaskResult(task);
        result.setStatus(Status.COMPLETED);

        //Register the output of the task
        result.getOutputData().put("outputKey1", "value");
        result.getOutputData().put("oddEven", 1);
        result.getOutputData().put("mod", 4);

        return result;
    }
}
```


## More Details
https://orkes.io/content/docs/how-tos/task-configurations

Follow and star us on GitHub for updates
https://github.com/Netflix/conductor/

Join the Slack Community Channel at 
https://join.slack.com/t/orkes-conductor/shared_invite/zt-xyxqyseb-YZ3hwwAgHJH97bsrYRnSZg
What is a Chat API?
Tags: chat, api, quickblox, sdk
Published: 2022-02-01 19:46:49

---
title: What is a Chat API?
published: true
description: 
tags: chat, API, QuickBlox, SDK 
//cover_image: https://direct_url_to_image.jpg
---
![Chat API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9dvkpe8kfn8apvoxc9gs.png)

More and more businesses and dev agencies are turning to Chat APIs as a time and cost efficient way to integrate real-time chat functionality into their app or website.  But what exactly is a chat API and how is it different from a chat SDK?

Take a look at a recent blog from QuickBlox, where we attempt to provide [everything you need to know in a nutshell](https://quickblox.com/blog/what-is-a-chat-api-everything-you-need-to-know-in-a-nutshell/) including:

* What is the difference between an API and SDK
* How your business could benefit from a chat API
* How best to use a chat API
* How to choose a chat API


Leave comments and questions below.
Blueberry Diagnostics desarrolla un innovador test sanguíneo para el diagnóstico del SARS-CoV-2 (COVID-19)

Published: 2022-02-01 19:44:51

Blueberry Diagnostics, empresa de biotecnología catalana especializada en el desarrollo de test basados en inteligencia artificial y machine learning (aprendizaje automático) para la detección temprana y el manejo preciso de enfermedades, anuncia que ha desarrollado un test especialmente indicado para detectar aquellos casos positivos de SARS-CoV-2 con una infección en curso, a partir de un simple análisis de sangre de rutina.

Desde que el pasado mes de diciembre de 2019 surgió en Wuhan, provincia de Hubei, China, la enfermedad por coronavirus 2019 (COVID-19) y, el 11 de marzo de 2020, la Organización Mundial de la Salud la declaró pandemia, diferentes estrategias para la identificación temprana de los casos infectados por el SARS-CoV-2 han servido de pilar para contener la propagación viral. En este sentido, el análisis de reacción en cadena de la polimerasa con transcripción inversa (RT-PCR) de hisopos nasofaríngeos sigue siendo el método de referencia para identificar la presencia del genoma del SARS-CoV-2. Sin embargo, la necesidad de procesamiento de laboratorio, el alto coste y el largo período de tiempo transcurrido desde el muestreo hasta la obtención de los resultados, limitan la viabilidad de esta técnica para las estrategias de pruebas basadas en la comunidad. Por otra parte, las pruebas rápidas de antígenos disponibles desde septiembre de 2020 (mucho más baratas que las PCR y con resultados en 15 minutos), no se pueden producir en la cantidad suficiente para satisfacer la demanda mundial actual. Por tanto, existe la necesidad de pruebas alternativas, menos costosas y más accesibles.

[ver mas...](https://tecnologia.ciudademprendedores.com/ver.php?url=monserratenoticias.co)