Expo Branch: undefined is not an object (evaluating ‘RNBranch.STANDARD EVENT ADD_TO_CART’)

I am using expo for my react native application. I start my application using the expo start command and it works fine. When I start the app back the next day using the same command expo start I encounter this error. I did not change a single line of code.

I believe this has something to do with the expo branch feature (https://docs.expo.io/versions/latest/sdk/branch/). This error only occurred on Android. It is working fine in IOS.

Error Message

Evaluating a service advertising “new video GPU” for macbook pros with the GPU defect

If someone advertises a service for a “NEW VIDEO GPU”for the 2011-2012 MacBooks with the GPU defect, could that be other than fraudulent? Isn’t the defect in the solder used for the GPU (low lead), rather than a defective GPU chip, and so replacing the GPU is not the issue, but resoldering is what is needed?

iReport error: JRExpressionEvalException: Error evaluating expression

I have an iReport which uses a jTable as a data source. I added a new column today to the iReport and jTable and made all the necessary changes. However, the below exception gets thrown every time I try to run the report from my Java application.

Since I couldn’t find a solution, I removed my jrxml file from the correct path and yet I get the same exception. So I am starting to think this is not an issue with my report. Can someone help? Thanks!

net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $ F{COLUMN_2}

  • Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘OXEMBERG DENIM pencil cut’ with class ‘java.lang.String’ to class ‘java.lang.Integer’ at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToNumber(DefaultTypeTransformation.java:143) at org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:248) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:599) at Sales_1552118302571_970096.evaluate(calculator_Sales_1552118302571_970096:240) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:250) … 103 more

Evaluating association strengths of items

Say I have a list of animals with their counts:

import numpy as np import pandas as pd from random import randint  table = np.zeros((5,1), dtype=int) for i in range(5):     table[i]=randint(10, 20)  df1 = pd.DataFrame(columns=['Animal', 'Count']) df1['Animal'] = animal_list df1['Count'] = table df1 

enter image description here

And I have a matrix of how many times they appear together:

table = np.zeros((5,5), dtype=int) animal_list = ['Monkey', 'Tiger', 'Cat', 'Dog', 'Lion']  for i in range(5):     for j in range(5):         table[i][j]=randint(0, 9)  df2 = pd.DataFrame(table, columns=animal_list, index=animal_list) df2 

enter image description here

I want to find the animals’ association strength, which is defined like so – if Lion and Cat appear together 5 times, and Lion‘s count is 10 and Cat‘s count is 15, then Lion -> Cat association strength is 5/10=0.5, and Cat -> Lion association strength is 5/15=0.33.

I do it like so:

assoc_df = pd.DataFrame(columns=['Animal 1', 'Animal 2', 'Association Strength']) for row_word in df2:     for col_word in df2:         if row_word!=col_word:             assoc_df = assoc_df.append({'Animal 1': row_word, 'Animal 2': col_word,                                          'Association Strength': df2[col_word][row_word]/df1[df1.Animal==row_word]['Count'].values[0]}, ignore_index=True)  assoc_df 

enter image description here

The problem is, since there are 2 for loops, the complexity is O(n^2). This is a problem when (in my real dataset) I have ~1000 animals to loop on, which takes hours to finish computing the association strength table.

So, how to do I better optimize the creation/generation process of this association table?

P.S.: In most practical use cases, df2 is a symmetric matrix, as “X appears together with Y” generally also means the same as “Y appears together with X. So, I am ok with solutions that assume that df2 is symmetric, and cut down the running time by half. In the above example, df2 is not a symmetric matrix, which is applicable for situations where we want to express meanings such as “X appears after Y” and “Y appears after X“, which are not the same.

Evaluating Fourier Coefficients [Approach needed]

I need to evaluate the Fourier Coefficients $ A_{nm}$ and $ B_{nm}$ using the following equation

$ $ \frac{1}{c}\sum_{n,m=1}^\infty\sin(\frac{n\pi x}{L})\sin(\frac{m\pi y}{l})\gamma(A_{nm}-B_{nm}) = \delta e^{\frac{-b_c y}{l}} + P-Q+R-S \rightarrow (\mathrm{1}) $ $

$ P =\sum_{n,m=1}^\infty\frac{b_c^2}{b_c^2+(m\pi)^2}(A_{nm}+B_{nm})\sin(\frac{n\pi x}{L})\sin(\frac{m\pi y}{l})$

$ Q =\sum_{n,m=1}^\infty \frac{b_c m\pi}{b_c^2+(m\pi)^2}(A_{nm}+B_{nm})\sin(\frac{n\pi x}{L})\cos(\frac{m\pi y}{l})$

$ R = \sum_{n,m=1}^\infty \frac{b_c m\pi}{b_c^2+(m\pi)^2}(A_{nm}+B_{nm})e^{\frac{-b_c y}{l}}$

$ S = \sum_{n,m=1}^\infty(A_{nm}+B_{nm})\sin(\frac{n\pi x}{L})\sin(\frac{m\pi y}{l})$

Here ,$ \gamma^2 = (\frac{n\pi}{L})^2 + (\frac{m\pi}{l})^2$ and $ c,\delta$ are constants.

Obviously, there would be another relation that would be a linear equation in $ A$ and $ B$ to finally deduce the values of $ A_{nm}$ and $ B_{nm}$ separately.My question pertains to the fact as to how should I handle the $ e^{\frac{-b_c y}{l}}$ term here.


I can multiply both sides of the equation $ \mathrm{(1)}$ with $ \int_0^L\sin(\frac{k\pi x}{L})$ and $ \int_0^l\sin(\frac{j\pi y}{l})$ and then use the principle of orthogonality to finally arrive at

For some $ n=k$ and $ m=j$ , $ \mathrm{(1)}$ becomes

$ $ \frac{1}{c}\frac{L}{2}\frac{l}{2}\gamma(A_{kj}-B_{kj})=\delta e^{\frac{-b_c y}{l}}\int_0^L\sin(\frac{k\pi x}{L})\int_0^l\sin(\frac{j\pi y}{l})+\underbrace{\frac{b_c^2}{b_c^2+(j\pi)^2}(A_{kj}+B_{kj})\frac{L}{2}\frac{l}{2}}_{P} – \overbrace{0}^{Q} + \underbrace{\sum_{n,m=1}^\infty \frac{b_c m\pi}{b_c^2+(m\pi)^2}(A_{nm}+B_{nm})e^{\frac{-b_c y}{l}}\int_0^L\sin(\frac{k\pi x}{L})\int_0^l\sin(\frac{j\pi y}{l})}_{R} – \overbrace{(A_{kj}+B_{kj})\frac{L}{2}\frac{l}{2}}^{S} $ $

Also somewhere I was suggested that $ e^{\frac{-b_c y}{l}}$ can be decomposed into its own Fourier series which gives me

$ e^{\frac{-b_c y}{l}} = \frac{1}{b_c}\bigg(1-\frac{e^{-b_c}}{b_c}\bigg) + \sum_{n=1}^\infty \frac{2}{l(\frac{b_c^2}{l^2}+n^2)} \bigg( e^{-b_c}\bigg(n\sin(nl)-\frac{b_c}{l}\cos(nl)\bigg)+\frac{b_c}{l}\bigg) + \sum_{n=1}^\infty \frac{2}{l(\frac{b_c^2}{l^2}+n^2)} \bigg( e^{-b_c}\bigg(n\cos(nl)-\frac{b_c}{l}\sin(nl)\bigg)+n\bigg)$

I am really confused about what I should do next (should I just substitute this expansion in $ \mathrm{1}$ ) or how should I approach the problem ? Any suggestions would be helpful and really appreciated.

Evaluating expressions in “case” vs using “if/else if”

I was just tempted to write a similar piece of code to the one presented in this answer on SO (posted below). The problem is having to discriminate between different cases where exactly one case is true.

In my experience switch statements are usually use to match the value of an expression against various constants. But in this case we use a switch statement to decide which of the conditions is true. To do this I would actually prefer using if/else if because switch(true) feels a little bit like an abuse of switch, but this is just a gut feeling. On the other hand I think this piece of code is still prefectly readable even with its seemingly unconventional use of a switch statement.

Are there any objective reasons why one would prefer switch over if/else if or vice versa when it comes to code quality, performance and readability?

switch (true) {   case (amount >= 7500 && amount < 10000):     //code     break;   case (amount >= 10000 && amount < 15000):     //code     break;    //etc... 

Evaluating Dirichlet $L$-functions at $s=1$

I’m trying to find references on general methods for evaluating Dirichlet $ L$ -functions at $ s=1$ , but it’s proving a little harder to google than I’d hoped. Specifically I’m looking for any books or papers that go through methods for solving the following question: suppose I have a (possibly primitive) Dirichlet character $ \chi$ of conductor $ q$ , what is the value of $ L(1,\chi)$ ? Any insights anyone has about this that aren’t a book or paper would also be very much appreciated.

This question has a good amount of detail on how to approach the problem, but it only covers odd characters. The Wikipedia page for the analytic class number formula also has this section, which gives closed forms for $ L$ -functions at $ s=1$ , but this is only for primitive characters with prime conductors (and possibly only for quadratic characters?) This is as much as I could find, and as for the more general cases I’m at a bit of a loss.