instruction
stringlengths
0
30k
βŒ€
I am attempting to build a python Flask + sqlite3 application. However I can't make it behave. I'm trying to make it threadsafe and that isn't working. I receive the error below: ``` resp = conn.execute("SELECT * FROM users") sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same ...
So as kind of a foreword I am coming from the world of compiled languages like C# and C++. There when importing types defined in other namespaces or even different assemblies with `using` or `#include` statements in C# and C++ respectively we are basically creating a hard dependency. For this reason depending on interf...
Do we need IoC containers in typescript if ts-mock-imports exists
|typescript|dependency-injection|mocking|ioc-container|dependency-inversion|
`abstract = True` means, it will not create a db table for that model. So, it can't be use as user model or use for authentication, login. [Reference][1] [1]: https://stackoverflow.com/a/16838663/13861187
This used to be a feature of HTML, but the `<center>` tag was [deprecated in HTML 4.01](https://stackoverflow.com/questions/1798817/why-is-the-center-tag-deprecated-in-html) to emphasize that CSS stylesheets are the new home for all style and formatting parameters. That was back in 1999. These days, you should creat...
you need to attach a click event listener to the "Place Order" button, Then Inside the event listener, first perform some actions and validations using the `validateOrder()` function. If the validation somehow fails, prevent the default action of the click event, effectively preventing the order from being placed. and ...
**Less secure option is not supported anymore by gmail. So you can use an App Password.** As [this answer][1] said, I set my `2-step verification` and then get my `App Password` from **[Here][2]**. At the end simply run this code with email address and that app password, then i got email with nodemailer. ``` const s...
{"Voters":[{"Id":4267244,"DisplayName":"Dalija Prasnikar"}],"SiteSpecificCloseReasonIds":[13]}
Good day, Could someone please assist with how to achieve the below. So I need to take the first "Addition" which is the "Total_COB_Growth" + "Sum_of_Previous_Interest" where the "Sum_of_Previous_Interest" is dependent on the LAG of "Additions" if that makes sense. I can't get it right in SQL to have the previous va...
I need assistance on debugging my apache2 + php8.2-fpm. based on apache2 error log, there is a lot of error [proxy_fcgi:error] [pid 1539011] (70007)The timeout specified has expired: [client xx.xx.xx.xx:58990] AH01075: Error dispatching request to : (polling), referer: https://xx.xx.xx/ ...
Issue with [proxy_fcgi:error] [pid 1539011] (70007)The timeout specified has expired
|php|laravel|ubuntu|apache2|
Color pulse broken on linear gradient. How to fix "@keyframe" to pulse background of a button?
1. Update to latest Next.js via: npm i next@latest react@latest react-dom@latest eslint-config-next@latest 2.Update package.json script for "dev" to: next dev --experimental-https
It would be helpful to include some comments in code to explain what each section does. <br> From what I see working through the code, you are first adding the Headers from your original Sheet 'Session-2024' to a new Workbook Sheet `sheet_dcfc1` with name 'Sheet' (then reading back / printing these headers). <br> ...
null
You can convert the mathematical expression string into a `SymPy` expression, replace the `^` operator with `**` (Python's exponentiation operator), and then create a Python function `f(x)` using `lambdify`. from sympy import sympify, symbols, lambdify x = symbols("x") expression_str = "2*x^2 + 5*x - 1" ...
The following compiles with GCC, but not with Clang: ```c++ #include <array> #include <tuple> constexpr auto makeNumberGenerator = [](this auto maker, int startingValue) { return [maker, startingValue]<typename Generator>(this Generator generator) -> std::tuple<int, Generator> { return std::...
Clang fails with "function with deduced return type cannot be used before it is defined", while GCC works
|c++|lambda|c++23|
## Bundle JRE/JDK within app > users can get started without having to install the JDK manually You should bundle a JRE/JDK within your app. This is the canonical way to distribute Java desktop apps and console apps. Such apps can qualify for distribution within online app marketplace such as the [*Apple App Stor...
Finally I use the flag -fallow-argumnet-mismatch to avoid this error. And I find this flag used in its mpi version (using mpiifort and mpicc). So I guess it's a common operation in this program. I believe there are better ways to calculate the size of types, but considering the programmers' actual job (99% scientists)...
How can i save to cache file when do multiple async requests at similar time. Right now the cache file for this specific request is empty at the end (for other requests everything is working fine). Im using standard OKHttp caching mechanism along with retrofit Is there a way to block cache files until get close...
Multiple async request do not store anything to cache
|android|caching|retrofit|okhttp|
> what about i4, i5, i6 _Thread_local int i4; - not `without a storage-class specifier` - not `with the storage-class specifier static` - not tentative ---- _Thread_local extern int i5; - not `without a storage-class specifier` - not `with the storage-class specifier static` - not tentative...
In my case, I also had a stale cscope database, and had `cscopetag` turned on, so vim was jumping to the wrong tag based on the information in the cscope database. Deleting or updating the cscope db would solve it.
At the time the book was written (it corresponds to Lua version 5.3.0) Lua had wrong behavior of reading long integer literals: it wraparounded them. Later, in Lua 5.3.x this behavior has been corrected to more user-friendly. As for now, when integer literal in beyond int64 range, Lua reads it as float number to ...
|java|java-native-interface|code-injection|jvmti|
The modal is designed to appear when there is an empty filled that has no value except some input fields. It shows up, yes, but after clicking OK, It won't hide. I did some troubleshoot but nothing really happened. Any advise or help would be appreciated. ```html <!--Required Fields modal --> <div id="requiredF...
How to get OAuth2 Access token from Postman
|javascript|oauth|postman|
{"Voters":[{"Id":14732669,"DisplayName":"ray"},{"Id":4722345,"DisplayName":"JBallin"},{"Id":11854986,"DisplayName":"Ken Lee"}],"SiteSpecificCloseReasonIds":[19]}
I frequently see sample GLSL code like this: vec4 sum = texture2D(texture, uv) * 4.0; sum += texture2D(texture, uv - halfpixel.xy * offset); sum += texture2D(texture, uv + halfpixel.xy * offset); sum += texture2D(texture, uv + vec2(halfpixel.x, -halfpixel.y) * offset); sum...
{"Voters":[{"Id":7758804,"DisplayName":"Trenton McKinney"},{"Id":2530121,"DisplayName":"L Tyrone"},{"Id":17562044,"DisplayName":"Sunderam Dubey"}]}
I've encountered an unexpected behavior while working with Swift and Objective-C interoperability involving the `#selector()` expression. Typically, when using `#selector()`, I understand that it's common to specify the type (class or instance) that declares the method to help the compiler identify the correct selector...
How can I make my flask + sqlite3 application threadsafe
|python|sqlite|flask|thread-safety|non-thread-safe|
I have a SQL query ``` SELECT M.EMPLOYEEID, LISTAGG(L.NAME, ',') WITHIN GROUP (ORDER BY L.NAME) AS Locations from EMPLOYEEOFFICES M LEFT JOIN OFFICELIST L ON M.OFFICELISTID = l.officelistid GROUP BY M.EMPLOYEEID ``` The Linq equivalent I am trying to run: ``` var empOfficeLocations = (from ...
Equivalent of LISTAGG in LINQ doesn't work
|c#|linq|linq-to-sql|entity-framework-6|listagg|
null
I have a userform in an excel, before the users could run the macro that calls the userform without issues, however, now when trying to run the macro they get the following error message: [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/zFjop.png That line that reference the error is this blue ...
when i am running npm run build command then getting this error D:\SPR\Porfolio\developer-portfolio>npm run build > developer-portfolio@0.1.0 build > next build β–² Next.js 14.1.3 Creating an optimized production build ... βœ“ Compiled successfully βœ“ Linting and checking validity of types βœ“ Coll...
``` buttonControl = (controlClass:string,iconClass: string, tooltip: string, toggleFn: (event: any) => void) => { const div = document.createElement('div'); div.id = UUID.UUID(); div.className = 'ol-toggle ol-button ol-unselectable ol-control '+controlClass; div.setAttribute('style', 'pointer-events: auto'); ...
Make 1D array with appropriate size and input the values with below condition: 1)number below 100 2)which are multiple of 5. 3)Then Print it in reverse order. I was successful in printing it in ascending order. But need it reversed. My output: 005 010 015 020 025 030 035 040 Expected: 40 35 3...
In cobol how to create an array of multiples of 5 and display it in reverse
|arrays|sorting|reverse|cobol|
null
{"OriginalQuestionIds":[10259613],"Voters":[{"Id":11683,"DisplayName":"GSerg"},{"Id":2933177,"DisplayName":"Charles"},{"Id":-1,"DisplayName":"Community","BindingReason":{"DuplicateApprovedByAsker":""}}]}
I am plotting data in seaborn using a violin plot, and the plots are not centering over the xticks. If I strike the "hue" argument, they align, but everything looks bad, and I would like to keep the hues. Any advice? Code: ``` fig, ax = plt.subplots() sns.violinplot(violin_data, y = 'Height', x = 'Sample', ...
Violin plots not plotting over xticks in seaborn
|python|seaborn|violin-plot|
null
The `NullPointerException` is occurring because you are passing `driver` to the constructor of `HomePage` without initializing it. **Solution:** Initialize `driver` before passing it to `HomePage()`. **Updated Code:** ```java public class ProductTests { WebDriver driver; HomePage hp; @When...
You are free to grab any control in the master page from child page code So, say in master page, we have this: <div id="DivInMaster" runat="server"> </div> So, in the child page, you can do this: HtmlGenericControl mydiv = (HtmlGenericControl)Page.Master.FindControl("DivIn...
I was able to identify the combination of flags when compiling the library that caused this library. If I compiled with `-arch arm64 -arch x86_64` to build a fat binary that can be loaded on both architectures, then I would get this runtime error. However, removing these flags and just including an arm64 build would...
Unexpected #selector() Behavior in Swift-Objective-C Interop?
|swift|objective-c|interop|pyobjc|
null
Main reason that network call can't be done on Main Thread, that it block the thread, and Main thread is the only one mustn't be blocked. On the code above you provide, it can work because it's Retrofit's internal mechanism, network call will be dispatched to background thread if you mark retrofit function with su...
select case when country='USA' then to_number(value,10,3) else to_number(Value,10,2) from emp_country; Table Creation: create table emp_country ( PersonID int, Country varchar(25), Value number(30,5) ); current output: ---------- personid country value ---------- 12 US...
I am trying to build a chatbot like Jarvis. I am using Convai API for that. However, when I ask for certain things that are new (i.e. information about an event that happened yesterday, which was not available for the API since it is pre trained on old dataset). So, I want to get information from Google if the chatbot ...
For a binary tree, is *Breadth First Search traversal* (BFS) the same as *Pre-order traversal*? I am a little bit confused by these two different types of traversals. Additionally, how does *Pre-order traversal* compare to *Depth First Search traversal* (DFS)?
The "normal" way of exposing .NET/C# objects to unmanaged code (like Python) is to create a COM-callable wrapper for the C# DLL (.NET assembly), and call that using Python's COM/OLE support. To create the COM-callable wrapper, use the `tlbexp` and/or `regasm` command-line utilities. Obviously, however, this does no...
I am writing this answer because I believe bunch of people are looking for some good answer for this topic. So I decided to share my code that I am using for booking site, where I want to check that IS NOT arrival_date > departure_date. My `Laravel` version is `5.3.30` public function postSolitudeStepTwo(Requ...
Issues with User form in excel vba
|excel|vba|forms|microsoft-forms|
{"Voters":[{"Id":1266756,"DisplayName":"Volker"},{"Id":874188,"DisplayName":"tripleee"},{"Id":5468463,"DisplayName":"Vega"}],"SiteSpecificCloseReasonIds":[11]}
I'm inserting this script into my wordpress site using Elementor: `<script src="https://www.fourvenues.com/assets/iframe/"></script>` It looks great while I'm logged-in but as soon as I log-out I got this error on the console: Uncaught TypeError: Cannot read properties of null (reading 'style') a...
UDPATE: 1. When using the brackets syntax `[]`, don't use a dot `.`. So you'll start with `$[`, not `$.[`. 2. When iterating over items, you'll need to use the `@` to start paths in filters. `@` indicates the current item root. `$` indicates the document root. So, instead of starting your path with `$.[?($.dat...
In your Continuous Integration (CI) environment, the issue might be due to `autoprefixer`, `postcss`, and `tailwindcss` being listed under `devDependencies` in your `package.json` file. When your CI is in production mode, it doesn't install packages listed under `devDependencies`. To resolve this, you can move these...
I was inspired by @Viki answers, And I got this to work on MAC: ```C# Services.AddDataProtection() .SetApplicationName("App") .PersistKeysToFileSystem(new DirectoryInfo(@"/var/share/directory")) .UseCryptographicAlgorithms(new AuthenticatedEncryptorConfiguration() { EncryptionAlgorithm = En...
null
I use phpMyAdmin and MySQL version is: 8.0.36 `Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: '' in...` I saw some other questions about this, but none fixed my problem. I tried to run some SQL commands Like: `ALLOW_INVALID_DATES.` `set optimizer_switch="deri...
null
Replace `ITree.trigger` (not overloaded) with `trigger` (overloaded). Compilable example: ``` From ExtLib Require Import Monad. From ITree Require Import ITree. Inductive D : Type -> Type := | Even : nat -> D bool | Odd : nat -> D bool. Definition def : D ~> itree (D +' void1) := fun _ d => match d w...
Finally I use the flag -fallow-argumnet-mismatch to avoid this error. And I find this flag used in its mpi version (using mpiifort and mpicc). So I guess it's a common operation in this program. I believe there are better ways to calculate the size of types, but considering the programmers' actual job (99% scientist...
I'm using CakePHP2-PHP8 version of this framework, which can be found on [this github](https://github.com/kamilwylegala/cakephp2-php8) If someone can help me, I have problems with PHPUnit testing. Please correct me if I am doing something wrong, but when i try to run Cake tests I found several problems. Let's use c...
There's no known "good" algorithm for this problem &mdash; this is the "Hitting Set Problem" which is NP complete. But for small examples, you can search by maintaining a hitting set of the unique elements chosen so far, and try all possibilities when the hitting set doesn't already hit the next set. Something li...
There are 2 questions in fact. **First question with codes samples.** Unlike the 1st answer I disagree. Try both code segments with an `.explain()` and you will see the generated Physical Plan for Execution is *exactly the same*. Spark is based on `lazy evaluation`. That is to say: > All transformations in...
How can I display order items details in WooCommerce Admin Orders list, when High Performance Orders Storage (HPOS) is enabled? The classic legacy method code no longer works. Here is the code I was using in legacy mode: ```php add_action('manage_shop_order_posts_custom_column', 'orders_list_preview_items', 20, 2 ...
{"Voters":[{"Id":8162520,"DisplayName":"Mayukh Bhattacharya"}]}
According to the [`relationship()` documentation][1], you can use `order_by` keyword argument with `relationship`s, to set the order that will be returned. On the same page, it mentions that you can also use `primaryjoin` keyword argument to define extra join parameters. I think that can be used for the filter you want...
null
I started getting build error MSB3174 Invalid value for 'AssemblyVersion'. This started after trying a couple of version updating extensions (Version Changer 2022 & Intentional Solution Version Editor VS2022) in my Visual Studio 2022 environment. I have since uninstalled the extension, but it has not resolved the issue...
Getting MSB3174 Invalid value for 'AssemblyVersion' in C# .NET 6 WindowsForms app
|c#|.net-6.0|visual-studio-2022|
null
My application is java and onboared to elastic. I can write python script with app ame, after testing connection to elastic server. I am in need to get last 1hr tracing details through devtool/API/python. es.Elastcsearch("https://localhost:9200") And then query: `{ "match": { "name": "1NN_java"}}` If I wan...
Importing assets in Python doesn't work after making a build
This might help you achieve your desired output of "Multiline Typing Animation" <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> body { background: #1a1b1e; color: white; font-weight: 900; font-family: monospace; font-size: 2re...
Honestly I would just directly duplicate the file and then edit it afterwards. import shutil source_file = open('source.docx', 'rb') dest_file = open('destination.docx', 'wb') shutil.copyfileobj(source_file, dest_file)
null
The problem was pulling in the datetime and trying to use it as the variable for dt. When I create a random string with (''.join(random.choices(string.ascii_lowercase, k=12))) it works. So, for anyone trying to do this: create a random string instead of trying to use datetime for the variable.
Get merge WHEN NOT MATCHED output into another table
I was writeing this simple arduino code and I got this error. I can clearly see that there are the appropriate brackets in place. ``` void setup() { // put your setup code here, to run once: pinMode(A7, OUTPUT);//sfx pinMode(A5, INPUT)pinMode(A6, OUTPUT);//flash ; //Button } void loop() { // put your ma...
"expected '}' at end of input" on arduino code
|arduino-ide|