instruction
stringlengths
0
30k
I'm using a WDM driver project in VS 2022. In case of the following code snippet: extern "C" NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) { DbgPrint("v=%s", 123); return STATUS_SUCCESS; } The `Db...
How to enable warning C6067 during (WDM) Windows driver compilation in VS 2022?
|c++|visual-studio-2022|wdm|windows-driver|
You also can use validator with some actions on raw data for field. from pydantic import BaseModel, UUID4, SecretStr, EmailStr, constr, validator class UserCreate(BaseModel): email: EmailStr password: SecretStr first_name: str last_name: str @validator("email"...
Here’s an example of what it might look like: ``` add_filter( 'login_redirect', 'custom_login_redirect', 10, 3 ); function custom_login_redirect( $url, $request, $user ) { if ( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) { if ( $user->has_cap( 'administrator' ) ) { $url = h...
I have the following entities ``` @Builder @Getter @Setter @NoArgsConstructor @AllArgsConstructor @Entity(name = "Employee") @Table(schema = "core", name = "employee") public class EmployeeEntity { @Id @SequenceGenerator(schema = "core", name = Sequence.EMPLOYEE_ID_SEQ, sequenceName = Sequence.EM...
Why does Hibernate execute two SELECT queries instead of one when using @ManyToOne(fetch = FetchType.EAGER)
|java|hibernate|jpa|quarkus|quarkus-panache|
I have a dataset with monthly sales data by brand. I have a measure which calculates market share %. I want to add an additional measure which calculates the growth in market share % between the most recent month and the second most recent month. Is this possible
Market share growth versus last month, last year
|date|powerbi|
- <kbd>Ctrl</kbd>+<kbd>H</kbd> - Find what: `,[^,\r\n]$` - Replace with: `LEAVE EMPTY` - **TICK** *Wrap around* - **SELECT** *Regular expression* - <kbd>Replace all</kbd> `\h+` stands for 1 or more horizontal spaces.
Is there any way to tell Notepad please do this... FROM THIS 15.63387,46.42795,1,130,1,210,Sele pri Polskavi TO THIS 15.63387,46.42795,1,130,1,210 I would like to remove everything after the last , So that in the end it looks like 15.63387,46.42795,1,130,1,210 Thing is when I try it using Notepad++ wi...
I'm going through [this][1] azure exercises and have a question regarding this statement: > From the All resources view in the Azure portal, go to the Overview page of the production slot of the web app. I have 2 deployment slots in my newly created test app services. Creating a `training-Staging` slot is the onl...
Application settings for production deployment slot in Azure App Services
Since mod_dav_svn.so and mod_authz_svn.so were not present in SVN (TortoiseSVN), I downloaded the files from https://github.com/nono303/win-svn/tree/master/vc15/x64 and moved them to "C:\Apache24\modules". I then added the following lines to the httpd.conf file in Apache24: `# Subversion Configuration LoadModule d...
Cannot load modules/mod_dav_svn.so into server
|windows|apache|svn|module|webdav|
null
`flipped_image = image[:, ::-1, :]`
I'm using React Native Expo, and I want to open the default phone Contacts app. **On Android, I used:** await Linking.openURL("content://contacts/people/"); and that's worked. On iOS that doesn't work. **I tried:** await Linking.openURL('contacts://'); but it doesn't work. How do I do th...
```python T = TypeVar("T", bound=str) def foo(a: T, b: T) -> T: return a + b print(foo("1", "2")) ``` mypy: `error: Incompatible return value type (got "str", expected "T") [return-value]` I dont understand how to fix this problem(using bound).
|python|mypy|typing|
I'm trying to populate a 2D array of objects and get a result like this example: ``` Guid guid = Guid.NewGuid(); var data = new[] { new object[] { 22, "cust1_fname","cust1_lname",guid }, new object[] { 23, "cust2_fname","cust2_lname",guid }, new object[] { 24, "cust3_fname","cust3_lname",guid }, };...
You can scroll to a particular view in a `ScrollView` by using its id. This can either be done using a `ScrollViewReader` (as suggested in a comment) or by using a `.scrollPosition` modifier on the `ScrollView` (requires iOS 17). Here is an example of how it can be done using `.scrollPosition`. - The images used ...
i built an AR project using Unity 2022.3.22f1 and Vuforia 10.22, the app is working just fine in the my pc using webcam but after building it and Install it in my Samsung A21S (that have android 12) the camera permission pop up after allows it the app gose black screen any help please i've tried many tricks that I...
unity + Vuforia balck screen in android AR app
|android|android-studio|unity-game-engine|augmented-reality|vuforia|
null
For me, using a .json file rather than a .js file for .eslintrc allowed `eslint .` to operate as it should in a module-based project. Failed attempts (.eslintrc.js): ```js export default { // also tried: export { // also tried: module.exports = { "env": { "browser": true, "es2021": true }, "...
I have been trying to watch my tests WITH test coverage without much of a success. My best attempt sofar is to install packaeges `pip install pytest pytest-watch pytest-cov` and run on separate terminals or tabs these commands, below Watch tests: `ptw --quiet --spool 200 --clear --nobeep --config pytest.ini --ext=.p...
Alternatives to pytest-watch on python unit test with pytest
|pytest|pytest-cov|
null
|python|matplotlib|draw|
null
I think this should always work: ```go string(norm.NFD.String(char)[0]) ```
Perform an inner-[`merge`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.merge.html): ``` index = df1.reset_index().merge(df2)['index'].tolist() ``` Or, if you have more columns but only want to consider a/b: ``` index = df1.reset_index().merge(df2, on=['a', 'b'])['index'].tolist() ``` If you ca...
I think you just need to change how you call pagination, if your code sample is accurate: `page = RawQuerySetPaginator(queryset, 15)` Pagination should have no issue with _most_ raw queries. Ordering and searching are, of course, an issue. ```py class MyPagination(PageNumberPagination): page_size = 1 ...
I aim to select full name of employees that either have no boss or their boss lives on a street that contains letter 'o' or letter 'u'. Then, I want to list them in descending order by full name. The problem comes in the ordering, because by queries that I think are the same I get different answers. When I introduc...
Perhaps the easiest thing to do is to save the next group that would be generated. Then a future run can rebuild a new product instance that starts with that group: def restart_product_at(start_group, *pools): n = 0 # Position of the start_group for element, pool in zi...
I'm attempting to implement the case change feature available in Microsoft Word with Shift + F3 into a TinyMCE React editor. The problem I'm running into is the last part where it should keep the same text selected/highlighted. The below works fine, as long as I haven't highlighted the last character of a node. If I ha...
I am using Svelte with [Ultralight][1], communication is handled with JavaScriptCore so Ultralight set / call functions on the global javascript object (which I believe is window). Now I want to call these functions in my svelte app, but I am using modules and so I can't set / use global functions. So for now I am s...
```r library(tidyverse) library(shiny) library(DT) ui <- sidebarLayout( sidebarPanel( numericInput("price", label = "Price ($)", value = 4.31, min = 0), numericInput("sqft", label = "Average Square Footage", value = 4400, min = 0), numericInput("delivery", label = "Delivery Cost", va...
I want to create a simple bar chart for a specific key and its values in a json data in FastAPI. The data is as shown below. I want to make a chart where indexes are in the x-bar and values of Blue in the y-bar. Can you please help me or lead me somewhere where I can learn that? {"1": {"Red": 14, "Blue": 12}, "2"...
I'm using Composables in Android Studio Kotlin, It creates a spanned string via specified keywords via looking up within foreach loop, How to make it append just one time or remove duplicated appended text? ``` buildAnnotatedString { note.value.title.forEachIndexed { index, char...
**I was facing the same issue with the Footer component.** [![enter image description here][1]][1] I dynamically added the Footer component and this is how I resolved this error: import dynamic from "next/dynamic"; const Footer = dynamic( async () => await import("../../components/foote...
For those using old LTS ***eclipse-temurin:17-jre-alpine*** or current LTS ***eclipse-temurin:21-jre-alpine*** the `wget` is included in default image, thus out of box **healthcheck** for docker compose would look like: ```yaml healthcheck: test: "wget -T5 -qO- http://localhost:8080/actuator/health | gre...
I'm using PostgreSQL in my project. The primary key column in my table is a character type with length of 36. I generate guids in the backend and store them in the table. Do I need to change the column type as uuid? Can it have the same performance?
Use data type uuid or varchar(36) for my UUID column?
|postgresql|database-design|uuid|
I have been trying to watch my tests WITH test coverage without much of a success. My best attempt sofar is to install packaeges `pip install pytest pytest-watch pytest-cov` and run on separate terminals or tabs these commands, below 1. Watch tests: `ptw --quiet --spool 200 --clear --nobeep --config pytest.ini --ext...
You could try using the following formulas, this assumes there is no `Excel Constraints` as per the tags posted: [![enter image description here][1]][1] ---------- =TEXT(MAX(--TEXTAFTER(B$2:B$7,"VUAM")*($A2=A$2:A$7)),"V\U\A\M\00000") ---------- Or, using the following: =TEXT(MAX((--RIGHT(B$2:B...
preventing duplicate text
|kotlin|android-studio|android-jetpack-compose|composable|
null
I received a data dump of the SQL database. The data is formatted in an .sql file and is quite large (3.3 GB). I have no access to the actual database and I don't know how to handle this .sql file in Python. I am looking for specific steps to take so I can use this SQL file in Python and analyze the data.
The function `execute` works in Qiskit 0.* and it was removed in Qiskit 1.*. See the migration guide [here][1]. [1]: https://docs.quantum.ibm.com/api/migration-guides/qiskit-1.0-features#execute
The plan is to create a new product Im a full stack developer The business idea is ready in mind I created a google drive and Github repos Multiple juniors might work on the project I still don't know and failed to find the next steps What is the recommended way to continue...Do I start by creating UML diagrams...
steps to create a web app with backend and database and web
|database-design|uml|documentation|react-fullstack|planning|
null
i cloned yolo5 and - setted up an virtenv - pip install -r requirements.txt - `python export.py --weights yolov5s-seg.pt --include torchscript --img 640 --device cpu` all went fine: `TorchScript: export success ✅ 1.6s, saved as yolov5s-seg.torchscript` But if i use this Model, i get `panic: libtorch API...
yolo v5 export to torchscript: how to generate constants.pkl
|pytorch|yolov5|
I'm slowly learning .NET Core 8, and I'm using Identity with individual user accounts. I've recently learned how to add custom properties to the user account such as `FirstName` and `LastName`. I would like to add a property called departments, however, each user may belong to several departments and so the `AspNetU...
I basically have to create a method that takes in a string array and a 2D array consisting of three double arrays and puts the first string with the first array, second string with the second array, etc. public static void printData(String[] c, double[][] d) { String cname = ""; for(int i =...
How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
|java|multidimensional-array|
null
You can store the value of mbserial number in cell c4 in sheet1 and then run workbook_open
It is indeed correct to type the property decorated with `ElementRef`, but it is just not enough: just add the generic type to `ElementRef`. ```typescript @ViewChild("userSelector") userSelector: ElementRef<HTMLInputElement>; ... onClickUser(user: User) { this.userSelector.nativeElement.value = user.name; ....
There is nothing you are missing. The assert can fail. In particular, the compiler or CPU are permitted to do the store to `y` before the one to `x` in `write_x_then_y`, because the order of the two statements doesn't imply any additional happens-before constraint. Then the other thread may do both loads in-betwe...
I had the same error when trying to run the application. **------ start of error snippet -----------** warning: default scripting plugin is disabled: The provided plugin org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar is not compatible with this version of compiler...
In the C++ standard, `max_size()` is defined as > *Returns*: `distance(begin(), end())` for the largest possible container. \- [[container.reqmts] `max_size`](https://eel.is/c++draft/container.reqmts#lib:max_size,containers) Initially, this looks good, and there is no *Preconditions* paragraph. However, `std::...
{"OriginalQuestionIds":[50499],"Voters":[{"Id":523612,"DisplayName":"Karl Knechtel","BindingReason":{"GoldTagBadge":"python"}}]}
I read a little bit everywhere that the in operator have a time complexity of O(n), yet I used it in a code and idk why but it's acting as if it have the time complexity O(1) So I was solving a problem on leetcode and ended up having this algorithm ``` class Solution(object): def twoSum(self, nums, target):...
Time Complexity of "in" keyword in python when using a list? Leetcode
|python|time-complexity|space-complexity|code-complexity|
null
.NET Core 8, how can I add properties to user account that contains multiple values?
struct MyStruct { var a = 0 func foo() { print("Ok") } mutating func increase() { a += 1 } } func runner(_ function: () -> Void) { function() } var myStruct = MyStruct() runner(my...
"Escaping autoclosure captures 'inout' parameter 'self'" Swift compilation error
|swift|escaping|inout|auto-close|mutating-function|
|c#|entity-framework-core|asp.net-core-mvc|asp.net-core-identity|
I have a frame layout that wants to fill 50% of the screen reso, then a tablayout below and a viewpager with 3 different fragment layouts based on the tabs. The tabs/viewpager works and shows the layouts when i remove scrollview, otherwise using this code it just show a blank viewpager. Can someone help me to enable a ...
What is the advantages of Leacky ReLU over ReLU? I have read some research paper but found nothing or more precious answer. Sometimes found that ReLU and Pre-ReLU helps more model optimization as compared to Leacky ReLU. Why?
ReLu, PreReLu, Leacky ReLU
|machine-learning|
null
Unfortunately, Flutter doesn't have `controller.jumpToIndex(index);` you can achieve this by adding a third-party library which is called [**scrollable_positioned_list**][1]. It is exactly like ListView but you can use `controller.jumpToIndex(index);` For Example: Init controller: final ItemScrollC...
Change this line: ``` output = p4.run("print", "-o", temp_file, f"{file_path}@{changelist_number}") ``` to: ``` output = p4.run("print", "-o", temp_file, f"{file_path}@={changelist_number}") ``` and make sure that your trigger is running as `change-content` rather than `change-submit`. The important ...
### Strategy for Answering Exactly what the `conda init` command does and its consequences are shell-specific. Instead of trying to cover all cases, let's walk through a case, noting along the way that one can replicate this analysis by substituting their shell of interest. --- # Case Study: `conda init zsh` ...
I see two possible options here. First is "more formally correct", but way too permissive, approach relying on `partial` hint: ```python from __future__ import annotations from functools import partial from typing import Callable, TypeVar, ParamSpec, Any, Optional, Protocol, overload, Concatenate R = TypeVar...
I am learning Spark, so as a task we had to create a wheel locally and later install it in Databricks (I am using Azure Databricks), and test it by running it from a Databrick Notebook. This program involves reading a CSV file (timezones.csv) included inside the wheel file. The file *is* inside the wheel (I checked it)...
so I have a problem where I can't make new table through MySQL Workbench, the name field is just not showing to me nor "Apply" button which should be in the bottom. Does anyone know how to fix this? [Screenshot from MYSQL Workbench](https://i.stack.imgur.com/Wxz6c.png) I don't know what should I do right now ...
MySQL Workbench [BUG]
|mysql|mysql-workbench|
null
Is there any way to tell Notepad please do this... FROM THIS 15.63387,46.42795,1,130,1,210,Sele pri Polskavi TO THIS 15.63387,46.42795,1,130,1,210 I would like to remove everything after the last , So that in the end it looks like 15.63387,46.42795,1,130,1,210 Thing is when I try it using Notepad++ wi...