teleren/devto huggingface dataset:
Sales Marker Introduces AI Sales To The World
Tags: ai, news, career
Published: 2023-11-15 15:51:48

[CrossBorder Inc., a pioneering force in 'intent-based sales'*1 in Japan, has introduced a groundbreaking advancement in sales with the launch of **AI Sales**, the world's first generative AI sales technology, integrated into its Sales Marker platform](https://www.techdogs.com/tech-news/business-wire/sales-marker-introduces-ai-sales-to-the-world). This move extends the reach of their innovative **'intent-based sales' methodology**, which focuses on understanding customer needs through intent data. Sales Marker, a leading sales intelligence solution, combines a vast corporate database with intent data to precisely target companies with immediate needs.

Traditional sales and marketing often struggle with identifying promising prospects, relying on firmographic data. Intent-based sales, however, takes a proactive approach by engaging with companies where needs are evident, resulting in significant improvements in conversion and win rates. In response to challenges in the sales process arising from individual skills and experiences, Sales Marker's AI Sales feature levels the playing field by automating the detection of companies in need, pinpointing specific departments and individuals, and generating tailored messaging for seamless engagement.

This technological leap not only streamlines processes traditionally navigated through trial and error but also addresses challenges faced by sales professionals contending with quotas. The CEO of CrossBorder, Ukyo Ogasawara, highlights the pivotal role of Sales Marker in optimizing outcomes through precise targeting and timely approaches. The unveiling of AI Sales marks a transformative moment, turning underperforming sales professionals into top performers, and underscores CrossBorder's commitment to advancing the well-being of all sales professionals while showcasing Japan's technological prowess on the global stage. As the sales landscape evolves, AI Sales offers a solution that piques curiosity, promising a paradigm shift in sales effectiveness.

Enjoyed reading this content piece? There's a lot more where this came from! Head to [TechDogs](https://www.techdogs.com/) homepage and check out the myriad of [Articles](https://www.techdogs.com/resource/td-articles), [White Papers](https://www.techdogs.com/resource/white-papers), [Case Studies](https://www.techdogs.com/resource/case-studies), [Reports](https://www.techdogs.com/resource/reports), [Videos](https://www.youtube.com/channel/UCZ0lgIRSVraU14O9bp3bMCQ), [News](https://www.techdogs.com/resource/tech-news) and[ Events & Webinars](https://www.techdogs.com/resource/events) to Know Your World of Technology.
Dependency Injection in javascript
Published: 2023-11-15 15:49:29

Dependency Injection (DI) is a design pattern that promotes the separation of concerns and helps to make your code more modular, flexible, and testable. In JavaScript, particularly in environments like Node.js or frontend frameworks (e.g., Angular), you can implement dependency injection in various ways.

Here's a basic explanation and example of dependency injection in JavaScript:

Dependency Injection Basics:
Dependency:
A dependency is an external module, service, or object that a function or module relies on to perform its task.

Injection:
Injection is the process of providing dependencies to a module or function from the outside, rather than having the module or function create the dependencies itself.

```js
// Service module (dependency)
class Logger {
  log(message) {
    console.log(`[LOG] ${message}`);
  }
}

// Client module (dependent on Logger)
class OrderProcessor {
  constructor(logger) {
    this.logger = logger;
  }

  process(order) {
    this.logger.log(`Processing order: ${order}`);
    // Business logic for processing the order goes here
  }
}

// Dependency Injection
const logger = new Logger(); // Create an instance of the Logger
const orderProcessor = new OrderProcessor(logger); // Inject the logger into the OrderProcessor

// Now, you can use orderProcessor to process orders, and it will use the injected logger for logging.
orderProcessor.process('Order123');


```


In this example, OrderProcessor is dependent on Logger, but instead of creating an instance of Logger inside OrderProcessor, we pass an instance of Logger to OrderProcessor when creating it. This is the essence of dependency injection.

Benefits of Dependency Injection:
Testability:
By injecting dependencies, you can easily replace them with mock objects or test doubles during unit testing.

Flexibility:
You can change the behavior of a module by injecting different implementations of its dependencies.

Modularity:
Dependencies are clearly defined and can be easily replaced or extended without modifying the dependent modules.
Facade Pattern in javascript
Published: 2023-11-15 15:43:27

The Facade Pattern is a structural design pattern that provides a simplified interface to a set of interfaces in a subsystem. It hides the complexities of the subsystem and provides a higher-level interface that makes it easier to use. In JavaScript, the Facade Pattern can be implemented using functions or classes to simplify interactions with a complex system.

Here's a simple example of the Facade Pattern in JavaScript:

```js
// Complex subsystem
class SubsystemA {
  operationA() {
    return "SubsystemA: operationA";
  }
}

class SubsystemB {
  operationB() {
    return "SubsystemB: operationB";
  }
}

class SubsystemC {
  operationC() {
    return "SubsystemC: operationC";
  }
}

// Facade
class Facade {
  constructor() {
    this.subsystemA = new SubsystemA();
    this.subsystemB = new SubsystemB();
    this.subsystemC = new SubsystemC();
  }

  operation() {
    let result = "Facade: ";
    result += this.subsystemA.operationA();
    result += " | " + this.subsystemB.operationB();
    result += " | " + this.subsystemC.operationC();
    return result;
  }
}

// Usage
const facade = new Facade();
console.log(facade.operation());
// Output: Facade: SubsystemA: operationA | SubsystemB: operationB | SubsystemC: operationC

```

In this example:

SubsystemA, SubsystemB, and SubsystemC represent different parts of a complex system.
The Facade class aggregates instances of the subsystems and provides a higher-level interface called operation that simplifies interactions with the subsystems.
The client code interacts with the Facade to perform operations without needing to understand the complexities of the individual subsystems.
The Facade Pattern is particularly useful when dealing with large and complex systems, providing a clear and simple interface for clients while encapsulating the details of the subsystems. This promotes loose coupling and makes the system more maintainable and easier to understand.
My Hacktoberfest 2023
Tags: hacktoberfest, 2023, opensource
Published: 2023-11-15 15:41:30

---
title: My Hacktoberfest 2023
published: true
description: No hacktoberfest for me in 2023
tags: hacktoberfest, 2023, opensource 
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzx2es49l2a0zdxv8u69.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-11-15 15:26 +0000
---
I have participated in the Hacktoberfest for some years now and I was looking forward to the Hacktoberfest of 2023.

Then I decided to to go trekking in Nepal instead.

So no Hacktoberfest for me in 2023 - which of course is sad, but then again I had a super trekking adventure in Nepal instead. Also the preparation was very time consuming so I did not spend so much time in front of the computer outside working hours as I normally do for the months up to my trek.

So now my plan is to make up for this during the next 11 months until the next Hacktoberfest.

To me this was very much a friendly reminder that not sitting in front of a computer, getting out and experiencing nature and the world and using your body physically is so rewarding on so many levels.

Now I just need to strike a balance between AFK and work and open source work - and I might start considering where my next trek should go to.
🚀 Git - Boost Your Productivity with Git worktrees 🌟
Tags: git, github, programming, tutorial
Published: 2023-11-15 15:30:00

Are you tired of constantly switching between branches while working on your Git projects? Git Worktrees to the rescue! 🌳

Git Worktrees are a fantastic feature that allows you to have multiple working directories (working trees) linked to a single Git repository. 🌐 This is especially handy when you need to juggle multiple branches simultaneously. Here's how to make the most of it:

1️⃣ **Create a New Worktree:**

   Start by creating a new worktree for the branch you want to work on with this simple command:

   ```bash
   git worktree add <path> <branch-name>
   ```

   Replace `<path>` with the location where you want to set up your new worktree (e.g., `../my-feature-branch`) and `<branch-name>` with the name of your target branch.

   Example:

   ```bash
   git worktree add ../my-feature-branch feature-branch
   ```

2️⃣ **Navigate to the New Worktree:**

   Move to the newly created worktree:

   ```bash
   cd ../my-feature-branch
   ```

3️⃣ **Work on the Branch:**

   Now, you can work on your branch independently in this new worktree. Any changes you make here won't affect your main working tree.

4️⃣ **List and Manage Worktrees:**

   To see all your active worktrees, use:

   ```bash
   git worktree list
   ```

   When you're done with a worktree, you can remove it by either manually deleting the associated directory or using:

   ```bash
   git worktree remove <path>
   ```

   Example:

   ```bash
   git worktree remove ../my-feature-branch
   ```

Using Git Worktrees is a game-changer for simultaneous branch work, whether it's reviewing, testing, or making changes across different branches. 🌈 Say goodbye to the hassle of multiple clones and keep your workspace organized and efficient!
generate-sitemap 1.10.0 Released
Tags: github, webdev, showdev, python
Published: 2023-11-15 15:15:58

## TL;DR

I just released [generate-sitemap](https://github.com/cicirello/generate-sitemap) 1.10.0, a [GitHub Action for generating XML sitemaps for static websites](https://dev.to/cicirello/generate-an-xml-sitemap-for-a-static-website-in-github-actions-20do). The generate-sitemap GitHub Action is implemented in Python, and generates an XML sitemap by crawling the GitHub repository containing the html of the site, using commit dates to generate `<lastmod>` tags in the sitemap.

This release, generate-sitemap 1.10.0, introduces an option to specify a list of directories and/or individual files to exclude from the sitemap. The Action already automatically excluded individual html files from the sitemap if a noindex directive to robots was specified in the head of the page, as well as exclusions based on contents of the site's robots.txt. This release adds the ability to specify additional paths to exclude from the sitemap. The motivating case came from a feature request from a user who wanted to be able to exclude a directory of content common across multiple pages from the sitemap (e.g., the pages that depend upon that content should be in sitemap, but not necessarily the shared html). 


## Changelog 1.10.0 - 2023-11-15

### Added
* Ability to specify list of paths to exclude from sitemap, via new input `exclude-paths`.

### Dependencies
* Bump [cicirello/pyaction](https://github.com/cicirello/pyaction) from 4.25.0 to 4.26.0


## More Information

Please consider starring generate-sitemap's GitHub repository:

{% github cicirello/generate-sitemap %}

For more information, see my earlier post about generate-sitemap here on DEV, as well as its webpage.

{% link https://dev.to/cicirello/generate-an-xml-sitemap-for-a-static-website-in-github-actions-20do %}

{% embed https://actions.cicirello.org/generate-sitemap/ %}


## Where You Can Find Me

Follow me [here on DEV](https://dev.to/cicirello) and on [GitHub](https://github.com/cicirello):

{% user cicirello %}

Or visit my website:

{% embed https://www.cicirello.org/ %}
The factory pattern
Published: 2023-11-15 15:08:41

The factory pattern is a creational design pattern that provides an interface for creating instances of a class, but it allows subclasses to alter the type of objects that will be created. In JavaScript, you can implement a factory pattern using functions and object literals. Here's a simple example:

```js
// Product class
class Car {
  constructor(options) {
    this.model = options.model || "Default";
    this.color = options.color || "Default";
  }

  displayInfo() {
    console.log(`Model: ${this.model}, Color: ${this.color}`);
  }
}

// Factory function
function carFactory(options) {
  return new Car(options);
}

// Usage
const car1 = carFactory({ model: "Toyota", color: "Blue" });
const car2 = carFactory({ model: "Honda", color: "Red" });

car1.displayInfo(); // Output: Model: Toyota, Color: Blue
car2.displayInfo(); // Output: Model: Honda, Color: Red

```

In this example:

We have a Car class representing the product we want to create.
The carFactory function is a factory function that takes options and returns a new instance of the Car class.
The carFactory function allows us to create different instances of Car with various options.
This simple example demonstrates the basic concept of a factory pattern. In more complex scenarios, you might have different types of products (classes) and a factory function that determines which type of product to create based on certain conditions or input parameters. The factory pattern is often used in conjunction with other design patterns to create flexible and maintainable code.
How to check the number of queries per second (QPS) on the PostgreSQL DB instance?
Tags: postgres, database, sql, devops
Published: 2023-11-15 14:48:30

To check the number of queries per second (QPS) on the PostgreSQL DB instance run the following SQL query:

```
with
 t1 as (select sum(calls) n from pg_stat_statements),
 t2 as (select sum(calls) n from pg_stat_statements , pg_sleep(1))
select
 t2.n-t1.n the_num_of_queries_per_second
from
 t1,t2;
```

Example:

```
postgres=> with
postgres->  t1 as (select sum(calls) n from pg_stat_statements),
postgres->  t2 as (select sum(calls) n from pg_stat_statements , pg_sleep(1))
postgres-> select
postgres->  t2.n-t1.n the_num_of_queries_per_second
postgres-> from
postgres->  t1,t2;
 the_num_of_queries_per_second 
-------------------------------
                          1234
(1 row)

postgres=> 
```

`ask_dima@yahoo.com`
How to check the number of transactions per second (TPS) for the given PostgreSQL DB instance?
Tags: postgres, devops, bash, database
Published: 2023-11-15 14:46:34

To find the number of transactions per second for the given PostgreSQL DB instance run the following script.

```
#!/bin/sh
###############################################
#
# Check transactions per second
# for the given PostgreSQL DB instance
#
# This script connects
# to the given PostgreSQL DB instance
# and retrieves information -
# the number of transactions per second
#
# Date: 10-Aug-2020
#
# Author: Dmitry
#
###############################################

helpFunction()
{
  echo " "
  echo "Usage: ${0} -h db_hostname -p port -U db_user -d db_name"
  echo "\t-h Postgres hostname"
  echo "\t-p Postgers port"
  echo "\t-U Postgres db user"
  echo "\t-d Postgres db name"
  echo " "
  echo "Example how to run: ${0} -h my_db_host -p 5432 -U my_db_user -d my_db_name "
  echo " "
  exit 1 # Exit script after printing help
}

trim() {
  local var="$*"
  # remove leading whitespace characters
  var="${var#"${var%%[![:space:]]*}"}"
  # remove trailing whitespace characters
  var="${var%"${var##*[![:space:]]}"}"
  printf '%s' "$var"
}

while getopts "h:p:U:d:" opt
do
case "$opt" in
  h ) inpHost="$OPTARG" ;;
  p ) inpPort="$OPTARG" ;;
  U ) inpDBUser="$OPTARG" ;;
  d ) inpDBName="$OPTARG" ;;
  ? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done

# Print helpFunction in case parameters are empty
if [ -z "$inpHost" ] || [ -z "$inpPort" ] || [ -z "$inpDBUser" ] || [ -z "$inpDBName" ]
then
  echo "Some or all of the parameters are empty";
  helpFunction
fi

a=$(psql -h $inpHost -p $inpPort -U $inpDBUser -d $inpDBName -t -c "select clock_timestamp() t, sum(xact_commit+xact_rollback) n, round(extract(epoch from now())) tt from pg_stat_database")
a=`trim $a`

tps_a_t=`echo $a | awk ' { printf("%s %s", $1, $2) } '`
tps_a=`echo $a | awk ' { print $4 } '`
tps_a_tt=`echo $a | awk ' { print $6 } '`

sleep 1

b=$(psql -h $inpHost -p $inpPort -U $inpDBUser -d $inpDBName -t -c "select clock_timestamp() t, sum(xact_commit+xact_rollback) n, round(extract(epoch from now())) tt from pg_stat_database")
b=`trim $b`

tps_b_t=`echo $b | awk ' { printf("%s %s", $1, $2) } '`
tps_b=`echo $b | awk ' { print $4 } '`
tps_b_tt=`echo $b | awk ' { print $6 } '`

# echo "($tps_a_t, $tps_a_tt, $tps_a)"
# echo "($tps_b_t, $tps_b_tt, $tps_b)"

x=$((tps_b-tps_a))
y=$((tps_b_tt-tps_a_tt))

# echo "x: $x"
# echo "y: $y"

tps=$((x/y))

echo "tps: $tps"
```
#02 IAM - Securing Root Account
Tags: aws, tutorial
Published: 2023-11-15 14:41:40

##01 Securing the Root Account

In this section, we are going to discuss how we are going to manage AWS accounts.

**1. What is IAM?**
IAM stands for **_Identity Access Management_** and essentially it allows you to manage users and their level of access to the AWS console and allows you to go ahead and create users and grant permissions to those users.

In IAM we can also create groups and roles. IAM basically used to control access for the AWS resources. 

**2. What is Root Account?**

The root account has full administrative access to AWS and It's the email address used to sign up for AWS.

**Hands-On**

<u>IAM Dashboard</u>

![IAM-dashboard ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ffeeucpyzkkbnzv6z21d.png)

**LAB 1**

When you first sign up for the AWS account with your root account, you need to add MFA for your root user. 

<u>Step 01</u>

Click on the "Add MFA" button. 

![add-mfa-1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzluecaewi1015tmkx71.png)

<u>Step 02</u>

Add a device name. Here I will add "Redmi"


![add-mfa-2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9kx1xd0rflp1lfx649pg.png)

Now you can download any authenticator app for your smartphone. In the above image, I have selected "Authenticator app". Select that and scroll down and go ahead to Next.

<u>Step 03</u>

In this step, you will able to see the QR code and you can do the setup device. 

![add-mfa-3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4fqhi59vcbdfcavdw62j.png)

Let's assume we used the Google Authenticator app. Once you scan the QR code you will need to add two MFA codes from your device. 

After adding those you will able to see your device has been added to your AWS account.

**Exam Tips**

1. Enable MFA on the root account.
2. Create an admin group for administrators, and assign the appropriate permissions to that group.
3. Create user accounts for your administrators.
4. Add your users to the admin group.
[Javascript] - Data dictionary
Tags: javascript, node
Published: 2023-11-15 14:37:37

```
Object.create() // TypeError: Object prototype may only be an Object or null
```


```
Object.create(null) //[Object: null prototype] {}
```


```
Object.create({}) // {}
```


**The second one is a data dictionary, because it is an object without a parent.**

It creates an object that has an empty [[Prototype]] binding (also known as null), and therefore this object cannot delegate anywhere. 

As an object of this type does not have a prototype chain, the _**instanceof**_ operator has nothing to check, so it will always return false. 

These special empty [[Prototype]] objects are often called "dictionaries" as they are typically only used to store data in properties, most of the time because they have no surprise effect coming from any delegated property/function in the chain [[Prototype]], and therefore are only used for data storage.

[The **_instanceof_** operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object. The return value is a boolean value.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof)

**_Constructors_**, in javaScript, it is more appropriate to say that, a "constructor" is any function called with a "new" keyword before it. **_Functions are not constructors_**, but function calls are "constructor calls" if and only if "new" is used.
Alias any Type with C# 12
Tags: csharp, dotnet
Published: 2023-11-15 14:29:45

---
title: Alias any Type with C# 12
published: true
description: With C# 12, you can now alias type, including tuples, array, pointer, and unsafe types.
tags: csharp, dotnet
cover_image: https://res.cloudinary.com/dk3rdh3yo/image/upload/w_526,dpr_auto,f_auto/v1699760915/blog/alias-any-type-in-csharp-12/0_2_stpqof.webp
published_at: 11/16/2023
canonical_url: https://baldbeardedbuilder.com/blog/alias-any-type-in-csharp-12/
---

C# has had the ability to alias namespaces and named types for a long time. It's useful for avoiding naming conflicts between libaries or for using simpler names for complex generic types. If you're not familiar with namespace and type aliasing, here is an example:

```csharp
// Namespace alias
using SuperJSON = System.Text.Json;
var document = SuperJSON.JsonSerializer.Serialize("{}");

// Type alias
using SuperJSON = System.Text.Json.JsonSerializer;
var document = SuperJSON.Serialize("{}");
```

## New Aliasable Types

With the release of C# 12, developers are gaining the ability to alias almost all types. Let's review some of the new options.

### Aliasing Tuple Types

Tuples are commonly used as method return types, but when they're used multiple times, aliasing can help us keep our code cleaner and more legible.

```csharp
using Country = (string Abbreviation, string Name, double GDPPerCapita);

Country GetCountry(string abbreviation)
{
    // Logic here
    return ("US", "United States of America", 63529);
}

List<Country> GetCountries()
{
    // Logic here
    return [("US", "United States of America", 63529)];
}

Console.WriteLine(GetCountry("US").Name);
```

### Aliasing Types with Pointers

Most of time, C# developers don't need access to pointers, but now you can alias them when you do.

```csharp
using bytePtr = byte*;

unsafe void MyMethod()
{
    int x = 1024;
    bytePtr ptr = (byte*)&x;

    Console.Write("The 4 bytes of the integer:");

    for (int i = 0 ; i < sizeof(int) ; ++i)
    {
        Console.Write(" {0:X2}", *ptr);
        ptr++;
    }

    Console.WriteLine();
    Console.WriteLine("The value of the integer: {0}", x);
}
```

### Aliasing Array Types

Aliased array types are another addition in C# 12, which should make your declarations cleaner and more legible for teams.

```csharp
using Companies = System.Collections.Generic.List<Company>;

Companies GetCompanies()
{
    return [
        new Company() { Id = 1, Name = "Acme Co."}
    ];
}

class Company
{
    public string Name;
    public int Id;
}
```

## Aliasing Nullable Types

Most types are available for aliasing in C# 12, including nullable value types. However, nullable reference types aren't available for aliasing.

## Conclusion

Expanded capabilities for aliasing in C# 12 has the potential to make your code cleaner and more readable for your teams.