Qt Duplicate/Clone screens in RPI4 - qt

Im trying to duplicate my output screen from 'HDMI1' to 'HDMI2' on RPI4 device.
According to https://doc.qt.io/qt-5/embedded-linux.html since Qt 5.11 it is possible using a kms configuration file.
So i build two Qt version for this purpose, 5.12.11 and 5.15.2.
here is the kms configuration i used:
{
"device": "/dev/dri/card1",
"outputs": [
{ "name": "HDMI1", "mode":"1024x600" },
{ "name": "HDMI2", "clones": "HDMI1" }
]
}
The output is two screen showing the same window but the performance is very poor and the screen keep showing white frames while showing the application window.
And also the output keep saying:
QEGLPlatformContext: eglSwapBuffers failed: 3003
Could not lock GBM surface front buffer!
Also worth mentioning that when i use the application without the cloning feature it works just fine.
I Wonder if im doing something wrong.

Related

Can I use key bindings in Sublime Text to open remote files?

Every time I start a new programming session I have to open many “remote” files.
I was hoping to find a way to use key bindings to open those files. However, if this is possible I can't seem to find the proper way to do so.
Current I have a keybinding to popup the SFTP server, but then I still have to scroll to the correct server, and scroll through files, select one, hit edit, and repeat for another 3 - 4 files. It's a bit tedious. Currently I have:
[ { "keys": ["f11"], "command": "sftp_browse_server" }]
But would love to expand it to something like this, if possible :
[{
"keys": ["shift+f11"],
"command": "open",
"args": {"file":"http://x.x.x.x/cgi-bin/helloWorld.pl"}
}
]

Failed to load config "next/babel" to extend from eslintrc.json

When I'm trying to build the Next.Js app then the below error is coming with a successful build. This error is showing when I deploy the app in Vercel.
error - ESLint: Failed to load config "next/babel" to extend from. Referenced from: /vercel/path0/.eslintrc.json
This is my .eslintrc.json
{
"extends": ["next/babel","next/core-web-vitals"]
}
I've also added .babelrc
{
"presets": ["next/babel"],
"plugins": []
}
I also found a solution when I change the eslintrc.json file like below:
{
"extends": ["next","next/core-web-vitals"]
}
then no error is showing while building the app. But there is another problem showing when I use the above solution and the problem is:
Parsing error: Cannot find module 'next/babel'
This is shown in all the imports with red marks.
I tried to search the solution but did not found any solution for this.
I think, this might have to do with this weird hackfix that is being touted in a bunch of places that tells you to place next/babel in your eslint config file for some reason (e.g. here).
It probably was a hackfix for an old bug in older next.js versions. But as of (at least) summer 2022, it makes little sense to do so, considering that next/babel is a babel preset, not an eslint preset. Instead, in recent next.js versions, just reset your .eslintrc.json:
{
"extends": [
"next"
]
}
With this setup, things don't error out, as of next#12.2.*.
You also might want to take a look next's eslint customization options. For example, some people might be confused why eslint is seemingly not working.
In that case, consider this solution and the next.js docs on eslint.
If you have this problem, but you did not copy+paste your .eslintrc.json from the interwebz, then you might need to describe your situation in more detail.
my problem has been solved by this code. just copy and paste it into the eslintrc.json file.
{
"extends": ["next/babel","next/core-web-vitals"]
}
Or just replace "next" and "next/core-web-vitals" to
"plugin:#next/next/recommended"
https://nextjs.org/docs/basic-features/eslint
I had this issue when working with TurboRepo. The solution for me was to add next as a devDependency in the root of the monorepo.
Same Turborepo issue using pnpm. This solved it for me: https://github.com/vercel/next.js/issues/40687#issuecomment-1275184829
Essentially add this to your settings.json
// .vscode/settings.json
{
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" }
]
}

How to recover accidentally deleted cells in Jupyter Notebook

I'm working in a .ipynb file in VSCode and I tried to undo some lines by using ESC + Z, but for some reason either I undid too much or I pressed something else, but around 30 of my cells all got deleted. I don't know how to redo and I'm scared I lost all my work!
How can I recover these cells???
Thanks
edit: I found the code that I've run using %history but I was hoping to get my Markdown cells as well because I wrote a lot of information there
edit 2: I noticed that my cells weren't just deleted, but my files actually just changed to a different spot in history, as my first few cells contained something different than it did before the cells disappeared. Does that change the answer to this question at all?
I did post a workaround to recover some stuff, but I'd still appreciate if someone let me know what happened in my 2nd edit, thanks!
If you hit the 'Z' key it will undo moves and deletes. Note, not CTRL+Z, but 'Z' by itself. link to the GitHub issue.
This happens constantly for me. So incredibly annoying! It happens when I hit or mishit CMD+Z. No amount of ESC-Z will recreate the deleted cell. Nothing in any menu have so far recreated the lost. I have deleted all shortcuts for 'delete cell' but it makes no difference at all. Just about to give up on VSCode for this reason alone.
I had a similar issue where I was hitting CTRL+Z outside of the cell when I thought I was inside the cell (usually because running current cell makes you lose cell focus).
Sometime it just "undid" the last created cell somewhere else in my notebook, and I actually lost some cells because I didn't realized right away what happened and just continued working.
I thought I would share my solution to this problem (because Google sent me on this post, and more people might be interested).
Redefining the Keyboard Shortcuts worked for me.
I removed the CTRL+Z shortcut when I'm not inside a cell (you can still access it with the menu Edit > Undo). I did the same for CTRL+SHIFT+Z, and so on.
To do this, I added theses rules to my keybindings.json:
{ "key": "ctrl+z", "command": "-undo" },
{ "key": "ctrl+z", "command": "undo", "when": "!notebookEditorFocused || inputFocus" },
{ "key": "ctrl+shift+z", "command": "-redo" },
{ "key": "ctrl+shift+z", "command": "redo", "when": "!notebookEditorFocused || inputFocus" },
{ "key": "ctrl+y", "command": "-redo" },
{ "key": "ctrl+y", "command": "redo", "when": "!notebookEditorFocused || inputFocus" },
I also removed the Z shortcut from Jupyter extension because I don't like it.
{ "key": "z", "command": "-undo", "when": "notebookEditorFocused && !inputFocus" },
This solution worked for me:
Open the command pallet (ctrl+shift+p on windows)
Select the "Undo" command
Not sure why it works. Does vscode disable the ctrl-z shortcut when outside a cell?
Ok, this is crazy but since I'm in Visual Studio Code, I tried right clicking on my .ipynb file and clicking "Convert to Python Script".
This recovered every single line including Markdown Code that I had before I did something to delete my cells.
Might be worth a try if you deleted your Jupyter Cells in Visual Studio Code
I found a way to get the lost cells back, which saved me an enormous amount of time as I did not have to recreate those cells. If you open the timeline (bottom left corner of the screen), you can go back in time when you still had those cells, copy the content and paste it in a new cell.
Update: you might have to upgrade to the latest version if Timeline is not available for you.
%history is a life saver but i will also note: When you run %history not all the code will show, given the amount of lines - you must navigate to the output file where you will see all the history, it is displayed there. The option to open the output file is usually given at the top of the page in VS code anyway.
I came to this thread after facing a similar situation as I lost a day's work as well but, I wasn't going to give up!
So, if you have setup Auto Save on VS Code and have wsl2 enabled and are using VS code from wsl, you have to navigate to this path
> \\wsl.localhost\Ubuntu\home\<user-name>\.vscode-server\data\User\History\.
or simply do
cd (to go to root path)
type explorer.exe . (this will open file explorer)
Navigate to .vscode-server\data\User\History\.
There will be multiple folders, pick one for the file you want to restore and Voila!
just click Z in windows. This saves my a lot of pain. it happens sometimes

Gltf model texture and scene bin not found

I searched a lot of solutions online but none helped. I tried putting the gltf model on this website (https://gltf-viewer.donmccurdy.com/) and it is working fine but when I tried using it on glitch the texture and scene.bin file failed to load. https://glitch.com/edit/#!/feline-lifter?path=index.html:21:13
Error im getting:
I kept getting this error and I don't know how to fix it! also this is my html code:
The errors suggest that something is trying to find resources at
https://cdn.glitch.com/textures/*something*.jpg
That something would be the GLFT Loader, which is fed with sinister lies in the .gltf file:
"buffers": [
{
"byteLength": 12440812,
"uri": "scene.bin"
}
],
"images": [
{
"uri": "textures/alpha_baseColor.png"
},
{
"uri": "textures/alpha_metallicRoughness.png"
},
(...)
if you look up the paths to the assets, they are neither in the textures folder nor in ..any folder. They are wherever glitch decides to throw them. So the paths in the .gltf file are not valid when it's being loaded at a glitch hosted website.
Either:
Convert the model to .glb, which consists all resources
Throw the model on github where paths are relative, making the paths valid.
Change the paths using the glitch assets links.

Path Issue with Wordpress + Composer on Heroku

I am a newbie in composer and Heroku cloud and here has a may-be-stupid question about the path in composer.
I am trying to deploy a Wordpress on Heroku, following the code/instruction here: https://github.com/ellefsen/wordpress-heroku-php
In concept, I should use S3 to store any media content. However, my case is quite special: there are two and only two images for my site, now and in future. So I:
removed all S3 related code and configs;
add two images in public/content/uploads/ as: public/content/uploads/2016/08/one.png and public/content/uploads/2016/08/another.png;
adjust the .gitignore accordingly (remove the public/content/uploads);
Modify the composer.json as:
"extra": {
"webroot-dir": "public/wp",
"webroot-package": "wordpress",
"installer-paths": {
"public/content/plugins/{$name}/": [
"type:wordpress-plugin"
],
"public/content/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
],
"public/content/uploads/{$name}/": [
"public/wp/wp-content/uploads/{$name}"
],
"public/content/themes/{$name}/": [
"type:wordpress-theme"
]
}
},
For item "public/content/uploads/{$name}/", I tried:
public/wp/wp-content/uploads/{$name}
wp-content/uploads/{$name}
But in any case, within the WP dashboard, I cannot see any image in the media lib. Could someone please give me a hand? Thanks!
I would not bother with the Media Library in WP as long as you are only dealing with two images. Just put them in your theme directory and reference them directly.
That way you won't have to deal with S3 or Heroku's ephemeral file storage as they would all be committed and included with your repository as part of your project.

Resources