instruction stringlengths 0 30k ⌀ |
|---|
See the following example where case B is undesirable and either we want case A or case C. I could envisage this being detected by (i) (ii) or (iii) below, but I can't see how to do this in ESLint?
```
function throw1 (j) {
if (j == 1) throw j;
return j;
}
var i;
for (i = 0; i < 3; i ++) { let r; ... |
Passing 'props' to children component and conditionally render it |
First a small clarification: `CodeServer` _is_ Super Dev Mode, just as `DevMode` is. The chief difference between `CodeServer` and `DevMode` is that `DevMode` _also_ starts a simple application server on port 8888 by default.
As such, you should not be running `CodeServer` and `DevMode` at the same time for the same... |
I want to publish the teams application from the [`@microsoft/teamsapp-cli`](https://www.npmjs.com/package/@microsoft/teamsapp-cli). I can see `teamsApp/update` is working fine but `teamsApp/publishAppPackage` from the same provision lifecycle configuration is giving me the error. Unfortunately (even with `--verbose` a... |
Unable to publish the MS Teams application using Teams CLI |
|microsoft-teams|teams-toolkit| |
public function connections()
{
return $this->hasMany(UserConnection::class, function ($query) {
$query->where('from_user_id', $this->id)
->orWhere('to_user_id', $this->id);
});
}
|
{"Voters":[{"Id":14853083,"DisplayName":"Tangentially Perpendicular"},{"Id":1940850,"DisplayName":"karel"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[18]} |
I use the example of `plotmf` function in the [document](https://www.mathworks.com/help/fuzzy/plotmf.html) and at the same time, I want to change the font of `x` label. So I use the code below:
```
fis = readfis('tipper');
plotmf(fis,'input',1)
xlabel('\fontname{宋体} 论域')
ylabel('\fontname{宋体} 隶属度')
```
But... |
You can leave the body empty and use the following line:
```csharp
Response.StatusCode = 202;
```
Let me know if this helped
|
I have the following bash script (`test.sh`):
#!/bin/bash
printf '\e[36m%s\e[0m' "This is a test"; echo ""
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) echo "Aborted"... |
R: Using system() to run a bash script with input via read -r |
|r|bash| |
Moving a project do not have impact on current resources.
However, for the new resource, created after the migration, some Organisation policy can apply and can impact the previous behavior if that organisation policy was not set (or configure differently).
For instance, or policy that allow a subset of usable im... |
null |
As per [Haystack docs](https://docs.haystack.deepset.ai/v1.25/docs/documents_answers_labels) (just search for `haystack.schema.Answer` to see the example code), you can directly access the values by using -
````
score = answer.score
context = answer.context
````
where answer is your `haystack.schema.Answer` objec... |
Try tu use "NoPadding" :
Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding"); |
I'm using Visual Studio 2022. I wanted to resize the Output dialog to make it a bit shorter, but I accidentally misclicked and I ended up making the Output dialog windowed.
So, then I dragged the Output dialog back to Visual Studio 2022, and while it did place the Output dialog back into the window, the Output dialo... |
I need to drop a column from existing table. For that I added drop column script in **predeployment** script and removed that column from the table in the project. But dacpac is throwing an error:
> Alter table drop column failed because column xxx does not exists in the table
Understood the reason but don't know... |
This is what my compiler says:
<source>: In function 'int myFun()':
<source>:5:12: error: 'x' was not declared in this scope
5 | return x*2;
| ^
Nothing more. And gcc is correct. You cannot use `x` before it has been declared. C++ code is parsed top to bottom (templates... |
I have created a repository to demonstrate how it's done within the gRPC context: [https://github.com/alfreddohnani/nestjs-grpc-interceptor][1]. Take note that in the context of NestJS, when working with gRPC, accessing the ServerUnaryCall object directly within an interceptor is not straightforward due to the way Nest... |
**Here is a recent solution of mine, I am using angular 16.**
::ng-deep .mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label {
top: 50% !important;
font-size: 14px !important;
}
::ng-deep .mat-mdc-text-field-wrapper.mdc-tex... |
My application is based on 2 GCP cloud functions which consume messages from different topics.
The first cloud function consumes a message from the 1st topic about object creation.
The second cloud function consumes a message from the 2nd topic about the status change of THE OBJECT which has been created in the co... |
GCP Pub Sub topics |
|python|google-cloud-platform|google-cloud-functions|google-cloud-pubsub|dead-letter| |
null |
{"OriginalQuestionIds":[14046838],"Voters":[{"Id":5389997,"DisplayName":"Shadow","BindingReason":{"GoldTagBadge":"mysql"}}]} |
this is my react app screenshot. and this is my context project in AppContext,jsx file. this file handel all variables and methods in my app so I don't send you other components source code because you dont need it. I want when I click at add button the cart add with income state. you can see I did it successfully and ... |
I have a problem with script when trying to run flow in power automate. It was working in last week but now for some reason is not working and returning this error
{
"error": {
"code": 502,
"source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net",
"clientRequestId": "80fc1432-3104-42df-b926-6e57... |
Is there any function that can be in place of line 11? |
|vba| |
null |
Issue was that the newest version of operatorsdk was not using the newest version of fabric8. After changing my dependency version of crd generator to 6.9.2 as is in the dependency tree for operator SDK, the code runs flawlessly. |
Im try to get daily ATR for last 5 days. Code work perfect on D1 but take another result on lower timeframes. Why? Seems like [dh, dl] on lower TF contains only current day info
```
[dh,dl] = request.security(syminfo.tickerid, "D", [high,low], lookahead=barmerge.lookahead_on)
if barstate.isrealtime
log.info... |
Try {
Process p = Runtime.getRuntime().exec("C:\\ProgramFiles(x86)\\Skype\\Phone\\Skype");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Becuase i think it doesn't allow for spaces, i know I'm a lit... |
How do i return an array to display from backwards |
|java|logic|explain| |
null |
Set background image dynamically with a `data-` attribute and then apply the value of that attribute to `background-image` in your (S)CSS.
example.component.html: <br>
<div class="element" [attr.data-background-url]="backgroundImageUrl"></div>
example.component.scss: <br>
.element {
backgr... |
I have deployed our website as a Cloud Run service.
Added a Global external load balancer as per the doc listed in this link [here][1]
Everything is perfect and My website is now runnings as `https://example.com`
I am currently exploring redirecting `www.example.com` to `https://example.com` .
Tried adding ... |
GCP Global External Load balance redirect www to non www sites |
|networking|gcp-load-balancer| |
how to count days elpased between each interval using mySQL? |
I'm using DRF (+ corsheaders) *port 8000*, React *port 3000* and on VPS nginx. All start in terminal manually.
Without SSL all works ok.
After I add SSL certificate to my project on ubuntu VPS, I start to receive next error message after any request - "Cross-Origin Request Blocked: The Same Origin Policy disallow... |
Recently I updated our build server's VS2019 buildtools to VS2022 BuildTools. But i do not see the latest VS2022 buildtools in the System capabilities of the Azure devops Agents. I tried updating the agents, restarting the services, re-configuring the agents nothing seems to work. I even restarted the onprem build serv... |
Try to load your image without the public in the file path as below.
`<Image src={'/icons/handshake_icon.png'} alt={props.topicName} fill={true} />`
Files inside the public can then be referenced by your code starting from the base URL (/)
For example, the file public/avatars/me.png can be viewed by visiting t... |
I think that the issue might be related to the path you're using to access the audio file.....
You have to ake sure the file path to your audio file is correct. You're currently using ./ex.ogg. This means the program is looking for ex.ogg in the current working directory. Double-check that ex.ogg exists in the same ... |
Adding a more modern answer to this question: The problem with other answers is that the machine that downloads the dependencies needs to be in a sense "clean" to get all dependencies. Enter docker!
- Connect the removeable storage device and note its mounted path `/mnt/store`
- Begin an interactive docker ... |
I have a legacy web application in .NET 4.8 (VB). I need to add secret file and read value from it.
In web.config and I added the following:
<configuration>
<configSections>
<section name="configBuilders"
type="System.Configuration.ConfigurationBuildersSection,
... |
I'm trying to upload a largefile.zip to my OneDrive using the API, but it's not working and it returns 'Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space.' Only the upload session is successful, and uploading the bytes to the upload session is not working.
```
@RequestMapping(... |
OneDrive API Upload Large File |
|javascript|onedrive|heap| |
null |
Just make a storage key unique. For example include a topic or replied comment id in it:
```
localStorage.setItem(`reply-to-${topic.id}`, comment.text);
``` |
I am currently using Quart in conjunction with [Quart_Sessions ](https://pypi.org/project/Quart-Session/)as session management for login etc.
I have the problem that sometimes all keys in the Redis database are simply deleted and 4 backups (`"backup1", "backup2", "backup3", "backup4"`) are created instead. This alw... |
Quart_Sessions Redis deletes keys and create backups instead |
|python|session|redis|quart| |
null |
|awk| |
I want to automate the login on Google using an AWS Lambda function, but I have hit a stone wall. I would appreciate it if someone could help me with either of these issues:
1º) Deploying undetected-chromedriver on AWS Lambda: After familiarizing myself with the framework and successfully running my code locally, I ... |
null |
Try {
Process p = Runtime.getRuntime().exec("C:\\ProgramFiles(x86)\\Skype\\Phone\\Skype");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Because I think it doesn't allow for spaces, I know I'm a little bit late but it might help people... |
You could use the `rbindlist` function from the `data.table` package like this:
``` r
library(data.table)
rbindlist(sam, fill = TRUE)
#> symbol name price changesPercentage change dayLow
#> <char> <char> <num> <num> <num> <num>
#> 1: COUNCODO... |
null |
`I have a curl command (see below) , currently i have one job in my pipeline and when i execute the curl command below, it runs my pipeline and executes my only job, i.e test-job1. now i have added test-job2. I will have more jobs in there , but i want to be able to configure the jobs such that , i can pick and choose ... |
After booting my predator helios 300 to linux mint OS, I am unable to access my both the fans. How can I access them, as my system is heating up like crazy?
I used fancontrol module, but it is throwing error as: pwm sensors not found. Now I am stuck,
I want to access my fans; how to do this? |
access fan and it's speed, in linux mint on acer predator helios 300 |
|gpu|cpu|sensors|pwm|overheating| |
null |
{"Voters":[{"Id":349130,"DisplayName":"Dr. Snoopy"},{"Id":535275,"DisplayName":"Scott Hunter"},{"Id":874188,"DisplayName":"tripleee"}]} |
I'm analyzing a schedule of database transactions to identify potential anomalies such as lost updates, non-repeatable reads, and dirty reads. Below is the schedule represented in a tabular format, with transactions (T1 through T5) and their respective operations on resources X and Q.
Operations are denoted as foll... |
How to Identify Specific Transaction Anomalies in a Given Schedule? |
|database|concurrency|transactions|isolation-level|data-anomalies| |
i have a table looking like this
Condition downsampling E. coli S. cerevisiae
Treated 45000000 1 0.944968385
Treated 40000000 1 0.932060195
Treated 32000000 1 0.900323585
Treated 16000000 0.99999549 0.73127366
Treated 8000000 0.99993898 0.503170515
Treated 4000000 0.99892133 0.30287704
Treated 2000000 ... |
Can anyone please help me how to solve this problem
TypeError: Cannot read property 'card' of undefined
This error is located at:
in DrawerViewBase (created by DrawerView)
in RNGestureHandlerRootView (created by GestureHandlerRootView)
in GestureHandlerRootView (created by DrawerView)
in RCTVi... |
TypeError: Cannot read property 'card' of undefined |
|react-native|react-navigation|drawer|react-native-gesture-handler| |
null |
I have deployed our website as a Cloud Run service.
Added a Global external load balancer as per the doc listed in this link [here][1]
Everything is perfect and My website is now runnings as `https://example.com`
I am currently exploring redirecting `www.example.com` to `https://example.com` .
Tried adding ... |
{"Voters":[{"Id":13302,"DisplayName":"marc_s"},{"Id":266304,"DisplayName":"Alex Poole"},{"Id":409172,"DisplayName":"Jon Heller"}],"SiteSpecificCloseReasonIds":[11]} |
I'm encountering a challenge with implementing a text-shadow effect. I'm trying to achieve to get like below image:
[![enter image description here][1]][1]
Problem:
- When I set the text color to white, the text-shadow effect is not visually appealing. The shadow effect doesn't stand out against the white, re... |
I resolved my issue. I couldn't find the required version on the official website link, so I downloaded an older version. With the bundle version `hudi-flink1.14-bundle-0.14.1.jar`, the error disappeared. |
Why are encrypted stored procedures taking a long time to execute in SQL Server 2022?
Is there any specific settings or configuration at server level?
Our large procedures are working fine in SQL Server 2019 with encryption. But in SQL Server 2022 It's taking a very long time to execute.
Need some setting or c... |
Why is an encrypted stored procedures taking a long time to execute in SQL Server 2022? |
|sql-server|encryption|procedure|sql-server-2022| |
When using coroutines, why can't network work be done on the main thread? (Android)
Ans: coroutine can be used on main thread for network call, but network call may take more time because of multiple reasons, and for that time the main thread is blocked.
and because main thread is responsible for rendering UI , i... |
I am learning api development with php now. While experimenting the password hashing i came up with a problem. **Initally i used bcrypt algorithm, it successfully works.** but when i tried **Argon2i or Argon2id it not works**.
```
public function test_hash() {
if(isset($this->_request['pass'])) {
... |
Argon2i password hash algorithm is not working in php? |
|php|bcrypt|blowfish|php-password-hash|argon2-ffi| |
null |
> Is it possible to define its target in a way that optional ones such as `FailMessage` are ONLY applicable to property level for a class that I will be decorating it with and `LearnAttribute` itself only applicable to class level?
No. You can define target only for the attribute class itself so all it's correspondi... |
how to run particular jobs in gitlab ci/cd via gitlab api? |
|python|gitlab|gitlab-ci| |
You cannot simply take the waveform data and render all data points, this is terribly inefficient.
Variable explanation:
- **width**: Draw area width in pixels, max is screen width
- **height**: Same as width but then height of draw area
- **spp**: Samples per pixel, this is your zoom level
- **resolut... |
Just putting variables in the dependency array is not enough.
`useEffect` is only executed when the component renders. Here the value in `token` will change, but that change will not trigger a rerender, since it is not part of the components state, or parent state.
For `useEffect` to notice a change the component... |
Am trying to make the text align center but it doens't work as I expected.
Expected output: https://imgur.com/5HU7TBv.jpg (photoshop)
My output: https://i.imgur.com/2jpgNr6.png (python code)
```py
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from PIL import ImageEnhance
# Op... |
I'm sorry for the inconvenience, and thanks to @Harris.
Here's the solution:
BelongsTo::make('ShipmentSentDate', 'shipmentSentDate')
->displayUsing(function ($shipmentSentDate) {
return Carbon::now()->format('Y-m-d');
}),
Thank you |
welcome everybody
I am doing a student attendance project
I record attendance in a table in the database
But I want to make a Monthly attendance report
I found a Stored Procedure to do that
table
CREATE TABLE Attend
(
NAME VARCHAR(50),
DATE DATETIME ,
PRESENT_STATUS VARCHA... |
How to create a 4 curves graph in R with a multi factor table? |
|r|ggplot2|charts| |