teleren/devto huggingface dataset:
Challenge: So Many Permutations!
Tags: programming, challenge, permutations, coding
Published: 2023-04-24 00:42:12

In this challenge, your task is to create all permutations of a non-empty input string and remove duplicates, if present.

Create as many "shufflings" as you can!

Examples:

```
With input 'a':
Your function should return: ['a']

With input 'ab':
Your function should return ['ab', 'ba']

With input 'abc':
Your function should return ['abc','acb','bac','bca','cab','cba']

With input 'aabb':
Your function should return ['aabb', 'abab', 'abba', 'baab', 'baba', 'bbaa']
```

Note: The order of the permutations doesn't matter.

Have fun!!
HackerRank: Class vs. Instance Solution using PHP (Day 4 - 30 Days of Code)
Tags: hackerrank, hackaton, programming, php
Published: 2023-04-24 00:39:44

## Task
Write a Person class with an instance variable, age, and a constructor that takes an integer, **initialAge**, as a parameter. The constructor must assign **initialAge** to age after confirming the argument passed as **initialAge** is not negative; if a negative argument is passed as **initialAge**, the constructor should set **age** to 0 and print Age is not valid, setting **age** to 0. In addition, you must write the following instance methods:

1. **yearPasses()** should increase the age instance variable by 1 
2. **amIOld()** should perform the following conditional actions:
- If age < 13, print You are young.
- If age>=13 and age<18, print You are a teenager.
- Otherwise, print You are old.
3. To help you learn by example and complete this challenge, much of the code is provided for you, but you’ll be writing everything in the future. The code that creates each instance of your Person class is in the main method. Don’t worry if you don’t understand it all quite yet!

**Note:** Do not remove or alter the stub code in the editor.

## Solution

```PHP

class Person {
    public $age;

    public function __construct($initialAge) {
        if ($initialAge < 0) {
            echo "Age is not valid, setting age to 0.\n";
            $this->age = 0;
        } else {
            $this->age = $initialAge;
        }
    }

    public function amIOld() {
        if ($this->age < 13) {
            echo "You are young.\n";
        } else if ($this->age >= 13 && $this->age < 18) {
            echo "You are a teenager.\n";
        } else {
            echo "You are old.\n";
        }
    }

    public function yearPasses() {
        $this->age += 1;
    }
}

$T = intval(fgets(STDIN));
for ($i = 0; $i < $T; $i++) {
    $age = intval(fgets(STDIN));
    $p = new Person($age);
    $p->amIOld();
    for ($j = 0; $j < 3; $j++) {
        $p->yearPasses();
    }
    $p->amIOld();
    echo "\n";
}
```

This is part of **30 Days of Code - Day 4**
A Gotcha With Gauges
Tags: java, development
Published: 2023-04-24 00:10:57

I had a gotcha recently trying to use a Gauge metric that I wanted to share. 

I love metrics and I use [Micrometer](https://micrometer.io/) as a Facade for them. 

Typical usage looks like the following, although you can also annotate a method with `@Timed` which is delightful.
```java
SimpleMeterRegistry oneSimpleMeter = new SimpleMeterRegistry();
Counter counter = registry.counter("page.visitors", "age", "20s");
counter.increment();
```

I typically use counters and timers and they have always been pretty straightforward. 

We're building a system for [dynamic config](https://www.prefab.cloud/features/config/) now and as part of that I wanted to track the current number of connections. Counters and Timers aren't right for this sort of thing however, what I needed was a Gauge, which should work right out of the box.  

I did something like the following and thought that would be it:
```java
class ConnectionHolder
  private final AtomicInteger connections;

  @Inject
  public ConnectionHolder(MeterRegistry meterRegistry) {
    connections =
      meterRegistry.gauge(
        "config.project-connections",
        Tags.empty(),
        new AtomicInteger()
      );
  }

  @Scheduled(fixedDelay = "1m")
  public void recordConnections(){
    projectConnections.set(calculateConnections());
  }
}
```

I made 2 connections to test it out and looked at the metrics. I was very surprised to see my numbers all over the place! Sometimes zero, sometimes one, sometimes 2. 

## The Problem
Trying to use Gauges exposed a setup problem in my DataDog metrics. The core issue is that Gauges are not additive in the same way as Counters. Here's what I mean: 
If server A writes a metric `counter:apples=2` 
And server B writes a metric `counter:apples=1`

Both of those metrics will be saved in the time period and we can add those together and get 3. 

Gauges however, are stored differently.  
If server A writes a metric `gauge:apples=2` 
And server B writes a metric `gauge:apples=1`

The metrics backend will only store the most recent value: `gauge:apples=1`. 

In my case, this meant we had a minute by minute race conditions between the two running pods.

## The Solution
The solution is proper metric tagging. We need each server to be tagging the result as having come from it. This prevents the backend from clobbering our values here.  
`gauge:apples=2,pod:abc123`
`gauge:apples=1,pod:xyz789`

The problem in my case was that DataDog was not sending stats through my Datadog sidecar and was sending them straight to the Datadog API, which bypassed the functioning tagging process that was working for APM.  


For more info, there are [full details](https://www.prefab.cloud/blog/gauge-metrics-datadog-and-kubernetes/) in this post, which gets into the details of passing the pod ID into the containers and setting the tagging explicitly.

## Takeaway
You can forget about the underlying way that stats are collected with counters, but gauges are less forgiving. Keep that in mind and happy counting.
Create A Unique ID Using A Custom Function In Google Sheets
Tags: googlesheets, googleappsscript, tutorial
Published: 2023-04-24 00:01:40

Have you ever needed to uniquely identify a row in Google Sheets? You could use the row number, but if users move or delete rows, the numbers would change. What you need is a unique id for each row. Learn how to create a custom function that returns a unique id in Google Sheets!

## Create A Custom Function

![Create A Custom Function](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8o2tq5td6n6x4i1t4yus.png)

1. Open your spreadsheet and navigate to Extensions > Apps Script.
2. The Apps Script Editor will open with a single script file called **Code.gs**.
3. An empty function will default in. You can remove it.
4. Give your untitled project a name.

In the Apps Script code editor, create a function called **UUID**.

```javascript
function UUID() {
 
}
```

Apps Script provides a [Utilities](https://developers.google.com/apps-script/reference/utilities/utilities) class with a [getUuid](https://developers.google.com/apps-script/reference/utilities/utilities#getUuid()) method. All we have to do is return it in the function.

```javascript
return Utilities.getUuid();
```

Here’s the final code for the **UUID** function.

```javascript
function UUID() {
  return Utilities.getUuid();
}
```

## Use A Custom Function

![Use A Custom Function](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wcraabnzblrlmip4y6is.png)

Using a custom function is no different than using the many functions Google Sheets provides. Within the cell, enter the function:

```javascript
=UUID()
```

The result will be a unique id!

```
baceef3c-f633-4deb-94db-1c17a2105719
```

You can also use functions (and custom functions) when inserting rows. For example, when using the [appendRow](https://developers.google.com/apps-script/reference/spreadsheet/sheet#appendrowrowcontents) method of the [Sheet](https://developers.google.com/apps-script/reference/spreadsheet/sheet) class.

```javascript
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Users');
 
sheet.appendRow([
  '=UUID()',
  'John',
  'Smith'
]);
```

You can now uniquely identify rows using the id! This can be useful when making an edit to a specific row!

---
**Visit our website at [https://nightwolf.dev](https://nightwolf.dev) and follow us on [Twitter](https://twitter.com/nightwolfdev)!**
What is blackmart alpha?
Published: 2023-04-23 23:48:21

If you are an android user then surely have installed some productive games and apps through the Google play store. 

To install these apps you have to create a google account first.
For which you have to give your personal information. 

Google play store contains a large number of games some of them are not free. 

Blackmart alpha provides you with a way to download all the apps and games for free. 

You must be wondering what is Blackmart Alpha APK? It is an unofficial app store 

through which you can download a variety of the latest games and apps for free. 

Blackmart Alpha is available for Android, IOS, and PC.

Source: https://blackmartz.com/alpha/
can you use Blazor instead of react
Published: 2023-04-23 23:47:19

Peace

**The article was Generated By AI** , I found it useful.

Yes, you can use Blazor instead of React. Blazor is a web framework for building client-side web applications using .NET and C#, whereas React is a JavaScript library for building user interfaces. Blazor uses WebAssembly to run .NET code in the browser, allowing you to write C# code that can execute directly in the browser without the need for JavaScript.

Blazor provides a component-based programming model similar to React, where you can create reusable UI components and compose them together to build complex user interfaces. Blazor also includes built-in support for data binding, routing, and dependency injection, making it easier to build complex web applications.

That being said, whether to use Blazor or React for frontend development depends on the specific requirements of your project and the expertise of your development team. If your team is experienced in C# and .NET development, and you prefer to use a single language for both server-side and client-side development, then Blazor may be a good choice. However, if your team is more experienced in JavaScript and you need access to a larger ecosystem of third-party libraries and tools, then React may be a better choice.

Blazor uses a component-based programming model, where developers can create reusable UI components using C# and Razor syntax. These components can be composed together to build complex user interfaces, and they can communicate with each other using events and data binding. Blazor also includes built-in support for routing, dependency injection, and state management, making it easier to build complex web applications.

Blazor provides two hosting models: server-side and client-side. In the server-side hosting model, the application code is executed on the server and the UI updates are sent to the client using a SignalR connection. In the client-side hosting model, the entire application is downloaded to the client and runs directly in the browser using WebAssembly.

Blazor is an open-source project that is part of the .NET platform, and it is supported by Microsoft. It can be used to build a wide range of web applications, including single-page applications, progressive web applications, and hybrid applications that combine server-side and client-side rendering.
CUPCAKEAGI Towards a Human-like Multisensory LLM Agent with Dreams & Random Thoughts, Emotions, Memory, and Task Performance
Tags: openai, chatgpt, ai, machinelearning
Published: 2023-04-23 23:28:13

Hi everyone, I made CupCakeAGI🧁🍰🎉🤖🧠🍩🍪 using Nextjs for frontend and langchain & fastapi for backend, CupcakeAGI is an agent that aims to mimic human-like behavior and cognitive abilities to assist users in performing various tasks. CUPCAKEAGI can accept images, video, audio and text. It has access tools like search, calculator and more tools can be added in a modular fashion like react. It has unlimited memory. I've added features to let it dream and have random thoughts and store emotion parameters, it has a thought bubble that can be seen by user at all times. It also performs tasks using pre-defined ability functions and can make new abilities using python code.

{% embed https://github.com/AkshitIreddy/CUPCAKEAGI %}
{% embed https://medium.com/@akshit.r.ireddy/cupcakeagi-towards-a-human-like-multisensory-llm-agent-with-dreams-random-thoughts-emotions-5a5417d074e4 %}
Password Hashing 101: All About Password Hashing and How it Works
Published: 2024-06-22 08:40:05

---
title: Password Hashing 101: All About Password Hashing and How it Works
published: true
date: 2023-04-23 23:11:23 UTC
tags: 
canonical_url: https://mojoauth.com/blog/password-hashing-101-all-about-password-hashing-and-how-it-works
---

And then there are the security concerns. With data breaches becoming more common, it’s important to choose passwords that are strong and secure. But is that enough to secure passwords? But what does that mean, exactly? In this article, we’ll take a look at what password hashing is and why it’s important. We’ll also give you some tips on how to choose strong passwords and keep them safe. What is password hashing?
Comprehensive Vehicle Tracking Dataset for Your Research or Business
Tags: ai, dataset
Published: 2023-04-23 17:41:35

Are you in need of a reliable and comprehensive vehicle tracking dataset for your research or business needs? Look no further than [Datatang.ai](http://datatang.ai/).

Our vehicle tracking dataset includes a wide range of data on various types of vehicles, including cars, trucks, buses, and more. Our data is collected through advanced GPS tracking technologies and can provide a wealth of information on vehicle movements, speed, direction, and more.

With our comprehensive vehicle tracking dataset, you can access data on millions of vehicles recorded over extended periods of time, allowing for detailed analysis of traffic patterns, fleet management, and more. Our dataset is also customizable based on your specific needs, ensuring that you receive the data you require for your analysis.

At [Datatang.ai](http://datatang.ai/), we take pride in offering high-quality data at competitive prices. Our team of experts works diligently to ensure that our data is accurate, comprehensive, and up-to-date. We use advanced quality control methods to ensure that our vehicle tracking dataset is error-free and meets the highest standards.

Whether you're a researcher, a business owner, or a government agency, our vehicle tracking dataset can provide you with valuable insights into vehicle movements and traffic patterns. Visit our website to learn more about our services and to request a quote today.
Automatically Document Your Database in Markdown
Tags: database, documentation
Published: 2023-04-23 21:46:59

---
title: Automatically Document Your Database in Markdown
published: true
description: 
tags: database, documentation
---

Use SchemaCrawler to generate Markdown documentation from your existing database. You can tweak the output to your heart's content using Python scripting. (SchemaCrawler also supports JavaScript and Ruby scripting.)

Try it out. Make sure that you have [Docker](https://docs.docker.com/desktop/) installed on your system, or download [SchemaCrawler](https://www.schemacrawler.com/). Download a sample SQLite database called ["chinook-database-2.0.1.sqlite"](https://github.com/schemacrawler/chinook-database/releases/download/v16.11.7/chinook-database-2.0.1.sqlite) into your current directory.

Grab the Python script of ["markdown.py" from SchemaCrawler's GitHub repository](https://github.com/schemacrawler/SchemaCrawler/blob/main/schemacrawler-scripting/src/main/resources/scripts/markdown.py), and save it in your local directory. 

Then run a command like:

```sh
docker run \
--mount type=bind,source="$(pwd)",target=/home/schcrwlr/share \
--rm -it \
schemacrawler/schemacrawler \
/opt/schemacrawler/bin/schemacrawler.sh \
--server=sqlite \
--database=share/chinook-database-2.0.1.sqlite \
--info-level=standard \
--command script \
--script-language python \
--script share/markdown.py
```

(If you are using PowerShell on Windows, replace the trailing backslash on each line with a back-tick "`".)

> There is a simpler example of this in the [scripting gist](https://gist.github.com/sualeh/4aebf7098f5907467df20d00f03962cd).

Once you have got this working, you can connect to any database - whether Oracle, MySQL, PostgreSQL, Microsoft SQL Server, IBM DB2 or any other database that SchemaCrawler supports.

You can build the Markdown generation in a GitHub Action or GitLab build too. An example is in the [schemacrawler/SchemaCrawler-Action-Usage-Example](schemacrawler/SchemaCrawler-Action-Usage-Example) repository.


-----

To learn about how to use SchemaCrawler, download the [SchemaCrawler distribution zip file](https://github.com/schemacrawler/SchemaCrawler/releases/) and go through the examples.
How to Contribute to Open Source Projects and the Benefits of Doing So
Tags: webdev, programming, productivity, opensource
Published: 2023-04-23 21:22:21

Open source projects are a great way to learn, teach, share, and build experience. Contributing to open source projects can be a rewarding way to improve the software you rely on daily, find a mentor if you need one, learn new skills or improve on existing ones, and build your portfolio.

Here are some steps to get started with contributing to open source projects:

1. Find a project that interests you: Look for projects that align with your interests and skills. You can start by searching on GitHub or other open source platforms.
2. Read the documentation: Before you start contributing, make sure to read the project's documentation to understand the guidelines, coding standards, and contribution process.
3. Start small: Start with small issues or bugs to get familiar with the project and the contribution process. This will also help you build confidence in your own abilities.
4. Ask for help: Don't be afraid to ask for help if you get stuck. Most open source projects have a community of contributors who are willing to help.
5. Submit your contribution: Once you have made your contribution, submit a pull request and wait for feedback from the project maintainers.

Contributing to open source projects is one of the best ways to learn how to look at a problem from different perspectives. When you're working on an open source project, you're likely going to be working with other developers who have their own unique approaches, and this can help you see problems from a totally different angle. Additionally, contributing to open source projects can help you build your reputation, your resume, and even your personal brand. By sharing code on GitHub, you can show potential employers that you have the skills needed to be a good developer or designer.
Another benefit of contributing to open source projects is that you can network with other developers. This means that you'll meet new people and make friends, collaborate with other developers on projects, and learn from others' experiences.
In conclusion, contributing to open source projects is a great way to learn, teach, share, and build experience. By following the steps outlined above, you can get started with contributing to open source projects and reap the benefits of doing so. Contributing to open source projects can help you build confidence in your own abilities, gain experience working on real-world projects, and build your portfolio. It can also help you learn new skills, improve on existing ones, and network with other developers.
How to monitor URQL performance and link with database queries ?
Tags: urq, performance, tracking, hasura
Published: 2023-04-23 21:13:05

Hi Urql community, i'm struggling debugging / optimising urql request as these requests are then converted to Postgre SQL requests thru Hasura.

Extract of my urql file:

```

    ${GetApprovals_VersionFragmentDoc}`;
export const GetApprovalsDocument = gql`
    query GetApprovals($projectId: uuid!) {
  files(
    where: {is_approval_mode: {_eq: true}, project: {id: {_eq: $projectId}}, folder: {is_in_bin: {_eq: false}}}
  ) {
    ...GetApprovals_file
  }
}
    ${GetApprovals_FileFragmentDoc}`;

```


Extracts of a postgre request (log from EverSQL), maybe linked to this query (but i'm not sure, which is my problem):

```
SELECT
  coalesce((json_agg("root") -> 0), 'null') AS "root"
FROM
  (
    SELECT
      row_to_json(
        (
          SELECT
            "_100_e"
          FROM
            (
              SELECT
                "_0_root.base"."id" AS "id",
                "_0_root.base"."name" AS "name",
                "public"."is_approved_on_a_version"("_0_root.base") AS "is_approved_on_a_version",
                "_0_root.base"."is_approval_mode" AS "is_approval_mode",
                "_16_root.or.assignation"."assignation" AS "assignation",
                "_99_root.cf.last_version"."last_version" AS "last_version",
                "_57_root.ar.root.file_versions"."file_versions" AS "file_versions",
                "_0_root.base"."due_date" AS "due_date",
                'files' AS "__typename"
            ) AS "_100_e"
        )
      ) AS "root"
    FROM
      (
        SELECT
          *
        FROM
          "public"."files"
        WHERE
          (
            (
              (
                (
                  "public"."get_user_can_read_file"("public"."files".*, $1)
                ) = (('true') :: boolean)
              )
              OR (
                (
                  (
                    "public"."get_user_can_read_file"("public"."files".*, $1)
                  ) IS NULL
                )
                AND ((('true') :: boolean) IS NULL)
              )
            )
```


As a conclusion here:
- i have no way to know if the SQL log comes from this specific query
- which user performed the query
- how to optimise the urql query to avoid performance provlems with SQL.

Do you have any tips / recommandations for that ?

Thanks a lot
#100DaysOfCode Into #BlockChain_Development
Tags: 100daysofcode, blockchain, blockchaindevelopment, soniastyle
Published: 2023-04-23 21:06:33

**A brief Intro:**
My Name is Sonia Atsen - But call me SoniaStyle for short. I am a frontend Developer with over 3 years of experience, a technical writer, and a Developer advocate. I base in Jos, Nigeria.

Few days ago, after making up my mind in 2023 to focus on blockchain Development.

I took a challenge on my Facebook page to focus on a #100DaysOfCode to focus on blockchain.

Today (23/04/2023) makes it approximately 4 days since i started.

Then, I remember I had a Dev.io account. As a technical writer, I will be stretching my learning process here too.

Do hope to write more blockchain technical content here as well.


Watch Out for me


I remain SoniaStyle
Frontend Developer Diving into Blockchain Development