instruction
stringlengths
0
30k
|c++|lambda|c++17|constexpr|stdtuple|
This is my userscript to change the color of visited links. It is assumed to be able to work with any website. ``` // ==UserScript== // @name Change the color of visited links // @description - // @match *://*/* // ==/UserScript== function style(css) { let head, style; head = document.getE...
I am working on a project using Node.js v21.7.1, from a MariaDB database I query first name and surname then pass these back to the client. In my SQL I use: ``` CONCAT(`t2`.`vcSurName`, ',', `t2`.`vcFirstName`) AS vcName ``` My client receives this and adds it to a 'SELECT' HTML tag, I can see the name is displa...
Why is ', ' translated to '%2C+'?
|string|decode|encode|javascrip|
From what I have read a NULL pointer points to the memory location "0" and an unitialized pointer points to a random location? Could it be that this random location sometimes is the "0" so that it is a NULL pointer as well? I realize that this will not happen all the time, but could it happen? Or has C some mechanism t...
Could an unitialized pointer be a NULL pointer?
|c|pointers|null|initialization|
When I run my spring-app in IntelliJ I get the normal output in the run-tool-window. The very first greyich line contains the complete command run to start the app. It is clickable so that the full thing should be expanded and displayed inline. But unfortunately my IntelliJ is somehow configured to open the thing in No...
|android|firebase|google-cloud-firestore|
null
null
# Short Version Now we are interested in controlling the expected outcome of `fetch_html()`, that means we have to control the input of the function. This function uses `urllib.request.urlopen()` to get a response from the http server of the domain `example.com`. That url is actually the input of the function. To ...
I have most recent **Android Studio Hedgehog | 2023.1.1 Patch 2** for this date. Created empty activity project. Tried both kotlin dsl and groovy dsl. Then can build it with build studio's command. But can't run any gradlew task. Only `./gradlew --version` works and prints following: > -----------------------------...
Error: EPERM: operation not permitted, unlink 'C:\Users\Bright-Ewuru\Desktop\full stack real estate\server\node_modules\.prisma\client\query_engine-windows.dll.node'. This the error i get when running npx prisma generate with working with react, mongodb and express I was expecting no error after i rung npx prism...
I am having issue in prima, whenever i run prisma generate i alway get an error
|database|mongodb|backend|node-modules|prisma|
null
|r|machine-learning|neural-network|mlr3|nnet|
I have created following middleware for API endpoint ``` apiVersion: traefik.containo.us/v1alpha1 kind: Middleware metadata: name: cors-api namespace: api-staging spec: headers: accessControlAllowMethods: - "GET" - "OPTIONS" - "PUT" - "POST" - "DELETE" acces...
Pine Script: Loop Through Input Price levels & set Alerts for Each Price
|loops|pine-script|alert|price|
null
The Compose documentation e.g. [here][1] mentions, that `Modifier.drawBehind` only affects the drawing phase, other phases are not re-executed when this modifier changes. But how does Jetpack Compose know that e.g. `Modifier.drawBedind` only affects the drawing phase? [1]: https://developer.android.com/develop/...
How does Jetpack Compose know that a modifier affects only e.g. the drawing phase?
I'm trying to fetch apis and combine the json objects into a single variable array that I can loop through. using .push my variable array ends up as.. ``` [ [ {"a","1"} ], [ {"b","2"} ] ] ``` when i want this.. ``` [ {"a","1"} {"b","2"} ] ``` Here's my trimm...
How to combine JSON objects and unnest array of arrays
|javascript|arrays|json|fetch|push|
null
I am scraping messages about power plant unavailability and converting them into timeseries and storing them in a sql server database. My current structure is the following. * `Messages`: publicationDate datetime, messageSeriesID nvarchar, version int, messageId identity The primary key is on `(messageSeries...
Modifying BadRequest Error Message in ASP.NET Core Microservice Application
|c#|asp.net-core|microservices|middleware|
**You can achieve this with a simple for loop. The idea is to iterate over the array forward base on the boolean flag. If it is forward iterating array with** `for (int i = 0; i < arr.length; i++)` **else if it is backward** `for (int i = arr.length - 1; i >= 0; i--)`. Refer the code below: public class Mai...
if(tid\<n) { gain = in_degree[neigh]*out_degree[tid] + out_degree[neighbour]*in_degree[tid]/total_weight //here let say node 0 moves to 2 atomicExch(&node_community[0, node_community[2] // because node 0 is in node 2 now atomic...
- Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> - Search *[settings.json][1]* - Open the **User Settings(Json)** [![Enter image description here][2]][2] - Add the following code ``` "editor.codeActionsOnSave": { "source.fixAll": true } Note: It is a sim...
Typescript generic type with reference to one of it's properties with different type
|typescript|
I think scss syntax allows you to put the ```::before``` pseudo element inside ```mat-expansion-panel-header``` ```scss mat-expansion-panel-header { position: relative; ::before { content: ''; position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; z-index: 1000; ...
When using the hugging face "phi2" model with the sample code i received the same error and using "mps" instead of "cuda" worked. `torch.set_default_device("mps")`
I wrote a simple code to test how many files may be open in python script: for i in xrange(2000): fp = open('files/file_%d' % i, 'w') fp.write(str(i)) fp.close() fps = [] for x in xrange(2000): h = open('files/file_%d' % x, 'r') print h.read() ...
I had a similar issue and was not able to find an already existing solution so I made this Python package. https://github.com/emileindik/slosh ```bash $ pip install slosh $ slosh ubuntu@1.1.1.1 --save-as myserver ``` This will create an entry in your SSH config file that looks like ``` Host=myserver Hos...
So in newer version first thing u have to do is npm i @electron/remote and add this code in the main js file you should add 1. require('@electron/remote/main').initialize(); Then you add this after app.on('ready', createWindow); 2. app.on('browser-window-created', (_, window) => { require("@electron/rem...
Generic type with reference to one of its properties with different type
Try this code. This will move the Excel file to the Right Monitor. I have tried it and it works. I have commented the code so you should not have a problem understanding it. **Important Note**: Since we are using VBA code, your files need to be saved as `.xlsm` and not `.xlsx` **In the ThisWorkbook Code module.**...
Is it possible to do some recursion(?) in typescript to call same Columns type but with different generic type N instead of T? Please consider example below. ``` type Column<T> = { render: (item: T, rowIndex: number) => React.ReactNode; }; ``` **Generic Type N here is only for example purposes.** I want to t...
Why is Notpad++ opened from IntelliJ
|intellij-idea|
I have an SQL query exactly as described in [this post][1]. To sum it up, it will read all Carboards specified with an offset. This query is executed on a MariaDB database.<br> Now, I have my Cardboards (ID, Cardboard_number, DateTime, Production_LineNumber) in my C# ASP.NET program. I have to read all production proc...
This can also mean the underlying storage driver does not exist, for example, EBS driver is not ready.
I have some python code: ``` class Meta(type): def __new__(cls, name, base, attrs): attrs.update({'name': '', 'email': ''}) return super().__new__(cls, name, base, attrs) def __init__(cls, name, base, attrs): super().__init__(name, base, attrs) cls.__init__ = Meta.fun...
The latest torch I found that works is torch==1.13.1+rocm5.2.0 With the HSA override of course.
You don't call [AbortTransaction][1]. However, mongo provides convenient `withTransaction` API that will simplify this work for you. See [here][2]. See also mongoose related [doc][3]. [1]: https://www.mongodb.com/docs/manual/reference/method/Session.abortTransaction/ [2]: https://mongodb.github.io/node-mongod...
I am trying to get the instances information with Google Cloud API in Java. When I send the list request I get an exception. Can you tell me why I getting this exception? I do not know about the protocol buffers and the error message does not give much clue. Best regards, The code: ``` InputStream strea...
"No map fields found in com.google.cloud.compute.v1.Instance" error when getting instances in Google Cloud API Java
|java|google-cloud-platform|protocol-buffers|
null
null
you can change max-height unit from px to vh it will work for you <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> .parent { margin: 5px; max-height: 100vh; max-width: 400px; background: pink; } .details { ...
I think there might be the alignment issue. Make sure the pubspec.yaml look like this: dependencies: flutter: sdk: flutter carousel_slider: ^4.2.1
You can use Docker [Volumes](https://docs.docker.com/storage/volumes/) > Volumes can be more safely shared among multiple containers. You can define Volumes on `dockerfile`, `docker-compose` file or on `cli` dockerfile: ```dockerfile FROM python VOLUME /home/python/lib ``` docker-compose file ```dock...
please help Bad PCD format error I would like to know whats wrong with PCD file. I have given the header to the PCD file header = "# .PCD v.7 - Point Cloud Data file format VERSION .7 FIELDS x y z data SIZE 4 4 4 TYPE F F F COUNT 1 1 1 WIDTH 0 HEIGHT 1 VIEWPOI...
> And since array name a is originally &a[0], it will be a int** type > variable. You are wrong. Arrays used in expressions with rare exceptions are indeed converted to pointers to their first elements. But in this case the type of elements of the array is `int[3]`. So the array `a` used in expressions is converted...
I have an application using the classic [clean architecture](https://jasontaylor.dev/clean-architecture-getting-started/) with all the dependencies set up as described (i.e. flowing inward). I have an external service I wish to use in my project, so defined the functionality (objects that interact with the service, som...
In clean architecture, is the presentation layer allowed to communicate directly with the infrastructure layer?
I am trying to create a multifilter from enum data type column using the Item Template. But Item Template JavaScript function is not being called and data is not being shown in combo box for some reason. I am looking for a help from expertise to solve. **Enum Records** public enum EmpTypes { [Di...
i am trying to get application context for showToast but not able to get it here is my code, kindly help ``` package com.coding.APPNAVIGATION.MenuAndNavigationDrawer import android.app.Application import android.content.Context open class MainApplication : Application() { override fun onCreate...
|asp.net-mvc|razor|kendo-grid|
I installed DNSfilter on the family tablet to prevent my children from accessing YouTube. As it happens, I need YouTube for professional purposes (following tutorials in particular) and so as not to continually activate/deactivate the VPN I thought of Samsung's Modes & Routines which, along with Routines +, allows when...
Automating connnection/deconnection of DNS filter's VPN when a specific fingerprint is recognised
|asp.net-core|asp.net-core-webapi|clean-architecture|
I have been trying all day to write a simple bit of code that makes a Discord Bot join a channel and then play a sound. But for some reason I can't seem to get it to work. I have tried many different things but it just doens't play the sound. I also get no error or anything. Could somebody explain to me what I am doing...
|java|spring-boot|testing|mockito|webclient|
> I don't understand the `temp` part. How the indexes are adding to `temp`? example `arr = 1,2,3,4,3`: it should return `4,2` but it returns `2,4`. `temp` captures the array list that the recursive call returns: it contains the matching indices, but only from the given index (`index+1`) onward. With `addAll` all the...
Generic type with reference to one of its properties with different type
I have written an Apache Beam function in Go which queries a database, creating a PCollection and then writes that PCollection to BigQuery. I would like to add a column to the PCollection before writing it to BigQuery. Part of the complication here definitely comes from the fact that I am trying to allow this functi...
Add a column to an Apache Beam Pcollection in Go
|go|google-cloud-platform|google-bigquery|google-cloud-dataflow|apache-beam|
null
For anyone else facing the same error with grant_type as password, you have to call Passport::enablePasswordGrant() inside the boot method of the AuthServiceProvider. The Laravel docs for Passport missed mentioning this part.
@John Gordon's answer is great, I just wanted to add something. Often `keyboard.read_key()` is not used, since it can be hard to clear keyboard input after pressing a key, and there is usually a more efficient way to do it with the `keyboard` library. We can use `keyboard.add_hotkey()` to allow our program to call a...
I am trying to write a Junit test but receiving java.util.NoSuchElementException. With limited knowledge on mockito and junit i understand DriverManager.getConnection needs to be mocked/stubbed. How can i do that. Any help is highly appreciated. The aim is to run the junit test without access to actual db source. ...
As user @SandeepM says, very likely the reason is because your ipad is using a dark theme. A simple way to fix that would be to set colors explicitly in your code. For example: i.fa-light, i.fa-light:before, i.fa-light:after{ color:black; } should change them to `black`.
I wanted to specify the layout of the facets when making a plot with face_wrap in ggplot, so I used the following code: ``` df$layout_order <- factor(rep(1:ceiling(nrow(df)/4), each = 4), levels = unique(rep(1:ceiling(nrow(df)/4), each = 4))[1:nrow(df)]) ggplot(df, aes(x = Time, y = nPVI, group = Time, fill = Gr...
class app : Application(), androidx.work.Configuration.Provider { override val workManagerConfiguration: androidx.work.Configuration get() = androidx.work.Configuration.Builder().setJobSchedulerJobIdRange(....).build() android { lintOptions { disable 'SpecifyJobSchedulerI...
I'm trying to clean and organize a data set that has user IDs, date and time to the second, and heartrate. What I'm trying to do is change this data set from measuring heartrate by second, to heartrate by minute by removing duplicate values before the first unique value. However, columns A (user IDs) and B (time) are b...
Removing duplicate data conditionally in Excel
|excel|duplicates|data-analysis|data-cleaning|
null
1. Sure you did not update accidentaly to 4.27.**3** or later? I got exactly your problem, after I installed the 4.28.0 Version - see below... 2. You need Hyper-V enabled for this: is it working correctly on your machine? If you are using Windows Home Edition there is no chance: upgrade your Windows to Professional ...
Well, the simple answer is that the language definition simply doesn't allow it - it's a design choice. [Chapter and verse][1]: <blockquote> <b>6.5.16 Assignment operators</b><br> ...<br> <b>Constraints</b><br><br> 2 An assignment operator shall have a modifiable lvalue as its left operand. </blockquote> ...
null
Well, the simple answer is that the language definition simply doesn't allow it — it's a design choice. [Chapter and verse][1]: <blockquote> <b>6.5.16 Assignment operators</b><br> ...<br> <b>Constraints</b><br><br> 2 An assignment operator shall have a modifiable lvalue as its left operand. </blockquote> ...
I was facing the same error on Laravel 10 with grant_type as password. The solution for me was to call Passport::enablePasswordGrant() inside the boot method of the AuthServiceProvider. The Laravel docs for Passport missed mentioning this part.
I fixed it guys. I was using restricted test key and each key (product and restricted and any) has different api keys settings for different actions, the error message will tell you which api key action you must change from none to write. Where it says reveal your key U have three dots on the right and there U can edit...
I have rewritten your `is_prime` and `largest_prime_under` functions. #!/bin/bash is_prime() { local n="$1" if (( n==2 )) || (( n==3 )); then return 0 fi if (( n<1 )) || (( n % 2==0 )) || (( n % 3==0 )); then return 1 ...
just replace this import { getMessaging} from 'firebase/messaging'; with this import { getMessaging} from 'firebase/messaging/sw';
I would use a [D3](https://d3js.org/) scale for that: ``` scale = d3.scaleLinear([1, 10], [100, 200]) // ^^^^^^^ ^^^^^^^^^^ // A B ``` `scale` is a function that maps a value in a domain **(A)** (the set of possible input) to another value in a range **(B)** (e....
|android|automation|dns|samsung|
null
So I'm trying to run a CMD check for a package I want to upload to CRAN but when running it on my Windows 11 cmd I get the following error: ``` checking whether package 'YEAB' can be installed ... ERROR Installation failed. ``` And when I open the "00install.out" file I get this error: ``` installing *sour...