Random snippets of all sorts of code, mixed with a selection of help and advice.
LeanTween tool in Unity is not scaling or bouncing the gameobject
28 March 2026 @ 11:30 am
I have been testing the LeanTween but it not working as expected for me. I'm trying to make a bounce effect on an UI element but its not working:
LeanTween.scale(_myGameObject, new Vector3(1f, 1f, 1f), 1f).setEase(LeanTweenType.easeInBounce).setDelay(2f);
When I change the scale it work but I do not want it to scale to another size I just want it to bouce one time. Its wierd because I have seen videos that sets the new scale the same as before and it works for theam
On Android 16 how can an app programmatically switch STREAM_MUSIC in MODE_NORMAL to the TYPE_BUILDIN_SPEAKER device?
28 March 2026 @ 11:19 am
On Android 16 how can an app programmatically globally switch STREAM_MUSIC in MODE_NORMAL to the TYPE_BUILDIN_SPEAKER device ?
The SetSpeakerPhoneOn() and setAudioRoute() APIs are either deprecated or no longer work. SetCommunicationDevice() is for calls not for normal audio. An app producing audio can use AudioAttributes but this is not a global switch. Due to the frequent changes to the AudioManager most of the audio routing apps are broken.
The reason this is required is simple - plug in a usb headset or just a microphone and the audio output to the speaker is cut off. It is possible outside of the Media Output panel as the Spotify app provides Wired Connection and This Phone options.The setting affects the whole phone not just Spotify audio.
Strangely on Samsung the Media Output panel does not give a This Phone option, but this could be a One UI issue.
How much Linux knowledge is required before learning Red Hat OpenShift for production environments?
28 March 2026 @ 11:10 am
I'm currently learning Linux administration and planning to move into container platforms like Red Hat OpenShift. Many enterprise job descriptions mention experience with Red Hat Enterprise Linux, containers, and automation.
I'm trying to understand:
What Linux skills are essential before learning OpenShift?
Should I learn container basics like Docker or Podman first?
Is Kubernetes knowledge required before OpenShift?
What real-world skills are expected for production environments?
I'm looking for a practical learning approach used in enterprise environments.
preciso de ajuda para corrigir um erro de um plugin [closed]
28 March 2026 @ 11:10 am
TUDO BEM?
EU COMPREI UM PLUGIM PREMIUM NO SITE PGUGINTHEMERBR.COM E ATIVEI NO MEI SITE. ESTAVA FUNCIONANDO NORMALMENTE ATÉ QUE ATUALIZEI DENTRO DO WORDPRESS SEM QUERER, PORQUE NA VERDADE ERA PARA EU BAIXAR A ATUALIZAÇÃO NO SITE DO PLUGIN E INSTALAR DE FORMA MANUAL.
aGORA QUANDO ATIVO O PLUGIN O SITE FICA FORA DO AR
ALGUÉM SABE COMO RESOLVER ESSE PROBLEMA?
How to retrieve the original .vfat image size from a GPT disk partition [closed]
28 March 2026 @ 10:56 am
I am building an Linux system where a .vfat filesystem image is created on a host machine and then flashed onto a GPT disk partition on the target device. I need to be able to recover the exact original .vfat image size from the target device at runtime, using only shell commands.
The image is created using mkdosfs and mcopy:
SIZE_KB=25292 # results in a 25899008-byte image (25292 * 1024)
ROOTDIR=./rootfs
mkdosfs -C file.vfat $SIZE_KB
mcopy -i file.vfat -s $ROOTDIR ::/
The resulting file.vfat is exactly 25899008 bytes (25292 * 1024) = ~24.7 MiB. It is then flashed onto a GPT partition of 50 MiB on the target disk
What I need (target side)
On the target device, given only /dev/sdX1, I need to recover the original .vfat image size: 25899008 bytes .
My first approach was to read
Next.js 16 app crashing on Plesk with HTTP 499 despite Passenger configuration
28 March 2026 @ 10:54 am
I have deployed a Next.js 16 application on a Plesk server. The application is finally running after following guidance from this Stack Overflow post: Deploy Next JS 14 on Plesk server
I also created a Passengerfile.json in the root directory with the following configuration:
{
"environment": "production",
"max_pool_size": 20,
"min_instances": 1,
"max_requests": 8000,
"max_request_queue_size": 400,
"pool_idle_time": 0
}
However, the application continues to crash constantly, returning HTTP error 499. I'm tired of manually restarting the server to keep it running.
Here is relevant server log.
4184995/T39 age/Cor/CoreMain.cpp:1094: Checking whether to disconnect long-running connections for process 253380, application /var/www/vhosts/[s
How to set dynamic canonical tag for each route in Angular (without SSR)?
28 March 2026 @ 9:49 am
I am working on an Angular application with multiple routes (e.g., /, /about, /contact), and I want to set a dynamic canonical tag for each route for SEO purposes.
Currently, I tried updating the canonical tag using Angular like this:
updateCanonical(url: string) {
let link: HTMLLinkElement = this.document.querySelector("link[rel='canonical']");
if (!link) {
link = this.document.createElement('link');
link.setAttribute('rel', 'canonical');
this.document.head.appendChild(link);
}
link.setAttribute('href', url);
}
And I call this method on route change.
Problem
This works in the browser (DevTools), but when I check View Source, the canonical tag is not updated — it still shows the static value from index.html.
Constraints
I am not using Angular Universal (SSR)
TypeError: When RV is not a pure distribution, value variable must have the same type
27 March 2026 @ 9:58 pm
From this article HERE, published in "PeerJ Comput. Sci." I took the last code (page 28):
import pymc as pm
import pytensor
import pytensor.tensor as pt
a = pm.Uniform.dist()
b = pm.Normal.dist(mu=a, sigma=1)
x = b + pt.as_tensor([2, 3, 4])
x_draws = pm.draw(x, draws=1_000)
x_logp = pm.logp(rv=x, value=[x_draws]).eval()
This gives way to a long error which I don't understand:
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
~\anaconda3\lib\site-packages\pymc\distributions\logprob.py in logp(rv, value)
176 try:
--> 177 return logp_logprob(rv, value)
178 except NotImplementedError:
~\anaconda3\lib\site-packages\pymc\logprob\abstract.py in logprob(rv_var, *rv_values, **kwargs)
52
How to manage platform-specific UI and shared logic in MAUI Hybrid without "spaghetti code"?
27 March 2026 @ 6:10 pm
I am developing a .NET MAUI Hybrid application and looking for industry best practices regarding architecture and maintenance for iOS and Android.
Currently, I am struggling with the following:
Code Organization: How can I effectively manage and reuse common classes and Enum values to avoid "spaghetti code"?
UI Management: I am getting stuck managing platform-specific UI components. What is the best way to keep the UI clean while handling the differences between the Android and iOS implementations?
Maintenance: Are there specific patterns (like MVVM or Service abstraction) that work best for MAUI Hybrid to ensure long-term maintainability for both mobile platforms?
This doesn't print anything
27 March 2026 @ 10:22 am
favorite_fruit = ["Mango", "Grape"]
if favorite_fruit == "Mango":
print("I really like mangos")
if favorite_fruit == "Grape":
print("I really like grapes")
if favorite_fruit == "Apple":
print("I really like apples")
if favorite_fruit == "Peach":
print("I really like peaches.")
I feel like this should work but it doesn't, why?
The list contains Mango and Grape but the if statements don't print anything.
There are no error messages when I run the code.