teleren/devto huggingface dataset:
Short-Circuiting and Logical Operators in JavaScript: &&, ||, ??
Tags: javascript, webdev, beginners, tutorial
Published: 2024-06-07 21:14:04



**Short-circuiting** is a concept in logical operations in many programming languages, including JavaScript where the evaluation stops as soon as the outcome is determined. such as the “AND operator” and “OR operator”. This feature only looks at the first value to decide what to return without even looking at the second value.
It is particularly useful for optimizing code and preventing unnecessary computations.

The **&& operator**: if the first value is **true**, it immediately returns “the second value”, and if the first value is **falsy** it will immediately return “the falsy value”.

```
// falsy values: 0, '', undefined, null
console.log(true && 'Something'); // Something
console.log(false && 'Something'); // false
console.log(0 && 'Something'); // 0
11
```

The **|| operator**: if the first value is **true**, it immediately returns “true”, and if the first value is **falsy** it will immediately return “the second value”.

```
// falsy values: 0, '', undefined, null
console.log(true || 'Something'); // true
console.log(false || 'Something'); // Something
console.log(0 || 'Something'); // Something
```

But there can be a problem with the returned value since if the first value is 0 but it’s not actually false, it’s just falsy! Then we would need to get the actual value of 0, not the second value.
Another example:

```
const count1 = undefined;
const count2 = 0;
console.log(count1 || 'No data'); // No data
console.log(count2 || 'No data'); // No data
```

Here, the second console log should show 0 as the total number, not undefined. To fix this, we should give the condition some flexibility with falsy values other than null and undefined. That’s where we use the **Nullish coalescing operator**. This operator returns the falsy value if it’s anything other than undefined or null. So, for the values of 0 and empty strings, it will return the actual value of them.

```
const count1 = undefined;
const count2 = 0;
const count3 = 5;
console.log(count1 ?? 'No data'); // No data
console.log(count2 ?? 'No data'); // 0
```

**Optional chaining operator**: this can be very useful when dealing with objects that may have missing properties or when you want to safely access deeply nested properties without running into _null_ or _undefined_ errors.

```
const data = {
 value1: undefined, // or it could be { nested: undefined }
 value2: { nested: 3 },
 value3: { nested: 5 }
};
function getMultiplicationResult(obj1, obj2) {
 const val1 = obj1?.nested ?? 0;
 const val2 = obj2?.nested ?? 0;
 return val1 * val2;
}
const result = getMultiplicationResult(data.value1, data.value2); // 0 * 3 = 0
const result = getMultiplicationResult(data.value2, data.value3); // 3 * 5 = 15
```

Here, we used **?** (Optional Chaining) to safely access the _nested_ property of the objects _obj1_ and _obj2_.
And used **??** (Nullish Coalescing) to provide a default value of _0_ if _nested_ is _null_ or _undefined_.
So, if _data.value1_ is undefined or if _data.value1.nested_ is undefined, _val1_ will be set to _0_.
From sticks and levers to worlds and chasms
Tags: ai, webdev, machinelearning, datascience
Published: 2024-06-07 21:13:41

Technology, and now AI, are modern equivalents of the Arquimedes lever for your mind. If we want to accomplish more as humans we have think on how to extend our innate capabilities.

We have been doing exactly that for thousands of years, from when we created our first handheld tool, to when we started creating the first machines to do work for us.

Today we have programmers, this rare subspecies of Homo sapiens who create incredible things with their hands and minds, by writing scripts and instructions for machines to follow and execute.

It's amazing how many abstraction levels we have gone through in the last centuries alone. Now we face an unprecedented phase of human amplification with AI.

There is a big dichotomy though: Will AI be an excuse for the dumbification of the Homo sapiens, or will it really help us achieve greater intellectual feats by sharpening the human mind?

Feels like it will be both, as it has always been. We already have the entirety of our shared knowledge in our pocket and very few use it well. It will not be different with AI.

However, we need to be careful. AI can not just increase the divide between the creative producers and consumers in our world, it can dig an uncrossable chasm. It can separate, it can even create a completely new species of humans by genetic manipulation and amplification.

What is too much? Can we stop ourselves from doing it? Or the mere possibility of others doing it will cause us to have to do it _first_? Will we be forced to transcend our human frailty by our very own nature? 

With that comes diversification, it for sure will create angels, but also demons.

Perhaps that's inevitable. There are many other things we need to worry, like the Earth exhausting its resources, and even our sun dying. What if we can create whole worlds just for us? What if we can rule over the universal laws of creation?

The future is bright, hopefully not too bright.
Ever felt the pain of not mastering something immediately?
Tags: productivity, improvement, yougotthis, fridaythinking
Published: 2024-06-07 21:11:59

Sometimes, when we want to start a new project, or maybe learn a new skill or language, we get caught up in the minute details or even get frustrated when we don’t grasp something entirely right away. (Hello!)

We have to remind ourselves that these big leaps and huge jumps in improvement that might be visible on the outside come with a lot of long days and nights of practice, hard work, and repetition.

Embracing continuous improvement over seeking delayed perfection acknowledges the value of progress and iteration!

When you’re constantly striving for perfection, you can face prolonged timelines (and possibly burn out on the thing you were so excited to complete), while a commitment to continuous improvement fosters adaptability and allows you to learn through practical experiences! 

Remember, growth flourishes in the garden of ongoing development, not in the waiting room of flawless outcomes.

Happy Friday!
Creating a Resource Group in Microsoft Azure
Tags: azure, cloud
Published: 2024-06-07 21:11:57

# Creating a Resource Group in Microsoft Azure

In this tutorial, we'll walk through the steps of creating a Resource Group on Microsoft Azure, providing a structured approach to manage related applications within the Azure environment.

## Prerequisites

Before proceeding, ensure you have an active Azure account and have logged into the Azure portal.

## Step 1: Navigate to Resource Groups

- Click on the Search Bar located at the top of the Azure portal.

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

- Type "Resource Groups" and select the corresponding option from the dropdown menu. Alternatively, you can find "Resource Groups" under the Azure Services section.

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

## Step 2: Create a Resource Group

- Click on the "Create" button either under the Resource Group title or in the center of the screen.

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

## Step 3: Basics

- Choose your subscription tier.
- Define a name for your resource group.
- Select a region for deployment, ideally one closest to your location.

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

- Optionally, add tags to better organize and monitor your resources. For this demonstration, we'll skip this step.

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

- Click on "Review + Create" at the top.

## Step 4: Review and Create

- Wait for the validation process to complete.
- Once validation is successful, click the "Create" button at the bottom of the screen.

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

## Step 5: Navigate to the Resource Group

- After the Resource Group is successfully created, either click on the "Go To Resource" option in the pop-up menu or select the name of the Resource Group from the dropdown menu in the center of the screen.

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

Congratulations! You have successfully created a Resource Group using Microsoft Azure.

## Step 6: Clean Up

To avoid any unnecessary charges, follow these steps to delete the Resource Group:

- Click on the "Delete Resource Group" button located in the menu beside the local search bar.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4szaqpefzxa8y4rks4ug.jpg)

- Enter the name of your Resource Group at the bottom, or copy and paste it. Then click Delete.

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

- Click on the "Delete" button on the pop-up window to confirm deletion.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2eap41arhih958zmmhh.jpg)
HIRE A HACKER TO FIND AND RECOVER YOUR STOLEN BTC/ETH/USDT/NFT'S AND ALL TYPES OF DIGITAL ASSETS
Tags: webdev, tutorial, productivity, news
Published: 2024-06-07 21:09:45


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

HIRE A HACKER  TO FIND AND RECOVER YOUR STOLEN BTC/ETH/USDT/NFT'S AND ALL TYPES OF DIGITAL ASSETS 
Someone I met online scammed me out of approximately $367,000 on a fictitious investment proposal. After I started looking for legal assistance to get my money back, I found a number of testimonials about WEB GENIE RECOVERY on www.webgenierecovery.com. I contacted them with all the information I needed, and it took the specialists around 72 hours to find and assist with getting my money back. I am quite relieved, and I hope that this will assist many others who have fallen prey to these fraudulent internet investment con artists. I heartily urge using the expert services to help with a quick and effective recuperation. Please get in touch with them at webgenierecoverys@proton.me.
webgenierecovery@outlook.com
via WhatsApp (918) 809-0113 
Telegram: @WEBGENIERECOVERY
Understanding Functions in Python
Published: 2024-06-07 21:08:16

Functions are a fundamental building block in Python programming. They allow you to encapsulate code into reusable blocks, making your code more modular, maintainable, and easier to understand.

## **Types of Functions in Python**


**1. User-Defined Function**
A simple function defined by the user using the def keyword.

```
def greet(name):
    print(f"Hello, {name}!")

greet("John") # Hello John

```

**2. Built-in Functions**
Python comes with several built-in functions that are always available. For example, len() is a built-in function that returns the length of an object.

```
# Example usage of built-in function len()
my_list = [1, 2, 3, 4, 5]
print(len(my_list))  # Output: 5

```
More about built-in functions 

```
my_list = [1, 2, 3, 4, 5]
print(sum(my_list))  # Output: 15

my_list = [5, 2, 3, 1, 4]
print(sorted(my_list))  # Output: [1, 2, 3, 4, 5]

my_list = [1, 2, 3, 4, 5]
print(list(reversed(my_list)))  # Output: [5, 4, 3, 2, 1]
```
**3. Anonymous Functions (Lambda Functions)**
These are small, unnamed functions defined using the lambda keyword.

```
# A lambda function to add two numbers
add = lambda x, y: x + y

# Example usage
result = add(5, 3)
print(result)  # Output: 8
```

**4. Higher-order Functions**
These are functions that take other functions as arguments or return them as results. Examples include map(), filter(), and reduce().

```
numbers = [1, 2, 3, 4, 5]
squared_numbers = map(lambda x: x ** 2, numbers)

# Example usage
print(list(squared_numbers))  # Output: [1, 4, 9, 16, 25]

```

**5.Generator Functions**
These use the yield keyword to return an iterator.

```
def countdown(n):
    while n > 0:
        yield n
        n -= 1

# Example usage
for number in countdown(5):
    print(number)

```

**Conclusion**
Functions are a fundamental aspect of Python, allowing you to organize code into reusable blocks. Thus, understanding the various types of functions and their use cases can greatly improve your programming skills and code organization.
Now connect SQL with no-code as a data source
Tags: nocode, sql, postgres, mariadb
Published: 2024-06-07 21:04:50

Softr just introduced its integration with Relational databases which includes MySQL, PostgreSQL, SQL Server, and MariaDB.

Softr is a tool that lets you create apps without writing code. It can connect to different sources of data, such as spreadsheets or databases, and use that data to build custom apps.

Users can build sophisticated no-code apps using huge SQL databases and can scale indefinitely without hitting records limit

Here is the official blog containing announcement [Softr now integrates with SQL Databases](https://softrplatformsgmbh.partnerlinks.io/sqlblog)

{% embed https://www.youtube.com/watch?v=QVWGEgOS83o %}

SQL databases store complex data that usually requires advanced technical skills to access. But with Softr, you can easily connect to your SQL databases and build powerful apps that use that data, all with just a few clicks

You can also connect your SQL data source just sign up for a free plan of  Softr and give it a try [LINK ](https://softrplatformsgmbh.partnerlinks.io/homesoftr)
Less is More: Why You May Don't Always Need JavaScript in Your B2B Web Apps
Tags: b2b, javascript, nobuild, nojs
Published: 2024-06-07 20:52:01

---
title: Less is More: Why You May Don't Always Need JavaScript in Your B2B Web Apps
published: true
description: This blog post argues for reducing JavaScript usage in B2B web apps front-ends in favor of server-size rendering
tags: b2b, javascript, nobuild, nojs
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-06-06 14:00 +0000
---

In the bustling world of web development, JavaScript often takes center stage. Its versatility and power are undeniable, making it the go-to choice for adding interactivity and dynamism to applications. However, when it comes to developing B2B (Business-to-Business) applications, it's worth considering a different approach. Surprisingly, you might not always need to rely heavily on JavaScript. Here’s why.

#### Controlled Environments

B2B applications are typically used in controlled environments, such as office settings, where the hardware, software, and network conditions are relatively uniform and predictable. Unlike consumer-facing applications, where developers must account for a wide range of devices and varying internet speeds, B2B applications benefit from a stable and robust infrastructure. This consistency reduces the necessity for JavaScript-driven enhancements aimed at compensating for unpredictable user environments.

#### Simplified Development and Maintenance

JavaScript can add significant complexity to a web application, both in terms of development and maintenance. By minimizing the use of JavaScript, developers can focus more on user-facing features. In B2B applications, users typically prioritize functionality and reliability over flashy, interactive interfaces. The core features and workflows are what matter most. By focusing on delivering robust backend functionalities and ensuring that the application performs its primary tasks efficiently, you meet the essential needs of your users without unnecessary embellishments.

#### One size does not fit all

While JavaScript undoubtedly has its place in web development, it’s not always a necessity for B2B applications. Leveraging the strengths of modern web frameworks in a controlled, reliable environment can lead to simpler, more secure, and maintainable applications. By focusing on core functionalities and server-side rendering, you can deliver robust solutions that meet the specific needs of business users without the added complexity of extensive JavaScript. SPAs (Single Page Applications), for example, are fantastic, but they aren't the best solution for every situation. Traditional server-side rendering can still meet your your users' needs perfectly well. Sometimes, less truly is more.
#648. Replace Words
Published: 2024-06-07 20:16:32


https://leetcode.com/problems/replace-words/description/?envType=daily-question&envId=2024-06-07


```js

/**
 * @param {string[]} dictionary
 * @param {string} sentence
 * @return {string}
 */
var replaceWords = function(dictionary, sentence) {
    sentence = sentence.split(" ")

    for (let i = 0; i < sentence.length; i++) {
        for (let j = 0; j < dictionary.length; j++) {
            if (sentence[i].startsWith(dictionary[j])) {
                sentence[i] = dictionary[j]
            }
        }
    }

    return sentence.join(" ")
};

```
MY EXPERIENCE SO FAR AT WHITE CREATIVITY
Tags: webdev, beginners, programming
Published: 2024-06-07 20:30:40

**My Journey at White Creativity**

Starting as a web developer at White Creativity has been an exciting and educating experience. With a basic understanding of HTML and CSS, I quickly realized the depth of practical web development once I joined and started my practice 

**Learning the Basics**

In the beginning, I focused on mastering HTML's structural elements and the aesthetic power of CSS. Understanding the semantic importance of HTML tags.

I'm getting better as the day goes by, and while practicing it gives me a clear picture of things I can achieve with the knowledge I'm acquiring to me that motivates me the more and gives me more reason to work harder to learn more.


**Overcoming Challenges**

Challenges like debugging CSS and ensuring that it reflects in the browser as per what I programmed , sometimes it will take time for me to go through the code just to figure out why mine isn't working 

**Growth and Aspirations**

My skills in HTML and CSS have grown exponentially, and I've learned the importance of user experience, clean code, and continuous learning. I’m now eager to delve higher and become better in web development.

**Conclusion**

My journey at White Creativity has been one of growth and continuous learning. With the foundation I've built, I am excited to tackle new challenges and innovations in web development.
Computer Vision Meetup: Combining Hugging Face Transformer Models and Image Data with FiftyOne
Tags: computervision, machinelearning, datascience, ai
Published: 2024-06-07 20:29:02

Datasets and Models are the two pillars of modern machine learning, but connecting the two can be cumbersome and time-consuming. In this lightning talk, you will learn how the seamless integration between Hugging Face and FiftyOne simplifies this complexity, enabling more effective data-model co-development. By the end of the talk, you will be able to download and visualize datasets from the Hugging Face hub with FiftyOne, apply state-of-the-art transformer models directly to your data, and effortlessly share your datasets with others.

Speaker: [Jacob Marks](https://www.linkedin.com/in/jacob-marks/), PhD is a Machine Learning Engineer and Developer Evangelist at Voxel51, where he leads open source efforts in vector search, semantic search, and generative AI for the FiftyOne data-centric AI toolkit.
Prior to joining Voxel51, Jacob worked at Google X, Samsung Research, and Wolfram Research.

Not a Meetup member? Sign up to attend the next event:

https://voxel51.com/computer-vision-ai-meetups/

Recorded on May 30, 2024 at the AI, Machine Learning and Data Science Meetup.
Vengo AI - Create and monetize your AI identity with one line of code
Tags: ai, b2b, saas, marketplace
Published: 2024-06-07 20:24:54

Vengo AI is a cutting-edge B2B SaaS platform that democratizes AI creation, making it accessible for everyone, from influencers and brands to entrepreneurs and businesses. Our proprietary system allows users to effortlessly integrate sophisticated AI identities into their websites with just one line of code. By joining our innovative community, members unlock the potential to create, customize, and monetize their digital twins, significantly enhancing their digital presence and generating new passive income streams. Experience the future of AI with Vengo AI, where technology meets simplicity and profitability.

[https://vengoai.com](https://vengoai.com)
Introducing Comment Monk: Simple comment hosting system for static blogs and websites
Published: 2024-06-07 20:24:26

I wanted to implement a comment hosting system for my static blog <https://prahladyeri.github.io>, just basic Wordpress.org style commenting feature with user's name, website, etc., no complicated logins or sign-ups or third-party platforms. The user reads your blog, posts a comment, and you approve from the backend (or alternatively, it gets auto-approved and you get an email notification). As simple as that!

Since github pages doesn't provide any backend PHP scripting facility, I had to develop a whole backend app along with a frontend EMCA script which could be plugged into a `div` block at the end of a blog post, a space typically reserved for comments. [Comment-Monk](https://github.com/prahladyeri/comment-monk/) is the result of that effort. I have made this app open source and put it on github so that it can be used by as many folks as possible. To use this app for your own static blog, just download the repo and deploy it to a PHP web hosting service. It's a very light script with Sqlite backend, intentionally kept small enough to be deployed to one of those cheap (even free) PHP hosting facilities.

Once you start the app, it takes you to the Install page where you can register with your details and credentials using which you can login to the app and administer it as a super user. It also asks the website or domain of your blog where you'll host the commenting system.

![cm-login](https://prahladyeri.github.io/uploads/cm/cm-login.png?v=1)

Once you login and go to home page, you can see this screen where you can view and manage your comments. Right now, you can just view and delete your comments but more features are en-route in the upcoming versions. You can also set your user preferences from the "Actions" menu on the top right.

![cm-dashboard](https://prahladyeri.github.io/uploads/cm/cm-dashboard.png?v=1)

Most importantly, you can click on the "Client Snippet" button which will guide you to implement your frontend HTML code to embed the comments.

Once you do that, your static blog should look something like this:

![cm-client](https://prahladyeri.github.io/uploads/cm/cm-client.png)

At the place where you added the `script` tag, you should be able to see a ready comment block showing all existing comments along with a submit form to post one.

Your audience can read your content and be able to post a comment. The backend validates the URI (Uniform Resource Identifier) and if a registered domain is found, creates an entry for that comment which will be reflected in the administrator's (YOUR) dashboard. I think this is almost as simple as it could be!

The comments block has a very basic and bland look by default but you can customize it fully by editing the `/static/cm-client.css` on backend which is used for styling it.

I hope you will find this system useful for your static blog. If you face any issue, don't forget to raise it on the [github tracker](https://github.com/prahladyeri/comment-monk/). Happy Coding!