teleren/devto huggingface dataset:
Exciting News!!! AWS Introduces S3 Express One Zone
Published: 2023-12-02 08:49:37

AWS has unveiled a major enhancement to its S3 object storage service at this year's re:Invent conference in Las Vegas. This new addition, AWS S3 Express One Zone, introduces a high-performance and low-latency tier for S3, promising an impressive 10x improvement in write speed, which is an improvement on the standard S3 service.

This update, known as One Zone, is designed to bring substantial performance enhancements to data-intensive applications, including tasks such as AI/ML training, financial modeling, and high-performance computing. While capable of handling objects of any size, AWS emphasizes that Express One Zone excels in use cases where applications need to access vast quantities of small files due to its low-latency access. In fact, it can read these small objects up to 10x faster than the S3 Standard service.

The S3 Express One Zone tier is now available for general use, providing AWS customers with a powerful and efficient option for storage that caters to the demands of high-performance applications while offering cost savings on requests.
Mocking Async API Calls in FastAPI Tests
Tags: fastapi, python, testing, webdev
Published: 2023-12-02 08:48:13

When engaging in software development, there is often a need to send SMS, emails, or make API calls to other systems. When testing such programs, it is common to mock these interactions to ensure that the testing process does not fail due to an unavailable network connection.

In FastAPI, there are two ways to define functions: using `def` and `async def`. According to the official documentation, testing these functions requires the use of `TestClient` for `def` and `httpx.AsyncClient` for `async def`. 

This article provides a practical method for mocking the API caller within `async def` functions.


## code
Here the API endpoint makes an API call to 3rd party
```py
# example_router.py

import httpx

@router.post('/examples')
async def add_example(payload) -> Any:
    try:
        async with httpx.AsyncClient() as client:
            r = await client.post('https://3rd-party-api.example.com',
                                  json={**payload.dict()})
            r.raise_for_status()
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))
    return JsonResponse(content={})
```
We should mock the `httpx.AsyncClient` inside `add_example`.

First, make a fixture
```py
# conftest.py

@pytest.fixture
async def async_client(app: FastAPI) -> AsyncClient:
    return AsyncClient(app=app, base_url='http://localhost:1234')
```
Then write the test with mock, the key points are:

1. Uses the `with patch` to mock the `httpx.AsyncClient`.
2. Mock your calling method, here is `post`

You cannot patch the whole `httpx.AsyncClient` using `@patch` decorator because it will mock all `httpx.AsyncClient` including the one declared in your test.
```py
# test_example_router.py

from unittest.mock import AsyncMock, patch

from httpx import AsyncClient
import pytest

@pytest.mark.asyncio
async def test_contact_us(async_client: AsyncClient) -> None:
    with patch('httpx.AsyncClient') as mock_client:
        mock_post = AsyncMock()
        mock_client.return_value.__aenter__.return_value.post = mock_post

        response = await async_client.post(url='/api/examples',
                                           json={
                                               'desc': 'desc',
                                               'name': 'Brid Pett',
                                               'phone': '123456789',
                                               'email': 'test@cc.cc',
                                           })
        mock_post.assert_called_once()
        assert response.status_code == status_code
```
That's all.
Latest Newsletter: Oddball Week (Issue #143)
Tags: javascript, tech, webdev, discuss
Published: 2023-12-02 07:48:29

---
title: Latest Newsletter: Oddball Week (Issue #143)
published: true
description: Change of pace given the thanksgiving holiday last weekend, but actually it’s resulted in quite a varied mix of interesting things. History, AI tech, philosophy, and a touch of politics.
tags: javascript, tech, webdev, discuss
---

Oddball Week (Issue #143)

Change of pace given the thanksgiving holiday last weekend, but actually it’s resulted in quite a varied mix of interesting things. History, AI tech, philosophy, and a touch of politics.

https://markjgsmith.substack.com/p/mark-smiths-newsletter-02-12-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Leading Industrial Plastic Pallets Manufacturer & Supplier in India
Tags: plasticpallets, manufacturer, supplier
Published: 2023-12-02 07:48:22

Swift Technoplast is an India based plastic pallets and material handling equipment manufacturer & supplier. The company’s forte is designing and molding plastic products for a wide range of heavy-duty applications in various industries. With 16+ years of extensive experience in design and innovation, the company understands the industry requirements and readily offers plastic product solutions to serve specific industrial applications.
COMMON DATA ENGINEERING INTERVIEW QUESTIONS
Published: 2023-12-02 07:18:08

Tell us about yourself. 
This question is often asked to get to know the candidate better. You can talk about your education, work experience, and any relevant projects you have worked on.

What are the most important skills for a data engineer to have?
 This question is aimed at understanding the candidate’s knowledge of data engineering. You can talk about skills such as data modeling, ETL, data warehousing, and data pipeline development.

What data engineering platforms and software are you familiar with?
 This question is aimed at understanding the candidate’s familiarity with data engineering tools and platforms. You can talk about platforms such as Hadoop, Spark, and AWS.

What is your experience with ETL? 
This question is aimed at understanding the candidate’s experience with ETL (Extract, Transform, Load) processes. You can talk about your experience with ETL tools such as Talend, Informatica, and Apache Nifi.

What is your experience with distributed systems? 
This question is aimed at understanding the candidate’s experience with distributed systems. You can talk about your experience with distributed systems such as Hadoop and Spark.

What is your experience with SQL? 
This question is aimed at understanding the candidate’s experience with SQL. You can talk about your experience with SQL databases such as MySQL, PostgreSQL, and Oracle.

What is your experience with NoSQL?
 This question is aimed at understanding the candidate’s experience with NoSQL databases. You can talk about your experience with NoSQL databases such as MongoDB, Cassandra, and DynamoDB.
Cancer Hospital in Chennai
Published: 2023-12-02 06:56:31

Apollo Proton Cancer Centre (APCC) is the first and only proton therapy centre in South Asia and Middle East and it is India's first JCI accredited Cancer hospital. At APCC, we aim to help billions of cancer patients from 147 countries with the courage to stand and stare cancer down with access to the most advanced cancer care. True to the Apollo Pillars of Expertise and Excellence, we bring together a powerful team of clinicians renowned globally in cancer care along with a fully integrated treatment suite that offers the most advanced treatment in surgical, radiation and medical procedures to help our patients win over cancer. 

Social Media :
LinkedIn : https://in.linkedin.com/company/apolloproton 
Facebook : https://www.facebook.com/ApolloProton/ 
Instagram : https://www.instagram.com/apolloproton/ 
Twitter : https://twitter.com/ApolloProton  
Youtube : https://www.youtube.com/channel/UCKX76zgrjHM2UFd2vrx_dUg
How to get motivated to code?
Tags: discuss, career, coding, development
Published: 2023-12-02 06:01:07

As a software developer, we all face times of procrastination which are mainly caused by various road-blockers which I discussed over [here](https://dev.to/nandinishinduja/road-blockers-while-coding-ckj). So what to do to overcome these road-blockers? Don't worry, I covered that in this [post](https://dev.to/nandinishinduja/how-to-get-un-stuck-while-coding-fgc). But to implement the ideas suggested in the second post, you need to not procrastinate and you need to be motivated. So in this article, I will discuss some motivation strategies. Some motivation techniques which help me are:
**The daily standup**: I have to say something in the standup, right? And to say something, I have to do something. So the standup is one of my biggest motivators.
**Product managers**: These people are great because they keep asking developers for the project status. So to update them, we need to update the project, right? So product managers are also motivators for me.
**Deadlines**: When you have a set deadline, you have to deliver by then. So deadlines are also something which motivate me. But the deadline has to be strict, I mean, it should be imposed by someone else and not finishing it should have some punishment (such as for example, in Fiverr, when you deliver late, your on-time delivery percentage goes down). 
**Self-assigned tasks**: When I assign a task to myself, that is when I choose my own task, something that I myself proposed to do, I feel more motivated to do it because I feel like I want to prove that my idea is doable and practical.
**Music**: Sometimes, playing music motivates me to work faster just like how the song moves swiftly with fast beats.
**People**: Being surrounded by people who are all working and coding motivates me more than anything. I feel like if they can, I can. So working in office is really motivating for me. 

What motivates you to code?
Creating Dynamic User Interfaces with React Hooks
Tags: webdev, javascript, programming, beginners
Published: 2023-12-02 05:50:55

"Creating Dynamic User Interfaces with React Hooks" is a guide that focuses on harnessing the power of React Hooks to build interactive and dynamic user interfaces. React Hooks were introduced to simplify state management and side effects in functional components, providing developers with a more concise and expressive way to handle complex UI logic. Here's an outline of what such a guide might cover:

**1. Introduction to React Hooks:**

* Overview of React Hooks and their purpose.
* The motivation behind introducing hooks.
* Key hooks: useState, useEffect, useContext, etc.

**2. Getting Started with useState:**

* Declaring state variables in functional components.
* Updating state with the useState hook.
* Handling different types of state (e.g., boolean, string, objects).

**3. Managing Side Effects with useEffect:**

* Understanding the lifecycle of functional components.
* Using useEffect for handling side effects.
* Cleanup and dependencies in useEffect.

**4. useContext for Global State:**

* Centralized state management with useContext.
* Sharing state between components without prop drilling.
* Creating and consuming a context.

**5. Building Custom Hooks:**

* Abstracting logic into custom hooks.
* Creating reusable hooks for common patterns.
* Best practices for naming and structuring custom hooks.

**6. Handling Forms with useState:**

* Managing form state with useState.
* Controlled components and form validation.
* Handling form submissions.

**7. Optimizing Performance with useMemo and useCallback:**

* Memoization in React with useMemo.
* Preventing unnecessary renders with useCallback.
* Improving the performance of dynamic UIs.

**8. Real-time Updates with WebSocket and useEffect:**

* Integrating WebSocket for real-time communication.
* Using useEffect for WebSocket subscriptions.
* Updating the UI in response to real-time data changes.

**9. Animation and Interaction with useSpring:**

* Introduction to animation in React.
* Utilizing the useSpring hook for smooth animations.
* Creating interactive elements with animation.

**10. Contextual Styling with useTheme:** 

- Managing themes and styles in React. - Using the useTheme hook for dynamic styling. - Adapting the UI based on user preferences.

**11. Testing React Hooks:**

- Writing tests for components using hooks. - Mocking hooks and testing asynchronous code. - Popular testing libraries and tools for React.

**12. Best Practices and Tips:**

 - Guidelines for effective use of React Hooks. - Common pitfalls and how to avoid them. - Tips for organizing and structuring code with hooks.

By exploring the features and use cases of React Hooks, developers can create more modular, readable, and maintainable code for dynamic user interfaces, enhancing the overall user experience of their applications.
Sithub
Published: 2023-12-02 05:50:09

Wanna learn python or any other programming language with expert trainers then visit sithub institute.

## Connect with Us:

Sithub
Email: info@sithub.in 
Website: www.sithub.in
Phone Number: +91-[7210018919](tel:072100 18919)
Location: [32, Gram Sabha, Sewak Park, Uttam Nagar, New Delhi 110059. Nearby Dwarka Mod Metro Station, Pillar No 774](https://www.google.com/maps/place/SITHUB/@28.6263111,77.018266,15z/data=!4m10!1m2!2m1!1ssithub!3m6!1s0x390d052e53236125:0x8e0fe0a057f3cfc7!8m2!3d28.6192453!4d77.0342279!15sCgZzaXRodWJaCCIGc2l0aHVikgEXZWR1Y2F0aW9uYWxfaW5zdGl0dXRpb26aASNDaFpEU1VoTk1HOW5TMFZKUTBGblNVUTFibDh6Y1ZaM0VBReABAA!16s%2Fg%2F11c0wvllp0?entry=ttu)
Establishment Year: 2015
I am a newb. I hope I can swim!
Published: 2023-12-01 15:41:07

    
Like a baby taking his first step for mankind. And Mr. Armstrong on the cheesy moon, I without a clue of what to do am stepping into the magical universe of talking machines. 0s and 1s you say...How do I make sense of it all? I am just a traveling clown who can travel no longer. I am the jester and the bard with a guitar missing a few strings and the voice of a crooked opera tenor. Is it finally my time to sing, "Hello, World!" to my lovely robots? 

I think so. I will learn how to talk to her. Yes, her. I shall name my PC and her name is Lara. I can not talk to girls but I will talk to the machine lady, with... what is this? A "command-line interface". Bravo! 

```
root:/lara $ Echo "Ciao, Lara. Mi chiamo Elk. Piacere di conoscerla. :)"
```

She just repeats it back....

```
root:/lara $ Echo "Come stai? Can you stop repeating me and answer the question?"
```

She repeats the same thing again. I must figure out how to truly communicate with m'lady, Lara. Do not just repeat me. We are not in the 50's.... I'm pondering many googles and moons later.

```
root:/lara $ mkdir romantic_lines
```

If she will only repeat for now, least my eyes can see a romance of texts that I so graciously wrote myself.

```
echo "Are you from tennessee, cus ur the only 10 I see. :D" > cheesy_one_liners.txt
```

This is all for now. Until I can make use of her basic commands echo, touch, cp, mkdir, mv, rm, man, cat, head, tail, more, less and all the same... What a simply complicated machine she is.
Table Subqueries
Published: 2023-12-02 05:49:35

Subqueries, sometimes referred to as inner queries or nested queries, are queries that are embedded within the clause of another SQL query. There are different types of SQL subqueries that are frequently used including Scalar, Row, Column, and Table subqueries.

**_<u>Scalar Subqueries</u>_**
A scalar subquery is a query that returns exactly one column with a single value.

Example:

```
    SELECT column_name [, column_name ]
    FROM   table1 [, table2 ]
    WHERE  column_name operator
           (SELECT column_name [, column_name ]
            FROM table_name 
            WHERE condition);
```
**_<u>Row Subqueries</u>_**

Row subqueries are used to return one or more rows to the outer SQL select query. 

Example:

```
    SELECT column_name [, column_name ]
    FROM   table1 [, table2 ]
    WHERE  (column_name [, column_name ])
          IN (SELECT column_name [, column_name ]
              FROM table_name 
              WHERE condition);
```
**_<u>Column Subqueries</u>_**

Column Subqueries are used to return one or more columns to the outer SQL select query.

Example:

```
    SELECT column_name [, column_name ]
    FROM   table1 [, table2 ]
    WHERE  (SELECT column_name [, column_name ]
            FROM table_name 
            WHERE condition);
```
**_<u>Table Subqueries</u>_**

Table subqueries are used in the FROM clause and return a table that can be used as a table-reference in an SQL statement. 
Example:

  

```
  SELECT column_name [, column_name ]
    FROM
        (SELECT column_name [, column_name ]
         FROM   table1 [, table2 ])
    WHERE  condition;
```
SQL - Numeric Functions
Published: 2023-12-02 05:45:02

**_<u>FLOOR</u>_**

```
FLOOR (number);
```

```
SELECT FLOOR(SalePrice) AS RoundedSalePrice
FROM Orders;
```

**_<u>ABS</u>_**

```
SELECT OrderID, Product, ABS(Quantity) as 'Absolute Quantity'
FROM Orders;
```
**_<u>MOD</u>_**

```
SELECT OrderNumber, MOD(OrderNumber, 7) as result
FROM Orders;
```

**_<u>ROUND</u>_**

```
SELECT ROUND(125.215, -2);
```

**_<u>CEILING</u>_**

```
SELECT ProductName, Price, CEILING (Price) AS RoundedUpPrice
FROM Products;
```
Exploring the Power of CSS Grid Layout for Web Design
Tags: webdev, javascript, programming, beginners
Published: 2023-12-02 05:33:43

"Exploring the Power of CSS Grid Layout for Web Design" delves into the capabilities and advantages of CSS Grid Layout, a powerful tool that has transformed the way web layouts are designed and implemented. Here's an outline of what such an exploration guide might cover:

**1. Introduction to CSS Grid:**

* Brief history and evolution of CSS Grid.
* Differentiating between CSS Grid and other layout methods (e.g., Flexbox, floats).

**2. Understanding the Basics:**

* CSS Grid fundamentals: rows, columns, and grid lines.
* Defining a grid container and grid items.
* Grid tracks, cells, and areas.

**3. Creating Responsive Layouts:**

* Using media queries with CSS Grid.
* Building responsive grids for various screen sizes.
* Leveraging the fr unit for flexible and responsive layouts.

**4. Grid Lines and Gutters:**

* Customizing grid lines and gutters.
* Creating asymmetrical grids.
* Implementing grid gap and grid-template-areas.

**5. Alignment and Justification:**

* Aligning items within the grid.
* Justifying content horizontally and vertically.
* Exploring the justify-content and align-items properties.

**6. Nested Grids:**

* Building nested grids for complex layouts.
* Strategies for organizing content hierarchies.
* Avoiding common pitfalls in nested grid structures.

**7. Grid Template Areas:**

* Utilizing named areas for layout clarity.
* Defining and managing grid template areas.
* Implementing responsive designs with template areas.

**8. CSS Grid and Flexbox Integration:**

* Combining CSS Grid and Flexbox for flexible layouts.
* Choosing the right layout method for specific design elements.
* Practical examples of using Grid and Flexbox together.

**9. Browser Compatibility and Fallbacks:**

* Checking browser support for CSS Grid.
* Implementing fallbacks for non-supporting browsers.
* Progressive enhancement with feature queries.

**10. Animation and Transitions with CSS Grid:**
 
- Adding animation effects to grid layouts. - Transitions between grid states. - Exploring CSS Grid in conjunction with CSS animations.

**11. Best Practices and Tips:**
 - Performance considerations with large grids. - Accessibility in CSS Grid layouts. - Optimizing for search engines and SEO.

**12. Advanced Techniques and Future Trends:**

 - Advanced use cases for CSS Grid. - Upcoming features and specifications related to grid layout. - Integration with emerging web technologies.

By exploring the power of CSS Grid Layout, web designers can gain a deep understanding of its features and capabilities, enabling them to create sophisticated and responsive layouts with efficiency and precision.
Devblog #1: Welcome to Pixelino — The Birth of a Minimalist Pixel Art Drawing Tool
Tags: tooling, programming, opensource, webdev
Published: 2023-12-02 05:31:42


![Pixelino Cover](https://miro.medium.com/v2/resize:fit:720/format:webp/1*snY68kT6BjJ_RyVpBw6aVA.jpeg)

You can follow the project here: https://zitrocodee.itch.io/pixelino

Greetings, technology enthusiasts! 👋 I’m Zitrocode, and I’m thrilled to welcome you to my first devblog. Some of you may already know me from my “[touch-win](https://github.com/zitrocode/touch-win)” and “inkwell” projects (although the latter, sadly, was abandoned). 😔 But today, I’m here to talk about Pixelino, my latest project. I promise this one won’t be abandoned, and to make sure of that, I’ve decided to make it public and keep a devblog of its development. In this space, I’ll share with you the entire creation process of my newest project: Pixelino, a minimalist pixel art drawing tool that will make it easier for people with no prior knowledge to enter this world.

For the past few months, I’ve been training in video game development and have discovered that creating pixel art is an incredibly useful skill in this field and other multimedia projects. However, during my search for pixel art tools, I found that many programs on the market were complicated to use or had a confusing interface for beginners.

That’s when I decided to create my own pixel art drawing tool: Pixelino. With this project, not only can I improve my programming and design skills, but also create an accessible and easy-to-use tool for other pixel art and game development enthusiasts.

With Pixelino, I aim to make the tools easy to find and use, without cluttering the space with tools that could confuse the user. Additionally, my goal is to create a minimalist tool that is accessible for those who are just entering the world of pixel art.

Through this series of devblogs, I’ll show you the entire creation process of Pixelino, from the technical details to the creative decisions behind its design. I’m excited for you to join me on this journey of creation, learning, and fun.

I plan to publish content almost every day so that you can closely follow the creation process of Pixelino and learn from my technical and creative decisions. I’ll show you every step I take in development, from selecting programming and design tools to usability testing and final release.

I want these devblogs to be not only a window into my creative process but also an invitation for us to embark on this exciting journey together. I’d love to hear your thoughts, suggestions, and feedback as we progress through Pixelino’s development. I hope this project will be a source of inspiration and learning for both me and all of you, and together we can create an incredible tool for pixel art.

Thank you for being a part of this project and for accompanying me on this creative adventure! ✨