teleren/devto huggingface dataset:
Symfony/Doctrine migrations for multiple databases
Tags: symfony, php, tutorial, database
Published: 2023-05-06 15:07:15

In Symfony/Doctrine, when running the command ``php bin/console make:migration`` it generates the migrations for the current driver only, unfortunately it doesn't generate database-agnostic code.

But it can be easily customized. Let's setup it to generate two migrations, one for MySQL (prod/dev) and one for SQLite (test).

## Setup

Setup your MySQL in your `.env` like you would usually do, but set a `MIGRATIONS_PATH="migrations/mysql"` property to it.

Then create a `.env.test` and set:
```bash
APP_ENV=test
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
MIGRATIONS_PATH="migrations/sqlite"
```

In your `config/packages/doctrine_migrations.yaml` you change default path to get from the env files:
```yaml
doctrine_migrations:
    migrations_paths:
        'DoctrineMigrations': '%kernel.project_dir%/%env(string:MIGRATIONS_PATH)%'
    enable_profiler: false
```

Also enable MakerBundle for test env in `config/bundles.php`: 
```php
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true, 'test' => true],
```
## Running migrations

Now you can work with migrations using:
```bash
# for MySQL
php bin/console make:migration
php bin/console doctrine:migration:migrate

# for SQLite
php bin/console make:migration --env=test
php bin/console doctrine:migration:migrate --env=test
```

Doing this, Symfony will generate migrations for MySQL in `migrations/mysql` and `migrations/sqlite` for SQLite.
52 berufliches Vorwärtskommen: Eine klare Rolle im Software-Entwicklungsprojekt.
Tags: deutsch, career, management, discuss
Published: 2023-05-06 15:05:08

Moin Moin,

zuvor sind wir auf unschöne soziale Rollen, innerhalb eines Teams, eingegangen, unter anderem [dem Einflüsterer→](https://dev.to/amustafa16421/40-berufliches-vorwartskommen-schutze-dich-vor-dem-einflusterer-3g4g). Jetzt schauen wir uns Rollen innerhalb eines Software-Entwicklungsprojekts an, welche die einzelnen Team-Mitglieder haben oder auch nicht haben.

Kennst du es, dass du eine klare Rolle innerhalb eines Projektes von Start bis Ende hast? Wie es beispielsweise bei Bauprojekten der Fall ist?
Dort arbeiten Elektriker, Bauleiter, Maurer und so weiter. Auf die IT übertragen: Wir hätten beispielsweise Anwendungslogiker, Projektleiter, „Datenbänker“ und so weiter. Diese würden, wie bei einem Bauprojekt, ihre Rolle für die Dauer des Projekts durchgehend beibehalten. Neues Projekt, neue Rollen möglich.

Es geht hier also nicht darum _wo_ man _allerlei_ Arbeiten übernimmt ( Innenraum, Fassade, Backend, Frontend ), sondern welche bestimmten Arbeiten man an bestimmten „Orten“ verrichtet.

1) Kennst du es, dass man eine Rolle durchgehend im Projekt beibehält?

Lass uns mittels Kommentaren austauschen.

Beste Grüße,
Mustafa

Austausch mittels E-Mail: mustafa.kevin.dwenger@posteo.de
Betreff: Austausch
Foundations
Tags: ruby, rails, webdev, programming
Published: 2023-05-06 14:57:55


Introducing FoundationsMapApp, a web application I have built with Ruby on Rails that helps users find and explore non-profit foundations across different states in the United States. This app allows users to browse through a list of foundations, view their details, and add them to their favorites list. It also offers data analytics to help users better understand the distribution of foundations across different categories.

With FoundationsMapApp, users can easily search for foundations by category and state, as well as sort the results by name, date added, and impact score. They can also view a map of all the foundations and their locations. Moreover, users can get recommendations for new foundations based on their browsing history.

FoundationsMapApp is built with Bootstrap, making it responsive and mobile-friendly. It also features authentication and authorization using Devise, ensuring secure access to user data. The app uses PostgreSQL as the database management system and will be deployed on Render.

Whether you're looking to donate to a non-profit foundation or simply want to learn more about them, FoundationsMapApp provides a convenient and user-friendly platform for all your needs.
Deployed Application
Tags: ruby, rails, programming, webdev
Published: 2023-05-06 14:55:40

MyLandlordRatings.org is an innovative online platform that provides tenants with the ability to rate and review their landlords and rental experiences. The platform is designed to empower tenants by creating a transparent community where individuals can share their experiences and help others make informed decisions when choosing a rental property.

The platform includes a range of features that make it easy for users to find and rate their landlords. Users can register for a free account by providing their email address and creating a password. Once registered, users can search for landlords or properties using the search bar on the platform. The search function provides users with the ability to filter their search based on a range of criteria, such as location, rental price, and property type.

Once users find the landlord or property they are interested in, they can click on the desired landlord or property to view their profile, ratings, and reviews. The landlord profile includes an aggregated rating, based on the ratings provided by all the tenants who have rented from the landlord. Users can also read reviews provided by other tenants, which can include comments on the landlord's behavior, the condition of the property, and other relevant factors.

Users can also submit their own rating and review by clicking on the "Rate and Review" button. This feature allows tenants to share their experiences with others and help them make informed decisions about their rental options. The platform also includes a flagging system for inappropriate content, which helps maintain the integrity of the platform by removing any reviews that violate the platform's guidelines.

MyLandlordRatings.org has been designed with responsive web design, which means that it is optimized for both mobile and desktop devices. This makes it easy for users to access the platform and rate their landlords on-the-go, or from the comfort of their own home.

The platform does not require any installation and is available to anyone with an internet connection. The project is open to feedback, bug reports, or suggestions for improvements, and users can provide their feedback via the platform's GitHub repository or email. MyLandlordRatings.org is released under the MIT License, which means that the platform can be used, modified, and distributed by anyone, subject to certain conditions.

In summary, MyLandlordRatings.org is a powerful platform that provides tenants with the ability to rate and review their landlords and rental experiences. It empowers users by creating a transparent community where individuals can share their experiences and help others make informed decisions when choosing a rental property. The platform is easy to use, responsive, and available to anyone with an internet connection.
Seedery App Development
Tags: programming, rails, ruby
Published: 2023-05-06 14:51:31


Growing up with a background in farming, one of the most important aspects of farming is planning and managing crops. Keeping track of the seeds we use is critical to the success of my operation, which is why I decided to create an app that would make seed cataloguing easy and efficient.

Planning and Designing
When I first started planning the app, I knew that it needed to be robust and versatile enough to handle the demands of both individual and commercial farming. I wanted to create an app that could handle large volumes of data and be easily customized to meet the specific needs of different crops and planting cycles.

I also developed a comprehensive database of seeds, including a wide variety of grains, vegetables, fruits, and herbs, to make the app as useful as possible.

Development
As a farmer, I understood the importance of reliability and functionality in the app. I used a variety of programming languages and tools to create a platform that was dependable and easy to use, spending countless hours testing and refining each feature to ensure that it worked seamlessly.

Future Features

Looking ahead, I plan to continue improving the app based on feedback from farmers. I'm also exploring ways to integrate the app with other farming tools and resources to create a more comprehensive farming platform.

One of the most exciting features i want to incorporate is the the ability to track seed age, germination rates, and storage conditions. I also included features that allowed me to set reminders for planting and watering, making it easier than ever to stay on top of my planting schedule.
OpenBSD 7.3 on VirtualBox 7: ゲスト OS インストールに失敗 - 原因は I/O APIC 有効化
Tags: openbsd, virtualbox, vm, troubleshooting
Published: 2023-05-06 14:43:36

## 発生した問題

[VirtualBox](https://www.virtualbox.org/) [7.0](https://www.virtualbox.org/wiki/Changelog-7.0) において、[Artix Linux](https://artixlinux.org/) 🐧 をホスト OS にして、[OpenBSD](https://www.openbsd.org/) 🐡 [7.3](https://www.openbsd.org/73.html) をゲスト OS としてインストールしようとすると失敗しました。

vbox の設定に起因するものでした。システム - マザーボード - "I/O APIC を有効化" に (デフォルトで) チェックが付いていたことが原因でした...🤕

失敗と関係があるのかわかっていませんが、VirtualBox ドキュメンテーションに [以下のように書かれていました](https://www.virtualbox.org/manual/ch03.html#settings-motherboard):

> software support for I/O APICs has been unreliable with some OSes other than Windows.

(私訳: Windows 以外の OS の中には、I/O APIC のソフトウェア・サポートが安定していないものもあります。)

### エラー内容

OpenBSD インストーラーにすべてを回答してインストールが始まった直後に発生しました。(以下の最初の行がそれを表しています。)

```
Installing bsd 0% (...)
dc_atapi_start: not ready, st = 40
fatal protection fault in supervisor mode
trap type 4 code 0 rip ff(...) cs 8 rflags 10286 cr2 42f9c8 cpl 6 rsp ff(...)
gsbase 0xff(...) kgsbase 0x0
panic: trap type 4, code=0, pc=ff(...)
syncing disks...6 6 (...)
```

## 解決方法

VirtualBox 設定で システム - マザーボード にある "I/O APIC を有効化" のチェックを外さねばなりませんでした。それで OpenBSD をゲスト OS としてインストールすることができるようになりました。

![vbox 設定の i/o apic のチェックを外す](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6w9fa66gu1got6b1s9o.png)

ともかく問題を解決できました 🙂

---

本記事は [私のツイート (英語)](https://twitter.com/nabbisen/status/1654696982722805760) をもとにしています。
The Wall of DST Hell
Tags: softwareengineering, webdev, programming, softwaredevelopment
Published: 2023-05-16 11:04:00

---
title: The Wall of DST Hell
published: true
date: 2023-05-04 22:02:12 UTC
tags: softwareengineering,webdev,programming,softwaredevelopment
canonical_url: https://fagnerbrack.com/the-wall-of-dst-hell-f3cdfe1554dd
---

#### The real code comment of a real company

![](https://cdn-images-1.medium.com/max/1024/1*uyx4auJSQalWm27W6syaLA.png)
_The cover of an album from Noise in Paradisum_

```
// The Wall of DST Hell
// --------------------
//
// Edge case 1:
// DST has caused an event from the previous day (6AM - 23PM)
// to block the entire next day.
// Make sure offset is changed in this code when DST changes.
// Right now this is hard coded to Sydney offset.
// Edge case 2 (24 March 2020):
// On March 2020, a customer in Sydney complained that on
// April 7 2020 whole day was blocked when they only had
// an "All Day" event on the previous day.
// The system was querying Google Calendar with the
// offset +11:00 for a date (April 7) where the
// offset is +10:00.
// When querying April 07 on a date before DST ended,
// the event from the previous day was coming in the list.
// That's why this function now hooks the offset to Luxon so
// that when we query a given date, we query using the correct
// offset relative to that date, not the one we're
// currently in.
// We're keeping it hardcoded to Australia/Sydney since all our
// customers are based in Sydney.
// Edge case 3 (07 September 2021):
// A customer based on Brisbane had their calendar blocked in
// the next day from an "All Day" event of the previous
// day when the previous day is under the effect of
// DST in Sydney.
// This happened because the "zone" was hard-coded to
// 'Australia/Sydney' but the customer calendar and company
// config were on 'Australia/Brisbane'.
// This issue was observed on 07 September and happened from
// the dates of 3 October (Sunday) to 4 October 2021 (Monday),
// which is the start of DST where the clocks forward 1
// hours for all states of Australia except... Brisbane.
// The cause for this bug was tricky to find because first we
// noticed the whole October month was locked for
// the only two calendars of the customer. The thing
// is they put one "All Day" event every 2 days, as they
// work one day in one location then another day in
// the other location. Therefore, the whole month became
// locked from October 03.
// I've changed to get the "zone" from the company
// config instead of hard code it to 'Australia/Sydney'.
// I hope this to be the last entry to the wall.
```

> I hope this to be the last entry to the wall.

We all hope so…

Thanks for reading. If you have feedback, contact me on [Twitter](https://twitter.com/FagnerBrack), [LinkedIn](https://www.linkedin.com/in/fagnerbrack/) or [Github](http://github.com/FagnerMartinsBrack).
OpenBSD 7.3 on VirtualBox 7: Installation as guest OS failed due to I/O APIC enabled
Tags: openbsd, virtualbox, vm, troubleshooting
Published: 2023-05-06 14:18:47

## Problem

With [VirtualBox](https://www.virtualbox.org/) [7.0](https://www.virtualbox.org/wiki/Changelog-7.0), installing [OpenBSD](https://www.openbsd.org/) 🐡 [7.3](https://www.openbsd.org/73.html) as guest on [Artix Linux](https://artixlinux.org/) 🐧 as host failed.

It was because of vbox Settings, in which checked (by default) was System - Motherboard - "Enable I/O APIC"...🤕

Although I don't know it has something to do with the failure, I found VirtualBox documentation [telling](https://www.virtualbox.org/manual/ch03.html#settings-motherboard):

> software support for I/O APICs has been unreliable with some OSes other than Windows.

### Error

It happened just after I finished answering to the OpenBSD installer and installation began. (See the first line below.)

```
Installing bsd 0% (...)
dc_atapi_start: not ready, st = 40
fatal protection fault in supervisor mode
trap type 4 code 0 rip ff(...) cs 8 rflags 10286 cr2 42f9c8 cpl 6 rsp ff(...)
gsbase 0xff(...) kgsbase 0x0
panic: trap type 4, code=0, pc=ff(...)
syncing disks...6 6 (...)
```

## Solution

I had to uncheck "Enable I/O APIC" of System - Motherboard in VirtualBox Settings to successfully install OpenBSD as guest.

![uncheck-io-apic-in-vbox-settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6w9fa66gu1got6b1s9o.png)

Anyway, it solved my problem 🙂

---

This post is based on [my tweets](https://twitter.com/nabbisen/status/1654696982722805760).
Exploring the Powerful Relationship Between Apache Age and PostgreSQL
Published: 2023-05-06 14:17:28

Apache Age is an open-source, distributed graph database built on top of PostgreSQL. It was developed by the AgensGraph team and is now an Apache Software Foundation project. This blog post will explore the relationship between Apache Age and PostgreSQL and how they work together to provide powerful data management solutions.

PostgreSQL is a powerful and open-source relational database management system (RDBMS) that has recently gained popularity. It is known for its scalability, reliability, and robustness. Apache Age, on the other hand, is a distributed graph database built on top of PostgreSQL. It is designed to provide a scalable, fault-tolerant, and efficient way to store and query large-scale graph data.

The relationship between Apache Age and PostgreSQL is similar to that of a house and its foundation. PostgreSQL provides the foundation for Apache Age, built on top of it to provide advanced graph database functionality. Apache Age utilizes PostgreSQL's powerful storage engine, indexing mechanisms, and transaction management capabilities to store and manage graph data. It extends PostgreSQL's SQL language to support graph queries and operations.

One of the key benefits of using Apache Age and PostgreSQL together is the ability to leverage the strengths of both systems. PostgreSQL provides a mature RDBMS's reliability, robustness, and scalability, while Apache Age provides the flexibility, agility, and scalability of a graph database. This combination makes it possible to manage complex graph data and relationships in a highly scalable and efficient manner.

Another benefit of using Apache Age and PostgreSQL is the ease of integration with other data management tools and systems. Apache Age is compatible with a wide range of data sources, including SQL, NoSQL, and Hadoop, which allows it to integrate seamlessly with other data management systems. It also provides a JDBC driver that enables easy integration with popular programming languages like Java, Python, and Ruby.

Apache Age and PostgreSQL provide a powerful combination of relational and graph database capabilities, making it possible to manage complex data and relationships efficiently. With their scalability, reliability, and flexibility, Apache Age and PostgreSQL are well-suited for various applications, from social networking to healthcare to IoT. By leveraging the strengths of both systems, organizations can achieve highly efficient and scalable data management solutions.
[Solved] iPhone "The device is unreachable"
Tags: ios
Published: 2023-05-06 14:09:05

If you've ever tried copying photos from your iPhone using a PC, you may have encountered an issue that goes something like:

>  "The device is unreachable"

You may also have had issues with the iPhone disconnecting from the PC while you're trying to copy photos. 

I have finally found out why this is happening. It turns out it's because the iPhone runs out of space!

For every copy operation you do from the phone to the PC, an additional copy is created on the phone in a buffer!

To ensure success, clear up space on your iPhone if you can, then reboot the iPhone to clear out any buffers. Then copy off the biggest files off the iPhone 1 by 1, delete them from the phone and reboot. Slowly build up space on the phone so further operations succeed.

Whenever you get the error, reboot the iPhone to clear up the buffer used and try again.
Lambda function use in React Class Components
Tags: react, lambda
Published: 2023-05-06 13:58:45

React functional components have become more popular than React class components in recent times. Hence we don’t need to rely on use of often misunderstood "this" keyword to access member variables, methods. We used to add a lot of mysterious `bind(this)` methods to our handlers in **constructors** before. 

```javascript
   this.checkedHandler = this.checkedHandler.bind(this);

```

Together with lambda syntax used in class methods we don't need this ceremony anymore. 

If you want to understand why, the code sample below explains briefly.

```typescript
import React from "react";

export default class App extends React.Component {
  constructor(props: React.PropsWithChildren) {
    super(props);
  }

  handleThis() {
    console.log("handle ", this);
  }

  handleThisWithLambda = ()=> {
    console.log('handle that', this)
  }

  render() {
    return (
      <div className="App">
       
        <button onClick={this.handleThis}>Handle This </button>
        <button onClick={this.handleThisWithLambda}>Handle That </button> </div>
    );
  }
}
```

There are 2 methods: `handleThis` and `handleThisWithLambda`

First one prints `undefined` as `this`, because in strict-mode `this` value is undefined when run outside of any object, ie. the event handler, unless it was bound by the function called, hence the use of `...bind.this( )`

The second one with the lambda syntax though prints the correct App instance we are running in. 

What is the difference? 

If you copy-paste this code to a code transpiler, like [typescript playground](https://www.typescriptlang.org/play) which converts it old ECMAScript 2017 code, you will spot the difference in how lambda syntax is translated inside the class code

```typescript
export default class App extends React.Component {
    constructor(props) {
        super(props);
        this.handleThisWithLambda = () => {
            console.log('handle that', this);
        };
    }
    handleThis() {
        console.log("handle ", this);
    }
    ...
}

```

As you can see `handleThisWithLambda` code moved into the constructor function, hence created with a closure to the `this` instance. So it is already doing the same job `bind.this` was doing previously for the legacy method case.

In React Functional components, you don't need this or bind.this anymore, as every thing is inside the same function closure anyway. 

Hope this helps!
Flutter's Hidden Gems 💎: Unearthing Lesser-Known Facts
Tags: flutter, dart, mobile, beginners
Published: 2023-05-06 13:54:32

Greetings, ~~fellow~~ flutter developers! 👋

Today, we embark on an exciting journey to explore the uncharted territories of the Flutter framework. Flutter has taken the development world by storm, and as it turns out, there are hidden gems 💎 waiting to be discovered! Fasten your seatbelt and join me as we dig deep into the lesser-known facts about Flutter. 🔍

**1. The Skia Connection**

Did you know that Flutter's powerful rendering engine is actually powered by Skia, the same graphics library used by Chrome and Android? 🤯 That's right! This secret sauce is what enables Flutter to paint beautiful UIs on your screens with unparalleled performance. So the next time you're admiring your smooth, pixel-perfect Flutter app, remember to give a shoutout to Skia! 🙌

**2. The Hummingbird Connection**

Flutter's journey to the web is an interesting tale, reminiscent of a spy movie. In its initial days, the project was codenamed "Hummingbird." 🐦 Now, the project has blossomed into a full-fledged framework, Flutter for Web, allowing developers to create stunning web apps using the same Flutter magic! Talk about a transformation! 🦋

**3. The Hidden Widgets**

Flutter is known for its extensive widget catalog, but there are a few widgets that like to play hide-and-seek! For example, the `LimitedBox` widget limits its maximum size only when it's confined in a tight space. Perfect for those situations where you need a widget to know its boundaries, quite literally. 📏 Don't let these elusive widgets escape your notice! 😉

**4. A Trip Down Memory Lane with Hot Reload**

If you love Flutter's Hot Reload feature (and who doesn't?), you'll be intrigued to know that it's inspired by React Native's "Hot Module Replacement." But Flutter's team took it a step further, making it lightning-fast! ⚡️ Now you can witness your code changes come to life in real-time, making you feel like a wizard casting UI spells. 🧙‍♂️

**5. The Flutter Time Machine**

Did you know that the first version of Flutter was actually called "Sky"? ☁️ Flutter's initial version was focused on providing a 120 FPS rendering experience for Android apps. But the Flutter we know today has evolved into a versatile, multi-platform powerhouse! 🚀

**6. A Little Love for the Lesser-Known Dart**

Flutter's best-kept secret might be its language, Dart. While Dart might not have the same spotlight as some of its counterparts, it's an incredibly powerful and versatile language. With features like sound null safety and ahead-of-time (AOT) compilation, Dart plays an essential role in Flutter's awesomeness. Don't forget to show Dart some love, too! ❤️

---

And there you have it, fellow explorers! 🌍 We've unveiled some of the hidden gems and lesser-known facts about the fantastic Flutter framework. May this knowledge add a sparkle to your Flutter journey as you continue to build stunning apps with newfound wisdom! 🌟

Keep on Fluttering, and until next time, happy coding! 💻