问:
How to create modify QR code design in react native?
In my react native application I have to generate QR code in customise way.

I am using this library to generate QR code react-native-qrcode-svg and it is working well.
But the design is not able to make same as requirement. I am trying to achieve like that

<QRCode
  color={Colors.DARK_PURPLE}
  value={item.value}
  size={windowWidth - 140}
  backgroundColor={'transparent'}
  logo={{url: 'https://raw.githubusercontent.com/AboutReact/sampleresource/master/logosmalltransparen.png',}}
  logoSize={50}
  logoMargin={50}
/>
```

Can I change the design style and make the same as rainbow does show.

I have to make QR code like that :-

And currently I am able to made like that :-

Can I modify the design like my requirement, someone please help me

Body:
In my react native application I have to generate QR code in customise way.

I am using this library to generate QR code react-native-qrcode-svg and it is working well.
But the design is not able to make same as requirement. I am trying to achieve like that

<QRCode
  color={Colors.DARK_PURPLE}
  value={item.value}
  size={windowWidth - 140}
  backgroundColor={'transparent'}
  logo={{url: 'https://raw.githubusercontent.com/AboutReact/sampleresource/master/logosmalltransparen.png',}}
  logoSize={50}
  logoMargin={50}
/>

Can I change the design style and make the same as rainbow does show.

I have to make QR code like that :-

And currently I am able to made like that :-

Can I modify the design like my requirement, someone please help me


来源: stackexchange

问:
Why I'm getting the error ["ReferenceError: 'require' is not defined]?
I wrote a script to bypass root detection in an android app. I run the following command to access the script frida -U --runtime=v8 -f com.app.example -l "C:\Users\rosha\frida.js" but get the following error

```<code>ReferenceError: require is not defined
    at C:\Users\obb\frida.js:2:13
    at /frida/repl-2.js:1:8
</code>```

Below is my script
`

```<code>var Frida = require("frida");
var Process = Frida.Process;

function bypassRootDetection() {
  var RootDetectorClass = Java.use("com.axisidp.mobile.setOnSwipeItemClickListener");
  Device.setTargetElevation.implementation = function() {
    return false;
  }
}

Process.enumerateModules()
  .then(function(modules) {
    var targetModule = modules.find(function(m) {
      return m.name === "cris.icms.ntes";
    });

    return Process.attach(targetModule.pid);
  })
  .then(function(process) {
    Frida.getScript(bypassRootDetection)
      .then(function(script) {
        script.load();
      })
      .catch(function(error) {
        console.error("Error injecting script:", error);
      });
  })
  .catch(function(error) {
    console.error("Error attaching to process:", error);
  });
</code>```

Please guide.

The script should bypass the root detection.

ContentLicense: CC BY-SA 4.0

Body:
I wrote a script to bypass root detection in an android app. I run the following command to access the script frida -U --runtime=v8 -f com.app.example -l "C:\Users\rosha\frida.js" but get the following error

ReferenceError: require is not defined
    at C:\Users\obb\frida.js:2:13
    at /frida/repl-2.js:1:8

Below is my script
`

var Frida = require("frida");
var Process = Frida.Process;

function bypassRootDetection() {
  var RootDetectorClass = Java.use("com.axisidp.mobile.setOnSwipeItemClickListener");
  Device.setTargetElevation.implementation = function() {
    return false;
  }
}

Process.enumerateModules()
  .then(function(modules) {
    var targetModule = modules.find(function(m) {
      return m.name === "cris.icms.ntes";
    });

    return Process.attach(targetModule.pid);
  })
  .then(function(process) {
    Frida.getScript(bypassRootDetection)
      .then(function(script) {
        script.load();
      })
      .catch(function(error) {
        console.error("Error injecting script:", error);
      });
  })
  .catch(function(error) {
    console.error("Error attaching to process:", error);
  });

Please guide.

The script should bypass the root detection.


问:
How to make chart dynamic based on table of information?
I'm brand new to Google Sheets. But how would I make a chart dynamic to this table here? I want to include a dropdown menu that has stuff like: "Last Year", "Last 6 Months" and then filter it by category. I was thinking of maybe using =filter(), but wanted to get some input

I tried using =filter(), using a pivot table, but I'm just lost.


问:
Why am i getting false on HTTP Request method is "httpAuth.isRequestSuccess()" on status code 201 and status Created?

Why am i Getting this "httpAuth.isRequestSuccess()= false" on status code 201 and status Created?


问:
android: how to differentiate between blinking cursor on an EditText line and clicking on that EditText line?
I have an initial EditText line for user input.  When the Activity starts and the UI is drawn, that EditText line has focus and that puts a blinking cursor at the beginning of the EditText line.  I want to be able to launch a Popup menu when the user then clicks on the EditText line.  Problem is that I have other EditText lines in the layout and when the user leaves the other EditText lines where the cursor is blinking and returns to the inital EditText line by clicking on the line, the Popup menu is launching because of the cEditText.requestFocus() code or the onFocusChangeListener() code on the intial EditText line.

How do I only launch the PopupMenu if the cursor is already blinking on the initial EditText line and avoid launching the Popup menu if the cursor is on another EditText line and then the user clicks back on the initial EditText line.

```<code>Activity.java

    protected void onCreate(final Bundle savedInstanceState) {
        ...
        cEditText.setOnClickListener(this::showTypePopup);
        cEditText.requestFocus();

    }

    private void showTypePopup(View v) {

        PopupMenu popup = new PopupMenu(this, v);
        popup.getMenuInflater().inflate(R.menu.skycardpopup_menu, popup.getMenu());
        popup.setOnMenuItemClickListener(item -> {
            int itemId = item.getItemId();
            if (itemId == R.id.menu_one) {
                ...
            }
        });
        popup.show();
    }

layout.xml

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ToDo_text_input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:focusable="true"
        app:hintTextAppearance="@style/FloatingLabel"  >

        <com.todo.quickcards.widget.ListenerEditText
            android:id="@+id/CEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textIsSelectable="true"
            android:imeOptions="actionNext|flagNoExtractUi"
            android:nextFocusDown="@+id/DEditText"
            android:clickable="true"
            android:focusable="true" />

    </com.google.android.material.textfield.TextInputLayout>

</code>```

Body:
I have an initial EditText line for user input.  When the Activity starts and the UI is drawn, that EditText line has focus and that puts a blinking cursor at the beginning of the EditText line.  I want to be able to launch a Popup menu when the user then clicks on the EditText line.  Problem is that I have other EditText lines in the layout and when the user leaves the other EditText lines where the cursor is blinking and returns to the inital EditText line by clicking on the line, the Popup menu is launching because of the cEditText.requestFocus() code or the onFocusChangeListener() code on the intial EditText line.

How do I only launch the PopupMenu if the cursor is already blinking on the initial EditText line and avoid launching the Popup menu if the cursor is on another EditText line and then the user clicks back on the initial EditText line.

Activity.java

    protected void onCreate(final Bundle savedInstanceState) {
        ...
        cEditText.setOnClickListener(this::showTypePopup);
        cEditText.requestFocus();

    }

    private void showTypePopup(View v) {

        PopupMenu popup = new PopupMenu(this, v);
        popup.getMenuInflater().inflate(R.menu.skycardpopup_menu, popup.getMenu());
        popup.setOnMenuItemClickListener(item -> {
            int itemId = item.getItemId();
            if (itemId == R.id.menu_one) {
                ...
            }
        });
        popup.show();
    }

layout.xml

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ToDo_text_input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:focusable="true"
        app:hintTextAppearance="@style/FloatingLabel"  >

        <com.todo.quickcards.widget.ListenerEditText
            android:id="@+id/CEditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textIsSelectable="true"
            android:imeOptions="actionNext|flagNoExtractUi"
            android:nextFocusDown="@+id/DEditText"
            android:clickable="true"
            android:focusable="true" />

    </com.google.android.material.textfield.TextInputLayout>


问:
Nginx Ingress Controller converting JSON request into XML
Client sends a HTTP POST request with JSON payload and content type "application/json".
Backend REST service that is proxied by NGINX (via Ingress Controller in k8s) receives the request with content type "application/xml" and the JSON is converted to a weird XML message. Below is my ingress object which has client auth turned on for mTLS:</p>
```<code>kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/auth-tls-verify-client: "on"
    nginx.ingress.kubernetes.io/auth-tls-secret: xyz/xyz-secret
    nginx.ingress.kubernetes.io/auth-tls-verify-depth: "2"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  name: xyz-ingress
  namespace: xyz
spec:
  ingressClassName: nginx
  rules:
  - host: host_name
    http:
      paths:
      - backend:
          service:
            name: api
            port:
              number: 80
        path: /xyz/api
        pathType: Prefix
  tls:
  - hosts:
    - host_name
    secretName: xyz-secret```

This is the request payload in XML received at the backend rest server:

```<.Proxy209 xmlns=""><tenant>xxx</tenant><serviceType>xxx</serviceType></.Proxy209>

The client sends out this JSON:

```{ "tenant": "xxx", "serviceType": "xxx" }```

The JSON is converted to the XML above by NGINX.
</code>```

Body:
Client sends a HTTP POST request with JSON payload and content type "application/json".
Backend REST service that is proxied by NGINX (via Ingress Controller in k8s) receives the request with content type "application/xml" and the JSON is converted to a weird XML message. Below is my ingress object which has client auth turned on for mTLS:

kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/auth-tls-verify-client: "on"
    nginx.ingress.kubernetes.io/auth-tls-secret: xyz/xyz-secret
    nginx.ingress.kubernetes.io/auth-tls-verify-depth: "2"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  name: xyz-ingress
  namespace: xyz
spec:
  ingressClassName: nginx
  rules:
  - host: host_name
    http:
      paths:
      - backend:
          service:
            name: api
            port:
              number: 80
        path: /xyz/api
        pathType: Prefix
  tls:
  - hosts:
    - host_name
    secretName: xyz-secret```

This is the request payload in XML received at the backend rest server:

```<.Proxy209 xmlns=""><tenant>xxx</tenant><serviceType>xxx</serviceType></.Proxy209>

The client sends out this JSON:

```{ "tenant": "xxx", "serviceType": "xxx" }```

The JSON is converted to the XML above by NGINX.


问:
Minified react error 185 when using elastic chart for kibana plugin with elastic search
I am using elastic/chart for showing a pie diagram inside kibana plugin. When I use Partition module from the elastic/chart I am getting minified react error 185. Following is the code.

`

```<code>import React from "react";

import { Chart, Partition, PartitionLayout, Settings } from "@elastic/charts";

function generateColor(index: number) {
  const colors = ["green", "red"];
  return colors[index];
}
export default function App() {
  return (
    <Chart size={[200, 200]}>
      {/* <Settings showLegend /> */}
      <Partition
        id="spec_1"
        data={[
          { content: "Failure", value: 2 },
          {
            content: "Success",
            value: 8
          }
        ]}
        layout={PartitionLayout.sunburst}
        valueAccessor={(d: any) => d.value as number}
        valueFormatter={(d: number) => `${d}`}
        layers={[
          {
            groupByRollup: (d: any) => d.content,
            nodeLabel: (d: any) => d,
            shape: {
              fillColor: (d: any, index: number) => generateColor(index)
            }
          }
        ]}
      />
    </Chart>
  );
}

</code>```

`

This is the error:
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

I am not setting any state value inside the update function. Please tell me what I am missing.

I tried inspecting the code for any infinite update exist. When I am using different module inside the Chart everything works fine.

This is the error:
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Body:
I am using elastic/chart for showing a pie diagram inside kibana plugin. When I use Partition module from the elastic/chart I am getting minified react error 185. Following is the code.

`

import React from "react";

import { Chart, Partition, PartitionLayout, Settings } from "@elastic/charts";

function generateColor(index: number) {
  const colors = ["green", "red"];
  return colors[index];
}
export default function App() {
  return (
    <Chart size={[200, 200]}>
      {/* <Settings showLegend /> */}
      <Partition
        id="spec_1"
        data={[
          { content: "Failure", value: 2 },
          {
            content: "Success",
            value: 8
          }
        ]}
        layout={PartitionLayout.sunburst}
        valueAccessor={(d: any) => d.value as number}
        valueFormatter={(d: number) => `${d}`}
        layers={[
          {
            groupByRollup: (d: any) => d.content,
            nodeLabel: (d: any) => d,
            shape: {
              fillColor: (d: any, index: number) => generateColor(index)
            }
          }
        ]}
      />
    </Chart>
  );
}

`

This is the error:
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

I am not setting any state value inside the update function. Please tell me what I am missing.

I tried inspecting the code for any infinite update exist. When I am using different module inside the Chart everything works fine.

This is the error:
Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.


问:
type 'Null' is not a subtype of type 'Future<DataState<List<CustomerEntity>>>
I'm working on a test CRUD application using Bloc for state management and sqflite database. I was asked to implement BDD testing for the app but I have no idea about BDD testing. From what I've learned so far I tryed to implement a simple scenario for the start which is landing on the home screen, but I'm getting this error when I run the test.
Also I don't know exactly how to mock my database to test the four main Create, Read, Update, and Delete functionalities.
I'm using getIt for dependency injection, Mocktail, and bdd_widget_test.

It is the scenario that I wrote in the .feature file:

```<code>Feature: Add Feature
    Scenario: Landing on the home screen
        Given the app is running
        Then I see enabled elevated button
</code>```

And it's the logic for the test.dart file where I get the mentioned exception:

```<code>class MockGetAllCustomers extends Mock implements GetAllCustomersUsecase {}

class MockAddCustomer extends Mock implements AddCustomerUsecase {}

class MockUpdateCustomer extends Mock implements UpdateCustomerUsecase {}

class MockDeleteCustomer extends Mock implements DeleteCustomerUsecase {}

class MockDbHelper extends Mock implements DBHelper {}

void main() {
  final GetIt getIt = GetIt.instance;
  late CustomersBloc bloc;
  late MockGetAllCustomers mockGetAllCustomers;
  late MockAddCustomer mockAddCustomer;
  late MockUpdateCustomer mockUpdateCustomer;
  late MockDeleteCustomer mockDeleteCustomer;

  late MockDbHelper dbHelper;
  late Database database;

  CustomerEntity customer = CustomerEntity(
      firstName: 'firstName',
      lastName: 'lastName',
      dateOfBirth: 'dateOfBirth',
      phoneNumber: 'phoneNumber',
      email: 'email',
      bankAccountNumber: 'bankAccountNumber');

  setUpAll(() async {
    // Initialize FFI
    sqfliteFfiInit();
    database = await databaseFactoryFfi.openDatabase(inMemoryDatabasePath);
    await database.execute(
        'CREATE TABLE $customersTable($colId INTEGER PRIMARY KEY AUTOINCREMENT, $colFirstName TEXT, $colLastName TEXT, $colDateOfBirth TEXT, $colPhoneNumber TEXT, $colEmail TEXT, $colAccountNum TEXT)');
    dbHelper = MockDbHelper();
    dbHelper.database = database;
    databaseFactory = databaseFactoryFfi;
  });

  setUp(() {
    mockGetAllCustomers = MockGetAllCustomers();
    mockAddCustomer = MockAddCustomer();
    mockUpdateCustomer = MockUpdateCustomer();
    mockDeleteCustomer = MockDeleteCustomer();
    bloc = CustomersBloc(mockGetAllCustomers, mockAddCustomer,
        mockUpdateCustomer, mockDeleteCustomer);

    getIt.registerFactory(() => bloc);
  });

  group('''Add Feature''', () {
    testWidgets('''Landing on the home screen''', (tester) async {
      await theAppIsRunning(tester);
      await iSeeEnabledElevatedButton(tester);
    });
  });
}
</code>```

It's a part of the exception message I'm receiving:

```<code>type 'Null' is not a subtype of type 'Future<DataState<List<CustomerEntity>>>'
package:mc_crud_test/features/customer_feature/domain/usecases/get_all_customers_usecase.dart 11:43  MockGetAllCustomers.execute
package:mc_crud_test/features/customer_feature/presentation/bloc/bloc/customers_bloc.dart 43:60      new CustomersBloc.<fn>
package:bloc/src/bloc.dart 226:26                                                                    Bloc.on.<fn>.handleEvent
package:bloc/src/bloc.dart 235:9                                                                     Bloc.on.<fn>
dart:async
</code>```

And it's my database class:

```<code>String customersTable = 'customers_table';
String colId = 'id';
String colFirstName = 'firstName';
String colLastName = 'lastName';
String colDateOfBirth = 'dateOfBirth';
String colPhoneNumber = 'phoneNumber';
String colEmail = 'email';
String colAccountNum = 'bankAccountNumber';

//
class DBHelper {
  //
  Database database;
  DBHelper({required this.database});

  //Database initialization and creation
  static Future<Database> initDatabase() async {
    //
    final dbPath = await sql.getDatabasesPath();
    return await sql.openDatabase(
      path.join(dbPath, 'customers.db'),
      onCreate: (db, version) {
        return db.execute(
            'CREATE TABLE $customersTable($colId INTEGER PRIMARY KEY AUTOINCREMENT, $colFirstName TEXT, $colLastName TEXT, $colDateOfBirth TEXT, $colPhoneNumber TEXT, $colEmail TEXT, $colAccountNum TEXT)');
      },
      version: 1,
    );
  }

  //
  //find a customer by firstName, lastName, dateOfBirth, and email
  Future<bool> findCustomer(CustomerEntity customer) async {
    //
    List<Map<String, dynamic>> map = await database.query(customersTable,
        columns: [colFirstName, colLastName, colDateOfBirth, colEmail],
        where:
            '$colFirstName = ? OR $colLastName = ? OR $colDateOfBirth = ? OR $colEmail = ?',
        whereArgs: [
          customer.firstName,
          customer.lastName,
          customer.dateOfBirth,
          customer.email
        ]);
    if (map.isEmpty) {
      return false;
    } else {
      return true;
    }
  }

  // Add a customer to the Database
  Future<int> insertCustomer(CustomerEntity customer) async {
    //
    final id = await database.insert(
      customersTable,
      customer.toMap(),
      conflictAlgorithm: ConflictAlgorithm.replace,
    );
    return id;
  }

  // Get the list of customers
  Future<List<CustomerEntity>> getAllCustomers() async {
    //
    try {
      final List<Map<String, Object?>> queryResult = await database.query(
        customersTable,
        orderBy: colId,
      );
      return queryResult.isEmpty
          ? []
          : queryResult.map((e) => CustomerEntity.fromMapObject(e)).toList();
    } catch (e) {
      print('Error reading database : $e');
      return [];
    }
  }

  //
  // Delete a Customer
  Future<int> deleteCustomer(int id) async {
    return await database
        .delete(customersTable, where: '$colId = ?', whereArgs: [id]);
  }

  //
  //Update a Customer
  Future<bool> updateCustomer(CustomerEntity customer) async {
    try {
      final count = await database.update(customersTable, customer.toMap(),
          where: '$colId = ?', whereArgs: [customer.id]);

      if (count == 1) {
        return true;
      } else {
        return false;
      }
    } catch (e) {
      print('Failed to update the customer: $e');
      return false;
    }
  }
}
</code>```

Body:
I'm working on a test CRUD application using Bloc for state management and sqflite database. I was asked to implement BDD testing for the app but I have no idea about BDD testing. From what I've learned so far I tryed to implement a simple scenario for the start which is landing on the home screen, but I'm getting this error when I run the test.
Also I don't know exactly how to mock my database to test the four main Create, Read, Update, and Delete functionalities.
I'm using getIt for dependency injection, Mocktail, and bdd_widget_test.

It is the scenario that I wrote in the .feature file:

Feature: Add Feature
    Scenario: Landing on the home screen
        Given the app is running
        Then I see enabled elevated button

And it's the logic for the test.dart file where I get the mentioned exception:

class MockGetAllCustomers extends Mock implements GetAllCustomersUsecase {}

class MockAddCustomer extends Mock implements AddCustomerUsecase {}

class MockUpdateCustomer extends Mock implements UpdateCustomerUsecase {}

class MockDeleteCustomer extends Mock implements DeleteCustomerUsecase {}

class MockDbHelper extends Mock implements DBHelper {}

void main() {
  final GetIt getIt = GetIt.instance;
  late CustomersBloc bloc;
  late MockGetAllCustomers mockGetAllCustomers;
  late MockAddCustomer mockAddCustomer;
  late MockUpdateCustomer mockUpdateCustomer;
  late MockDeleteCustomer mockDeleteCustomer;

  late MockDbHelper dbHelper;
  late Database database;

  CustomerEntity customer = CustomerEntity(
      firstName: 'firstName',
      lastName: 'lastName',
      dateOfBirth: 'dateOfBirth',
      phoneNumber: 'phoneNumber',
      email: 'email',
      bankAccountNumber: 'bankAccountNumber');

  setUpAll(() async {
    // Initialize FFI
    sqfliteFfiInit();
    database = await databaseFactoryFfi.openDatabase(inMemoryDatabasePath);
    await database.execute(
        'CREATE TABLE $customersTable($colId INTEGER PRIMARY KEY AUTOINCREMENT, $colFirstName TEXT, $colLastName TEXT, $colDateOfBirth TEXT, $colPhoneNumber TEXT, $colEmail TEXT, $colAccountNum TEXT)');
    dbHelper = MockDbHelper();
    dbHelper.database = database;
    databaseFactory = databaseFactoryFfi;
  });

  setUp(() {
    mockGetAllCustomers = MockGetAllCustomers();
    mockAddCustomer = MockAddCustomer();
    mockUpdateCustomer = MockUpdateCustomer();
    mockDeleteCustomer = MockDeleteCustomer();
    bloc = CustomersBloc(mockGetAllCustomers, mockAddCustomer,
        mockUpdateCustomer, mockDeleteCustomer);

    getIt.registerFactory(() => bloc);
  });

  group('''Add Feature''', () {
    testWidgets('''Landing on the home screen''', (tester) async {
      await theAppIsRunning(tester);
      await iSeeEnabledElevatedButton(tester);
    });
  });
}

It's a part of the exception message I'm receiving:

type 'Null' is not a subtype of type 'Future<DataState<List<CustomerEntity>>>'
package:mc_crud_test/features/customer_feature/domain/usecases/get_all_customers_usecase.dart 11:43  MockGetAllCustomers.execute
package:mc_crud_test/features/customer_feature/presentation/bloc/bloc/customers_bloc.dart 43:60      new CustomersBloc.<fn>
package:bloc/src/bloc.dart 226:26                                                                    Bloc.on.<fn>.handleEvent
package:bloc/src/bloc.dart 235:9                                                                     Bloc.on.<fn>
dart:async

And it's my database class:

String customersTable = 'customers_table';
String colId = 'id';
String colFirstName = 'firstName';
String colLastName = 'lastName';
String colDateOfBirth = 'dateOfBirth';
String colPhoneNumber = 'phoneNumber';
String colEmail = 'email';
String colAccountNum = 'bankAccountNumber';

//
class DBHelper {
  //
  Database database;
  DBHelper({required this.database});

  //Database initialization and creation
  static Future<Database> initDatabase() async {
    //
    final dbPath = await sql.getDatabasesPath();
    return await sql.openDatabase(
      path.join(dbPath, 'customers.db'),
      onCreate: (db, version) {
        return db.execute(
            'CREATE TABLE $customersTable($colId INTEGER PRIMARY KEY AUTOINCREMENT, $colFirstName TEXT, $colLastName TEXT, $colDateOfBirth TEXT, $colPhoneNumber TEXT, $colEmail TEXT, $colAccountNum TEXT)');
      },
      version: 1,
    );
  }

  //
  //find a customer by firstName, lastName, dateOfBirth, and email
  Future<bool> findCustomer(CustomerEntity customer) async {
    //
    List<Map<String, dynamic>> map = await database.query(customersTable,
        columns: [colFirstName, colLastName, colDateOfBirth, colEmail],
        where:
            '$colFirstName = ? OR $colLastName = ? OR $colDateOfBirth = ? OR $colEmail = ?',
        whereArgs: [
          customer.firstName,
          customer.lastName,
          customer.dateOfBirth,
          customer.email
        ]);
    if (map.isEmpty) {
      return false;
    } else {
      return true;
    }
  }

  // Add a customer to the Database
  Future<int> insertCustomer(CustomerEntity customer) async {
    //
    final id = await database.insert(
      customersTable,
      customer.toMap(),
      conflictAlgorithm: ConflictAlgorithm.replace,
    );
    return id;
  }

  // Get the list of customers
  Future<List<CustomerEntity>> getAllCustomers() async {
    //
    try {
      final List<Map<String, Object?>> queryResult = await database.query(
        customersTable,
        orderBy: colId,
      );
      return queryResult.isEmpty
          ? []
          : queryResult.map((e) => CustomerEntity.fromMapObject(e)).toList();
    } catch (e) {
      print('Error reading database : $e');
      return [];
    }
  }

  //
  // Delete a Customer
  Future<int> deleteCustomer(int id) async {
    return await database
        .delete(customersTable, where: '$colId = ?', whereArgs: [id]);
  }

  //
  //Update a Customer
  Future<bool> updateCustomer(CustomerEntity customer) async {
    try {
      final count = await database.update(customersTable, customer.toMap(),
          where: '$colId = ?', whereArgs: [customer.id]);

      if (count == 1) {
        return true;
      } else {
        return false;
      }
    } catch (e) {
      print('Failed to update the customer: $e');
      return false;
    }
  }
}


问:
How to calculate unknown values in Sine linear interpolation using quadrature look up table (LUT)?
I have generated a sine wave using a 257-point look-up table that covers only one quadrant (4th quadrant). The entries in the table are in fixed point format (Q1.15) [o,.....,-32768]. linear interpolation is used for finding unknown values in the table. I came across an example in which linear interpolation is implemented and used the same logic. The index and delta are calculated as:

x -> phase in Q1.15
entries in look up table = 2^8 + 1 = 257

```<code>n = 8;
if (x > 0)
{
    sign_flag = 1;
    x = ~(x);
  }
if (x < -16384)
 {
    x = -32768 - x;
  }
  x = ~(x);
index = x >> (14-n);
delta = (x & ((1 << (14 - n)) - 1)) << (1 + n);
z = table[index];
y = ((table[index+1] - table[index]) * delta) >> 15;
y = z + y;`
</code>```

what is the logic behind index and delta ?

If delta is calculated using x (phase) in float, how to calculate delta without using shift operation?

Body:
I have generated a sine wave using a 257-point look-up table that covers only one quadrant (4th quadrant). The entries in the table are in fixed point format (Q1.15) [o,.....,-32768]. linear interpolation is used for finding unknown values in the table. I came across an example in which linear interpolation is implemented and used the same logic. The index and delta are calculated as:

x -> phase in Q1.15
entries in look up table = 2^8 + 1 = 257

n = 8;
if (x > 0)
{
    sign_flag = 1;
    x = ~(x);
  }
if (x < -16384)
 {
    x = -32768 - x;
  }
  x = ~(x);
index = x >> (14-n);
delta = (x & ((1 << (14 - n)) - 1)) << (1 + n);
z = table[index];
y = ((table[index+1] - table[index]) * delta) >> 15;
y = z + y;`

what is the logic behind index and delta ?

If delta is calculated using x (phase) in float, how to calculate delta without using shift operation?


问:
Firebase crashlytics is not enable in production mode in flutter iOS application
Firebase account I could not get crash in iOS production app. I have added 2 build variant in application. Beside firebase console production iOS application is detected but crash is not showing.
I have uploaded dsyms File using terminal. If any one know about this issue then please help me.

I have uploaded dsyms File using terminal.


问:
unable to fetch firebase realtime database data into website UI using ReactJs
I am new to firebase (version-9) , and after trying alot , i am unable to fetch the data from firebase realtime database , i can see the data in console , but i want to render it into my website table, please help. below is my code snippet .

``

```<code>import React, {useState, useEffect} from 'react';
import  { db } from '../firebase-config';
import { Link } from 'react-router-dom';
import { ref, onValue } from 'firebase/database';

const ViewAll = () => {
  const [posts, setPosts] = useState([]);
  useEffect(() => {
    const posts = ref(db, 'superadmin/admins/')
    onValue(posts,(snapshot) => {
      const json = ({...snapshot.toJSON()})
      const keys = Object.keys(json);
      const postJSON = keys.map(key => {
        const element = json[key];
        return [element.FullName,element.doctors, element.technicians, element.patients]
      });
      setPosts(postJSON);
      console.log({...snapshot.val()})
    })
  }, []);
</code>```

``

``

```<code>return (

    <div style={{marginTop: "100px"}}>
      <table className='styled-table'>
        <thead>
          <tr>
            <th style={{textAlign: "center"}}>No.</th>
            <th style={{textAlign: "center"}}>Name</th>
            <th style={{textAlign: "center"}}>Action</th>
          </tr>
        </thead>
        <tbody>
          {Object.keys(posts).map((id,index)=>{
            return (
              <tr key={id}>
                <th scope='row'>{index + 1}</th>
                <td>{posts[id].name}</td>
                <td>
                  <Link to={'/SuperAdmin/ViewAll'}>
                  <button className='btn btn-view'>View</button>
                  </Link>
                </td>
              </tr>
            );
          })}
        </tbody>
      </table>

    </div>
  )
}

export default ViewAll
</code>```

``

This is my code snippet
code snippet part 2

I'm Using Firebase version 9 in reactjs.

I am able to view the data in the console , I just want to render it into my website , and since i am new to firebase , i dont know how to render it in the website,

any sort of help will be hihgly appreciated.

Body:
I am new to firebase (version-9) , and after trying alot , i am unable to fetch the data from firebase realtime database , i can see the data in console , but i want to render it into my website table, please help. below is my code snippet .

``

import React, {useState, useEffect} from 'react';
import  { db } from '../firebase-config';
import { Link } from 'react-router-dom';
import { ref, onValue } from 'firebase/database';

const ViewAll = () => {
  const [posts, setPosts] = useState([]);
  useEffect(() => {
    const posts = ref(db, 'superadmin/admins/')
    onValue(posts,(snapshot) => {
      const json = ({...snapshot.toJSON()})
      const keys = Object.keys(json);
      const postJSON = keys.map(key => {
        const element = json[key];
        return [element.FullName,element.doctors, element.technicians, element.patients]
      });
      setPosts(postJSON);
      console.log({...snapshot.val()})
    })
  }, []);

``

``

return (

            No.
            Name
            Action

          {Object.keys(posts).map((id,index)=>{
            return (

                {index + 1}
                {posts[id].name}

                  <Link to={'/SuperAdmin/ViewAll'}>
                  <button className='btn btn-view'>View</button>
                  </Link>

            );
          })}

  )
}

export default ViewAll

``

This is my code snippet
code snippet part 2

I'm Using Firebase version 9 in reactjs.

I am able to view the data in the console , I just want to render it into my website , and since i am new to firebase , i dont know how to render it in the website,

any sort of help will be hihgly appreciated.


问:
How to setup github action code coverage analysis swift language in SonarCloud
I've been trying to follow the example provided by SonarCloud to set it up, but it doesn't work.

```<code>name: SonarCloud
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Build and analyze
    runs-on: macos-latest
    env:
      BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Install sonar-scanner and build-wrapper
        uses: SonarSource/sonarcloud-github-c-cpp@v1
      - name: Run build-wrapper
        run: |
          build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }}<insert_your_clean_build_command>
      - name: Run sonar-scanner
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: |
          sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"

</code>```

It always goes wrong in the Run build-wrapper-macosx-x86 production process.

Is there enough solution or sample code to guide me?

Body:
I've been trying to follow the example provided by SonarCloud to set it up, but it doesn't work.

name: SonarCloud
on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  build:
    name: Build and analyze
    runs-on: macos-latest
    env:
      BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - name: Install sonar-scanner and build-wrapper
        uses: SonarSource/sonarcloud-github-c-cpp@v1
      - name: Run build-wrapper
        run: |
          build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }}<insert_your_clean_build_command>
      - name: Run sonar-scanner
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: |
          sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"

It always goes wrong in the Run build-wrapper-macosx-x86 production process.

Is there enough solution or sample code to guide me?


问:
How to prevent httpx timeout in python?
I am trying to scrape tokopedia here. When I use raw codes, it works and the json is returned. However when I tried to use it as a variable, it reads time out.
website:https://www.tokopedia.com/samudrasembako/regal-marie-roll-230-gram?extParam=ivf%3Dfalse&src=topads
Here's the code

```<code>!pip install fake_useragent
!pip install httpx
import requests
from fake_useragent import UserAgent
import httpx

tokopedia=['https://www.tokopedia.com/samudrasembako/regal-marie-roll-230-gram?extParam=ivf%3Dfalse&src=topads']
for url in tokopedia:
  ua = UserAgent().random
  product_key=url.split(".com")[1].split("/")[2].split("?")[0]
  shopdomain=url.split(".com")[1].split("/")[1].split("?")[0]
  payload={
    "operationName":"PDPGetLayoutQuery",
    "variables":
      {"shopDomain":f"{shopdomain}",
      "productKey":f"{product_key}",
       "layoutID":"",
       "apiVersion":1,
       "userLocation":
        {"cityID":"176",
         "addressID":"0",
         "districtID":"2274",
         "postalCode":"",
         "latlon":""},
       "extParam":""},
       "query":"fragment ProductVariant on pdpDataProductVariant {\n  errorCode\n  parentID\n  defaultChild\n  sizeChart\n  totalStockFmt\n  variants {\n    productVariantID\n    variantID\n    name\n    identifier\n    option {\n      picture {\n        urlOriginal: url\n        urlThumbnail: url100\n        __typename\n      }\n      productVariantOptionID\n      variantUnitValueID\n      value\n      hex\n      stock\n      __typename\n    }\n    __typename\n  }\n  children {\n    productID\n    price\n    priceFmt\n    optionID\n    optionName\n    productName\n    productURL\n    picture {\n      urlOriginal: url\n      urlThumbnail: url100\n      __typename\n    }\n    stock {\n      stock\n      isBuyable\n      stockWordingHTML\n      minimumOrder\n      maximumOrder\n      __typename\n    }\n    isCOD\n    isWishlist\n    campaignInfo {\n      campaignID\n      campaignType\n      campaignTypeName\n      campaignIdentifier\n      background\n      discountPercentage\n      originalPrice\n      discountPrice\n      stock\n      stockSoldPercentage\n      startDate\n      endDate\n      endDateUnix\n      appLinks\n      isAppsOnly\n      isActive\n      hideGimmick\n      isCheckImei\n      minOrder\n      __typename\n    }\n    thematicCampaign {\n      additionalInfo\n      background\n      campaignName\n      icon\n      __typename\n    }\n    __typename\n  }\n  __typename\n}\n\nfragment ProductMedia on pdpDataProductMedia {\n  media {\n    type\n    urlOriginal: URLOriginal\n    urlThumbnail: URLThumbnail\n    urlMaxRes: URLMaxRes\n    videoUrl: videoURLAndroid\n    prefix\n    suffix\n    description\n    variantOptionID\n    __typename\n  }\n  videos {\n    source\n    url\n    __typename\n  }\n  __typename\n}\n\nfragment ProductHighlight on pdpDataProductContent {\n  name\n  price {\n    value\n    currency\n    __typename\n  }\n  campaign {\n    campaignID\n    campaignType\n    campaignTypeName\n    campaignIdentifier\n    background\n    percentageAmount\n    originalPrice\n    discountedPrice\n    originalStock\n    stock\n    stockSoldPercentage\n    threshold\n    startDate\n    endDate\n    endDateUnix\n    appLinks\n    isAppsOnly\n    isActive\n    hideGimmick\n    __typename\n  }\n  thematicCampaign {\n    additionalInfo\n    background\n    campaignName\n    icon\n    __typename\n  }\n  stock {\n    useStock\n    value\n    stockWording\n    __typename\n  }\n  variant {\n    isVariant\n    parentID\n    __typename\n  }\n  wholesale {\n    minQty\n    price {\n      value\n      currency\n      __typename\n    }\n    __typename\n  }\n  isCashback {\n    percentage\n    __typename\n  }\n  isTradeIn\n  isOS\n  isPowerMerchant\n  isWishlist\n  isCOD\n  isFreeOngkir {\n    isActive\n    __typename\n  }\n  preorder {\n    duration\n    timeUnit\n    isActive\n    preorderInDays\n    __typename\n  }\n  __typename\n}\n\nfragment ProductCustomInfo on pdpDataCustomInfo {\n  icon\n  title\n  isApplink\n  applink\n  separator\n  description\n  __typename\n}\n\nfragment ProductInfo on pdpDataProductInfo {\n  row\n  content {\n    title\n    subtitle\n    applink\n    __typename\n  }\n  __typename\n}\n\nfragment ProductDetail on pdpDataProductDetail {\n  content {\n    title\n    subtitle\n    applink\n    showAtFront\n    isAnnotation\n    __typename\n  }\n  __typename\n}\n\nfragment ProductDataInfo on pdpDataInfo {\n  icon\n  title\n  isApplink\n  applink\n  content {\n    icon\n    text\n    __typename\n  }\n  __typename\n}\n\nfragment ProductSocial on pdpDataSocialProof {\n  row\n  content {\n    icon\n    title\n    subtitle\n    applink\n    type\n    rating\n    __typename\n  }\n  __typename\n}\n\nquery PDPGetLayoutQuery($shopDomain: String, $productKey: String, $layoutID: String, $apiVersion: Float, $userLocation: pdpUserLocation, $extParam: String) {\n  pdpGetLayout(shopDomain: $shopDomain, productKey: $productKey, layoutID: $layoutID, apiVersion: $apiVersion, userLocation: $userLocation, extParam: $extParam) {\n    requestID\n    name\n    pdpSession\n    basicInfo {\n      alias\n      createdAt\n      isQA\n      id: productID\n      shopID\n      shopName\n      minOrder\n      maxOrder\n      weight\n      weightUnit\n      condition\n      status\n      url\n      needPrescription\n      catalogID\n      isLeasing\n      isBlacklisted\n      menu {\n        id\n        name\n        url\n        __typename\n      }\n      category {\n        id\n        name\n        title\n        breadcrumbURL\n        isAdult\n        isKyc\n        minAge\n        detail {\n          id\n          name\n          breadcrumbURL\n          isAdult\n          __typename\n        }\n        __typename\n      }\n      txStats {\n        transactionSuccess\n        transactionReject\n        countSold\n        paymentVerified\n        itemSoldFmt\n        __typename\n      }\n      stats {\n        countView\n        countReview\n        countTalk\n        rating\n        __typename\n      }\n      __typename\n    }\n    components {\n      name\n      type\n      position\n      data {\n        ...ProductMedia\n        ...ProductHighlight\n        ...ProductInfo\n        ...ProductDetail\n        ...ProductSocial\n        ...ProductDataInfo\n        ...ProductCustomInfo\n        ...ProductVariant\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"
  }
  headers={
    'origin': 'https://www.tokopedia.com',
    'referer': f'{url}',
    'sec-ch-ua': '"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': "Windows",
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
    'x-device': 'desktop',
    'x-source': 'tokopedia-lite',
    'x-tkpd-akamai': 'pdpGetLayout',
    'x-tkpd-lite-service': 'zeus',
    'x-version': '53ac990'
  }
  client= httpx.Client()
  resp=client.post("https://gql.tokopedia.com/graphql/PDPGetLayoutQuery",json=payload,headers=headers)
</code>```

Can someone please help? So that the above code runs and returns the json.

Title: How to prevent httpx timeout in python?

Body:
I am trying to scrape tokopedia here. When I use raw codes, it works and the json is returned. However when I tried to use it as a variable, it reads time out.
website:https://www.tokopedia.com/samudrasembako/regal-marie-roll-230-gram?extParam=ivf%3Dfalse&src=topads
Here's the code

!pip install fake_useragent
!pip install httpx
import requests
from fake_useragent import UserAgent
import httpx

tokopedia=['https://www.tokopedia.com/samudrasembako/regal-marie-roll-230-gram?extParam=ivf%3Dfalse&src=topads']
for url in tokopedia:
  ua = UserAgent().random
  product_key=url.split(".com")[1].split("/")[2].split("?")[0]
  shopdomain=url.split(".com")[1].split("/")[1].split("?")[0]
  payload={
    "operationName":"PDPGetLayoutQuery",
    "variables":
      {"shopDomain":f"{shopdomain}",
      "productKey":f"{product_key}",
       "layoutID":"",
       "apiVersion":1,
       "userLocation":
        {"cityID":"176",
         "addressID":"0",
         "districtID":"2274",
         "postalCode":"",
         "latlon":""},
       "extParam":""},
       "query":"fragment ProductVariant on pdpDataProductVariant {\n  errorCode\n  parentID\n  defaultChild\n  sizeChart\n  totalStockFmt\n  variants {\n    productVariantID\n    variantID\n    name\n    identifier\n    option {\n      picture {\n        urlOriginal: url\n        urlThumbnail: url100\n        __typename\n      }\n      productVariantOptionID\n      variantUnitValueID\n      value\n      hex\n      stock\n      __typename\n    }\n    __typename\n  }\n  children {\n    productID\n    price\n    priceFmt\n    optionID\n    optionName\n    productName\n    productURL\n    picture {\n      urlOriginal: url\n      urlThumbnail: url100\n      __typename\n    }\n    stock {\n      stock\n      isBuyable\n      stockWordingHTML\n      minimumOrder\n      maximumOrder\n      __typename\n    }\n    isCOD\n    isWishlist\n    campaignInfo {\n      campaignID\n      campaignType\n      campaignTypeName\n      campaignIdentifier\n      background\n      discountPercentage\n      originalPrice\n      discountPrice\n      stock\n      stockSoldPercentage\n      startDate\n      endDate\n      endDateUnix\n      appLinks\n      isAppsOnly\n      isActive\n      hideGimmick\n      isCheckImei\n      minOrder\n      __typename\n    }\n    thematicCampaign {\n      additionalInfo\n      background\n      campaignName\n      icon\n      __typename\n    }\n    __typename\n  }\n  __typename\n}\n\nfragment ProductMedia on pdpDataProductMedia {\n  media {\n    type\n    urlOriginal: URLOriginal\n    urlThumbnail: URLThumbnail\n    urlMaxRes: URLMaxRes\n    videoUrl: videoURLAndroid\n    prefix\n    suffix\n    description\n    variantOptionID\n    __typename\n  }\n  videos {\n    source\n    url\n    __typename\n  }\n  __typename\n}\n\nfragment ProductHighlight on pdpDataProductContent {\n  name\n  price {\n    value\n    currency\n    __typename\n  }\n  campaign {\n    campaignID\n    campaignType\n    campaignTypeName\n    campaignIdentifier\n    background\n    percentageAmount\n    originalPrice\n    discountedPrice\n    originalStock\n    stock\n    stockSoldPercentage\n    threshold\n    startDate\n    endDate\n    endDateUnix\n    appLinks\n    isAppsOnly\n    isActive\n    hideGimmick\n    __typename\n  }\n  thematicCampaign {\n    additionalInfo\n    background\n    campaignName\n    icon\n    __typename\n  }\n  stock {\n    useStock\n    value\n    stockWording\n    __typename\n  }\n  variant {\n    isVariant\n    parentID\n    __typename\n  }\n  wholesale {\n    minQty\n    price {\n      value\n      currency\n      __typename\n    }\n    __typename\n  }\n  isCashback {\n    percentage\n    __typename\n  }\n  isTradeIn\n  isOS\n  isPowerMerchant\n  isWishlist\n  isCOD\n  isFreeOngkir {\n    isActive\n    __typename\n  }\n  preorder {\n    duration\n    timeUnit\n    isActive\n    preorderInDays\n    __typename\n  }\n  __typename\n}\n\nfragment ProductCustomInfo on pdpDataCustomInfo {\n  icon\n  title\n  isApplink\n  applink\n  separator\n  description\n  __typename\n}\n\nfragment ProductInfo on pdpDataProductInfo {\n  row\n  content {\n    title\n    subtitle\n    applink\n    __typename\n  }\n  __typename\n}\n\nfragment ProductDetail on pdpDataProductDetail {\n  content {\n    title\n    subtitle\n    applink\n    showAtFront\n    isAnnotation\n    __typename\n  }\n  __typename\n}\n\nfragment ProductDataInfo on pdpDataInfo {\n  icon\n  title\n  isApplink\n  applink\n  content {\n    icon\n    text\n    __typename\n  }\n  __typename\n}\n\nfragment ProductSocial on pdpDataSocialProof {\n  row\n  content {\n    icon\n    title\n    subtitle\n    applink\n    type\n    rating\n    __typename\n  }\n  __typename\n}\n\nquery PDPGetLayoutQuery($shopDomain: String, $productKey: String, $layoutID: String, $apiVersion: Float, $userLocation: pdpUserLocation, $extParam: String) {\n  pdpGetLayout(shopDomain: $shopDomain, productKey: $productKey, layoutID: $layoutID, apiVersion: $apiVersion, userLocation: $userLocation, extParam: $extParam) {\n    requestID\n    name\n    pdpSession\n    basicInfo {\n      alias\n      createdAt\n      isQA\n      id: productID\n      shopID\n      shopName\n      minOrder\n      maxOrder\n      weight\n      weightUnit\n      condition\n      status\n      url\n      needPrescription\n      catalogID\n      isLeasing\n      isBlacklisted\n      menu {\n        id\n        name\n        url\n        __typename\n      }\n      category {\n        id\n        name\n        title\n        breadcrumbURL\n        isAdult\n        isKyc\n        minAge\n        detail {\n          id\n          name\n          breadcrumbURL\n          isAdult\n          __typename\n        }\n        __typename\n      }\n      txStats {\n        transactionSuccess\n        transactionReject\n        countSold\n        paymentVerified\n        itemSoldFmt\n        __typename\n      }\n      stats {\n        countView\n        countReview\n        countTalk\n        rating\n        __typename\n      }\n      __typename\n    }\n    components {\n      name\n      type\n      position\n      data {\n        ...ProductMedia\n        ...ProductHighlight\n        ...ProductInfo\n        ...ProductDetail\n        ...ProductSocial\n        ...ProductDataInfo\n        ...ProductCustomInfo\n        ...ProductVariant\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"
  }
  headers={
    'origin': 'https://www.tokopedia.com',
    'referer': f'{url}',
    'sec-ch-ua': '"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': "Windows",
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
    'x-device': 'desktop',
    'x-source': 'tokopedia-lite',
    'x-tkpd-akamai': 'pdpGetLayout',
    'x-tkpd-lite-service': 'zeus',
    'x-version': '53ac990'
  }
  client= httpx.Client()
  resp=client.post("https://gql.tokopedia.com/graphql/PDPGetLayoutQuery",json=payload,headers=headers)

Can someone please help? So that the above code runs and returns the json.


问:
Sonar issues related to at-rule @use at angular material
Getting a sonar issue
Unexpected unknown at-rule @use

When I try to add syntax like
@use 'angular/material' as mat;
Add in scss file in angular material.

Can anyone please help her how to resolve this?


问:
Different Trace Id while using Feign client in Distributed Tracing
I implementing Distributed tracing in microservices. I'm using feign client for inter service communication and using micrometer for tracing. But I'm getting different trace id when I call Service B from Service A using feign Client. I read a lot of articles regarding this issue, but didn't find any solution. Could anyone please help me in this? I'm using spring boot 3.0.0-Snapshot.

I expect someone will help me in this problem so I can move forward with my work, I'm stuck due to this issue.


问:
How to save file outside docker container with multiple running instance?
I have a nodejs backend and react frontend that is running with 5 instance with docker-compose.yml which is hosted in Google cloud platform.

```<code>docker-compose up --build --scale nodeserver=5
</code>```

In my nodejs app, I am saving some files in the local filesystem. When I run docker with one container I can load the files but if I run multiple containers then it seems like file is getting saved into each containers.

to be more specific, I am saving user profile images in a folder "userProfilepictures" which is located inside my backend folder. I am saving all uploaded images from react to here and also loading them from here.

How can I save the files in the system filesystem and access them from each docker container?

my current docker-compose.yml

```<code>version: "3.8"
services:
    nodeserver:
        build:
            context: ./backend
        restart: on-failure
    frontend:
        build:
            context: ./frontend
        container_name: nginx
        hostname: nginx
        ports:
            - "80:80"
            - "443:443"
</code>```

Body:
I have a nodejs backend and react frontend that is running with 5 instance with docker-compose.yml which is hosted in Google cloud platform.

docker-compose up --build --scale nodeserver=5

In my nodejs app, I am saving some files in the local filesystem. When I run docker with one container I can load the files but if I run multiple containers then it seems like file is getting saved into each containers.

to be more specific, I am saving user profile images in a folder "userProfilepictures" which is located inside my backend folder. I am saving all uploaded images from react to here and also loading them from here.

How can I save the files in the system filesystem and access them from each docker container?

my current docker-compose.yml

version: "3.8"
services:
    nodeserver:
        build:
            context: ./backend
        restart: on-failure
    frontend:
        build:
            context: ./frontend
        container_name: nginx
        hostname: nginx
        ports:
            - "80:80"
            - "443:443"


问:
Google Play Console subscription Percentage discount offer
Adding a discount offer to the yearly subscription doesn't seem to be working. The billing dialog still shows the full price.

I have set up a yearly subscription. I want to give new subscribers a 20% discount as a new years special. I have added the "Percentage discount" offer, which should run after the free trial. I plan on de-activating the discount offer once the special ends. However, when it is activated and I test it, it still shows as $99.99 instead of $79.99.

I am testing using a google account that has been added to the internal testing track, and this user has never subscribed.

Any idea what I'm doing wrong here?


问:
Why forEach is not working in JavaScript?
This is a timer. One of the timers is 58 minutes and the other one is 49 hours

timer

The timer was 58 minutes. When the clock reaches 00:00:00, both of them will be as below.

end

I want to change those that reached the timer 0, what should I do?

It is possible that both of them will reach 0, so I have to make a forEach.

I want to make it show the end of the discount when it reaches 0.

HTML

```<code><div class="card-footer text-center text-secondary end-discount d-none">End of Discount</div>
<p data-timestamp="1671524779" class="timestamp fw-bolder text-danger text-end mb-0" dir="ltr"></p>
<div class="card-footer text-center text-secondary end-discount d-none">End of Discount</div>
<p data-timestamp="1671524779" class="timestamp fw-bolder text-danger text-end mb-0" dir="ltr"></p>
<div class="card-footer text-center text-secondary end-discount d-none">End of Discount</div>
<p data-timestamp="1671524779" class="timestamp fw-bolder text-danger text-end mb-0" dir="ltr"></p>
<div class="card-footer text-center text-secondary end-discount d-none">End of Discount</div>
<p data-timestamp="1671524779" class="timestamp fw-bolder text-danger text-end mb-0" dir="ltr"></p>
</code>```

JS

```<code>const timestamps = document.querySelectorAll('[data-timestamp]');
timestamps.forEach(function(timestamp) {
    setInterval(() => {
        const curTime = (new Date()).getTime() / 1000;
        timestamp.innerText = (`${timestamp.dataset.timestamp - curTime}`).toHHMMSS();
        if (timestamp.innerText === '00 : 00 : 00') {
            const end_discounts = document.querySelectorAll('.end-discount');
            end_discounts.forEach((end_discount) => {
                end_discount.classList.remove('d-none');
                end_discount.classList.add('d-block');
            });
</code>```

Body:
This is a timer. One of the timers is 58 minutes and the other one is 49 hours

timer

The timer was 58 minutes. When the clock reaches 00:00:00, both of them will be as below.

end

I want to change those that reached the timer 0, what should I do?

It is possible that both of them will reach 0, so I have to make a forEach.

I want to make it show the end of the discount when it reaches 0.

HTML

End of Discount

End of Discount

End of Discount

End of Discount

JS

const timestamps = document.querySelectorAll('[data-timestamp]');
timestamps.forEach(function(timestamp) {
    setInterval(() => {
        const curTime = (new Date()).getTime() / 1000;
        timestamp.innerText = (`${timestamp.dataset.timestamp - curTime}`).toHHMMSS();
        if (timestamp.innerText === '00 : 00 : 00') {
            const end_discounts = document.querySelectorAll('.end-discount');
            end_discounts.forEach((end_discount) => {
                end_discount.classList.remove('d-none');
                end_discount.classList.add('d-block');
            });


问:
onnx2ncnn model conversion for raspberry pi
how to convert onnx model to ncnn i am using raspberry pi 5 and have to build ncnn in it but when I run the command on it not working

I have tried the command on onnx2ncnn but it says no module found


问:
ProgressBar on Pixel 7 Android 13 devices not rotating after 5 December 2022 security patch
The ProgressBar on Pixel 7 Pro devices not rotating after December 5, 2022 security patch. The ProgressBar simply does not rotate, it stays as a static image. Also
I have set

```<code>android:indeterminate="true"
</code>```

Body:
The ProgressBar on Pixel 7 Pro devices not rotating after December 5, 2022 security patch. The ProgressBar simply does not rotate, it stays as a static image. Also
I have set

android:indeterminate="true"


问:
Can I use Apache Batik to paint an SVG to an AWT Graphics2D context?
I have successfully read an SVG file into an org.w3c.dom.Document to see its structure.
Now I'd like to render it to the screen using Java's AWT's Graphics2D.

Note:
I don't want to use Swing (e.g., with org.apache.batik.swing.JSVGCanvas).
All the Googling I do tells me how to write to an SVGGraphics2D. (Nifty; I use it elsewhere!)
But I don't want to do that; I want to draw to the screen.

Is there a way to do this?

Or are there lower-level Swing-independent drawing classes that JSVGCanvas uses internally to draw to an AWT graphics context?

I'd hoped to find simple, clear calls that took as parameters, e.g., a Graphics2D and a Document.

[Edit by OP: Unless I dreamt it--complete with cut-and-paste-able code--I got the answer in a comment within minutes...  ; )  Here's its essence for others with the need, and so people don't waste time answering again:]

```<code>// Create a user agent and document loader
UserAgent userAgent = new UserAgentAdapter();
DocumentLoader loader = new DocumentLoader(userAgent);

// Create a bridge context and GVT builder
BridgeContext ctx = new BridgeContext(userAgent, loader);
ctx.setDynamic(true);
GVTBuilder builder = new GVTBuilder();

// Build the graphics node
GraphicsNode graphicsNode = builder.build(ctx, [Document]);

// Paint the graphics node to the Graphics2D object
graphicsNode.paint([Graphics2D]);
</code>```

And without that comment the image I pasted of the result made the question meaningless/confusing; now may make sense. Thank you again to that moderator-deleted poster! (I think because he asked for college money...)

Body:
I have successfully read an SVG file into an org.w3c.dom.Document to see its structure.
Now I'd like to render it to the screen using Java's AWT's Graphics2D.

Note:
I don't want to use Swing (e.g., with org.apache.batik.swing.JSVGCanvas).
All the Googling I do tells me how to write to an SVGGraphics2D. (Nifty; I use it elsewhere!)
But I don't want to do that; I want to draw to the screen.

Is there a way to do this?

Or are there lower-level Swing-independent drawing classes that JSVGCanvas uses internally to draw to an AWT graphics context?

I'd hoped to find simple, clear calls that took as parameters, e.g., a Graphics2D and a Document.

[Edit by OP: Unless I dreamt it--complete with cut-and-paste-able code--I got the answer in a comment within minutes...  ; )  Here's its essence for others with the need, and so people don't waste time answering again:]

// Create a user agent and document loader
UserAgent userAgent = new UserAgentAdapter();
DocumentLoader loader = new DocumentLoader(userAgent);

// Create a bridge context and GVT builder
BridgeContext ctx = new BridgeContext(userAgent, loader);
ctx.setDynamic(true);
GVTBuilder builder = new GVTBuilder();

// Build the graphics node
GraphicsNode graphicsNode = builder.build(ctx, [Document]);

// Paint the graphics node to the Graphics2D object
graphicsNode.paint([Graphics2D]);

And without that comment the image I pasted of the result made the question meaningless/confusing; now may make sense. Thank you again to that moderator-deleted poster! (I think because he asked for college money...)


问:
How to get data from firebase Realtime database to Dialogflow chatbot
I was trying to create a chatbot in Dialogflow es. I want, when the user ask chatbot to show Board id it will read data from firebase Realtime database and show that data to the user.

I have tried this way:-

'use strict';

const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');

const firebaseAdmin = require("firebase-admin");

process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements

 firebaseAdmin.initializeApp({
credential:firebaseAdmin.credential.applicationDefault(),
  databaseURL:"https://***************.firebaseio.com",
});

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
  const agent = new WebhookClient({ request, response });
  console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
  console.log('Dialogflow Request body: ' + JSON.stringify(request.body));

  function welcome(agent) {
    agent.add(`Welcome to akvo agent!`);
  }

  function fallback(agent) {
    agent.add(`I didn't understand`);
    agent.add(`I'm sorry, can you try again?`);
  }

  function getFromFirebase(agent){
    return firebaseAdmin.database().ref('board_id').once("value").then((snapshot) => {
    var boardid = snapshot.val();
      agent.add(boardid);
   });
  }

  // Run the proper function handler based on the matched Dialogflow intent name
  let intentMap = new Map();
  intentMap.set('Default Welcome Intent', welcome);
  intentMap.set('Default Fallback Intent', fallback);
  intentMap.set('board id', getFromFirebase);
  agent.handleRequest(intentMap);
});```

After deploying this code I got an error.
Error:-"Webhook call failed. Error: DEADLINE_EXCEEDED, State: URL_TIMEOUT, Reason: TIMEOUT_WEB."

Please tell me how can I solve this.

Body:
I was trying to create a chatbot in Dialogflow es. I want, when the user ask chatbot to show Board id it will read data from firebase Realtime database and show that data to the user.

I have tried this way:-

'use strict';

const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');

const firebaseAdmin = require("firebase-admin");

process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements

 firebaseAdmin.initializeApp({
credential:firebaseAdmin.credential.applicationDefault(),
  databaseURL:"https://***************.firebaseio.com",
});

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
  const agent = new WebhookClient({ request, response });
  console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
  console.log('Dialogflow Request body: ' + JSON.stringify(request.body));

  function welcome(agent) {
    agent.add(`Welcome to akvo agent!`);
  }

  function fallback(agent) {
    agent.add(`I didn't understand`);
    agent.add(`I'm sorry, can you try again?`);
  }

  function getFromFirebase(agent){
    return firebaseAdmin.database().ref('board_id').once("value").then((snapshot) => {
    var boardid = snapshot.val();
      agent.add(boardid);
   });
  }

  // Run the proper function handler based on the matched Dialogflow intent name
  let intentMap = new Map();
  intentMap.set('Default Welcome Intent', welcome);
  intentMap.set('Default Fallback Intent', fallback);
  intentMap.set('board id', getFromFirebase);
  agent.handleRequest(intentMap);
});

After deploying this code I got an error.
Error:-"Webhook call failed. Error: DEADLINE_EXCEEDED, State: URL_TIMEOUT, Reason: TIMEOUT_WEB."

Please tell me how can I solve this.


问:
gorilla websocket NextWriter and WriteMessage() difference
i have function:

```<code>func write() {
    defer func() {
        serverConn.Close()
    }()
    for message := range msgChan {
        w, err := serverConn.NextWriter(websocket.TextMessage)
        if err != nil {
            return
        }
        bmessage, err := json.Marshal(message)
        if err != nil {
            return
        }

        _, err = w.Write(bmessage)
        if err != nil {
            fmt.Println(err)
        }

        if err := w.Close(); err != nil {
            return
        }
    }
}
</code>```

And i got

```<code>panic: concurrent write to websocket connection

</code>```

I'm wondering how is this possible? in ws writes only this function, which is running in 1 instance. and second question: what is the point of using NextWriter instead of just conn.WriteMessage()? Is it possible that with a large number of messages NextWriter accumulate and can try to write at the same time?

Body:
i have function:

func write() {
    defer func() {
        serverConn.Close()
    }()
    for message := range msgChan {
        w, err := serverConn.NextWriter(websocket.TextMessage)
        if err != nil {
            return
        }
        bmessage, err := json.Marshal(message)
        if err != nil {
            return
        }

        _, err = w.Write(bmessage)
        if err != nil {
            fmt.Println(err)
        }

        if err := w.Close(); err != nil {
            return
        }
    }
}

And i got

panic: concurrent write to websocket connection

I'm wondering how is this possible? in ws writes only this function, which is running in 1 instance. and second question: what is the point of using NextWriter instead of just conn.WriteMessage()? Is it possible that with a large number of messages NextWriter accumulate and can try to write at the same time?


问:
FutureWarning when creating an empty GeoSeries
I'm trying to create an empty GeoSeries which is later populated with geometries:

```<code>import geopandas as gpd
x = gpd.GeoSeries()
</code>```

This gives me the following warning:

```<code>FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)
</code>```

I tried specifying a dtype to silence the warning as instructed:

```<code>import geopandas as gpd
x = gpd.GeoSeries(dtype='geometry')
</code>```

But this still gives me the exact same FutureWarning.

What can I do to silence the warning?

Edit

I've also tried specifying a different dtype, but the warning still shows:

```<code>x = gpd.GeoSeries(dtype='float64')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='int')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='int64')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='str')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='object')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='geometry')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

</code>```

Versions

In case it helps, the versions I'm using:

```<code>gpd.show_versions()

SYSTEM INFO
-----------
python     : 3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]
executable : xxx
machine    : xxx

GEOS, GDAL, PROJ INFO
---------------------
GEOS       : None
GEOS lib   : None
GDAL       : 3.0.2
GDAL data dir: None
PROJ       : 6.2.1
PROJ data dir: xxx

PYTHON DEPENDENCIES
-------------------
geopandas  : 0.9.0
pandas     : 1.5.2
fiona      : 1.8.13.post1
numpy      : 1.23.4
shapely    : 1.8.4
rtree      : 0.9.7
pyproj     : 2.6.1.post1
matplotlib : 3.5.1
mapclassify: 2.4.3
geopy      : None
psycopg2   : None
geoalchemy2: None
pyarrow    : None
pygeos     : None
</code>```

Body:
I'm trying to create an empty GeoSeries which is later populated with geometries:

import geopandas as gpd
x = gpd.GeoSeries()

This gives me the following warning:

FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

I tried specifying a dtype to silence the warning as instructed:

import geopandas as gpd
x = gpd.GeoSeries(dtype='geometry')

But this still gives me the exact same FutureWarning.

What can I do to silence the warning?

Edit

I've also tried specifying a different dtype, but the warning still shows:

x = gpd.GeoSeries(dtype='float64')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='int')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='int64')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='str')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='object')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

x = gpd.GeoSeries(dtype='geometry')
C:\Users\xxx\anaconda3\envs\xxx\lib\site-packages\geopandas\geoseries.py:207: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  s = pd.Series(data, index=index, name=name, **kwargs)

Versions

In case it helps, the versions I'm using:

gpd.show_versions()

SYSTEM INFO
-----------
python     : 3.9.12 (main, Apr  4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]
executable : xxx
machine    : xxx

GEOS, GDAL, PROJ INFO
---------------------
GEOS       : None
GEOS lib   : None
GDAL       : 3.0.2
GDAL data dir: None
PROJ       : 6.2.1
PROJ data dir: xxx

PYTHON DEPENDENCIES
-------------------
geopandas  : 0.9.0
pandas     : 1.5.2
fiona      : 1.8.13.post1
numpy      : 1.23.4
shapely    : 1.8.4
rtree      : 0.9.7
pyproj     : 2.6.1.post1
matplotlib : 3.5.1
mapclassify: 2.4.3
geopy      : None
psycopg2   : None
geoalchemy2: None
pyarrow    : None
pygeos     : None


问:
Flutter "Generated Plugins" showed with git changes when there are no changes
I am on a Flutter project and I have this 7 files that are related to generated plugins, which showed changes when there were no changes made on my Git. Does anyone have this issue before and have a solution? Much appreciated!

Pic 1

Pic 2

Tried git config --global core.filemode false but doesn't works


问:
Export excel from PHP
I want to download excel file by name.
I'm using ORDER BY Name ASC, it's working and showing information on the site, but when I want to download file doesn't work. but if I check all information it's working.

Screen From My Site

```<code>
<?php
    header("Content-Type: application/xls");
    header("Content-Disposition: attachment; filename=municipaliteties_en_list.xls");
    header("Pragma: no-cache");
    header("Expires: 0");

    require_once 'connection.php';

    $key = isset($_GET['key']) ? $_GET['key'] : '0';
    $mun = isset($_GET['mun']) ? $_GET['mun'] : '0';

    $output = "";

    $output .="
        <table>
            <thead>
                <tr>
                ";

    $output .= "<th>Municipaliteties</th>";
    $output .= strrpos($key,'1') ? "<th>Area (sq. km)</th>" : "" ;
    $output .= strrpos($key,'2') ? "<th>Number of cities and towns (unit)</th>" : "" ;
    $output .= strrpos($key,'3') ? "<th>Number of villages (unit)</th>" : "" ;
    $output .= strrpos($key,'4') ? "<th>Population (thousands)</th>" : "" ;
    $output .= strrpos($key,'5') ? "<th>Number of live births (male)</th>" : "" ;
    $output .= strrpos($key,'6') ? "<th>General birth rate (number of births per 1000 people)</th>" : "" ;
    $output .= strrpos($key,'7') ? "<th>Death (men)</th>" : "" ;
    $output .= strrpos($key,'8') ? "<th>General mortality rate (number of deaths per 1000 people)</th>" : "" ;
    $output .= strrpos($key,'9') ? "<th>Number of employees in the business sector (thousands of people)</th>" : "" ;
    $output .= strrpos($key,'10') ? "<th>Average monthly salary of employees in the business sector (GEL)</th>" : "" ;
    $output .= strrpos($key,'11') ? "<th>Number of registered economic entities (unit)</th>" : "" ;
    $output .= strrpos($key,'12') ? "<th>Number of active economic entities (unit)</th>" : "" ;

    $output .="
                </tr>
            <tbody>
    ";

    $query = mysqli_query($link, "SELECT * FROM `municipalities` WHERE ID IN(". $mun .") ORDER BY Name ASC");
    while($fetch = $query->fetch_array()){

    $output .= "
                <tr>
                    <td>".$fetch['NameEN']."</td>";

                    $output .= strrpos($key,'1') ? "<td>".$fetch['Area']."</td>" : "" ;
                    $output .= strrpos($key,'2') ? "<td>".$fetch['NumberOfCT']."</td>" : "" ;
                    $output .= strrpos($key,'3') ? "<td>".$fetch['Villages']."</td>" : "" ;
                    $output .= strrpos($key,'4') ? "<td>".$fetch['Population']."</td>" : "" ;
                    $output .= strrpos($key,'5') ? "<td>".$fetch['LiveBirths']."</td>" : "" ;
                    $output .= strrpos($key,'6') ? "<td>".$fetch['GeneralBirthRate']."</td>" : "" ;
                    $output .= strrpos($key,'7') ? "<td>".$fetch['Dead']."</td>" : "" ;
                    $output .= strrpos($key,'8') ? "<td>".$fetch['GeneralMortalityRate']."</td>" : "" ;
                    $output .= strrpos($key,'9') ? "<td>".$fetch['Employees']."</td>" : "" ;
                    $output .= strrpos($key,'10') ? "<td>".$fetch['AVGSalary']."</td>" : "" ;
                    $output .= strrpos($key,'11') ? "<td>".$fetch['RegEcSub']."</td>" : "" ;
                    $output .= strrpos($key,'12') ? "<td>".$fetch['ActEcSub']."</td>" : "" ;
    $output .= "</tr>";
    }

    $output .="
            </tbody>

        </table>
    ";

    echo $output;

</code>```

It's my code named: export_excel_mun_en.php  and I don't know how to solve it.

Title: Export excel from PHP

Body:
I want to download excel file by name.
I'm using ORDER BY Name ASC, it's working and showing information on the site, but when I want to download file doesn't work. but if I check all information it's working.

Screen From My Site

<?php
    header("Content-Type: application/xls");
    header("Content-Disposition: attachment; filename=municipaliteties_en_list.xls");
    header("Pragma: no-cache");
    header("Expires: 0");

    require_once 'connection.php';

    $key = isset($_GET['key']) ? $_GET['key'] : '0';
    $mun = isset($_GET['mun']) ? $_GET['mun'] : '0';

    $output = "";

    $output .="

                ";

    $output .= "Municipaliteties	";
    $output .= strrpos($key,'1') ? "Area (sq. km)	" : "" ;
    $output .= strrpos($key,'2') ? "Number of cities and towns (unit)	" : "" ;
    $output .= strrpos($key,'3') ? "Number of villages (unit)	" : "" ;
    $output .= strrpos($key,'4') ? "Population (thousands)	" : "" ;
    $output .= strrpos($key,'5') ? "Number of live births (male)	" : "" ;
    $output .= strrpos($key,'6') ? "General birth rate (number of births per 1000 people)	" : "" ;
    $output .= strrpos($key,'7') ? "Death (men)	" : "" ;
    $output .= strrpos($key,'8') ? "General mortality rate (number of deaths per 1000 people)	" : "" ;
    $output .= strrpos($key,'9') ? "Number of employees in the business sector (thousands of people)	" : "" ;
    $output .= strrpos($key,'10') ? "Average monthly salary of employees in the business sector (GEL)	" : "" ;
    $output .= strrpos($key,'11') ? "Number of registered economic entities (unit)	" : "" ;
    $output .= strrpos($key,'12') ? "Number of active economic entities (unit)	" : "" ;

    $output .="

    ";

    $query = mysqli_query($link, "SELECT * FROM `municipalities` WHERE ID IN(". $mun .") ORDER BY Name ASC");
    while($fetch = $query->fetch_array()){

    $output .= "

                    ".$fetch['NameEN']."	";

                    $output .= strrpos($key,'1') ? "".$fetch['Area']."	" : "" ;
                    $output .= strrpos($key,'2') ? "".$fetch['NumberOfCT']."	" : "" ;
                    $output .= strrpos($key,'3') ? "".$fetch['Villages']."	" : "" ;
                    $output .= strrpos($key,'4') ? "".$fetch['Population']."	" : "" ;
                    $output .= strrpos($key,'5') ? "".$fetch['LiveBirths']."	" : "" ;
                    $output .= strrpos($key,'6') ? "".$fetch['GeneralBirthRate']."	" : "" ;
                    $output .= strrpos($key,'7') ? "".$fetch['Dead']."	" : "" ;
                    $output .= strrpos($key,'8') ? "".$fetch['GeneralMortalityRate']."	" : "" ;
                    $output .= strrpos($key,'9') ? "".$fetch['Employees']."	" : "" ;
                    $output .= strrpos($key,'10') ? "".$fetch['AVGSalary']."	" : "" ;
                    $output .= strrpos($key,'11') ? "".$fetch['RegEcSub']."	" : "" ;
                    $output .= strrpos($key,'12') ? "".$fetch['ActEcSub']."	" : "" ;
    $output .= "
";
    }

    $output .="

    ";

    echo $output;

It's my code named: export_excel_mun_en.php  and I don't know how to solve it.


问:
Assignment operation from constant value in Kotlin not working
In the ViewModel of my Android app built with Kotlin, The method shown below sets the state to the values passed in to it. But if the calling code passes in a String constant, it is not set to the constant's value. Instead, it is set to an empty string. In the example below, passing in a ZERO_STRING constant actually assigns an empty string "". How can I pass in a constant and still make this work?

Constants File

```<code>ZERO_STRING = "0"
ITEM_QUANTITY_STRING = "ItemQuantity"
</code>```

Method in ViewModel

```<code>private val _shoppingListItemState = MutableLiveData(
    savedStateHandle.get<ShoppingListItem>("shoppinglistitem")
        ?: ShoppingListItem()
)

override val shoppingListItemState: LiveData<ShoppingListItem>
        get() = _shoppingListItemState

override fun setStateValue(stateToEdit: String, stateValue: Any?) {
   var itemToUpdate = _shoppingListItemState.value!!

when(stateToEdit) {
   ITEM_QUANTITY_STRING -> itemToUpdate = itemToUpdate.copy(quantity = stateValue.toString())
}
   _shoppingListItemState.value = itemToUpdate
}
</code>```
```<code>//This works
setStateValue(ITEM_QUANTITY_STRING, "0")

//This does not work. It assigns "" instead of "0"
setStateValue(ITEM_QUANTITY_STRING, ZERO_STRING)
</code>```

Body:
In the ViewModel of my Android app built with Kotlin, The method shown below sets the state to the values passed in to it. But if the calling code passes in a String constant, it is not set to the constant's value. Instead, it is set to an empty string. In the example below, passing in a ZERO_STRING constant actually assigns an empty string "". How can I pass in a constant and still make this work?

Constants File

ZERO_STRING = "0"
ITEM_QUANTITY_STRING = "ItemQuantity"

Method in ViewModel

private val _shoppingListItemState = MutableLiveData(
    savedStateHandle.get<ShoppingListItem>("shoppinglistitem")
        ?: ShoppingListItem()
)

override val shoppingListItemState: LiveData<ShoppingListItem>
        get() = _shoppingListItemState

override fun setStateValue(stateToEdit: String, stateValue: Any?) {
   var itemToUpdate = _shoppingListItemState.value!!

when(stateToEdit) {
   ITEM_QUANTITY_STRING -> itemToUpdate = itemToUpdate.copy(quantity = stateValue.toString())
}
   _shoppingListItemState.value = itemToUpdate
}

//This works
setStateValue(ITEM_QUANTITY_STRING, "0")

//This does not work. It assigns "" instead of "0"
setStateValue(ITEM_QUANTITY_STRING, ZERO_STRING)


问:
Grafana alerting on ephemeral namespace
If we have an alert that is created within Grafana that relies on a namespace and that namespace is ephemeral, will we get alerted if the alert is active and the namespace is removed? I provided an example below which includes the namespace develop as an example.

The exact alert triggers is the namespace persistent volume exceeds 95% utilization.

Example PromQL:

```<code>sum without(instance, node) (topk(1, (kubelet_volume_stats_available_bytes{cluster="", job="kubelet", metrics_path="/metrics", namespace="develop", persistentvolumeclaim="chserver-logs"})))
</code>```

Title: Grafana alerting on ephemeral namespace

Body:
If we have an alert that is created within Grafana that relies on a namespace and that namespace is ephemeral, will we get alerted if the alert is active and the namespace is removed? I provided an example below which includes the namespace develop as an example.

The exact alert triggers is the namespace persistent volume exceeds 95% utilization.

Example PromQL:

sum without(instance, node) (topk(1, (kubelet_volume_stats_available_bytes{cluster="", job="kubelet", metrics_path="/metrics", namespace="develop", persistentvolumeclaim="chserver-logs"})))


问:
Parse Basic Programming
Receiving this error when trying to compile code on replit. I have already tried to declare two arrays, you need to use separate DIM statements for each array:

as 20 DIM W$(10)
30 DIM G$(26)

Error:  ParseError: Parse error on line 20: Unexpected token DIM

Any suggestions on how to resolve this issue

```<code>   10 REM Hangman game
   20 REM Set up variables
   30 DIM W$(10), G$(26)
   40 LET C = 0
   50 LET I = 0
   60 LET J = 0
70 REM Set up word list
80 W$(1) = "HANGMAN"
90 W$(2) = "BASIC"
100 W$(3) = "COMPUTER"
110 W$(4) = "PROGRAM"
120 W$(5) = "VINTAGE"
130 REM Select a random word
140 LET R = INT(RND(1) * 5) + 1
150 LET W = W$(R)
160 REM Set up guess string
170 FOR I = 1 TO LEN(W)
180 G$(I) = "-"
190 NEXT I
200 REM Main game loop
210 DO
220 CLS
230 PRINT "Hangman"
240 PRINT
250 PRINT "Word: ";
260 FOR I = 1 TO LEN(W)
270 PRINT G$(I);
280 NEXT I
290 PRINT
300 PRINT "Guesses: ";
310 FOR I = 1 TO 26
320 IF G$(I) <> "-" THEN PRINT G$(I);
330 NEXT I
340 PRINT
350 INPUT "Enter a letter: ", L$
360 IF LEN(L$) > 1 THEN 400
370 IF L$ < "A" OR L$ > "Z" THEN 400
380 LET L = ASC(L$) - 64
390 GOTO 420
400 PRINT "Invalid input. Please enter a single letter."
410 GOTO 350
420 REM Check if letter is in word
430 LET F = 0
440 FOR I = 1 TO LEN(W)
450 IF MID$(W, I, 1) = L$ THEN G$(I) = L$: F = 1
460 NEXT I
470 IF F = 0 THEN C = C + 1
480 IF C = 6 THEN 600
490 REM Check for win
500 LET WN = 1
510 FOR I = 1 TO LEN(W)
520 IF G$(I) = "-" THEN WN = 0
530 NEXT I
540 IF WN THEN PRINT "You win!": GOTO 650
550 REM Check for loss
560 IF C = 6 THEN PRINT "You lose. The word was "; W: GOTO 650
570 LOOP
600 REM Draw hangman
610 PRINT " _____"
620 PRINT " | |"
630 IF C > 1 THEN PRINT " O |" ELSE PRINT " |"
640 IF C > 2 THEN PRINT "/|\ |" ELSE PRINT " |"
650 END
</code>```

/////

I tried declaring separate arrays. I also tried running it on a vintage basic terminal, and received an error with line 150 "type mismatch"

Title: Parse Basic Programming

Body:
Receiving this error when trying to compile code on replit. I have already tried to declare two arrays, you need to use separate DIM statements for each array:

as 20 DIM W$(10)
30 DIM G$(26)

Error:  ParseError: Parse error on line 20: Unexpected token DIM

Any suggestions on how to resolve this issue

   10 REM Hangman game
   20 REM Set up variables
   30 DIM W$(10), G$(26)
   40 LET C = 0
   50 LET I = 0
   60 LET J = 0
70 REM Set up word list
80 W$(1) = "HANGMAN"
90 W$(2) = "BASIC"
100 W$(3) = "COMPUTER"
110 W$(4) = "PROGRAM"
120 W$(5) = "VINTAGE"
130 REM Select a random word
140 LET R = INT(RND(1) * 5) + 1
150 LET W = W$(R)
160 REM Set up guess string
170 FOR I = 1 TO LEN(W)
180 G$(I) = "-"
190 NEXT I
200 REM Main game loop
210 DO
220 CLS
230 PRINT "Hangman"
240 PRINT
250 PRINT "Word: ";
260 FOR I = 1 TO LEN(W)
270 PRINT G$(I);
280 NEXT I
290 PRINT
300 PRINT "Guesses: ";
310 FOR I = 1 TO 26
320 IF G$(I) <> "-" THEN PRINT G$(I);
330 NEXT I
340 PRINT
350 INPUT "Enter a letter: ", L$
360 IF LEN(L$) > 1 THEN 400
370 IF L$ < "A" OR L$ > "Z" THEN 400
380 LET L = ASC(L$) - 64
390 GOTO 420
400 PRINT "Invalid input. Please enter a single letter."
410 GOTO 350
420 REM Check if letter is in word
430 LET F = 0
440 FOR I = 1 TO LEN(W)
450 IF MID$(W, I, 1) = L$ THEN G$(I) = L$: F = 1
460 NEXT I
470 IF F = 0 THEN C = C + 1
480 IF C = 6 THEN 600
490 REM Check for win
500 LET WN = 1
510 FOR I = 1 TO LEN(W)
520 IF G$(I) = "-" THEN WN = 0
530 NEXT I
540 IF WN THEN PRINT "You win!": GOTO 650
550 REM Check for loss
560 IF C = 6 THEN PRINT "You lose. The word was "; W: GOTO 650
570 LOOP
600 REM Draw hangman
610 PRINT " _____"
620 PRINT " | |"
630 IF C > 1 THEN PRINT " O |" ELSE PRINT " |"
640 IF C > 2 THEN PRINT "/|\ |" ELSE PRINT " |"
650 END

/////

I tried declaring separate arrays. I also tried running it on a vintage basic terminal, and received an error with line 150 "type mismatch"


问:
next-js static deploy not working due to the website files being in to subdirectory of the repo
https://github.com/mrpatches123/patchy-api
the next js app is in /docs. What ever I do doesn't seem to fix it. If anyone has any suggestions that would help.

I tried https://github.com/mrpatches123/patchy-api/blob/main/.github/workflows/nextjs_new.yml
and it errors with Error: Dependencies lock file is not found in /home/runner/work/patchy-api/patchy-api. Supported file patterns: package-lock.json,npm-shrinkwrap.json,yarn.lock


问:
Run pyspark program in pycharm - windows 11 pro
I am running pyspark application in my local windows machine (win 11 pro). Installed java , scala , python and pycharm. while running sample code , i am getting below exception. can you please help me on this. I tried all the way to resolve the issue. But i failed in all the options.
Here is my configuration:</p>
```<code>C:\Users\LENOVO>pyspark
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
22/12/20 11:23:31 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 3.3.0
      /_/

Using Python version 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022 16:14:13)
Spark context Web UI available at http://host.docker.internal:4040
Spark context available as 'sc' (master = local[*], app id = local-1671515612280).
SparkSession available as 'spark'.

>>> df = spark.createDataFrame(data=data, schema=columns)
>>> df.show()
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
22/12/20 11:24:34 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
org.apache.spark.SparkException: Python worker failed to connect back.
        at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
        at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
        at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
        at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
        at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
        at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)

22/12/20 11:24:34 ERROR TaskSetManager: Task 0 in stage 0.0 failed 1 times; aborting job
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\spark-3.3.0-bin-hadoop2\python\pyspark\sql\dataframe.py", line 606, in show
    print(self._jdf.showString(n, 20, vertical))
  File "C:\spark-3.3.0-bin-hadoop2\python\lib\py4j-0.10.9.5-src.zip\py4j\java_gateway.py", line 1321, in __call__
  File "C:\spark-3.3.0-bin-hadoop2\python\pyspark\sql\utils.py", line 190, in deco
    return f(*a, **kw)
  File "C:\spark-3.3.0-bin-hadoop2\python\lib\py4j-0.10.9.5-src.zip\py4j\protocol.py", line 326, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o52.showString.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0) (host.docker.internal executor driver): org.apache.spark.SparkException: Python worker failed to connect back.
        at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
        at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
        at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
        at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
        at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
        at
</code>```

Body:
I am running pyspark application in my local windows machine (win 11 pro). Installed java , scala , python and pycharm. while running sample code , i am getting below exception. can you please help me on this. I tried all the way to resolve the issue. But i failed in all the options.
Here is my configuration:

C:\Users\LENOVO>pyspark
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
22/12/20 11:23:31 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 3.3.0
      /_/

Using Python version 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022 16:14:13)
Spark context Web UI available at http://host.docker.internal:4040
Spark context available as 'sc' (master = local[*], app id = local-1671515612280).
SparkSession available as 'spark'.

>>> df = spark.createDataFrame(data=data, schema=columns)
>>> df.show()
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
22/12/20 11:24:34 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
org.apache.spark.SparkException: Python worker failed to connect back.
        at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
        at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
        at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
        at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
        at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
        at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)

22/12/20 11:24:34 ERROR TaskSetManager: Task 0 in stage 0.0 failed 1 times; aborting job
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\spark-3.3.0-bin-hadoop2\python\pyspark\sql\dataframe.py", line 606, in show
    print(self._jdf.showString(n, 20, vertical))
  File "C:\spark-3.3.0-bin-hadoop2\python\lib\py4j-0.10.9.5-src.zip\py4j\java_gateway.py", line 1321, in __call__
  File "C:\spark-3.3.0-bin-hadoop2\python\pyspark\sql\utils.py", line 190, in deco
    return f(*a, **kw)
  File "C:\spark-3.3.0-bin-hadoop2\python\lib\py4j-0.10.9.5-src.zip\py4j\protocol.py", line 326, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o52.showString.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0) (host.docker.internal executor driver): org.apache.spark.SparkException: Python worker failed to connect back.
        at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
        at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
        at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
        at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
        at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
        at


问:
When CodePush App rollsback due to unknown reason, will it try to update again automatically?
I want to ask about a certain codepush scenario.

If my Codepush enabled react native App does a rollback while installing a new update due to unknown reason (failed install etc. ), then will it try to re-sync and try to install the latest codepush update again?

I looked in the Docs for this, but couldn't find anything solid and it is very difficult to re-produce this to test it manually.


问:
Unity build aab GooglePlay
I use WWise + Unity. Wwise sounds are in the streaming assets folder. When I build the game in "aab" with "default" compression. All sounds are in place, the weight of the game is correct. But when I upload the game to "Google play" the Wwise sounds disappear and the weight of the game becomes smaller. It looks like it doesn't see the streaming assets folder or deletes it altogether. But at the same time, if you build with "lz4" or "Lz4hc" compression, there is no such problem. What could be the problem?

In the path in the streaming assets folders, I tried to write the name of the folders with a small letter. I read somewhere that this might help. But it did not help. At the same time, everything works as it should only if you make a build with Lz4 and Lz4hc compression. But we need to make a build with "default" compression.

Title: Unity build aab GooglePlay