on-internet

Spring Boot + Spring Security + Spring Rest Issue: 'Access Denied' error

I created a Spring Boot application from the Spring initializer, included no dependencies at all. Then I imported this application into STS-4.4.2. I created a rest controller and added a single POST method. My controller class is below: import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; @RestContr

Join the discussion →

Connection to daemon was invalidated

My app is using Firebase Analytics and I believe starting in iOS 13.2 started getting the errors described here: Why I get the console warning: [Process] kill() returned unexpected error 1 when I load a WKWebView in iOS13.2? I guess it wasn't a big deal Since I planned for my app to go live in January, I began bigger tests in physical devices. I noticed after a while the app started to behave erratically, specially after receiving a [general] Connection to daemon was invalidated error. This doesn't occur in the simulator Searching the internet I found a post that describes the same problem: ht

Join the discussion →

Command 'python' not found after creating conda environment

I am running Ubuntu 19.10 on my laptop, I recently installed miniconda3. No problems this far, but after creating an environment with python 2.7 I get the following message every time I open a terminal: Command 'python' not found, but can be installed with: sudo apt install python3 # version 3.7.5-1, or sudo apt install python # version 2.7.17-1 sudo apt install python-minimal # version 2.7.17-1 So I followed the advise and installed python, then this error occured: Traceback (most recent call last): File "<stdin>", line 3, in <module> ImportError: No module named conda My guess is that bash i

Join the discussion →

How to fix chunk load failure?

I am trying to make a web application using Vue and Monaco Editor for the frontend and Asp.Net Core 3 on the backend. I am also using webpack since I'm using Vue single page components. I am new to webpack, and don't understand all its functionality. Anyway, webpack splits the build into several files (chunks it seems). However, when loading the web page I keep getting the error Uncaught (in promise) ChunkLoadError: Loading chunk 2 failed. I tried to googling the answer, but nothing I have done has worked so far. Here are my package.json and webpack.config.json. Package.json { "name": "parvis"

Join the discussion →

How to display an error message if email and password is not valid in firebase flutter?

I have developed a login page. If the email and password matches from the database, it should successfully log in and move to the new page, but if it's wrong I want to display an error message: "email or password doesn't match". Here's my code: class _AdminLoginState extends State<AdminLogin> { String _username, _password; TextEditingController _email = TextEditingController(); final GlobalKey<FormState> _formkey = GlobalKey<FormState>(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('LOGIN'), backgroundColor: Colors.indigo[900], ), body: SingleChi

Join the discussion →

How to make an Object property of a C# class optional?

I am trying to make a class in C# in which I require the object and list properties as optional: public class Customer { [JsonProperty("Custid")] public string CustId { get; set; } [JsonProperty("CustName")] public string CustName { get; set; } } public class Store { [JsonProperty("id")] public string Id { get; set; } [JsonProperty("Name")] public string? Name { get; set; } [JsonProperty("Customer")] public List<Customer>? Customers{ get; set; } *//Error 1* [JsonProperty("OtherProperty")] public object? OtherProperty{ get; set; } *//Error 2* } The above code is giving these errors: Error 1: Th

Join the discussion →

How to list all delta tables in Databricks Azure?

I have saved one dataframe in my delta lake, below is the command: df2.write.format("delta").mode("overwrite").partitionBy("updated_date").save("/delta/userdata/") Also I can load and see the delta lake /userdata: dfres=spark.read.format("delta").load("/delta/userdata") but here , I have one doubt like when I am moving several parquet files from blob to delta lake creating dataframe, then how some one else would know which file I have moved and how he can work on those delta, is there any command to list all the dataframes in delta lake in databricks?

Join the discussion →

AWS IAM - best way to revoke temporary credentials for service linked roles-ec2 service linked role

Any advice on best option for revoking temp credentials issued for ec2 service linked role. I can prefrom a revoke session fro console/api but this revoke all temp creds for the role, is it possible to revoke cred for service link role for EC2 or is the some other way via policies that I can revoke or reduce permissions. I also have this problem for cross-account-role it do not seem to be able to revoke the temp creds by session as above I only have the option to revoke all session for entities that have assumed the role. For instance if I have a user that has assumed a role (I deem the activi

Join the discussion →

Create a search bar with multiple columns in codeigniter

Controller: public function search_products_auto(){ $this->load->helper(array('form', 'url','common')); $this->load->library(array('session','pagination')); $this->load->model('homemodel','',TRUE); $this->homemodel->search_products_auto(); } public function search($subcategory=''){ $this->load->helper(array('form', 'url','common')); $this->load->library(array('session','pagination')); $this->load->model('homemodel','',TRUE); $search_name=$this->input->post("title"); // first get search character $data['records']=$this->homemodel->search($search_name,$_GET); // SearchModel is the model class na

Join the discussion →

How to call a REST based API from Databricks using pyspark?

I want to call a REST based microservice URL using GET/POST method and display the API response in Databricks using pyspark. Currently I am able to achieve both using python. Here is my python script for POST method: import requests as req import json input_data = {'A': 1, 'B': 2} url = 'http://myurl/v1/post' input_headers={ "Content-Type": "application/json", "header1":"value1", "header2":"value2, "header3":"value3" } resp = req.post (url,headers=input_headers, data=json.dumps(input_data)) print(resp.text) And my script for GET method: import requests as req url = 'http://myurl/v1/get' resp=

Join the discussion →

Wordpress : Allow zip files in media to upload

I need to upload .zip file to media. Here I tried https://wordpress.stackexchange.com/questions/57603/is-it-possible-to-allow-zip-files-to-be-uploaded-in-wordpress add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes ( $existing_mimes=array() ) { // add your extension to the mimes array as below $existing_mimes['zip'] = 'application/zip'; $existing_mimes['gz'] = 'application/x-gzip'; return $existing_mimes; } But it is not working in Wordpress 5+ or gutenburg editor

Join the discussion →

error while attempting to bind on address ('0.0.0.0' 443) permission denied aws

I'm trying to start a telegram bot on an aws unix server. Following the example in the api of pyTelegramBotApi I am setting up webhook with aiohttp. I have no problems generating the ssl certificate and the private key but I have problems in receiving connections. On aws in the security groups section I opened the ports http 80 and https 443, both with anyware 0.0.0.0/0 but when I start the program it always returns the error in the image, both with port 80 and 443, how to solve? Error Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/base_events.py", line 1062, in create_ser

Join the discussion →

Why memory reordering is not a problem on single core/processor machines?

Consider the following example taken from Wikipedia, slightly adapted, where the steps of the program correspond to individual processor instructions: x = 0; f = 0; Thread #1: while (f == 0); print x; Thread #2: x = 42; f = 1; I'm aware that the print statement might print different values (42 or 0) when the threads are running on two different physical cores/processors due to the out-of-order execution. However I don't understand why this is not a problem on a single core machine, with those two threads running on the same core (through preemption). According to Wikipedia: When a program runs

Join the discussion →

PowerBI MicrosoftAzureConsumptionInsights - changing query to get more than 2 months

I am using PowerBI to analyze Cost data from Azure. I am making a direct connection and pulling in data by: opening PowerBI | Get Data | Online Services | Microsoft Azure Consumption Insights (Beta) This works, however, I am only able to see two months of data and ideally I'd like to see 6. After a lot of searching the general consensus from other users seems to be using the advanced editor to tweak the query by adding "optionalParameters" and specifying the number of months... I came across a few other sites where users were experiencing the same issue but the suggestions didn't work. I am ho

Join the discussion →

Custom CSS property "background-color" not working

I've been trying to use CSS variables recently in a very simple code. It actually did not work. I double checked the information I found about how to use variables but I can't find my mistake. Maybe I am doing something wrong? :root { --my-color: red; } body { background-color: var(--my-color); } <!DOCTYPE html> <html> <head> <title>My title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="./style/mainPage.css"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bo

Join the discussion →

Obter valor y id de un button en html y pasarlo a variable PHP

Tengo una tabla que lleno con una consulta a mi base de datos, pero como son varias columnas solo muestro algunas, agrego un boton para abrir una especie de formulario que muestre todo el registro completo, esto lo intento hacer guardando el id del registro en el id del boton para posteriormente hacer una nueva consulta con el id especificado. Aqui es donde no logro hacer la consulta, por que no eh encontrado como enviar el id del boton presionado a php. La pregunta es como puedo hacer eso.? Esta seria mi tabla. <?php while($mostrar=mysqli_fetch_array($result)){ ?> <tr> <td><?php echo $mostrar

Join the discussion →

React-Native-Video how to pause the video when video not in full screen or off the screen

i am making a Android video gallery app like YouTube using React-Native for that i am using 'react-native-video' , package While using it i had a problem with video auto-play option all videos are playing at a time in the background without viewing the videos and another problem is all videos controls={true} are showing when scrolling the video and they are not moving along with videos.I am doing all this inside FlatList My code : import React, { Component, PropTypes } from "react"; import { AppRegistry, Image, Platform, StyleSheet, Text, View, TextInput, Button, TouchableHighlight, Alert, Tou

Join the discussion →

Structured array from individual field arrays (python, numpy)

I would like to make an structured array data like dtype_test = [ ('a', np.int16), ('b', np.int16), ] data = np.array( [(1, 2), (3, 4), (5, 6)], dtype=dtype_test) However, I only have individual fields array; (1,3,5) and (2,4,6). In other words, I have data data['a'] and data['b'] already made. How can I directly make data from these individual arrays?

Join the discussion →

How to import all modules in __init__.py in python?

I have a directory that contains several .py files/modules. In that directory, I put __init__.py within with an intent to make it a package. What I would like to have is, when I import the directory, I would access all the methods from individual modules without specifying each module name inside __init__.py. This means, when I would add a new module, __init__.py would pick it up and I am free off manual update of that module name inside of __init__.py. Here is an example to show what I want: /my_package/ module1.py module2.py .......... .......... moduleN.py Now, within module1.py, I have def

Join the discussion →

If I could sense magnetic north, could I sense magnetic south?

In a world I am helping build there is a certain group of people with the ability to produce electricity from their bodies (and control it, I believe), an additional power I gave them was the ability to sense magnetic north. My assumption was basically "if compasses can sense magnetic north, there is probably a way for a creature to do it.). I do not know the nature of magnetic fields, but since I want these people to be seafarers, my desire is to place magnetic north and magnetic south off-kilter like it is on earth. My hope is to make it where, if they can sense the direction of magnetic nor

Join the discussion →

Android carrier app e-sim activation code usage

I am trying to develop a carrier app decribed here https://source.android.com/devices/tech/connect/esim-overview#making_a_carrier_app Saying I have something like this (scanned QR code): LPA:1$sm-v4-009-pla-gtm.pr.go-esim.com#<activation code> I am wonder if below cases are true: activation code needs to always contain embedded encoded certificate user can use this code by the carrier app itself or by just navigating to settings and scan the QR code (this QR code should contain embedded encoded certificate in activation code. It is not possible to use such QR code without embedded encoded cert

Join the discussion →

TLS handshake failed with error tls: first record does not look like a TLS handshake server=Orderer remoteaddress=192.168.144.4:43496

I am building my network with 5 orderers, 1 org and 2 peers. Also 1 cli and 1 ca. I scaled from 1 orderer to 5 implementing Raft. This is why I want to extend my network and do deeper tests on what happens with multiple peers. The docker are running but I get some errors regarding TLS inside my orderer containers: TLS handshake failed with error tls: first record does not look like a TLS handshake server=Orderer remoteaddress=192.168.144.4:43496 I don't understand where is the problem, because I setted up everything to implement Raft, from the crypto material to the docker compose file. Here i

Join the discussion →

How do you generate an image where each pixel is a random color in python

I'm trying to make an image with a random color for each pixel then open a window to see the image. import PIL, random import matplotlib.pyplot as plt import os.path import PIL.ImageDraw from PIL import Image, ImageDraw, ImageFilter im = Image.new("RGB", (300,300)) for r in range(0,300): for c in range(0,300): re = random.randint(0, 255) gr = random.randint(0, 255) bl = random.randint(0, 255) im[r][c]=[re,gr,bl] im.show() 14 bl = random.randint(0, 255) ---> 15 im[r][c]=[re,gr,bl] 16 im.show() TypeError: 'Image' object does not support indexing

Join the discussion →

Text and Image together in a Flutter Card

I want to add an image and a text together in a card but I'm not able to do it. I think a row would be used here but not able to implement it. I'm new to flutter and app development so having some troubles. Any help is really appreciated. Also the cards are in GridView(not in ListView). import 'package:flutter/material.dart'; import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; import 'lists.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Just Another App', home: Home(), rou

Join the discussion →

Using SignInManager in server-side Blazor

Is it possible to use SignInManager without having some HTTPContext ? I'm making a Blazor server-side app and I need to make end-users signed in using PasswordSignInAsync() method of SignInManager. If there is other ways to do it with cookies or something else, I'll take it too, as long they are "clean" methods. If I could get also an explanation on how to configure for Startup.cs the solution, it will be perfect.

Join the discussion →

How to use the current date/time in an API call?

I have a test that makes an API call, and a required part of the body that I'm passing in is a timestamp. The whole test is working except for this last piece (if I manually set the date/time before each test execution the test succeeds). I have been trying to set a variable like this: const todaysDate = Cypress.moment().format('YYYY-MM-DDTHH:MM:SS-07:00'); but I cannot figure out how to use this in the API call. The API parameter is formatted as such: "offDateTime": "YYYY-MM-DDTHH:MM:SS-07:00" Can anyone help me out?

Join the discussion →

Javascript Canvas Uncaught TypeError: document.getContext is not a function

I am trying to draw a simple canvas but my browser shows an error, I am doing this by a tutorial and wondering where the mistake is. Thanks in advance <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>doc</title> <link rel="stylesheet" href="style.css"> </head> <body> <canvas id="c1"></canvas> <script src="js.js"></script> </body> </html> var canvas = document.getElementById('c1'); var ctx = document.getContext('2d'); ctx.fillRect(100,50,150,75);

Join the discussion →
Older stories