instruction stringlengths 0 30k β |
|---|
Install vite-plugin-node-polyfills
<code>npm install --save-dev vite-plugin-node-polyfills</code>
or <code>yarn add --dev vite-plugin-node-polyfills</code>
and add the import <code>import { nodePolyfills } from "vite-plugin-node-polyfills";</code>
to vite.config.ts and add <code>nodePolyfills()</code> ... |
You can use [`str.extract()`](https://docs.pola.rs/py-polars/html/reference/series/api/polars.Series.str.extract.html) to split the parts and then get the resulting number by using [`Expr.replace()`](https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.replace.html) + [`Expr.pow()`](https://docs.po... |
I have a transformation matrix with scaling (20, 20, 1) and rotation by 90 degrees:
```
0, -20, 0, 80
20, 0, 0, 20
0, 0, 1, 0
0, 0, 0, 1
```
I want to get scaling. I have the next example in JavaScript with the glMatrix library that extracts scaling from the transformation matrix above:
```html... |
Is it possible for `sudo` to fail temporarily with the correct password? Hacking suspected |
|linux|security|ssh|root|sudo| |
Broadly speaking, you are right -- there should be some persistance mechanism to make dynamic allocation work. But in the narrower context of your question, I would go with a firm'ish NO because modern Spark versions provide other means to persist and serve shuffle blocks beyond External Shuffle Service (ESS). This is ... |
[Reference 1][1]
**Problem :-**
Look below.
```python
application = ProtocolTypeRouter({
"websocket": URLRouter([
path("ws/notifications/", consumers.NotificationConsumer.as_asgi()),
]),
})
```
It's `notifications`.
And
```javascript
const ws = new WebSocket('ws://localho... |
{"Voters":[{"Id":864233,"DisplayName":"romellem"},{"Id":2802040,"DisplayName":"Paulie_D"},{"Id":8620333,"DisplayName":"Temani Afif"}],"SiteSpecificCloseReasonIds":[]} |
if you use dio method for api calling please use like ,
your porblem is 100% solved
Map<String, dynamic> map = jsonDecode(response.toString()); |
I think this solution is more simple and you could use the whole modal header to drag the modal. However I use reactstrap!
import { Modal, ModalHeader, ModalBody } from "reactstrap";
import Draggable from "react-draggable";
...
<Draggable handle=".handle">
<Modal size="lg" toggle={fun... |
> `configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Origin", "Origin"));`
You might need to adjust `configuration.setAllowedHeaders(...)`. The [header `"Access-Control-Allow-Origin"`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) is a *response* header, not... |
{"Voters":[{"Id":1427563,"DisplayName":"jla"},{"Id":4621513,"DisplayName":"mkrieger1"},{"Id":830680,"DisplayName":"Clive"}]} |
POSIX mandates in Definition 3.84[1] that a byte is "exactly an octet" (8 bits). Does that make it safe to assume that a `char` is 8 bits on all Linux and FreeBSD systems (at least)?
I have some understanding of what POSIX is and what it tries to achieve, but I don't know to what extent Linux and *BSD systems "must"... |
{"Voters":[{"Id":4785110,"DisplayName":"maraca"}],"DeleteType":1} |
I've recently tried to publish a very simple API which runs with a local SQL server database to Azure through Visual Studio, but it only returns an empty array when entering the correct route.
[Empty array](https://i.stack.imgur.com/yaIxs.png)
I already included the dependancy to Azure and connected it to an Azur... |
Empty array returned from api database when publishing to azure |
|database|azure|api|publish| |
null |
my laravel livewire 3 app has a datatable. Sorting this table triggers the livewire update which is huge in size for a relatively small table of just 10 rows and 7 columns. The queries are all lighnting fast already.
How can I make the actual sorting of the table snappy? I believe that I have to tell livewire which ... |
How to get scaling from QMatrix4x4 |
|c++|qt|linear-algebra| |
You see this : `len(nums[start:end + 1])` this is nothing but `end - start + 1`
In other words you are slicing the `nums` repeatedly which is not necessary.
You could write it as :
result = min(end - start + 1, result) |
use the language code for your state.
for ex:
void changeLanguage(Locale locale) {
currentLocale = locale;
emit(LanguageChanged(locale.languageCode));
}
sealed class LocalizationState extends Equatable {
const LocalizationState();
}
final class LanguageChanged exte... |
config:
target: "url"
phases:
- duration: 600
arrivalRate: 6
variables:
from: "{{ $randomItem(file('numbers.json')) }}"
scenarios:
- flow:
- log: "{{ from }}"
- loop:
- post:
url: "/api"
json:
text:
... |
How to generate random item from json file in yaml code for artilliery load testing? |
|yaml|load-testing|artillery| |
null |
code:
```
import random
import re
numbuttons = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
operators = ['+', '-', '*', '/']
class Task:
def __init__(self, difficulty = 1):
c = None
self.difficulty = difficulty
self.task = ""
b = ""
if difficulty == 1:
... |
Our asp.net website is using FormAuthentication. I want to decrpty the authentication cookie. Here is the code.
```
string ticket = Request.Cookies[".ASPXAUTH_xxx"].Value.ToString();
// Format Cookie to be converted
ticket = ticket.Replace('-', '+').Replace('_', '/');
var padding = ... |
How to unprotect ASP.NET FormAuthentication cookie |
|c#|asp.net|.net|webforms|asp.net-authentication| |
{"OriginalQuestionIds":[4928271],"Voters":[{"Id":157882,"DisplayName":"BalusC","BindingReason":{"GoldTagBadge":"java"}}]} |
I am having issues with a query which includes BEGINSWITH (or CONTAINS for that matter). I am trying to follow the example as found in the Mongo Db documentation:
This query to find instances of the \<Pantry\> model is not filtering the way it should.
(all of this is in the viewModel)
This is the query:
```... |
Yes, components requires you to run them under a proper owner, that is either `render` function, or a root created via `createRoot` function or another component. This is needed to build an ownership tree, a tree that show who owns whom so that when a component is disposed, its resources will be cleaned up. So, the war... |
This might be lacking one `flatDir` "repository" configuration, which tells it where to look for it.
repositories {
mavenCentral()
flatDir {
dirs '../../../spring-cloud-netflix/spring-cloud-starter-netflix-eureka-server/target/'
}
}
Then it can just be referenced a... |
The UI shows the correct value however the event handler returns `undefined`.
```typescript
const TestComp: Component<{ count: number }> = (props) => {
const handleClick = () => {
console.log(props.count);
};
return (
<button onClick={handleClick}>Show {props.count}</button>
)
}
```
It co... |
Call 2 numbers simultaneously from softphone (Asterisk - FreePBX) |
|python|asterisk|agi|freepbx|dialplan| |
null |
[enter image description here](https://i.stack.imgur.com/4A5H6.png)
I am trying to combine the "n" column to matching word (there are multiple words from a big dataset). That way the percentages reflect all of the combined "n" by circumstances of rescue, but they are subsetted by the different circumstances of rescue... |
I have a Linux C/C++ application, including a custom signal handler which sends an email.
When I run without GDB and a signal is thrown, my signal handler is called.
However, when I run using GDB it obviously intercepts the signal and my handler is not called. I presume this is so it can show the backtrace etc.
... |
Can GDB call user-defined signal handler and still break on the code which threw a signal? |
|c|linux|gdb| |
Here is an approach using the save/restore mechanism of Fragment/Activity written in Kotlin
First create a data class that will hold the map state and make it implement Parcelable
data class MapState(
val mapType: Int,
val zoomLevel: Float,
val cameraLat: Double,
val camera... |
There is a default table from the vuetify docs:
https://vuetifyjs.com/en/components/data-tables/basics/#expandable-rows
The default padding for the td and th elements is 16px left and right.
How can I change it to a lower value?
Thank you.
I tried adding custom css rules, but I am not good at doing that, ... |
is there a way in vuetify to adjust padding in data table? |
|datatable|vuetify.js|padding| |
null |
I'm trying to create the figure below from my GWAS (Genome wide association) results of all the QTLs (Quantitative trait loci) I have identified. This figure has shown up in several papers I have read but no package is ever cited to help with making it and I'm hoping someone here can help.
![enter image description ... |
Checking mass balance requires to **close the system**. This can be done by adding explicit state variables for source and sink, where `source` represents the stock of the drug and `sink` the accumulated amount that leaves the blood, either by decomposition or excretion. The source variable can be set to zero to check ... |
### Here are some very simple but detailed solutions in Chinese:
https://zhuanlan.zhihu.com/p/352148624
### My solution:
Link the lost libs after `#include` (beware `#pragma` only in msvc, gcc would get error)
```c++
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "xxx.lib")
...
```
1. Search the spe... |
I want to plot two plots with `make_subplots` with different times.
How should I do that?
```
fig = make_subplots(rows=2, cols=1,row_heights=[0.5, 0.5], shared_xaxes=True)
fig.add_trace(go.Candlestick(x=dfpl.index, open=dfpl['open'], high=dfpl['high'], low=dfpl['low'], close=dfpl['close']), row=1, col=1)
fig.... |
null |
null |
null |
null |
TLDR: He is rendering elements under an async function. Rendering uses computations internally which can not be tracked directly under an async function. Creating computation under an async function is same as creating computation outside a tracking scope because the computation is executed in the event loop, after the... |
I am new to writing functions and loops in R, and am wanting to iterate a chunk of code across columns in a dataframe, to create a new matrix of results. I am getting stuck with how to iteratively create new objects and matrices using/named after values in a certain column (Site) in my dataframe, to then pass through t... |
I'm new to Bokeh and Python and really not sure where I'm going wrong. I've created 4 dataframes english1 french1 german1 and spanish1.
To which I'm hoping to display in one bokeh graph to compare the to movie Genres based and those 4 languages..
This is my code
`your text`# Set the figure specifics.
`your tex... |
v.bar is returning no results in my bokeh code |
|bokeh| |
null |
|excel|vba|excel-tables|listobject| |
Part of the issue is with your interpretation of the `else` on the `while` loop. It will only ever get executed once, as the while loops exits without a `break`. I think your expectation was that after the else block, the while condition would be evaluated again. This is not the case, use an `if` statement in the while... |
The [`.cum_sum()`](https://docs.pola.rs/docs/python/dev/reference/expressions/api/polars.Expr.cum_sum.html#polars.Expr.cum_sum) itself can be used as the "group id".
```python
df.with_columns(
group = pl.col("a").cum_sum()
)
```
```python
shape: (4, 3)
βββββββββ¬ββββββ¬ββββββββ
β a β b β group β
β ... |
I need help with this exercise:
Half Sum Element:
Write a program that inputs n integers and checks whether there is a number among them, which is equal to the sum of all the rest. If there is such an element, print "Yes" + its value, otherwise print - "No" + the difference between the largest element and the su... |
{"Voters":[{"Id":238704,"DisplayName":"President James K. Polk"},{"Id":2395282,"DisplayName":"vimuth"},{"Id":4085331,"DisplayName":"Doug Maurer"}],"SiteSpecificCloseReasonIds":[18]} |
my mistake is i configure .env.example
you must configure .env file
|
In order for Jackson to deserialize a Json, it either needs a default constructor or a method annotated with `@JsonCreator`. Without any of these two methods, Jackson raises an `InvalidDefinitionException`.
With a default constructor, Jackson first creates an instance of the class and then injects the object's prope... |
I just cannot get my ajax calls to work on an Ionic 3 Cordova application built for a Windows 10 UWP. They can access localhost, but not any outside connections.
The application works fine on both Android and iOS.
I am trying to test this locally on my dev machine. I use a certificate (bought) to sign the applic... |
{"Voters":[{"Id":466862,"DisplayName":"Mark Rotteveel"},{"Id":354577,"DisplayName":"Chris"},{"Id":16217248,"DisplayName":"CPlus"}],"SiteSpecificCloseReasonIds":[18]} |
I am having issues with a query which includes BEGINSWITH (or CONTAINS for that matter). I am trying to follow the example as found in the Mongo Db documentation:
This query to find instances of the \<Pantry\> model is not filtering the way it should.
(all of this is in the viewModel)
This is the query:
```... |
I am trying to use a regresion test case folder but when I add the test cases to the new test set, it has all previous test case results. Is there a way to not include any of the previous results?
From the Milestone, I added a new test set and then added the test folder. |
Copying rally test sets without including previous results |
|rally| |
null |
You should try something like this:
SRC_URI:machineA += "file://machineA/machineA.patch"
SRC_URI:machineB += "file://machineB/defconfig \
file://machineB/machineB.patch"
The filename you specify within the URL can be either an absolute or relative path to a file.
Mo... |
null |
null |
null |
null |
If you're using Backpack version 6.x. To show a dropdown menu, with elements, you can use the menu-dropdown and menu-dropdown-item components:
<x-backpack::menu-dropdown title="Authentication" icon="la la-group">
<x-backpack::menu-dropdown-item title="Users" icon="la la-user" :link="backpack_url('user')... |
I'm working on a multi-module Gradle project named "layers" with the following structure:
```
layers/
|- build.gradle.kts
|- settings.gradle.kts
|- buildSrc/
| - build.gradle.kts
|- layers-sdk/
| - build.gradle.kts
|- layers-api/
| - build.gradle.kts
|- libs/
| - build.gradle.kts
```
In my settings.... |
Generation of expressions in the form of division of one random int operand by a similar operand, the result of execution of which will be an int num |
|python| |
Did you create OpenAPI Bean? Something like this:
@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.info(
new Info()
.title("My app")
... |
In our company, we have a private repo on Github where we have our internal nuget packages.
On my laptop, on another API solution, I can restore the nuget packages using my github credentials.
I'm configuring the github actions to check the PR and deploy the API but when I want to restore nugets, I have an 403 erro... |
|python-multiprocessing|attributeerror|python-3.8|wandb| |
Figured out I was using the wrong path to generate logs. I'm running on a windows computer so I had configurated the path `Logging\\Logs.txt`. Since docker on windows uses WSL I had to change it to `Logging/Logs.txt` |
{"Voters":[{"Id":23839152,"DisplayName":"Robin Scheel"}],"DeleteType":1} |
My SQL Server Management Studio is crashing every time I am running a query.
I am getting following logs:
```
<entry>
<record>816</record>
<time>2024/03/29 15:31:44.769</time>
<type>Error</type>
<source>VisualStudio</source>
<description>Loading UI library</description>
<guid>{67909... |
I'm struggling with a VBA subroutine and would appreciate some assistance. The script is intended to perform the following tasks:
1. Read values from column "LADUNGSNUMMER" in the worksheet "NVL" cell by cell.
2. Find each value in column "Transport" of the worksheet "DATA".
3. Read the corresponding values from c... |
The django-tables2 docs describe how to sort a custom column (<https://django-tables2.readthedocs.io/en/latest/pages/ordering.html#table-order-foo-methods>). But I can't figure out how to apply this to my situation and am hoping someone can help.
Before sharing code, here's what I'm doing. The table is built of `d... |
django-tables2 sorting on custom column |
|django-queryset|django-tables2| |
|excel|vba|excel-tables|listobject| |
You are on the right track using the `MemoryRouter`, but you'll also need to render `MovieDetails` on a route with a path that has a `movieId` parameter.
Example:
```jsx
import {
MemoryRouter,
Routes,
Route,
} from 'react-router-dom';
test('render movie details when a movie is selected', () => {
... |
|excel|vba|excel-tables|listobject| |
I need to cumsum the column b until a becomes True. After that cumsum shall start from this row and so on.
```python
df = pl.from_repr("""
βββββββββ¬ββββββ
β a β b β
β --- β --- β
β bool β i64 β
βββββββββͺββββββ‘
β false β 1 β
β false β 2 β
β true β 3 β
β false β 4 β
βββββββββ΄ββββββ
""")
... |
VBA script to read values from one worksheet and write to another (set range problem) |