Posts

Showing posts from September 3, 2018

page not found on refresh after uploading to webhosting

Image
Clash Royale CLAN TAG #URR8PPP page not found on refresh after uploading to webhosting I uploaded production build of my react app to my web hosting but when refreshing it, page not found occurs, how to set it up or what to do with it ? Hard to say with the limited information currently in your question, but are you using React Router? You must make sure all routes are serving your index.html file so React Router can take care of the routing in the browser. – Tholle Aug 10 at 20:48 index.html Yes I am using react router so how make it to serve into my intel.html ? – Sebastián Danáč Aug 11 at 8:01 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Why ”Type Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Enum> of the type Enum“?

Image
Clash Royale CLAN TAG #URR8PPP Why ”Type Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type Enum<E>“? I am trying to read the hadoop 1.0.0 source code in eclipse. I downloaded the source code first and then use ant eclipse to build the project. After that, I successfully created the project in eclipse. But there is an error Type Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type Enum<E> on the line 396 of Gridmix.java . The error code: ant eclipse Type Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type Enum<E> Gridmix.java private <T> String getEnumValues(Enum<? extends T> e) StringBuilder sb = new StringBuilder(); String sep = ""; for (Enum<? extends T> v : e) "; return sb.toString();

Using nonce or hash values in content-security-policy for inline styles

Image
Clash Royale CLAN TAG #URR8PPP Using nonce or hash values in content-security-policy for inline styles I am adding content-security-policy settings for my web app and would like to be strict about inline scripts and inline styles. I have inline scripts working properly but am having trouble with inline styles. For background, my web app uses Elixir/Phoenix on the back end and includes React components on the front end. Nonce for Inline Scripts - Works I have just a smattering of inline scripts to get the React components bootstrapped. Per CSP guidelines, I'm using nonce values to handle these inline scripts. Specifically, I generate a new nonce value server side on each page load and include it in the content-security-policy header and also inject it into a nonce attribute in the script tags using server side rendering. This works fine. nonce content-security-policy nonce Nonce for Inline Styles - Doesn't Work Inlines styles are another story. Inlines styles are pretty

Why [[ -n $var ]] instead of [[ $var ]]?

Image
Clash Royale CLAN TAG #URR8PPP Why [[ -n $var ]] instead of [[ $var ]]? In this answer I had some code which read: if [[ $ZSH_VERSION ]]; then This was edited to be: if [[ -n $ZSH_VERSION ]]; then Update: I just saw the edit comment: [[ x ]] didn't work until recently in zsh I looked through the zsh release notes and couldn't find reference to this. zsh Which zsh version first allowed [[ x ]] ? zsh [[ x ]] See e.g. github.com/zsh-users/zsh/blob/master/ChangeLog#L11593 – Kusalananda 34 mins ago 2 Answers 2 From the zsh 5.5.1 docs for CONDITIONAL EXPRESSIONS zsh CONDITIONAL EXPRESSIONS For compatibility, if there is a single argument that is not syntactically significant, typically a variable, the condition is treated as a test for whether the expression expands as a string of non-zero length. In other words, [[ $var ]] is the same as [[ -n $var ]]. It is recommended that the second, explicit, form be used where possible. With the source tree around, % gr

Issue with timezone on website

Image
Clash Royale CLAN TAG #URR8PPP Issue with timezone on website does anyone know how to fix this error: https://prnt.sc/kh728n I have tried online guides but they seem to cause more errors when i change things in the .htaccess file. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Detecting balls on a pool table (stripes and solids)

Image
Clash Royale CLAN TAG #URR8PPP Detecting balls on a pool table (stripes and solids) I couldn't find any satisfying answer on that topic. I want to make a program that will get snapshots from camera above the pool table and detect balls. I am using OpenCV and Java. My algorithm now is basically: blurring image -> converting RGB to HSV -> splitting into 3 planes -> using Canny() on H plane -> using HoughCircles() method to detect balls This algorithm detects balls quite well, it has problem with two balls only (green and blue, because background of the table is green). But I want to go one step further and: Do you have any idea how to implement task #1? My idea is to use inRange() function, but then I'd have to prepare a mask for every ball that detects that one ball in specified range of colors, and do this detection for every ball, am I right? Thanks for sharing your opinions. @Edit: Here I give you some samples of how my algorithm works. I changed some parame

TFS 2018 tree query

Image
Clash Royale CLAN TAG #URR8PPP TFS 2018 tree query https://i.stack.imgur.com/VY9Bc.png How do I edit this query to INclude children items that are completed? What's that mean for the completed here? including closed? – Andy Li-MSFT Aug 13 at 11:59 completed There's a TFS state "Completed" – Stephanie Monick Aug 13 at 14:13 Do you mean you want to query the completed children items? – Eddie Chen - MSFT Aug 14 at 1:32 If the parent or grandparent is still active, then I want all the children (completed and not completed) – Stephanie Monick Aug 15 at 16:05 If I didn't misunderstand your question, the query in your screenshot should work. – Eddie Chen - MSFT Aug 16 at 2:40 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

R Error in regsubsets() NA/NaN/Inf in foreign function call (arg 5) and dataset has been checked for NAs/NANs/Inf

Image
Clash Royale CLAN TAG #URR8PPP R Error in regsubsets() NA/NaN/Inf in foreign function call (arg 5) and dataset has been checked for NAs/NANs/Inf FA_binary <- as.numeric(HE_Data$`FA?` == "Y") TE_binary <- as.numeric(HE_Data$`Bond Type` == "Tax-Exempt") ST_binary <- as.numeric(HE_Data$`School Type` == "Public") Data <- data.table(HE_Data$School, HE_Data$`Maturity Year`, HE_Data$Cpn, HE_Data$Sprd, HE_Data$`Rating Scale (1-11)`, FA_binary, TE_binary, ST_binary) names(Data) <- c("School", "Maturity", "Coupon", "Spread", "Rating", "FA", "Tax Status", "School Type") year <- Data$Maturity spread <- Data$Spread cpn <- Data$Coupon rating <- Data$Rating fa <- Data$FA schooltype <- Data$`School Type` tax <- Data$`Tax Status` HEsubset <- regsubsets(spread ~ year + rating + cpn + fa + schooltype + tax, data = Data) HEsubset returns the error: Error i

Fixing Flask timeout due to instantiation of large Keras model on Heroku

Image
Clash Royale CLAN TAG #URR8PPP Fixing Flask timeout due to instantiation of large Keras model on Heroku So I have a simple demo Flask application meant to serve a Keras model that I trained. The application works fine running locally on my computer but often times out on Heroku. In the application the model is loaded when Flask is started. This makes the most sense to as then we don't have to reload the model on each request. Normally this would be fine since Flask would run continuously. However, given this is a free Heroku app, Heroku deactivates my instance after 30 minutes. This means each time the app has to reload the model from scratch which causes a timeout error due to the model being instantiated (which often takes 20+ seconds) (occasionally it also has an out of memory error). I would like to either reduce the model load time if possible. Barring that find another way to avoid timeout on Heroku without upgrading (i.e multi-threading perhaps). I realize I could host my

How to Create MSSQL database user with ARM templates

Image
Clash Royale CLAN TAG #URR8PPP How to Create MSSQL database user with ARM templates Is it possible to create MSSQL database user and then grant a database access ( owner privileges ) to this user using ARM templates? 1 Answer 1 Not in the current iteration of ARM. Here is what is supported with SQL server ARM templates. If you're fixed on using db user/pass to talk to the database, try a powershell script as part of your CI/CD pipeline. But you could also look at Azure AD cert-based auth or Managed Service Identity (MSI) instead. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Getting error: java.lang.ClassNotFoundException: cucumber.runtime.java.CitrusObjectFactory

Image
Clash Royale CLAN TAG #URR8PPP Getting error: java.lang.ClassNotFoundException: cucumber.runtime.java.CitrusObjectFactory I have cucumber.properties file that contains following: cucumber.api.java.ObjectFactory=cucumber.runtime.java.CitrusObjectFactory cucumber.properties cucumber.api.java.ObjectFactory=cucumber.runtime.java.CitrusObjectFactory But looks like it cannot find this class . Could you please let me know, what did I miss? class Hi Friend, I request you to check How to create a Minimal, Complete, and Verifiable example. – Praveen Aug 10 at 19:25 As Praveen mentioned please provide MCVE. Most likely class not found related issues are related to build path and how references are set to external libraries. Please refer: help.eclipse.org/luna/… – sette Aug 10 at 20:48 1 Answer 1 Have you tried cleaning and building project ? Restart the IDE as well and check again ! By clicking "Post Your Answer", you acknowledge that you have read our updated

Vagrant's Ubuntu 16.04 vagrantfile default password

Image
Clash Royale CLAN TAG #URR8PPP Vagrant's Ubuntu 16.04 vagrantfile default password I'm attempting to deploy and run an Ubuntu 16.04 VM via Vagrant 1.9.1. The Vagrantfile I'm using is from Atlas: Ubuntu Xenial 16.04 Vagrantfile I'm using Debian Stretch as the host OS. Vagrant was installed via a .deb available from Vagrant's website. The Vagrantfile does run and deploy correctly. I can ssh into the VM via both my host OS and using 'vagrant ssh'. However, I have one minor blocker when attempting to ssh in from outside. The default user in this VM is named 'ubuntu', and looks to have a password set. However, I have no idea what the password is at all, and no docs seem to have the information that I'm looking for. Attempting to set a password via 'passwd' within the VM asks for a current password. Anyone see where this is going? So my big question is this: has anyone else deployed this same Vagrantfile, and if so, does anyone know what

Is it safe to (can I) use `HttpError` from 'admin-on-rest/lib/util/HttpError'?

Image
Clash Royale CLAN TAG #URR8PPP Is it safe to (can I) use `HttpError` from 'admin-on-rest/lib/util/HttpError'? My API provider is sending error messages in the response.body as a ReadableStream as plain text and I need to get admin-on-rest to display those messages to the end user. response.body I'm planning to do so like this: import HttpError from 'admin-on-rest/lib/util/HttpError' import _ from 'lodash'; function handleError(response) if (_.isFunction(response.text)) const statusText = response.statusText; const status = response.status; return response.text().then(text => ); else throw new Error(response.statusText); And in my custom REST Client //... if (response.status < 200 || response.status >= 300) return handleError(response); //... But I feel that accessing to HttpError directly through 'admin-on-rest/lib/util/HttpError' intead of 'admin-on-rest' is insecure because if the internal implementation changes (or

AttributeError: module 'pandas' has no attribute 'self'

Image
Clash Royale CLAN TAG #URR8PPP AttributeError: module 'pandas' has no attribute 'self' I'm working with classes and I've got self.variables, which is no problem at all until I want to do this: I want to subtract values of one df by values of another by index import pandas as pd . . . for index, row in self.DataFrame4.iterrows(): self.DataFrame1=pd.self.DataFrame3.subtract(self.DataFrame2, axis='index') The result is: AttributeError: module 'pandas' has no attribute 'self' most likely because of "pd.self" What would be a neat solution to fix that issue? have you tried removing pd. to make it like all the other self.DataFrame# references? – Joel Berkeley Aug 10 at 20:51 pd. self.DataFrame# self.DataFrame1 = self.DataFrame3.subtract(self.DataFrame2, axis='index') ? – Madhan Varadhodiyil Aug 10 at 20:55 self.DataFrame1 = self.DataFrame3.subtract(self.DataFrame2, axis='index') hey Joel, thank

Create JSON from string with format “key1=value1,key2=value2” using jq

Image
Clash Royale CLAN TAG #URR8PPP Create JSON from string with format “key1=value1,key2=value2” using jq I'm trying to create a json file from a string with the following format: string="key1=value1,key2=value2" Is there a way to create a json using jq by specifying the = and , symbols as separators for the keys and values? = , The output I'm looking for would be: "key1": "value1", "key2” :”value2" I've tried to use this post as a reference: Create JSON using jq from pipe-separated keys and values in bash -- however, it expects input that contains a line with only keys, before later lines with only values; here, the keys and values are all interspersed. You can't have comma delimited key/value pairs without having a way of encoding the delimiters. How is anyone supposed to interpret that? – Jeff Mercado Aug 13 at 19:02 Editing a question into a completely distinct follow-up question after it already received answers