teleren/devto huggingface dataset:
Being a Developer Advocate: Half a Year Review
Tags: devrel, learning, learninpublic
Published: 2023-06-30 14:14:28

I blinked and six months are already gone since I plunged head first into Developer Relations as a single Developer Advocate at a small startup.

In hindsight it was clear that it would have been a lot easier with a whole team already in place to learn from 😋

But at that time it was exactly what I needed: The freedom to learn in every direction possible and expand my knowledge in all of the ways in an area I deeply care about!

I got to do so many things:

* Building Developer Docs from the ground up using Docs-As-Code
* Giving a ton of presentations at conferences and on company workshops
* Hosting events
* Sketchnoting our Meetup
* Hosting a podcast and learning about the distribution of it
* Creating a 15 Episodes strong YouTube short-form series about the companies product by doing everything from scripting to thumbnails to postproduction and promotion
* Writing a ton of technical blog posts
* Passionately advocating internally for our users
* Improving the developer experience as much as I possibly could

## What I most enjoyed?
Helping humans to succeed is the best possible feeling you can get in my opinion 🥰

Doing it while also being allowed to work with code and docs is the perfect combination! Nothing beats being able to geek out about machine-learning stuff on a podcast, then getting feedback from users on how to improve your product afterwards. Finding a quick fix for it you can document quickly in the docs and then communicate the overall problem to product/engineering for improvement.

It is this mix of cross-functional skills and impact you can have when you do it well that feels like a superpower.

At the same time it can make you feel helpless because all you can do is __try__ to influence without the assurance it will actually achieve your desired outcome.

## What I hope to achieve in the next 6 months?
So now that I know what I enjoy and hopefully also excel at, I will work hard to professionalize it.

At the moment a lot of things are not automated and time consuming. Publishing blog posts for example means publishing them manually on every platform. Then doing the social media posts manually.

I also hope to build more. By learning all the basics building time with our tool and also coding in general was not enough. Not losing touch with coding is a major challenge I want to solve by actually building stuff consistently.

Also a goal will be to do a talk at a meetup or if even possible at a conference about DevRel. I really enjoy geeking out about docs and metrics and I believe this is something to explore further and talk about.

So if you want to geek out about DevRel, docs, metrics or anything else: Hit me up and I am happy to join!
PyLadies Dublin Feb 2023 Meetup
Tags: pyladies
Published: 2023-06-30 14:09:46

Note: I'll be uploading videos (uncut for now until I get a hang of davinci resolve). You can also find them on our youtube channel, I try to add chapters for these videos.

{% embed https://youtube.com/@PyLadiesDublin %}

---

Thanks to everyone who joined us. A huge thank you to both our speakers, [Nabanita Roy](https://github.com/royn5618) and [Michael Twomey](https://www.twoistoomany.com/).

You can find announcements, slides and code via https://github.com/pyladiesdublin/feb-talks-2023
@validates
Published: 2023-06-30 14:07:29


Form validation is a critical aspect of web development, ensuring that user-submitted data meets specific requirements or constraints. In Flask, a popular Python web framework, form validation can be made even more effortless and concise with the help of the @validates decorator.

The @validates decorator is a powerful tool provided by the SQLAlchemy library, which is commonly used in Flask applications. It allows you to define custom validation rules for specific attributes or fields within a model or class.

Here's how the @validates decorator can simplify this process:

    @validates('age')
    def validate_age(self, key, value):
        if not (11 < value < 18):
            raise ValueError(f"Must have an age between 11 and 18 years old.")
        return value`


In the code above, we define a User model with an "age" attribute. By using the @validates decorator on the validate_age method, we specify that this method should be invoked whenever the "age" attribute is set or updated. Inside the method, we perform the custom validation logic, raising a ValueError if the age is outside the desired range. If the validation passes, the method returns the validated value.

The @validates decorator offers several benefits when it comes to form validation in Flask. With @validates, you can encapsulate validation logic within your models or classes, making it easier to maintain and reuse.

By raising specific exceptions within the validation methods, you can provide meaningful error messages to guide users in correcting their inputs.

Since @validates is part of SQLAlchemy, it seamlessly integrates with Flask's database functionality, allowing you to enforce validation rules directly at the model level.

The @validates decorator in Flask provides a convenient way to define custom validation rules for model attributes or fields. It simplifies the form validation process and improves code organization by encapsulating validation logic within the relevant models or classes. By using @validates, you can ensure that user-submitted data meets specific criteria, enhancing the overall robustness and integrity of your Flask application.

Validation is a crucial step in any web application to ensure data accuracy and security. With the @validates decorator in your Flask arsenal, you have a powerful tool to simplify and streamline the form validation process.
[Digest] Java, Kotlin, Spring, Cloud, and More - Episode 2
Tags: digest, java, cloud, spring
Published: 2023-06-30 14:07:22

Hi there! Another issue of the weekly digest is here 🤓

💾 [The best way to use one-to-one table relationships](https://vladmihalcea.com/one-to-one-table-relationships/): how one-to-one table relationship can improve performance.

🦄 [Unique Identifiers Based on Timestamps in Distributed Applications](https://foojay.io/today/unique-identifiers-based-on-timestamps-in-distributed-applications/): an approach of generating an 8-byte lightweight unique identifier efficiently.

🦄 [Analyzing New Unique Identifier Formats (UUIDv6, UUIDv7, and UUIDv8)](https://blog.devgenius.io/analyzing-new-unique-identifier-formats-uuidv6-uuidv7-and-uuidv8-d6cc5cd7391a): and another post about unique identifiers - nice overview of new UUID specifications.

🌱 [Securing Spring Boot Applications With SSL](https://spring.io/blog/2023/06/07/securing-spring-boot-applications-with-ssl): how Spring Boot 3.1 makes SSL configuration easier.

☕️ [Java 21 in Practice, Virtual Threads, Structured Concurrency, and Scoped Values](https://medium.com/javarevisited/java-21-in-practice-virtual-threads-structured-concurrency-and-scoped-values-8d16084dbbf2): an overview of Java 21 concurrency-related features with code samples.

---

*Dream your code, code your dream.*
Securely Storing API Keys in Flutter
Tags: flutter, security, dart, envied
Published: 2023-06-30 13:29:45




Protecting API keys is crucial to ensure the security of your Flutter applications. In this article, we will explore a practical approach for securely storing API keys by utilizing environment variables, obfuscation, and automation. By following these best practices, you can safeguard sensitive information and minimize the risk of unauthorized access or data breaches.

## Step 1: Create a .env File and Add it to .gitignore

To begin, create a .env file in the root directory of your Flutter project. This file will store your API keys in plaintext format. It's important to add the .env file to your project's .gitignore file. This prevents the file from being accidentally committed to version control and exposed to others.

![flutter secret.env file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v36pp0q4inor1pgkb14p.png)

**You can add your key in secret.env file**
```
MY_KEY=a1b2c33d4e5f6g7h8i9jakblc
```

## Step 2: Add the following packages in your pubspec.yaml

1. [ENVied](https://pub.dev/packages/envied) Package in dependancies. 
2. [envied_generator](https://pub.dev/packages/envied_generator) Package in dev_dependancies.
3. [build_runner](https://pub.dev/packages/build_runner) Package in dev_dependancies.

## Step 3: Create an env.dart File

Create an env.dart file in your project, preferably in a dedicated config or utils directory. This file will define a class called Env, which will hold the API keys as properties. For example:

```
import 'package:envied/envied.dart';
part 'env.g.dart';

@Envied(path: '../note_keeper_flutter_app/secret.env')  //Path of your secret.env file
abstract class Env{
  @EnviedField(varName: 'MY_KEY',obfuscate: true)
  static const myApiKey=_Env.myApiKey;
}
```

## Step 4: Generate the Code

Run the code generator by executing the command. 

```
flutter pub run build_runner build --delete-conflicting-outputs
```

This generates a env.g.dart file that contains abfuscated value of your keys.

```
// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'env.dart';

// **************************************************************************
// EnviedGenerator
// **************************************************************************

class _Env {
  static const List<int> _enviedkeymyApiKey = [
    1381461286,
    2322593563,
    1978670197,
    2411908773,
    2066599044,
    2426385646,
    3978051006,
...];
 static const List<int> _envieddatamyApiKey = [
    1381461319,
    2322593578,
   ...];

  static final String myApiKey = String.fromCharCodes(
    List.generate(_envieddatamyApiKey.length, (i) => i, growable: false)
        .map((i) => _envieddatamyApiKey[i] ^ _enviedkeymyApiKey[i])
        .toList(growable: false),
  );
```

## Step 5: Import env.dart and Access API Keys

In the relevant files of your Flutter project where you need to access the API keys, import env.dart as follows:


You can then access the API keys using the Env class, like this:

```
String apiKey = Env.myApiKey;
```
Now your keys will be more protected inside your project.
Xamarin/C# app
Tags: xamarin, csharp
Published: 2023-06-30 13:22:09

I am developing an application in Xamarin/C# and I need to receive a JSON from an API that monitors a MySQL server, regardless of whether the application is running or not, and depending on the return, display a notification with a message. Where can I find some guide to do this? I cant find examples to do this.
Feature selection and Engineering in supervised classification and regression
Published: 2023-06-30 12:46:51

**- Feature selection and engineering:**
+ Feature selection is a process of identifying and selecting the most relevant features from a dataset.
+ Relevant features are those that are most likely to be predictive of the target variable.
+ Irrelevant features are those that are not predictive of the target variable or that add noise to the data.
+ Feature selection can improve the performance of machine learning models by reducing overfitting and improving the interpretability of the models.
+ There are a number of different feature selection methods available, each with its own advantages and disadvantages.

**- Classification and regression using supervised learning**
+ Supervised learning is a type of machine learning where the model is trained on a dataset of labeled data. The labeled data consists of pairs of inputs and outputs, where the input is a vector of features and the output is a scalar value.
+ Classification is a type of supervised learning where the goal is to predict the class of an input. The class is a categorical variable, such as "red" or "blue".
+ Regression is a type of supervised learning where the goal is to predict a continuous value. The continuous value can be anything from a number to a probability.
+ Supervised learning algorithms are trained on a dataset of labeled data. The algorithm learns the relationship between the inputs and outputs, and then uses this relationship to make predictions on new data.
+ There are many different supervised learning algorithms available, each with its own strengths and weaknesses. Some of the most common supervised learning algorithms include:
  - Decision trees
  - Support vector machines
  - Random forests
  - Neural networks
20+ Thought Leaders from India’s Top Companies are speaking at TribeQonf
Tags: javascript, testing, automation, eventdriven
Published: 2023-06-30 12:21:40

I am thrilled to share some exciting news with you. TribeQonf, a prestigious event featuring over 20 Thought Leaders from India’s Top Companies, is just around the corner, and I would be delighted if you could join me for this incredible experience.

TribeQonf promises to be an inspiring and insightful event, with renowned speakers from various industries sharing their expertise, experiences, and visions for the future. It’s a unique opportunity to gain valuable insights, network with influential professionals, and discover groundbreaking ideas that can propel our own growth and success.

**URL to registered**
**[URL to registered](https://www.thetesttribe.com/tribeqonf/?sld=kailashpathak)**


**Get Extra Discount**
Get Extra 15% Discount using the coupon code mentioned below

Coupon Code KailashTQF
Flutter
Published: 2023-06-30 12:21:32

As a Flutter Mobile Developer, I would like to share with you some knowledge about Flutter. To begin with, I must tell you that Flutter is an open-source framework developed by Google for building cross-platform applications for Android, iOS, web, and desktop. Here are some key elements to understand Flutter:
Programming Language: Flutter uses the Dart programming language, also developed by Google. Dart is a modern and easy-to-learn language for developers.
Widgets: Flutter uses a widget system to build the user interface of the application. Widgets are reusable visual elements such as buttons, text, images, and much more. Widgets can be combined to create complex user interfaces.
Architecture: Flutter uses a "Stateful Widget" architecture to manage the state of the application. Stateful widgets have a state that can be modified and triggers an update to the user interface. This architecture enables the creation of dynamic and reactive applications.
Hot Reload: Flutter has a development tool called "Hot Reload" that allows you to modify the application code in real-time without having to restart it each time. This significantly speeds up the development and testing process.
Community: Flutter has a large community of active developers who share resources and knowledge. There are many online resources, including tutorials, videos, and blogs, to learn Flutter.
I hope this gives you a good introduction to Flutter! Soon we will have a lot to talk about regarding this framework. If you have any further questions, please don't hesitate to ask.

#developer #share #android #programming #architecture #community #ios #google
How to build a GET Api using Flask
Published: 2023-06-30 12:20:40

In order to make a GET request in a front end React application from the server, the server needs to be set up in that it sends an object array in JSON format. On the front end, you might see something like this:

```
function tripList() {
  const [trips, setTrips] = useState([]);

  useEffect(() => {
    fetch("http://localhost:4000/trips")
      .then((r) => r.json())
      .then((trips) => setTrips(trips));
  }, []);

  return (
    <section>
      {trips.map((trip) => (
        <TripItem key={trip.id} trip={trip} />
      ))}
    </section>
  );
}
```
To set up the back end of the GET request, there are some initializers to be set up first. At the top of an app.py file, you will start with something that looks like this:

```
from flask import Flask, jsonify, make_response
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate

from models import db, User, Review, Game

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.json.compact = False

migrate = Migrate(app, db)

db.init_app(app)
```
Using jsonify allows us to serialize our arguments (lists or dictionaries) as JSON and subsequently returns a response. make_response is what is used to send back the data. To begin setting up the GET request, we can start by settings up an @app.route('/trips') to our list of trips. From there, we want to define a function called def trips. Next, the idea is to grab all of the trips that we have a put them in a list, which we will then jsonify and send the response via make_response. To begin, we want to set up an empty list and set it equal to a variable such as "trips". Next, we will use query to get all of our trips which will look like: Trips.query.all(). However, it's important to serialize each trips in all trips and to resolve that issue we can create a for loop. Within the for loop, the next step is to create the dictionary object for the trip. For example:

```
for trip in Trips.query.all():
    trip_dict = {
       "date": trip.date,
       "location": trip.location
    }
```
Next, we want to append these trip_dict's to the empty list that we created. After that, we can create a variable called "response" and set it equal to make_response(jsonify(trips), 200). Lastly within the function we want to return the response! This is how you set up a GET request in Flask. See below for the full code under @app.route. 

```
@app.route('/trips')
def trips():

    trips = []
    for trip in Trip.query.all():
        trip_dict = {
            "date": trip.date,
            "location": trip.location,
        }
        trips.append(trip_dict)

    response = make_response(
        trips,
        200,
        {"Content-Type": "application/json"}
    )

    return response
```
My Test Page
Published: 2023-06-30 12:20:13

---
title: My Test Page
published: true
description: My Description
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-06-30 12:12 +0000
---
# Heading 1
## Heading 2
### Heading 3
### Heading Id {#custom-id}  // Not supported

---

- [ ] Checkbox
- [X] Checkbox
  
---

:blush:, :smile:, :confused:

---

  Footnote text [^1]

[^1]: Foot Note

---
1. first item
2. second item

---
- first item
- second item

--- 

> Block quote text

---
Link
[title](https://www.example.com)

---

Image

![alt text](https://raw.githubusercontent.com/bilgep/Blog/main/_resources/_img/image.jpg)

---


**bold text**

---

*italic text*

---


```js
      Code Block
      console.log('hello');
    // Code Block
```

```powershell
$foo = $bar # assign foo to bar
```

```csharp
var item = new Item();
// Comment
```

---
not supported


term
: definition

---

~~Strikethrough~~

---

I need to highlight these ==very important words==.  // not supported

---

Subscript
H~2~O
not supported

---

Superscript
X^2^
X^2
 not supported
---
Who's looking for open source contributors? (week 48)
Tags: discuss, opensource, contributorswanted, codenewbie
Published: 2023-06-30 12:00:00

---
title: Who's looking for open source contributors? (week 48)
series: Looking for Contributors
published: true
description: Discover which open source projects are actively seeking contributors. Learn how you can make a meaningful contribution to the open source community and gain valuable experience. Find out who's looking for open source contributors now.
tags: discuss, opensource, contributorswanted, codenewbie
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
published_at: 2023-06-30 12:00 +0000
---
Open Source is about the community. Whether you have a project or you're looking to make your first PR, we want to help facilitate those connections. 

## Tell us about your project
_Promote your project by providing a link to the repo. Everyone who posted in previous weeks is welcome back this week, as always 😄_

Open Source should be a welcoming space for contributors. The README is the front door of your project. If you'd like to check out an example of a README, here's our [OpenSauced/insights README](https://github.com/open-sauced/insights).

If you submit please have the following in your repo to make it welcoming and helpful for contributors:

1. README.md
2. CONTRIBUTING.md

Feel free to drop your issues and repos in the [OpenSauced Discord](https://discord.gg/opensauced) #:eyes:-looking-for-contributors channel at any time! 

If you're new to open source, and you're not sure where to start, check out our [Intro to Open Source course](https://github.com/open-sauced/intro). 

Finally, consider reading the [Best Practices for Maintainers](https://opensource.guide/best-practices/).

Just a note to say, we've restarted this post from something Ben was doing for a while :star-struck: 

Happy coding!
Force Lodash Import Scope
Tags: lodash, eslint, sznmnotes
Published: 2023-06-30 12:00:00

---
title: Force Lodash Import Scope
published: true
description: How to enforce lodash import scope
tags: lodash, eslint, sznmnotes
cover_image: https://images.unsplash.com/photo-1587293852726-70cdb56c2866
# Use a ratio of 100:42 for best results.
# published_at: 2023-06-30 19:00
canonical_url: https://sznm.dev/notes/force-lodash-modules-import
---

## Importing Lodash

There are multiple ways to import lodash utilities.

```ts
// whole import
import _ from 'lodash';
// _.debounce();

// curly bracket / named import
import { debounce } from 'lodash';

// one-by-one / modules / single method import
import debounce from 'lodash/debounce';
```

One of the recommended way to import it is `one-by-one` or modules or `single method` import as it will produces smallest bundle size.

## Enforce Lodash Import Method

How about if our project is:

1. maintained by multiple people, or
2. we have various parts in our code which utilize lodash

and we want to enforce specific way to import lodash methods?

We can use eslint and there's an eslint plugin for it: [`eslint-plugin-lodash`](https://www.npmjs.com/package/eslint-plugin-lodash). This plugin has a rule named `import-scope`. Here's how to configure it:

```bash
pnpm i -D eslint eslint-plugin-lodash
```

```js
// .eslintrc.js
/** @type {import('eslint').Linter.Config} */
module.exports = {
  plugins: ['lodash'],
  rules: {
    'lodash/import-scope': [
      'error',
      'method' /** 'method' | 'member' | 'full' | 'method-package' */,
    ],
  },
};
```

With this configuration, eslint will warns us when we import lodash methods using other than the preferred import scope.

### References:

- https://www.blazemeter.com/blog/import-lodash-libraries
- https://github.com/wix-incubator/eslint-plugin-lodash/blob/master/docs/rules/import-scope.md
Data Replication
Tags: apacheage, postgres
Published: 2023-06-30 11:54:39


PostgreSQL Replication refers to the process of copying data from one PostgreSQL database server to another server.
A key idea in database administration is data replication, which gives essential systems high availability, fault tolerance, and scalability. Data replication is essential for assuring data durability, reducing downtime, and dispersing the workload over different servers in PostgreSQL, a powerful and feature-rich open-source relational database.

Data replication has a variety of applications:
1. Online transactional processing (OLTP) performance:  the transaction processing time and query time of an OLTP system can be improved by removing reporting query load.
2. Fault Tolerance: The replica server can take over in the event that the master database server fails, 
3. Data Transfer
4. Testing Systems in Parallel: Results on the same data from the old and new systems must be compared when moving an application from one DBMS to another to make sure the new system performs as intended.

Reference: [Data Replication](https://www.enterprisedb.com/docs/eprs/latest/)
[Data Replication in PostgreSQL](https://www.enterprisedb.com/postgres-tutorials/postgresql-replication-and-automatic-failover-tutorial#:~:text=repmgr%20for%20PostgreSQL-,1.,is%20called%20the%20Replica%20server.
)