on-internet

How to push and pull docker images from Gitlab with access token

I am trying to push an image to a gitlab registry with two factor authentication. It gives me this error message: unauthorized: HTTP Basic: Access denied\nYou must use a personal access token with 'api' scope for Git over HTTP I tried to use this command to login but it still says access denied: docker login https://registry.gitlab.com/my_registry -u my_user_name -p my_public_key What am I doing wrong? How can I push and pull images with the public key?

Join the discussion →

How to create by an iterative method a series of boxplots with statistics annotations

I've fitted the following model models_list_1 <- dataset_long %>% group_by(FEATURE) %>% do( fit = lmerTest::lmer( RESPONSE ~ TREATMENT * SESSION + (1 | SUBJECT), data = . ) ) %>% pull(fit) %>% lapply( function(x) summary(x)$coefficients ) %>% setNames( unique(dataset_long$FEATURE) ) and extracted the pairwise stastistics as follows md <- dataset_long %>% group_by(FEATURE) %>% do( fit = lmerTest::lmer( RESPONSE ~ TREATMENT * SESSION + (1 | SUBJECT), data = . ) ) %>% pull(fit) %>% lapply( function(m) lsmeans( m, pairwise ~ TREATMENT * SESSION, adjust = "tukey" ) ) If I would like to reprocude it

Join the discussion →

eslint-loader - TypeError: eslint.CLIEngine is not a constructor

I'm starting a new VueJS project in WebStorm. I've created a new VueJS project, upgraded NPM, added Vuetify and after starting the server, it raises this error: ERROR Failed to compile with 1 errors 11:34:19 AM Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js): TypeError: eslint.CLIEngine is not a constructor at Object.module.exports (/home/milano/WebstormProjects/xxx/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:223:27) How can I fix this? Should I downgrade eslint?

Join the discussion →

How to call external api with Azure function with POST method with request body data

using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using System.Net; using System.IO; namespace FunctionRestApi { public static class Function1 { [FunctionName("Function1")] public static IActionResult Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, ILogger log) { var httpWebRequest = (HttpWebRequest)WebRequest.Create("URL_with_client_id_authorization_token"); httpWebRequest.ContentType = "ap

Join the discussion →

Why can't the linker find 'absl' references?

Why can't linker find 'absl' references? Configuration: Raspberry Pi 4 Model B (AArch64) Ubuntu Server 20.04 Clang++ (LLVM 13.0.0) gRPC v1.41.1 (libprotoc 3.17.3) I installed gRPC with these options: cmake -DgRPC_INSTALL=ON -DCMAKE_BUILD_TYPE=Release -DgRPC_ABSL_PROVIDER=module -DgRPC_CARES_PROVIDER=module -DgRPC_PROTOBUF_PROVIDER=module -DgRPC_RE2_PROVIDER=module -DgRPC_SSL_PROVIDER=module -DgRPC_ZLIB_PROVIDER=module -j4 ../ sudo make install Command: clang++ -std=c++17 -iquote /home/ubuntu/gameserver/server/include -include /usr/local/include/grpcpp/support/method_handler.h -L /usr/local/lib

Join the discussion →

How do I link and compile Raylib on windows?

I have installed the raylib migw from the official source. The installation directory is C:\raylib\raylib. I have written the sample program from the website as follows. #include "raylib.h" int main(void){ const int screenWidth = 800; const int screenHeight = 600; InitWindow(screenWidth, screenHeight, "raylib basic window test"); SetTargetFPS(60); while(!WindowShouldClose()){ BeginDrawing(); ClearBackground(RAYWHITE); DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); EndDrawing(); } CloseWindow(); return 0; } I have compiled it using gcc main.c -I C:\raylib\raylib\

Join the discussion →

How can I separate all the numbers from a string as indicated?

I'm writing code for a bigger program but I'm stuck on the following issue: The input for my program is a string such as s="cycling;time:1,49;distance:2". I want the program to only return the numbers in the provided string. I have tried doing it like this: def getDigits(s): answer = [] for char in s: if char.isdigit(): answer.append(char) return ''.join(answer) print(getDigits(s="cycling;time:1,49;distance:2")) The output prints out 1492, but I want the numbers to be printed separately. I want my program to print out 1,49 separately from 2 because 1,49 is the cycling time while 2 is the dista

Join the discussion →

PHP Warning: Undefined array key when processing form array inputs

I am practicing with PHP arrays and forms. When running my code, I get the following warning: Warning: Undefined array key 3 in php Even though the output still prints, I would like to understand why this warning occurs. Here is the HTML form (Q4.php): <!DOCTYPE html> <html> <head><title>Number of Students</title></head> <body> <form action="Q4.php"> <table> <tr> <td>Number of Students:</td> <td><input type="text" name="num" size="5"></td> <td><input type="submit" value="Submit"></td> </tr> </table> </form> </body> </html> Here is the second PHP form (Q4index.php): <!DOCTYPE html> <html> <head

Join the discussion →

npm run Lifecycle scripts included in project: test echo "Error: no test specified" && exit 1

I am trying to develop a springboot/react app and have installed react and created the react project. However when I try to execute: npm run I get the following error: Lifecycle scripts included in project: test echo "Error: no test specified" && exit 1 I also installed jest I believe and when I go to package.json: I have changed the test: to "jest" "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "jest", "eject": "react-scripts eject" } I also tried when it was just "react-scripts test" and that gave me the same error. Any help would be greatly appreciated,

Join the discussion →

Visual Studio 2019 - No Android SDK instance matching the path Android component "tools" is obsolete, please install "cmdline-tools"

I'm using Xamarin on Visual Studio 2019 for a project. But, recently I'm facing issue as - No Android SDK instance matching the 'C:\Program Files (x86)\Android\android-sdk' path Android component "tools" is obsolete, please install "cmdline-tools" Trying to fallback to "tools"... File 'C:\Program Files (x86)\Android\android-sdk\cmdline-tools\android.bat' not found for 'Android SDK Core' File 'C:\Program Files (x86)\Android\android-sdk\cmdline-tools\mksdcard.exe' not found for 'Android SDK Core' File 'C:\Program Files (x86)\Android\android-sdk\cmdline-tools\emulator.exe' not found for 'Android

Join the discussion →

Laravel 5.8 - Timezone environment variable

I have a problem where I can't seem to make Laravel pick up the system wide APP_TIMEZONE env variable, I am not sure if using php-fpm affects that. When I add it to the .env the DateTime are correctly set using the timezone When I remove it, DateTime now uses UTC from Laravel app.php default ('timezone' => env('APP_TIMEZONE', 'UTC')) When I remove it, add APP_TIMEZONE to /etc/environment, reboot, printenv returns the right variable so does Tinker (but I think it's using the CLI and not the FPM process) and instantiating a date in Tinker shows the correct timezone, however running my app show d

Join the discussion →

git 'unmerged paths' - resolve strategy needed

was working on a featurebranch (spun off from main) for some while, commited it and want to merge it back to main. Unlike expected I get: error: Merging is not possible because you have unmerged files. hint: Fix them up in the work tree, and then use 'git add/rm <file>' hint: as appropriate to mark resolution and make a commit. fatal: Exiting because of an unresolved conflict. git status shows quite a lot of uncomitted files (which comes as a suprise to me to some extend) the entire message is here: user@hostname:~/path/to/repo> git merge feature_branch-2 error: Merging is not possible because

Join the discussion →

Value at 'body' failed to satisfy constraint: Member must not be null

I'm trying to run a prediction using a sagemaker endpoint. The input format is comma separated features and | separated observations. However when I try to iterate over the input data and invoke the end point on every iteration like this : ENDPOINT_NAME = "my_endpoint" runtime= boto3.client('runtime.sagemaker') results = [] for r in request_body.split('|'): response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME, ContentType='text/csv', Body=r) result = json.loads(response['Body'].read().decode()) results.append(result) I get the following error: ValidationError: an error occurred (Valid

Join the discussion →

Why do I get /usr/bin/python: No module named pip

When I do python -m pip install 'uwsgi==2.0.*' I'm getting: /usr/bin/python: No module named pip which pip gives: /home/snowcrash/.local/bin/pip If I do pip I get: pip Traceback (most recent call last): File "/home/snowcrash/.local/bin/pip", line 5, in <module> from pip._internal.cli.main import main ImportError: No module named pip._internal.cli.main This does not seem to help /usr/local/bin/python: No module named pip

Join the discussion →

Serving android APK files for installation, application/vnd.android.package-archive parse error

I am looking to enable download and installation of an android application package (APK) from my own server through a browser download. This appears to be blocked in the latest versions of android with the cryptic "There was a problem parsing the package" message. In the past (I forget which version of android) this worked just fine. Need help making it work in Android 11. Here is the header content used to serve the file: header('Content-Description: File Transfer'); header('Content-Type: application/vnd.android.package-archive'); header("Content-Disposition: attachment; filename=\"".$filenam

Join the discussion →

Pytest: Patch a global variable

How do you patch a variable with mock or pytest-mock. Assume the variable is defined in another python script and is used by many other scripts. I would like to mock it within pytest_cmdline_main so that all the scripts using that variable will be mocked accordingly. A quick example will be in env.py VAR = "something" in conftest.py import os import sys from unittest.mock import patch TEST_DIR = os.path.dirname(os.path.realpath(__file__)) class MockThings(): def __init__(self): self.setup() def setup(self): mock_var = patch('env.VAR').start() mock_var.return_value = "updated" def pytest_cmdlin

Join the discussion →

How to report REPEATED MEASURES ANOVA output in tables on a word text file?

I would like to export tables for the following result for a repeated measure anova: Here the function which ANOVA test has been implemented fAddANOVA = function(data) data %>% ezANOVA(dv = .(value), wid = .(ID), within = .(COND)) %>% as_tibble() aov_stats <- df_join %>% dplyr::group_by(signals) %>% dplyr::mutate(anova_output = purrr::map(readings, ~fAddANOVA(.x))) %>% dplyr::select(-readings) %>% tidyr::unnest(anova_output) And here the commands to explore ANOVA statistics print(aov_stats) # A tibble: 12 × 4 # Groups: signals [12] signals ANOVA$Effect $DFn $DFd $F $p $`p<.05` $ges `Mauchly's

Join the discussion →

How to mount a NFS file share inside a Windows Docker Container

I am running Docker on a Windows Server 2022. I need to start a Windows Container - must be a windows container because I am porting a Net Framework App that cannot run on Linux. My Windows Container needs to write uploaded files to a network share. I have read lots of discussion, but I could only find example on Linux containers. Currently I am trying using a Docker Compose file. This is the compose file: version: "3.9" services: web: image: misterpanel ports: - "80:80" volumes: - misterpanel_images:/inetpub/wwwroot/Img volumes: misterpanel_images: driver: local driver_opts: type: cifs o: use

Join the discussion →

Unable to find method void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)

I'm unable to run any tests or run the app or debugger because of this error: `Unable to find method void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)` I've tried all of the provided solutions and hit the File > Invalidate Caches/Restart... option. This is an Android Studio project in Kotlin and Java with Jetpack Compose, Retrofit2, OkHttp3. Update: Here are my build.gradle files build.gradle Project: buildscript { ext.kotlin_version = '1.6.0-RC' ext { compose_version = '1.0.1' fragment_version = "1.3.6" } repositories { google() mavenCentral() maven { url = uri("https://

Join the discussion →

Webpack 5 Asset modules not creating images to dist folder when using handlebars-loader. How do i get it to output the images?

This is my config file, I have tried with html-loader it works fine for .html files but i’m now trying to learn and use handlebarsjs its not working the same. I've also tried using the preprocessor option for html-loader whereby i created a function to read .hbs files but I keep getting errors. const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/index.js', plugins: [ new HtmlWebpackPlugin({ title: 'Output Management', template: './src/index.hbs' }), ], devtool: 'inline-source-map', devServer: { static: './dist', hot: true, },

Join the discussion →

Prolog: How to create all possible combinations without repetitions

I am trying to create a predicate that finds all possible combinations without repeating same numbers. I tried using permutation predicate, but it found duplicated lists. For example: permutation([0,1,1], L). L = [0,1,1]; L = [0,1,1]; L = [1,0,1]; L = [1,1,0]; L = [1,0,1]; L = [1,1,0]; What I need: newPermutation([0,1,1], L). L = [0,1,1]; L = [1,0,1]; L = [1,1,0]; Can someone please help me with that? Thanks a lot...

Join the discussion →

How to specify the type of an implicit global variable for a JS code snippet?

I have a JavaScript file that is being run with eval() by a VSCode extension. When the script is evaluated, its context already includes the global variable vscode (the VSCode API) which I am using from my script. All of that works fine. Is there a way to use JSDoc annotations / TypeScript type definition files to tell VSCode that the vscode variable exists in the context? I have tried this (I'm not sure if it makes any sense) and it didn't help: // @ts-check /// <reference path="node_modules/@types/vscode/index.d.ts" /> What does work is if I write: const vscode = require('vscode') But I'd ra

Join the discussion →

JSDoc: How to specify the type of an implicit global variable for a JS code snippet?

I have a JavaScript file that is being run with eval() by a VSCode extension. When the script is evaluated, its context already includes the global variable vscode (the VSCode API) which I am using from my script. All of that works fine. What I want to know: Is there a way to use JSDoc annotations / TypeScript type definition files to tell VSCode that the vscode variable exists in the context? I have tried this (I'm not sure if it makes any sense) and it didn't help: // @ts-check /// <reference path="node_modules/@types/vscode/index.d.ts" /> What does work is if I write: const vscode = require

Join the discussion →

ffmpeg Flip video horizontally

anyone know can I make the video flip horizontal using batch file? here my batch file code that I have tried : @echo off ffmpeg -i "1.mp4" -vf hflip -i audio1.mp3 -map 0:v -map 1:a -c:v copy -shortest "C:\Users\Admin\Desktop\Replaced Mp3\1.mp4" pause

Join the discussion →

How can I make a discontinuous axis in R with ggplot2?

I have a dataframe (dat) with two columns 1) Month and 2) Value. I would like to highlight that the x-axis is not continuous in my boxplot by interrupting the x-axis with two angled lines on the x-axis that are empty between the angled lines. Example Data and Boxplot library(ggplot2) set.seed(321) dat <- data.frame(matrix(ncol = 2, nrow = 18)) x <- c("Month", "Value") colnames(dat) <- x dat$Month <- rep(c(1,2,3,10,11,12),3) dat$Value <- rnorm(18,20,2) ggplot(data = dat, aes(x = factor(Month), y = Value)) + geom_boxplot() + labs(x = "Month") + theme_bw() + theme(panel.grid = element_blank(), te

Join the discussion →

How can I perform principal component analysis (PCA) on a large feature set?

I am using logistic regression to train a dataset with 20,000 features and am also using PCA for dimensionality reduction. The snippet below is directly from the documentation here: https://spark.apache.org/docs/latest/mllib-dimensionality-reduction.html#principal-component-analysis-pca However, I am (understandably) getting Java Heap Space errors (both locally and when running on a GCP cluster). How can I use PCA for such a large feature set, or, what would be a better approach for dimensionality reduction? import org.apache.spark.mllib.feature.PCA import org.apache.spark.mllib.linalg.Vectors

Join the discussion →

Wallet Connect: No RPC Url available for chainId: 137

I am trying to create a WalletConnect provider. I am using the @walletconnect/web3-provider package along with Web3Modal for UI. I am instantiating the WalletConnectProvider using my Infura client ID let web3Modal = new Web3Modal({ network: "matic", cacheProvider: true, providerOptions: { walletconnect: { package: WalletConnectProvider, options: { infuraId: "c22c90a767684c5fbd7257da57802b35" , }, }, }, }); web3Modal.clearCachedProvider(); await web3Modal.connect(); When I run my app and connect my wallet, I get the following error: Error: No RPC Url available for chainId: 137 I am trying to co

Join the discussion →

Is Python's asyncio `loop.create_task(...)` threadsafe?

I have matplotlib running on the main thread with a live plot of data coming in from an external source. To handle the incoming data I have a simple UDP listener listening for packages using asyncio with the event loop running on a seperate thread. I now want to add more sources and I'd like to run their listeners on the same loop/thread as the first one. To do this I'm just passing the loop object to the classes implementing the listeners and their constructor adds a task to the loop that will initialize and run the listener. However since these classes are initialized in the main thread I'm

Join the discussion →
Older stories