teleren/devto huggingface dataset:
A 7-Step Overview Of ML Model Deployment
Published: 2022-12-20 09:48:43

The nuances of ML are hard enough locally, but are you tired of dealing with the headache of juggling machine learning development, deployment, and maintenance all on your own? Say goodbye to the days of being a one-man (or woman) ML show and hello to the world of MLOps. In this article, we'll explore an overview of how to deploy an ML model and where to start when youre ready to move from your local environment into the great beyond.

Deploying a machine learning (ML) model typically involves the following steps:

1. Preprocessing the data: The first step is to prepare the data that will be used to train the model. This may involve cleaning and formatting the data, as well as splitting it into training and testing sets.

2. Training the model: Next, the model is trained on the prepared data using a machine learning algorithm. This typically involves adjusting the model's hyperparameters and optimizing its performance.

3. Evaluating the model: After training, the model's performance is evaluated on the testing set to assess its accuracy and identify any areas for improvement.

4. Tuning the model: If the model's performance is not satisfactory, it may be necessary to fine-tune the model by adjusting its hyperparameters or trying different algorithms.

5. Serializing the model: Once the model is performing well, it needs to be saved in a format that can be easily loaded and used for predictions. This is typically done using a process called serialization.

6. Deploying the model: There are several ways to deploy a machine learning model, depending on the requirements of the application. Some options include deploying the model as a web service, integrating it into a mobile app, or using it to make predictions on a server.

7. Monitoring and maintaining the model: After the model is deployed, it is important to monitor its performance and make any necessary updates or adjustments to ensure that it continues to perform well.
How to publish your own Laravel Package on Packagist
Tags: laravelframework, opensource, webdev, laravel
Published: 2022-12-29 03:33:46

---
title: How to publish your own Laravel Package on Packagist
published: true
date: 2022-12-20 09:43:05 UTC
tags: laravelframework,opensource,webdevelopment,laravel
canonical_url: https://blog.devgenius.io/how-to-publish-your-own-laravel-package-on-packagist-ac9a084502ab
---

[![](https://cdn-images-1.medium.com/max/2600/0*TwUr7h0DrslpbAZo)](https://blog.devgenius.io/how-to-publish-your-own-laravel-package-on-packagist-ac9a084502ab?source=rss-17217f29618a------2)

Laravel creates an admin panel from scratch — Part 20

[Continue reading on Dev Genius »](https://blog.devgenius.io/how-to-publish-your-own-laravel-package-on-packagist-ac9a084502ab?source=rss-17217f29618a------2)
Speed up iOS builds by turning off Flipper on CI (complete React Native guide)
Tags: reactnative, ios, ci, flipper
Published: 2022-12-20 09:43:02

---
title: Speed up iOS builds by turning off Flipper on CI (complete React Native guide)
published: true
description: speed up react native ios builds on ci/cd
tags: reactnative, ios, ci, flipper
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83ejpfsie2dm60ofzwn6.png
---




The simple way to speed up `pod install` it's turn off Flipper for CI builds.

1) For old React Native versions `0.68.x` and lower edit your `ios/Podfile`:

```ruby
# ./ios/Podfile
if !ENV['CI']
  use_flipper!()
end
```



2) For React Native `0.69.x...0.70.x`:

```ruby
# ./ios/Podfile
use_react_native!(
  :flipper_configuration => ENV['CI'] ?
    FlipperConfiguration.disabled : 
    FlipperConfiguration.enabled,
  # ...
  # Note: you also can pass extra params
  # FlipperConfiguration.enabled(['Debug', 'Staging.Debug'], { 'Flipper': '0.174.0' })
)
```


3) If you are using modern [React Native `0.71.x`](https://github.com/facebook/react-native/commit/bf6a24bd4660819354cc0a562813590f2abe0164) and higher you can just add one env variable `NO_FLIPPER=1` that prevent installing

```sh
NO_FLIPPER=1 npx pod-install
# or 
export NO_FLIPPER=1 # you can define globally 
pod install --project-directory=ios
# or short
NO_FLIPPER=1 pod install --project-directory=ios

```  

---

## Troubleshooting

If your iOS build will fail with next error 

```
node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPlugin.h:9:9: 'FlipperKit/FlipperConnection.h' file not found

#import <FlipperKit/FlipperConnection.h>
```

It happens because `react-native-flipper` package require installed `FlipperKit` pod but we turn off it on CI.

Solution will be easy, just exclude that module on CI too, you need to edit/add `react-native.config.js` in the root folder of your project:

```js
// react-native.config.js
module.exports = {
  dependencies: {
    ...(process.env.CI // or `process.env.NO_FLIPPER` for RN@0.71.x and above
      ? { 'react-native-flipper': { platforms: { ios: null } } }
      : {}),
  },
  // ...
};
```
Show image after upload without any plugins
Published: 2022-12-20 09:28:53

```
fileBrowseHandler(files: any) {
    if (files.target.files && files.target.files[0]) {
      const reader: FileReader = new FileReader();
      reader.readAsDataURL(files.target.files[0]);
      reader.onload = () => {
        this.preview = reader.result;
      };
      reader.onerror = (error) => {
        console.log('Error: ', error);
      };
    }
  }
```

Here is the explanation for the code above:
1. files.target.files is an array-like object. It contains the files that the user has selected.
2. FileReader object lets web applications asynchronously read the contents of files.
3. reader.readAsDataURL(files.target.files[0]) is used to read the contents of the specified Blob or File.
4. reader.onload is an event handler which is called when the read operation successfully completes.
5. reader.onerror is an event handler which is called when the read operation fails.
6. this.preview is a variable which stores the base64 image data of the selected file.
Prepare for Google Cloud Professional Cloud Architect exam : Regions and Zones
Tags: googlecloud
Published: 2022-12-20 09:02:28

**Regions and Zones**
In case you need to expand your business in other states in the world, you can use regions  to put your business data in the cloud. Thus people in that state can easily get your service then.

Also any server crashes, if you put your files in another zone before the crash, your website or service will still be available then.

Let's understand with a case study:
Assume your service is deployed in a data center of London 

Challenge 1: People in Mumbai or Bangladesh will see a lack in your service due to large distance from the data center.


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

Challenge 2: What will you do if that data center gets crashed?

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

To solve the crashing issue, add another data center as a back up.You can do this using zones. A region can have multiple zones.(Challenge 2 solved!)

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

Another challenge is still remaining.

What do yo suggest?
If we have a data center near India , won't it solve the lacking?


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dlflwep17ztzd1m3xf6i.png)
Challenge 1 is solved!

Challenge 3: What if the entire London data center goes down?
Then Mumbai data center will be handy.

So, we have designed a system fully suitable for our business. Gradually when the business expands, just add more regions.

You can use any cloud providers for setting regions and zones. This is how you will use GCP for that:

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

About GCP zones:

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

For example, here you can see 2 regions (us-west1, europe-north1) with their own zones:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70rfoei4xvjtgkqtb8be.png)
ReductStore Client SDK for C++ v1.2.0
Tags: news, cpp, tutorial, database
Published: 2022-12-20 08:40:39


We are excited to announce the release
of [ReductStore Client SDK for C++ v1.2.0](https://github.com/reductstore/reduct-cpp/releases/tag/v1.2.0)! This release
includes updated
documentation after we renamed the project from "Reduct Storage" to "ReductStore", and supports [ReductStore HTTP API
1.2.0](https://docs.reduct.store/http-api) with the endpoint `GET /api/v1/me`.

<!--more-->

One of the useful features of the ReductStore Client SDK is the ability to retrieve information about the authenticated
user using the `IClient::Me method`. Here is an example of how to use this method:

```cpp
#include <reduct/client.h>

#include <iostream>

using reduct::IBucket;
using reduct::IClient;

int main() {
  auto client = IClient::Build("https://play.reduct.store", {.api_token="my-token"});
  auto [token_info, err] = client->Me();
  if (err) {
    std::cerr << err << std::endl;
    return 1;
  }
  
  std::cout << token_info.full_access << std::endl;
  return 0;
}

```

We hope you find the ReductStore Client SDK for C++ v1.2.0 useful in your projects! Let us know 
if you have any questions or feedback, don't hesitate to reach out in [Discord](https://discord.gg/NQbPeGgzdR) 
or by opening a discussion on [GitHub](https://github.com/reductstore/reductstore/discussions).
Get A Dev Job # 3
Tags: journey, webdev
Published: 2022-12-20 08:26:00

It's December! It's been a busy two months but I am still pressing on! 

I'm so glad that I sustained my commitment to consistently code (with some miss due to emergencies). Here's my Github profile now. 

![github profile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j48kq1g5ll3rhgb49v6n.png)

That 5 days break in November was when I attended  a conference, but the rest was consistent coding. I maintained the website that I created for our school/seminary and added other features to help students. 
Here's the website: [lovegreek](https://lovegreek.vercel.app/).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/94852cr75ubqvi5pww8c.png)

I was also able to apply the features that I stated [here](https://dev.to/jeffchavez_dev/event-timer-o64). That is the ability to change the background. It worth celebrating for me (maybe not that much for others), but I learned to celebrate every milestones. 


![Event Timer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/er1z55f7s8hbpv7m6ttu.png)
I still have other features in mind that I like to implement, but I enjoy its present state. I will still continue my journey until I get that web developer job by God's grace. 


As a Christian, I also write blogs about the goodnews. If you are interested, please read here: [The Glorious Gospel](https://hgcbcc.com/2021/03/04/the-glorious-gospel/)
Kotlin Code Smells 14 - Anonymous Functions Abusers
Tags: kotlin, codesmells, cleancode, programming
Published: 2022-12-21 04:09:01

---
title: Kotlin Code Smells 14 - Anonymous Functions Abusers
published: true
date: 2022-12-20 08:00:45 UTC
tags: kotlin,codesmells,cleancode,programming
canonical_url: https://yonatankarp.com/kotlin-code-smells-14-anonymous-functions-abusers
---

> **TL;DR:** Avoid excessive use of closures and functions. Encapsulate them within objects.

## Problems

* Maintainability
    
* Testability
    
* Code Reuse
    
* Implementation Hiding
    
* Debugging
    

## Solutions

* Wrap functions/closures
    
* Reify algorithms using a [method object](https://maximilianocontieri.com/refactoring-010-extract-method-object) / Strategy pattern
    

## Sample Code

### Wrong

```kotlin
fun sortFunction(
    list: MutableList<Int>,
    fn: (Int, Int) -> Boolean
) {
    for (i in list.indices) {
        for (j in 0 until list.size - i - 1) {
            if (fn(list[j], list[j + 1])) {
                val temp = list[j]
                list[j] = list[j + 1]
                list[j + 1] = temp
            }
        }
    }
}

fun main() {
    val scores = mutableListOf(9, 5, 2, 7, 23, 1, 3)
    sortFunction(scores) { a, b -> a > b }
}
```

### Right

```kotlin
class ElementComparator {
    fun greaterThen(firstElement: Int, secondElement: Int) =
        firstElement > secondElement

    // This is just an example. With more complex objects,
    // this comparison might not be so trivial...
}

class BubbleSortStrategy(
    private val elements: MutableList<Int>,
    private val comparator: ElementComparator
) {
    // We have a strategy; we can unit test it, change it to a
    // polymorphic implementation, or benchmark different algorithms, etc.
    fun sort() {
        for (i in elements.indices) {
            for (j in 0 until elements.size - i - 1) {
                if (comparator.greaterThen(elements[j], elements[j + 1])) {
                    swap(j)
                }
            }
        }
    }

    private fun swap(index: Int) {
        val temp = elements[index]
        elements[index] = elements[index + 1]
        elements[index + 1] = temp
    }
}

fun main() {
    val scores = mutableListOf(9, 5, 2, 7, 23, 1, 3)
    BubbleSortStrategy(scores, ElementComparator()).sort()
}
```

## Conclusion

Humans read code, and while software can handle anonymous functions, maintainability suffers when multiple closures are used. By extracting functionality into objects, we can improve code reuse and maintainability.

---

Stay updated with my latest thoughts and ideas by registering for my [**newsletter**](https://yonatankarp.com/newsletter). Connect with me on [**LinkedIn**](https://www.linkedin.com/in/yonatankarp/) or [**Twitter**](https://twitter.com/yonatan_karp). Let's stay connected and keep the conversation going!

---

## Credits

* [Code Smell 21 - Anonymous Functions Abusers](https://maximilianocontieri.com/code-smell-21-anonymous-functions-abusers) by @[Maxi Contieri](@mcsee)
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes, watercooler
Published: 2022-12-20 08:00:17

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes, #watercooler
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12595d30baa.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ How does a programmer open a jar for their significant other?

___A:___ They install Java
 -->
AWS Community Builders on a Holiday
Tags: aws, awscommunity, cbchristmas2022
Published: 2022-12-20 08:00:00

Hello 👋, this is Abhishek and I am community builder for 3 consecutive years. Here are my few cents on the community builders program!

## What surprises you most about the Community Builders Program?

The sheer amount of helpful content produced by the community builders helping a lot of folks out there without expecting anything in return is commendable and to be praised for always.

## What’s your background and your experience with AWS?
I am a platform engineer by profession and also a backend engineer. Since I started working I only used AWS as my go to cloud provider because of the amount of services and solutions it provides and the community support for the same.

## What’s the biggest benefit you see from the program?
The biggest benefit I see is this program brings the community builders around the globe under one roof and it gives everyone huge opportunity to network with like minded people and the solutions they are building on AWS.

## What’s the next swag item that you would like to get?
I would like to add a builders hoodie or the tumbler which was given out at re:invent to my swag collection. Although Jason and team always surprise with the new items, so open for surprises.

## What are you eating for dinner today? Share the recipe!
I am eating butter chicken today for dinner! For the recipe head over to - [Butter Chicken](https://www.indianhealthyrecipes.com/butter-chicken/)

## Do you have anything else to say about the community builders programme in 2022?
I can't thank enough Jason and team to bring this program to us. Because of this program I am able to grow and reach out to fellow community builders and learn a lot from them. Whenever I feel low on motivation, I go back to Community Builders Slack channel and see what everyone's doing and get my motivation high.
JavaScript course in Scrimba
Tags: javascript, beginners
Published: 2022-12-20 07:55:00

Hi guys! Before i seeing **scrimba** JavaScript i'am very confused to what i do to learn JavaScript. Because, i watched many tutorials in YouTube(in my native language) but i cannot understand why i'am using this method in this place. But after seeing Scrimba's JavaScript course by **"Per Harald Borgen"** i got very clear idea of what is JavaScript and how can i use it in creating a web page. And i also learned to setup GitHub and how to upload in internet. 
Mainly the solo projects are really awesome, Because i'am creating a functional thing from scratch😎. Of course, this is the fantastic course for beginners to learn JavaScript and  Know about GitHub & lot more about how to use google to find answers for your problems(Stack overflow).And last the best course for beginner to start their JavaScript journey.
AWS Community Builders Holidays posts 2022
Tags: cbchristmas2022, aws, awscommunitybuilders, cloud
Published: 2022-12-20 07:55:00

A holiday story of cloud builders, this is the Tejas Gupta edition, check out the other posts from my fellow AWS Community Builders on why they love the program and learn more about them too!

## What surprises you most about the community builders program?
It really surprises me to see how people in community builders program are so helpful. All the community managers are working so hard and never fail to amaze us. Here, everyone is treated equally without considering any other factors.

## What’s your background and your experience with AWS?
I think I am one of the youngest community builders, and I got into this program in my 3rd year of my bachelor's degree. I started my journey with AWS in my 2nd year, and it's never-ending. I've been involved in a number of AWS communities and user groups, as well as internships and freelance work, but the main point is that "I have not yet graduated 😃."
I have done the Cloud Practitioner as well as the Solution Architect; the next one is probably DevOps Professional.

## What’s the biggest benefit you see from the program?
I feel that access to the Slack channel and networking with a lot of builders is the biggest benefit that I got from this program. Also, swags are love 🤩

## What’s the next swag item that you would like to get?
I really wish I could take a picture of myself dressed entirely in AWS swags. That can include a hoodie, joggers, and, most importantly, Sneakers👟.

## What are you eating for dinner today? Share the recipe!
Indian Thali

Allow me to not share the recipe and invite you to my place for dinner!

## Is there anything else you would like to say about the community builders program in 2022?
Hat's off to this community's dedication and helpful nature of everyone. Everyone is equally important to the success of 2022. I really hope that we will grow exponentially in 2023.
Error: Minified React error #130 in vite Projects
Tags: react, vite, javascript, webdev
Published: 2022-12-20 07:27:22

[Show me the fix](#fix)
If you've encountered the [Error: Minified React error #130](https://reactjs.org/docs/error-decoder.html/?invariant=130&args[]=object&args[]=) in your production environment, but not in your dev environment and you are migrating (from CRA) or using "Vite" it is frustrating trying to figure out what the issue is The error itself is quite vague, as it is displayed by minified React rather than any specific React error.i had spent a lot of time debugging this  because i made the fundamental mistake of not following the debugging steps.
lets go through the steps which i should have followed in the first place-

1. Debug the app and get more details. To do this, use minify, sourcemap, and dev mode in your `vite.config.js` file:
```javascript
export default defineConfig({
  plugins: [reactRefresh()],
  mode: "development",
  build: {
    minify: false,
    sourcemap: true 
  }
});
```
You may be able to pinpoint the buggy code by inspecting the console.[eg](https://github.com/vitejs/vite/issues/2139#issuecomment-802981228)

2. If you can't find the buggy code, try reproducing the bug with minimal code. Start by commenting out imports and their dependent code. This error often occurs in older npm libraries, so start with the oldest library you are using in `package.json`. This can be time-consuming, but it's worth it to find the root cause of the issue.

3. Once you've identified the problematic npm library, you have two options: update the package to the latest version and see if the bug is fixed, or use the hack suggested by the [maintainers:](https://github.com/vitejs/vite/issues/2139#issuecomment-802981228)

## Workaround <a name="fix"></a>
```javascript
import Something from "library";
const UseThis = Something.default ? Something.default : Something;
```
OR 
```javascript
import RPI from "react-phone-input-2";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const ReactPhoneInput = RPI.default ?? RPI;
```
Or like me you may also choose to delete the dependency from your project altogether.
___
## Why this occurred
> The root problem is that many packages follow a bad practice that breaks Rollup ESM-CJS interop - [sodatea](https://github.com/vitejs/vite/issues/2139#issuecomment-1024852072)
and Vite (which uses Rollup) handles default exports differently than CRA (which uses webpack or esbuild)

This is an open issue in the [Vite repo](https://github.com/vitejs/vite/issues/2139) This is an open, so if any future updates resolve it i will update this blog.