instruction
stringlengths
0
30k
The snippet below shows a struct (`ckmsgq`) with a function pointer as a member (`func`). Then there is a function (`create_ckmsgq`) that is assigning a value to the function pointer. However the function isn't using the usual syntax for a function pointer parameter. It's just accepting what looks like a normal poin...
You can use the `classes` prop and add a class to the component and then use that class to style the component with `css`. ``` <FileUploader classes="custom-fileUploader" multiple={true} handleChange={handleChange} name="file" types={fileTypes} /> ``` Now just give `.custom-fileUpl...
I have a simple Django API served with gunicorn on a Kubernetes cluster. And after long time of running the pod seems to CPU throttle. So I tried to investigate, I used Lucost to swarm my API of requests to see how it handles a unsual amount of requests. Here is a recap of normal activity of the API: - 60 req...
I have a dataset which shows the religious adherence of Party A and Party B in X country, in addition to the percentage of religious adherents in each country. df <- data.frame( PartyA = c("Christian","Muslim","Muslim","Jewish","Sikh"), PartyB = c("Jewish","Muslim","Christian","Muslim","Buddhist"),...
How to summarize values depending on category of other variable in R?
|r|database|dataframe|
Recently we released the first release candidate of a [high-performance JSON masker library in Java with no runtime dependencies](https://github.com/Breus/JSON-masker) which you might want to use to do this. It works on any JSON value type, has an extensive and configurable API, and adds minimal computation overhea...
With python I had to do this to set the right billing ID when building a GCP client (service account and service api in different projects): client = translate.TranslationServiceClient( credentials=google.auth.default(quota_project_id=project_id)[0], ) What is the equivalent of `google.auth.def...
Filebeat CPU throttle in kubernetes with django logging
|django|kubernetes|python-logging|
To achieve something like this, you will want to conditionally skip your tests. This will need added to your test block (test.describe) if you want entire blocks to be skipped, or to each test individually if you want each one to be skipped independently. This is all from a quick mock up so tailor to your needs! ...
This is a weired Layout issue I recently occured. I have tried many different ways to construct all fails. Here is what I want: - In a row; - the text should expand to the row; - the text has a Container as background, I want the container always fits the text; - it's should expand or soft wrap but when tex...
I'm starting a project with .NET 8 and GraphQL (hot chocolate) and I use Visual Studio editor.. Every time I create a new mutation for GraphQL, I need to remember to create the class as sealed, and to add two attributes, for example: ``` [ExtendObjectType(typeof(GraphMutation))] [Authorize] public sealed cl...
{"Voters":[{"Id":3474181,"DisplayName":"user3474181"}],"DeleteType":1}
If you're using `docker compose` to manage your docker containers you can simply connect via the convenient image name specified in the `docker-compose.yaml`-file. For instance, I have two named containers running called `postgres` and `pgadmin` with the following setup ```yaml services: postgres: en...
{"Voters":[{"Id":3474181,"DisplayName":"user3474181"}]}
Can't index arrays in assembly
I got this problem where Django return "No Books matches the given query", even though the object exist in database. For context, I want to create an update page without relying the use of URL. First, here is my model : ``` User = get_user_model() class Books(models.Model): owner = models.ForeignKey(User,...
I'm currently trying to deploy a Next.js app on GitHub Pages using GitHub Actions, but I get a page 404 error even after it successfully deploys. I've looked around a bunch of similarly named questions and am having trouble figuring this out. Here is my GitHub repo: https://github.com/Mctripp10/mctripp10.github.io ...
404 error on deploying Next.js app with GitHub Actions
|reactjs|next.js|github-pages|
You can use `theme(aspect.ratio = ...)` to give your whole plot a particular aspect ratio. This will make your title come down closer to the bar. It makes it easier to reason about plots if you avoid flipping co-ordinates. In addition, I would use a super-thick segment instead of a bar here. By setting `expand = FALSE`...
I was hunting for an answer (but for C#) and landed here; found a clue in edwabr123's post. This is the relevant option (2022-17.8.6): Text_Editor/C#/Advanced/Fix_text_pasted_into_string_literals_(experimental). HUGE headache . . . gone.
I have a databricks notebook that uses chrome webdriver. I had been using the same notebook and code for several months, yet all of a sudden I get this error: ``` ImportError: cannot import name 'deprecated' from 'typing_extensions' (/databricks/python/lib/python3.10/site-packages/typing_extensions.py) ``` For th...
ImportError: cannot import name 'deprecated' from 'typing_extensions' Chrome Webdriver
|python|selenium-webdriver|databricks|
You want `skip-worktree`. `assume-unchanged` is designed for cases where it is expensive to check whether a group of files have been modified; when you set the bit, `git` (of course) assumes the files corresponding to that portion of the index have not been modified in the working copy. So it avoids a mess of `stat`...
The agent does not have any profiling settings, so it cannot record data. If you specify the "nowait" option, also specify the config=<PATH> and the id=<ID> parameters to refer to a particular session configuration. The total parameter will look like -agentpath:/opt/jprofiler14/bin/linux-x64/libjprofilerti.s...
It looks like this code works for me. I put it into [Directory.Packages.props][1]. ``` <GlobalPackageReference ExcludeAssets="build" Include="Transitive library Y">       <IncludeAssets>runtime; native; contentfiles; analyzers; buildtransitive</IncludeAssets>       <PrivateAssets>all</PrivateAssets> </GlobalPack...
How to make Container wrap to text while Expanded to Row, and fit it's own width?
|android|flutter|algorithm|mobile|layout|
You can use it as a mask like below. Note the use of `80px 80px` which will control the size of the SVG <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> img { border-radius: 5px 0 5px 5px; -webkit-mask: linear-gradient(#000 0 0), ...
I am using ECS with EC2 launch type, where my four services are running like Frontend in angular, backend in python django, redis and rabbitmq, Now my my backend is must connect with rabbitmq where rabbitmq make connections with backend service and in backend service celery is there which is give workers to rabbitmq v...
consumer: Cannot connect to amqp://awaazde:**@rbmq.local:5671/awaazde: [Errno 111] Connection refused
|django|amazon-web-services|amazon-ec2|rabbitmq|amazon-ecs|
null
I am trying to fetch an OS image with pycurl and write the decompressed data to disk. With gzip it is straight forward, only with lz4 formats I face issues, it seems the write_lz4(buf) decompresses and writes to disk, only when I try to resize the partition, I get an error: > entries is 0 bytes, but this program su...
|flutter|firebase|dart|firebase-authentication|flutter-getx|
null
I've been trying to get a pie chart working and was following the instructions from here [https://livecharts.dev/docs/WPF/2.0.0-rc2/Overview.Installation](https://livecharts.dev/docs/WPF/2.0.0-rc2/Overview.Installation) [https://livecharts.dev/docs/WPF/2.0.0-rc2/PieChart.Pie%20chart%20control](https://livecharts.dev/...
I have a list of field name in a database table (my actual list is 15+ in length and can vary) ``` flds = ["foo", "bar", "foobar"] ``` I also have field name in a function that correspond to those values ``` foo = "red" bar = "" foobar = "green" ``` I have code be low that is the same for each variabl...
I want to dynamically create python code based on values in a list
|python|
null
You may remove a single occurrence of a character from a string with something like the following: ```typescript const removeChar = (str: string, charToBeRemoved: string) => { const charIndex: number = str.indexOf(charToBeRemoved); let part1 = str.slice(0, charIdx); let part2 = str.slice(charIdx + 1,...
null
I have the problem when syncing the build.gradle.kts file: plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("com.google.devtools.ksp") id("kotlin-kapt") } android { namespace = "com.example.contactapp" compileSdk = 34 default...
|python|windows-task-scheduler|
I'm working on a project in Reac Native Expo and using "expo-router" to navigate between pages. I need to send a nested object array from one screen to another. My object structure is something like this: item: { id: '123', name: 'name', nestedObjectArray: [{id: 1, name: 'name'}, {id: 2, name: 'name'...
How to send nested objects with router.navigate()?
|typescript|react-native|expo|expo-router|
null
I want the pass the dynamic values in `params` from input.txt file? **input.txt file:-** ``` term=ditech process solutions,country=IN,action=get_search_companies ``` **For this code:-** import requests from bs4 import BeautifulSoup def read_params(file_path): params = {}...
It's a known issue with the latest release, it now has been resolved and the fix will come in the next release. One way to fix it is to rollback to a previous version i.e. 10.7.1 or if the isssue persists like mine you can just add this line of code: window.navigator.userAgent = "ReactNative"; I pasted mine i...
## 2024 update Even startxwin is no longer present. But `XWin` is (note the uppercase which is not tab-completion friendly when you're trying to find it!).
I have a function, which takes two vectors and computes a numeric value (like `cor` correlation would do). However, I have two datasets with around 6000 columns (the two datasets have the same dimensions), where the function should return one vector with the values of the correlation. The code with a loop would look...
I'm encountering an issue with notification delivery in my application, specifically utilizing FCM. Notifications on my device are experiencing delays when the app is closed. Interestingly, notifications are promptly delivered when the app is running or in the background, even when the phone is locked. However, the pro...
Notification Delivery Issue: Seeking Assistance for Instant Call Functionality in Flutter
|flutter|firebase|agora.io|
null
I've been writing a jolt for json transformation and I'm halfway through there. Need to modify json object in array if it is present in array and need to create new if it is not present at all. The object can appear at any position in json. ``` { "id": "id_1", "targetId": "targetId42", "externalId": "1ex...
Modify json array object with jolt
|json|apache-nifi|jolt|
null
For example there are two tables t1 and t2: t1 as, the only value in the table is either 'Prime', 'Non-Prime' or **'All'**. So it's something like this below, shipment_type can be one of the three values. It's 'Prime' in this example. 'All' means it can be either Prime or Non-Prime. shipment_type ...
|spring|spring-security|
null
With my quarto extension [mathjax3eqno](https://github.com/ute/mathjax3eqno), you can use mathjax capabilities also within html, but unfortunately not for books, because these would require keeping track of labelled equations across several rendered files. It is not working for word format, either. If you want to us...
I'm just building an (older) GCC version from source. During the make step, I get the error message ``` "WARNING: `makeinfo' is missing on your system. You should only need it if you modified a `texi' or a `.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might a...
makeinfo is not found, although installed. How can I fix this problem?
|gcc|
null
You use the [**`|json_script`** template tag&nbsp;<sup>\[Django-doc\]</sup>](https://docs.djangoproject.com/en/stable/ref/templates/builtins/#json-script) for this: <pre><code>{{ actual_data<mark><strong>|json_script:'actual_data'</strong></mark> }} {{ predicted_data<mark><strong>|json_script:'predicted_data'</stro...
I am newbie in bash linux. I already make Boot Menu in Batch and Powershell. I want to make it in bash. In bash, when i type efibootmgr, the output: ``` BootCurrent: 0003 Timeout: 2 seconds BootOrder: 0011,0000,0001,0013,0014,0015,0004,0003,0016,0017 Boot0000* ThrottleStop UEFI Boot0001* rEFInd Boot Manag...
How do I prompt an input on two different lines at the same time?
|python|python-3.x|input|
null
I have an error with php function chmod https://www.php.net/manual/en/function.chmod.php Any solutions? I'm running Linux Debian 13.05 with root access and PHP 8.2. Php Warning: chmod(): No such file or directory in file: index.php on line: 8 After I added a empty file, I we get: Php Warning: chmod(): Operation not...
Php Warning: chmod(): Operation not permitted
I'm trying to get some environnement variables that I set in my nuxt.config.ts like this : ``` const config = { space: useRuntimeConfig().public.CTF_SPACE_ID, accessToken: useRuntimeConfig().public.CTF_CDA_ACCESS_TOKEN, host: useRuntimeConfig().public.CTF_HOST, environment: useRuntimeConfig...
Error [nuxt] instance unavailable when using useRuntimeConfig in Nuxt 3
|vue.js|nuxt.js|nuxt3|
There be no straight way for an Android app to detect if another app is using the camera. Android's security model prohibit one app from accessing the resources or monitoring the behavior of another app without explicit permission and appropriate APIs. While Android does provide APIs for accessing certain system inf...
[![enter image description here][1]][1] I get this error whenever I want to access my frontend and I don't know what to do Author Controller cs ``` // Controllers/AuthorController.cs using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.T...
null
Have a question regarding Pytorch framework that I started to use recently (while always used keras/tf in the past). So I would like to convert simple pandas `DataFrame` to the pytorch `Dataset`. import pandas as pd df = pd.DataFrame(np.array([[1, 2], [4, 5], [7, 8]]), columns=['A', 'B']) For applyi...
CASE WHEN Statement in the Filter
|sql|mysql|case|
i want to make my extension I want to suggest "CompletionList" to users. users can run "editor.action.triggerSuggest" The process of my extensions as is follows 1. users write some texts 2. if he press "completion command", 3. vscode extension provides Completion 4. and executeCommand("editor.action.trigg...
Safari's stricter autofill regulations especially about private data like credit card numbers—are probably to blame. Additionally, you might try using JavaScript to trigger it programmatically. This can be achieved by programmatically blurring the form's initial input field after focusing on it. This might aid Safari i...
The core issue lies in the @Lock(LockMode.PESSIMISTIC_READ) annotation being incorrectly applied to the findAll() method. Spring Data JPA's @Lock annotation is intended for locking individual entity instances, not for locking entire query results. The framework is attempting to interpret findAll() as a property of th...
i want to make my extension I want to suggest "CompletionList" to users. users can run "editor.action.triggerSuggest" The process of my extensions as is follows 1. users write some texts 2. if he press "completion command", 3. vscode extension provides Completion 4. and executeCommand("editor.action.trigg...
I don't need to do any validation over users, etc. I only need that the client send the certificate and the server (me in this case) validate the certificate through truststore or something (apply mTLS in other words). I have one endpoint, lets say "/authentication", that need to be mTLS, the other ones only nee...
Encountering a specific problem with Angular routing when deploying my application on Wildfly, especially when packaged as a `.war` using the command `jar -cfv`. The primary concern is that while I can successfully navigate to the base URL (e.g., [http://127.0.0.1:8982/oferta-app](https://i.stack.imgur.com/AMPG8.png...
null
You should try set your html language to urdu. Add the following line to the html head ``` <html lang="ur"> ```
|c#|.net|
I would like to ask you how I could build a dataframe inside a loop starting from the values of a column. The initial dataframe is: data = {'Name': ['Computer','Tablet','Monitor','Printer'], 'Price': [900,300,450,150], 'Identifier': ['11$10qw-IDAA','2222-IL$DB123-ABC','33-$IDCCC-12345', '1as3211-...
Pandas Create a data frame from a loop
|pandas|string|dataframe|list|function|