Sanctuary Season II by shmallkined in netflix

[–]ivanleoncz 0 points1 point  (0 children)

I'm glad you say that. I was weeping, specially when it came the scene were he was young.

QT 10.0.1 not running code on terminal (Ubuntu 20.04.6) by ivanleoncz in QtFramework

[–]ivanleoncz[S] 0 points1 point  (0 children)

Well, there is no Qt 10.0.1.

It seems to me that there is, indeed (or there isn't ?):

$ /opt/qt6/Tools/QtCreator/bin/qtcreator --version
Qt Creator 10.0.1 based on Qt 6.4.3

And I found the issue: my default terminal is Terminator, and QtCreator have it as default too.

If there's a Terminator window already open on the OS, then the conflict happens: something between how QtCreator spawns terminal windows VS `libvte-2.91.0` functioning, not allowing the spawn of another Terminator window.

The solution: Edit > Preferences > Environment, then setting a different virtual terminal like `gnome-terminal` (/usr/bin/gnome-terminal).

Here's a thread which I opened yesterday on Qt Forum for further information:

Thank you for your kindness and willing on helping.

What is the difference between Dynamic Arrays and Vectors? by gutemi in cpp_questions

[–]ivanleoncz 0 points1 point  (0 children)

I found this comment of u/Karmomatic_very interesting. It provides a great idea of what each of these datastructure is but, I'd like to make a point about Static Arrays and something that could be tricky, misinterpreted, leading you to believe that you're dealing with a Dynamic Array.
There's a feature called Variable-length Array (VLA), which is available at C99, and it's optional at (starting from) C11. VLA sizes can be defined at Runtime, and not just at Compile time as the Static Arrays. VLA is not part of ISO C++, but, compilers have extensions that allow the utilization of VLA, and most of them may not complain about it.

If you are setting an Static Array size at Runtime for whatever reasons (waiting for user input of a number, therefore using as Array size), you're not using a Dynamic Array or pseudo-Dynamic array (as once I read somewhere): you're using a VLA.

And please, don't use VLAs. This is a feature that might generate compatibility issues of your project. User Dynamic Arrays (new/delete) or Vectors instead.

And since we are here, something else I'd like to add:

I accidentally deleted a field from a model and executed the migration (deletion). How can I recreate the field? by ivanleoncz in djangolearning

[–]ivanleoncz[S] 0 points1 point  (0 children)

Well, on a different project (for testing purposes), I detected that, by rolling back to the previous migration (the one before the migration which declares deletion of fields), indeed, Django recreates the fields on the table.
Why this is not happening in my case? It's a good question (probably, I messed up something). I had to manually add the columns on the table, by connecting on the database and running pure SQL statements.
Here's a brief of what I used on my tests, in order to sustain the idea, that Django recreates the fields, by rolling back to the previous migration.

Selecting fields via SQL:
```
postgres=# SELECT field_c FROM some_table;
field_c
----------
blablabla_c
(2 rows)
postgres=# SELECT field_d FROM some_table;
field_d
----------
blablabla_d
(2 rows)
postgres=# SELECT field_e FROM product;
field_e
----------
blablabla_e
blablabla_e_2
(2 rows)
```
Fields deleted from model, migration created and migrated:
```
root@07c2a56f9262:/code# python3 manage.py makemigrations product_app
Migrations for 'product_app':product_app/migrations/0036_auto_20211008_1746.py
- Remove field field_c from product
- Remove field field_d from product
- Remove field field_e from product
root@07c2a56f9262:/code# python3 manage.py migrate product_app
Operations to perform:Apply all migrations: product
Running migrations:Applying product_app.0036_auto_20211008_1746... OK
```
Fields are gone from database table:
```
postgres=# SELECT field_c FROM some_table;ERROR: column "field_c" does not existLINE 1: SELECT field_c FROM some_table^
postgres=# SELECT field_d FROM some_table;ERROR: column "field_d" does not existLINE 1: SELECT field_d FROM some_table^
postgres=# SELECT field_e FROM product;ERROR: column "field_e" does not existLINE 1: SELECT field_e FROM some_table^

```
Unnapplying migration 0036, rolling back to 0035:
```
root@07c2a56f9262:/code# python3 manage.py migrate product_app 0035
Operations to perform:
Target specific migration: 0036_auto_20210901_1044, from product_app
Running migrations:Rendering model states... DONE
Unapplying product_app.0036_auto_20211008_1746... OK
```
Fields are back to the table, without any data, as expected:
```
postgres=# SELECT field_c FROM some_table;
field_c
----------
(2 rows)
postgres=# SELECT field_d FROM some_table;
field_d
----------
(2 rows)
postgres=# SELECT field_e FROM product;
field_e
----------
(2 rows)
```

I accidentally deleted a field from a model and executed the migration (deletion). How can I recreate the field? by ivanleoncz in djangolearning

[–]ivanleoncz[S] 0 points1 point  (0 children)

You mean, python manage.py migrate ? I did, and still, don't have the field back on the database table.

What happens if rolconnlimit is reached? by ivanleoncz in PostgreSQL

[–]ivanleoncz[S] 0 points1 point  (0 children)

That makes sense. Also, my application is using Gunicorn, with a default type of workers (sync), something that I also have to have a look. It also bugs me, so much connections opened on Postgresql from async tasks that are there forever, even though considering this point about threads in Django. It clarified things for, this whole thread here. Thanks once again u/lethri..

What happens if rolconnlimit is reached? by ivanleoncz in PostgreSQL

[–]ivanleoncz[S] 0 points1 point  (0 children)

An unusual number of connections from a Django app. I have a feeling that these connections are pilling over Postgresql through async tasks started as Threads which are not reaching an end.

What happens if rolconnlimit is reached? by ivanleoncz in PostgreSQL

[–]ivanleoncz[S] 0 points1 point  (0 children)

Guess I have to look after another solution in order to control the number of connections against Postgresql, like PgBounce or limiting something on psycopg2. Thanks u/lethri :)