instruction
stringlengths
0
30k
Managed to produce a simple example. Tried lots of Googling but none of the answers helped. simple test code: import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.s...
Connect ssh to cisco switch with ansible
|ssh|ansible|ssh-keys|cisco|cisco-ios|
null
If I use std::size and sizeof() for a char array , it gives the same value . So are those same for char array ? I think these 2 work differently for different types , but are they same for char ? So are those same for char array ? I think these 2 work differently for different types , but are they same for char ?
Is std::size and sizeof same for a char array?
|c++|arrays|char|
null
I am working on a project in the Node.js environment that via dbus-native interfaces with Connman. What I need to do is create some code that allows it to connect to a secure wifi network. I went to implement the Agent and the RequestInput function and from another file I go to call the Connect(), but once it is called...
i want to turn windows firewall on and off from java code so to do this need to execute cmd command with admin privilege to do this please any one help me i tried this but it is not running as admin public void execute_cmd2() { Process exec = Runtime.getRuntime().exec("cmd"); Outp...
I'm relatively new to writing unit tests. I ran into this scenario while writing unit test cases in .NET 8,for azure functions. Project 1 - ABC.Functions Project 2 - ABC.Functions.Test I have added a few nuget packages related to Azure functions in Project1. Should I be replicating these references in Project2 as ...
Should I add the nupkg dependencies of the Assembly of the SUT to the Test Project as well?
|unit-testing|testing|tdd|moq|microsoft-unit-testing|
null
You could use this regex: ```regex (?:(?<=^tags::)|\G(?<!^))(\s*\w+)(?= ) ``` This matches: - `(?:(?<=^tags::)|\G(?<!^))` : **either** - `(?<=^tags::)` : positive lookbehind for start-of-string followed by `tags::`; **or** - `\G(?<!^)` : end of the previous match (but not at the start of the string) - `(...
Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
|typescript|svelte|vercel|sveltekit|gun|
null
I'm developing an Android app with flutter and Dart, but everytime I try to run the app, or build It, It returns me the same erro: ```console e: /home/ju-bei/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.22/636bf8b320e7627482771bbac9ed7246773c02bd/kotlin-stdlib-1.8.22.jar!/META-INF/k...
The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
|android|flutter|dart|gradle|
null
The only thing what was wrong is a direcory: WRONG directory: https://oss.sonatype.org/content/repositories/snapshots/org/hibernate/orm/ CORRECT directory: https://oss.sonatype.org/content/repositories/snapshots ``` <repositories> <repository> <id>hibernate-snapshots</id> <name>Hibernate...
When I set `multiline` to `true`, on each new line, the content get pushed up, and there is a scroll that I can't disable. [![enter image description here][1]][1] In the attempt to fix it, I tried to set the height of the TextInput to the contentSize height that I get from `onContentSizeChange`, but there was a f...
I'm building a website using WordPress. I'm trying to set a video as the background, but there are some black areas. I can change the black areas by changing the color in the global settings, but I can't remove them. How can I remove these areas or add a video?" I'm not familiar with this topic. Could yo...
merge dataframe but do not sort by merge key
|python|pandas|
null
I'm experimenting with GLFW (compiling with **g++ -o nxtBluePixel nxtBluePixel.cpp -lglfw -lGLEW -lGL** ) to simply draw a blue box and move it up/down/left/right. I want to output a message "out of bounds" when the box touches the edges of the visible area, which should logically be -1 or 1 (in those so-called normali...
I have a problem with "drop_na" function. I wanted to clean the dataset and erase the "NA" values, but when I entered the code, all datas are disseapperad. I do not understand why it happens. not:Im beginner level. [You can see clearly what my codes are in this picture](https://i.stack.imgur.com/ORaUW.png) ...
TROUBLING with the "DROP_NA" Function
|r|rstudio|
null
i have being building a telegram bot with nodejs where people can send in a url of a tweet and if it contains a media of type video. it downloads it and sends it to the user. Thats the purpose, which i already completed. The problem i have is with setting a paywall on this bot account so that after 2 or 3 request, ...
I'm currently working on integrating Microsoft Graph APIs into my Java application to retrieve license details for users in my Microsoft 365 tenant. I referred to the official Microsoft documentation [here](https://learn.microsoft.com/en-us/graph/api/user-list-licensedetails?view=graph-rest-1.0&tabs=java) to understand...
I had similar problems with webpack 5 and http-proxy-middleware. It was due to webpack DevServer using the `/ws` path, but my proxy and socket server were also using `/ws`. Before: proxy and socket server using `/ws`. ```js const setupProxy = [ createProxyMiddleware('/api', options), createProxyMiddleware('/...
Cpp function overloading
|c++|function|overloading|
null
|youtube-api|
My app is to open one of the application with some parameters in windows. i was sucessfull by doing that in flask and provided .exe format and it works proper. now instead of giving .exe i want place the project in server and give the url. the problem here is if i execute the subprocess.popon it tries to execute in ...
On click of a button open an application in client side
|javascript|python|
|javascript|google-cloud-platform|
|sql|sql-server|t-sql|sql-server-2019|
|json|nested-json|
|swift|authentication|swiftui|
Need a batch script to rename folders that look like this \[MSXEP001\] Dom & Roland - Can't Punish Me EP \[2000\] to looking like MSXEP001-Dom\_&_Roland_-\_Can't_Punish_Me_EP-FLAC-2000. Need to remove the square brackets, add hypen between cat# and artis(s), add -FLAC- before the year and use underscore. Folders all...
Batch script to rename [MSXEP001] Dom & Roland - Can't Punish Me EP [2000] to MSXEP001-Dom_&_Roland_-_Can't_Punish_Me_EP-FLAC-2000
|batch-rename|
null
|javascript|html|graphql|
{"OriginalQuestionIds":[16602175],"Voters":[{"Id":817643,"DisplayName":"StoryTeller - Unslander Monica","BindingReason":{"GoldTagBadge":"c++"}}]}
Need a batch script to rename folders that look like this [MSXEP001] Dom & Roland - Can't Punish Me EP [2000] to looking like MSXEP001-Dom_&_Roland_-_Can't_Punish_Me_EP-FLAC-2000. Need to remove the square brackets, add hypen between cat# and artis(s), add -FLAC- before the year and use underscore. Folders all share...
How do I test the ohlc series, I cannot see any demo in lightningchart official site. I tried below code candle[id] = chart[id].addOHLCSeries().setMouseInteractions(false); Also previously when I checked ohlcseries of lighning chart ,, candle automatically converting to different candles when i zoom i...
Spring security causing 404 with message "No static resource login"
|spring-boot|spring-mvc|spring-security|
how to correctly get the value of an element by its index from TypedArray?
I do know that conditional operators have right associativity, but can't understand how the flow of `condition1` , `condition2` , `expression1` , `expression2` , `expression3` are all happening one after another. Or how the evaluation and flows are changing when we assume that associativity is left to right. (co...
Explanation of the associativity of nested conditional operators
|conditional-operator|operator-precedence|
null
I have a opencart 2.3 store and I have downloaded a extension that shows all products on one page, it creates a category called All and displays all products in that category. It's working all ok but I would like to have the product filter displayed in the left column so it's the same as the other categories. For...
|mysql|
Your algorithm essentially performs a breadth-first search, where you extend all partial matches you found in a previous iteration by one character and keep those that still match. So for a worst case scenario we would want to have as many partial matches as possible for as many iterations as possible. One such wors...
wordpress delete unwanted location
|wordpress|web|wordpress-theming|
null
I'm building a website using WordPress. I'm trying to set a video as the background, but there are some black areas. I can change the black areas by changing the color in the global settings, but I can't remove them. How can I remove these areas or add a video?" [enter image description here][1] I'm not f...
I have a use case: I have a static website without server side code and I want to send an email whenever someone submits a form on website. To send an email i am using flask rest api. I have deployed the api seperately and then i am calling the api from the website using javascript. Now I am wondering how can i pro...
Authenticate Flask rest API
|javascript|authentication|flask|token|
{"Voters":[{"Id":4621513,"DisplayName":"mkrieger1"},{"Id":243925,"DisplayName":"Tony"},{"Id":3700524,"DisplayName":"Mohsen_Fatemi"}]}
|c#|arrays|.net|object-pooling|
I am creating a radar chart via echarts4r package in a shiny app. On small screens, the labels of the radar chart cut off. How do I make sure that the labels are completely visible on any screen? I understand that any solution for this would mean that the radar chart size decreases to accommodate the labels. ### Examp...
I am trying to use a drop down menu from a navbar. I copied the exact code snippets provided at getbootstrap dot com, and bingo, not working. Why? Are the links to import libraries for popper in the right places? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <met...
Bootstrap v5.3 navbar drop-downs not working. Why?
|bootstrap-5|
I'm going through [this](https://www.youtube.com/watch?v=O42LUmJZPx0) tutorial of how to use arrow instead of regular dplyr. Second and subsequent times I run queries on this dataset it's very fast, but the first one is incredibly slow (times below). ### Minimal Reproducible Example Here's an MRE of what I'm doin...
Aliases don't take effect when I use Vim to execute external commands, for example: :! ll I want it to support aliases like normal shells do.
Alias does not take effect when I use Vim to execute external commands
One counter example to your solution is: ``` [8, 7, 5, 4, 4, 1] ``` Adding as you have done would give the subsets: ``` [8, 4, 4], [7, 5, 1]: difference of sums = 3 ``` while the optimal solution is: ``` [8, 5, 4], [7, 4, 1]: difference of sums = 1 ``` Thus, to solve this problem, you need to brute forc...
I am struggling with gtsummary. Essentially I am trying to make a table with 2 different variables, one is organism one is resistance markers. Currently both of these variables are character variables. When I made them factor variables it made the table even worse. I am only trying to include certain organisms whi...
Why don't you just use await? try{ let a = await callbackA(); let b = await callbackB(a); let c = await callbackC(b); } catch(err){}
I have a maria-db database docker-compose.yml: ``` version: '3.8' services: mariadb: image: mariadb:latest container_name: mariadb restart: always environment: MYSQL_ROOT_PASSWORD: admin MYSQL_DATABASE: "wordpress3,wordpress4" MYSQL_USER: mohsin MYSQL_PASSWORD: ...
```c# [QueryProperty("Filename", "Filename_")] public partial class EditViewModel : ObservableObject { [ObservableProperty] string filename; partial void OnFilenameChanged(string value) { ReadFile(); } } ``` I think that it is the right way to solve this. there is no ...
null
Try forcing admin access for selected command: Function Check-RunAsAdministrator() { #Get current user context $CurrentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) #Check user is running the script is member of Admin...
$this->eventDispatcher->dispatch(new OrderSentEvent($order, $context), 'name.goes.here'); …did the trick. No event subscriber could be found, because if you don't provide one, the full class name will be used. The Flow Builder apparently uses the custom one.
I want to do marquee animation in Tailwind and next.js and some of it I have done. The only issue I am having is that it is not showing one after the other with the first. The second time it will show after some time. **I want it to be like this:** [![Want it like this](https://i.stack.imgur.com/5AKUJ.png)](https:/...
null
What if I disable "high performance order storage" in WooCommerce with 500+ daily orders and 5k+ daily traffic? What will be the side effects on the website? There are some Plugins I am using and it's showing error that these plugins are not supporting HPOS and making issues in the website like rejecting orders and ...
What if I disable "high performance order storage" in WooCommerce?
|wordpress|woocommerce|orders|woocommerce-theming|
{"OriginalQuestionIds":[164194],"Voters":[{"Id":584518,"DisplayName":"Lundin","BindingReason":{"GoldTagBadge":"c"}}]}
I'm trying to set specific column totals in DataFrame dff to certain predetermined values. Currently, I have a DataFrame dff constructed by performing various operations on multiple DataFrames (df, df2, df3, and df1) using multiplication and addition. After calculating the sum of rows and columns, I want to ensure that...
To get some code executed just once in this function, you need to tag the order like: ```php add_action( 'woocommerce_order_status_changed', 'bacs_payment_complete', 10, 4 ); function bacs_payment_complete( $order_id, $old_status, $new_status, $order ) { // 1. For Bank wire and cheque payments if ( $order-...
To remove product SKU from email notifications, simply use the following: ```php add_filter( 'woocommerce_email_order_items_args', 'customize_email_order_items_args', 20 ); function customize_email_order_items_args( $items_args ) { $items_args['show_sku'] = false; return $items_args; } ``` Code goes i...
So when checking for duplicates in an array (that's what I think the algorithm is for; correct me if I'm wrong), you want to check each element against each other element once. Let's have a 2D array of all possible pairs of elements you can check. For an array with 4 elements, the 2D array would look like this: `...
The simplest solution to find total RAM in a device is to use `NSProcessInfo`: **Objective C:** [NSProcessInfo processInfo].physicalMemory **Swift 3**: NSProcessInfo.processInfo().physicalMemory **Swift 5**: ProcessInfo.processInfo.physicalMemory Note: `physicalMemory` gives us the in...