Random snippets of all sorts of code, mixed with a selection of help and advice.
ERROR: must be owner of table but I am superuser
21 November 2024 @ 12:06 am
I have an postgres 16 DB in Docker container with volume. I wanted to hide standard postgres user and changed it's name to super (as example). Now I try to make somthing with any tables (DDL operations like ALTER TABLE) but it throws:
must be owner of table ...
I tried to give some priveligies to my user but it throws for all commands:
permission denied
I have tries:
ALTER USER super WITH SUPERUSER;
But got:
Only roles with the SUPERUSER attribute may alter roles with the
SUPERUSER attribute.
Then I run query:
SELECT rolname, rolsuper FROM pg_roles WHERE rolname = 'super';
It shows me:
rolename | rolesuper
--------------------
super | true
Well. My role is superuser. I've event tried run:
Extend "grid-lines" beyond a CSS grid
21 November 2024 @ 12:04 am
This is a silly one, but assuming an N-by-M grid of cells, how can I achieve the below effect.
I can make a 3x3 grid fine.
[A][B][C]
[D][E][F]
[G][H][I]
Adding gap spaces the elements out:
[A] [B] [C]
[D] [E] [F]
[G] [H] [I]
And I can fill the background to give the effect of grid-lines.
.-----------.
|[A]|[B]|[C]|
|---+---+---|
|[D]|[E]|[F]|
|---+---+---|
|[G]|[H]|[I]|
`-----------`
But is it possible to have grid-lines align within the gaps of a grid, and also "extend" beyond the grid by a set amount?
| | | |
--+---+---+---+--
|[A]|[B]|[C]|
--+---+---+---+--
|[D]|[E]|[F]|
--+---+---+---+--
|[G]|[H]|[I]|
--+---+---+---+--
| | | |
I've managed to "hack it" with absolutely positioned DIVs using formulas which reference the grid's custom properties to align themselves. But this requires me to kno
Can I use a PublicTrust Certificate created with Trusted Signing to sign an MSIX package in Visual Studio?
20 November 2024 @ 11:58 pm
I need to sign an MSIX I'm creating for a .NET Framework 4.X Windows Forms application. What is the process for doing that once I create the certificate? Is it stored in an Azure Key Vault and do I use the wizard in VS to get it from there? Or do I download a file? Or...? We're waiting on our Identity Validation, so we can't actually try it out yet, but are trying to be ready.
Optimizely - Updating site through job for automation
20 November 2024 @ 11:57 pm
I am currently working on automating updates for our Optimizely-managed sites during deployments. My idea is to create a job that runs during the deployment process to eliminate the need for manual updates.
However, I’m encountering an issue: I cannot update the site’s host because it is currently set to read-only. Is there a way to configure the site host so it is no longer read-only, allowing updates during deployment?
Any guidance or suggestions would be greatly appreciated!
React blank page on build
20 November 2024 @ 11:43 pm
I've been learning React (kind of new to it) and I'm working on a project and I did an npm create vite@latest. So far everything works fine when I do run dev. However when I do run build, then go to the dist folder and open the index.html file I get a blank page.
So I do an inspect page in FireFox and I get these errors -
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resources at file:///assets/index-J7cny882.js. (Reason: CORS request not http)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resources at file:///assets/index-BAXwXR6k.css. (Reason: CORS request not http)
I'm bit puzzled by this. Don't know whats wrong or how to fix it. I did come across some things online that mentioned adding "homepage": "." to package.json. I did that but didn't help.
I appreciate the help.
Thanks.
How to remove duplicates values in list where values are very close to each other in Python?
20 November 2024 @ 11:31 pm
I have in Python list like below:
['reporting-service',
'ireporting-service',
'caid-reporting-service',
'java-version-service',
'dotnet-version-service',
'occbs-caid-cruise-control-service',
'fliptv-caid-cruise-control-service'
'jira-service'
]
As you can see in this list I have many similar valies like:
'reporting-service' = 'ireporting-service' = 'caid-reporting-service' (similar because both have "reporting-service")
'java-version-service' = 'dotnet-version-service' (similar because both have "version-service")
'occbs-caid-cruise-control-service' = 'fliptv-caid-cruise-control-service' (similar because both have "cruise-control-service")
All the values in my list end with “-service”. I would like to track down those values that share a common part (as seen above) and leave only one of those values in the list in that case, because they mean exactly the same thing
ASP.NET Core 8.0 Razor Page has a binding model issue, along with some strange behaviour in the OnPost method
20 November 2024 @ 10:03 pm
Pref: I experienced some really strange behavior in ASP.NET Core.I started an MVC project, but I also included some Razor pages in the project.
When I attempt to bind the model and click the Save button, The input values are null or empty. The model is invalid and does not include the input values, it is completely empty. I checked all of the properties, and everything seems almost correct, but it is not binding the input values for Product.
[BindProperty]
public ProductViewModel Product { get; set; }
It's really strange that I created a second button, but it also calls the OnPost method for some reason... Similar case: Removing the OnPost m
Angular 18 component does not work as expected with blobs
20 November 2024 @ 9:55 pm
I have an angular 18 project which pulls the image data from an API to dispaly's it on screen. Can someone help me understand this behaviour?
The app throws an exception 'document is not defined' with the 'const a = document.createElement('a');' in the getImage(..) function of the ImageService.ts file. Even with this error, the app pulls the image data and draws it on the page.
When I take this line out, I get a different error and the image also does not show.
I added a breakpoint on the API and also the getImage function in ImageService.ts
angular 19 - APP_INITIALIZER deprecation
20 November 2024 @ 9:14 pm
I am trying to upgrade from angular 18 to 19. Automatic migration changed the following code
providers: [
{
provide: APP_INITIALIZER,
useFactory: initializeApp1,
deps: [AuthService],
multi: true
},
]
to this:
providers: [
provideAppInitializer(initializeApp1(inject(AuthService)))
]
however when I run the code I am getting error Uncaught RuntimeError: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with runInInjectionContext. Find more at https://angular.dev/errors/NG0203
I am pretty stuck as to how to solve this error, could you help me?
thanks a lot
Python ModuleNotFoundError: No module named 'Cython'
20 November 2024 @ 8:07 pm
I'm trying install xinference, and get the message ModuleNotFoundError: No module named 'Cython'.
I install the Cython with the command pip install Cython ,and install the package from the pypi, the command pip list shows that the package has installed successfully, but it still reports the same error.
ModuleNotFoundError: No module named 'Cython'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
What's wrong?
Python 3.10.10 Cython 3.0.11 windows 11