teleren/devto huggingface dataset:
IntelliType: Python Type Hinting with Hoverable Docstrings
Tags: python, typehint, cleancode, documentation
Published: 2024-07-16 10:32:28

## IntelliType

I recently published a Python type-hint library called [intelli-type](https://github.com/crimson206/intelli-type). The main purpose is to enhance type-hinting with Intellisense.

## Intellisense

When using IntelliType, you need to define custom type hints.

```python
class AudioFeature(IntelliType[Tensor], Generic[T]):
    """
    VggishOutput representation.

    Shape: (batch_size, 1, channels)
    - channels: Number of audio features

    Input Audio Waves -> AudioFeature
    """
```

The type `AudioFeature` is equivalent to Tensor.

Even though you define the type when you create `AudioFeature`,
you still need to specify the type when you use it for type hinting.

```python
def forward(
    self, feature_map: FeatureMap[Tensor], audio_feature: AudioFeature[Tensor]
) -> FusionMap[Tensor]:
    pass
```

Adding `Generic[T]` enhances Intellisense.

```python
# Intellisense with Generic[T]

(method) def forward(
    self: Self@CrossModalMixer,
    feature_map: FeatureMap[Tensor],
    audio_feature: AudioFeature[Tensor]
) -> FusionMap[Tensor]
```

```python
# Intellisense without Generic[T]

(method) def forward(
    self: Self@CrossModalMixer,
    feature_map: FeatureMap,
    audio_feature: AudioFeature
) -> FusionMap
```

![deep-learning-example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yp4seebonpxi02outh7.gif)

**Gif. Runtime Example**

## Strict Annotation

If you have already defined `AudioFeature` as `Tensor`, you can't use this type with other types. The syntax below will cause an error.

```python
def func(
    audio_feature: AudioFeature[str]
):
    ...
```

## Single Responsibility & Reusability

Traditionally, we write the description of arguments in the docstring of a function.
The same argument can be used in different functions, so we need to repeat the same task. The critical problem is that the descriptions for the same argument are not programmatically connected. If we want to update the description of the argument, we must do it manually.

![func_dedicated_docstring](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h86311oojqawjfrbt055.png)
**Fig. Function Dedicated Docstring**

Using IntelliType, the description for `feature_map` is written in FeatureMap and can be reused everywhere. You update the docstring in FeatureMap, and the change is applied everywhere programmatically. Therefore, we can write dedicated docstrings for functions and arguments separately.

## Namespace

I am pioneering and establishing [Micro-wise development](https://github.com/crimson206/microwise-development). To avoid 'namespace pollution', I am publishing all the modules with the namespace 'crimson'. Therefore,

```python
# import syntax is

from crimson.intelli_type import IntelliType
```

```bash
# install the package with the command line

pip install crimson-intelli-type
```

### Post History
Written: 16/07/2024
Send certificate & Key file in Rest Api
Published: 2024-07-16 10:38:56

Hi
I want to do certificate based authentication in React Native, for that I am using Rest API.
And from the docs https://learn.microsoft.com/en-us/azure/iot-dps/how-to-control-access#certificate-based-authentication I found out this cURL, and I need to send certificate and key file in API, as https.agent is not supported by React Native, how can I manage to do that?
```
curl -L -i -X PUT –cert ./[device_cert].pem –key ./[device_cert_private_key].pem -H 'Content-Type: application/json' -H 'Content-Encoding:  utf-8' -d '{"registrationId": "[registration_id]"}' https://global.azure-devices-provisioning.net/[ID_Scope]/registrations/[registration_id]/register?api-version=2021-06-01
```

So far what I have tried is

```
 const data = {
    registrationId: registrationId,
  };
  const cert = await RNFS.readFile(certificatePath, 'utf8');
  const key = await RNFS.readFile(keyPath, 'utf8');
  console.log('cert', cert);
  console.log('key', key);
  try {
    const httpsAgent = new https.Agent({
      cert: cert,
      key: key,
      keepAlive: true,
    });
    console.log('httpsAgent', httpsAgent);
    const response = await axios({
      method: 'PUT',
      url: `https://global.azure-devices-provisioning.net/${scopeId}/registrations/${registrationId}/register?api-version=2021-06-01`,
      data: data,
      httpsAgent: httpsAgent,
      headers: {
        'Content-Type': 'application/json',
        'Content-Encoding': 'utf-8',
      },
    });
    return response.data;
  } catch (err) {
    console.log('err', err);
    return err;
  }
```
Thank you!!!
How I migrated my course platform to the SPARTAN stack (Angular Global Summit 2024)
Tags: angular, analog
Published: 2024-07-16 10:39:12

I just released my latest conference talk:

How I migrated my course platform to the SPARTAN stack (Angular Global Summit 2024)


- The SPARTAN Stack
- How I migrated my course platform to Analog and the SPARTAN stack
- Handing auth with the SPARTAN stack
- Client Hydration with Analog

[Watch it here](https://www.youtube.com/watch?v=oOItC-Z7zOU&ab_channel=ChristianLydemann)
Library v/s Framework
Tags: library, framework, frontend, spring
Published: 2024-07-16 10:41:54


## Ever confused between library and frameworks ???

---

Do you also get confused about these two and used these two terms interchangeably.
Let me help you understand these two so you will have a better clarity.

---

First, lets start with definition:

## **Library**
A collection of predefined methods, classes or interfaces used for solving common problems.
It comes either bundled with a language or can be downloaded from internet and used.

> Examples - react.js, twilio, iText, apache commons and lot more.

## Benefits of using library:

1. Reusability
2. Reduces programmer's effort
3. Allows programmer to focus on main problem

---

## **Framework**
A collection of libraries is called framework, it provides a foundation on which we develop our code.
It provides pre-written common logics so that developers can focus on business logic only also called components.

Frameworks can be further divided into following sub categories:
- Frontend framework
- Web framework
- Application Development framework
- ORM framework 

> Examples - angular, spring, hibernate, struts and more.

## Benefits of using framework:

1. Speeds up development process
2. The code is more secured than library
3. Forces developers to follow standard procedures and hence make our code clean and therefore is opinionated

---

## Difference between library and framework

1. Libraries are lightweight whereas frameworks are more bulky.
2. Libraries are more flexible than frameworks.
3. Frameworks call our code whereas we developers call library methods or functions.
4. Frameworks employ the concept of IoC(Inversion of Control) where framework tells developers how to write the code.
5. Frameworks controls the flow of application but we can use force library to control the flow of application.
6. Libraries are more flexible than frameworks.

---

## Conclusion

I hope you know the difference and advantages and disadvantages of using libraries and frameworks 🏗️.
If, you want to develop overall architecture of an application by using best practices and standards, you can use framework but if you want to develop application at a greater pace with your own custom logics and control flow on your own, you can use library 📚.

---

**Follow me on [Twitter](https://x.com/thisis_souraev) for more.**
I used to hate my mornings until I discovered this transformative morning routine!
Published: 2024-07-16 10:43:25

Background: I moved to Lisbon, Portugal, six months ago. Suddenly, my perfect work schedule was disrupted. My active workday, with meetings starting at 9:30, began two hours earlier than my usual 11:30 start. This change was challenging, and I needed to adapt to this new reality.

**The solution was establishing a productive morning routine, allowing me to ease into the day instead of diving straight into work after waking up.**

Today, I want to share this life-changing routine with you:

**7:00 AM - Wake Up**
Most importantly, avoid opening news or social media! 

**7:00-7:10 AM - Journaling**
I use the Stoic. app for this, but you can use phone notes or even a paper notepad. Write down your thoughts, even if they are just how much you dislike mornings 😄 

**7:10-7:25 AM - Bathroom Time**
Don’t forget to apply your SPF!

**7:25-7:50 AM - Dress Up and Go for a Walk**
It’s crucial not to listen to music or podcasts. As a reminder, avoid social media during this time. Leaving your phone at home can help avoid temptation.

**7:50-8:00 AM - Quick Workout**
Nothing fancy. Just do a warm-up and one circuit of push-ups, squats, and tricep exercises.

**8:00-8:10 AM - Return Home and Take an Ice Shower**
It’s a pure dopamine boost.

**8:10-8:30 AM - Quick Breakfast**
I usually have Greek yoghurt with blueberries and coffee. Remember to take any prescribed supplements. And only now can you quickly check your phone for important messages.

**8:30-9:00 AM - Time for Learning, Reading, Writing**
For example, I’m writing this post during this slot. I’ve also completed two online courses in a month, thanks to this dedicated time.

**9:00 AM - Start the Workday**
I prefer checking emails and Slack messages and conducting pull request reviews.

I encourage you to create your perfect morning routine. Give it a try and see how it transforms your day!
VR Game Development
Tags: vrgame, vrgamedevelopment, vrgamedevelopers, vrgameplatform
Published: 2024-07-16 10:57:25

> At SDLC Corp., we specialize in creating immersive and breathtaking VR gaming experiences that transport players to entirely new worlds. Our commitment to innovation and excellence ensures that each VR game we develop captivates players, delivering unparalleled levels of immersion and interaction. At SDLC Corp., we are passionate about pushing the boundaries of what's possible in VR gaming. Our dedication to quality, innovation, and client satisfaction makes us the ideal partner for bringing your VR game vision to life. Dive into the future of gaming with SDLC Corp., where virtual reality becomes a reality.

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nhn7nwz3o0hj6eoig3wi.png)
](https://sdlccorp.com/services/games/vr-game-development-company/)


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s6pix79zyo5mf9t2zu7s.png)
](https://sdlccorp.com/services/games/vr-game-development-company/)


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


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


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpxpwcppu4bpvkopx2yt.png)](https://sdlccorp.com/services/games/game-development-company/)


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


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


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


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1i43tpfcsg8ioo50w81n.png)](https://sdlccorp.com/services/games/vr-game-development-company/)


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


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


[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0r2n9g84lppsefncqdk.png)](https://sdlccorp.com/services/games/vr-game-development-company/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6flnvx8qyelu443qosv.png)
Spaceship operator 🚀 in PHP
Tags: php, operator
Published: 2024-07-16 11:00:23

Introduced in PHP 7, the Spaceship operator <=> is used to compare two expressions.

It returns:

- 0 if both values are equal
- 1 if left operand is greater
- -1 if right operand is greater

Let’s see it with an example:

```
echo 2 <=> 2; // Outputs 0
echo 3 <=> 1; // Outputs 1
echo 1 <=> 3; // Outputs -1

echo "b" <=> "b"; // Outputs  0
echo "a" <=> "c"; // Outputs -1
echo "c" <=> "a"; // Outputs 1

// Note: for string comparison, the ASCII value of the characters are used, that is why "c" is greater than "a"
echo "ping" <=> "pong"; // Outputs -1 since "o" is greater than "i"
```

This operator can be used for sorting arrays:

```
$numbers = [1, 4, 5, 9, 2, 3];

usort($numbers, function ($a, $b) {
    return $a <=> $b; // Sort in ascending order
});

echo print_r($numbers); // Outputs [1,2,3,4,5,9]

usort($numbers, function ($a, $b) {
    return $b <=> $a; // Sort in descending order
});

echo print_r($numbers); // [9,5,4,3,2,1]
```
Hiring Full Stack Engineers (MERN Stack) | Cypherock
Tags: webdev, hiring, fullstack, cryptocurrency
Published: 2024-07-16 11:00:40

Hello Developers,

We at Cypherock are hiring for Full Stack Engineers proficient with MERN stack with at least 1 year of experience in the field. However, if you feel you are qualified enough even as a fresher, feel free to apply for the position. To apply, drop me a mail at pranay@cypherock.com with your resume and a cover letter with the subject "Application for Full Stack Engineer via Dev.to". 

## Job Description

At Cypherock, we are disrupting the current financial system by increasing the adoption of Blockchain-based digital assets through better key management solutions. We build "Worlds' first products" from India, work at the intersection of Blockchain, Security, Embedded Hardware and Cryptography and have worked with companies like Google, Blockgeeks, Samsung, Lockheed Martin, Apollo Munich, Bank of America amongst others.

As the primary person responsible for everything Blockchain in the company, we think it will be a great fit if :

- You love everything Crypto and are passionate to create the World's safest Crypto wallet.
- You have security paranoia.
- You are interested to create an open source Web 3.0 app store from the ground up.

If we decide to work together, we believe you would be a key team member who helps in the mass adoption of Crypto for the first billion users.

## Requirements
**Must have**
Programming languages -
- Server-side: Node.js, TypeScript
- Database: MongoDB
- SDK: JavaScript, TypeScript (with strong understanding of JavaScript)
- Frontend: React, Bootstrap, CSS
- Backend: JavaScript (proficient in data structures)

Technologies
- AWS
- Docker

**Good to have**
- Rust
- Kubernetes
- WebSQL
- WebAssembly​

**Benefits**
Benefits given to Cypherock employees:
- Competitive salary as per Industry standards.
- Work From Home flexibility.
- Complimentary meals and refreshments in office.
How to Learn Swift: A Comprehensive Guide
Published: 2024-07-16 11:22:20

Swift is a powerful and intuitive programming language developed by Apple for building apps on iOS, macOS, watchOS, and tvOS. Whether you're new to programming or an experienced developer looking to add Swift to your skill set, this guide will help you navigate the learning process.

Why Learn Swift?
Before diving into the how, let's explore the why. Here are some compelling reasons to learn Swift:

1. High Demand
Swift developers are in high demand, with many companies seeking skilled professionals to build iOS and macOS applications.

2. Modern Language
Swift is designed to be safe, fast, and expressive, making it a joy to work with. Its modern syntax and features help prevent common coding errors.

3. Community and Resources
Swift has a vibrant and supportive community. Numerous resources are available, including official documentation, tutorials, and forums.

Getting Started with Swift
1. Set Up Your Development Environment
To start coding in Swift, you'll need to set up your development environment:

Xcode: Apple's integrated development environment (IDE) for macOS. Download it from the Mac App Store.
Swift Playgrounds: An iPad app and macOS application that offers a fun and interactive way to learn Swift. Download it from the Mac App Store.
2. Learn the Basics
Begin with the fundamentals of Swift:

Variables and Constants: Learn how to declare and use variables (var) and constants (let).
Data Types: Understand Swift's data types, such as Int, Double, String, and Bool.
Control Flow: Study the basic control flow statements, including if, else, switch, for, and while.
Functions: Discover how to define and call functions.
Optionals: Learn about optionals and how to safely handle nil values.
Recommended Resources:

The Swift Programming Language: Official guide by Apple.
Hacking with Swift: Comprehensive tutorials and projects by Paul Hudson.
3. Build Projects
Applying what you've learned through projects is essential:

Simple Apps: Start with simple apps like a calculator, to-do list, or weather app.
Challenges: Participate in coding challenges and exercises to reinforce your knowledge.

Related Article: [click here ](https://wyaholding.com/effective-debugging-techniques-for-swift-developers/)
Personal Finance Tracker with Python
Tags: python, beginners
Published: 2024-07-16 11:24:24

Intro: 
Morning! Another simple project under my belt and could be under yours! With the tutorial guidance of Tim from Tech with Tim at: [Youtube Link](https://www.youtube.com/watch?v=Dn1EjhcQk64) I was able to program a personal finance tracker. This project used a csv file to store transactions from the terminal line with pandas and uses matplotlib to plot the data for you to see. This is a great project for python beginners looking to explore popular libraries! 

Project:
The program prompts users to enter transaction details such as date, amount, category (Income or Expense), and description, which are then stored in a CSV file. Users can view a summary of their income, expenses, and net savings for any given period, and generate plots to see trends and patterns in their financial data.

The project was both challenging and rewarding. Validating user inputs to ensure data integrity, handling CSV files for data storage, and creating meaningful visualizations were some of the key tasks. This experience highlighted the importance of robust input validation, efficient data handling, and the power of data visualization in understanding financial habits.

To Do:
This project and concept is a great base to make something bigger! Ideas I can think of is making a simple GUI that implements the original functions, or perhaps creating a django site. You could add more functionalities. The sky's the limit. 

Lesson: 
Following projects is a great tool for learning, but working on your own idea or building off an idea yourself is equally important. I will work off this project and be back to share my creation. In addition, following these projects are crucial for building a greater computer science background and experience. I plan to learn about webscraping, ai chatbots, and django with youtube. Following different topics through videos extends your knowledge a ton and can allow you to start thinking of ways to connect them all. Youtube is the best. 

Thank you for reading. Thanks again to Tim from Tech with Tim. The repo for this project can be found here [GitHub Link](https://github.com/techwithtim/Personal-Finance-Tracker)

Nelson Bermeo
Computer Science Sophomore
Stevens Institute of Technology
Email: nbermeo@stevens.edu
[LinkedIn](https://www.linkedin.com/in/nelson-bermeo-9118b11ba/)
[Personal Website](https://www.linkedin.com/in/nelson-bermeo-9118b11ba/)
[Github](https://github.com/NelsonBermeo)
How to Learn Xcode: A Comprehensive Guide
Published: 2024-07-16 11:27:03

Xcode is Apple's integrated development environment (IDE) used for developing applications for macOS, iOS, watchOS, and tvOS. Learning Xcode is essential for anyone looking to build apps within the Apple ecosystem. This guide will provide you with a structured approach to mastering Xcode, whether you're a beginner or an experienced developer.

Why Learn Xcode?
Before diving into the learning process, let's understand why Xcode is a valuable tool:

1. Comprehensive Toolset
Xcode offers a complete set of tools for designing, coding, testing, and debugging applications, making it the go-to IDE for Apple development.

2. Seamless Integration
Xcode seamlessly integrates with Apple's developer ecosystem, providing access to frameworks, libraries, and services like Swift, Objective-C, Interface Builder, and more.

3. Professional Development
Mastering Xcode is essential for developing professional, high-quality apps for Apple platforms.

Related articles: [click here](https://wyaholding.com/)
Quick Start with AWS Lambda for Serverless Computing
Published: 2024-07-16 11:29:29

Discover how AWS Lambda, a serverless computing service, can revolutionize your development process by eliminating server management tasks. This post will guide you through creating your first Lambda function, perfect for beginners and enthusiasts of tools like capcutapk.

What is AWS Lambda?
AWS Lambda runs your code in response to events and automatically manages the underlying compute resources. It's cost-effective, scales automatically, and integrates seamlessly with other AWS services.

Quick Setup Guide
Log in to AWS: Access the AWS Management Console.
Access Lambda: Search for "Lambda" in the Services menu.
Create a Function: Click "Create function", select "Author from scratch", name your function, choose a runtime, and set up the execution role.
Add a Trigger: Configure a trigger, such as an HTTP request via API Gateway.
Deploy and Test: Deploy your function and test it with a simulated event.
Conclusion
AWS Lambda is ideal for real-time file processing, building scalable APIs, data transformation, and automation tasks. Start experimenting today and pair it with tools like [capckutapk](https://capckutapk.com/) for enhanced productivity.

Tags
#aws #serverless #lambda #cloud #capckutapk
Linking multiple API requests: A new approach
Published: 2024-07-16 11:36:20

What you normally see in an API client (yes postman too) is that every API request is a monolithic block - This means that if you want to make any changes/adjustments, you first need to copy/clone the API request. 

⚠️ This could potentially result in dozens of "API request clones" that have some minor differences in the headers, body or the query parameters. 

🚧 Now imagine that you want to introduce a new parameter to all these APIs. What do you do? The only way is to make these changes manually in all of these API requests. 

Is there another way?

- With Fusion, every part of an API request is a reusable Fusion Block, allowing you to compose and link these blocks together, keeping them in sync. No need to manually adjust all these copied API requests.

- Read more about linking blocks with Fusion here: https://lnkd.in/dktbH726

Try out Fusion, start designing your APIs with reusability and interconnectedness in mind: https://apyhub.com/product/fusion