instruction
stringlengths
0
30k
βŒ€
null
Coding a two-dimensional, dynamically allocated array of `int` is a non-trivial task. If you use a _double pointer_, there are significant memory allocation details. In particular, you need to check every allocation attempt, and, if any one fails, back out of the ones that didn't fail, without leaking memory. And, fina...
I have a custom layout that lays views from left to right and if horizontal space runs out then it lays the next views below. If I put a basic text element that says "hello" inside this custom layout then the view occupies all the horizontal space. How can I adjust my setup so the custom layout only occupies the needed...
You can remove the port binding for the frontend service in the docker-compose file. Since your Nginx server can access the frontend service by name, use the frontend container's default port (port 80) in your Nginx configuration instead: proxy_pass http://frontend/; I'm unsure how you're currently se...
Your application binds to the loopback interface (127.0.0.1). That means it'll only accept connections from there. In a container, it'll only accept connections from inside the container. You need to bind to 0.0.0.0 for it to accept connections from outside the container. The key log message to look for is `Dev...
I'm using Cognito with a SPA and leveraging the Hosted UI to handle all the user interface/authentication logic (i.e. the SPA is only redirecting to Cognito and handling callbacks from Cognito). Sign ups are disabled and users are pre-created using [AdminCreateUser][1] so that the new user is in the `FORCE_CHANGE_PASS...
Automating Password Reset/Expiry in Cognito Hosted UI for Users with Expired Temporary Passwords
|amazon-web-services|amazon-cognito|
Here is what you could do if you only intend to focus on a limited number of locales, and keep a sensible default. ```php $formatter = match ($lang) { 'en' => new \IntlDateFormatter($lang, pattern: 'EEEE, MMMM d'), 'sv' => new \IntlDateFormatter($lang, pattern: 'MMMM d, EEEE'), default => new \IntlDa...
Using the IExpress utility present on Windows, I created a self-extracting EXE (self-extracting Win32 CAB), which will be used to open Python files. During building, I checked the "extract files and run an installation command" option and typed "`cmd /c myfile.bat`" to install the program. Concerning the source BAT fil...
Working on a CMS/rich text editor, and for now just recreating the layout Wix is using. Looks like this at the moment: [Base Layout](https://i.stack.imgur.com/2DcbL.png) and with the sidebar expanded like this: [Expanded Sidebar](https://i.stack.imgur.com/vbeAc.png) [Flexbox Model](https://i.stack.imgur.com/9ZDdQ....
CSS scrolling only on part of website - Flexbox, sidebar
|css|flexbox|wix|scrollbar|overflow|
null
A windowed function is processed at the same time the SELECT is. More specifically, this is the order of operations: - List item - FROM and JOINS - WHERE - GROUP BY - HAVING - SELECT notice how SELECT is processed last. Therefore your queries are not the same. Your first query is filtering before the w...
`from llama_index.core.node_parser import SimpleNodeParser` ?
Going through the issues on [vscode-python](https://github.com/microsoft/vscode-python) repository, it is being mentioned in multiple issues that git bash is not officially supported. For example [here](https://github.com/microsoft/vscode-python/issues/23008#issuecomment-1972618316): > Note Gitbash isn't supported b...
The problem is even if the *condition* is *false* and the *capture* didn't return any frame (like at the end of the video), your code still tries to track this nonexistent frame before the *while* condition will do its job: ```python while condition: condition, frame = capture.read() results = model.trac...
I wait until the page is loaded and use the "DOMContentLoaded" method to add eventhandlers on some p tags. This works until I open and close the modal, then the page/js freezes. Why does it freeze? ``` <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initi...
The result of dereferencing a deleted pointer is undefined. That means anything can happen, including having a program appear to work. There is no promise that an exception will be thrown, or that an error message will be displayed. The specific language in the [C++23 Standard](https://timsong-cpp.github.io/cppw...
> How should I code to test for an integer value of 0 or 1 The right answer is to use **OR-Patterns**, described in [PEP 622][1]: > Multiple alternative patterns can be combined into one using |. This > means the whole pattern matches if at least one alternative matches. > **Alternatives are tried from left to...
I want to update or insert 100,0000 records into a database in a single batch process using some effective design pattern. Example: I have 1 million records in my table date range from 1/1/2020 to 1/1/2024 and if user updates any transaction in the middle, e.g. 1/1/2022, then based on that particular date I need to ...
Design patterns - How Design patterns work with bulk data
|java|hibernate|design-patterns|
null
{"Voters":[{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}]}
Figured it out. Had a dumb if statement manually checking the first index of the argv array for the file path. This wouldn't work if switching from `node index.js <command>` to `scaffold <command>` because the first index no longer points to what the if statement is looking for, thereby never allowing runCLI() to run. ...
{"Voters":[{"Id":2395282,"DisplayName":"vimuth"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}]}
{"Voters":[{"Id":2530121,"DisplayName":"L Tyrone"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}]}
{"Voters":[{"Id":9952196,"DisplayName":"Shawn"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}],"SiteSpecificCloseReasonIds":[18]}
1. Return a pointer to the `Node` of interest instead of updating the out parameter `head_dest`. The stack will implicitly hold `cur_list_dest`. 1. The original implementation changes the original list. To create a new list you need to return a pointer to *copy* of the smallest node or NULL. To emphasize that I m...
Custom layout occupies all horizontal space
Try modifying your li style like this: ``` css OL { margin-left: 0; padding-left: 0; } ``` And add this: ``` css li p { padding-left: 10px; } ```
null
I do not understand how the following operations `2s – 1` and `1 - 2s` are performed in the following expressions: ```vhdl R <= (s & '0') - 1; L <= 1-(s & '0'); ``` Considering the fact that `R` and `L` are of type `signed(1 downto 0)` and `s` of type `std_logic`. I have extracted them from a `vhdl` code...
Is there any difference between using map and using function if everything is known at compile time. (I'm new to Kotlin/Java and i couldn't find answer to this) Maximal number of items will never be higher than 200 and for the most of the time it would be below 10 Example: ```kt val mappings = mapOf( "PL" t...
[my question is what's the meaning of new_image[new_image] in this image img in index what does it mean can you help me with this and specify what img in index returns my image in this is gray scale thank all of you answering my question](https://i.stack.imgur.com/umMGp.png)
what is it? my question is what's the meaning of img[img]
|python|indexing|
null
I dont see any problem working with the above xml, you will have to query into object and create a table / collection for each. Or Create a type field for each and store them in the same table/collection { "type": "person", "name": "John", "age": 30 } { "type": "car", "name": "BMW", "price": 50000 } ...
Working on a CMS/rich text editor, and for now just recreating the layout Wix is using. Looks like this at the moment: [Base Layout](https://i.stack.imgur.com/2DcbL.png) and with the sidebar expanded like this: [Expanded Sidebar](https://i.stack.imgur.com/vbeAc.png) [Flexbox Model](https://i.stack.imgur.com/9ZDdQ....
The issue you're experiencing might be due to the margin-left property in your .col img CSS rule. When the screen size is reduced, the margin-left: 7vw; causes the image to extend beyond the viewport width. To fix this, you can adjust the margin-left property inside the media query to reduce the margin when the scre...
{"Voters":[{"Id":476,"DisplayName":"deceze"}]}
I don't know how, but everything was fixed after a reboot :)
You'd have to edit file `gradle/libs.versions.toml` and add in TOML format: [versions] androidx_media3 = '1.3.0' androidx_compose_bom = '2024.03.00' androidx_compose_uitest = '1.6.4' # ... [libraries] androidx_media3_exoplayer = { module = "and...
Spring Data JPA doesn't support aggregate functions in queries using method names (see the table of supported keywords [here][1]). The suggested approach is to use `@Query` as mentioned in your question. Why do you consider it dirty? It isn't IMHO. [1]: https://docs.spring.io/spring-data/jpa/reference/jpa/que...
### For the new Firebase update Try this code for the latest Firebase update. Open the console, paste this code and hit enter!!! ```js setInterval(() => { document.getElementsByClassName('edit-account-button mat-mdc-menu-trigger mat-mdc-icon-button mat-mdc-button-base')[0].click() Array.from(document.getElem...
null
### For the new Firebase update Try this code for the latest Firebase update. Open the console, paste this code and hit enter. ```js setInterval(() => { document.getElementsByClassName('edit-account-button mat-mdc-menu-trigger mat-mdc-icon-button mat-mdc-button-base')[0].click() Array.from(document.getEleme...
I just needed to add ```mkdir -p /var/run/kea``` to the ```kea-dhcp4-server``` script under ```init.d```. (I had already tried this but forgot to set execute permission on ```kea-dhcp4-server``` in my .bbappend).
{"Voters":[{"Id":349130,"DisplayName":"Dr. Snoopy"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":2836621,"DisplayName":"Mark Setchell"}],"SiteSpecificCloseReasonIds":[18]}
I do not understand how the following operations `2s – 1` and `1 - 2s` are performed in the following expressions: ```vhdl R <= (s & '0') - 1; L <= 1-(s & '0'); ``` Considering the fact that `R` and `L` are of type `signed(1 downto 0)` and `s` of type `std_logic`. I have extracted them from a `vhdl` code...
I was working with importing classes (please see my code below) and I ran into the following mistake: Below is the code of the file `admin_instance.py` and I see the squiggly line under admin in `admin_instance.py` ``` import admin my_admin = admin.Admin('john', 'doe', 30, 'USA') my_admin.describe_user() my...
Mistake in importing the class
|python|import|importerror|
null
In my extension I add files and create filters for them in `project.vcxproj.filters` file (it's for C++ project). Now I'm doing something like this: ``` ProjectItems items; items.AddFromFile(path); // Mofify <project>.vcxproj.filters project.DTE.ExecuteCommand("File.SaveAll"); project.DTE.ExecuteCommand("Proj...
Is it possible to refresh filters instead of reloading project
|c#|visual-studio-extensions|vsix|
Encountering `Warning: Trying to access array offset on value of type null in /www/wwwroot/kopsis/config.php on line 95 Warning: Trying to access array offset on value of type null in /www/wwwroot/kopsis/config.php on line 96 Warning: Trying to access array offset on value of type null in /www/wwwroot/kopsis/c...
I wait until the page is loaded and use the "DOMContentLoaded" method to add eventhandlers on some p tags. This works until I open and close the modal, then the page/js freezes. Why does it freeze? ``` <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initi...
Windows "Open with" a file with self-extracting CAB Win32
|windows|cab|open-with|self-extracting|iexpress|
null
As far as I know, tflite models require metadata in order to run. Regarding the "*cannot initialize type StatusCode*" error, I recently resolved the same situation with *tflite_support* imports simply by downgrading the TensorFlow version in Google Colab like: !pip uninstall tensorflow !pip install tensorfl...
[enter image description here][1]I'm relatively new to using neo4j. I've connected to a database with the py2neo library and populated the database with the faker library to create nodes for Person and Address each with attributes attached to them. I'm interested in creating indexes and testing the performance of diffe...
You could try something like this: print("Welcome to Nim!") name = input("Enter name: ") replay = 'y' while replay == 'y': and then at the end of the game: ``` winner = current_player print("Winner is", winner) replay = str(input("One more round (y/n)?")) ```
Single core embedded system Priority based scheduling Thread 2(T2) - High priority Thread 1(T1) - Low priority **Requirement:** 1. Data flow from T2 to T1 through shared circular buffer. Data flow possible in one direction i.e. T2 to T1. 2. Between threads planning to use circular buffer as sha...
Shared variable read from low priority thread in preemptive scheduling
|c|multithreading|embedded|critical-section|preemptive|
****just add 'title' to display tooltip message** <i class="fas fa-question-circle help-icon" data-bs-toggle="tooltip" data-bs-placement="top" container="body" aria-label=".." title="....."></i> **or else put tooltip properties inside anchor tag** <a href="#" tooltip properties><i.....></i></a>**
{"Voters":[{"Id":12265927,"DisplayName":"Puteri"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}]}
{"Voters":[{"Id":6243352,"DisplayName":"ggorlen"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}],"SiteSpecificCloseReasonIds":[13]}
{"Voters":[{"Id":29157,"DisplayName":"Adam Liss"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}]}
{"Voters":[{"Id":14732669,"DisplayName":"ray"},{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"}]}
{"Voters":[{"Id":2372064,"DisplayName":"MrFlick"},{"Id":22180364,"DisplayName":"Jan"},{"Id":1974224,"DisplayName":"Cristik"}]}
Several things are needed to help break the binding loop: 1. Check a break flag as smr has suggested 2. Allow events, use Qt.callLater() means idle time is granted so events can fire 3. Define events that reset and set the break flag We can borrow the userbreak pattern and implement here with mouse tapped, k...
I am using `react-bootstrap` `Table` filteredData function should return `searchTerm` matches record from the data. I am getting empty data on search now. How to loop through Object and return true If any of the searchTerm match? ```javascript import { Table, Pagination, Form } from 'react-bootstrap'; ```...
I try to go from Spring-Boot 2.7 to 3.1 - its regarding Security. What I have under old version 2. public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure (HttpSecurity http) throws Exception { http.cors ().an...
Spring 3 - Security: How to rebuild authManager () usage?
|java|spring-boot|spring-security|
In Delphi 7 I have a report written in QuickReport. The report is called by the function from another form ` var RepResult : integer RepResult := ShowReport(param1,param2...); ` The function inside report looks like ` var QuickRep1 : TQuickReport; ReportResult : integer; functio...
Delphi - How to get result of function from QuickReport without viewing a report?
|delphi-7|quickreports|
null
{"Voters":[{"Id":147356,"DisplayName":"larsks"},{"Id":2530121,"DisplayName":"L Tyrone"},{"Id":5320906,"DisplayName":"snakecharmerb"}]}
There is no such thing as a "normal shell". You have "interactive shells" and "non-interactive shells", which differ, among other things, by what `*rc` file they source at startup and by *whether aliases are expanded or not*. And there are other types, even. By default Vim uses a *non-interactive shell* for `:!` and...
You could use [`top_k`](https://docs.pola.rs/py-polars/html/reference/dataframe/api/polars.DataFrame.top_k.html) and slice the last row: ``` import polars as pl np.random.seed(0) df = pl.DataFrame({'col': np.random.choice(5, size=5, replace=False)}) out = df.top_k(2, by='col')[-1] ``` You could also [`filter...
PYTHON & OPENPYXL: Drag copy paste formula down below from previous cell
|python|automation|openpyxl|
null
{"Voters":[{"Id":2921691,"DisplayName":"Markus Safar"},{"Id":1145388,"DisplayName":"Stephen Ostermiller"}],"SiteSpecificCloseReasonIds":[13]}
|python|python-typing|metaclass|type-alias|
I've started working with Svelte and I stumbled upon some unexpected behavior. This is the snippet of my app source ```typescript let currentPage = 1; $: if (currentPage || $selectedOption) { fetchPage(currentPage, $selectedOption); } async function fetchPage(page: number, option: string) { //... } onM...
In order to solve your problem, you first need insight into what is occurring. So to do that, you should enable SSH debugging: git config --global core.sshCommand "ssh -vvv" Then run your `git clone` again. This time, it will show you a lot more information. You can create a new StackOverflow question with...
How can I get all available devices for CuPy? I'm looking to write a version of this for CuPy: ``` if is_torch(xp): devices = ['cpu'] import torch # type: ignore[import] num_cuda = torch.cuda.device_count() for i in range(0, num_cuda): devices += [f'cuda:{i}'] if torch.backends.mp...
{"Voters":[{"Id":1145388,"DisplayName":"Stephen Ostermiller"}],"SiteSpecificCloseReasonIds":[18]}
i'm trying to play a short sound clip when a usr click on a javafx canvas, i have followed the attach audio documentation provided by gluon yet no sound is being played when i install the app on android phone the following is my implementation based on gluon documentation ``` graphicContext.getCanvas().setOnMousePr...
Using Malvin Lok's answer as a lead, I located `io.netty.handler.codec.http.HttpHeaders` and put a breakpoint for each `set*(..)` and `add*(..)` method. Here's what I found Default headers are added one by one in different places of Netty code. It's hard-coded, there are no injected strategies or configs. There's ap...