instruction
stringlengths
0
30k
null
In some cases, this is because Pycharm scans and indexes the PYTHONPATH. I figured out that some shared script I was running got changed by some nincompoop (may his severed head soon decorate our moat) and the /homes directory got into the PYTHONPATH. How to get it out: Go to **File->Settings->Project:[your proje...
How can I outsource worker processes within a for loop and then merge them again in node.js?
|node.js|multithreading|node-worker-threads|
I'm attempting to display a list of movies on a website using Jinja2 (a template engine for Python) and Bootstrap (a front-end framework). However, I'm having difficulty getting the movie cards to display correctly.When trying to display the movie cards using Jinja2 and Bootstrap, the cards aren't being displayed as ex...
Displaying a Movie List on a Website Using Jinja2 and Bootstrap
|python|html|web|bootstrap-4|
null
> I would expect both queries reusing the same plan, hence, pointing to the same plan_handle. Is my expectation incorrect? Your expectation is incorrect. When you hard-code where-clause values, the literal values are available at the time the plan is optimized, and so the different queries may get different plans. ...
Initialization: We have two sorted arrays, A and B, and we're merging them into a single sorted array, C. The idea of ​​the merge function is: 1.We iterate through both arrays simultaneously using two indexes, one for each array. While both arrays have elements remaining, we compare the elements at the current i...
null
First, some observations: 1. The string size is exponential in n so a(n) takes 10000 bits. The largest number type in C++ is uint64_t with 64 bits. 2. Luckily, the restriction on k means we only have to consider the first 10^15 digits, which is 35 bits and thus fits in a uin64_t. 3. a(49) is the last digit str...
null
null
Some examples of how to query a json data type field: ```sql SELECT * FROM users WHERE JSON_EXTRACT(meta_data, "$.first_name") = 'bob'; SELECT * FROM users WHERE JSON_EXTRACT(meta_data, "$.age") IS NOT NULL; SELECT * FROM users WHERE JSON_EXTRACT(meta_data, "$.accepted_policy") = true; ``` **With mysql...
null
null
null
null
null
I'm not sure that Excel keeps track of the filename, I believe it just gets the image out of the file. In order to test this, I have created an empty Excel sheet and inserted a picture, using the feature you mentioned. The name of the file was "350450_Something.jpeg". Then I saved the Excel file. Afterwards I unz...
I didn't see any examples of this so I am wondering if this is a bad practice to extend DAG class. Is it a bad practice and why, if it is? Example of where I can see this useful follows... Let's say we have a number of DAGs which all share the same behaviour: calling a specific function as a very last thing, reg...
Google Maps not displaying in Flutter app despite successful API hits
|flutter|dart|google-maps|
null
With option `enable_events=True` in your `sg.Radio` elements to generate event when clicked, or it won't generate event when you click on them and no update for disabled state of the Input element. ```python import PySimpleGUI as sg sg.theme('DarkBlue') layout =[ [sg.Radio('Yes', 'g', enable_events=True, ...
If the line is `#pod 'GoogleMobileVision/FaceDetector'` it means you or someone else commented out the pod. It won't be installed. Viewing the `podfile` in Xcode will show the item dimmed. e.g This spec will only install `Purchases`: [![enter image description here][1]][1] Change the line to `pod 'GoogleMobi...
I am looking for a way to use a hot key 's' to capture repeated screenshots. When the script originally runs, I do not want any screenshots being captured, but when I press 's' I want screenshots being recorded at a designated time interval. When I press 's' again I want the screenshots to stop being recorded. Here...
Python: Screenshot toggle switch (no Tkinter)
Use the `debounce` function from npm packages which will make a delay while the user types before making a request to the API. const debounceDelay = 300; const handleDebouncedChange = debounce((event) => { console.log('Debounced value:', event.target.value); }, debounceDelay); ...
I am making a form using next js 14, I made an actions.ts file there I built a generic method that shows a console log. [form component][1] [action.ts][2] In the form component, loginForm.tsx, in the form tag, I use the action property, and from there, I call the generic method that I made in action.ts [de...
Given the following C program (MSVC does not optimize away the "work" for me, for other compilers you may need to add an `asm` statement): ```c #include <inttypes.h> #include <stdlib.h> #define SIZE 10000 typedef struct { int32_t a, b, c; } Struct; void do_work(Struct* data) { int32_t* a = malloc(siz...
Yeah you can just promote it to production or add a new release once you got the production. For those who need 20 testers can follow the below way , I have created this app called Testers Community to solve the problem of 20 testers for 14 days. You can download the app here https://play.google.com/store/apps/d...
I have an HTML code that I need to send email to certain sectors of a company. When I use the `.HTMLbody` property with html, a syntax error arises. The VBA code and the HTML code that I tried to pass to the `.HTMLbody` property. ```vba Sub enviar_email() Dim linha As Integer Dim Objeto_outlook As...
I am trying to make something like a todolist web with flask, and I am inserting new tasks using a jinja loop in index.html ``` {% for x in data %} <div class="love"> <button type="button" class="tasks" style="background-color: {{x[1]}};"> {{x[0]}}<i class="{{x[2]}}" id="habitIcons"></i> ...
how to control jinja loop using javascript
|javascript|html|sqlite|jinja2|
null
I have a form that upload multiple files and their associated meta data. I would like to dynamically add metadata to each file depending on how many files are selected for upload. I render a list of Title, Description and Document Type controls based on the amount of files selected. I can link the document title ...
Dynamically bind control to object in Mudblazor page
|file-upload|mudblazor|dynamic-controls|
null
The query looks like this: **Datatype for month.ty is text** ``` month.ty LIKE '%2024%' ``` I am trying to make it **get year without having to change it when year ends**. Like get current year. I have tryied with plus special character: ``` month.ty LIKE '%' + YEAR(current_timestamp) + '%' ``` This way it ...
``` p1 = new Promise((res,rej)=>{ console.log("p1 setTimeout"); setTimeout(()=>{ res(17); }, 10000); }); p2 = new Promise((res,rej)=>{ console.log("p2 setTimeout"); setTimeout(()=>{ res(36); }, 2000); }); function checkIt() { console.log("Started"); let val1 = this.p1; console.log("...
I'm trying to check if a package is installed in a Ubuntu based system. Running the following in my terminal returns `true` (exit code 0) since I have those packages: ```shell dpkg --get-selections | grep -wq <package> ``` Where the \<packages\> are the following: - google-chrome - okular-extra-backends ...
Why `set -o pipefail` gives different output even though the pipe is not failing
|linux|bash|shell|
null
<!-- language-all: sh --> To complement [Prodige69's helpful answer](https://stackoverflow.com/a/78182028/45375): Another way to **wait _only_ for `msiexec.exe`** (and child processes _synchronously_ launched from it, if any) rather than its entire child process _tree_ (`msiexec.exe` plus any child processes laun...
How to apply double quotes in html code within the body property of emails in VBA?
null
You have two primary challenges in your question: 1. separating the space-separated word read into `input`; and 2. storage for each word. While there are may ways to "tokenize" (separate) input, when wanting space-separated words, a very simple way to do that is to just read with `fgets()` to fill `input` (as yo...
Don't use boolean indexing. Rather set "A" as index: ``` ddd = { 'A': ['a', 'b', 'c', 'd'], 'X': [100.0, 20.0, 5.0, 2.0], 'Y': [6.0, 2.0, 1.0, 1.0] } df = pd.DataFrame(ddd).set_index('A') lst = [('a', 'b'), ('c', 'd')] out = [df.loc[x]/df.loc[y] for x, y in lst] ``` Output: ``` [X ...
I am working on my auth implementation for a side project of mine and I am stuck trying to authorize the user sensing the httpOnly cookie with the token to each subsequent request after login. The workflow is the following: - login req from the FE - login res from the BE that sets the cookie httpOnly - POST req fr...
I'm trying to write my vector, to realize the function of the one in STL as much as possible. However when I tried to run a test project, Visual Studio told me that, `const` version of `begin()`, `const` version of `end()`, `cbegin()` and `cend()` trigger `C2373` errors due to redefinitions. I'm sure I didn't defin...
I´m trying to replicate the following graph: [![graph][1]][1] I have a dataset with a timeseries of intensity (4 different loads) and coefficient. Does anyone know which R function is the best to produce graphs like that? Thanks I´ve tried the plotly function but didn´t get the desired result [1...
null
I'm trying to replicate the following graph: [![graph][1]][1] I have a dataset with a timeseries of intensity (4 different loads) and coefficient. Does anyone know which R function is the best to produce graphs like that? I've tried the plotly function but didn't get the desired result [1]: https:/...
ok, heres whats wrong with your code 1. after assigning the srcObject of a video element you have to call play 2. in the setInterval function you get the image data in your let statement but you havent drawn anything to the canvas yet, although it would be available in the second iteration 3. when you actua...
{"OriginalQuestionIds":[54055445],"Voters":[{"Id":8620333,"DisplayName":"Temani Afif","BindingReason":{"GoldTagBadge":"css"}}]}
I know that the question is tagged with c++14 but it may be interesting to have a version for newer versions of the standard where metaprogramming is a little bit easier (not so obvious in this example though). Moreover, I also needed to have a range of integers not necessarely bigger than 0, so the following code ...
I'm trying to make a button that has an image background and text. The text should be invisible and the bg image should be opaque. When you hover the button, the background should go black and the text appear at the same time, with a fading transition, but I cant get only one to display at a time. I tried adding the...
Practically, there is no difference, especially since you are using immutable `Map`s (as opposed to `MutableMap`). I used Amazon's `corretto-18` to compile your code and inspected the bytecode. Those are the conclusions I got from doing so: `println(mappings["PL"]!!)` compiles to the following bytecode: ```byteco...
Try this if it works spring.servlet.multipart.enabled=true spring.servlet.multipart.file-size-threshold=2KB spring.servlet.multipart.max-file-size=200MB spring.servlet.multipart.max-request-size=215MB
I am trying to send a music file from my app to WhatsApp using Apple Share sheet which is UIActivityViewController. I am able to share the music file but the problem is I cannot add metadata to this. I mean I can share audio with url and it can be open and listen in WhatsApp but I cannot figure out how to add metada...
How to share metadata of an audio url file to a WhatsApp conversation with friends
|ios|swift|whatsapp|uiactivityviewcontroller|ios-sharesheet|
@Modifying @Transactional @Query("DELETE FROM BusinessTransaction bt WHERE bt.userId.id=:id") void deleteByUserId(Long id); For this query I am getting the following error: > Transaction silently rolled back because it has been marked as rollback-only In this query `userID` is an ...
Transaction silently rolled back
You are trying to call the `stop()` method on a `MediaStream` object like `main_pc["local_audio"]` which is no longer how you are supposed to do do it. Instead, you need to stop all tracks of the local stream along the lines of ``` main_pc["local_audio"].getTracks().forEach(track => track.stop()) ``` Once all local...
<!-- language-all: sh --> * Your screenshot is not consistent with your code, because it implies that you passed (a variable containing) either `$null`, or an _empty array_ (`@()`) to the `-ArgumentList` parameter of [`Start-Process`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.managemen...
I have a DB of 600 talks on various topics by various speakers. They are in the format of: ------------------- Topic 1 (Speaker 1) Event_type_1 - , Topic 2 (Speaker 2) Event_type_2 - , Topic 3 (Speaker 3) Topic 4 (subtopic 1) (Speaker 1) --------------------- Ideally, I would want to convert the DB t...
this should work @Scheduled(cron = "${scheduled.everyThreeHours}") public void runCleanupSchedule() throws IOException { ... } in your **application.properties** add **scheduled.everyThreeHours** scheduled.everyThreeHours=0 0 */3 * * * and you can change the value for each environ...
You have to change the `keydown` event in your EventListener to be `input` when you add an event listener to the `numberInput`: ```javascript numberInput.addEventListener ("input", (e) => { inputCheck(numberInput.value); if (e.key === "Enter") { outputField.textContent = toRoman(numberInput.value); }...
As you haven't shared your buildable code (ViewA is missing), I am sharing some suggestions to answer your question: 1. Use `@Binding` instead of `Binding<Bool>`. 2. Properly handle navigation with `NavigationStack` and `navigationDestination` to handle navigation (This is out of your question). The version of `Nav...
Good morning. I am working to build a web app using tabulator and appscripts with a google sheet "database" I guess you would call it. I found a tutorial online and have been following along. There have been a few issues that I have been able to find and fix. However; right now I am working to build the functionality w...
Tabulator and App Script Tutorial save function not working
|google-apps-script|tabulator|
null
I am using the Kendo UI (2015.3.930) Grid Control and I have a integer textbox in a grid filter row that always as decimal when I apply the filter. Here is my code: @(Html.Kendo().Grid((IEnumerable<UiController.Lot>)Model.Lots) .Name("Grid") .Columns(columns => { column...
null
I am using the Kendo UI (2015.3.930) Grid Control and I have a integer textbox in a grid filter row that always as decimal when I apply the filter. Here is my code: @(Html.Kendo().Grid((IEnumerable<UiController.Lot>)Model.Lots) .Name("Grid") .Columns(columns => { column...
Given a json object like this { link:"https://www.google.com", image:"../../assets/images/googleicon.png", }, And then this in the component <View> {info.image && <Image source={require(info.image)} /> } </View> It just yells at me with "Inval...
How i can repair my redirect in php when my db is completed?
|php|redirect|
null
If you are trying import context directly from sqlalchemy try sqlalchemy.orm
I'm creating my own links manually within a module of a divi theme, since divi doesn't support three links side by side. It's supposed to look like this: [Three side-by-side links](https://i.stack.imgur.com/RZ5iM.png) But when the screen is resized it looks like this: [Split looking link](https://i.stack.img...
|html|css|button|hyperlink|
sudo pip3 install pillow --upgrade this worked for me in raspberry pi. pillow version 10.2.0 was installed and solved my error.
Your question explicitly asks for an MVVM compliant way to handle attached UI events (or UI events in general) in the application view model. There is none. Per definition, the view model must not participate in UI logic. There is no reason for the view model to ever handle UI events. All the event handling must take p...
Here is my set up: Specs: Tomcat 7.0.109 jdk1.8.0_11 IDEA20232.5 When I enter the 'test5_5' method of this action, it will redirect to a 404 page. ```java if(NumberUtils.notNullEquals(result.getResult(), 0)){//登录失败 return LOGIN; } ``` The corresponding configuration file ```xm...
|java|jsp|configuration|struts2|actionresult|
I have an array of `value,location` pairs ```bash arr=(test,meta my,amazon test,amazon this,meta test,google my,google hello,microsoft) ``` and i want to print the duplicate value, the number/count of them, along with the location eg ```txt 3 test: meta, amazon, google 2 my: amazon, google 1 this: meta 1 hel...
Bash: Find duplicates in array, print count with pair
|arrays|bash|awk|uniq|
I use GraphQL library `HotChocolate`. Program.cs: ``` var builder = WebApplication.CreateBuilder(args); builder.Services .AddGraphQLServer() .AddAuthorization() .AddQueryType<ProductQuery>(); builder.Services.AddDbContext<DpcDatabaseContext>(); // ... v...
HttpOnly cookie is undefined when reaches the backend middleware
|reactjs|node.js|cookies|jwt|
The error occurs when you start a script from the editor that should be started by a trigger. Therefore, the edited cell range cannot be retrieved and an error occurs.