Posts

Showing posts from December 15, 2018

React native pan responder trapping all touch events from propagating to children

Image
up vote 0 down vote favorite I'm trying to wrap all of my component 'scenes' in an expo multitouch component (which is a wrapper for the pan responder) so that, if a person performs a multitouch gesture at any point, this will trigger an app menu, and otherwise, the child views respond to the touch event. How do I accomplish this? It seems that the parent traps and stops propagation of all events - I would've expected those events to bubble upward from the innermost elements. Ordinarily I would use a shake gesture, but I'm using expo, which reserves that gesture for its own menu. Here's my code: class ResultsScreen extends React.Component { render() { const props = { onTouchBegan: ({ identifier }) => { console.log('onTouchBegan', identifier); }, }; r

Matrix Values change after function is executed

Image
up vote 0 down vote favorite I am using C++ to create an algorithm to amend matrix entries - however I have come across some strange behaviour. The algorithm itself should provide two matrices, one of which is inputted as a variable and should be amended in the algorithm, and the other will be returned. All was fine until I noticed that the matrix that was inputted has entry values inside the function that differ from outside the function (after the function had been executed). I will not write out the whole code (because it is rather long and I don't think is relevant), however, I will show snippet, hopefully elucidating the issue. double** function(double** A) { /*Some coding that amends entries in A...*/ for (int i = 0; i <= Dimension - 1; i++) { for (int j = 0; j <