instruction
stringlengths
0
30k
Hey guys so in class we went over this bit of Java and we were told to find the runtime. ``` for(int i=0; i<N; i=i+2){ for(int j=N; j<N j++){ for(int k=0; k<N k++){ System.out.println(i*j); System.out.println(i); } } } for(int k=0; k<100; k++){ System.out.println(...
Why is the runtime for this o(n)?
|data-structures|big-o|
null
There are several problems: - the data in the question is an image so no one can reproduce it without tediously retyping it. Even then this does not guarantee that one would have exactly what you have. In the future please provide a minimal reproducible example in text form using `dput`. See the information at t...
How to add new custom page in Timber Wordpress
|wordpress|timber|custom-pages|
null
``` $("#examplee").DataTable({ "data" : data, "columns":[ {"data" : 'numeroDossier'}, {"data" : 'nomOuRs'}, {"data" : 'tel'}, {"data" : 'pro...
How do I get my data.id of each row with using return in jquery please?
|html|jquery|api|
null
which backend parameter to add Internal Server Error: /accounts/google/login/callback/ Traceback (most recent call last): File "/home/zaibe/Desktop/project2/env/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/home/zaibe/Desktop/p...
Django project with a RESTful API for user registration and login using Google or Apple OAuth
|django|django-rest-framework|django-views|google-oauth|social-auth-app-django|
null
|ruby-on-rails|ruby|testing|ruby-riot|
I have create a microService for shearing Proto files (server). and i have module and service for calling this. now in my (client), i want to call that microservice as soon as my application started. I already use onApplicationBootstrap() in my app.module file. but thats not work, because I use onModule init for my ...
running a service file befor bootstrap function in nestjs
|javascript|node.js|nestjs|
null
Riot is a fast, expressive, and contextual unit testing framework for [tag:Ruby]. For more information, see the [GitHub page][1]. [1]: https://github.com/thumblemonks/riot
null
Riot is a fast, expressive, and contextual unit testing framework for Ruby.
null
When i click on the data in map then it's automatically draw a line vertically and horizontally. I have tried everything with all properties but still not able to remove that. How can i remove that line?? **please find the attached screenshot** [![I want to remove those linke where we have label of 42 there we ha...
I make a program, two clients connect to a server, and one of the clients send msg to server, then the server resend this msg to another client.I use base_rdset as listen set, and rdset as ready set, clients' socket identifier storge in a array. When I start the server, sometimes it runs well, but sometimes it posts ...
null
I make a program, two clients connect to a server, and one of the clients send msg to server, then the server resend this msg to another client.I use base_rdset as listen set, and rdset as ready set, clients' socket identifier storge in a array. When I start the server, sometimes it runs well, but sometimes it posts ...
Assuming the data has been stored in table named Numbers ``` SQL WITH NUM AS ( SELECT A.*, ROW_NUMBER() OVER(PARTITION BY ID1, ID2 ORDER BY VALUE) AS RN FROM NUMBERS A ) SELECT A.ID1, A.ID2, A.LOWER, A.VALUE,A.UPPER, A.MEASUREMENT, SUM(COALESCE(B.MEASUREMENT, 0))...
You could try: lapply( my_list, \(x) if ('col3' %in% names(x)) transform(x, col3 = replace(col3, is.na(col3) & col1 %in% c('v2', 'v3'), 'VAL')) else x ) Output: [[1]] col1 col2 col3 col4 1 v1 wood cup <NA> 2 v2 <NA> VAL pear 3 v3 water fork ba...
I have a Avalonia project in C# that was just setup. Currently I am testing if Avalonia fits my requirements. Currently I struggle at a simple point. I want to create a custom user control of type `UserControl` and provide a property in that control, that should be set by a binding from the view that is using the cont...
I'm trying to create a code for **perfectly optimal chess endgame**. By that I mean that the loosing player tries to delay the checkmate as long as possible while the winning tries to checkmate the opponent as soon as possible. This code for chess endgame is my currently best [one](https://pastebin.com/zkcbgANy) ...
Use case: I want to have a REST API that will fire an event in the system using RabbitMQ/AMQP, and I want to have the SecurityContext of the currently logged in user propagated to that event, in order to use the audit annotations in my JPA Repository (lastModifiedBy) and annotations for checking roles for users in serv...
How do I propagate the current SecurityContext to my @RabbitListener in Spring Boot?
|spring|spring-security|spring-amqp|
I am using AppsScript to send emails by prompts on GoogleSheets. When I test the AppScript, the email appears in my Sent box; however, it does not appear in the recipients inbox. I have tried manually sending the same email; it appears in my Sent box and does appear in the recipient's inbox. I do not understand ...
Email Sent Using AppScript Appears in Sent Box, but does not appear in Recipient's Inbox
|google-apps-script|
Although I am still unsure, as to what the actual is may be, I have managed to find a fix. Instead of relying on the `JwtService` to provide the verifier instance, I went with the approach of defining it within the module, as seen [in the ktor docs][1]. Now, my `configureSecurity()` looks like this: fun Appli...
You need to convert to a continuous scale to use minor ticks, since there are no minor breaks on a discrete axis: ``` r dt %>% ggplot(aes(var1, as.numeric(factor(ca)), fill = var2)) + geom_col(width = 0.8, orientation = 'y') + stat_summary(orientation = 'y', fun = sum, geom = "point", colour = "grey40", ...
null
Assume I have the following bar chart made with `library(plotly)` (the space on the right side is intentional): ```r library(dplyr) library(plotly) library(tidyr) d <- tibble(cat = LETTERS[1:3], val = c(25, 10, 30), total = 40) (bars <- d %>% mutate(remaining = total - val) %>% ...
null
when I launch chrome to debug an angular 17+ app, the debugger does not work. If I refresh then it stops at main.js, if I move forward from there it debugs from there. here is my launch configuration. ``` "configurations": [ { "name": "Launch Chrome", "request": "launch", "type": "c...
Warning was fixed with update to: env: Python 3.9 conda pygraphviz 1.11 conda graphviz 8.1.0
{"Voters":[{"Id":10141885,"DisplayName":"halt9k"}]}
**To configure Microsoft Account as the IDP,** you need to register the application in **Microsoft Entra ID tenant (Azure AD tenant)**: Add redirect URL as **`https://your-tenant-name.b2clogin.com/your-tenant-name.onmicrosoft.com/oauth2/authresp`** ![enter image description here](https://i.imgur.com/rkT1emc.png) ...
null
There is a custom loader that can be configured in Tag Manager that will allow you to set your own path. This custom loader allow you to create any path you like, such as: t.example.com/my_special_tracker.js The full step by step instructions are here (not my website): https://www.simoahava.com/analytics/custo...
I have to encrypt some data in my project. For this I'm using ECDH and AES-128-CBC. The problem is: I got the key from the other side. I have to create a public key from the mentioned key: public PublicKey createPublicKey(byte[] key) { X509EncodedKeySpec x509key = new X509EncodedKeySpec(key); ...
vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
|angular|typescript|visual-studio-code|
Since I updated 2FA in order to put trusted device, I have this error after the login and security code entered: >Key provided is shorter than 256 bits, only 64 bits provided I updated my User.php to add : /** * @ORM\Column(type="integer") */ private int $trustedVersion; ... ...
I found a solution. It is probably a dirty solution, but it works. The problem was to terminate my Activity just after the user manually grant the right MANAGE_EXTERNAL_STORAGE, knowing that : - even after the user grant the permission, my Activity did not have the right (1) - more over, if I end my Activity by fini...
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...
Inset pie chart into bar chart
|r|plotly|
My app has min sdk version 19 and apk has the following structure [![enter image description here][1]][1] And after I had switched to min sdk version 21, it changed the structure. [![enter image description here][2]][2] And SOTI can read it now. It sounds to me like SOTI has a bug on how to read this configura...
The 400 bad request error as we know it mostly has to do with the syntax, which means that the request might be malformed. The reason why I was getting the 400 bad request error was that I was trying to migrate to the new FCM API V1 and the new FCM API accepts a slightly different json payload as opposed to what the le...
I have a problem when I try to use MouseLeftButtonUp event handler on Image it's not working exactly when parent(For example Grid) has his own MouseLeftButtonDown event handler. However when I remove MouseLeftButtonUp from parent(For example Grid) MouseLeftButtonUp event handler on Image is working. So what should I do...
Error "java.security.spec.InvalidKeySpecException: Error parsing public key" with Java
|java|android|aes|x509|
most simply implementation is int my_strncmp(const char *s1, const char *s2, size_t n) { if (n) { do { unsigned char a = *s1++, b = *s2++; if (int r = a - b) { return r; // 0 < r ? +1 : -1; // if normalize to {-1,0,+1} } ...
There are many services you can use to play around with WordPress. 1. InstaWP - they have a 3 sites limit at a time, you can spin up a site for 7 days. They offer an internal migration tool which can be used to migrate to any hosting service. 2. TasteWP - i think they have a 48 hours limit on temp sites. 3....
If you are using **personal** Microsoft accounts *(Outlook, Gmail)* to login, your `code` value will start with *M.C* which is default behavior. I registered one multi-tenant application and granted `API permissions` as below: ![enter image description here](https://i.imgur.com/h5L8n3n.png) In my case, I used ...
i have a service in spring boot and i want to get optional entity and to check if is not null to do something after. User repository class public interface UserRepository extends JpaRepository<UserEntity, Long> { Optional<UserEntity> findByLastName(String lastName); } Role repository clas...
Spring boot : how to get entity optional properly and check null
|java|spring|spring-boot|option-type|
<!-- 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...
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. [enter image description here][1] [enter image description here][2] In the form component, loginForm.tsx, in the form tag, I use the action property, and from there, I call the generic metho...
Maybe try to plot in this order: `condition -> genes -> category`: nodes <- unique(unlist(example.data)) links <- rbind( data.frame(source = match(example.data$conditions, nodes) - 1, target = match(example.data$genes, nodes) - 1, value = 1), data.fra...
null
I'm using a pretty complex custom handler in DRF. For example, for a given response, `response.data` could look like to: ```python {'global_error': None, 'non_field_errors': [], 'field_errors': {'important_field': [ErrorDetail(string='Ce champ est obligatoire.', code='required')]}} ``` However, when getting th...
In DRF, How to inject full `ErrorDetail` in the response, using a custom exception handler?
|python|django|django-rest-framework|
I am implementing an intersection observer to determine when certain div elements are coming into the viewport and once they are I am triggering a script which loads the google add into the already defined slot. Now the intersection observer currently works when the element comes into 1 pixel of the viewport however I ...
> mov al, A ; Load A into AL register > imul B > movsx bx, cc > imul bx > movsx bx, D > imul bx This code calculates `A * B * cc * D`, simply multiplying the 4 numbers. > but when I use `idiv` the code doesn't give any outputs. You can't just substitute that instruction: `imul` ou...
Before anything, you might see my language isn't really good in english, and I'm sorry about that. By clicking a button in WPF on .NET 8, I want to create a new instance of another window that I made to enter values and then use these values later. The problem here is that when I want to make an instance of that win...
Can't open new instance of another window in my app, in WPF .NET 8
|c#|wpf|xaml|.net-8.0|
I am using mathjax and Shiny to display equations. But the output text doesn't seem to me to be very high quality. How do I increase the dpi or the resolution of the output, which seems to be a dull or transparent black or isn't at it's full "brightness", if that makes sense? library(shiny) library(mathja...
How to increase quality of mathjax output in Shiny R
|r|text|shiny|mathjax|
I have been using a `~/.config` directory, as a git repo that was forked from https://github.com/benbrastmckie/.config to `https://github.com/<myusername>/.config` and git cloned. I want to keep its remote repo focused on my Neovim related configuration, so my other local files in `.config` are git-excluded for now. T...
IntersectionObserver rootMargin don't seem to work correctly
|javascript|observers|intersection-observer|
null
{"OriginalQuestionIds":[68158839],"Voters":[{"Id":12002570,"DisplayName":"user12002570","BindingReason":{"GoldTagBadge":"c++"}}]}
Do this $imageName = time().'.'.$image->extension(); $image->move(public_path('products'), $imageName); and while fetching <img src="{{ asset('products/'.$imageName) }}" alt="Uploaded Image">
If you want to delete subfolders under the root folder in an ADLS account, you can follow the procedure below: Upon the success of the copy activity, add a Get Metadata activity with the child items field using the Mainfolder dataset. It will display the list of subfolders as shown below: ![enter image descript...
null
It's kindof sortof the case in thios particular example, but you shouldn't care. Observe: ``` #include <iostream> int main(void) { { char test[3]; std::cout << "std::size(char[]): " << std::size(test) << '\n'; std::cout << "sizeof(char[]): " << sizeof(test) << '\n'; } ...
I have "src/bin" folder to store the code and "tests" folder to store my test scripts. I am using the below pytest command in my pipeline - pytest /builds/cdf/Platform/onprem-core-functions/test/ --cov=src --cov-report xml:coverage/cov.xml --cov-branch but it fails with the below error. CoverageWarning: No data...
When .NET (Core) was first released for Linux, it was not yet available in the official Ubuntu repo. So instead, many of us added the Microsoft APT repo in order to install it. Now, the packages are part of the Ubuntu repo, and they are conflicting with the Microsoft packages. This error is a result of mixed package...
Good evening, you can use a nested for loop for this. For example if you want to make grid for minesweeper you can do it like so: ``` from tkinter import Tk, Canvas root = Tk() screenWidth = 800 screenHeight = 1000 root.geometry("{}x{}".format(screenWidth, screenHeight)) size = 10 #This is size of 1 cell w = Canvas...
I have a ASP.NET Core 6.0 and Angular 13 & TypeScript 4.5 project. I use Swagger and NSwag for create TypeScript clients. My swagger.json like as below: { "openapi": "3.0.1", "info": { "title": "Reinsurance.Api", "version": "1.0" }, "paths": { "/api/v1...
Is there a way to create a column from a single string value that is inherently and by default already a string column and not an object column? I don't want to spend any time casting an object column back to a string column. ```python df = pd.DataFrame(dict(a=range(10))) df["new"] = "my string" df.info() ...
Setting up the version control of .dotfiles while the .config is connected to a forked repo
I'm doing the parallel version of Bellman-Ford algorithm in c++ using std::atomic This is my main function executed in multiple threads ``` void calculateDistances(size_t start, size_t end, const Graph& graph, std::vector<std::atomic<double>>& distances, bool& haveChange) { for (size_t source = start; source <...