entities – OO way of adding base field definitions

Is there any object oriented Drupal way to add a base field definition to an existing entity?

Of course I am familiar with hook_entity_base_field_info(), but I am trying to keep my .module file size to a minimum and I was wondering if there is a way to achieve that with a different approach.

I thought of decorating or extending the entity, but after some research, I stumbled upon these issues that suggest those two options aren’t yet possible or elegant, as far as I understand.

Am I wrong in that?

Is there anyone that has had the same case and found a different approach?

linux – Impact on Recovery Time Using A Single Perpetual Base Backup and WAL Archives

What would be the impact on recovery time when restoring a Postgres database from a backup where one base backup was taken at the start of the backup strategy and then only applying WAL archives from anywhere between a week, to a month, to even 3 or 6 months?

From the perspective of an Oracle RMAN incremental backup strategy, Oracle recommends weekly level 0 backups combined with daily level 1 incrementals, however, I am unable to find any such recommendations with regards to Postgres.

All Postgres Continuous Archiving and Point-in-Time Recovery articles mention only one base backup and then archiving WAL from that point onward, but how would this impact recovery time compared to having a weekly base backup and daily WALs strategy?

The reason why I’m asking this is because Redstor (the cloud backup solution we use) supports deduplication and backup archiving, so we’re trying to find the best backup strategy that will provide PITR where the total size of the backup on the backup server’s filesystem will always reflect the total size of the database in its current state. When it comes to restoring a backup, we can choose any 24 hour time period to restore from and replay from the backed-up WAL files to any point in time within 24 hours to bring the system to a current state.

java – Sincronizar base de datos SQL local con MS Access en red

Estoy desarrollando un proyecto para clase en el que debo enlazar mediante DSN una base de datos local de SQL con otra MS Access en red, en una aplicación Android. He visto que hay un software cerrado, Cellica Database Anywhere, que realiza esto. Este software sincroniza ambas bases de datos cuando tiene conexión a internet y las actualiza según las modificaciones hechas. ¿Alguien sabe algún tipo de software abierto, driver o librería que pueda usar para hacer esto en Android Studio Java? Gracias de antemano.

php – Tengo este codigo que genera un csv conectado a una base de datos pero me lo genera en Unix LF y debo convertirlo a CRLF pero no se como hacerlo

Simplemente al generar el csv luego al abrirlo se muestra en fomrato lf unix y no en crlf pero no se muy bien como realizarlo

$salida_cvs = ""."";
foreach($dades as $barres){
    $codibarres() = array('id' => $barres('id'),'codigo_barras' => $barres('codigo_barras'),
    'alto' => $barres('alto'), 'ancho' => $barres('ancho'),
    'profundidad' => $barres('profundidad'), 'peso'  => $barres('peso'), 'fecha' => $barres('fecha'), 'hora' => $barres('hora'));

    $salida_cvs .= "$rara"."$delimiter"."$floritura"."$delimiter".$barres('id')."$delimiter".$barres('peso')."$delimiter".$barres('alto')."$delimiter".$barres('ancho')."$delimiter".$barres('profundidad')."$delimiter".$rara1."$delimiter".$barres('codigo_barras')."$delimiter"."$floritura2"."$delimiter".$barres('id');
    $salida_cvs .= "n";

Aquí lo que hace es extraer la info de una consulta y guardarla dandole el fomrato que desea el cliente

Aquí genera el csv y demás
$fechaActual = date("d-m-Y");
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary"); 
header("Content-disposition: attachment; filename=$fechaActual.csv"); 
define('CRLF', "rn");
readfile('my_csv_file.csv', true);
Explicando un poco el codigo este primero desde una busqueda gurda los datos y luego al descargar los archivos los extrae de la consulta luego genera un csv con el formato UNIX LF

base de datos – Como rellenar un campo de otra desde otra tabla

Mi intención es crear un fichador de empleado, dónde cada usuario pondrá su codigo de empleado que yo le proporcione, la idea es que coja los datos de otra tabla pero no sé como resolverlo.

Adjunto Datos.


class empleado(models.Model):
Codigo = models.CharField('codigo', max_length=50)
nombre_persona = models.CharField('nombre', max_length=7)

def __str__(self):
    return self.codigo

class fichador(models.Model):
    Codigo =  models.CharField('codigo', max_length=50)
    fecha = models.DateTimeField(auto_now_add = True)
    nombre_persona = models.ForeignKey(empleado, related_name='nombre', default="", max_length=50, on_delete=models.SET_DEFAULT)
    tipo = models.CharField(choices=OPCIONES_TIPO,
                            max_length=15, blank=True, null=True)


class fichador_view_entrada(CreateViewEntrada):
    model = fichador
    fields = ('Codigo')
    success_url = reverse_lazy('home')
    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context('entrada') = fichador.objects.all()
        return context

path('entrada/', views.fichador_view_entrada.as_view(), name='entrada')

 <form method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        {{ form.as_p }}
                        <button type="submit" class="btn btn-secondary" value="upload">Aceptar</button>

Lo que quiero es lo siguiente: que cuando yo introduzca el codigo en la vista.html busque en la tabla de empleado(datos introducidos manualmente) por medio del codigo que yo le pasé que coincidirá con un codigo de la tabla empleado, recoja el nombre que tiene y lo envie a la tabla del fichador ya que en el fichador si se guarda el codigo pero no el nombre.
Tabla Empleado
Tabla Fichador Rellena

WHMCS Pricing changes (again) – 100X Up this time if you dare to have a large customer base.

Got an email today,
[COLOR=#202020][FONT=&quot]We are writing today to let you know about some changes to our pricing and licensing… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1842515&goto=newpost

new players – How could I base a campaign with music as the main focus without making everyone a bard?

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

¿Como puedo cargar una base de datos de archivo zip en python?

dataset = pd.read_json(‘dataset_amazon(1).zip’, lines= True)

FileNotFoundError: (Errno 2) No such file or directory: ‘dataset_amazon(1).zip’

macos – 13″ MacBook Air Terminal says ” (base) UNKNOWN

The UNKNOWN part is your computer hostname, for some reasons it changed itself.

You can change the hostname from the Terminal using the following commands :

sudo scutil --set ComputerName "newname"
sudo scutil --set LocalHostName "newname"
sudo scutil --set HostName "newname"

Then flush your DNS cache with dscacheutil -flushcache and reboot your Mac.

You can also change it without using commands, in System Preferences > Sharing > Computer Name.

magento2 – how to hide the filter in product listing page without modify the code base?

Your question is pretty confusing as you want to hide it without touching code, but you also want to do it by CSS or JS which is code?

Either way, you can hide it with CSS by using this:

.sidebar .filter {
    display: none !important;

Although the better method would be to remove it with layout XML then you don’t even need to load it, there’s no point in loading a block just to always hide it.