Random snippets of all sorts of code, mixed with a selection of help and advice.
PrimeFilm PF 1800AFL detected by Windows, but drivers not working
13 June 2026 @ 1:27 pm
I'm trying to get my PrimeFilm PF 1800AFL film scanner working on Windows 10, but I'm stuck.
Here's what happens:
When I connect the scanner via USB, Windows detects the device.
I installed the driver package from the Scanace website.
If I manually install that driver, the device appears as "AFL Film Scanner" under Other devices, but neither VueScan nor CyberView can use it.
If I let Windows automatically search for a driver, it installs "Multiple Frame Film Scanner" under Imaging Devices.
With that driver installed, both VueScan and CyberView detect the scanner, and VueScan identifies it as PIE PrimeFilm 1800 AFL.
However, when I press Preview or Scan, the scanner pulls the film in but then ha
Chrome Commands(Custom Shortcut) is not working on extension globally
13 June 2026 @ 1:27 pm
I am trying to create an extension in which user can press an shortcut which perform some task in chrome. The command(shortcut) would work globally whether the chrome is minimized or inside a chrome.
To solve this i added a global key attribute in manifest json file and i have removed extension first then again loaded it into chrome.As i tried to press my shortcut it doesn,t work either in chrome or outside of chrome(while it minimized).
For cross check i checked keyboard shortcut configuration from extension hamburger menu i seen there the shortcut added as Global.I again changed it to the in chrome mode and i pressed again shortcut now the things are working fine.I also checked that my shortcut is not conflicting with other shortcut or built in.
here according to docs i used combination of Ctrl+Shift+(value from 0 to 9) here i used 1. As Based on official docs recommendation
So my overall problem is how i should fix global activation problem of commands
FastAPI returns 422 Unprocessable Entity on POST from Next.js fetch despite matching Pydantic model
13 June 2026 @ 1:23 pm
I'm sending a POST request from a Next.js 14 client to a FastAPI endpoint. The request body matches my Pydantic model exactly, but I keep getting a 422 Unprocessable Entity instead of a 200.
Expected: the endpoint accepts the JSON and returns the created object.
Actual: {"detail":[{"loc":["body","email"],"msg":"field required"}]}
FastAPI endpoint:
@app.post("/contacts")
async def create_contact(contact: Contact):
return contact
Next.js fetch:
await fetch("/api/contacts", {
method: "POST",
body: JSON.stringify({ email: "[email protected]" }),
});
What I've tried: confirmed the payload in the network tab, checked the model field names match. Removing the body entirely gives the same error.
Communication with the RS 232 port in emu8086 via the out instruction
13 June 2026 @ 12:05 pm
Can communication with the RS-232 serial port (COM1) be initiated in the emu8086 application using the `out` instruction, and which registers are used? If so, how? Thank you. This is for the purpose of reusing the x86 kernel from the examples.
What are the differences between the class and struct keyword in C++
13 June 2026 @ 12:02 pm
As we all know , we can use struct and class to define our type based on our usage and requirements of our project and we also use it in OOP . But my question is that , are there any significance difference between the class and struct ? The only difference i can find is their default access specifier , where for struct is public and for class is private.
Is it better for users to get raw information or the tidied up information from the functions in my python library?
13 June 2026 @ 5:17 am
I'm creating a simple Python library for Ubuntu-based Linux distributions that retrieves information about memory, the CPU, and the motherboard. For each module, I've created a helper function, for example, _get_memo_info(keyword: str), which returns a list of memory information in dictionary form. We need to specify the keyword parameter to get the information we need.
My question is, which is better for the user?
Option 1
The helper function will become the main function and i'll create a custom argument to display all the information, for example, get_mem_info("-all"), and then, once I find the information I want to retrieve, I simply change the argument, for example, get_memo_info("MemFree").
In my opinion, the advantage is that it gives us the freedom to access all available information, while the disadvantage is that it might require a few extra steps, as I mentioned earlier.
Option 2
Development in DOT NET For Student data validation testcase
13 June 2026 @ 5:07 am
I want validate student data i want upload file and that file having data check data validation and downloads correte validate data file and or error file also in dot net mvc core how i developed it tell me
and gave me code for refresh for how i Development that and also UI
Excel VBA: Out of Memory Error When Copying Large Arrays Worksheet
13 June 2026 @ 4:30 am
I am running a VBA macro that processes a large dataset (around 500,000 rows and 30 columns). The data is read into a Variant array, processed in memory, and then written back to a new worksheet.
The processing phase in the array works perfectly and fast. However, when I try to dump the entire array back to the worksheet using the following line, Excel crashes with Run-time error '7': Out of memory:
Sheets("Output").Range("A1").Resize(UBound(MyArray, 1), UBound(MyArray, 2)).Value = MyArray
This happens intermittently, usually when the system has other Office applications open. I have already verified that:
I am using 64-bit Excel, so memory limits should not be an issue.
ScreenUpdating, Calculation, and EnableEvents are all set to False before execu
How can I get a source code of Python function which was declared by using 'exec' inside other function?
11 June 2026 @ 6:49 pm
UPD: the question is answered by the comment of @cards
I need to get a source code of Python function which was declared via using exec
inspect.getsource can't help me with that.
Simplified Example:
from inspect import getsource
def declare_func():
func_code=\
'''def new_func():
print("Hello, world!")'''
exec(func_code)
return locals()['new_func']
func = declare_func()
print('=run=')
func()
print('=func=')
print(func)
print('=code=')
print(getsource(func))
Output:
=run=
Hello, world!
=func=
<function new_func at 0x000001DF77173E20>
=code=
... OSError: could not get source code
How can I get source code of the 'func' ?
Note1: I can't avoid using exec for declaration of
Web scraping fails due to "request to load the app is timing out." [closed]
11 June 2026 @ 5:59 pm
I am trying to scrape this Web page, but the page keeps downloading an empty page that reads:
Connection error.
Sorry, your request to load the app is timing out.
Please check your internet connection and refresh the page.
If the issue continues, try in a different browser and then contact support
Refresh page →
I wonder what I might be able to do to circumvent the issue. I wonder whether the issue really has to do with a time-out issue, as suggested by the message, which is why I'm curious what 'tricks' I should try at that stage.
I am using PhantomJS, which I am 'driving' through R, with the following code:
library(readr)
library(webdriver)
dr <- run_phantomjs()
ses <- Session$new(port = dr$port)
ses$go("https://virtual.oxfordabstr