Steve Steve

12086 questions
1

votes
2

answer
431

views

React Native, Redux, and Fetch: “Possible Unhandled Promise Rejection (id: 0)”

I am loading JSON data from a Webpage into my React Native app, and would like to store the data in Redux. I'm currently using Fetch like so: fetch('https://foo.com/product-data/product1.json') .then((response) => response.json()) .then((responseData) => this.state.productLoad(responseData)); where...
Steve
1

votes
3

answer
36

views

assigning attribute to a method

I have a class for a dynamical system, with methods for the ODE function and also the event function to terminate integration. I want to solve this with scipy.integrate.solve_ivp. According to the docs, this is done by assigning an attribute to your event function, as myEvent.terminal = True. Howeve...
Steve Heim
1

votes
1

answer
26

views

Copy values from one table to another, only where second table has specific values

I thought this would be straightforward, but it's been a while since I've looked at R. I have two tables, and I want to make a third table with values from the first based on values from the second. (I want the numbers from table 1, anytime the corresponding row/column from table 2 has a '1') I was...
Steve
0

votes
2

answer
14

views

MySQL query looking for 3 identical transactions over a very large group of transactions

We have a table of transactions that holds an amount, a user ID, a partner ID, and a description. When a user has 3 of a specific transaction they get a one-time bonus. The query we have worked OK on smaller sets, but now that we're at over 20,000,000 transaction rows it's just not cutting it. Th...
Steve
0

votes
2

answer
28

views

Difference between Atomic set() and getAndSet() methods in Java

In one of my programs, I was trying to update the value of an Atomic Integer, but could not decide between set() and getAndSet() methods because they both seem to do the same. //Sets the newValue to the volatile member value public final void set(int newValue) { value = newValue; } and public final...
Steve
0

votes
0

answer
19

views

Problem setting indeterminate value of parent checkbox in group

I have a JSON file with hierarchical data: [ { 'id': 0, 'label': 'Gap Inc.', 'value': 'Gap Inc', 'checked': false, 'children': [ { 'id': 0, 'label': 'Banana Republic', 'value': 'Banana Republic', 'checked': false }, { 'id': 1, 'label': 'Gap', 'value': 'Gap ', 'checked': false }, { 'id': 2, 'label':...
Steve
1

votes
1

answer
719

views

How to find all (child) sub-interfaces of a particular interface in Java?

Given an interface: public interface A {}; with inheriting interfaces: public interface B extends A {} public interface C extends A {} How can I programmatically scan to find B and C? I.e. how to do this: Type[] types = findAllSubInterfacesOfA(); // Returns [B.class, C.class] Note: Am trying to find...
Steve Chambers
0

votes
0

answer
3

views

Node: How Can I Import Web3 To Node.js?

I'm trying to import the web3 library in Node.js so that I can handle Ethereum smart contract events, however I can't get the import to work. I'm running Babel on each file to convert to es5, and the import in Node's index.js file looks like this: import Web3 from web3; When I add that 'import Web3...
Steve
1

votes
3

answer
354

views

Angular JS apply uppercase filter to boolean value?

I have an angular 1.4.12 binding: {{ mob.mobDataSettings[7].value | uppercase }} where the first part is a boolean from a json file which is of course either true or false. however, in the rendered HTML it is not being uppercased (i.e. TRUE), it's printing as true. Am I missing something obvious?
Steve
1

votes
3

answer
83

views

How do I safely delay a web response in ASP.net?

I have a problem where when we initiate a REST resource from a third party (Twilio), the service responds so quickly, we don't have time to write our SID's to database. We can't tell the service to wait, as it returns the SID only when the service has initiated. The application itself can't hold the...
Scuba Steve
1

votes
3

answer
92

views

How to register RoleManager in Startup.cs in ASP.NET Core

When I run my application in debug mode my seed method fails because of a 'missing' service. The error message is: No service for type 'Microsoft.AspNetCore.Identity.RoleManager`1[Microsoft.AspNetCore.Identity.IdentityRole]' has been registered. Can someone please help me register this service corr...
steve
1

votes
2

answer
45

views

Aggregate method and lambda function

I have a dataframe df and would like to get the ID list for each class: import pandas as pd list1 = [[1, ('A', 'B', 'C')], [2, ('M', 'E', 'F')], [3, ('H', 'A', 'D')], [4, ('H', 'A', 'D')]] df = pd.DataFrame(list1, columns=['ID', 'Class']) df looks like ID Class 1 (A, B, C) 2 (M, E,...
Steve P
0

votes
0

answer
8

views

How to print uiwebview which has header and uitableview with multiple data

I am creating webview to print the data. As per my requirement half of the page contains header labels and remaining starts with uitableview which has table contents. If tableview contents are more then i need to continue those contents to next page. func createPDF(_ currentWebView: UIWebView) {...
Steve Gear
1

votes
1

answer
46

views

How to deal with factors in Rcpp

I'm attempting to learn how to use Rcpp in R. Can someone please point out what the problem/s are with this code. There's probably more than one issue. When the c object is entered into fun() at the bottom of the code I want it to output a vector/array with the values 'Home', 'Elsewhere' or 'Number'...
Steve
0

votes
0

answer
6

views

How to write Nginx location block

I am a Nginx noob. I am trying to execute the location block which matches the general condition in all the cases but use the /account condition for for url matching that. So for request www.abc.com, www.abc.com/var1, www.abc.com/var2/var3 I want the first block to be execute but for request like ww...
Steve_Greenwood
1

votes
0

answer
77

views

Nil Out package.loaded Every Time?

Is it good practice to nil out the loaded package every time the script is called? What if the file never changes during runtime? Can I just use require instead of nilling it out first? package.loaded['scripts/common/functions'] = nil...
Steve Stout
0

votes
0

answer
13

views

Different behaviors on jQuery row deselect, and I don't understand why

I have two variations of code, each variation has a desired behavior, and an undesired behavior... But I don't understand why this is happening, or how to combine them to get both desired behaviors. (I've tried different variations of if/else statements trying to get both of the desired behaviors in...
Steve
1

votes
2

answer
170

views

Async event and exception

in ES7 we will be having async and await keyword for JS. It looks very promising for regular functions. But how do we handle exception in async events? for example async badFunc() { throw 'bad'; } var reader = new FileReader(); reader.onload = async function () { await badFunc(); } Based on my under...
Steve
1

votes
0

answer
136

views

JWT authentication and permission_callback

In angular, I have following to get the JWT token for wordpress. import { HttpClient, HttpHeaders} from '@angular/common/http'; ... logIn(){ let loginInfo ={ username: 'admin', password: 'password.' }; let headers = new HttpHeaders(); headers.set('Content-Type', 'application/json'); this.http.pos...
steve Kim
1

votes
0

answer
57

views

serve compressed file with no file extension with .htaccess

I have a website chat plugin script that I've made a local copy of, and uploaded to our website: www.example.com/js/default. webpagetest.org reports this file is uncompressed. In .htaccess, we have: AddType x-font/woff .woff AddType x-font/ttf .ttf AddOutputFilterByType DEFLATE image/svg+xml AddOutp...
Steve
1

votes
1

answer
19

views

Converting command-line cURL where URL is piped to python

I have this command-line cURL example: curl -X PUT -H 'X-Auth-Token: $AUTH_TOKEN' \ -d '{\'data\':{\'name\':\'Device1 Callflow\', \'numbers\':[\'1001\'], \'flow\':{\'module\':\'device\',\'data\':{\'id\':\'$DEVICE_ID\'}}}}' \ http://ip.add.re.ss:8000/v2/accounts/$ACCOUNT_ID/callflows | python -mjson....
Steve Humphrey
1

votes
0

answer
95

views

infinte scroll + imagesloaded + masonry on tumblr API loaded via ajax within shopify

I've been trying to make this work for a while but haven't made any progress. Not sure if I'm missing something or if it just won't work within this setup. In short: client has a shopify site, and wants to load in images from tumblr in an infinite scroll. I'm using the standards from DeSandro: Infin...
Steve King
1

votes
0

answer
351

views

How to make Camel's “Netty4” component output an endpoint's results, but NOT echo back all the input as well?

I am experimenting with using Apache Camel to implement a TCP game server. It will accept bi-directional, synchronous telnet or SSH connections from multiple human or bot players. The communication 'protocol' is a bit crude, and based on legacy infrastructure that's already in place from an earli...
Steve Perkins
1

votes
3

answer
41

views

Console logging comparator boolean in Javascript

Somehow I manage not to get a good answer to this by googling. Java dev here, new to Javascipt. I have this code: console.log('this.props.projectData.length: ' + this.props.projectData.length); console.log('this.props.projectData.length >= 0 : ' + this.props.projectData.length >= 0); output: this.pr...
Steve Waters
1

votes
0

answer
32

views

Get File Names from Windows Share in Web App

I need to get a list of file names from a network Windows Share folder. The following works great when I am running it in my local host environment but gives this error when I try to run it in my web application server hosted on an iSeries(as400 box) - still on same network: HistoricalFileList: ja...
Steve Dyke
1

votes
0

answer
134

views

Installing png in CRAN 3.4.3

I am trying to install the png package in CRAN 3.4.3 on Ubuntu 16.04 via install.packages('png', dependencies=TRUE) but I get the following error message: Installing package into ‘/home/steve/R/x86_64-pc-linux-gnu-library/3.4’ (as ‘lib’ is unspecified) trying URL 'https://cran.uni-muenster.d...
Steve
1

votes
0

answer
124

views

How to delete references in MonoDevelop

Running MonoDevelop-Unity, version 5.9.6, Mac Using Project->Edit References->.Net Assembly tab I have clicked Browse and added reference to a .dll library generated in another MonoDevelop Project. Now I would like to delete that line as it appears in the .Net Assembly tab. Cannot figure out how t...
Steve Reber
1

votes
0

answer
89

views

calculator parsing wth FSM

I am trying to remember what I have learned in university where we used fsm + parse tree to build a compiler. To start off simple I thought I will try to do it for a calculator first. this is what I have got I can't seem to get what I should do if im in the bracket state and I see another ( and wh...
Steve
1

votes
1

answer
779

views

Work-around for Styled-component not working on Internet Explorer 11

I have styled-components on my web-app. They work great. Except on Internet Explorer 11. They completely break and the layout is just a pile of components laying there horizontally instead of the flexbox and whatnot. What is the usual way to work around this problem? Should I somehow recognize in th...
Steve Waters
1

votes
1

answer
72

views

xamarin forms ios small caps

My designer for our Xamarin Forms app specified Small Caps for a label field. There are several discussions on how to do this in Xamarin for Android, but I can't find anything for iOS. I know I will need a custom renderer and have found a good discussion here, but am being challenged in converting...
Steve Reed Sr
1

votes
0

answer
188

views

Box-Shadow cut off in Safari

I'm having issues with box-shadows being cut off in Safari, but fine in Chrome. I've tried 'overflow: visible', but that isn't working. See link below. li { background: #f7f7f7; width: 400px; height: 200px; display: flex; justify-content: center; align-items: center; } button { background:...
Steve Lamb
1

votes
1

answer
59

views

Backtracking a Javascript Button

My question is, How do I backtrack what a javascript button does. Specifically when it does not have an obvious function as detailed below. I am taking a JS course on Udacity and I'm trying to figure out what happens when I hit the Submit Button. Is this possible and if so, what is the next piece I...
steve
1

votes
1

answer
54

views

Invoking GetProcAddress resulting procedure reports ERROR_FILE_NOT_FOUND

I am accessing a c++ dll library (I don't have the source code) from c++ code. I use this library to mount a usb device so I can access the files on the device. This code worked well in VS2010 but since we updated to VS2013 it no longer works. Here is my question. What differences between VS2010...
Steve E
1

votes
1

answer
171

views

Efficient comparison of 2 double arrays with tolerance - Java

I have a method to check for equality of 2 double[]'s with a tolerance between each element. I'd like to make this faster and am wondering if there is a way to do this without a for loop. I've been searching but can't find something that does this. The Arrays.equals() or deepEquals() doesn't seem to...
Steve W
1

votes
1

answer
91

views

Copy ManyToMany Value

I am currently trying to copy a many-to-many-field from one model to another but running into a bit of trouble. I have been able to create the model fine with a many-to-many-field with a ModelMultipleChoiceField, and the model saves the way I want it to. When I try to copy it to another model, I d...
Steve Smith
1

votes
0

answer
79

views

Relative import

I'm trying to make a dynamic relative import in Python but i'm not sure how to do it. My project is organized like this : . ├── __init__.py ├── requests.py └── serializers.py and I need to do the equivalent of from .serializers import Serializer. I tried multiple time with __import...
Steve
1

votes
0

answer
96

views

Why my JAVA_HOME points to Java 8 even though it has been set to Java 7?

Here's a picture that illustrates the problem perfectly: I have restarted windows after changing that.
Steve Waters
1

votes
0

answer
238

views

grViz diagrammeR: justifying rows of nodes

I am using diagrammeR with grViz to generate a flow chart with multiple rows. The rows are grouped together properly, and the vertical order works well. Is there a way to specify justification of full rows (ranks)? I would like them to be centered. Below is code and an image of the example I am work...
Steve
1

votes
0

answer
34

views

create identical R setup on multiple machines

I need to run a series of analyses on three servers and my laptop. In order to maintain the setup, I want each server to have identical packages (and versions) installed (incl. some of my own packages) as on my laptop. All of the packages and code has been developed and is installed the way I want i...
Steve G. Jones
1

votes
1

answer
131

views

missing metatag description bing

I'm the owner of SafetyStore.com and currently rolling over my site from sparkpay to 3dcart. Updating info with Bing and the test says that my site is missing the Title metatag and Description metatag. When I check the code, they are at line 276 and 282 on the main page. Do I have a syntax error I'...
Steve Hull

View additional