using System;
public class Newton_Ralphson
{
public double compute(double x,int n,double[] P) // x, degree, coefficients
{
double pol = 0;
for (int i = 0;i < n;i++)
{
for (int j = 1; j < n - i; j++)
x *= x;
pol += P[n - i] * x;
}
pol += P[0];
return pol;
}
public double[] secondary_Pol(int n, double[] P) //slope
{
double[] secP = new double[n - 1];
for (int i = 0; i < n …Run Code Online (Sandbox Code Playgroud) 我看过其他帖子,但似乎没有一个解决方案适合我的问题。错误出在方法上FirebaseRef.setValue()
我正在尝试将数据保存到Firebase server. 起初我认为错误是因为我尝试将数据保存为自定义对象,然后我尝试将其保存为基本哈希(我按照此链接中的教程进行操作)
protected Boolean doInBackground(Void... params) {\n // Database Connection, if no connection or what not, exception will be here\n mDatabase = FirebaseDatabase.getInstance().getReference();\n Log.d(DBTAG, mDatabase.toString());\n\n // \'child database\'\n mBooksDatabase = mDatabase.child("books");\n mCurrentUser = mDatabase.child("users").child(mUserEmail);\n\n // address to upload the book, later we can call newBookRef.getKey() to get the ID\n // and use the ID to indicate the relationship between the owner and the book\n final DatabaseReference newBookRef = mBooksDatabase.push();\n try {\n …Run Code Online (Sandbox Code Playgroud)