text:
Q: Java: Code with JButton and a timer works in some methods but not others I am trying to create a program that moves a button to a random location after it is pressed. The player has to respond before a certain timeframe or the game goes to game over. The game works, but after there is game over, the button does not move back to the middle and the timer does not start back up. Game over is a method in my GUI class. Thank you in advance for any help!!!
public void gameOver() {
    System.out.println("Game Over (add pop-up) - You tapped " + taps + " times!");

    //RESET everything
    System.out.print("Started gameOver");

    timer.pause();
    taps = 0;
    tapHere.setBounds(305, 325, 90, 50);

    System.out.print("Finished gameOver");
}

Here is the Timer class code:
public class Timer extends GUI implements Runnable {

private int counter = 0;
Thread t = new Thread (this);
private volatile boolean isRunning = false;

public Timer() {}

public void run() {

    while (isRunning)
    {
        counter++;
        System.out.println(counter);
        if (counter >= 24)
        {
            gameOver();
        }
        try {
            Thread.sleep(30);
        } catch(InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
    }

}

public void start() {
    t.start();
}

public void pause() {
    isRunning = false;
    counter = 0;
}

public void time() {
    isRunning = true;
}

}
Full code is on pastebin and Github


text:
Q: What is the best way to know when the UIViewController above me in the stack has been popped? I have a UIViewController that manages the display of some data. When the user wants to edit this data I push an edit UIViewController onto the stack. When the user is finished editing the top view controller is popped off the stack. What is the most elegant way to know that I need to update my display after the edit view is popped off?
I thought that I might be able to put the content update code into the viewDidLoad method of my data view, but this method isn't always called when my view displays, especially not when I'm navigating down the view stack.
I also considered setting up my data view controller as a delegate for the UINavigationController and wait for – navigationController:didShowViewController:animated: to be called, my concern is that there may be other view controllers that need to be notified when they're displayed and it will turn into a minor headache managing which controller should be receiving the didShowViewController message.

A: I think viewWillAppear will do the trick.
Otherwise your edit view controller could call a new method of delegate pointing to your parent controller. In there, you can update the data model and display. For instance:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    if ([delegate respondsToSelector:@selector(editEntryByTitle:)])
        [delegate performSelector:@selector(editEntryByTitle:) withObject: textField.text];
    [textField resignFirstResponder];
    [self dismissModalViewControllerAnimated:YES];
    return YES;
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Make a line chart with chart js based on JSON array from API, and have multiple values show in the mouse hover box What I want to do is create a linechart with points that correspond to the JSON data I get from the API. Although I am currently not doing this dynamically I would like to do that down the line, but the current focus is getting the line data from the response.
I want to have multiple values display in the display box when i hover over it with my mouse currently I only get one:
That looks like this
The data is formatted like this:
[{
              "Tijdstempel apparaat": "23-02-2023 00:07",
              "Historische glucose mmol/l": "11.8",
              "Scan Glucose mmol/l": null,
              "Snelwerkende insuline (eenheden)": "4.0",
              "Koolhydraten (gram)": "40",
              "Notities": null
            },
            {
              "Tijdstempel apparaat": "23-02-2023 00:28",
              "Historische glucose mmol/l": "10.8",
              "Scan Glucose mmol/l": null,
              "Snelwerkende insuline (eenheden)": null,
              "Koolhydraten (gram)": null,
              "Notities": null
            },
            {
              "Tijdstempel apparaat": "23-02-2023 01:28",
              "Historische glucose mmol/l": "7.8",
              "Scan Glucose mmol/l": null,
              "Snelwerkende insuline (eenheden)": null,
              "Koolhydraten (gram)": null,
              "Notities": null
}]

There are a lot more lines in this obj, but I am focusing on these for now.
If I change those to be set to x and y labe;s it looks like:
[{
              x: "23-02-2023 00:07",
              y: "11.8",
              "Scan Glucose mmol/l": null,
              "Snelwerkende insuline (eenheden)": "4.0",
              "Koolhydraten (gram)": "40",
              "Notities": null
            },
]

This would get me: The line with x and y
Which is great, but when I want to add the; lets say "Koolhydraten (gram)": "40" I don't know how to get that on the same pointer as the Y value already is in the chart.
I have a very basic App.vue that looks like this:
<template>
  <Line :data="data" />
</template>

<script lang="ts">
import {
  Chart as ChartJS,
  CategoryScale,
  LinearScale,
  PointElement,
  LineElement,
  Title,
  Tooltip,
  Legend
} from 'chart.js'
import { Line } from 'vue-chartjs'

ChartJS.register(
  CategoryScale,
  LinearScale,
  PointElement,
  LineElement,
  Title,
  Tooltip,
  Legend)

export default {
  name: 'App',
  components: {
    Line
  },
  data() {
    return {
      type: "line",
      data: {
        options: {
          responsive: true,
          scales: {
            y: {
              stacked: true
            }
          }
        },
        datasets: [
          {
            label: 'Glucose level',
            backgroundColor: '#f87929',
            data: .. the data obj
          }]
      }
    }
  }
}

</script>

but what if I want the other present values to also be shown on the hover display, I tried to use stacked to stay y values but that is not how it's supposed to be done:
[{
              x: "23-02-2023 00:07",
              y: "11.8",
              "Scan Glucose mmol/l": null,
              y: "4.0",
              y: "40",
              "Notities": null
            }, {
              x: "23-02-2023 00:28",
              y: "10.8",
              "Scan Glucose mmol/l": null,
              "Snelwerkende insuline (eenheden)": null,
              "Koolhydraten (gram)": null,
              "Notities": null
            }]

When I add the koolhydraten to the same Y axis for example, I want to display below the glucose level label
That's the jist of what I want to achieve.
And if someone could point me into the right direction for doing this dynamically with the data provided by the API that would very much be appreciated as well.


text:
Q: Custom event parameter is not passed correctly in test I developed a JavaScript library to handle the events generated by a gamepad/joystick, and I also developed a series of tests with Jest for different test cases. But I have a problem with the tests: I can't figure out how to simulate the gamepadconnected and gamepaddisconnected events.
This is a simplified version of my code:
const gameControl = {
  // ...
  init: function() {
    window.addEventListener('gamepadconnected', e => {
      console.log('gamepad detected');
      if (!window.gamepads) window.gamepads = {};
      if (e.gamepad) {
        if (!window.gamepads[e.gamepad.index]) {
          window.gamepads[e.gamepad.index] = e.gamepad;
          // ...
        }
      }
    });
    window.addEventListener('gamepaddisconnected', e => {
      console.log('gamepad disconnected');
      if (e.gamepad) {
        delete window.gamepads[e.gamepad.index];
        // ...
      }
    });
  }
  // ...
};

gameControl.init();

export default gameControl;

gamepadconnected and gamepaddisconnected are native events triggered when a gamepad/joystick is connected or disconnected respectively. As a parameter, they receive an event object with the gamepad property that is an object with information about the connected/disconnected gamepad.
I tried dispatching the events manually in the tests, creating my own custom event with the parameter I want (gamepads below is an array with gamepad's mock data). Something like this:
describe('gameControl', () => {

  // ...

  test('trigger gamepadconnected event', () => {
    const event = new CustomEvent('gamepadconnected', {
      detail: { gamepad: gamepads[0] }
    });
    global.dispatchEvent(event);
  });

  test('trigger gamepaddisconnected event', () => {
    const event = new CustomEvent('gamepaddisconnected', {
      detail: { gamepad: gamepads[0] }
    });
    global.dispatchEvent(event);
  });

  // ...

});

But, although the events are dispatched correctly and the event listener is triggered, the parameter doesn't make it through. For example, gamepadconnected is handled and I see in the console "gamepad detected," but the object e does not contain the property gamepad that I need.
I did a console.log(e) to see the properties of the event object, but my parameter is nowhere to be seen. This is all the console.log shows:

CustomEvent { isTrusted: [Getter] }

What am I doing wrong? How can I achieve what I want and test the full code of the event handler for gamepadconnected and gamepaddisconnected?
As alternatives, I tried moving the gamepad property to the top level, or using Event instead of CustomEvent, but problem persists.
test('trigger gamepaddisconnected event', () => {
  const event = new CustomEvent('gamepaddisconnected', {
    gamepad: gamepads[0]
  });
  global.dispatchEvent(event);
});

test('trigger gamepaddisconnected event', () => {
  const event = new Event('gamepaddisconnected', {
    gamepad: gamepads[0]
  });
  global.dispatchEvent(event);
});

A: a lazy hack that comes to mind: just check if e.detail.gamepad is defined  and then set e.gamepad to e.detail.gamepad
window.addEventListener('gamepadconnected', e => {
   if(e.detail && e.detail.gamepad) { e.gamepad = e.detail.gamepad }
...


text:
Q: Integral $\int_0^\infty \frac{\cos x}{x}\left(\int_0^x \frac{\sin t}{t}dt\right)^2dx=-\frac{7}{6}\zeta(3)$ I am trying to prove this below.
$$
I:=\int_0^\infty \frac{\cos x}{x}\left(\int_0^x \frac{\sin t}{t}dt\right)^2dx=-\frac{7}{6}\zeta(3)
$$
where
$$
\zeta(3)=\sum_{n=1}^\infty \frac{1}{n^3}.
$$
I am not sure how to work with the integral over $t$ because it is from $0$ to $x$.   If we can somehow write
$$
\int_0^\infty \frac{\cos x}{x} \left(\int_0^\infty \frac{\sin t}{t}dt-\int_x^\infty \frac{\sin t}{t}dt     \right)^2dx=\int_0^\infty \frac{\cos x}{x}\left(\frac{\pi}{2}-\int_x^\infty \frac{\sin t}{t}dt\right)^2dx.
$$
I do not want to use an asymptotic expansion on the integral over $t$ from $x$ to $\infty$, I am looking for exact results.  Note we can use $\int_0^\infty \frac{\sin t}{t}dt=\int_0^\infty \mathcal{L}[\sin t(s)]ds=\frac{\pi}{2}.$  Other than this approach I am not really sure how to go about this.  Note by definition
$$
\int_0^x \frac{\sin t}{t}dt\equiv Si(x),
$$
but I'm not too sure what this definition can be used for in terms of a proof.  Also note
$$
\int_0^\infty \frac{\cos x}{x}dx \to \infty.
$$

A: It's strange that you're unable to access that link. I do not understand that.
I accredit this to Shobit.
Anyway, what Shobit done was to write it as a triple integral.
$$I=\int_{0}^{\infty}\int_{0}^{1}\int_{0}^{1}\frac{\cos(x)\sin(xy)\sin(xz)}{xyz}dydzdx$$
$$I=1/4\int_{0}^{1}\int_{0}^{1}\int_{0}^{\infty}\frac{\cos(x(y-z+1))+\cos(x(y-z-1))-\cos(x(y+z+1))-\cos(x(y+z-1))}{xyz}dxdydz$$
Now, use the known result:  $$\int_{0}^{\infty}\frac{\cos(bx)-\cos(ax)}{x}dx=\log(a/b)$$
Using this, it can now be written in terms of a log:
$$I=1/4\int_{0}^{1}\int_{0}^{1}\frac{1}{yz}\log\left(\frac{(y+z+1)(y+z-1)}{(y-z+1)(y-z-1)}\right)dydz$$
Now, integrating this w.r.t y is where the dilogs come into play:
$$I=1/4\int_{0}^{1}\frac{Li_{2}(\frac{1}{z+1})+Li_{2}(\frac{1}{z-1})-Li_{2}(\frac{-1}{z+1})-Li_{2}(\frac{1}{1-z})}{z}dz$$
Maybe you can finish it now on your own. It is now a matter of known dilog integrals. This is the bulk of it. But, if you need more I can write the rest later.


text:
Q: Callback from tweet button in iOS? I want users to be able to share a page. It's specific for iOS users. Best practice would be to use the share button from Safari itself, so users don't have to login, etc. But I want to track if the link has been shared through Twitter/Facebook. Is there some kind of callback you can monitor server-side or some other way, to tracks sharing from a webpage on iOS (6)?

A: Sounds like you'd have to make a link that forwarded to a server you managed, record what information you'd like out of the link, and then forward that user to the actual link you want to send them to. You're basically intercepting them on their way to the site they want, and can track what you want from that link. A lot of sites employ this practice.
Take for example in Facebook, whenever you click an external link there you actually click a link thats first handled by Facebooks servers to record your action, then forwards you on to the correct site.

A: I don't know about server side, but you can track when the user completes a post in the iOS SDK. Here's an example of a TWTweetComposeViewController completion handler that will inform you when the user has successfully posted the tweet. I'd give you a Facebook example, but iOS 6 is still under NDA.
Additionally, there's no need to do this in Safari. If the user has linked their Twitter account in system preferences, they will not be prompted to login using a TWTweetComposeViewController and the same should holder true for the iOS 6 Facebook composer.
[tweetViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result) {

    switch (result) {
        case TWTweetComposeViewControllerResultCancelled:
            break;
        case TWTweetComposeViewControllerResultDone:
              //some code representing a successful tweet here!
            break;
        default:
            break;
    }
    [self dismissModalViewControllerAnimated:YES];
}];


text:
Q: Error opening a file in C++: Error getting characters from string So I have some code for opening a file:
#include <string>
#include <fstream>
#include <iostream>
#include <stdio.h>

void OpenFile(std::string filename);

int main()
{
    OpenFile("c:\\Programming\\Viper\\ViperEngine\\Debug\\plop.png");

    return 0;
}

void OpenFile(std::string filename)
{
    std::ifstream file(filename, std::ios::in | std::ios::binary);

    if(!file.good())
    {
        std::cout << "I am Error";
        std::cin.get();

        return;
    }

    std::cin.ignore();

    file.close();
}

This all looks well and good to me, except that it doesn't work.  When I run the Debugger, it says that Seteback and setegptr are equal to 0xcccccccc and that there are errors reading the characters from the string, when trying to open the file.  I tried just hard-coding the filename into the file open call (std::ifstream texFile("c:\Programming\Viper\ViperEngine\Debug\floop.png", std::ios::in | std::ios::binary)), but that still did not work.  The strange thing is it works fine if I use a file called "bloop.bmp" in exactly the same directory.  I am at a loss.  I had a look around on Google, where it said things about the string perhaps being destroyed before it could be used, but the string is still fine at the file-opening line.
Here is a screenshot of the Debug watches.
I can continue with my little project for a while with this problem, but it's mighty annoying, so any help would be much appreciated.
EDIT: Now with a minimal reproducible code, and Debug watch at the correct stage.  Thanks for the tips, guys.

A: The debug output is shown at the wrong stage. You need to look at the _texFile variable after the debugger has stepped over it. The image that you have posted indicates that the debugger had not yet executed the statement in question, so you are probably misled by that.

A: Try to make some simple test. Put some file in C:\file.png, make sure file exists and check if it opens. You can also try to check if file exists using some C++ function, (ifstream needs absolute path, I had similar error when I was opening file by relative path)


text:
Q: odbc connection oracle log cat error in android i wrote program to connect oracle database 11g for my android application to store values. My table name is names contains three fields. I imported ojdbc.jar file in to my project. After compiling program a log cat error displays like " could not find the class oracle.jdbc.driver.OracleDriver() "  like this. Pls give one solution or  is any other jar file i need to import?
   package com.odbc;

      import java.sql.Connection;
      import java.sql.DriverManager;
      import java.sql.PreparedStatement;

      import android.app.Activity;
      import android.os.Bundle;

        public class OdbcActivity extends Activity {
       /** Called when the activity is first created. */
      @Override
        public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    String a="karthick";
    String b="vijay";
    String c="vel";
        try
    {
            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
            Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.2:1521:XE","system","mobile");
            PreparedStatement pst=con.prepareStatement("insert into names(name1,name2,name3) values(?,?,?)");
            pst.setString(1,a);
            pst.setString(2,b);
            pst.setString(3,c);
            pst.executeUpdate();
    }
    catch(Exception e)
    {
        System.out.println("Exception:"+e);

    }

}
     }

A: Place the ojdbc.jar in libs/ directory under your android project.
See this page for a more detailed explanation of why you need to do this with r17.


text:
Q: std::partition deliberately implemented to ignore the last element? std::list<int> ll{1,2,3,4,5,7,9};
auto end = ll.begin();
std::advance(end , 5);
std::cout << "end element: " << *end << std::endl; (output as '7')
auto middle = std::partition(std::begin(ll), end, [](const auto& item){ return item % 2; });
for(int fi : ll) std::cout << fi << ' ';

From the above snippet I expect : 1 7 3 5 4 2 9(for instance), however I get 1 5 3 4 2 7 9.
std::partition in STL has been implemented to ignore the last element? to work around this quicksort example program in cppreference is also unnecessarily complicated.
checked the STL GCC implementation: Its purposely left out maybe "__pred(*__last)" could be UB for one past last iterator (std::end) However in my example above it's not.
below code yields me what i want though its not complete.
template<typename BidirectionalIterator, typename Predicate>
BidirectionalIterator my_partition(BidirectionalIterator __first, BidirectionalIterator __last,
                                        Predicate __pred){

    while (true)
    {
        while (true)
            if (__first == __last)
                return __first;
            else if (__pred(*__first))
                ++__first;
            else
                break;
        /*--__last;*/
        while (true)
            if (__first == __last)
                return __first;
            else if (!bool(__pred(*__last)))
                --__last;
            else
                break;
        std::iter_swap(__first, __last);
        ++__first;
    }
}


text:
Q: Computed array sorting I have a computed array like this,
self.weapons = ko.observableArray(
  []
  );

self.wings = ko.observableArray(
  []
  );

 self.itemList = ko.computed( function()
 {
     return self.weapons().concat(self.wings());
 }
 },
 this );

i would like to sort this array.
i can sort ko.observableArray with no problem.
issue here is i think, ko.computed is computes back again after the sorting is done.
also: is there a better way concatenating multiple observableArrays together?
Thank you.

A: Just sort the concatenated array.
self.itemList = ko.computed(function () {
    var weapons = self.weapons(),
        wings = self.wings();
    return weapons.concat(wings).sort();
});

It will have to be resorted every time either array changes but there's not much you can do about that.
If you are going to make many changes in succession, consider using the rateLimit extender (or throttle prior to knockout 3.1.x) on your computed observable.  This will limit the amount of times notifications are sent out by the observable by collapsing all notifications made within a certain time period.
self.itemList = ko.computed(function () {
    ...
}).extend({ rateLimit: 500 }); // wait at least 500ms before first notification


text:
Q: Getting arguments out of a C function using SWIG I have the following SWIG file (simplified of course):
typedef int64_t SuiteSparse_long;

%apply SuiteSparse_long  *OUTPUT {
     SuiteSparse_long  *lnz,
     SuiteSparse_long  *unz,
     SuiteSparse_long  *n_row,
     SuiteSparse_long  *n_col,
     SuiteSparse_long  *nz_udiag
 };

SuiteSparse_long umfpack_dl_get_lunz
(
    SuiteSparse_long *lnz,
    SuiteSparse_long *unz,
    SuiteSparse_long *n_row,
    SuiteSparse_long *n_col,
    SuiteSparse_long *nz_udiag,
    void *Numeric
) ;

And I expected the Python function signature to be:
umfpack_zl_get_lunz(void * Numeric) -> (SuiteSparse_long, SuiteSparse_long lnz, SuiteSparse_long unz, SuiteSparse_long n_row, SuiteSparse_long n_col)

However, the actual Python function signature was
umfpack_zl_get_lunz(SuiteSparse_long * lnz, SuiteSparse_long * unz, SuiteSparse_long * n_row, SuiteSparse_long * n_col,
            SuiteSparse_long * nz_udiag, void * Numeric) -> SuiteSparse_long

Interestingly, when I typedef long SuiteSpare_long, it works, but not with int64_t. Does SWIG not support int64_t?


text:
Q: Solve the following linear first order Pde with the characteristic curves method Solve the following PDE
$$ y \cdot \frac{\partial}{\partial x}u+ \frac{\partial}{\partial y}u=x \\
 u(x,0)=sin(x).$$
I cannot find a solution. Firstly I have calculated the flux $\Phi$ of the vector field
which is
$$  \Phi(t,(x,0))=\begin{cases}
     x(t)=\frac{(t+c)^2}{2}+d \\
     y(t)=t+c
     \end{cases},$$
with $c=0$ because I want my integral curves to intersect the $x$ axis in $t=0.$
If a solution $u$ exists the function $\hat{u}=u \circ \Phi$ has to solve the following Cauchy problem
$$ \begin{cases}
    \frac{\partial}{\partial t}\hat{u}(t,(x,0))=x(t)= \frac{(t)^2}{2}+d \\
     \hat{u}(0,(x,0))=sin(x)
    \end{cases}
$$
So we must have $\hat{u}(t)=\frac{t^3}{6}+dt+a$ where $a=sin(x).$ At a certain time $t_1$ the integral curve starting at $(x,0)$ has to encounter the point $(x,y)$ obtaining
$$ \begin{cases}
x =\frac{t_1^2}{2}+d \\
y=t_{1}.
\end{cases}$$
Finally,
$$u(x,y)=\hat{u}(t_1) \\
= \frac{y^3}{6}+(x-\frac{y^2}{2})y+sin(x),$$ but this is not the solution. Where did I go wrong?

A: $$ y \cdot \frac{\partial}{\partial x}u+ \frac{\partial}{\partial y}u=x $$
https://en.wikipedia.org/wiki/Method_of_characteristics
$$\frac{dx}{y}=\frac{dy}{1}=\frac{du}{x}$$
A first characteristic equation from $\frac{dx}{y}=\frac{dy}{1}$ :
$$x-\frac12y^2=c_1$$
A second characteristic equation from
$\frac{dy}{1}=\frac{du}{x}=\frac{du}{c_1+\frac12y^2}\quad\implies\quad du=(c_1+\frac12y^2)dy$
$$u-c_1y-\frac16y^3=c_2$$
General solution of the PDE : $c_2=F(c_1)=u-c_1y-\frac16y^3=F(x-\frac12y^2)$
$F$ is an arbitrary function.
$$u(x,y)=(x-\frac12y^2)y+\frac16y^3+F(x-\frac12y^2)$$
$$\boxed{u(x,y)=xy-\frac13y^3+F(x-\frac12y^2)}$$
Condition :
$u(x,0)=\sin(x)=0.x-0+F(x-0)$
$$F(x)=\sin(x)$$
The function $F$ is determined. We put it into the above general solution where the argument is $(x-\frac12y^2)$.
$$\boxed{u(x,y)=xy-\frac13y^3+\sin(x-\frac12y^2)}$$


text:
Q: Python - read with key in App Engine I have a python program in Google App Engine
When finding an object in the datastore when I have the key as a string, how can I do a direct read. Below is my code which is performing a loop, not good.....
class Opportunity(db.Model):
    customer = db.ReferenceProperty(Customer,collection_name='opportunitys')
    BNusername = db.StringProperty()
    opportunity_no = db.StringProperty()
    # etc etc etc.....

#BnPresets holds the object key as a string

opportunitys = Opportunity.all()
opportunitys.filter('BNusername =',BnPresets.myusername)
for oprec in opportunitys:
    if str(oprec.key()) == BnPresets.recordkey:
         opportunity = oprec
         # I have the object here and can process etc etc

A: You can instantiate db.Key from string by passing it directly to the constructor:
opportunity_key = db.Key(BnPresets.recordkey)

Once you have that, simply db.get to obtain the entity identified by this key:
opportunity = db.get(opportunity_key)

I guess (by looking at the query you use) that you also want to verify the username of the object you got:
if opportunity.BNusername == BnPresets.myusername
    process_opportunity(opportunity)

That should be pretty much it. The bottom line is that you should use the key first - as it uniquely identifies your entity - rather than querying for some other property and iterating through results.


text:
Q: Android Studio Emulator is closing but still showing as active, can't launch it again I am using Android Studio Dolphin version 2021.3.1 Patch 1, Android Emulator Version 31.3.13, in Linux
Every time I open an emulator, its working fine, but when i try to close it, the window get closed, but on the device manager it still shows as active (with Green dot), because of that, I can't start it again, i can't delete it, i can't wipe data of that emulator.
I tried deleting the *.lock files but it didn't work, its still showing as active with green dot, and i can't launch the emulator, It will work if i restart the Android Studio, but is there any other way?


text:
Q: WCF connectionstring from configuration file with EF6 I've a WCF service with an internal connectionString "Model_DB_Custom" to connect to my database with Entity Framework 6.
DBContext constructor is:
public partial class Model_DB : DbContext
    {
        /// <summary>
        /// Create a dbcontext from default connectionString in app.config to Sql Server
        /// </summary>
        public Model_DB() : base(
            ((ConnectionStringsSection)
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
                    .GetSection("connectionStrings"))
                    .ConnectionStrings["Model_DB_Custom"]
                    .ConnectionString)
        {
            //This constructor works if connectionstring is changed at runtime...
        }

...
}

When a windows service application use this WCF service, ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) returns correct WCF server config file (means "C:\Program Files\WCfService\WCfService.exe.config")
When a WPF application use this WCF service, , ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) returns its config file (means "C:\Program Files\WPFApp\WPFApp.exe.config")
Some ideas I have:

*

*Permission issue? Windows Service is running under System Account and
WPF application under an administrator.

*Bad app.config file for these 2 clients?

Thanks for your help!

A: @Thomas, you were right! Thanks for this good idea!
Ok, finally my issue was not related at all to app.config(s).
I didn't call correctly my WCF service.
To avoid proxies generation/use, I use ChannelFactory() in my WCF Service because I manage both servers and clients and that was this SimpleIOC configuration which was bad...
Now this WCF Service is implemented throw MVVM Light/SimpleIOC with following code:
ViewModelLocator.cs:
public class ViewModelLocator
    {
        static ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            //Define data access (wcf service) for design mode
            if (ViewModelBase.IsInDesignModeStatic)
            {
                SimpleIoc.Default.Register<IService, Design.DesignDataService>();
            }
            ...
    }

WcfServer class:
public class WcfServer : IDisposable
    {
        ...
        //Wcf connection
        private ChannelFactory<IService> _wcfFactory = null;

        /// <summary>
        /// Gets the DataService proxy from MVVMLight SimpleIOC instance.
        /// </summary>
        public IService DataService
        {
            get
            {
                return SimpleIoc.Default.GetInstance<IService>();
            }
        }

        public WcfServer(string urlServer)
        {
            UrlServer = urlServer;
        }

        /// <summary>
        /// Connect to wcf service
        /// </summary>
        public bool Connect()
        {
            try
            {
                ...

                EndpointAddress endpointAddress = new EndpointAddress(new Uri(UrlServer));
                if (_wcfFactory == null)
                {
                    _wcfFactory = new ChannelFactory<IService>(WCFSharedConfiguration.ConfigureBindingWithSimplehttps(), endpointAddress);

                    //Open ChannelFactory
                    _wcfFactory.Open();

                    //Define Faulted handler
                    _wcfFactory.Faulted += FactoryFaulted;
                }
                else
                    //Log + return

                if (!ViewModelBase.IsInDesignModeStatic)
                {
                    //If we are not in Design (means blend or VS IDE)
                    SimpleIoc.Default.Register<IService>(() => _wcfFactory.CreateChannel(), true);
                }
            }
            catch (Exception ex)
            {
                //Log
                throw;
            }
            return true;
        }

        public bool Disconnect()
        {
              SimpleIoc.Default.Unregister<IService>();
        }
   }

May it helps!


text:
Q: Android Espresso click a button inside a ListView I'm trying to make a test with Espresso that performs a click on a button within a specific element of my Listview.
Each element in the ListView has a a button (R.id.my_button) and I want to click the button of the first element.
I tried:
        onData(anything()).
                atPosition(0).
                inAdapterView(
                        allOf(
                                withId(R.id.my_button)
                        )
                ).
                perform(click());
Actual result:
androidx.test.espresso.AmbiguousViewMatcherException: '(with id: com.test.test:id/my_button)' matches multiple views in the hierarchy.

A: This might help,
Go inside listView -> first element -> first element's child (in your case the button)
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).onChildView(withId(R.id.my_button)).check(matches(isDisplayed())).perform(click());

A: If you want to go inside AdapterView, this will allow you to click an element inside listview
onData(anything()).inAdapterView(withId(R.id.list1)).atPosition(0).perform(click());


text:
Q: Can you have 2 processes modify a data store in a DFD diagram If I have a Ban User process that should definitely modify the Accounts data store and if I have Create Account that should also should modify the Accounts data store.

A: DFD's are a documentation tool having a somewhat defined language, but you won't get fined if you use them slightly differently from how they "should" be used. You just shouldn't use them in confusing ways. So your "can you have" question can generally be answered "yes if you like".
That said, as all diagrams only show a limited aspect of your system, it is perfectly normal for separate diagrams to use/modify the same resource. In your example, the actions have preconditions (ban user can only ban existing users, create account can only create accounts that don't exist before) and depending on the modeling language you might need to explicitly model synchronization, or it might be assumed in the form of transactions or other atomicity mechanisms.
The question here is how you got the impression that two processes can't modify the same resource. There seems to be a fundamental misunderstanding about how software works or about what you can express with DFD's.


text:
Q: Is there any way to get related posts API in WordPress? I need to create an API that will render a related post by category filter. I have written the code in my functions.php file but I did not get how can I pass a post id to the arguments?
function related_posts_endpoint( $request_data ) {
    $uposts = get_posts(
    array(
        'post_type' => 'post',
        'category__in'   => wp_get_post_categories(183),
        'posts_per_page' => 5,
        'post__not_in'   => array(183),
    ) );
    return  $uposts;
}

add_action( 'rest_api_init', function () {
    register_rest_route( 'sections/v1', '/post/related/', array(
        'methods' => 'GET',
        'callback' => 'related_posts_endpoint'
    ) );
} );

I need to pass the id from my current API call. So, I need to pass that id to the related API arguments that I have currently passed as static (180)
Image of Current post API from which I need to render a related API

A: You can add to your rest route a parameter called post_id, and then access the id from the request_data array.
function related_posts_endpoint( $request_data ) {

    $post_id = $request_data['post_id'];

    $uposts = get_posts(
        array(
            'post_type' => 'post',
            'category__in'   => wp_get_post_categories($post_id),
            'posts_per_page' => 5,
            'post__not_in'   => array($post_id),
        )
    );

    return  $uposts;
}

add_action( 'rest_api_init', function () {

    register_rest_route( 'sections/v1', '/post/related/(?P<post_id>[\d]+)', array(
            'methods' => 'GET',
            'callback' => 'related_posts_endpoint'
    ));

});

You can add the id to the end of your URL call /post/related/183.

A: Your can get the post id like normal get request. ?key=value and use its ad $request['key'] so Your code should be like this.
function related_posts_endpoint( $request_data ) {
    $uposts = get_posts(
    array(
        'post_type' => 'post',
        'category__in'   => wp_get_post_categories(183),
        'posts_per_page' => 5,
        'post__not_in'   => array($request_data['post_id']),//your requested post id
    )
    );
    return  $uposts;
 }
add_action( 'rest_api_init', function () {
    register_rest_route( 'sections/v1', '/post/related/', array(
            'methods' => 'GET',
            'callback' => 'related_posts_endpoint'
    ));
});

Now your api url should be like this /post/related?post_id=183
try this then let me know the result.


text:
Q: Allow only number, decimal value upto two place, delete and backspace In my jquery code, I'm doing validation for only numbers and decimal point, it restricts special characters. But it also restrict backspace and delete key. So, if anyone can help me in this issue ?
Allow = [only numbers , decimal value upto two place, backspace and delete]
Restrict = [special character paste option and alphabets]
Validation to be done in jquery.
Thanks in advance.
   <label for="proposal_price">price</label>
   <input type="text" class="form-control" id="proposal_price" name="proposal_price">

   $('#proposal_price').keypress(function(event) {
          var self = $(this);
          self.val(self.val().replace(/[^0-9\._\b]/g, ''));
          if (((event.which != 46 || (event.which == 46 && $(this).val() == '')) ||
          $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
                    event.preventDefault();
               }
   }).on('paste', function(event) {
        event.preventDefault();
   });


text:
Q: Blank screen when loading webvr scene I have a webvr scene as below, but when the scene is loaded, the screen is blank. Only when moving with the mouse in the scene, the scene appears.
<a-scene id="exp-view" style="width: 90vw; height: 90vh;" embedded>
  <a-assets>
    <a-asset-item id="endo-obj" src="test.obj"></a-asset-item>
  </a-assets>
    <a-entity position="33 0 -33" rotation="0 180 0" look-controls id="camera" camera="userHeight: 1.6" listener>

    <a-grid static-body></a-grid>

    <a-box color="#a00" scale="0.3 0.3 0.3" rotation="-90 180 0" dynamic-body="shape: box; mass: 0" position="-10 0 20" width="2" height="2" depth="2"></a-box>

    <a-box color="#abc" position="-35 0 0" width="0.001" height="6" depth="70"></a-box>
    <a-box color="#abc" position="35 0 0" width="0.001" height="6" depth="70"></a-box>

    <a-box color="#abc" position="0 0 -35" width="70" height="6" depth="0.001"></a-box>
    <a-box color="#abc" position="0 0 35" width="70" height="6" depth="0.001"></a-box>

    <a-light type="ambient" color="#bbb"></a-light>
    <a-light color="#ccc" position="0 30 0" distance="100" intensity="0.4" type="point"></a-light>
    <a-light color="#ccc" position="3 10 -10" distance="50" intensity="0.4" type="point"></a-light>
    <a-entity id="a" template="src: #scene1"></a-entity>
</a-scene>

This is a scene with few objects. However, it only gets visible once the user provided some input (for example drag the scene with a mouse). How can I show this scene directly?

A: Close Your camera entity with the </a-entity> tag, and make sure Your model loads properly ( the source path is correct ).
Seems to be working.


text:
Q: How to insert data in two tables with a single line of command in mysql? First, I saw some answers close to this question, but it does not work. That is why I created a new question and here is the spec:
I created two tables with:
CREATE TABLE car_info (
    id int PRIMARY KEY AUTO_INCREMENT NOT NULL,
    mileage int,
    make varchar(100),
    model varchar(100),
    fuel varchar(100),
    gear varchar(100),
    offertype varchar(100)
);

CREATE TABLE sales_info (
    id int PRIMARY KEY AUTO_INCREMENT NOT NULL,
    FOREIGN KEY(id) REFERENCES car_info(id),
    price int,
    hp int,
    year int
);

And I joined these two with:
select *
from (SELECT *
        FROM car_info
     ) as a
    left outer join (SELECT *
                    FROM sales_info
                    ) as b on a.id = b.id
union
select *
from (SELECT *
        FROM car_info
      ) as a
    right outer join (SELECT *
                    FROM sales_info
                    ) as b on a.id = b.id;

As you can see, id is the common variable here. And here, is the car_info table:
+-----------+--------------+------+-----+---------+----------------+
| Field     | Type         | Null | Key | Default | Extra          |
+-----------+--------------+------+-----+---------+----------------+
| id        | int          | NO   | PRI | NULL    | auto_increment |
| mileage   | int          | YES  |     | NULL    |                |
| make      | varchar(100) | YES  |     | NULL    |                |
| model     | varchar(100) | YES  |     | NULL    |                |
| fuel      | varchar(100) | YES  |     | NULL    |                |
| gear      | varchar(100) | YES  |     | NULL    |                |
| offertype | varchar(100) | YES  |     | NULL    |                |
+-----------+--------------+------+-----+---------+----------------+

And here, is the sales_info table:
+-------+------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra          |
+-------+------+------+-----+---------+----------------+
| id    | int  | NO   | PRI | NULL    | auto_increment |
| price | int  | YES  |     | NULL    |                |
| hp    | int  | YES  |     | NULL    |                |
| year  | int  | YES  |     | NULL    |                |
+-------+------+------+-----+---------+----------------+

And here, is the code I normally use to import SQL data inside a single table:
app.post('/save', (req, res) => {
    let data = { mileage: req.body.mileage, make: req.body.make, model: req.body.model, fuel: req.body.fuel, gear: req.body.gear, offertype: req.body.offertype };
    let sql = "INSERT INTO car_info SET ?";
    let query = connection.query(sql, data, (err, result) => {
        if (err) throw err;
        res.redirect('/');
    });
});

When I use this code, and call it from a form, it works perfectly. But, what I want to do is, I want to call this code from a form and import both tables to related info like:
app.post('/save', (req, res) => {
    let data = { mileage: req.body.mileage, make: req.body.make, model: req.body.model, fuel: req.body.fuel, gear: req.body.gear, offertype: req.body.offertype, price: req.body.price, hp: req.body.hp, year: req.body.year };
    let sql = "**car_info and sales_info tables code here**";
    let query = connection.query(sql, data, (err, result) => {
        if (err) throw err;
        res.redirect('/');
    });
});

Lastly, I tried something like that:
let sql = `INSERT INTO car_info
                    (mileage, make, model, fuel, gear, offertype)
            VALUES('${req.body.mileage}', '${req.body.make}',
                    '${req.body.model}', '${req.body.fuel}',
                    '${req.body.gear}', '${req.body.offertype}');
           INSERT INTO sales_info
                    (price, hp, year)
            VALUES('${req.body.price}', '${req.body.hp}',
                    '${req.body.year}');`

But the problem here, it only insert data inside car_info and not inside sales_info although I put some value in the related fields.
I hope the question is clear, and how can I achieve this?

A: As your two tables have different columns, I suggest you to create two queries in two different variables, then insert data collected from req.body in the tables accordingly.
app.post('/save', (req, res) => {
    const { milage, make, model, fuel, gear, offertype, price, hp, year } = req.body //Destructured object
    const car_info_query = `INSERT into car_info VALUES (?,?,?,?,?,?)`
    const sales_info_query = `INSERT into sales_info VALUES (?, ?, ?)`

    let write_car_info = connection.query(car_info_query, [milage, make, model, fuel, gear, offertype] , (err, result) => {
        if (err) throw err;
    });
    let write_sales_info = connection.query(sales_info_query, [price, hp, year], (err, result) => {
        if (err) throw err
    })
    //Insert into as many tables as you want
    res.redirect('/');
});

A: With following the @jkalandarov 's answer, I solved the problem. And the main problem here is the relation of sales_info where id is foreign key. But at the end, it is solved :)
Here is my final code:
app.post('/save', (req, res) => {
    let car_info_data = { mileage: req.body.mileage, make: req.body.make, model: req.body.model, fuel: req.body.fuel, gear: req.body.gear, offertype: req.body.offertype };
    let sales_info_data = { price: req.body.price, hp: req.body.hp, year: req.body.year };

    const car_info_query = 'INSERT into car_info SET ? ';
    const sales_info_query = 'INSERT into sales_info SET ?';

    let write_car_info = connection.query(car_info_query, car_info_data, (err, result) => {
        if (err) throw err;
    });
    let write_sales_info = connection.query(sales_info_query, sales_info_data, (err, result) => {
        if (err) throw err;
    })
    //Insert into as many tables as you want
    res.redirect('/');
});


text:
Q: node.js python child-process won't print in realtime I'm trying to make a python program's stdout trigger an event for my node.js app to detect it and send that stdout's data to a client's browser.
The problem is the program won't deliver it's stdout until it terminates... and closes the pipe i guess.
I need it to be so as a line prints node gets the stdout after each print statement.
here's an example python program run with python program.py
from __future__ import print_function
import time
import os
import sys

for num in range(0,8):
    print('my []-- ', num)
    time.sleep(0.2)
    sys.stdout.flush()

Node which spawns a child process with
proc = spawn('python3 program.py -u')
var pid = proc.pid
echoIO( pid )
toggleState()
processDriver(proc)

below listens for the stdout and sends it to a browser with socket io
    function processDriver(proc) {
        proc.stdout.setEncoding('utf-8');
        proc.stdout.on('data', function (data) {
            echoIO(data)
        })
        proc.stderr.on('data', function (data) {
            console.log(data)
            var res = data.toString()
            echoIO(res)
        })

        proc.on('exit', function (code) {
            console.log(code)
            stateOff()
            echoIO("exit " + code)
            sendProcState(JSON.parse('{"status":"not_running"}'))
        })
    }

Also i've tested this problem in raspbian, ubuntu, and crunchbang, and the issue persists, no other solutions i've found on stackoverflow have worked yet. Sorry if this is about the 20th post.
EDIT:
I've also run into this now
stderr - execvp(): No such file or directory
events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: spawn ENOENT
...

A:
proc = spawn('python', ['program.py'], '-u')

it turns out my method of spawning the child was the error. It's a miracle that it ever spawned a child at all, playing with the code generated the error above, that led me to the post below.
But once I spawned it with this line, instead of a string with 'python program.py -u' it worked.
Node.js - spawned process is generating error "execvp(): No such file or directory"


text:
Q: question regarding the geometric meaning of eigenvalues and eigenvectors Ok so I've known how to get eigenvalues and eigenvectors for a while, but am becoming more interested in a 'simple' explanation of what actually is going on. I've looked up things on Google etc. What's confusing me is that it says x is an eigenvector of A if the image of x which is $\lambda x$ is parallel to x. Fine, but then even on wikipedia it shows a small graph where $Ax$ is lying along the vector x but it is just longer or stretched by $\lambda$. This obviously isn't parallel to x ? But x is an eigenvector?

A: Parallel in terms of linear algebra means that the two vectors have the same direction.  This can be characterised in $\mathbb{R}^3$ or $\mathbb{R}^2$ as the cross product of the two vectors being zero.  This is equivalent to the two vectors having the same direction, as
$$||a \times b|| = ||a|| ||b||\sin \vartheta \text{,}$$
where $\vartheta$ is the angle between the two vectors (note that this definition of parallel also implies that the zero vector is parallel to all vectors).
Also note that vectors can be picked up and moved around, so two vectors lying on top of eachother, as in your example, can be made parallel in the traditional sense by simply picking one up and moving it a bit to the side.
Another way to think geometrically of eigenvectors, which makes sense in all dimensions, not just 2 or 3, is that they are scaled by the linear operator (the matrix $A$) by the value $\lambda$ (the eigenvalue).  So eigenvectors are those that have only their magnitude changed by $A$, and not their direction.


text:
Q: How to get Eastern Standard Time[US] form my local server time in ASP.NET 1.1 I am currently working on a project on asp.net 1.1.I have a requirement where I need the timezone to be change to Eastern Standard Time[US]. I have a piece of code in .net 4.5 which seems to help but that is not supported in .net 1.1.
Below is the code for .net 4.5
TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
DateTime easternTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, easternZone);

So could you please help me on this.

A: things were very limited in .NET 1.1 as others have commented you really should not even use that anymore.
back in those days we had to manually adjust time because we did not have the helper TimeZoneInfo class.
DateTime utcDt = DateTime.UtcNow();
int easternTimeOffset = -5;
DateTime easternTime = utcDt.AddHours(easternTimeOffset);

the problem in this example is that easternTimeOffset is -4 during daylight savings and there was no good way in the framework to determine the current offset to use.
that problem was solved in later versions of .NET with the introduction of TimeZoneInfo class.
So, if you want to do things a better way you should consider updating the app to use a newer supported version of .NET

A: Really you should upgrade.  You only need .NET 3.5 to use TimeZoneInfo.  If you can at least get to .NET 2.0, then you can try TZ4NET.   But if you're on 1.1, you have to use code such as the following:
public static DateTime GetCurrentEasternTime()
{
    // The current rule for US Eastern Time is:
    //   -5 => -4: 2nd Sunday in March    (2:00 AM Local Time, 7:00 AM UTC)
    //   -4 => -5: 1st Sunday in November (2:00 AM Local Time, 6:00 AM UTC)

    DateTime utcNow = DateTime.UtcNow;

    DateTime springTransitionUtc = new DateTime(utcNow.Year, 3, 8, 7, 0, 0);
    while (springTransitionUtc.DayOfWeek != DayOfWeek.Sunday)
        springTransitionUtc = springTransitionUtc.AddDays(1);

    DateTime fallTransitionUtc = new DateTime(utcNow.Year, 11, 1, 6, 0, 0);
    while (fallTransitionUtc.DayOfWeek != DayOfWeek.Sunday)
        fallTransitionUtc = fallTransitionUtc.AddDays(1);

    bool isDst = utcNow >= springTransitionUtc && utcNow < fallTransitionUtc;

    int offset = isDst ? -4 : -5;

    DateTime easternNow = utcNow.AddHours(offset);

    return easternNow;
}


text:
Q: How can I handle html code sent by Json? I have this data from a json, it's html code, how can I print it like html because it only seems to print it as a String:
   "content": "Más pruebas\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003e\n\u003ca href=\"https://2.bp.blogspot.com/-CK43Mn516s4/WEmWGS9eoaI/AAAAAAAASg0/k4213387TNA0XInyTNgqaqEn4YYanzCZgCLcB/s1600/Monsters-Inc-Concept-Art.jpg\" imageanchor=\"1\" style=\"clear: left; float: left; margin-bottom: 1em; margin-right: 1em;\"\u003e\u003cimg border=\"0\" height=\"174\" src=\"https://2.bp.blogspot.com/-CK43Mn516s4/WEmWGS9eoaI/AAAAAAAASg0/k4213387TNA0XInyTNgqaqEn4YYanzCZgCLcB/s200/Monsters-Inc-Concept-Art.jpg\" width=\"200\" /\u003e\u003c/a\u003e\u003c/div\u003e\n\u003ca href=\"http://google.com/\"\u003eGoogle\u003c/a\u003e",

I'm using angularjs 1.x
Thank you all!

A: As you are receiving HTML code from your data source you should use the $sce service to escape it. Use
$sce.trustAsHtml(data)

Here is a plunker to demonstrate with your data which then displays the string as HTML:
https://plnkr.co/edit/LXLHhXCJ4zEZhFJSeT5W?p=preview

A: Use:


text:
Q: Creating Application scope as singleton in Kotlin In Dagger2 while using java I create the application scope and use as singleton as below
@Scope
@Retention(RetentionPolicy.CLASS)
public @interface MyApplicationScope {
}

Question : Now how to write the similar code in Kotlin
What I tried:
@Scope
@Retention(AnnotationRetention.RUNTIME)
annotation class ApplicationScope

I don't get the option .CLASS

A: The Kotlin equivalent to Java's RetentionPolicy.CLASS is AnnotationRetention.BINARY.  Both refer to annotations that need to be retained in the JAR or other compiler output file, but do not need to be available at runtime.


text:
Q: NSMutable array exception I am getting data from web service and displayed it in a tableview and at button click which is at tableview i am storing data id in nsmutablearray . Then i am comparing  clicked data id which is stored in nsmutable array with web service data in   cellForRowAtIndexPath function.
Error:
At code comparing in tableview, exception index not found.
At button click i tried these all::::
 [myidmutablearray addObject:[[webservicedata valueForKey:@"id"]objectAtIndex:clickedButtonIndexPath.row]];

 [myidmutablearray insertObject:[webservicedata valueForKey:@"id"] atIndex:clickedButtonIndexPath.row];

 [myidmutablearray replaceObjectAtIndex:clickedButtonIndexPath.row withObject:[webservicedata valueForKey:@"id"]];

At CellForRowAtIndexPath I tried this,
    if([myidmutablearray count]!=0)

    {
    if([[webservicedata valueForKey:@"id"] containsObject:[myidmutablearray objectAtIndex:indexPath.row]])

        NSLog(@"not empty");
    }

  else
        NSLog(@"empty");

A: NSMutableArray is not an array with an indefinite number of entries, whose index you can assign.
As you add objects to an NSMutableArray, the first entry added will be at index 0.  No matter what index you give to it when adding.
I think What you really want is an NSDictionary, with the key as an NSNumber made from the indexpath.row.  Then you can retrieve it later using an NSNumber again.
When saving, do something like this:
//defining somewhere
NSMutableDictionary *myIdMutableDictionary;

//then in the button click:
[myIdMutableDictionary setObject:[webservicedata valueForKey:@"id"] forKey:@(indexPath.row)];

//then later to check it, you test value would be in this:
[[myIdMutableDictionary objectForKey:@(indexPath.row)


text:
Q: CRASH on receiving in-app notification I have a live iOS project which I have integrated Urban Airship for sending Push Notifications. We are experiencing a really odd crash when sending Push Notification + In-App notifications.
For those of you who don't know what is Urban Airship or In-App Notification, have a look at this reference:

*

*https://docs.urbanairship.com/engage/in-app-messaging/

*https://docs.urbanairship.com/platform/ios/#in-app-messaging
The crash info:
Incident Identifier: 9A827662-CC1A-4149-A522-A49B6FCB4B44
CrashReporter Key:   99521F07-6C65-4369-999F-E5798EAED769
Hardware Model:      iPhone7,2
Process:         XXXXXX [1601]
Path:            /var/containers/Bundle/Application/XXXXX/XXXX.app/XXXXX
Identifier:      XXXXXX
Version:         2.6.1 (7191)
Code Type:       ARM-64
Parent Process:  ??? [1]

Date/Time:       2017-12-23T12:51:45Z
Launch Time:     2017-12-23T12:51:32Z
OS Version:      iPhone OS 11.2.1 (15C153)
Report Version:  104

Exception Type:  SIGABRT
Exception Codes: #0 at 0x1864282e8
Crashed Thread:  0

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'this request has been neutered - you can't call -sendResponse: twice nor after encoding it'

Last Exception Backtrace:
0   CoreFoundation                       0x0000000186916364 __exceptionPreprocess + 124
1   libobjc.A.dylib                      0x0000000185b5c528 objc_exception_throw + 52
2   CoreFoundation                       0x0000000186916238 +[NSException raise:format:arguments:] + 100
3   Foundation                           0x00000001872b17f4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 108
4   BaseBoard                            0x0000000188e220cc __40-[BSAction sendResponse:withCompletion:]_block_invoke + 576
5   libdispatch.dylib                    0x0000000186292a14 _dispatch_client_callout + 12
6   libdispatch.dylib                    0x000000018629b618 _dispatch_queue_barrier_sync_invoke_and_complete + 52
7   BaseBoard                            0x0000000188e21e08 -[BSAction sendResponse:withCompletion:] + 128
8   UIKit                                0x00000001905275d4 -[UIHandleRemoteNotificationAction sendResponse:] + 144
9   UIKit                                0x000000019006e710 __91-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:]_block_invoke_3.2829 + 68
10  libdispatch.dylib                    0x0000000186292a54 _dispatch_call_block_and_release + 20
11  libdispatch.dylib                    0x0000000186292a14 _dispatch_client_callout + 12
12  libdispatch.dylib                    0x000000018629f698 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1012
13  CoreFoundation                       0x00000001868be544 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
14  CoreFoundation                       0x00000001868bc120 __CFRunLoopRun + 2008
15  CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
16  GraphicsServices                     0x0000000188688f84 GSEventRunModal + 96
17  UIKit                                0x000000018fe5b67c UIApplicationMain + 232
18  XXXXXX                       0x00000001003d8e3c main (main.m:15)
19  libdyld.dylib                        0x00000001862f856c start + 0

Thread 0 Crashed:
0   libsystem_kernel.dylib               0x00000001864282e8 __pthread_kill + 8
1   libsystem_pthread.dylib              0x000000018653d2f8 pthread_kill$VARIANT$mp + 392
2   libsystem_c.dylib                    0x0000000186396fbc abort + 136
3   HockeySDK                            0x00000001010777ec 0x101004000 + 473068
4   CoreFoundation                       0x00000001869166d8 __handleUncaughtException + 624
5   libobjc.A.dylib                      0x0000000185b5c804 _objc_terminate() + 108
6   HockeySDK                            0x000000010106275c 0x101004000 + 386908
7   libc++abi.dylib                      0x0000000185b4c54c std::__terminate(void (*)()) + 12
8   libc++abi.dylib                      0x0000000185b4c5b8 std::terminate() + 56
9   libdispatch.dylib                    0x0000000186292a28 _dispatch_client_callout + 32
10  libdispatch.dylib                    0x000000018629b618 _dispatch_queue_barrier_sync_invoke_and_complete + 52
11  BaseBoard                            0x0000000188e21e08 -[BSAction sendResponse:withCompletion:] + 128
12  UIKit                                0x00000001905275d4 -[UIHandleRemoteNotificationAction sendResponse:] + 144
13  UIKit                                0x000000019006e710 __91-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:]_block_invoke_3.2829 + 68
14  libdispatch.dylib                    0x0000000186292a54 _dispatch_call_block_and_release + 20
15  libdispatch.dylib                    0x0000000186292a14 _dispatch_client_callout + 12
16  libdispatch.dylib                    0x000000018629f698 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1012
17  CoreFoundation                       0x00000001868be544 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
18  CoreFoundation                       0x00000001868bc120 __CFRunLoopRun + 2008
19  CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
20  GraphicsServices                     0x0000000188688f84 GSEventRunModal + 96
21  UIKit                                0x000000018fe5b67c UIApplicationMain + 232
22  XXXXXXX                        0x00000001003d8e3c main (main.m:15)
23  libdyld.dylib                        0x00000001862f856c start + 0

Thread 1:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 2:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 4:
0   libsystem_kernel.dylib               0x0000000186407568 mach_msg_trap + 8
1   CoreFoundation                       0x00000001868be308 __CFRunLoopServiceMachPort + 192
2   CoreFoundation                       0x00000001868bbed4 __CFRunLoopRun + 1420
3   CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
4   Foundation                           0x0000000187211594 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
5   Foundation                           0x00000001872309ac -[NSRunLoop(NSRunLoop) runUntilDate:] + 92
6   UIKit                                0x00000001909c57b8 -[UIEventFetcher threadMain] + 132
7   Foundation                           0x00000001873130f4 __NSThread__start__ + 992
8   libsystem_pthread.dylib              0x000000018653c2b4 _pthread_body + 304
9   libsystem_pthread.dylib              0x000000018653c180 _pthread_start + 308
10  libsystem_pthread.dylib              0x000000018653ab74 thread_start + 0

Thread 5:
0   libsystem_kernel.dylib               0x00000001864075bc semaphore_timedwait_trap + 8
1   libdispatch.dylib                    0x0000000186295870 _dispatch_semaphore_wait_slow + 68
2   AirshipKit                           0x0000000101324810 0x1012b4000 + 460816
3   Foundation                           0x00000001872edba0 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 12
4   Foundation                           0x000000018722d894 -[NSBlockOperation main] + 68
5   Foundation                           0x000000018721d4c4 -[__NSOperationInternal _start:] + 844
6   Foundation                           0x00000001872ef894 __NSOQSchedule_f + 400
7   libdispatch.dylib                    0x0000000186292a14 _dispatch_client_callout + 12
8   libdispatch.dylib                    0x000000018629af08 _dispatch_continuation_pop$VARIANT$mp + 424
9   libdispatch.dylib                    0x000000018629980c _dispatch_async_redirect_invoke$VARIANT$mp + 600
10  libdispatch.dylib                    0x000000018629fcf4 _dispatch_root_queue_drain + 596
11  libdispatch.dylib                    0x000000018629fa38 _dispatch_worker_thread3 + 116
12  libsystem_pthread.dylib              0x000000018653b06c _pthread_wqthread + 1264
13  libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 6:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 7:
0   JavaScriptCore                       0x000000018db2f9a4 WTF::HashTableAddResult<WTF::HashTableIterator<int, WTF::KeyValuePair<int, std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> > >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<int, std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> > > >, WTF::IntHash<int>, WTF::HashMap<int, std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> > > >::KeyValuePairTraits, WTF::UnsignedWithZeroKeyHashTraits<int> > > WTF::HashMap<int, std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> >, WTF::IntHash<int>, WTF::UnsignedWithZeroKeyHashTraits<int>, WTF::HashTraits<std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> > > >::add<std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> > >(int const&, std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> >&&) + 152
1   JavaScriptCore                       0x000000018db2f900 JSC::SourceProviderCache::add(int, std::__1::unique_ptr<JSC::SourceProviderCacheItem, std::__1::default_delete<JSC::SourceProviderCacheItem> >) + 28
2   JavaScriptCore                       0x000000018da7a560 bool JSC::Parser<JSC::Lexer<unsigned char> >::parseFunctionInfo<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::FunctionNameRequirements, JSC::SourceParseMode, bool, JSC::ConstructorKind, JSC::SuperBinding, int, JSC::ParserFunctionInfo<JSC::SyntaxChecker>&, JSC::Parser<JSC::Lexer<unsigned char> >::FunctionDefinitionType) + 7436
3   JavaScriptCore                       0x000000018d2efe8c JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 1980
4   JavaScriptCore                       0x000000018da8a6d4 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 548
5   JavaScriptCore                       0x000000018da88e74 JSC::SyntaxChecker::Property JSC::Parser<JSC::Lexer<unsigned char> >::parseProperty<JSC::SyntaxChecker>(JSC::SyntaxChecker&, bool) + 1120
6   JavaScriptCore                       0x000000018d2f16fc JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 8236
7   JavaScriptCore                       0x000000018da8a6d4 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 548
8   JavaScriptCore                       0x000000018d2f089c JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 4556
9   JavaScriptCore                       0x000000018da8a6d4 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 548
10  JavaScriptCore                       0x000000018d2f1178 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 6824
11  JavaScriptCore                       0x000000018da8a6d4 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 548
12  JavaScriptCore                       0x000000018d2ef570 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 248
13  JavaScriptCore                       0x000000018d2f21f8 JSC::SyntaxChecker::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseReturnStatement<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 264
14  JavaScriptCore                       0x000000018d2ee898 JSC::SyntaxChecker::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseStatement<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Identifier const*&, unsigned int*) + 284
15  JavaScriptCore                       0x000000018da7ee10 JSC::SyntaxChecker::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseStatementListItem<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Identifier const*&, unsigned int*) + 140
16  JavaScriptCore                       0x000000018da7ec1c JSC::SyntaxChecker::SourceElements JSC::Parser<JSC::Lexer<unsigned char> >::parseSourceElements<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::SourceElementsMode) + 772
17  JavaScriptCore                       0x000000018da7953c bool JSC::Parser<JSC::Lexer<unsigned char> >::parseFunctionInfo<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::FunctionNameRequirements, JSC::SourceParseMode, bool, JSC::ConstructorKind, JSC::SuperBinding, int, JSC::ParserFunctionInfo<JSC::SyntaxChecker>&, JSC::Parser<JSC::Lexer<unsigned char> >::FunctionDefinitionType) + 3304
18  JavaScriptCore                       0x000000018d2efe8c JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&) + 1980
19  JavaScriptCore                       0x000000018da8a6d4 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 548
20  JavaScriptCore                       0x000000018da80bc4 JSC::SyntaxChecker::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseVariableDeclarationList<JSC::SyntaxChecker>(JSC::SyntaxChecker&, int&, JSC::SyntaxChecker::DestructuringPattern&, JSC::SyntaxChecker::Expression&, JSC::JSTextPosition&, JSC::JSTextPosition&, JSC::JSTextPosition&, JSC::Parser<JSC::Lexer<unsigned char> >::VarDeclarationListContext, JSC::DeclarationType, JSC::Parser<JSC::Lexer<unsigned char> >::ExportType, bool&) + 1188
21  JavaScriptCore                       0x000000018da7f784 JSC::SyntaxChecker::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseVariableDeclaration<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::DeclarationType, JSC::Parser<JSC::Lexer<unsigned char> >::ExportType) + 76
22  JavaScriptCore                       0x000000018d2ee85c JSC::SyntaxChecker::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseStatement<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Identifier const*&, unsigned int*) + 224
23  JavaScriptCore                       0x000000018da7ee10 JSC::SyntaxChecker::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseStatementListItem<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::Identifier const*&, unsigned int*) + 140
24  JavaScriptCore                       0x000000018da7ec1c JSC::SyntaxChecker::SourceElements JSC::Parser<JSC::Lexer<unsigned char> >::parseSourceElements<JSC::SyntaxChecker>(JSC::SyntaxChecker&, JSC::SourceElementsMode) + 772
25  JavaScriptCore                       0x000000018da70298 bool JSC::Parser<JSC::Lexer<unsigned char> >::parseFunctionInfo<JSC::ASTBuilder>(JSC::ASTBuilder&, JSC::FunctionNameRequirements, JSC::SourceParseMode, bool, JSC::ConstructorKind, JSC::SuperBinding, int, JSC::ParserFunctionInfo<JSC::ASTBuilder>&, JSC::Parser<JSC::Lexer<unsigned char> >::FunctionDefinitionType) + 4280
26  JavaScriptCore                       0x000000018d2f614c JSC::ASTBuilder::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::ASTBuilder>(JSC::ASTBuilder&) + 3656
27  JavaScriptCore                       0x000000018da93620 JSC::ASTBuilder::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::ASTBuilder>(JSC::ASTBuilder&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 1844
28  JavaScriptCore                       0x000000018d2f7d30 JSC::ASTBuilder::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseMemberExpression<JSC::ASTBuilder>(JSC::ASTBuilder&) + 10796
29  JavaScriptCore                       0x000000018da93620 JSC::ASTBuilder::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseAssignmentExpression<JSC::ASTBuilder>(JSC::ASTBuilder&, JSC::Parser<JSC::Lexer<unsigned char> >::ExpressionErrorClassifier&) + 1844
30  JavaScriptCore                       0x000000018d2fb068 JSC::ASTBuilder::Expression JSC::Parser<JSC::Lexer<unsigned char> >::parseExpression<JSC::ASTBuilder>(JSC::ASTBuilder&) + 104
31  JavaScriptCore                       0x000000018da9ef70 JSC::ASTBuilder::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseExpressionOrLabelStatement<JSC::ASTBuilder>(JSC::ASTBuilder&, bool) + 736
32  JavaScriptCore                       0x000000018da9b3d4 JSC::ASTBuilder::Statement JSC::Parser<JSC::Lexer<unsigned char> >::parseStatementListItem<JSC::ASTBuilder>(JSC::ASTBuilder&, JSC::Identifier const*&, unsigned int*) + 880
33  JavaScriptCore                       0x000000018da5c1fc JSC::ASTBuilder::SourceElements JSC::Parser<JSC::Lexer<unsigned char> >::parseSourceElements<JSC::ASTBuilder>(JSC::ASTBuilder&, JSC::SourceElementsMode) + 312
34  JavaScriptCore                       0x000000018da57690 JSC::Parser<JSC::Lexer<unsigned char> >::parseInner(JSC::Identifier const&, JSC::SourceParseMode) + 716
35  JavaScriptCore                       0x000000018d512f24 std::__1::unique_ptr<JSC::ProgramNode, std::__1::default_delete<JSC::ProgramNode> > JSC::Parser<JSC::Lexer<unsigned char> >::parse<JSC::ProgramNode>(JSC::ParserError&, JSC::Identifier const&, JSC::SourceParseMode) + 92
36  JavaScriptCore                       0x000000018d503c24 std::__1::unique_ptr<JSC::ProgramNode, std::__1::default_delete<JSC::ProgramNode> > JSC::parse<JSC::ProgramNode>(JSC::VM*, JSC::SourceCode const&, JSC::Identifier const&, JSC::JSParserBuiltinMode, JSC::JSParserStrictMode, JSC::JSParserScriptMode, JSC::SourceParseMode, JSC::SuperBinding, JSC::ParserError&, JSC::JSTextPosition*, JSC::ConstructorKind, JSC::DerivedContextType, JSC::EvalContextType, JSC::DebuggerParseData*) + 184
37  JavaScriptCore                       0x000000018d586104 JSC::UnlinkedProgramCodeBlock* JSC::generateUnlinkedCodeBlock<JSC::UnlinkedProgramCodeBlock, JSC::ProgramExecutable>(JSC::VM&, JSC::ProgramExecutable*, JSC::SourceCode const&, JSC::JSParserStrictMode, JSC::JSParserScriptMode, JSC::DebuggerMode, JSC::ParserError&, JSC::EvalContextType, JSC::VariableEnvironment const*) + 124
38  JavaScriptCore                       0x000000018d584324 JSC::UnlinkedProgramCodeBlock* JSC::CodeCache::getUnlinkedGlobalCodeBlock<JSC::UnlinkedProgramCodeBlock, JSC::ProgramExecutable>(JSC::VM&, JSC::ProgramExecutable*, JSC::SourceCode const&, JSC::JSParserStrictMode, JSC::JSParserScriptMode, JSC::DebuggerMode, JSC::ParserError&, JSC::EvalContextType) + 308
39  JavaScriptCore                       0x000000018d5841e0 JSC::CodeCache::getUnlinkedProgramCodeBlock(JSC::VM&, JSC::ProgramExecutable*, JSC::SourceCode const&, JSC::JSParserStrictMode, JSC::DebuggerMode, JSC::ParserError&) + 36
40  JavaScriptCore                       0x000000018d2fdcac JSC::ProgramExecutable::initializeGlobalProperties(JSC::VM&, JSC::ExecState*, JSC::JSScope*) + 184
41  JavaScriptCore                       0x000000018d8c8714 JSC::Interpreter::executeProgram(JSC::SourceCode const&, JSC::ExecState*, JSC::JSObject*) + 10952
42  JavaScriptCore                       0x000000018d5bc390 JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) + 312
43  JavaScriptCore                       0x000000018d92626c JSEvaluateScript + 444
44  XXXXXX                        0x000000010069fed4 executeApplicationScript(NSData*, NSURL*, RCTJSCWrapper*, RCTPerformanceLogger*, OpaqueJSContext*) + 228
45  XXXXX                        0x00000001006a1c3c __64-[RCTJSCExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke + 256
46  XXXXXXX                        0x00000001006a1dd8 -[RCTJSCExecutor executeBlockOnJavaScriptQueue:] + 168
47  Foundation                           0x00000001873132e4 __NSThreadPerformPerform + 336
48  CoreFoundation                       0x00000001868be97c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
49  CoreFoundation                       0x00000001868be8fc __CFRunLoopDoSource0 + 84
50  CoreFoundation                       0x00000001868be184 __CFRunLoopDoSources0 + 200
51  CoreFoundation                       0x00000001868bbd5c __CFRunLoopRun + 1044
52  CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
53  XXXXXX                        0x000000010069f13c +[RCTJSCExecutor runRunLoopThread] + 260
54  Foundation                           0x00000001873130f4 __NSThread__start__ + 992
55  libsystem_pthread.dylib              0x000000018653c2b4 _pthread_body + 304
56  libsystem_pthread.dylib              0x000000018653c180 _pthread_start + 308
57  libsystem_pthread.dylib              0x000000018653ab74 thread_start + 0

Thread 8:
0   libsystem_kernel.dylib               0x00000001864280f0 __psynch_cvwait + 8
1   libc++.1.dylib                       0x0000000185adff34 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 92
2   JavaScriptCore                       0x000000018dc1cd94 std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 120
3   JavaScriptCore                       0x000000018dc1cc68 std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lock<bmalloc::Mutex>, std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<bmalloc::Mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 104
4   JavaScriptCore                       0x000000018dc1caec bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 276
5   JavaScriptCore                       0x000000018dc1cde4 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >(void*) + 40
6   libsystem_pthread.dylib              0x000000018653c2b4 _pthread_body + 304
7   libsystem_pthread.dylib              0x000000018653c180 _pthread_start + 308
8   libsystem_pthread.dylib              0x000000018653ab74 thread_start + 0

Thread 9:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 10:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 11:
0   libsystem_kernel.dylib               0x0000000186407568 mach_msg_trap + 8
1   CoreFoundation                       0x00000001868be308 __CFRunLoopServiceMachPort + 192
2   CoreFoundation                       0x00000001868bbed4 __CFRunLoopRun + 1420
3   CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
4   CoreFoundation                       0x000000018682af54 CFRunLoopRun + 112
5   CoreMotion                           0x000000018bc490e8 CLStartStopAdvertisingBeacon + 227260
6   libsystem_pthread.dylib              0x000000018653c2b4 _pthread_body + 304
7   libsystem_pthread.dylib              0x000000018653c180 _pthread_start + 308
8   libsystem_pthread.dylib              0x000000018653ab74 thread_start + 0

Thread 12:
0   libsystem_kernel.dylib               0x00000001864280f0 __psynch_cvwait + 8
1   WebCore                              0x000000018e6feb88 SendDelegateMessage(NSInvocation*) + 584
2   CoreFoundation                       0x000000018691ba1c ___forwarding___ + 620
3   CoreFoundation                       0x0000000186800ecc _CF_forwarding_prep_0 + 88
4   WebKitLegacy                         0x000000018fb048b8 __48-[WebFrame(WebPrivate) deviceOrientationChanged]_block_invoke + 112
5   WebCore                              0x000000018f826a08 HandleRunSource(void*) + 684
6   CoreFoundation                       0x00000001868be97c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
7   CoreFoundation                       0x00000001868be8fc __CFRunLoopDoSource0 + 84
8   CoreFoundation                       0x00000001868be184 __CFRunLoopDoSources0 + 200
9   CoreFoundation                       0x00000001868bbd5c __CFRunLoopRun + 1044
10  CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
11  WebCore                              0x000000018e6e92c8 RunWebThread(void*) + 556
12  libsystem_pthread.dylib              0x000000018653c2b4 _pthread_body + 304
13  libsystem_pthread.dylib              0x000000018653c180 _pthread_start + 308
14  libsystem_pthread.dylib              0x000000018653ab74 thread_start + 0

Thread 13:
0   libsystem_kernel.dylib               0x0000000186428d80 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x000000018653ab6c start_wqthread + 0

Thread 14:
0   libsystem_kernel.dylib               0x0000000186407568 mach_msg_trap + 8
1   CoreFoundation                       0x00000001868be308 __CFRunLoopServiceMachPort + 192
2   CoreFoundation                       0x00000001868bbed4 __CFRunLoopRun + 1420
3   CoreFoundation                       0x00000001867dbe58 CFRunLoopRunSpecific + 432
4   CFNetwork                            0x00000001870cb128 -[__CoreSchedulingSetRunnable runForever] + 776
5   Foundation                           0x00000001873130f4 __NSThread__start__ + 992
6   libsystem_pthread.dylib              0x000000018653c2b4 _pthread_body + 304
7   libsystem_pthread.dylib              0x000000018653c180 _pthread_start + 308
8   libsystem_pthread.dylib              0x000000018653ab74 thread_start + 0

Thread 0 crashed with ARM-64 Thread State:
    pc: 0x00000001864282e8     fp: 0x000000016fa76450     sp: 0x000000016fa76420     x0: 0x0000000000000000
    x1: 0x0000000000000000     x2: 0x0000000000000000     x3: 0xffffffffffffffff     x4: 0x0000000000000010
    x5: 0x0000000000000010     x6: 0x0000000000000000     x7: 0x0000000000000000     x8: 0x0000000008000000
    x9: 0x0000000004000000    x10: 0x00000001865415e0    x11: 0x00000001b9d21ebc    x12: 0x00000001b9d21ebc
   x13: 0x0000000000000018    x14: 0x0000000000000001    x15: 0x0000000000000881    x16: 0x0000000000000148
   x17: 0x0000000000000000    x18: 0xfffffff01b69925c    x19: 0x0000000000000006    x20: 0x00000001b79f3b80
   x21: 0x0000000101a43490    x22: 0x0000000000000303    x23: 0x00000001b79f3c60    x24: 0x00000001b7a00000
   x25: 0x0000000190b8b5fe    x26: 0x0000000190b953b5    x27: 0x00000001869ae23f    x28: 0x00000001b6182a18
    lr: 0x000000018653d2f8   cpsr: 0x0000000000000000

Do you have any idea of what this could be?


text:
Q: Draggable Inner Frame similar to google maps Been playing with the thought of javascript game. Especially RTS types... the question is as followed.
How do i work on creating a draggable inner frame, similar to google maps?
The idea, is that there is an overlaying UI, and a much larger draggable map underneath. Sort of similar to your usual RTS games. However i been trying to figure a simple work around for such an interface. Is there a ready made API for something similar?, or would i need to do it from scratch?.
If possible, it should work on an iphone too =X
Additional info:
From what i know so far, it seems like google maps uses a draggable element placed ontop of the map, detecting the drag events. What i dun understand however, is how, it is still able to hit objects beneath it...

A: I just threw this together in a second:
http://jsfiddle.net/purmou/mrJtG/
It uses jQuery UI's (http://jqueryui.com/home) "Draggable" function. Here's the HTML and CSS:
#range {
    width:400px;
    height:400px;
    overflow:hidden;
    border:1px solid black;
}

And here's the jQuery:
jQuery(document).ready(function() {
    jQuery("#map").draggable();
});

Take a look at the Draggable page here for further exploration.

A: I don't think this answer is valid, as jQueryUI's draggable does not work on touch devices and PicoCreator clearly stated that he needs it to work on an iPhone/iOS/Touch Interface


text:
Q: Document Information Panel was unable to load: NodeTest expected here We are using SP built-in feature to map document library columns to Word QuickParts. We are using default template for Microsoft Office applications.
Most of Word templates are working fine, but several do not behave as expected. When I open the document by clicking the link in document library, the document is loaded in Word client application, but Document Information Panel is unable to load. This prevents me from saving the document back to document library.
This is the error thrown by Word client application:

The form cannot be opened. To fix this problem, contact the form
  designer.
  Form template:
  http://servername/sites/sitename/proppanel.xsn
  Document
  Information Panel cannot open the following view: ContentType Properties
  - Server
  The following view file is not valid: view2.xsl
  The .xsl file is not valid XSL.
  NodeTest expected here.
@<--

The only tool which I have used for debugging purposes was Fiddler so far.
Could anyone point me in the right direction on how to debug this issue?

A: After trial and error I located the faulty site column by excluding one by one site column from content type.
Not a nice solution but at least I was able to pin point the site column which was causing problems. Unfortunately it took me around 15 deploys to isolate the problem.


text:
Q: Not able to load c3 graph data with ajax HI i want to load dynamic data with date time range with c3 graph
Here is my CODE :
$.ajax({
    [...]
    success: function(data) {
        chart.load({
            columns: data,
            unload: chart.columns,
        });
    }
});

The Ajax response is  :
[['Friday', 1],['Friday', 3],['Sunday', 1],['Saturday', 2],['Friday', 3],['Friday', 3],['Friday', 5],['Friday', 3],['Monday', 1],['Friday', 1],['Tuesday', 1]]

On success haven't seen anything on my graph . even i have commented "unload"
but still same  . the function is works fine if i put statically . please help  me

A: You're using it wrong. It's not exporting a chart function, but a c3 function. The following will generate a chart (that doesn't look too good but I don't know what you're expecting).
You also missed to define an output div, thus I added #chart.

var data = [['Friday', 1],['Friday', 3],['Sunday', 1],['Saturday', 2],['Friday', 3],['Friday', 3],['Friday', 5],['Friday', 3],['Monday', 1],['Friday', 1],['Tuesday', 1]];

var data2 = [['Friday', 3],['Friday', 10],['Sunday', 50],['Saturday', 20],['Friday', 15],['Friday', 10],['Friday', 6],['Friday', 8],['Monday', 5],['Friday', 20],['Tuesday', 13]];

var chart = c3.generate({
    bindto: '#chart',
    data: {
      columns: data
    }
});

setTimeout(function() {
    chart.load({
        columns: data2
    });
}, 2000)

A: Did you try brackets around columns: data in the chart.load function argument ? Here is a piece of code which works in my application
$(document).on("click", "#btnPDquant", function(event) {
$.ajax({
url: "PDQuantCalc",
type: "post",
data: $('#formPDquant').serialize(),
success: function(response){
    var newdat = JSON.parse(response);
    chart.x(newdat.year);
        chart.load({
            columns: [ newdat.PDquant ]
    });
}
event.preventDefault(); // Important! Prevents submitting the form.
});


text:
Q: Recovering data from TrueNAS pool in Ubuntu I am having a heck of a time trying to get my data off my drives that were in a pool in TrueNAS. I installed Ubuntu on another drive in the same server and loaded Ubuntu 21.04 and installed zfsutils. I was able to import the pool and finally figure out how to mount the vdevs,kinda, and see the data. Right now it is resilvering, but it is taking forever. It is in a degraded state. A drive had failed out of no where after I replaced another drive. This drive wasn't previously showing any issues or errors before. That is when it all start with the I/O errors and all. I have been working on this for days, trying to get the files off the pool. The one failed drive listed in the pic, I can't remove it. I would also like to try and speed up the resilvering if possible. I had a backup of all this data, but it was temporarily wiped due to moving over to another system. I know, stupid mistake, but I wasn't expecting the drive that showed no errors or symptoms of being bad, to actually fail on me out of nowhere.
So back to recovering the data. I can browse the pool and dataset and see the data, but when I try to copy over the files, I get an I/O error and it won't copy. Can anyone please help me figure this out? Even if I need to do an actual data recovery, that is fine, I just don't want to lose 88tb worth of data. Please forgive me ahead of time, I am not a Linux guy, I come from a Windows and Mac background. Everyone talked about TrueNAS/FreeNAS and thought I would give it a shot, but I've had nothing but trouble out of it since I set it up. I've replaced 8 drives so far and they might not have actually been bad, except this one drive. I know ZFS is supposed to be solid, but since I don't know Linux, maybe I'm just not understanding how to go about recovering the data back properly.
Here is the errors that I'm seeing. The last pic shows the unavailable drive that is currently removed out of the system.

A: I would not have used a Linux system for a FreeBSD zpool (because this is TrueNAS, a BSD system and has nothing to do with Linux)
" I would also like to try and speed up the resilvering if possible "
In fact, no, or rather, it depends on the version of zfs you are using.
The more modern ones have (by themselves, you don't have to do anything) a more advanced, sequential resilvering, which improves times, especially for almost full volumes.
It is an openzfs technology, essentially an attempt to merge zfs development on BSD with Linux.
In the case of BSD it is active since version 13 (and, personally, I do not find it particularly reliable)
Back to the question: I suppose you are done by now, or do you need further support?


text:
Q: Delete the word null from text string I have a string that is like this word1 - null - word3, is it possible to write an sql query to remove the word null from the string of text?
Thanks

A: you can use REPLACE function:
DECLARE @Test AS VARCHAR(32)
SELECT @Test = 'word1 - null - word3'

SELECT REPLACE(@Test, 'null - ', '')

A: Use REPLACE.
Query
declare @str as varchar(50);
set @str = 'word1 - null - word3';

select replace(@str,'null','');


text:
Q: How to provide type hints in JavaScript using JSDoc for Apollo Client based code? I have trouble setting up type hints for my JavaScript code using JSDoc (trying to make this work with VSCode and WebStorm).
As first step, I converted GraphQL schema into set of JSDoc @typedef entries using @graphql-codegen/cli. For the sake of this conversation, lets talk about this one:
// schema.js

/**
 * @typedef {Object} Country
 * @property {string} code
 * @property {string} name
 */

Then, somewhere in my App.js I tried writing:
// App.js

const GET_COUNTRIES = gql`
  query GetCountries {
    countries {
      code
      name
    }
  }
`;

/**
 * @typedef {import("./schema").Country} Country
 * @typedef {import("@apollo/client").QueryResult} QueryResult

 * @returns {QueryResult<Country>}
 */
const useGetCountries = () => {
  return useQuery(GET_COUNTRIES);
};

However, it looks like the type definitions from schema.js are being ignored (both App.js and schema.js are in the same directory).
My question is this: is it possible to setup something like this - have IDE pickup JSDoc type definitions and provide type hints? If the answer is YES, how would I go around settings this up?
I've created a simple repro on CodeSandbox at https://codesandbox.io/s/graphql-type-hints-n1vh0

A: While I was unable to make this work using just JSDoc, I had a good success using the same @graphql-codegen/cli utility and generating .d.ts file instead. After that, I was able to provide correct type hints using the following code:
/**
 * @typedef {import("../types/schema").Country} Country
 * @typedef {import("../types/helpers").ApolloQueryResult<{countries: Country[]}>} QueryResult
 *
 * @returns {QueryResult}
 */
const useGetCountries = () => {
  return useQuery(GET_COUNTRIES);
};

I also implemented helpers.d.ts so that I can easily make fields of my choosing optional (unlike the built-int Partial type that makes all fiels optional) and make data filed of QueryResult optional as well (as in Apollo documentation. Didn't had the time to figure out why it is not already in Apollo's .d.ts)
type OptionalKey<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

export type ApolloQueryResult<TData = any, TVariables = any> = OptionalKey<
  QueryResult<TData, TVariables>,
  "data"
>;


text:
Q: Iframe not displaying 'Your connection is not private' warning I'm in the in the process of developing an application for a client, which will have an SSL certificate and be served under https. In this I am using iframe to display another url.
Both these URLs are on https, but the problem is that the url which will be displayed on iframe has a warning 'Your connection is not private'.
I have created a self-signed certificate for both these https urls and it is node application and the server where it will be installed is centos. I am trying to display the waring 'Your connection is not private' on the iframe but unable to do so.
Is there any way to do so. And also can the self signed certificate be installed in he app so that these warning may not come at all, if so please share the steps to do so.
Please help.


text:
Q: Trying to get python to work I'm in linux. The Python (version 3.6.7)is in my linux operating system and I have fetched all the libs & tk. The next step would be for me to go to downloads then tar. I type the following: cd download to get in that directory. I get an error that nothing is in the directory. What am I doing wrong? I also tried cd downloads/.

A: Linux file system is case-sensitive. Try cd Downloads. If you want to get a list of all files and directories in your current working directory, type ls.


text:
Q: Multifile C Python Extension Organization Issue Currently, I am trying to write a C Python extension. Specifically, I am trying to create a python module that has a couple of classes in it. Basically, I want it to look something like this:
my_module
     class foo
     class bar

Here's some context as to what I'm working with now.
So far, my source tree looks something like this:
src/
    my_module_main.c
    my_module_defs.h
    my_module_foo.c
    my_module.bar.c

The file my_module_main.c contains the module initialization. This includes the initmy_module function, the definition of my PyTypeObjects for each class, and their corresponding method tables.
The file my_module_defs.h contains all of the definition of functions and types. It contains the
typedef struct {
    PyObject_HEAD
    ...
} foo;

object definitions as well.
Both the my_module_foo.c and my_module_bar.c files contains the definition of the functions for each of the classes. These files contain the actual functions used by these functions (i.e allocators, constructors, destructors, and methods).
Now for my actual problem.
One thing that I am trying to do within this project is access the underlying objects of the class structures (the structs with PyObject_HEAD in them). To do this, you need to use the PyTypeObject structure. That object, however, is located in my_module_main.c and is declared as static, so it is not accessible in my other C files.
My question is this: is there a way that I can share this PyObjectType across multiple source files? Do I have to declare things as extern? I know that I could put the entire module into one source file, but this would be a pain because the file would be too large and have too much going on.
Thanks for your help. If there are any glaring issues with my setup, feel free to comment on it as I am new to this process and could use some pointers. Thanks!

A: The way the CPython implementation handles this for its own API types is to define the type object in their C file (like you have) and then extern its type objects in their header files. For instance, for the float object you have:
floatobject.h
#ifndef Py_FLOATOBJECT_H
#define Py_FLOATOBJECT_H

...

PyAPI_DATA(PyTypeObject) PyFloat_Type;

...

#endif

floatobject.c
PyTypeObject PyFloat_Type = {
    ...
};

Where PyAPI_DATA has a default implementation of simply (in Include/pyport.h):
#define PyAPI_DATA(RTYPE) extern RTYPE

This only really changes if you are on windows.


text:
Q: Find pattern and append in sed I am having difficulty to find a pattern and append line before the pattern in sed
Suppose i want to find the following pattern with sed
"stackov/er;flo.w users are great"

Note:The pattern to be search contain double quotes , /, ; and dot
And then append this line just before pattern
proud sta{ckov,er member

My attempts
1.sed "|"stackov/er;flo.w users are great"|i\proud sta{ckov,er member" file
2.
sed "/stackov/er;flo.w users are great|i\proud sta{ckov,er member" file

I tried to replace the / delimiter by | and then escaping / in pattern with \ but it didn't work.
Any help appreciated

A: This might work for you (GNU sed):
sed '/"stackov\/er;flo\.w users are great"/i\proud sta{ckov,er member' file

A: Unless you're on Windows (in which case I don't know), you basically want the entire sed script in single quotes, not double.
sed '\|"stackov/er;flo.w users are great"|i\proud sta{ckov,er member' file

You can make it work with double quotes as well, but unless you specifically require double quotes, you should default to single quotes. Read up on the shell's quoting behavior if you want to use it in the future as well.