instruction stringlengths 0 30k ⌀ |
|---|
Like any kind of `Stream` (e.g. `Promise`s), when you see nesting in `Observable`s you might want to take a step back to see if it's really warranted.
Let's examine your solution bit by bit.
Our starting point is:
this.router.paramMap.pipe(takeUntil(this.ngUnsubscribe))
Then you subscribe, but within th... |
the problem seems to be in the way you are printing your statements with the use of your "__repr__" function, the method of the ListNode class is recursively calling it self, causing it to be infinite recursion hence, the hanging
try the below given code:
def __repr__(self, visited=None):
if visited is N... |
So I'm getting started with Rust and as a practice project I decided to create a small program that would just find a number in a given range using what I think is binary search. The code works well, as far as I can tell. The issue appeared when I wanted to make a mathematical function that would predict the average am... |
Application Insights capturing ALL traces while appsettings.json level is set as Inforamtion |
|c#|api|asp.net-web-api|azure-application-insights| |
null |
you are installing the pm2 application in the builder stage.
you have to give the command:
RUN npm install -g pm2
in the second stage (after the FROM nginx:alpine line)
for my use case I used this dockerfile:
FROM node:12.22.10 as build
WORKDIR '/app'
COPY ./src ./src
COPY ./*.* .
... |
Our Spring Java application should use Azure App Configuration service to manage feature flags.
The problem is that there is [no way to run App Configuration service locally][1] through Docker like other feature flags manager products. There is an option the [Java Azure SDK to use local configuration][2] but it is ... |
Switch between static and dynamic Azure App Configuration service |
|spring-cloud|azure-app-configuration|feature-flags| |
TL; DR: You just have to change the message handlers registration order
from
```
.AddHttpMessageHandler<LogHandler>()
.AddPolicyHandler(retryPolicy);
```
to
```
.AddPolicyHandler(retryPolicy)
.AddHttpMessageHandler<LogHandler>();
```
___
**UPDATE #1**
In order to better understand why `DelegatingH... |
Why isn't the code reflecting the actual mathematical behaviour when doing a binary search guess? |
|math|rust|binary-search| |
I've written the following code to compare the theoretical alpha = 0.05 with the empirical one from the buit-in t.test in Rstudio:
```
set.seed(1)
N <- 1000
n <- 20
k <- 500
poblacion <- rnorm(N, 10, 10) #Sample
mu.pob <- mean(poblacion)
sd.pob <- sd(poblacion)
p <- vector(length=k)
for (i in 1:k) {
mu... |
{"Voters":[{"Id":4253229,"DisplayName":"Eugene Sh."},{"Id":16217248,"DisplayName":"CPlus"},{"Id":9455518,"DisplayName":"Hamed"}]} |
Compare theoretical and empirical alpha in R [SOLVED] |
|python|django|deep-learning|webcam|mediapipe| |
In case it is relevant, I am observing this behavior in Tcl 8.6.13.
Normally, errors in Tcl include line numbers and filenames when applicable.
However, I'm finding that when errors occur in scripts executed with ```interp eval```, I do not get this information.
The two examples below are exactly the same, exc... |
How to integrate real-time webcam MediaPipe code to Django |
Recently I also faced same problm in MacOS while opening R studio , it produces a pop-up error saying
> File Listing Error, Error navigating to ~/Desktop: Operation not permitted.
so waht u have to do
- open R studio
- you may find RStudio next to apple icon Click over there
- Then click... |
|php|symfony|symfony4|user-roles|symfony-security| |
null |
In NextJs unlike other frameworks it doesn't provide filter chain or request pre-processing or post processing.
This could be a common need for any node project or some library developers to have their logic to be executed before and after actual call delegated to API endpoint / Web pages.
```
In even this feature... |
I have an expo app, I need to run `eas build`.
Before that I needed to log in to the expo account but I have signed up with Google, so I don't have a password.
I have created a new auth token from expo.
But I don't see how can I use this auth token to login from the console.
|
eas login with access token |
|react-native|expo|eas| |
I have a Combobox and a Listbox like this:
```python
cities = df[df.columns[0]].tolist()
city_frame = tk.Frame(root)
city_frame.grid(row=1, column=1, sticky=tk.N)
cities_var = tk.Variable()
cities_var.set(cities)
tk.Label(city_frame, text="Thành phố").grid(row=0, column=0)
selected_cities_lb = tk.Listbox(
... |
tkinter - selecting values from Combobox resets the value of an another Listbox |
|python|tkinter| |
You need to use **Align.CenterHorizontally** and add it if you don't want to check your import
import androidx.compose.ui.Alignment
Column (
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally... |
you are installing the pm2 application in the builder stage.
you have to give the command:
RUN npm install -g pm2
in the second stage (after the FROM nginx:alpine line)
for my use case I used this dockerfile:
FROM node:12.22.10 as build
WORKDIR '/app'
COPY ./src ./src
COPY ./*.* .
... |
As mentioned in the comments: yes, this documentation is imprecise at best. I think it is referring to the behavior between scalars of the same type:
```python3
import numpy
a = numpy.uint32(4294967295)
print(a.dtype) # uint32
a += np.uint32(1) # WILL wrap to 0 with warning
print(a) # 0
print(a.dtype) # u... |
How can I make my text visible when my custom curser hovers over it |
|javascript|css|cursor| |
null |
I want to create 2 lists from one column based on condition in other column. Currently, I am able to get the 2 lists by scaning dataframe twice.
1. Is it possible to get the 2 lists in single scan?
2. Getting lists by individual groups?
```
data = {
"co2": [95, 90, 99, 104, 105, 94, 99, 104],
"model": [
... |
creating lists in single scan |
|python|pandas| |
in my vs code in c++ when i am declaring a pointer and then printing the size of the pointer its giving me 4 bytes instead of 8 bytes even though my system and compiler both are 64 bits. pls help i am a beginner.
i tried asking chat gpt but got no answer |
pointer size not 8 bytes |
|visual-studio-code|pointers| |
null |
You can think of using Azure DevOps REST API for this purpose. You can create one PowerShell or Python Script to use Azure DevOps REST API to get the deployment status and then link it to the work item. |
- Mitmproxy: 10.2.4
- Python: 3.10.12
```python
from mitmproxy import http, flow
def request(flow: flow):
headers = [
(b'set-cookie', b'name1=value1'),
(b'set-cookie', b'name2=value2'),
(b'content-type', b'text/html'),
]
flow.response = http.Response.make(200, b'<... |
ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you're on Streamlit Cloud, click on 'Manage app' in the lower right of your app).
Traceback:
File "/home/adminuser/venv/lib/python3.9/si... |
|c++|visual-studio-code|pointers| |
The most frequent issue that arises while using kubectl kustomize for Json6902 patching is the failure to recognize that "add" might occasionally behave like "replace”. The same problem & its solution is explained in this **[Medium blog](https://pauldally.medium.com/the-most-common-problem-i-see-when-using-json6902-pat... |
NextJs handle logic for request pre-processing & post-processing |
|next.js| |
You can use the CLI to generate a standard dedicated [Web Worker][1] and then update the code to use Shared Worker instead.
new SharedWorker(new URL('./shared.worker', import.meta.url))
Angular CLI will handle compilation and bundling the worker file automatically.
[1]: https://angular.io/guide/web-worke... |
Your fairly "verbose" code can be written a lot shorter if you leave out all the repetitions:
<!-- begin snippet:js console:true -->
<!-- language:lang-html -->
A<button id="na">1</button>
B<button id="nb">1</button>
X<button id="nx">1</button>
Y<button id="ny">1</button>
Z<button id="nz">1</button>
<div id="... |
I need to generate a YAML file. There is the following dictionary `{'fruits': ['banana', 'apple'], 'car': [], 'clothes': ['jeans', 't-shirt', 'shirt'], 'headdress': [], 'shoes': []}`.
But I can't seem to generate the following file itself:
```yaml
config:
product:
fruits:
name: Fruits
object_typ... |
Python generate file YAML |
{"OriginalQuestionIds":[12708381],"Voters":[{"Id":1048572,"DisplayName":"Bergi","BindingReason":{"GoldTagBadge":"html"}}]} |
I am trying to introduce an API, where you pass object and the object's methods will have `this` typed as the object itself without specifying the type of the object explicitly.
I tried this:
```typescript
interface BaseProcessor<T> {
process(this: T): void;
[key: string | symbol]: unknown;
}
functio... |
I have a `FloatingActionButton` that changes its icon to a pause icon when clicked. How can I toggle the icon back to the play icon when the button is clicked again?
**Code:**
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
... |
Do you have `AllowsEditing: true` in your `ImagePicker.launchImageLibraryAsync` ?
I have the same error and i fix it by set `AllowsEditing: false` and instead of using axios or fetch to send request i use `FileSystem.uploadAsync` in `expo-file-system`
p/s: sorry if my english was too bad :)) |
The command sometimes succesfully launches the batch file however, sometimes it doesn't work and it immediately closes.
I was wondering what I could do to fix this issue.
#a couple of the commands I have tried
start-process -wait -filepath "C:\Windows\System32\cmd.exe" -argumentlist "/c 'C:\path\stream3.ba... |
For simplicity, let's only look at a translation.
For that we assume a scenario where the sun sits at the origin, the planet earth one unit to the right on the x-axis and the moon one unit further right of the earth.
If we want to render the sun, planet and the moon we typically would render the sun first, transl... |
I have a python code which uses Hugging Face Transformers to run an NLP task on a PDF document. When I run this code in Jupyter Notebook, it takes more than 1.5 hours to complete. I then setup the same code to run via a locally hosted Streamlit web app. To my surprise, it ran in under 5 mins!
I believe I am comparin... |
I have a very simple Asp .Net API project where I am trying to add some trace logging.
I need some help with Application Insights configuration for that logging.
Right now its capturing ALL traces while in *appsettings.json* I have set the **Default** level to **Information**.
I have this code in my *Program.cs* ... |
Levels have been explained in the official documentation below.
https://docs.amplify.aws/javascript/build-a-backend/storage/upload/
Example usage from there:
```
uploadData({
key: file.name,
data: file,
options: {
accessLevel: 'private'
}
});
``` |
I'm sorry for the short answer. This is a problem widely discussed in the Timescale community.
The problem is related to the immutable vs not immutable time bucket function signature dealing with different types of data. So, in resume timestamp is not immutable and timestamptz is immmutable.
Let's navigate on it:... |
I have problem with selecting certain checkboxes in Vue 3 compositonApi by primeVue components.
For example static data works correctly i can select whichever element i want:
```
<DataTable v-model:selection="selectedItem" :value="itemsFromApi" dataKey="id" tableStyle="min-width: 50rem">
<Column selection... |
I had the same issue before, in my case the Url was not properly set because I was using an env var that was not propagating correctly.
I was dong something like
use: {
baseURL: process.env.URL <- I had a problem with my env variable
},
Just in case, I would suggest to hardcode the value direct... |
Not sure which version you are on, but currently the pager is using a flexbox layout. So you can prepend an element with the `k-spacer` class that is used to separate items in toolbars. For the latest version it does the trick:
`$(".k-grid-pager").prepend('<div class="k-spacer"></div>')`
Here is an [example](http... |
Let's pretend I want to add an hyperbolic curve to this plot
data(cars)
xyplot(dist ~ speed, cars)
Even though, such function won't fit data, the curve should be like the one you see in the picture. Could you please suggest to me the proper code?
![][1]
[1]: https://i.stack.imgur.com/AuXqm.... |
How to add hyperbolic curve in lattice |
|r|curve|lattice|hyperbolic-function| |
When I login to bastion server every time, there is initial shell script which will run and records sessions.
```if [[ -z $SSH_ORIGINAL_COMMAND ]]; then
LOG_FILE="`date --date="today" "+%Y-%m-%d_%H-%M-%S"`_`whoami`"
LOG_DIR="/var/log/ssh-bastion/"
echo ""
echo "NOTE: This SSH session will be recorded... |
Iam not able to login to bastion server-permission denied error |
|amazon-ec2|bastion-host|bastion| |
Vue 3 Problem with PrimeVue DataTables Checkboxes component |
|laravel|datatable|vuejs3|vue-composition-api|primevue| |
null |
I am working on a simple React app in which I have a basket that stores the number of items a user wants to purchase.
I'm storing this number in localstorage and that all works fine.
I'd now like to use that same number to populate the trolley icon at the top of my page. This lives in the main React App component... |
Why isn't my JS eventlistener triggering a function? |
|javascript|reactjs|listener|event-listener| |
Nothing is stopping you from sending an image or any other arbitrary data over TCP.
You can serialize the image to JSON, and send as text, or send the image as one or more `TypedArray`s.
Then reconcontruct the data per your specification on the other side of the socket. |
I'm in the process of upgrading Cypress from version 8 to version 13. In version 8, I was able to do something like this:
cy.getBySel('mealList-totalCalories').invoke('text').as('totalCals');
This accesses the original value of a value that will change later on once a new item is added to the meal list. Once ... |
How to access the previous value of text in Cypress that you expect to change? |
|cypress| |
A typed property can only be assigned values of the same type. Another value would either be silently converted, or crash the program. As such the type is guaranteed to be correct, **which makes the `Type` assertion useless**.
Also, note that it is better to validate data before they make their way inside your entit... |
I have a Python script to download an image from a URL and upload it to AWS S3. This script works perfectly when I run it on my local machine. However, when I deploy and run the same script on an AWS EC2 instance, I encounter a `ReadTimeout` error.
The error I'm receiving is as follows:
```
requests.exceptions... |
ReadTimeout error when downloading images on AWS EC2 but not locally |
|python-3.x|amazon-ec2|request|timeoutexception| |
I debug the code using `{{ dd($order->id) }}`, I got 100238 order id value. But when I type
<form action="{{ route('admin.pos.update_order', ['id' => $order->id]) }}" method="post">
then its not working. Then I write this `{{ route('admin.pos.update_order', ['id' => 100238]) }}` its works great.
I cannot ... |
You should never have written `b.__breadth = 5`. The intent of double underscore is that this variable is private to the class and should never be accessed from outside it. If you need to modify `__breadth` from outside, you should have a `set_breadth` method inside the class.
```
class Rectangle:
...
d... |
I got a new Laravel project but it showing the following error and it is not letting me run it using php artisan serve I tried using composer self-update too but it is not working....
Here's the error =>
php artisan serve
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return typ... |
The easiest way to find out correct image is to check [Ubuntu on Azure][1]:
For example for `Ubuntu 22.04 LTS - Jammy Jellyfish` the image is going to be something like that:
image:
offer: "0001-com-ubuntu-server-jammy"
publisher: "Canonical"
sku: "22_04-lts"
version: "latest"
... |
>Is there something similar to the Azure SQL database deployment for SQL Server? Conceptually, I'm thinking running a task that executes Update-Database as a deployment task. Am I on the right track?
The `Azure SQL database deployment` task used SqlPackage.exe and Invoke-Sqlcmd cmdlet to deploy DACPACs or SQL Server... |
I am getting audio from mic. with using AvAudioEngine but when coming call and makes interruption, I want to stop and then restart getting audio process but When I try handleInterruption(I shared below) method I am getting this error. how can I stop and restart AvAudioEngine after interruption
AURemoteIO.cpp:1702 A... |
|javascript|hoisting|function-expression| |
I disagree; when you've learnt 5 or so programming languages, you usually come to the point where you realize it's more or less the same, because *program design* is "language agnostic" and you (ought to) design programs in the same way no matter if you code in assembler or C#. What's actually most different isn't so m... |
null |
I'm using Anaconda3-2024.02-1-Windows-x86_64 (yes, Windows 64) on windows 11, with python 3.11.7. I was trying to build an offline translator and i forgot what led to what... Eventually i was trying to install EasyNMT and it faild because of fasttext package. Then, I decided to install fasttext separately but failed an... |
If you are using InterActiveServer per page/component it will not work. You need to change the `App.razor` to global Interactive server mode.
```
<Routes @rendermode="InteractiveServer" />
```
If you are using Blazor Webassembly standalone. To use `MudMenu` you need to make sure following steps have been finished.
... |
Where you store the user credential? Inside the cookie or session? Which authentication schema you have used? According to your description, it seesm the user credential expire which caused your application login again.
If you just want to know how to modify the IIS application pool idle time, you could refer to b... |
When I run `Rake -T` in production mode, rails throws error about missing `pry` gem.
Who can help me explain why it happens?
My command: `RAILS_ENV=production bundle exec rake -T`
Ruby: "3.3.0"
Rails version: 7.1.3.2
Bundle command
```
bundle config set without 'development test'
bundle install -j 20 ... |