teleren/devto huggingface dataset:
Fix iPhone not showing as webcam | Continuity Camera
Tags: tutorial, productivity, tooling
Published: 2023-01-07 21:22:15

{% embed https://youtube.com/shorts/3WU3cA5xHtA?feature=share %}

So if you're like me, you've been frustrated with trying to use your iPhone as a webcam on Mac Os using the continuity feature.
Sometimes you load up Chrome, and it just doesn't appear. You can use it in FaceTime, but Chrome doesn't have it as a selection. Well, I figured out a workaround, and all you need is one application.

OBS Studio! https://obsproject.com/

All you have to do is
1. Go and download OBS Studio for your Mac Os.
2. Open up, and you're presented with two sections at the bottom of the window called “Scenes” and “Sources”. You will want to add a new source.
3. Click the “+” at the bottom of the “Sources” window
4. Select “Video Capture Device”, and click Ok.
5. Select your iPhone in the “Device” selection list. Click Ok.

You should see your webcam taking up the largest preview area. Everything you see in the preview screen will show up as your webcam.

6. Next, click “Start Virtual Camera”

Now go back to whatever website or application you want to use your webcam. Go into the camera selection. And now you have OBS Virtual Camera as a selection. You hopefully have a reliable way to get your iOS webcam showing up consistently.
How do you check for valid email input?
Tags: javascript, beginners, webdev, openai
Published: 2023-01-07 21:20:37

I'm working with strings in section 9 of The Complete JavaScript Course 2023: From Zero to Expert, which I purchased on Udemy. 

Jonas Schmedtmann, one of Udemy's Top Instructors, demonstrates how to check the validity of email input using various methods on strings (shown in CodeSnap below).



![A CodeSnap of JavaScript string methods for converting to lowercase and getting rid of white spaces]](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mta0cxlfexunswr33de9.png)

Jonas mentioned the challenge of creating a function with checking or validating behaviour, that could return a boolean. I took on the challenge and generated three functions by prompting ChatGPT, as outlined below.



## 1st Function 
 
Use a regular expression to check if the email is in the correct format

```jsx

function isValidEmail(email) {
  const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  return re.test(String(email).toLowerCase());
}

```


This function takes an email as an argument and uses a regular expression to check if the email is in the correct format. The regular expression checks for the presence of an @ symbol and a ., and it also checks that the email does not contain any invalid characters.



## 2nd Function

To use this function, you can pass the email that you received as an input to the function and check if it is valid:


```jsx
const email = 'Hello@Jonas.Io';

if (isValidEmail(email)) {
  console.log('Valid email');
} else {
  console.log('Invalid email');
}

```
This code will output Valid email, because the email is in the correct format.



## 3rd Function

To fix the capitalization and remove the spaces before and after the email, you can use the trim and toLowerCase methods:

```jsx
const fixedEmail = email.trim().toLowerCase();

if (isValidEmail(fixedEmail)) {
  console.log('Valid email');
} else {
  console.log('Invalid email');
}

```

This code will output Valid email, because the trim method removes the leading and trailing whitespace from the email and the toLowerCase method converts the email to lowercase.

In ECMAScript 2019 (ES2019), two new string trimming methods were introduced: trimStart and trimEnd.

The trimStart method removes leading whitespace from a string, while the trimEnd method removes trailing whitespace.

Here is an example of how you can use these methods:

```jsx
const str = '  Hello   ';

console.log(str.trimStart()); // Output: "Hello   "
console.log(str.trimEnd()); // Output: "   Hello"

```

You can use these methods instead of the trim method if you only want to remove leading or trailing whitespace from a string.

Keep in mind that the trimStart and trimEnd methods are not supported in all browsers, so you may want to use a polyfill if you need to support older browsers.


This article was produced with the help of [ChatGPT](https://openai.com/blog/chatgpt/)
How to Learn cloud in 2023
Tags: cloud, aws, cloudskills, beginners
Published: 2023-01-07 21:20:31

Follow these steps to learn more about cloud computing in 2023.

 1 . Start by learning the basics of cloud computing. 

This includes understanding different types of cloud services such as infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). Benefits and challenges of using the cloud.

2 . Choose a cloud provider and set up your account: 

You can choose from several leading cloud providers, including Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform. Sign up for an account with one of these providers and explore their services and features.

3 . Take an online course or get a certification: 

There are many online courses and certification programs to help you learn more about cloud computing. Look for courses that cover the specific cloud provider you're interested in, as well as general cloud concepts and technologies. 

4 . Get hands-on experience: The best way to learn about cloud computing is to get hands-on experience building and deploying applications on cloud platforms. Experiment with different services and features before building a simple application or project.

5 . Stay up to date with industry trends: 

Cloud computing is a rapidly evolving field, so it's important to stay up to date with the latest trends and developments. Consider following cloud-related blogs and social media accounts, attending conferences and meetups, and learning from experts in the field.

Overall, the key to learning about cloud computing in 2023 is to take a hands-on approach, combining theoretical knowledge with practical experience to develop a deep understanding of the cloud.
Java's priority for inheritance of methods
Tags: java, beginners, tutorial
Published: 2023-01-07 20:51:27

# Introduction

That post was based on [Vogella's](https://www.vogella.com/tutorials/JavaIntroduction/article.html#javadef_interface_multiple) post about an introduction of Java.

# Multiple Inheritance of Methods.

Java follows an especific priority order to decide which method should be used among the classes (Super Classes or Interfaces) that have their implementations.

1. Overrides methods.
2. Super Class methods.
3. Subtype methods (instead of Supertypes one).

For example, let's consider the following Interfaces and Super Class:

```java
interface MyFirstInterface { // Supertype
    public default void myMethod(String myParameter) {
        System.out.println("First Message: " + myParameter);
    }
}

interface MySecondInterface extends MyFirstInterface { // Subtype
    public default void myMethod(String myParameter) {
        System.out.println("Second Message: " + myParameter);
    }
}

class MySuperClass {
    public void myMethod(String myParameter) { // Super class
        System.out.println("Super Class Message: " + myParameter);
    }
}
```

Using `MySuperClass` as Super Class, implemmenting both Interfaces and overriding the `myMethod` method in a test class, according to the priority order, it is expected that the overrided method will be executed.

**Code:**
```java
class Application extends MySuperClass implements MyFirstInterface, MySecondInterface {
    public static void main(String args[]) {
        Application myApp = new Application();
        myApp.myMethod("Hello World!");
    }

    @Override
    public void myMethod(String myParameter) {
        System.out.println("Overrided Message: " + myParameter);
    }
}
```

**Result:**
```
Overrided Message: Hello World!
```

Using `MySuperClass` as Super Class and implemmenting both Interfaces at the same test class, according to the priority order, it is expected that the Super Class's method will be executed.

**Code:**
```java
class Application extends MySuperClass implements MyFirstInterface, MySecondInterface {
    public static void main(String args[]) {
        Application myApp = new Application();
        myApp.myMethod("Hello World!");
    }
}
```

**Result:**
```
Super Class Message: Hello World!
```

Implemmenting only both Interfaces at the test class, according to the priority order, it is expected that the Subtype's method (`MySecondInterface.myMethod`) will be executed.

**Code:**
```java
class Application implements MyFirstInterface, MySecondInterface {
    public static void main(String args[]) {
        Application myApp = new Application();
        myApp.myMethod("Hello World!");
    }
}
```

**Result:**
```
Second Message: Hello World!
```

As shown above, this is the list of priorities that Java assumes when encountering these scenarios. You can see the code by clicking [here](https://github.com/MarcosGOFavaretto/vogella-estudies/tree/main/multiple-inheritance-interfaces).

Any suggestions are accepted, thank you for reading ;D.
How to change hair styles using AI ?
Tags: python, neuralnetworks, deeplearning, ai
Published: 2023-01-07 20:07:57

Hi,
This is a cool Python AI library that produce face images with a new look and hair style.
This tutorial is based on the wonderful library named “BarberShop”
This pre-trained model enables change the hair style and the hair color of any face image
Pretty cool. Watch this video for more info.


Oreily  come up with this book . the best book for learning Deep learning based on Tensorflow-Keras. This is the link : [](https://amzn.to/3STWZ2N)

You can find the link for the video tutorial here:[](https://youtu.be/gqw-DMQpliQ) 

Moreover, you may find in the video description an instructions file with the setup process, reference for the Github library

Enjoy
Eran
#python #computervision #NeuralNetworks #ai #DeepLearning
Most software engineers start thinking about the code. Instead, start with "why" so you solve the right problem the first time
Tags: career, codenewbie, productivity, programming
Published: 2023-01-07 19:59:41

Every software engineer has that moment.

You are assigned a feature requirement. It could be a Jira ticket or a sticky note. You first start brainstorming if this is possible, how you would achieve it, and how much time it might take.

But before you start thinking through the technical implementation, you need to step back and ask "why"?

## Asking "why" saves you time because it prevents you from building the wrong solution.

Often by nature, there are some technical assumptions built into a requirements ticket.

However, those writing software requirements sometimes don't clearly understand what is and isn't possible. There may be a better solution that is either faster or more user-friendly that has not been thought of or assumed to be impossible. As the software engineer building the feature, understanding why a requirement exists allows you to validate that the best solution (given all the variables) is being selected.

As a software engineer, you are the technical subject matter expert (yes, even if you're new).

## Understanding "why" opens up alternative ways to build the feature.

Even if the requirements you're given are correct, there are many assumptions you may make based on what is or isn't listed in the ticket.

It is so important to never make an assumption. Assumptions lead to faulty technical decision-making. This feature may be a stop-gap and will need to change in 6 months. You save yourself and your company time by asking questions and unlocking those things that other stakeholders may not think to volunteer. This complete understanding of the problem and solution allows you to make the right technical trade-offs.

You aren't really doing your whole job as a software engineer if you are just building what people ask rather than what people need.

## After asking "why" enough times, you'll build an understanding and intuition about your customers and their needs.

The sweet spot for software engineers is when they understand their customers and their needs deeply.

When that happens, engineers can suggest ideas that product managers or designers might not have considered. This collaboration between engineering, product, and design makes unique software exist. So embrace being a collaborative, product-focused engineer.

Ask "why" and make your product better.
Maximize Your Work Performance with the Power of Alpha Waves
Published: 2023-01-07 19:56:14

Are you having trouble staying focused and productive during work? If you're looking for a natural way to boost your concentration, you might want to consider listening to pure alpha wave sounds.

Alpha waves are brain waves that have a frequency of 8-12 Hz, and they are often present when a person is in a state of relaxation or meditation. Research has shown that listening to pure alpha wave sounds can help to reduce stress and anxiety, and increase feelings of calm and relaxation. This can be beneficial for improving focus and concentration, as a relaxed and stress-free mind is more able to focus on a task without being distracted by negative emotions or external distractions.

But the potential benefits of alpha waves don't stop there! Some research suggests that alpha waves may also have a direct impact on brain function, and may be able to improve cognitive performance, including memory, learning, and problem-solving skills.

So, if you're looking for a natural way to improve your focus and productivity during work, give pure alpha wave sounds a try. You might just be amazed at the results!

References : 
Listen to alpha waves -
[INSTANT RESULTS : 100% PURE ALPHA BRAIN WAVES FOR STUDY, MEDITATION , FOCUS, INTELLIGENCE
](https://www.youtube.com/watch?v=fyBuKsmKew4)

[Alpha Brain Waves](https://open.spotify.com/artist/2DvbYXMiUAQuupPEQnIt1I)

[What is Binaural Beats and How It Enhanced My Productivity Up to the Utmost Extent
](https://lakin-mohapatra.medium.com/what-is-binaural-beats-and-how-it-enhanced-my-productivity-up-to-the-utmost-extent-6654f12872d6)

[https://www.cell.com/trends/neurosciences/fulltext/S0166-2236(07)00026-4](https://www.cell.com/trends/neurosciences/fulltext/S0166-2236(07)00026-4)

[https://www.healthline.com/health/alpha-brain-waves](https://www.healthline.com/health/alpha-brain-waves)
Don't want to fix that bug? Here are 6 things you can do instead
Tags: work, procrastination
Published: 2023-01-30 10:59:46

---
title: Don't want to fix that bug? Here are 6 things you can do instead
published: true
date: 2023-01-07 19:52:00 UTC
tags: work, procrastination
canonical_url: https://rachsmith.com/6-things-to-do-instead-of-work/
---

Look, coding is hard. Every time you start to solve a problem or fix a bug you run the risk of not being able to do it and then feeling like you aren't as smart as you thought you were. That sucks! Here are some things you can do instead.

## Choose a new font for your IDE

My paid favourites are [Berkeley Mono](https://berkeleygraphics.com/typefaces/berkeley-mono/), [Operator Mono](https://www.typography.com/fonts/operator/styles) and [Dank Mono](https://philpl.gumroad.com/l/dank-mono). But there is a whole set of [free monospace fonts](https://fonts.google.com/?category=Monospace) on Google Fonts that you can try out, one by one until you find one you like, or don't.

## Change your terminal

I've heard [warp](https://www.warp.dev/) is good?

## Choose a new theme for your IDE

Some of my favourites: [Moonlight II](https://marketplace.visualstudio.com/items?itemName=atomiks.moonlight), [In Bed By 7pm](https://marketplace.visualstudio.com/items?itemName=sdras.inbedby7pm) and [Houston](https://marketplace.visualstudio.com/items?itemName=astro-build.houston). But there are [hundreds](https://vscodethemes.com/) (thousands?) of options to choose from. Try them out. Use each for half an hour before you decide to change back to the same one you've had for the last 3 years.

## Decide you're going to learn all the keyboard shortcuts in VSCode

Pretend you're improving your productivity when you're actually procrastinating! Check out the [Keybindings reference](https://code.visualstudio.com/docs/getstarted/keybindings) or if you're too lazy for that, watch some videos on people's[favourite VSCode shortcuts](https://www.youtube.com/watch?v=4xA5JePvCJc).

## Buy a new keyboard

Your code is going to be so much better when you have the ultimate keyboard. Research is important so make sure you head back to YouTube to find out [which is the best](https://www.youtube.com/watch?v=wmQt-QM0mbQ&t=1s). Now instead of doing the work that makes you money, you are spending money. Amazing!

## Redesign your personal website

I mean it has been at least 6 months since you overhauled it. And the fact it doesn't include a dark/light theme switcher is frankly, embarrassing. Check out [other people's sites](https://personalsit.es/) for some inspo. Bonus: you can go back to Google Fonts!
WTF is Higher Order Function ?
Tags: webdev, javascript, tutorial, beginners
Published: 2023-01-07 18:57:09




A higher-order function is a function that takes one or more functions as arguments, or returns a function as its result. Higher-order functions are often used in functional programming languages. They allow you to abstract over actions, rather than just values.

```
function applyTwice(func, arg) {
  return func(func(arg));
}

function sum(x) {
  return x + 5;
}

console.log(applyTwice(sum, 10));  // 20
```

In this example, `applyTwice` is a higher-order function because it takes the function `sum` as an argument and calls it twice on the argument 10.

Higher-order functions are often used in functional programming languages like JavaScript to abstract over actions, rather than just values. They can be used to create reusable abstractions that can simplify complex code and make it easier to understand.

Here are few examples of HOC functions in javascript : 

1. `Array.prototype.map()` : This function takes an array and a callback function as arguments, and returns a new array with the results of calling the callback function on every element in the original array.

```
const numbers = [1, 2, 3, 4, 5];
const doubledNumbers = numbers.map(x => x * 2);
console.log(doubledNumbers); // [2, 4, 6, 8, 10]

```

2. `Array.prototype.filter()` : This function takes an array and a callback function as arguments, and returns a new array with only the elements from the original array that pass the test implemented by the callback function.

```
const numbers = [1, 2, 3, 4, 5];
const evenNumbers = numbers.filter(x => x % 2 === 0);
console.log(evenNumbers); // [2, 4]
```

3. Array.prototype.reduce(): This function takes an array and a callback function as arguments, and returns a single value that is the result of applying the callback function to each element in the array, from left to right.


```
const numbers = [1, 2, 3, 4, 5];
const sum = numbers.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
console.log(sum); // 15

```

4. Array.prototype.sort(): This function takes an array and an optional compare function as arguments, and returns a new array with the elements in the original array sorted according to the return value of the compare function.

```
const numbers = [4, 1, 5, 2, 3];
const sortedNumbers = numbers.sort((a, b) => a - b);
console.log(sortedNumbers); // [1, 2, 3, 4, 5]
```

I hope you understand now what higher order functions are. 

Thanks for reading. Follow me on [Twitter](https://twitter.com/HQdeepak)
2022, a look back
Tags: yearinreview
Published: 2023-01-07 18:50:36

As this year has come to an end, I thought I'd take a moment to reflect on the past year of my life. It was an year full of learning, growing, and sharing. Looking back over the past year, I'm able to remind myself of the challenges I faced, remember what I've learned, how I've grown, see what I've accomplished, and most importantly think about what I need to do this year in order to further facilitate this growth.

This recap isn't just limited to things related to technology, but needless to say technology makes up a major chunk of this blog post.

## Numbers

I'll start with some raw numbers: followers, stars, etc. Mostly meaningless, but nevertheless they give me an awkward sense of accomplishment.

- Hit over 600 followers on [Twitter](https://twitter.com/harshhhdev)
- Hit over 175 followers on [GitHub](https://github.com/harshhhdev)
- Hit over 110,00 views on my posts
- Hit over 700 stars across my projects
- Hit over 150 followers on [Linkedin](https://www.linkedin.com/in/harshhhdev/)
- Hit over 1,100 new followers on my blog
- Hit over 30,000 page views
- Hit over 475 stars on [kmenu](https://kmenu.hxrsh.in)
- Hit over 650 followers on [Instagram](https://www.instagram.com/haaarshsingh/)
- Hit over 200 wins in Fortnite 🫠

## Miscellaneous

- Launched [kmenu](https://github.com/harshhhdev/kmenu) which reached over 475 stars in under five months
- Gave a talk at four different meetups
- Won two categories at [Bitcamp 2022](https://bit.camp/)
- Won the [Astro Hackathon](https://astro.build/blog/astro-1-hackathon/)
- Moved to the Dallas-Fort Worth area
- Started actively attending in-person technology meetups
- Got my American citizenship
- Redesigned my website four times
- Wrote twelve blog posts
- Started _actually_ earning money with contracts
- Bought the new iPhone and AirPods
- Rebuilt my entire workspace in Texas
- Built [snip.place](https://snip.place/) with [Ibrahim](https://ibra.github.io/)
- Got into photography a bit
- Visited over twenty four cities
- Held a snake in my hand
- Started learning Rust
- Bought a new mountain bike
- Pulled of seven all-nighters
- Benched my bodyweight

## 🏄 Travel

Cities I've visited this year. They're all in the United States.

- Dallas, TX
- Fort Worth, TX
- Austin, TX
- San Antonio, TX
- Little Rock, AR
- Memphis, TN
- Nashville, TN
- Louisville, KY
- Cincinnati, OH
- Columbus, OH
- Akron, OH
- Cleveland, OH
- Buffalo, NY
- Rochester, NY
- Syracuse, NY
- Albany, NY
- Hartford, CT
- New York, NY
- Newark, NJ
- Jersey City, NJ
- Boston, MA
- Philadelphia, PA
- Baltimore, MD
- Washington, D.C.

## Conclusion

That's about all I have to share for my year. Through many highs and lows, this year was filled with memories I hope to cherish one day. I try to write a post similar to this annually to retrospect how I've grown.

I'll end this post off with a quote by Ferris Bueller.

> "Life moves pretty fast. If you don't stop and look around once in a while, you could miss it."

Wishing y'all the best of luck for the upcoming year. Cheers.