teleren/devto huggingface dataset:
Improving build times with Docker Layer Caching
Published: 2023-03-23 08:55:29

An important concept in container image building is layer-caching. It is important to understand in order to optimize your build times and to streamline your CI/CD workflows.

In this post, we'll be taking a look at three different aspects of layer-caching:

1. Optimizing dockerfiles to re-use the maximum number of layers.
2. Layer-caching between two different images using `--cache-from`.
3. Using BuildKit's inline cache. 
 

## Understanding Layers
Let's take a look at an example of a simple dockerfile:

```
# pull base image
FROM ubuntu:latest

# install wget
RUN apt-get update && \
    apt-get -y install wget
```
Here, we can observe two layers. The first one pulls the base image, and the second one installs wget. 

With layer caching, our aim is to build a minimal amount of layers in each build, while re-using previous layers as much as possible. In essence, we're trying to reduce the number of steps in our build process.


## Optimizing Dockerfiles to re-use layers
If we build the simple dockerfile we took as an example above, it will take a few seconds for the base image to be pulled. If we change the second layer to:

```
# install wget and nginx
RUN apt-get update && \
    apt-get -y install wget && \
    apt-get -y nginx
```
And then re-build, we will see that only the second layer will be run again, and the base image will _not_ be pulled again. This is because the first layer has been cached and is being re-used.

However, if we change our first layer, we will be _invalidating_ all subsequent layers that come after it. 

```
# pull different image
FROM ubuntu:18.04

# install wget nginx
RUN apt-get update && \
    apt-get -y install wget && \
    apt-get -y nginx
```
This time, all layers after the first layer will be built again. 

Keeping this in mind, we should always try to follow the two following best practices:
1. Keep commands that are not likely to change at the start of the dockerfile.
2. Commands that are going to change often should ideally be near the end of the dockerfile.

## Using layer-caching between Images
If there is an image that has already been built and it shares some of the layers with your own dockerfile, you can use that image as part of the build cache with the help of the `--cache-from` flag. 

For example:

```
IMG="my-image"

# Pull an existing image
docker pull ${IMG}:old-ver

docker build --cache-from ${IMG}:old-ver -t ${IMG}:new-ver .
```

## BuildKit Inline Cache
The problem with the above approach is that it requires us pulling an image from a remote registry first. By using BuildKit's inline cache, we can cache images to our local registry in order to avoid expensive pull operations. 

```
export DOCKER_BUILDKIT=1

# Build and cache image
$ docker build --build-arg BUILDKIT_INLINE_CACHE=1 .

```
How quantum computing can revolutionise AI algorithms
Tags: quantum, ai, algorithms, quantumcomputin
Published: 2023-03-23 08:50:42

Quantum computing has the potential to revolutionise AI algorithms in several ways. By exploiting the principles of quantum mechanics, quantum computers can process and analyse vast amounts of data at speeds that are currently unattainable by classical computers. Here are some ways quantum computing can bring about significant improvements in AI algorithms:

**Faster processing and training:** Quantum computers use qubits instead of classical bits, which allows them to perform multiple calculations simultaneously. This parallelism enables quantum computers to solve complex problems and process large datasets much faster than classical computers. As a result, AI models can be trained more rapidly and efficiently.

**Enhanced optimization:** Many AI problems, such as combinatorial optimization, can be mapped onto quantum computing frameworks. Quantum computers can explore multiple solutions concurrently, allowing them to find the optimal solution more effectively than classical computers. This capability can enhance AI algorithms that rely on optimization, such as those used in machine learning and operations research.

**Improved accuracy and precision:** Quantum computing can potentially improve the accuracy and precision of AI algorithms by reducing errors and noise in data processing. Quantum error correction techniques can help minimize the impact of noise and other errors that may arise during computation, leading to more reliable AI models.

**Quantum machine learning:** Quantum computing can enable the development of new quantum machine learning algorithms that exploit quantum phenomena, such as entanglement and superposition. These algorithms can enhance the performance of machine learning models, enabling them to learn complex patterns and make predictions more effectively.

**Solving intractable problems:** Some problems are considered intractable for classical computers due to the exponential growth of computational resources required to solve them. Quantum computing has the potential to tackle these problems, opening up new possibilities for AI algorithms in areas like cryptography, optimization, and simulation.

**Expanding AI capabilities:** The integration of quantum computing can allow AI algorithms to solve problems previously considered out of reach. For example, quantum computing can potentially enable AI models to simulate quantum systems, opening up new research opportunities in fields like materials science, drug discovery, and climate modeling.

Overall, the integration of quantum computing into AI algorithms can lead to faster, more efficient, and more accurate models. As quantum computing technology continues to advance, we can expect to see significant improvements in AI capabilities and applications across various domains.
Laravel Extract Language to lang files
Tags: laravel, package, language, extract
Published: 2023-07-11 14:21:01

---
title: Laravel Extract Language to lang files
published: true
date: 2023-03-23 08:46:00 UTC
tags: Laravel, Package, Language, Extract
canonical_url: https://dcblog.dev/laravel-extract-language-to-lang-files
---

 ![Laravel Extract Language to lang files](https://dcblog.dev/images/posts/laravel-extract-language-to-lang-files.png) 

If you've already used JSON lang in your views, here's a handy package to extract all lang keys to language files. The package exports all your `__(‘some text’)` calls to language files.

https://github.com/kkomelin/laravel-translatable-string-exporter

Here's a video demo.

https://www.youtube.com/watch?v=AA2m-FzkuCw
GitHub Copilot X 🔥
Tags: webdev, programming, productivity, discuss
Published: 2023-03-23 08:43:36

## Introduction

GitHub has recently launched a new AI-powered coding tool, GitHub Copilot X. It is a collaboration between GitHub and OpenAI, and it is designed to help developers write better code, faster. The tool uses machine learning to provide suggestions and autocompletions for code as the developer types. In this blog post, we will discuss the features of GitHub Copilot X and its impact on the coding community.

## Improved Code Suggestions

GitHub Copilot X offers improved code suggestions that are more accurate and context-sensitive. The tool uses machine learning algorithms to understand the context of the code and provides suggestions that are relevant to the current code. This means that developers can write code faster and with more confidence, as they don't have to spend time searching for the right code snippets or syntax.

## Increased Efficiency

With GitHub Copilot X, developers can write code more efficiently. The tool provides suggestions for code snippets, functions, and entire classes, making it easier to write complex code. It also helps developers to avoid common mistakes and typos by suggesting corrections as they type. This increases the efficiency of the coding process and allows developers to focus on the logic and functionality of their code.

## Future of AI in Coding

GitHub Copilot X is a significant step forward in the use of AI in coding. It demonstrates the potential for machine learning algorithms to assist developers in writing better code. As the tool continues to learn and improve, it has the potential to revolutionize the coding process, making it faster, more efficient, and more accessible to everyone.

## Conclusion

In conclusion, GitHub Copilot X is a groundbreaking tool that has the potential to change the way we write code. Its improved code suggestions and increased efficiency make it a valuable addition to any developer's toolkit. As AI continues to advance, we can expect to see more tools like GitHub Copilot X that help us to write better code faster and with more confidence.
Tauri will be bigger than Flutter and Electron in 2 years
Tags: tauri, crossplatform, webdev, applicationdevelopment
Published: 2023-03-23 08:40:36

Tauri is a cross-platform framework that provides a way to create secure, performant, and lightweight applications with modern web technologies. It is designed to help developers build applications that can run on all major operating systems and web browsers.

Tauri has been gaining traction in the development community, with strong support from open source communities and notable companies, such as Microsoft and Mozilla. As more developers learn about and use Tauri, its popularity will continue to grow.

Tauri also has the potential to revolutionize the way developers build applications. With its ability to create applications that are secure, performant, and lightweight, it could become the go-to framework for developers looking to build modern applications that can run on multiple platforms.

In short, Tauri is a promising cross-platform framework that has the potential to become the industry standard for modern application development. 

#Tauri #CrossPlatform #ApplicationDevelopment #WebTechnologies
Effortless Language Redirection - TYPO3 Extension
Tags: opensource, typo3, php, github
Published: 2023-03-23 08:27:09

## Introduction

Hello fellow TYPO3 enthusiasts! I had the pleasure of cooperating with my colleague @malteriechmann to create a TYPO3 extension called `t3languageredirection`, which provides an effortless and dependable way to redirect users to their preferred language. In this blog post, we will take a look at this simple project, and reveal how it can add user-friendliness to your multilingual website.

## What does `t3languageredirection` actually do?
This **open-source** extension, will configure a new frontend middleware that automatically redirects users to the appropriate language version of your website based on their browser's Accept-Language header.

The `LanguageRedirectionMiddleware` is implemented using the [PSR-15](https://www.php-fig.org/psr/psr-15/) middleware interface, making it easy to integrate into your existing TYPO3 project.


## Why `t3languageredirection`?
Unlike other TYPO3 redirection extensions, t3languageredirection does not require any additional configuration and is not dependent on the user's IP address. Additionally, it is designed to be independent of the underlying web servers, providing a flexible and adaptable solution.

Using `t3languageredirection` will improve the user experience of a website and make it more accessible to a wider audience. Whether your website is a small blog or a large e-commerce site, this extension is a nice-to-have tool for anyone looking to create a multilingual TYPO3 website.

## How to use `t3languageredirection`?

To get started, simply install the extension using Composer:

```
composer require visuellverstehen/t3languageredirection
```

After installation the middleware will automatically handle language redirection. This means that visitors to your site will be redirected to the language version that best suits their needs without any additional effort on your part.


## Conclusion

The `t3languageredirection` extension simplifies the language redirection of your multilingual website with easy installation, automatic redirection, and seamless compatibility with any hosting environment. The extension is still in the testing phase, and we are constantly working to refine and improve its functionality.

Feel free to utilise it or to give us feedbacks, and if you could star the repository, we would appreciate it:

https://github.com/visuellverstehen/t3languageredirection
Remix without Limits on vercel
Tags: vercel, react, javascript, webdev
Published: 2023-03-23 08:26:42

Vercel just announced some exciting new features to their Remix platform, an integrated development environment for front-end developers. With the latest updates, Vercel now supports Streaming SSR, Advanced Caching, Data Mutations and API Routes. 

Remix without Limits allows developers to quickly build, test and deploy full-scale applications without the need for manual scaling or resource provisioning.

Streaming SSR (Server Side Rendering) is a feature that lets developers render their application on the server, providing instant page loads and improved search engine optimization (SEO).

Advanced Caching allows developers to cache their application data and serve it quickly and consistently. This allows for better overall performance and faster response times.  

Data Mutations provide developers with a way to modify data on the server-side, which can be used for secure data management and secure transactions.

Finally, API Routes provide developers with a way to connect their applications to external services, like databases, APIs and third-party services.  

Vercel's Remix platform is a great tool for developers looking to quickly and easily develop and deploy applications. With the latest updates, developers now have even more control over their applications, allowing them to build powerful, secure and performant applications with ease.

What is [Remix](https://remix.run/)?

> Remix is a full stack web framework that lets you focus on the user interface and work back through web standards to deliver a fast, slick, and resilient user experience. People are gonna love using your stuff.

Remix is an open source framework created by Ryan Florence and Michael Jackson, well known in the React ecosystem for maintaining React Router, the most widely used routing library for React.

The company supporting the Remix core team’s activities was acquired in October 2022 by Shopify, and Remix is now used as foundations for Shopify’s Hydrogen framework. This acquisition and actions taken since the merger makes us confident in Remix’s open source future.

[remix.run](https://remix.run/) 

#react #opensource #userexperience #development #seo #searchengineoptimization #work #future #love #streaming #javascript #vercel #shopifystore #shopify
Python's MicroPython Microcontroller Programming Merits annd Demerits
Published: 2023-03-23 08:17:55

MicroPython is a version of the Python programming language that has been optimized for use on microcontrollers, such as the ones commonly used in embedded systems and IoT devices. MicroPython provides a compact and efficient way to write code for microcontrollers and is easier to learn than low-level languages such as C and assembly language. Here are some of the merits and demerits of using MicroPython:

Merits:

Easy to learn: Python is known for its simplicity and ease of use, and MicroPython is no exception. The syntax is similar to that of regular Python, making it easy for developers who are already familiar with Python to get started with MicroPython.

Compact and efficient: MicroPython has been optimized for use on microcontrollers with limited resources, such as RAM and flash memory. As a result, it is very compact and efficient, making it ideal for use on low-power devices.

Rapid prototyping: MicroPython makes it easy to quickly prototype and test ideas on microcontrollers. Developers can write and test code directly on the microcontroller, eliminating the need for a separate development board or computer.

Large library support: MicroPython has a large and growing library of modules that provide support for a wide range of sensors, displays, and other peripherals commonly used in embedded systems.

Demerits:

Limited performance: While MicroPython is efficient compared to other high-level programming languages, it still cannot match the performance of low-level languages such as C or assembly language. This can be a limiting factor for applications that require high performance or real-time processing.

Limited memory: Microcontrollers typically have limited memory, and MicroPython may require more memory than other low-level languages. This can be a problem for applications that require a lot of memory, such as image or audio processing.

Limited hardware support: While MicroPython has a large library of modules, it may not have support for all the hardware components required for a specific application. In such cases, developers may need to write their own drivers or use a different programming language.

Overall, MicroPython can be a great option for developers who want to write code for microcontrollers using a high-level programming language. It provides a simple and efficient way to prototype and test ideas and has a growing library of modules for commonly used peripherals. However, developers should be aware of its limitations in terms of performance and memory and carefully consider whether it is the best option for their specific application.
LeanGUI review? Should I use it in a Framework used in multiple projects?
Tags: unity3d
Published: 2023-03-23 08:02:55

As a game developer, I create new projects on a monthly basis and have been attempting to create a Unity framework that encompasses all of the common elements utilized in each project, such as a GameManager and SoundManager.



In order to streamline the process, I was interested in developing a UI library featuring the primary components frequently used in games. However, I decided to investigate if such a library already exists and stumbled upon

LeanGUI - https://assetstore.unity.com/packages/tools/gui/lean-gui-72138.



Despite its existence, there appears to be minimal information available regarding its effectiveness or user experience. If anyone has incorporated LeanGUI into their projects at various levels, whether as a novice or professional, I would appreciate hearing about their impressions.



Additionally, I would be grateful for any recommendations regarding similar Full Game Frameworks that are already available for use.
Days_12 Find All the Bugs
Published: 2023-03-23 07:50:15

This course has taught you to squash bugs like a true programmer. Find the errors and start debugging like a pro 

```
#Find All the Bugs
#
#22 MARCH 2023

print("100 Days of Code QUIZ")
print()
print("How many can you answer correctly?")
ans1 = ("What language are we writing in?")
if ans1 == "python":
  print("Correct")
else:
  print("Nope🙈")
ans2 = input("Which lesson number is this?")
if(ans2>12):
  print("We're not quite that far yet")
elif(ans2==12):
  print("That's right!")
else:
  print("We've gone well past that!")
```
Your Shortcut to Becoming a Contributor in Google Summer of Code
Tags: postman, opensource, programming, beginners
Published: 2023-03-23 07:48:30

Here's a shortcut to your participation in Google Summer of Code. Or is it? The following points are the absolute must-have-dones for a successful application. And yes, please do apply. All former participants that I have talked to say it has been more than worth their time. 

📖 Take 20 minutes to read into GSoC. What it is and terms and conditions. You don't need to know every detail, but you should have a basic understanding of how it works. 
https://summerofcode.withgoogle.com/

📁 Check out our suggestions for projects. If you don't find anything in there, don't give up. Browse other organisations. Open Source needs you, no matter where you eventually find your sweet spot. But we at Postman are definitely the best place for APIs. https://github.com/postman-open-technologies/gsoc-2023/issues

🎙️ Get in touch with a mentor on the project(s) of your choice. You can only apply to 3 projects, so you better know who you are committing to work with. How to find a mentor? Identify them on the issues and dedicated repos, and hit them up here or on the projects' channels (could be Slack or Discord or a forum. You will learn this from the issue/repo). Ask them if they think your skillset matches the project.

🧪 Try yourself out. There will be micro-tasks and first issues on the repo. This will help you make your first steps in Open Source as well as understand if this project is a fit for you. 

🪪 Register and apply on the [GSoC website](https://summerofcode.withgoogle.com/register/contributor). You can modify your application until April 4. Don't worry if you don't have all the details ready yet. But start with something that doesn't make mentors ignore your submission (like only uploading a CV instead of an application pdf, or skipping on the details of your proposal). Expect 1h and likely more for this step. But the earlier you get to actually submitting your proposal, the better, as it creates better visibility.

👷 Continue to update your application, and stay in touch with the mentors. Engagement in the existing community is key.

🏆 You got this! 🏆
What is the difference npm build and npm run build?
Published: 2023-03-23 07:48:05

One more thing, npm build and npm run build are two different things, npm run build will do custom work written inside package. json and npm build is a pre-defined script (not available to use directly).

Resource
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiAnbHGx_H9AhWexgIHHUu6AsIQFnoECAsQAQ&url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F43664200%2Fwhat-is-the-difference-between-npm-install-and-npm-run-build&usg=AOvVaw3u7JIq9QOJYXkUCxvrDsqn
Rerun only Failed Tests in Robot Framework
Tags: robotframework, webtesting, qualityengineering
Published: 2023-03-23 07:31:34

Sometimes correctly written test cases can fail in robot framework. This could be caused by a couple of reasons including but not limited to:

- Network failures - leading to a time out
- Software failures

In such a case, there arises a need to rerun only the failed test cases and generate a report that combines the results. Sit tight as I guide you on how to do this (and become a master in 4 seconds  :smile:)

**_1. Run Your Tests_**

Let’s use a simple sample robot project as below. There are 3 test cases in TC1.robot.

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


After running the tests, assume one test case fails due to  a network error as below:

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

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

**_2. Rerun the Failed Test Case_**

To rerun only the failed test cases, run the command: 

`robot --rerunfailed output.xml --output output2.xml TC1.robot`

output.xml is the output of our first run, while output2.xml is where we want to store the output of our second run.


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


Only the one failed test case has been run

**_3. Combine the outputs_**

To combine the two runs and have a combined report, run the command: 

`rebot --output output.xml --merge output*.xml`


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

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

Yehey, :relaxed: , simple, right?
Cara Share Screen Google Meet dari Laptop/PC dan HP
Published: 2023-03-23 07:27:46

Salah satu platform yang banyak digunakan untuk mengadakan rapat online yaitu Google Meet. Sebelum gabung ke rapat, ada baiknya kamu mengetahui cara share screen Google Meet. Google Meet memungkinkan pengguna melakukan tatap muka real time secara daring. Sehingga platform ini banya dipakai untuk mengadakan meeting... more [https://wigatos.com/21634-cara-share-screen-google-meet/
](https://wigatos.com/21634-cara-share-screen-google-meet/)