Discovering Primitive Objects In JavaScript (Part 1)

Original Source: https://smashingmagazine.com/2023/02/discovering-primitive-objects-javascript-part1/

It seems natural to use strings to distinguish things. It’s very likely that in your codebase, there are objects with name, id, or label properties that are used to determine if an object is the one you’re looking for.

if (element.label === “title”) {
make_bold(element);
}

At a certain point, your project grows (in size, importance, popularity, or all at once). It needs more strings as there are more things to distinguish from each other. The strings grow longer, as does the cost of typos or, say, your label naming convention changes. Now you have to find all the instances of those strings and replace them. Consequently, a commit for that change becomes much bigger than it should be. Which makes you look better in the eyes of the clueless. Simultaneously it makes your life miserable since it’s much harder now to find the cause of regression in your git history.

Strings are bad for identification. You have to consider uniqueness and typos; your editor or IDE won’t check if it’s the string you meant. It’s bad. I hear someone saying, “Just put them in a variable, duh.” That’s a good suggestion, and it removes some of my concerns. But look at John Smith:

const john_smith_a_person = “John Smith”;
const john_smith_a_company = “John Smith”;

// Do they have the same name?
john_smith_a_person === john_smith_a_company; // true

// Are they the same thing?
john_smith_a_person === john_smith_a_company; // true

John happens to share the name with a company. What if I say to you I have a better solution? The one that removes all the concerns and adds more value — allows you to achieve more. What would you say? Well, I won’t rewrite the article just because your answer doesn’t fit my narrative. The answer is objects. You use objects themselves to figure out if an object is the one you’re looking for.

// Do they have a same name?
john_smith_a_person.name === john_smith_a_company.name; // true

// Are they the same thing?
john_smith_a_person === john_smith_a_company; // false

It makes the intent clearer. Let me give you a better example. Say you have labels in your app. They are localized, so the label string is determined by the localization library you’re using and your team’s translation process. You keep your labels in a module where you have them all neatly organized and curated. Once you need to do something special for certain labels, you can compare it directly with the one you’ve got.

import React from “react”;
import labels from “./labels.js”;

const render_label(label) => (
<Label
className={label === labels.title ? “bold” : “plain”}
icon={label.icon}
text={label.text}
/>
)

function TableOfContents({ items }) {
return (
<ul className=”my-menu”>
{items.map(render_label(item.label)}
</ul>
);
}

See how much more I can do with objects? In the labels module, I’ve set aside a label title, which in this case should be rendered bold. Plus, being an object, my label can hold a localization string (imaginatively called text) and an icon. It’s all neatly organized in advance, which keeps my UI logic clean.

But it’s just a part of the picture. I know we use objects all over the place, and it’s nothing new to group things in them. But I bet you don’t use them exactly like that. I rarely see two objects being compared like that because you never know what’s in there or where it came from. Objects are created and changed all the time. It is more likely for them to be compared by the values of their properties than the objects themselves. And the reason for that is that objects aren’t suitable for that kind of use. They are too capable. To allow that use case and many others, we have to, on the one hand, reduce some capabilities of objects and, on the other, implement some more. And in the end, we’ll get what I call Primitive Objects. Th… a solution to al… some problems.

In the first part of the series, I want to cover some aspects of JavaScript that help bring objects closer to primitive values, which in return would allow us to benefit from common language features that aren’t usually associated with an object, like comparisons and arithmetic operators. In the following part, we’ll look closely into practical examples and tools to work with such objects. Now let’s see what objects are like in JavaScript.

Properties Of Primitive Values We Need

First, let’s define our goal. Let’s draw a picture of where we would like to be afterward. What properties of primitive values do we want our objects to have?

Immutability
Primitive values are read-only. We want our objects not to be editable by anybody after their creation. Recall the example before. What use of a label do we have if some code out of our control has changed the text or icon of it? Once the object is defined, it should be set in stone.
Work with operators.
Expressions with certain operators return their appropriate type. Arithmetic operators give numbers back. Comparisons give booleans.
Have literal syntax.
Literals for primitives give you the exact value, or rather an object representing the value. Such objects get created once for each value. Each time you have “hello” in your code, you get the same object.
Have types.
The typeof operator tells you what you’re dealing with (except for null). We don’t always know which kind of object we get. So before we poke its properties, it would be nice to know what we’re dealing with.

I listed them by immediate usefulness. And as luck would have it, they are also ordered by easiest to get. In this article, I’ll cover the first one and a part of the second one. We’ll see how to make objects immutable. We also will define their representation in primitive values, which allows us to use some operators on them. Moving from objects to primitive values is easy, as primitive values are objects themselves — sort of.

It’s Objects All the Way Down, Even If It Kinda Isn’t

I remember my confusion when I first saw {} === {}; // false. What is this language that cannot even tell apart two equal things? It felt so ridiculous and amusing. It was much later that I learnt that there are much worse parts in JavaScript, after which I stopped laughing while watching wat talk.

An object is one of the fundamental things in JavaScript. You might have heard that in JavaScript, everything is an object. That’s quite true. Apart from some bottom values, all the primitives are objects. While technically, it is more nuanced, from the perspective of our code, it is true. In fact, it’s true enough that believing everything is an object might be a useful mental model. But let’s first try to understand what is happening with that object-to-object comparison that was so amusing to younger me.

Object literal syntax is used for creating new objects. It allows us to declare and initiate an object in a single expression.

// Instead of this.
const my_object = new Object();
my_object.first_property = “First property”;
my_object.nth_property = “Next property”;

// You can do this.
const my_object = {
first_property: “First property”,
nth_property: “Next property”
};

Much cleaner, right? But now I think the lack of object initialization line is what got me confused about those two empty object equality expressions. It seemed to show the language’s struggle to recognize apparent equality. But what actually happens in that expression is this:

new Object() === new Object(); // false

Now it’s obvious they aren’t equal. You’re comparing two distinct objects you’ve just created. To expect contrary is the same as expecting 5 === 3 to return true. In both cases, they are different things.

Let’s do a sanity check. Would two variables referring to the same object be considered equal?

const my_object = {};
const other_thing = my_object;
my_object === other_thing; // true

In this case, only the first line has an expression that creates an object. On the second line, we make the other_thing variable refer to a just-created object. Two variables are now referring to the same object. Comparing them is just like comparing two equal numbers, isn’t it?

Why is this significant? Because it gives us a way to check if a variable refers to an object we’re looking for. And if we think about it in the context of “everything is an object,” that’s how numbers and strings work. When you compare two variables holding strings, the engine doesn’t have to check if each character in those strings is the same. It’s enough to compare if the variables refer to the same object. That is thanks to the most significant difference between regular objects and primitive values — immutability.

How To Bring Regular Objects Closer To Primitive Values

In JavaScript, Primitive values are immutable. You cannot change a single character in a string as well as you cannot make a number five to become six. If you use const to initialize a variable and put a primitive value in it, it’ll always stay the same. No one could change the value; it’s immutable. No one could reassign the variable; it was created with const.

Let’s look closely at how numbers work. You can get six out of five by incrementing it by one, but it doesn’t change anything about five.

const five = 5;
const six = 5 + 1;
five === 5; // true

Some might say that using let would change that. But look, it cannot change five:

const five = 5;
let result = 5;
result++;
result === 6; // true
five === 5; // true

A five is still a five. That is because ++ is just a shorthand for += 1. See the equals sign? What happened was I assigned a new value to the result variable, the value that I got from the result + 1 expression (which is what += 1 is a shorthand for). The const keyword prevents reassignment to a variable. In the example above, that’s what gives me a way to know that five always refers to a 5 object.

We might assume that the only way primitive values are changed in JavaScript is through the assignment, which means what we’re actually changing is what a variable refers to. So it’s variables that are changing, not values. Not primitive ones, at least. But how it works with objects instead?

After initializing an object, you can change its properties: delete them, add new ones, and reassign old ones. We are all familiar with doing that. But apart from that, it behaves the same as primitive values. In fact, if you get accustomed to a model where objects and primitive values are the same things, you’ll look differently at all sorts of problems in JavaScript.

You probably stumbled upon a question about how variables are passed to a function. People ask whether variables are passed by value or by reference. A common answer is primitive values are passed by value while objects are passed by reference. But with the mental model I’m forcing on you here, you might already know what I will say about that. Before that, let me show you how the question doesn’t make much sense in JavaScript. I will also reveal to you a sleight of hand that many articles and tutorials use.

When you pass variables as parameters of a function call, they get assigned to the function’s arguments. Arguments are local variables to a function’s scope and have no connection back to the original variables, which makes sense. If you pass an expression to a function, you have to put the result of it somewhere, don’t you?

Look at the following two functions. They do the same thing, pass a value through, but one is defined with a single parameter, the other with none. The second one demonstrates what is happening with the parameter we passed in.

function single(arg) {
return arg;
}

function none() {

// The first parameter is assigned to a variable `arg`.
// Notice the `let`; it will be significant later.
let arg = arguments[0];

return arg;
}

single(“hi”); // “hi”
none(5); // 5

You see that they both work the same. Keeping in mind how function arguments work, let’s try changing some values. We’ll have a function that changes its only argument and returns it. I also will create some variables that I’ll pass to the function one by one. Try to predict what would be printed in the console. (Answer is in the second sentence of the next paragraph.)

function reassign(arg) {
arg = “OMG”;
}

const unreassignable = “What”;
let reassignable = “is”;
let non_primitive = { val: “happening” };

reassign(unreassignable);
reassign(reassignable);
reassign(non_primitive);

console.log(unreassignable, reassignable, non_primitive.val, “😱”);

Did your guess has any “OMG” in it? It shouldn’t have, as the console will show “What is happening 😱.” No matter what gets passed to a function in JavaScript, reassigning changes only the argument variable. So, neither const nor let change anything here because the function doesn’t get the variable itself. But what happens if we try changing the properties of an argument?

I created another function that tries to change the val property of its argument. See if you can guess the message in the console this time.

function change_val_prop(arg) {
try {
arg.val = “OMG”;
} catch (ignore) {}
}

const a_string = “What”;
const a_number = 15;
const non_primitive = { val: “happening” };
const non_primitive_read_only = Object.freeze({ my_string: “here” });

change_val_prop(a_string);
change_val_prop(a_number);
change_val_prop(non_primitive);
change_val_prop(non_primitive_read_only);

console.log(
a_string.val,
a_number.val,
non_primitive.val,
non_primitive_read_only.val,
“😱”
);

Is there any “OMG” in your guess now? Great, the message is “undefined undefined OMG undefined 😱.” The only time the function could change the property is with a common object. What does it tell us? Is there any difference between how primitive values are passed and how objects are? Is it that passing frozen object suddenly changes it to pass-by-value? I think it’s more useful to treat them as equals.

Now about that sleight of hand I mentioned. Practically all the resources do that thing where they say that primitives and objects are passed differently, then immediately follow it with an example where they treat them differently. Look at function description in MDN. By the time of this writing, it described it like this (emphasis mine):

Arguments may be passed by value (in the case of primitive values) or by reference (in the case of objects). This means that if a function reassigns a primitive type parameter, the value won’t change outside the function. In the case of an object type parameter, if its properties are mutated, the change will impact outside of the function.

I just showed you the reassigning wouldn’t change the object either. You cannot change primitives’ properties because they are read-only, which is also the case for frozen objects. And most of the examples you’ll find do the same thing. They first state the difference between two values, then demonstrate it using different methods for each value.

I’m not trying to criticize, don’t get me wrong. It probably was done because it explains JavaScript quirks in a more familiar way. Just be aware that sometimes an explanation gives you a model of thinking about a problem. But the model is never completely true to the nature of a problem.

Looking at this issue from the perspective of primitives being just like frozen objects helps you to recognize what actually happens. Alternative tutorials become illogical. And now, having discovered this notion of a primitive object that no one could change, let us make them more friendly for the rest of your program.

Converting

Primitive values stand on their own; any program knows how to handle them. Objects could be anything. And even if you call them primitive, it’s not enough for them to suddenly become first-class citizens. To achieve some of that, we need to do some work.

You can define a way to convert objects into primitive values such as strings or numbers. For example, let’s create an object representing a rating from zero to five. We need to be able to work with numeric representation for comparison and sorting. We also need to be able to output it in text.

There are certain methods that you could define to describe your object’s representation. Remember [object Object]? It’s what you get when you try to turn your object into a string:

String({}); // “[object Object]”

Let’s change that.

String Representation

That output comes from the default toString method defined in the Object prototype. But you could overwrite it by defining it on your own object.

String({ toString: () => “hello there” }); // “hello there”

That’s what we will use for our rating objects. To make it convenient, let’s create a function that initializes and freezes such objects. It will also check if the value is within the zero to five range and return undefined otherwise.

function new_rating(value) {
const max = 5;

// That symbol forces textual representation (who needs emoji anyway 🙄).
const text_only = “ufe0e”;

const star = “⭑” + text_only;
const no_star = “⭐” + text_only;

if (
!Number.isSafeInteger(value) ||
(value < 0 || value > max)
) {
return undefined;
}

return Object.freeze({
value,
toString: () => star.repeat(value) + no_star.repeat(max – value)
});
}

Now let’s rate something. There is a pen I like. It’s pretty great, and I’d give it five stars.

const ratings = new WeakMap();
ratings.set(jetstream_pen, new_rating(5));

This WeakMap for ratings is how you could assign properties to objects without actually changing them. Now, whenever we want to have a rating, we can convert both of our objects to strings.

if (ratings.has(jetstream_pen)) {
console.log(`${jetstream_pen} ${ratings.get(jetstream_pen)}`);
// “Uni-Ball Jetstream 0.5 ⭑︎⭑︎⭑︎⭑︎⭑︎”
}

Wrapping both objects in string template literal is what I relied on here to trigger the toString method. Otherwise, you could just call the String function on them, as I did at the beginning of this section.

For Numberphiles

For numbers, there’s the valueOf method, which is called whenever there’s an attempt to convert to number comparisons or math operators (except for +). Let’s add it to our new_rating function:

function new_rating(value) {
// …

return Object.freeze({
value,
toValue: () => value,
toString: () => star.repeat(value) + no_star.repeat(max – value)
});
}

Now it might seem redundant to return the value property directly. But remember that no one but us knows that it’s there. Returning it from toValue is a universal way to get a numeric representation.

Let’s say we have our pen object again. And let’s say the rating is now its property (just to simplify the example). We can now filter out items with less than four stars:

articles.filter((item) => item.rating > 3);
// [ { name: “Uni-Ball Jetstream 0.5”, … } ]

Similarly, we can sort items by rating. We can do that using the Arrays’ sort method. You probably already have your favorite little sorting function that you’d like to use, like this one:

function sorter(first, second) {
return second.rating – first.rating;
}

const sorted_by_rating = array_of.sort(sorter);

Now, sorted_by_rating holds an array of the very best items.

Conclusion

I rarely looked at objects as something that could extend what could be expressed in JavaScript. With primitive objects, that’s what I’m trying to explore. There are still things we cannot add, like new operators or literal syntax, but still, with primitive objects, we could define new types of values.

In this first part of the Primitive Objects series, I tried to give an overview of how to make objects resemble some primitives properties. You freeze them to make them read-only. You also can define a representation in primitives, either number or string, to make it work with arithmetic operators or output them in text.

In the next parts coming up next week, I aim to give more examples of usage and comparison with other approaches I’ve encountered. You will see how to make it easier to create primitive objects and turn them into structures.

In this series, I’m trying to touch on JavaScript features that can be relied on. Even if not all of it makes sense, I hope that by looking at some of the examples I gave here, you’ll learn something useful that would make working with JavaScript less brittle without unnecessarily turning to additional tools.

10 Most Useful ChatGPT Tools So Far

Original Source: https://www.hongkiat.com/blog/chatgpt-tools/

The popularity of AI-powered GTP technology has been on the rise in recent years. It has transformed the way we interact with computers and have made it possible to achieve tasks faster and in more efficient and natural ways.

In this article, we will be showcasing 10 of the most powerful resources built on top of ChatGPT and GPT-3 based AI model, making it easier for you to take advantage of their full potential. So, if you’re looking to leverage AI technology in your life or work, this article is a must-read. Let’s begin.

1. ChatGPT Desktop

The ChatGPT Desktop is a multi-platform solution available on macOS, Linux, and Windows. You can use ChatGPT in your desktop and export your conversation history in PNG, PDF, and Markdown formats.

The app offers common shortcut keys and integrates with awesome-chatgpt-prompts for easy import of prompts which can be synced with one click and disabled if needed.

ChatGPT DesktopChatGPT Desktop
2. ChatGTP Everywhere

A Google Chrome extension for instant access to ChatGPT. With this extension, you can quickly gather information while using Google search. It also includes a sidebar that can be easily accessed with just one click, providing full access to the capabilities of ChatGPT’s language model anywhere the web.

ChatGTP EverywhereChatGTP Everywhere
3. ChatGPT for Gmail

A Chrome extension to help you deal with emails productively whether composing or answering the email. With the ability to complete the email subject, fix typos and provide an accessible button to activate the completion process, this extension makes email writing more efficient. Plus, the feature can be enabled or disabled at any time.

ChatGPT for GmailChatGPT for Gmail
4. AI Engine

A WordPress plugin that allows you to add a ChatGPT-style chatbot to your website with a simple shortcode. You can generate fresh content, doing translations, corrections and find suggestions in its AI Playground.

The plugin also provides quick title and excerpt suggestions, tracks your OpenAI usage with built-in statistics, and has an internal API for other plugins to tap and integrate into the plugin.

AI EngineAI Engine
5. AI Post Generator

Another AI-powered WordPress plugin that helps you with creating high-quality content for your website. The plugin is powered by OpenAI’s GPT-3 language model and supports multiple languages, automatically detecting the language of the title and generating content in the same language.

What makes it cool is that it can find high-quality images for your post that go with the topic or theme of the writing.

AI Post GeneratorAI Post Generator
6. GPT3 WordPress Post Generator

This script generates a WordPress post by utilizing the OpenAI GPT-3 API and the OpenAI Python library for API calls, and the WordPress XML-RPC library for post creation. You can control the length of content, topic, and even tone (e.g., funny, serious, formal) for the generated post.

GPT3 WordPress Post GeneratorGPT3 WordPress Post Generator
7. ChatGPT for Google

This browser extension integrates ChatGPT into popular search engines including Google, Baidu, Bing, DuckDuckGo, Brave, Yahoo, and Naver to display ChatGPT responses alongside the search results.

It features Markdown rendering, code highlighting, dark mode, copying to the clipboard, and language switching. All in all, this extension will enhance your search engine experience.

hatGPT for GooglehatGPT for Google
8. ChatGPT VSCode

A Visual Studio Code extension integrates ChatGPT API. It allows you to ask natural language questions and get answers from OpenAI’s ChatGPT directly in the editor. It provides a user-friendly input box in the sidebar to ask questions, a panel to view responses, and the ability to follow up with additional questions while maintaining conversation context.

Additionally, code snippets from the AI’s response can be inserted into the active editor with a click.

ChatGPT VSCodeChatGPT VSCode
9. ChatGPT macOS

A simple macOS application that integrates ChatGPT API into the menubar. It allows you to access it quickly with the Cmd+Shift+G shortcut from anywhere.

There’s no Windows version is currently available, but it can be run on Windows by cloning the repository, installing electron-forge, and running the build a command. In Windows, you can access it with the Ctrl+Shift+G shortcut.

ChatGPT macOSChatGPT macOS
10. ChatGPT for JetBrains

Aa plugin for JetBrains IDEs series that allows for integration with ChatGPT. It adds a section within the IDE where you can input prompts and view ChatGPT’s responses, providing a convenient assistant for code development.

ChatGPT for JetBrainsChatGPT for JetBrains

The post 10 Most Useful ChatGPT Tools So Far appeared first on Hongkiat.

Quick Tip: How to Disable Text Selection Highlighting in CSS

Original Source: https://1stwebdesigner.com/quick-tip-how-to-disable-text-selection-highlighting-in-css/

There are two main CSS properties that control text selection highlighting: user-select and -webkit-user-select. These properties are used to specify whether or not users are able to select text on the web page.

UNLIMITED DOWNLOADS: Email, admin, landing page & website templates
Starting at only $16.50 per month!

DOWNLOAD NOW

To disable text selection highlighting in CSS, you can set the value of the user-select property to none:

body {
-webkit-user-select: none; /* for Safari */
-moz-user-select: none; /* for Firefox */
-ms-user-select: none; /* for Internet Explorer */
user-select: none; /* for modern browsers */
}

In this example, the user-select property is applied to the body element, which means that text selection highlighting will be disabled for the entire page. If you want to disable text selection highlighting for a specific element, simply apply the property to that element instead of the body element.

It’s important to note that the -webkit-user-select and -moz-user-select properties are vendor-specific extensions, and are used to ensure compatibility with Safari and Firefox, respectively. The -ms-user-select property is used for compatibility with Internet Explorer. The standard user-select property should work in all modern browsers.

Nintendo Direct Live Blog: the biggest Switch news as it happens

Original Source: https://www.creativebloq.com/news/live/nintendo-direct-live-blog-2023

The 40-minute Nintendo Direct start time and how watch. Will we see Zelda, Metroid and Switch Pro?

Landing Your Dream Job with Lensa in Graphic Design

Original Source: https://designrfix.com/graphic-design/landing-your-dream-job-with-lensa

Landing your dream job in graphic design requires more than just a creative eye and technical skills. You need to have the right skills, an online presence, and a portfolio that demonstrates your abilities. In this article, we will discuss how to make yourself a more attractive candidate for a graphic design position by honing […]

Top 22 Python Books for Beginners and Advanced Coders

Original Source: https://www.sitepoint.com/best-python-books/?utm_source=rss

Top 22 Python Book for Beginners and Advanced Coders

All the books you need to get started with Python or improve your programming knowledge are included in this extensive list.

Continue reading
Top 22 Python Books for Beginners and Advanced Coders
on SitePoint.

How to Recover Deleted Videos on Windows 10/11

Original Source: https://www.hongkiat.com/blog/recover-deleted-videos-windows/

Accidentally deleting files or videos on your computer can be a very frustrating experience, especially if they are of importance. However, not all are lost.

The good news is that – there’s a high chance they are recoverable. And in this post, I will cover several methods to recover deleted videos with native Windows tools, as well as a 3rd-party file recovery tool.

First, Try This…

Whenever the delete command is executed, the file is moved from its current location to the Recycle Bin. That means, technically, the file is still recoverable until you clear the Recycle Bin.

To recover the deleted file, go to the respective folder where the file was, right-click and select “Undo Delete”.

This will bring the file back to its origin from Recycle Bin.

undo deleteundo delete
Recover with Window’s Backup and Restore

You can also restore deleted files from a backup created with the Window’s Backup and Restore feature.

Instructions:

Connect to the external storage device of your backup files.
In the search box, type “Control Panel” then hit Enter.
Search for the deleted files in the result and select “Backup and Restore”.
Select another backup to restore files from, select the location of your external storage device, and follow the on-screen instructions to restore your files.

For Windows 7 users, click here for the guide to recovering your deleted files.

Recover with Window’s File History

File History in Windows 10, and 11 automatically creates an additional copy of your files. However, for this to work, it must first be turned on.

Step 1: Turn on File History

Press Win + R to launch the Run command box.
Type in FileHistory and hit Enter.
Connect your Windows to an external storage device.
Click “Turn On” to enable File History.

Step 2: Recover deleted files using File History

Type restore files in the search box of the taskbar.
Select “Restore your files with File History”.
Look for the file you want to recover, then select “Restore”.

Recover Using a Third-party Software

If all else fails, then your last resort would be to recover with the help of a third-party application.

There are a plethora of data recovery tools out there, but in this post, I will focus on one of them – Tenorshare 4DDiG, and I will provide a walkthrough of how to get it done with the said application.

4DDiG app4DDiG app
4DDiG – In a Nutshell

Created by Tenorshare, 4DDiG is capable of recovering deleted files or files lost caused by local disk error or a computer crash.

Some of its other features include the following:

Supports recovery of various file types, including video, picture, audio, etc.
Supports recovery of deleted videos from internal and external drives, PC or Mac, USB flash drives, SD cards, and other devices.
Works on Windows 7,8,10 and 11.
No malicious pop-ups and ads.

Recovering Deleted Video Files with 4DDiG

Step 1:

Download and install 4DDiG on your Windows. Upon installation, the app will start recognizing the missing partition so that you can choose it as the target for the scan.

Note: You can also choose a specific target file type before scanning begins.

step 1step 1

Step 2:

When it detects that a video file has been erased, 4DDiG will instantly search the local disk and any lost partitions in the surrounding area for the file.

Note: You can suspend or cancel the search at any time.

step 2step 2

Step 3:

When the app identifies the video as having been erased, and you decide to recover it, just store it in a safe location on your local device.

step 3step 3
Bonus: Recover Deleted and Damaged Videos

Additionally, the 4DDiG app can also restore video files that have been damaged, broken, or otherwise rendered unplayable.

Go to Advanced Recovery on the sidebar.
Click “Click to add videos” and import the video you want to repair, then click “Repair”.
Finally, select the path you want the fixed video to be saved to, then click “Export”.

How to Prevent Video Loss on Your Computer?

Video loss is a common problem, especially among video content creators. While most of the time, it can be prevented by being more cautious about what you are deleting or removing from your system, errors caused by a hardware failure, on the other side, are harder to prevent.

Here are a few ways to keep video lost at bay:

1. Keep a Few Copies of Your Videos

It makes sense to keep an extra copy (or two) of the video file and all its assets. Keep a copy in your local computer if your hard drive’s capacity allows, then keep another copy in external hard drives or a Network-attached Storage (NAS).

2. Use Reliable Video Editing Software

Crashes could lead to loss of video, and it often happens during the editing process. Hence, it’s important to use reputable software when it comes to editing your videos. This will reduce the risk of loss and corruption.

3. Save Working File Regularly

Not all video editing software comes with an auto-save feature. Make it a habit to manually save the working file as regularly as you can to minimize any loss shall a software crash happen.

Summary

So the main takeaway from this is – prevention is definitely better than cure. Making sure your system’s health is in good condition and keeping a good habit of saving the working file regularly will drastically reduce the list of video loss.

If you’ve accidentally deleted a video file, do check inside the Recycle Bin first. If you are lucky, you might still find it there. But if it’s not, try taking advantage of windows’ System Restore or File History.

But if all else fails, invest in a 3rd-party file recovery app for peace of mind.

The post How to Recover Deleted Videos on Windows 10/11 appeared first on Hongkiat.

Illustration inspired by travels, books and people, who can make our life amazing and colorful

Original Source: https://abduzeedo.com/illustration-inspired-travels-books-and-people-who-can-make-our-life-amazing-and-colorful

Illustration inspired by travels, books and people, who can make our life amazing and colorful
Illustration inspired by travels, books and people, who can make our life amazing and colorful

abduzeedo0202—23

Irene Neyman is a self-taught illustrator & graphic designer from Ukraine, who creates a strong visual and emotional connection between brand, design, and audience. Irene is now based in Canada and for the last 4 years, she has been working on projects all over the world. 

She specializes in, but not limited to, illustrations & designs for editorial, apps, websites, brands, publications, character design and so much more. Her illustration style is about a balance of bright colors, simple shapes and meanings, and experiments with textures and details playing on them. Irene works with all mediums, digital & print, coming up with unique and suitable solutions.

“I truly believe that being open to new challenges in a fast-changing world is a crucial skill for a designer, so I mix it with my endless thirst for knowledge and new things.”

Irene decided to connect her life with a career in art because she has been immersed in illustrating since she was a kid. Her path in illustration & design began more than 4 years ago when she decided to completely change the course of her life journey. 

“I’m largely inspired by travels, books and people, who can make our life amazing and colorful.”

You can find more of Irene’s works on her website and Instagram page. 

UX Podcasts For Designers

Original Source: https://smashingmagazine.com/2023/02/podcasts-ux-designers/

What UX podcasts are you listening to? Below you’ll find a few wonderful UX podcasts we came across, as well as podcasts that the UX community shared with us.

Whether you’re particularly interested in user research, are looking for advice to navigate a career in UX, or want to better understand how the human brain works, the podcasts in this collection cover every possible aspect of UX. Not all of them are still running, but the archives are incredible, with interviews full of insights and gems.

A huge thank-you to the hosts — and, of course, the people behind the scenes — for producing these podcasts and helping us all make sense of the multifaceted, exciting world that UX is.

So, prepare yourself a nice cup of coffee and get cozy — oh, and don’t forget to charge your headphones before your next commute. Happy listening!

Table Of Contents

You can jump directly to the topic you’re interested in to find podcasts relevant to you or browse through the complete list.

accessibility
best practices
business
career and leadership
content strategy
creative culture
design
design systems
diversity
future of UX
hacking
human behavior
human-centered design
information systems
product design
UI
usability
UX systems
user research
workflow

UX Tips And Best Practices
UX Cake

UX Cake helps you become more effective in your UX work and career. In each episode, host Leigh Allen-Arredondo invites leaders in the field of UX to share their practical advice to get the best outcomes for your work, your users, and your career in UX.

🎙 Hosted by Leigh Allen-Arredondo
🗓 New episodes weekly

The NN/g UX Podcast

In the Nielsen Norman Group UX Podcast, Senior User Experience Specialist Therese Fessenden interviews industry experts, covering common questions, hot takes on pressing UX topics, and tips for building truly great user experiences.

🎙 Hosted by Therese Fessenden
🗓 New episodes monthly

User Defenders

Helping you to better fight for your users and business is the mission of the User Defenders podcast. In every episode, influential UX superheros share their stories, reveal their design superpowers, and offer their advice.

🎙 Hosted by Jason Ogle
🗓 Currently paused

24 Minutes Of UX

Every 24 Minutes of UX episode features a curious “Seeker” who is seeking advice in a specific topic within the domain of UX and an experienced “Giver” who shares the knowledge they gathered around the topic over the years.

🎙 Hosted by Jesse Anton and Peter Horvath
🗓 Retired

Boagworld Show

The Boagworld Show was the first web design podcast and ran from 2005 to 2021, interviewing the leading minds in the field and sharing best practices in digital. The archive is a treasure chest for any UX professional.

🎙 Hosted by Paul Boag
🗓 Retired

User Research
Awkward Silences

Awkward Silences interviews the people who interview people. The podcast dives deep into all things UX research, qualitative data, and the craft of understanding people to build better products and businesses.

🎙 Hosted by Erin May and JH Forster
🗓 Ca. two to three new episodes per month

UX Research Geeks

UX Research Geeks is all about User Experience Design, research, and everything that goes along with it. Among the guests are senior researchers, designers, speakers, CEOs, startup founders, and many more.

🎙 Hosted by Tina Ličková
🗓 Ongoing

Human Behavior
Hidden Brain

In Hidden Brain, Shankar Vedantam uses science and storytelling to reveal the unconscious patterns that drive human behavior, shape our choices, and direct our relationships.

🎙 Hosted by Shankar Vedantam
🗓 New episodes weekly

The Cognitive Bias

Clear language, the value of discomfort, and the psychology of money are just a few of the topics that The Cognitive Bias covers. It explores the world of things we do that don’t make any rational sense, one bias at a time.

🎙 Hosted by David Dylan Thomas
🗓 Retired

Human-Centered Design
This Is HCD — Human-Centered Design Podcast

The mission of the Human Centered Design Podcast is to educate and empower people and organizations about the power of true human-centered design. It brings together thought leaders from various disciplines such as service design, user experience, interaction design, and product management to better understand what it means to work within a human-centric method.

🎙 Hosted by This is HCD
🗓 Several episodes per month

Usability
UXpod

UXpod offers a free-ranging set of discussions around UX design, website design, and usability in general. The podcast retired last year, but there is an incredible archive with more than 120 episodes and even transcripts.

🎙 Hosted by Gerry Gaffney
🗓 Retired

Accessibility
A11y Rules

There is a lot of information about making the web accessible, but not so much information about the people working to make the web accessible. A11y Podcast is here to change that by inviting people involved with web accessibility.

🎙 Hosted by Nicolas Steenhout
🗓 New episodes weekly

UI
UI Breakfast Podcast

In the UI Breakfast Podcast, Jane Portman invites industry experts to share actionable knowledge. The topics cover UI/UX design, products, marketing, and more.

🎙 Hosted by Jane Portman
🗓 New episodes weekly

UX Systems
The Object-Oriented UX Podcast

The Object-Oriented UX Podcast is a deep-dive into the weeds of UX systems, information architecture, human psychology, data wrangling, structured content, UX process, and, above all, simplifying the complex.

🎙 Hosted by Sophia V. Prater
🗓 Currently paused

Content Strategy
The Content Strategy Podcast

The Content Strategy Podcast is a show for people who care about all things content. Kristina Halvorson interviews expert leaders and exciting new voices in the field of content strategy, diving deep into topics that inform how we shape digital content and how it, in turn, shapes us.

🎙 Hosted by Kristina Halvorson
🗓 Ongoing

Writers In Tech

Brought to you by the UX Writing Hub, Writers in Tech is a podcast where content strategists, UX writers, and content designers share their well-kept industry secrets.

🎙 Hosted by Yuval Keshtcher
🗓 Ca. two new episodes per month

Content Rookie

You want to dive deeper into the practice and art of all things content? Then tune into Content Rookie, where Nicole Michaelis and her guests explore UX writing, content marketing, content design, and copywriting.

🎙 Hosted by Nicole Michaelis
🗓 New episodes monthly

Design Systems
Design System Office Hours

In Design System Office Hours, design system practitioners Davy Fung and PJ Onori talk about design-led product ownership, scaling and adoption, community and engagement, design system team models, and much more.

🎙 Hosted by Davy Fung and PJ Onori
🗓 Ca. two to three new episodes per month

Design Systems Podcast

The Design Systems Podcast interviews industry leaders and product makers to share best practices and explore the areas where design and development come together.

🎙 Hosted by Chris Strahl
🗓 New episodes ca. once to twice a month

Information Systems
The Informed Life

Information is key to deciding and acting. The Informed Life podcast explores how people organize information to get things done and how to better design, build, and use information systems.

🎙 Hosted by Jorge Arango
🗓 New episodes biweekly

Product Design
How I Built This

For How I Built This, Guy Raz interviews the world’s best-known entrepreneurs to learn how they built their iconic brands. They reveal their moments of doubt and failure and share insights on their eventual success.

🎙 Hosted by Guy Raz
🗓 New episodes on Mondays and Thursdays

The Product Design Podcast

The Product Design Podcast invites the best and brightest in product design to dig into how they got where they are today, what mistakes they made along the way, and what advice they have for you as you navigate the world of product design.

🎙 Hosted by Seth Coelen
🗓 Ca. two to three new episodes per month

Better Product

Better Product shares the stories of industry-leading companies whose products have a soul, mission, and vision. Through conversations with CEOs, entrepreneurs, and innovators, hosts Christian Beck and Meghan Pfeifer explore what it takes to build better products.

🎙 Hosted by Christian Beck and Meghan Pfeifer
🗓 Currently paused

New Layer

New Layer is a podcast on everything related to product design, discussing design careers, tools, education, critique, and much more. The podcast has retired, but with two years of weekly episodes, the archive is still a treasure chest.

🎙 Hosted by Tanner Christensen and Jasmine Friedl
🗓 Retired

Workflow
Design Better Podcast

Currently in its seventh season, the Design Better Podcast by InVision explores what it takes to make work more collaborative, creative, inclusive, and impactful throughout your organization.

🎙 Hosted by Aarron Walter and Elijah Woolery
🗓 Ongoing

Business
The Futur Podcast

The Futur Podcast explores the overlap between design, marketing, and business. In each episode, Chris Do invites a new guest from the worlds of design, technology, marketing, business, philosophy, and personal development to understand what drives them and what we all can learn from it.

🎙 Hosted by Chris Do
🗓 New episodes weekly

Career And Leadership
Honest UX Talks

Anfisa Bogomolova and Ioana Teleanu together have 20 years of experience in the UX field. In Honest UX Talks, they share their lessons learned about UX design careers, challenges, portfolios, mental health, and, of course, all things UX.

🎙 Hosted by Anfisa Bogomolova and Ioana Teleanu
🗓 New episodes weekly

The UX Hustle Podcast

The UX Hustle Podcast is a show with a focus on crafting and navigating a UX career and refining your UX process to become better at what you do. It also explores how to apply UX to your life to get more done, with low stress.

🎙 Hosted by Amanda Worthington
🗓 Ongoing

Finding Our Way

In Finding Our Way, hosts Peter Merholz and Jesse James Garrett navigate the challenges and opportunities of design and design leadership.

🎙 Hosted by Peter Merholz and Jesse James Garrett
🗓 Ongoing

Google Design Podcasts

Google Design Podcasts is a collection of podcasts that gives you design inspiration and insights. Method explores the career journeys of designers at Google, while Design Notes goes in-depth with designers working in diverse creative disciplines.

🎙 Hosted by Travis Neilson (Method) and Liam Spradlin (Design Notes)
🗓 Method: Retired; Design Notes: New episodes ca. monthly

Diversity
Revision Path

Revision Path showcases Black designers, artists, developers, and digital creatives from all over the world. Through weekly in-depth interviews, you’ll learn about their work, their goals, and what inspires them as creative individuals.

🎙 Hosted by Maurice Cherry
🗓 New episodes weekly

Technically Speaking

Technically Speaking is a podcast by Harrison Wheeler about BIPOC designers, entrepreneurs, and technologists sharing their unique stories of triumph and resilience at the intersection of product design.

🎙 Hosted by Harrison Wheeler
🗓 Ongoing

The Future Of UX
Rosenfeld Review Podcast

What shifts does UX face? And how can individuals and teams respond in ways that drive success? That’s what Lou Rosenfeld wants to find out by inviting changemakers in the UX world and beyond to the Rosenfeld Review Podcast.

🎙 Hosted by Lou Rosenfeld
🗓 Ca. one to two new episodes per month

The Sustainable UX Podcast

The Sustainable UX Podcast is for everyone who wants to make an impact for a sustainable future. In each episode, the hosts Bavo Lodewyckx and Thorsten Jonas invite you to meet people from around the world who try to save the world through and within UX, design, and tech.

🎙 Hosted by Bavo Lodewyckx and Thorsten Jonas
🗓 New episodes monthly

Future Of UX

In every episode of the Future of UX podcast, Patricia Reiners talks to leading UX/UI designers and digital pioneers about the future and how we are going to design a great user experience with new technologies.

🎙 Hosted by Patricia Reiners
🗓 Retired

Creative Culture
Design Matters

Design Matters started out in 2005 as a little radio show and soon became the first podcast about design and an inquiry into the broader world of creative culture. Among the guests are designers, writers artists, curators, musicians, and other luminaries of contemporary thought.

🎙 Hosted by Debbie Millman
🗓 New episodes weekly

Design
99% Invisible

99% Invisible has grown from a four-minute spot on broadcast radio to an enormously popular narrative podcast with listeners all over the world. It dives deep into the things we don’t think about — the unnoticed architecture and design that shape our world.

🎙 Hosted by Roman Mars
🗓 New episodes weekly

Hacking
Darknet Diaries

How about a peek inside the dark side of the web? Darknet Diaries is a podcast about hackers, breaches, shadow government activity, hacktivism, cybercrime, and all the things that dwell on the hidden parts of the network.

🎙 Hosted by Jack Rhysider
🗓 New episodes weekly

Last But Not Least…

Did you know that there’s a Smashing Podcast, too? In each episode, host Drew McLellan talks to design and development experts about their work on the web, as well as catching you up with the latest news and articles at Smashing Magazine. And, well, it’s suitable for cats, too. 😉

If you have a favorite UX podcast that is not mentioned in this post — or maybe you’re running one yourself — please let us know in the comments below. We’d love to hear about it!

Introduction to the CSS :has() selector

Original Source: https://1stwebdesigner.com/introduction-to-the-css-has-selector/

Yes, we know we’re a bit late to the party, what with the :has() selector making the rounds of web design and development headlines. But better late than never, right? So let’s dive into this new feature of CSS and see what it’s all about!

Your Web Designer Toolbox
Unlimited Downloads: 500,000+ Web Templates, Icon Sets, Themes & Design Assets
DOWNLOAD NOW

 

The CSS :has() selector is a type of complex selector that allows you to select an element based on whether it contains a certain other element. This selector is a powerful tool that can be used in a variety of ways to create advanced styles for your website. Here are some examples of the advanced uses of the :has() selector:

Selecting Parent Elements with a Specific Child Element

One of the most common uses of the :has() selector is to select parent elements based on the presence of a specific child element. For example, if you want to select all the li elements that contain an a element, you can use the following code:

li:has(a) {
background-color: yellow;
}

Selecting Sibling Elements

Another advanced use of the :has() selector is to select sibling elements based on the presence of a specific child element. For example, if you want to select all the td elements that are siblings of a td element that contains an a element, you can use the following code:

td:has(a) + td {
background-color: yellow;
}

Selecting Grandparent Elements

You can also use the :has() selector to select grandparent elements based on the presence of a specific child element. For example, if you want to select all the ul elements that are grandparent elements of an li element that contains an a element, you can use the following code:

ul:has(li:has(a)) {
background-color: yellow;
}

Selecting Elements with Multiple Children

The :has() selector can also be used to select elements based on multiple children. For example, if you want to select all the p elements that contain both an em and a strong element, you can use the following code:

p:has(em) :has(strong) {
background-color: yellow;
}

Selecting Elements with Specific Attributes

Finally, you can use the :has() selector to select elements based on the presence of specific attributes. For example, if you want to select all the input elements that have a required attribute, you can use the following code:

input:has([required]) {
background-color: yellow;
}

These are just a few examples of the more complex uses of the :has() selector. With its powerful syntax, it can be used to make complex selections that would otherwise be difficult or impossible to achieve with traditional selectors.

It’s important to note that the :has() selector is not supported in all browsers, so it’s always a good idea to check the browser compatibility before using it in a production environment.