instruction stringlengths 0 30k ⌀ |
|---|
> I wrote below bash Shell script to check whether the input value is a character string or a number (using Mathematical function):
> #!/bin/bash
> uniq_value=$1
> if `$(echo "$uniq_value / $uniq_value" | bc)` ; then
> echo "Given value is number"
> else
> echo "Given value is string"
> fi
> The execution res... |
Look at this:
for (i = 0; i < N; i += 8)
for (j = 0; j < M; j += 4) {
if (j == i || j == i + 4) { /* same block */
For 8x8 matrix both `N`and `M` is 8 so it's like:
for (i = 0; i < 8; i += 8)
for (j = 0; j < 8; j += 4) {
if (j == i || j == i + 4) { /* same bl... |
The thing is that I need to create a table and export it as a photo. There are some elements that I need them to be aligned to the right, but I want them to have some margin with respect to the end of the cell. What I did is to convert these numbers to a string, and then I added a blank space at the end (representing t... |
GitLab CI Pipeline Incorrectly Triggers on All Branches Despite Specific Workflow Rules |
|git|gitlab|gitlab-ci| |
I am developing a simple test web application with registration and ability to log in. I try to add a new row to the database via Postman using this POST request:
```
https://localhost:7239/api/Auth/Register
```
But I get this error:
> System.InvalidOperationException: Unable to resolve service for type 'Web... |
|c#|postgresql|asp.net-core-mvc|connection| |
I'm currently trying to deploy a nextJS 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. I'll add that this is my first nextjs project and I've never hosted a website... |
I've a execute process task which executes python Script[![enter image description here][1]][1]
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/n0qzu.png
[2]: https://i.stack.imgur.com/YDWK0.png
I want to pass root variable value in python from SSIS when I give the project param... |
How to pass a variable value in SSIS to Python Script : Execute Process task |
|python|ssis|sql-server-data-tools|ssis-2012|msbi| |
If even after having incorporated the remove icon you still can't see the remove button as happened to me, then, after having implemented all the previous recommendations, make sure that in the module of your component you have imported these four modules:
MatChipGrid,
MatChipRow,
MatChipInput,
Ma... |
You can import javascript and css files in index.html from github owl-carousel repository. |
I want to write a script for running regression models across a whole data.table, where my function fits the model and extracts information for later analysis. I have a very large number of models to fit, so I want to make this fast. I want to vectorize this function in order to do this, but have struggled as there are... |
R linear regression function vectorization |
|r|performance|vectorization|linear-regression| |
null |
denied: Unauthenticated request. Unauthenticated requests do not have permission "artifactregistry.repositories.uploadArtifacts" on resource "projects/digidoc-dev/locations/asia-south1/repositories/digidoc-art" (or it may not exist)
I tried login authentication but still failed and have granted all the permissions |
Custom .NET Core service factory with auto dispose features |
|c#|asp.net-core|.net-core|.net-5| |
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... |
|gcc|coredump|address-sanitizer| |
Is it possible to use Few Shot Learning in Retrieval Augmented Language ?
I can use the few shot separately
and create a rag with template
but I couldn't use the few shot template in Retrieval Augmented Language
```
#prompt few shot
prompt = FewShotPromptTemplate(
examples=examples,
example_prompt... |
I am struggling with a problem. I migrated my app from rails 6 + webpacker to rails 7 + jsbundling + webpack following this tutorial : https://github.com/rails/jsbundling-rails/blob/main/docs/switch_from_webpacker.md
However, I get this error "The asset 'transportation_calculator.js' is not present in the asset pipe... |
The asset xxx is not present in the asset pipeline - Rails 7 |
|ruby-on-rails-7| |
null |
Hello everybody i have a problem using NEXT's dynamic routing (Next 13)
I have this structurr
- user/
-- [id]/
--- page.js
and this is working on dev mode but not in prod.
What im trying?
Im make a "page.js" inside user folder with this config on it
export const dynamic = 'auto'
e... |
I am migrating old openssl version openssl-0.9.8i with VS-2012 to openssl-1.1.1w with VS-2017.
I am getting below error:
"..\openssl-1.1.1w\include\openssl/asn1_mac.h(10): fatal error C1189: #error: "This file is obsolete; please update your software."
In older version "asn1_mac.h" has some different content an... |
\openssl-1.1.1w\include\openssl/asn1_mac.h(10): fatal error C1189: #error: "This file is obsolete; please update your software |
|openssl| |
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... |
How to Control Visual Studio Code Extension Intellisense? |
|javascript|typescript|visual-studio-code|google-chrome-extension|vscode-extensions| |
null |
So, I'm sure this is a bit naive, but this is purely for experimental purposes and/or a learning exercise. In essence, I'd like to see if I can reduce the footprint of the closure created when we use `Task.Run(()=>Func<>())` by creating a class that I initialize only once. One, the objective would be to avoid creating ... |
(C#) Reducing Closure Overhead In Task.Run/Factory.StartNew With Predefined Object |
|c#|closures|task-parallel-library| |
null |
{"OriginalQuestionIds":[52593803],"Voters":[{"Id":476,"DisplayName":"deceze","BindingReason":{"GoldTagBadge":"python"}}]} |
> I wrote below bash Shell script to check whether the input value is a character string or a number (using Mathematical function):
> #!/bin/bash
> uniq_value=$1
> if `$(echo "$uniq_value / $uniq_value" | bc)` ; then
> echo "Given value is number"
> else
> echo "Given value is string"
> fi
> The execution res... |
jst install it will work perfectly
"npm install react-tilt react react-dom" |
`Enum` classes (with members) [are final][1], even at runtime, so there is no need to use `Self`. Use `Letter` directly:
<sub>(playground link: [Pyright][2])</sub>
```py
from enum import Enum
class Letter(Enum):
...
@property
def neighbors(self) -> list['Letter']:
match self:
case self.... |
For this to work you'll need to write a [recursive conditional type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#recursive-conditional-types) that walks through the [tuple type](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) of the input array and maps them t... |
PyTorch LSTM not using hidden layer |
|python|machine-learning|pytorch|lstm| |
ERROR in ./src/index.js 8:0-51
Module not found: Error: Can't resolve './react-router-dom' in 'C:\Users\nagendra\nagendra-website\src'
how to solve errors and what are the change?
how to solve errors and what are the change? |
Deprecation notice: ReactDOM.render is no longer supported in React 18 Fixed (React.s dom) |
|reactjs|dom| |
null |
In a Linux shell, a dollar sign `$` inside double quotes gets interpreted as a variable. Since `$1` is undefined, it gets translated into an empty string, so the double-quoted argument effectively becomes:
print if /#define\s+ELFOSABIV_LATEST\s+(\S+)/
when passed to perl, resulting in the entire line being p... |
Is there data leakage while splitting the data this way? |
it get's boring when you are always doing it with the same programming language (required by work). to make it more challenging, try to learn new programming language when you have free time. |
null |
Having a type and a property with the exact same name isn't uncommon. Yes, it looks a little weird, but renaming properties to avoid this clash looks even weirder, admittedly.
Eric Lippert had [a blog post on this exact topic](https://learn.microsoft.com/en-us/archive/blogs/ericlippert/color-color).
There is no a... |
null |
I’m fairly new to Python, so go easy on me.
I’m trying to make the following inputs appear at the same time in the console
Input(“Please enter your feet: “)
Input(“Please enter your inches: “)
Desired output:
Please enter your feet:
Please enter your inches:
At the same time for the user to enter.
... |
next/navigation Error 404 dynamic routes only in production NEXT13 |
|javascript|reactjs|next.js| |
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-css -->
.parent {
height: 100vh;
}
.copy-txt {
color: rgba(255, 255, 255, 0.5);
font-size: 10px;
text-align: center;
}
.copy-txt > a {
color: rgba(255, 255, 255, 0.5... |
The problem is that you are trying to assign the same ref for all your components. a ref needs to be assined to a single instance of a component so we can modify your code to the following
```
import React, { useRef, useEffect } from "react";
const DynamicComponent = React.forwardRef(({ name }, ref) => {
// Som... |
WSO2 MI 4.2.0
I am using Wso2 micro integrator version 4.2.0. and a rollover policy based on a time period for the log files. I'm trying to delete old rollover files with more than 58 days, meaning that I want to keep ~58 days of logs with the following configuration (as recommended on https://apim.docs.wso2.com/en/... |
Try adding another w-function to determine the next distinct order date.
```sql
WITH ranked_transactions AS (
SELECT
t.*,
DENSE_RANK() OVER (PARTITION BY t.customer_key ORDER BY t.order_date) AS order_rank
FROM transaction_records t
),
next_order_dates AS (
SELECT
custome... |
Suppose I have a workload that branches out like a tree.
I have to process `n` A items.
Processing each A item requires processing of `m` B items.
This goes on for another level or two.
And I have the following functions:
```go
func handler() {
var aList []A
var wg sync.WaitGroup
for _,... |
I need to install a self-signed SSL certificate to trusted root on the device from my uwp app code how can I achieve this? |
How to install a ssl certificate from uwp app code |
|c#|windows|security|ssl|uwp| |
You can simplify your code to a single `SELECT` (and eliminate the nested loops):
```lang-sql
DECLARE
p_nation STRING_LIST := STRING_LIST('AA', 'BB', 'CC');
p_lastrundate VARCHAR2(20) := '01-JAN-1970 00:00:00';
BEGIN
DBMS_OUTPUT.PUT_LINE('CIDGEN' || '||' || 'NATION');
FOR rec IN (
SELECT B.CIDGEN,... |
ngClass and ngStyle are actual directive need to import before using for Standalone component:
import { NgFor, NgClass } from '@angular/common';
@Component({
selector: 'app-attribute',
standalone: true,
imports: [NgFor, NgClass],
templateUrl: './attribute.component.html',
... |
There is a QLabel added to the statusbar of the main window. When setting long text, the QLabel expands and expands the window with it. It is necessary that the size of the QLabel and the window do not change, and only the text that fits is shown (as happens with a fixed size widget). The width of the QLabel cannot be ... |
QLabel: how to prevent expanding? |
|qt|qlabel|qtwidgets|qsizepolicy| |
null |
I am trying to split the data and rearrange the data in a CSV file. My data looks something like this
```none
1:100011159-T-G,CDD3-597,G,G
1:10002775-GA,CDD3-597,G,G
1:100122796-C-T,CDD3-597,T,T
1:100152282-CAAA-T,CDD3-597,C,C
1:100011159-T-G,CDD3-598,G,G
1:100152282-CAAA-T,CDD3-598,C,C
```
and I want a t... |
See this, for example: [HOW C# ARRAY INITIALIZERS WORK][1]
[1]: https://web.archive.org/web/20190719134346/http://bartdesmet.net/blogs/bart/archive/2008/08/21/how-c-array-initializers-work.aspx |
I am using Masstransit version 7.3.1 and rabbitmq to create a messaging mechanism (I am sending a message with each request the API receives) and I installed the Greenpipes library to use it later but after some monitoring I found out that Greenpipes is using a lot of CPU (see the image).
Does Masstransit use Gree... |
How many Goroutines is too many Goroutines? |
|multithreading|go|operating-system|goroutine| |
{"Voters":[{"Id":2887218,"DisplayName":"jcalz"}]} |
After the suggestion from @rcgldr I modified the solution. the solution is not really functional way of doing things but at least it runs within the specified time.
*One thing to note is that if you submit the same answer at different times of day **OR** repeatedly submit the same solution, you get different tests... |
|angular|angular-material| |
null |
I have connectionstring of my application defined in a seperate config file. While migrating to .NET8 im facing platform not supported error when trying to decrypt it. Is there any way to decrypt it in c#?
Here is my config file:
```xml
<?xml version="1.0" encoding="utf-8"?>
<connectionStrings configProtectionP... |
|c#|asp.net-core|rabbitmq|masstransit| |
I want to sort the values of this dictionary from low to high:
For example,
input:
```
average = {'ali': 7.83, 'mahdi': 13.4, 'hadi': 16.2, 'hasan': 3.57}
```
I want the output to be like this:
```
{'hasan': 3.57, 'ali': 7.83, 'mahdi': 13.4, 'hadi': 16.2}
```
I tested this method, but because my data is... |
I have a web application (4.8 Framework API) and I need to be able to test on local machine with various settings and I do not want them accidentally checked into source code repository.
For example, Web.Config would have our standard settings but my Web.Local.Config would have settings I may need to debug a client'... |
How to do a web.config transform during build for local debugging? |
|c#|.net|visual-studio|web-config| |
I'm using the apphud sdk to fetch in app purchase products. The SDK is used to purchase products in an IOS app. I use the following code
Apphud.paywallsDidLoadCallback { paywalls in
if let paywall = paywalls.first(where: { $0.identifier == "your_paywall_id" }) {
I get the following error
Cannot ... |
apphud sdk and completion handlers |
|ios|swift|in-app-purchase| |
The problem was that in my Users table in the database, the email field had a capital 'E' like 'Email.' However, Laravel by default searches for 'email' with a lowercase 'e,' and that's why.
If you don't want to modify the column's name on your database you can paste the following code on your User's model:
p... |
> I wrote below bash Shell script to check whether the input value is a character string or a number (using Mathematical function):
> #!/bin/bash
> uniq_value=$1
> if `$(echo "$uniq_value / $uniq_value" | bc)` ; then
> echo "Given value is number"
> else
> echo "Given value is string"
> fi
> The execution res... |
I don't know if I did it right, but I found a solution to make it work the way I want. Based on the answer here https://stackoverflow.com/a/67083089/21533506 I added the following code:
```
add_filter( 'woocommerce_package_rates', 'disable_shipping_method_based_on_location', 10, 2 );
function disable_shipping_... |
Geeting error while i push image to gcp artifact repo |
|docker|image|google-cloud-platform|artifact| |
null |
I am working on a virtualised data grid for my application.
I use transform: translateY for the table offset on scroll to make table virtualised.
I developed all the functionality in React 17 project, but when migrated to React 18 I found that the data grid behaviour changed for the worse - the data grid started to b... |
{"Voters":[{"Id":18839983,"DisplayName":"Thanasis Mp"}],"DeleteType":1} |