问:
can't decode lat/lng in flutter_google_map(flutter_polyline_points)
this is example code in pub.dev

```<code>import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

import 'package:flutter_polyline_points/flutter_polyline_points.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Polyline example',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.orange,
      ),
      home: MapScreen(),
    );
  }
}

class MapScreen extends StatefulWidget {
  @override
  _MapScreenState createState() => _MapScreenState();
}

class _MapScreenState extends State<MapScreen> {
  late GoogleMapController mapController;
  // double _originLatitude = 6.5212402, _originLongitude = 3.3679965;
  // double _destLatitude = 6.849660, _destLongitude = 3.648190;
  double _originLatitude = 26.48424, _originLongitude = 50.04551;
  double _destLatitude = 26.46423, _destLongitude = 50.06358;
  Map<MarkerId, Marker> markers = {};
  Map<PolylineId, Polyline> polylines = {};
  List<LatLng> polylineCoordinates = [];
  PolylinePoints polylinePoints = PolylinePoints();
  String googleAPiKey = "AIzaSyA4TgUKzpYzWqFFzik8uqtu816xAkpMhnc";

  @override
  void initState() {
    super.initState();

    /// origin marker
    _addMarker(LatLng(_originLatitude, _originLongitude), "origin",
        BitmapDescriptor.defaultMarker);

    /// destination marker
    _addMarker(LatLng(_destLatitude, _destLongitude), "destination",
        BitmapDescriptor.defaultMarkerWithHue(90));
    _getPolyline();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
          body: GoogleMap(
            initialCameraPosition: CameraPosition(
                target: LatLng(_originLatitude, _originLongitude), zoom: 15),
            myLocationEnabled: true,
            tiltGesturesEnabled: true,
            compassEnabled: true,
            scrollGesturesEnabled: true,
            zoomGesturesEnabled: true,
            onMapCreated: _onMapCreated,
            markers: Set<Marker>.of(markers.values),
            polylines: Set<Polyline>.of(polylines.values),
          )
      ),
    );
  }

  void _onMapCreated(GoogleMapController controller) async {
    mapController = controller;
  }

  _addMarker(LatLng position, String id, BitmapDescriptor descriptor) {
    MarkerId markerId = MarkerId(id);
    Marker marker =
    Marker(markerId: markerId, icon: descriptor, position: position);
    markers[markerId] = marker;
  }

  _addPolyLine() {
    PolylineId id = PolylineId("poly");
    Polyline polyline = Polyline(
        polylineId: id, color: Colors.red, points: polylineCoordinates);
    polylines[id] = polyline;
    setState(() {});
  }

  _getPolyline() async {
    PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
        googleAPiKey,
        PointLatLng(_originLatitude, _originLongitude),
        PointLatLng(_destLatitude, _destLongitude),
        travelMode: TravelMode.driving,
        wayPoints: [PolylineWayPoint(location: "Sabo, Yaba Lagos Nigeria")]);
    if (result.points.isNotEmpty) {
      print(result.points);
      result.points.forEach((PointLatLng point) {
        polylineCoordinates.add(LatLng(point.latitude, point.longitude));
        print(point);
      });
    }
    _addPolyLine();
  }
}
</code>```

goto polar... : -

lat/lng are incorrectly decoded:

```<code>lat: 26.48426 / longitude: 50.04557
lat: 42974.52504 / longitude: 42996.53506
lat: 42974.97077 / longitude: 85945.60919
lat: 42975.63476 / longitude: 128894.19193
lat: 42975.85842 / longitude: 171842.96642
lat: 42976.36448 / longitude: 214791.73755
lat: 42977.1388 / longitude: 257739.82004
lat: 85926.64582 / longitude: 300688.95536
lat: 128875.84375 / longitude: 343637.03394
lat: 128876.021 / longitude: 386585.83405
lat: 128876.68735 / longitude: 429535.09705
lat: 128877.45938 / longitude: 472484.06431
lat: 171827.0864 / longitude: 515432.8731
</code>```

Body:
this is example code in pub.dev

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

import 'package:flutter_polyline_points/flutter_polyline_points.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Polyline example',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.orange,
      ),
      home: MapScreen(),
    );
  }
}

class MapScreen extends StatefulWidget {
  @override
  _MapScreenState createState() => _MapScreenState();
}

class _MapScreenState extends State<MapScreen> {
  late GoogleMapController mapController;
  // double _originLatitude = 6.5212402, _originLongitude = 3.3679965;
  // double _destLatitude = 6.849660, _destLongitude = 3.648190;
  double _originLatitude = 26.48424, _originLongitude = 50.04551;
  double _destLatitude = 26.46423, _destLongitude = 50.06358;
  Map<MarkerId, Marker> markers = {};
  Map<PolylineId, Polyline> polylines = {};
  List<LatLng> polylineCoordinates = [];
  PolylinePoints polylinePoints = PolylinePoints();
  String googleAPiKey = "AIzaSyA4TgUKzpYzWqFFzik8uqtu816xAkpMhnc";

  @override
  void initState() {
    super.initState();

    /// origin marker
    _addMarker(LatLng(_originLatitude, _originLongitude), "origin",
        BitmapDescriptor.defaultMarker);

    /// destination marker
    _addMarker(LatLng(_destLatitude, _destLongitude), "destination",
        BitmapDescriptor.defaultMarkerWithHue(90));
    _getPolyline();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
          body: GoogleMap(
            initialCameraPosition: CameraPosition(
                target: LatLng(_originLatitude, _originLongitude), zoom: 15),
            myLocationEnabled: true,
            tiltGesturesEnabled: true,
            compassEnabled: true,
            scrollGesturesEnabled: true,
            zoomGesturesEnabled: true,
            onMapCreated: _onMapCreated,
            markers: Set<Marker>.of(markers.values),
            polylines: Set<Polyline>.of(polylines.values),
          )
      ),
    );
  }

  void _onMapCreated(GoogleMapController controller) async {
    mapController = controller;
  }

  _addMarker(LatLng position, String id, BitmapDescriptor descriptor) {
    MarkerId markerId = MarkerId(id);
    Marker marker =
    Marker(markerId: markerId, icon: descriptor, position: position);
    markers[markerId] = marker;
  }

  _addPolyLine() {
    PolylineId id = PolylineId("poly");
    Polyline polyline = Polyline(
        polylineId: id, color: Colors.red, points: polylineCoordinates);
    polylines[id] = polyline;
    setState(() {});
  }

  _getPolyline() async {
    PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
        googleAPiKey,
        PointLatLng(_originLatitude, _originLongitude),
        PointLatLng(_destLatitude, _destLongitude),
        travelMode: TravelMode.driving,
        wayPoints: [PolylineWayPoint(location: "Sabo, Yaba Lagos Nigeria")]);
    if (result.points.isNotEmpty) {
      print(result.points);
      result.points.forEach((PointLatLng point) {
        polylineCoordinates.add(LatLng(point.latitude, point.longitude));
        print(point);
      });
    }
    _addPolyLine();
  }
}

goto polar... : -

lat/lng are incorrectly decoded:

lat: 26.48426 / longitude: 50.04557
lat: 42974.52504 / longitude: 42996.53506
lat: 42974.97077 / longitude: 85945.60919
lat: 42975.63476 / longitude: 128894.19193
lat: 42975.85842 / longitude: 171842.96642
lat: 42976.36448 / longitude: 214791.73755
lat: 42977.1388 / longitude: 257739.82004
lat: 85926.64582 / longitude: 300688.95536
lat: 128875.84375 / longitude: 343637.03394
lat: 128876.021 / longitude: 386585.83405
lat: 128876.68735 / longitude: 429535.09705
lat: 128877.45938 / longitude: 472484.06431
lat: 171827.0864 / longitude: 515432.8731


来源: stackexchange

问:
curl error 28 while downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json: Connection timed out after 10006 milliseconds
I am trying to create a symfony skeleton project using below command

composer create-project symfony/skeleton my_project_name

After, I hit the enter, its starts installing symfony and after few seconds it shows below error

[Composer\Downloader\TransportException] curl error 28 while
downloading
https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json:
Connection timed out after 10006 milliseconds

I want to create a symfony project using composer only, is there a way?

I also created an issue with symfony git repository, they shifted the issue to discussions (below is the url)

https://github.com/symfony/symfony/discussions/48733#discussioncomment-4512675

Composer Version : 2.1.12

Php Version I have tried : 8.0.2 and 8.1

ContentLicense: CC BY-SA 4.0


问:
A connection could not be established because the database name '<databaseName>' is larger than the maximum length allowed by the network protocol
We are trying to pull data using a JDBC connection request and spark 3.2.0. Our JDBC call using splice driver (com.splicemachine:db-client:2.7.0.1815) looks something like this with sample query -

```<code>val url_upd = "jdbc:splice://sl73caehdp0225.visa.com:1527/splicedb;user=***;password=a***"
val query = "select top 5 ENCRPT_PYMT_CRD_ACCT_NUM_NORM from optd.ttd_cs_dtl CS where TRAN_CD IN ('01','04','05','06','10','11')"

val jdbcDF = spark.read.format("jdbc").option("url", url).option("driver", "com.splicemachine.db.jdbc.ClientDriver").option("query", query).load();
</code>```

And we are observing a limitation of "111" characters for the size of the query to get the results. If the size exceeds this limit, we are receiving the below error -

"A connection could not be established because the database name '' is larger than the maximum length allowed by the network protocol."

The same connection request and query work fine in spark 2.3

Body:
We are trying to pull data using a JDBC connection request and spark 3.2.0. Our JDBC call using splice driver (com.splicemachine:db-client:2.7.0.1815) looks something like this with sample query -

val url_upd = "jdbc:splice://sl73caehdp0225.visa.com:1527/splicedb;user=***;password=a***"
val query = "select top 5 ENCRPT_PYMT_CRD_ACCT_NUM_NORM from optd.ttd_cs_dtl CS where TRAN_CD IN ('01','04','05','06','10','11')"

val jdbcDF = spark.read.format("jdbc").option("url", url).option("driver", "com.splicemachine.db.jdbc.ClientDriver").option("query", query).load();

And we are observing a limitation of "111" characters for the size of the query to get the results. If the size exceeds this limit, we are receiving the below error -

"A connection could not be established because the database name '' is larger than the maximum length allowed by the network protocol."

The same connection request and query work fine in spark 2.3


问:
Is there any way to test Google AdSense?
I'm making advertisement zone for my company's site, and I want to show google adsense if site's administerator register ad with adsense code.

The logic is already made and now I wanna test it in local environment.

Someone said insert "data-ad-test='on'", but it wasn't work my case.

Perhaps, is there any way to test adsense..?

insert "data-ad-test='on'", but it wasn't work my case.

Just I wanna know how to work adsense in local environment.
Of course, it's OK that doesn't make profit


问:
How to record mouse and keyboard movement simultaneously, and store it as a variable that could be placed in a function or loop with Python?
So I want to start a project that records my keyboard input and mouse movement for a sandbox PC games. I love farming, however whether I'm tired, and taking a short break to make a coffee or have a phone call. When I come back my farm gets annihilated.

I tried and made this one, but it seems not to work. Any way to make it better with the possibility to implement the recorded inputs in a loop function?

```<code>import pyautogui

def record_movement():
    # Initialize variables to store mouse and keyboard events
    mouse_events = []
    keyboard_events = []

    # Start recording mouse and keyboard events
    pyautogui.PAUSE = 0.001 # Set a small pause to record events more accurately
    pyautogui.FAILSAFE = False # Disable failsafe feature to allow for recording
    recording = True
    while recording:
        event = pyautogui.getEvent()
        if event.event_type == 'MouseMove':
            mouse_events.append(event)
        elif event.event_type == 'KeyDown':
            keyboard_events.append(event)
        elif event.event_type == 'KeyUp':
            keyboard_events.append(event)
        elif event.event_type == 'Quit':
            recording = False
    return mouse_events, keyboard_events

def replay_movement(mouse_events, keyboard_events):
    # Replay recorded mouse and keyboard events
    for event in mouse_events:
        pyautogui.moveTo(event.x, event.y)
    for event in keyboard_events:
        if event.event_type == 'KeyDown':
            pyautogui.press(event.name)
        elif event.event_type == 'KeyUp':
            pyautogui.keyUp(event.name)

# Test:
mouse_events, keyboard_events = record_movement()
replay_movement(mouse_events, keyboard_events)
</code>```

Body:
So I want to start a project that records my keyboard input and mouse movement for a sandbox PC games. I love farming, however whether I'm tired, and taking a short break to make a coffee or have a phone call. When I come back my farm gets annihilated.

I tried and made this one, but it seems not to work. Any way to make it better with the possibility to implement the recorded inputs in a loop function?

import pyautogui

def record_movement():
    # Initialize variables to store mouse and keyboard events
    mouse_events = []
    keyboard_events = []

    # Start recording mouse and keyboard events
    pyautogui.PAUSE = 0.001 # Set a small pause to record events more accurately
    pyautogui.FAILSAFE = False # Disable failsafe feature to allow for recording
    recording = True
    while recording:
        event = pyautogui.getEvent()
        if event.event_type == 'MouseMove':
            mouse_events.append(event)
        elif event.event_type == 'KeyDown':
            keyboard_events.append(event)
        elif event.event_type == 'KeyUp':
            keyboard_events.append(event)
        elif event.event_type == 'Quit':
            recording = False
    return mouse_events, keyboard_events

def replay_movement(mouse_events, keyboard_events):
    # Replay recorded mouse and keyboard events
    for event in mouse_events:
        pyautogui.moveTo(event.x, event.y)
    for event in keyboard_events:
        if event.event_type == 'KeyDown':
            pyautogui.press(event.name)
        elif event.event_type == 'KeyUp':
            pyautogui.keyUp(event.name)

# Test:
mouse_events, keyboard_events = record_movement()
replay_movement(mouse_events, keyboard_events)


问:
Object that stores multidimensional index that can be supplied in operator[]
As C++23 supports multidimensional subscript operator(eg. a[1, 2, 3] and mdspan, is there native support for storing an multidimensional index as an object and used multiple times?

One example could be

```<code>// not storing as object {int a; double b;} due to layout considerations
// maybe we want contiguous accessing a/b individually to be fast but there are
// slow operations using both
std::array<std::array<std::array<int, L>, M>, N> a;
std::array<std::array<std::array<double,L>, M>, N> b;
// Index is conjured up
Index idx{3, 5, 2};
doSomething(a[idx], b[idx]);
</code>```

Is there anything we would get from the mdspan library that achieve this? I feel this is actually something handy when doing operations above, but seems like we need to implement ourselves.

Body:
As C++23 supports multidimensional subscript operator(eg. a[1, 2, 3] and mdspan, is there native support for storing an multidimensional index as an object and used multiple times?

One example could be

// not storing as object {int a; double b;} due to layout considerations
// maybe we want contiguous accessing a/b individually to be fast but there are
// slow operations using both
std::array<std::array<std::array<int, L>, M>, N> a;
std::array<std::array<std::array<double,L>, M>, N> b;
// Index is conjured up
Index idx{3, 5, 2};
doSomething(a[idx], b[idx]);

Is there anything we would get from the mdspan library that achieve this? I feel this is actually something handy when doing operations above, but seems like we need to implement ourselves.


问:
Copy data from Excel file Postgresql
I need to copy the data of three columns of the excel file into fifth column for Postgresql for further enter the data into table together. I need to copy the data into this below insert query format.so what would be the formula I need to use in Excel.

```<code>INSERT INTO dlhg.traducao_de_protocolo (status, traducao, tipo_do_dive)
VALUES ('', '', '');
</code>```

I tried in this way but didn't work accurately.

```<code>="insert into .....D4 Values )" & "'"& B4  &", "& [@Tradução]
</code>```

Title: Copy data from Excel file Postgresql

Body:
I need to copy the data of three columns of the excel file into fifth column for Postgresql for further enter the data into table together. I need to copy the data into this below insert query format.so what would be the formula I need to use in Excel.

INSERT INTO dlhg.traducao_de_protocolo (status, traducao, tipo_do_dive)
VALUES ('', '', '');

I tried in this way but didn't work accurately.

="insert into .....D4 Values )" & "'"& B4  &", "& [@Tradução]


问:
Generate a graph for the diffusion equation
I have a code that represents the diffusion equation (Concentration as a function of time and space):

∂²C/∂x² - ∂C/∂t= 0

I discretized to the following form:

C[n+1,j] = C[n,j] + (dt/dx²)(C[n,j+1] - 2(C[n,j]) + C[n,j-1])

I am trying to generate the following graph, however I haven't had much success. Is there anyone who could help me with this? Many thanks!

The graph that I obtain:

The code that I have to reproduce the diffusion equation:

```<code>import numpy as np
import matplotlib.pyplot as plt

dt = 0.001 # grid size for time (s)
dx = 0.05 # grid size for space (m)
x_max = 1 # in m
t_max = 1 # total time in s
C0 = 1 # concentration

# function to calculate concentration profiles based on a
# finite difference approximation to the 1D diffusion
# equation:
def diffusion(dt,dx,t_max,x_max,C0):
    # diffusion number:
    s = dt/dx**2
    x = np.arange(0,x_max+dx,dx)
    t = np.arange(0,t_max+dt,dt)
    r = len(t)
    a = len(x)
    C = np.zeros([r,a]) # initial condition
    C[:,0] = C0 # boundary condition on left side
    C[:,-1] = 0 # boundary condition on right side
    for n in range(0,r-1): # time
        for j in range(1,a-1): # space
            C[n+1,j] = C[n,j] + s*(C[n,j-1] -
                2*C[n,j] + C[n,j+1])
    return x,C,r,a
# note that this can be written without the for-loop
# in space, but it is easier to read it this way

x,C,r,a = diffusion(dt,dx,t_max,x_max,C0)

# plotting:
plt.figure()
plt.xlim([0,1])
plt.ylim([0,1])
plot_times = np.arange(0,1,0.02)
for t in plot_times:
    plt.plot(x,C[int(t/dt),:],'Gray',label='numerical')
plt.xlabel('Membrane position x',fontsize=12)
plt.ylabel('Concentration',fontsize=12)
</code>```

Body:
I have a code that represents the diffusion equation (Concentration as a function of time and space):

∂²C/∂x² - ∂C/∂t= 0

I discretized to the following form:

C[n+1,j] = C[n,j] + (dt/dx²)(C[n,j+1] - 2(C[n,j]) + C[n,j-1])

I am trying to generate the following graph, however I haven't had much success. Is there anyone who could help me with this? Many thanks!

The graph that I obtain:

The code that I have to reproduce the diffusion equation:

import numpy as np
import matplotlib.pyplot as plt

dt = 0.001 # grid size for time (s)
dx = 0.05 # grid size for space (m)
x_max = 1 # in m
t_max = 1 # total time in s
C0 = 1 # concentration

# function to calculate concentration profiles based on a
# finite difference approximation to the 1D diffusion
# equation:
def diffusion(dt,dx,t_max,x_max,C0):
    # diffusion number:
    s = dt/dx**2
    x = np.arange(0,x_max+dx,dx)
    t = np.arange(0,t_max+dt,dt)
    r = len(t)
    a = len(x)
    C = np.zeros([r,a]) # initial condition
    C[:,0] = C0 # boundary condition on left side
    C[:,-1] = 0 # boundary condition on right side
    for n in range(0,r-1): # time
        for j in range(1,a-1): # space
            C[n+1,j] = C[n,j] + s*(C[n,j-1] -
                2*C[n,j] + C[n,j+1])
    return x,C,r,a
# note that this can be written without the for-loop
# in space, but it is easier to read it this way

x,C,r,a = diffusion(dt,dx,t_max,x_max,C0)

# plotting:
plt.figure()
plt.xlim([0,1])
plt.ylim([0,1])
plot_times = np.arange(0,1,0.02)
for t in plot_times:
    plt.plot(x,C[int(t/dt),:],'Gray',label='numerical')
plt.xlabel('Membrane position x',fontsize=12)
plt.ylabel('Concentration',fontsize=12)


问:
Zookeeper znode delete
echo mntr | nc localhost 2181
zk_version      3.4.6-78--1, built on 12/06/2018 12:30 GMT
zk_avg_latency  319
zk_max_latency  13406
zk_min_latency  0
zk_packets_received     1847226
zk_packets_sent 1782230
zk_num_alive_connections        437
zk_outstanding_requests 0
zk_server_state follower
zk_znode_count  3188127

zk_watch_count  21
zk_ephemerals_count     27
zk_approximate_data_size        651278666
zk_open_file_descriptor_count   473
zk_max_file_descriptor_count    4096
zk_fsync_threshold_exceed_count 1

zk_znode_count  3188127

For me zk_znode_count looks very high
Please can anyone help me to  how to list all zonode.
After checking znodes details h ave to decide to delete on based on what criteria....?

It would be help full because of my cluster service are always in acive/active or standby/standby mode.

Thanks in Adv,

Title: Zookeeper znode delete


问:
Encryption and decryption of messages in a chat application
I am building a chat application in Angular 13 and .net 6. I have built the basic app. Real time chat is working just fine but there are few things missing in the app -

All the messages are transferred in plain text, I want to encrypt them on client side and decrypt at other client side while showing them.

Now the messages are being stored in the sql server but I want them to store on the client side just like whatsapp, so is there any Database or efficient way to store them in angular and use them.

The expected result I want is the when user sends a message then it is encrypted (in angular) and then sent to the other user and stored in his local database and then we decrypt it to show it to him.


问:
Not getting data from native side to flutter using method channels in android
In my app I am using flutter_twilio package to get the incoming call from twilio. When user lift the call the package showing a call screen from native side. Now I want add a new button to call screen and based on button click I need to send data from native to flutter side using method channels. So I started to implement method channels. I am able to send data from flutter to native but vice versa is not working. I am not even getting any error logs to find the problem.

Flutter Side:

```<code>void callbackDispatcher() {
  WidgetsFlutterBinding.ensureInitialized();
  print("Our background job ran!");
}

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initializeFirebase();
  await initialize(callbackDispatcher);
  runApp(const MyApp());
}

const MethodChannel channel = MethodChannel("native_to_flutter_main");

Future<void> initialize(final Function callbackDispatcher) async {
  final callback = PluginUtilities.getCallbackHandle(callbackDispatcher);

  await channel.invokeMethod('initialize', callback!.toRawHandle()); /*This is executing and able to pass data to native*/

  channel.setMethodCallHandler((call) async {
    switch (call.method) {
      case 'recordStart':
        Helper().showSnackBar('Record Start');
        debugPrint('recordStart');
        return 'some string';
      case 'recordStop':
        Helper().showSnackBar('Record Stop');
        debugPrint('recordStop');
        return 'some string';
      default:
        throw MissingPluginException('notImplemented');
    }
  });
}
</code>```

FlutterTwilioVoicePlugin.java in flutter_twilio package:

```<code>public class FlutterTwilioVoicePlugin implements
        FlutterPlugin,
        MethodChannel.MethodCallHandler,
        ActivityAware,
        PluginRegistry.NewIntentListener {

  private static final String TAG = "FlutterTwilioVoicePlugin";
  private Context context;
  private static MethodChannel customChannel;
  private CustomBroadcastReceiver broadcastReceiver;
  private boolean broadcastReceiverRegistered = false;

  public FlutterTwilioVoicePlugin() {
  }

  private void setupMethodChannel(BinaryMessenger messenger, Context context){
    this.context = context;
    this.customChannel = new MethodChannel(messenger, "native_to_flutter_main");

    customChannel.setMethodCallHandler(
                        (call, result) -> {
                            if (call.method.equals("initialize")) {
                                int batteryLevel = getBatteryLevel();
                                Log.i(TAG, "callback from flutter"); /*This is executing*/
                                if (batteryLevel != -1) {
                                    result.success(batteryLevel);
                                } else {
                                    result.error("UNAVAILABLE", "Battery level not available.", null);
                                }
                            } else {
                                result.notImplemented();
                            }
                        }
                );

    customChannel.invokeMethod("recordStart", true); /*This is not executing, not getting error logs*/
    customChannel.invokeMethod("recordStop", false); /*This is not executing, not getting error logs*/
    Log.i(TAG, "setupMethodChannel called from native");
  }
    private int getBatteryLevel() {
        int batteryLevel = 10;
        Log.i(TAG, "Battery level called from native");
        return batteryLevel;
    }
</code>```

Flutter console logs:

```<code>Debug service listening on ws://127.0.0.1:54443/WHuZNE7DfTM=/ws
Syncing files to device AC2001...
I/FlutterTwilioVoicePlugin(17642): Battery level called from native
I/FlutterTwilioVoicePlugin(17642): callback from flutter
W/FlutterJNI(17642): FlutterJNI.loadLibrary called more than once
I/ResourceExtractor(17642): Found extracted resources res_timestamp-1-1673516201217
W/FlutterJNI(17642): FlutterJNI.prefetchDefaultFontManager called more than once
W/FlutterJNI(17642): FlutterJNI.init called more than once
I/FLTFireBGExecutor(17642): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
I/FlutterTwilioVoicePlugin(17642): setupMethodChannel called from native
D/FlutterGeolocator(17642): Geolocator foreground service connected
D/FlutterGeolocator(17642): Initializing Geolocator services```

Flutter Doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.9, on macOS 12.6 21G115 darwin-x64, locale
    en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.74.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

I am able to send data from flutter to native, but unable to send data from native to flutter.
```

Body:
In my app I am using flutter_twilio package to get the incoming call from twilio. When user lift the call the package showing a call screen from native side. Now I want add a new button to call screen and based on button click I need to send data from native to flutter side using method channels. So I started to implement method channels. I am able to send data from flutter to native but vice versa is not working. I am not even getting any error logs to find the problem.

Flutter Side:

void callbackDispatcher() {
  WidgetsFlutterBinding.ensureInitialized();
  print("Our background job ran!");
}

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initializeFirebase();
  await initialize(callbackDispatcher);
  runApp(const MyApp());
}

const MethodChannel channel = MethodChannel("native_to_flutter_main");

Future<void> initialize(final Function callbackDispatcher) async {
  final callback = PluginUtilities.getCallbackHandle(callbackDispatcher);

  await channel.invokeMethod('initialize', callback!.toRawHandle()); /*This is executing and able to pass data to native*/

  channel.setMethodCallHandler((call) async {
    switch (call.method) {
      case 'recordStart':
        Helper().showSnackBar('Record Start');
        debugPrint('recordStart');
        return 'some string';
      case 'recordStop':
        Helper().showSnackBar('Record Stop');
        debugPrint('recordStop');
        return 'some string';
      default:
        throw MissingPluginException('notImplemented');
    }
  });
}

FlutterTwilioVoicePlugin.java in flutter_twilio package:

public class FlutterTwilioVoicePlugin implements
        FlutterPlugin,
        MethodChannel.MethodCallHandler,
        ActivityAware,
        PluginRegistry.NewIntentListener {

  private static final String TAG = "FlutterTwilioVoicePlugin";
  private Context context;
  private static MethodChannel customChannel;
  private CustomBroadcastReceiver broadcastReceiver;
  private boolean broadcastReceiverRegistered = false;

  public FlutterTwilioVoicePlugin() {
  }

  private void setupMethodChannel(BinaryMessenger messenger, Context context){
    this.context = context;
    this.customChannel = new MethodChannel(messenger, "native_to_flutter_main");

    customChannel.setMethodCallHandler(
                        (call, result) -> {
                            if (call.method.equals("initialize")) {
                                int batteryLevel = getBatteryLevel();
                                Log.i(TAG, "callback from flutter"); /*This is executing*/
                                if (batteryLevel != -1) {
                                    result.success(batteryLevel);
                                } else {
                                    result.error("UNAVAILABLE", "Battery level not available.", null);
                                }
                            } else {
                                result.notImplemented();
                            }
                        }
                );

    customChannel.invokeMethod("recordStart", true); /*This is not executing, not getting error logs*/
    customChannel.invokeMethod("recordStop", false); /*This is not executing, not getting error logs*/
    Log.i(TAG, "setupMethodChannel called from native");
  }
    private int getBatteryLevel() {
        int batteryLevel = 10;
        Log.i(TAG, "Battery level called from native");
        return batteryLevel;
    }

Flutter console logs:

Debug service listening on ws://127.0.0.1:54443/WHuZNE7DfTM=/ws
Syncing files to device AC2001...
I/FlutterTwilioVoicePlugin(17642): Battery level called from native
I/FlutterTwilioVoicePlugin(17642): callback from flutter
W/FlutterJNI(17642): FlutterJNI.loadLibrary called more than once
I/ResourceExtractor(17642): Found extracted resources res_timestamp-1-1673516201217
W/FlutterJNI(17642): FlutterJNI.prefetchDefaultFontManager called more than once
W/FlutterJNI(17642): FlutterJNI.init called more than once
I/FLTFireBGExecutor(17642): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
I/FlutterTwilioVoicePlugin(17642): setupMethodChannel called from native
D/FlutterGeolocator(17642): Geolocator foreground service connected
D/FlutterGeolocator(17642): Initializing Geolocator services```

Flutter Doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.9, on macOS 12.6 21G115 darwin-x64, locale
    en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.74.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!

I am able to send data from flutter to native, but unable to send data from native to flutter.


问:
What is the process for updating the application managed with MDM in the Apple AppStore?
We have an app managed with "AppConfig-App Configuration" approach. We want to update this app in AppStore. Apple consistently rejects the app. The reason for the rejection is not the errors in the application, but the constant new requests related to MDM. (Provide MDM test environment, provide information on how to download iOS Profiles to the device, show the user a popup that the data collected with MDM is not shared with a 3rd party, etc.) And they want them part by part, and it never ends. But our customers are waiting for app update.
What is the process for updating the application managed with MDM in the AppStore? What is the experience of other people submitting their MDM-managed app to the AppStore?
I would be very grateful if someone with experience in this matter could share their experience with me.
Thanks in advance.</p>


问:
Imagview inside cardview not working rounded corner in emulator but works in xml preview
How can I fix this? Imageview rounded corner perfectly works in preview but in emulator and physical device there is no rounded corner effect.

Preview window XML

Emulator

That is my code.

```<code><androidx.cardview.widget.CardView android:id="@+id/materialCardView2"
    android:layout_width="64dp"
    android:layout_height="64dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:cardCornerRadius="20dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="centerCrop"
        android:id="@+id/test_iv"
        android:src="@drawable/rider"/>
</androidx.cardview.widget.CardView>
</code>```

Body:
How can I fix this? Imageview rounded corner perfectly works in preview but in emulator and physical device there is no rounded corner effect.

Preview window XML

Emulator

That is my code.

<androidx.cardview.widget.CardView android:id="@+id/materialCardView2"
    android:layout_width="64dp"
    android:layout_height="64dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:cardCornerRadius="20dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="centerCrop"
        android:id="@+id/test_iv"
        android:src="@drawable/rider"/>
</androidx.cardview.widget.CardView>


问:
I want to loop through an array that are objects and get a specific one to out using vue js
script(obtained from a pinia store):

```<code>const moviePosters = store.poster

function removeMovie (value) {
    for(var i = 0; i < movieTitles.length; i++) {
        movieTitles.splice(i, value);
        console.log(movieTitles)
}
</code>```

html:

```<code><button v-for="options of movieTitles" @click = "removeMovie(options, options)"></button>
</code>```

This is the array of objects I got back and want to remove a specific one:

```<code>Proxy {0: 'Puss in Boots: The Last Wish', 1: 'The Menu'}
 [[Handler]]: Object
 [[Target]]: Array(2)
  0: "Puss in Boots: The Last Wish"
  1: "The Menu"
  length: 2
  [[Prototype]]: Array(0)
 [[IsRevoked]]: false
</code>```

Body:
script(obtained from a pinia store):

const moviePosters = store.poster

function removeMovie (value) {
    for(var i = 0; i < movieTitles.length; i++) {
        movieTitles.splice(i, value);
        console.log(movieTitles)
}

html:

<button v-for="options of movieTitles" @click = "removeMovie(options, options)"></button>

This is the array of objects I got back and want to remove a specific one:

Proxy {0: 'Puss in Boots: The Last Wish', 1: 'The Menu'}
 [[Handler]]: Object
 [[Target]]: Array(2)
  0: "Puss in Boots: The Last Wish"
  1: "The Menu"
  length: 2
  [[Prototype]]: Array(0)
 [[IsRevoked]]: false


问:
How XMLReader from PHP library will deal with condition when millions of users reading/searching something from a large XML? Will it hang or process?
I know XMLReader from PHP https://www.php.net/xmlreader can read/search something from XML and return data using file-path.

```<code>$xml = new XMLReader();
$xml->open('test.xml');
//Do Something with file test.xml and return searched data
$xml->close();
</code>```

But I just wanted to know what if millions of user are visiting the page concurrently which uses above function, means open the file return what user wants and then close the file.

Then how this will deal if user load is million?

Will it hang the system of read from same file open at once, without opening that again?

But what function says it will open every-time & close.

I just tried above function and it was returning the data from XML which I needed but I am just confused with their open and close process each time. Then if at same time millions of users are searching different thing from XML that uses same function to return data, how it will handle the scenario.

Body:
I know XMLReader from PHP https://www.php.net/xmlreader can read/search something from XML and return data using file-path.

$xml = new XMLReader();
$xml->open('test.xml');
//Do Something with file test.xml and return searched data
$xml->close();

But I just wanted to know what if millions of user are visiting the page concurrently which uses above function, means open the file return what user wants and then close the file.

Then how this will deal if user load is million?

Will it hang the system of read from same file open at once, without opening that again?

But what function says it will open every-time & close.

I just tried above function and it was returning the data from XML which I needed but I am just confused with their open and close process each time. Then if at same time millions of users are searching different thing from XML that uses same function to return data, how it will handle the scenario.


问:
How to connect gremlin with python runtime in GCP environment?
Janusgraph is deployed and running in GCP container, I can access that using Cloud shell.
I want to perform some CRUD operation using python runtime.

What are the connection URL, and ports I have to mention to get proper result.

Docs used to create the GCP environment - https://cloud.google.com/architecture/running-janusgraph-with-bigtable#overview

Docs used to connect gremlin to Python - https://tinkerpop.apache.org/docs/current/reference/#connecting-via-drivers

But I'm unable to hit the server, Is there anyone out who tried to establish this type of connection.


问:
MySQL refuses to run in brew services
I was running DatabaseCleaner tests on Rails and ended up breaking MySQL completely. I've completely removed and re-installed it and still can't get it to run. Used brew uninstall mysql and brew install mysql to start fresh, but it's broken even upon re-install.

```<code>❯ brew services start mysql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/allan/Library/LaunchAgents/homebrew.mxcl.mysql.plist` exited with 5.
</code>```
```<code>❯ mysql.server start
Starting MySQL
./usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 144: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 144: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 199: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 144: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
 ERROR! The server quit without updating PID file (/usr/local/var/mysql/Allans-MacBook-Pro.local.pid).
</code>```
```<code>❯ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
</code>```

HOWEVER if I run mysqld it actually runs and then I can access it! Does anyone know how to fix this without having to factory reset my Macbook? running Moneterey version 12.4

Title: MySQL refuses to run in brew services

Body:
I was running DatabaseCleaner tests on Rails and ended up breaking MySQL completely. I've completely removed and re-installed it and still can't get it to run. Used brew uninstall mysql and brew install mysql to start fresh, but it's broken even upon re-install.

❯ brew services start mysql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/allan/Library/LaunchAgents/homebrew.mxcl.mysql.plist` exited with 5.

❯ mysql.server start
Starting MySQL
./usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 144: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 144: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 199: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/8.0.31/bin/mysqld_safe: line 144: /usr/local/var/mysql/Allans-MacBook-Pro.local.err: Permission denied
 ERROR! The server quit without updating PID file (/usr/local/var/mysql/Allans-MacBook-Pro.local.pid).

❯ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

HOWEVER if I run mysqld it actually runs and then I can access it! Does anyone know how to fix this without having to factory reset my Macbook? running Moneterey version 12.4


问:
Facing error while loading GloVe word vectors in python dictionary
I've downloaded pretrained word vector glove.840B.300d.txt from GloVe: Global Vectors for Word Representation. Now, I want to load them into a python dictionary but getting an error.

```<code>for line in open("C:\Users\sunja\OneDrive\Desktop\New folder\glove.840B.300d.txt").readlines():
                                                                                ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
</code>```

What I am doing wrong here?

Here is my approach

```<code>import numpy as np

emb_index = {}
for line in open("C:\Users\sunja\OneDrive\Desktop\New folder\glove.840B.300d.txt").readlines():
    word, vector = line.split(maxsplit=1)
    vector = np.fromstring(vector, "f", sep=" ")
    emb_index[word] = vector

print(emb_index["good"])
</code>```

Body:
I've downloaded pretrained word vector glove.840B.300d.txt from GloVe: Global Vectors for Word Representation. Now, I want to load them into a python dictionary but getting an error.

for line in open("C:\Users\sunja\OneDrive\Desktop\New folder\glove.840B.300d.txt").readlines():
                                                                                ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

What I am doing wrong here?

Here is my approach

import numpy as np

emb_index = {}
for line in open("C:\Users\sunja\OneDrive\Desktop\New folder\glove.840B.300d.txt").readlines():
    word, vector = line.split(maxsplit=1)
    vector = np.fromstring(vector, "f", sep=" ")
    emb_index[word] = vector

print(emb_index["good"])


问:
Sequelize: order-by doesn't seem to work on aggregated output while using multiple joins
I've been trying to order the results by total no. of all reviews given for a particular seller's store.

All associations are defined but when I tried order by on avg(ratings) or count(id) [here id is id of alias named 'seller_details'], it gives me an error. I have tried many ways like using Sequelize.col() and giving all models names; using Sequelize.literal() but none works.

```<code>const data = await UserFavoriteStores.findAndCountAll({
      where: {
        customer_id: userId
      },
      include: [
        {
          model: SellerStoreDetail,
          required: false,
          include: [
            {
              model: StoreReviews,
              required: false,
              attributes: [],
              as: 'seller_details'
            }
          ],
          attributes: {
            include: [
              [
                Sequelize.fn(
                  'count',
                  Sequelize.col('favStoreData.seller_details.id')
                ),
                'totalReviewCount'
              ],
              [
                Sequelize.fn(
                  'AVG',
                  Sequelize.col('favStoreData.seller_details.rating')
                ),
                'avgRating'
              ]
            ]
          },
          as: 'favStoreData'
        }
      ],
      group: ['user_favorite_stores.id', 'favStoreData.id'],
      limit: limit,
      offset: skip,
      subQuery: false
    });
</code>```

Body:
I've been trying to order the results by total no. of all reviews given for a particular seller's store.

All associations are defined but when I tried order by on avg(ratings) or count(id) [here id is id of alias named 'seller_details'], it gives me an error. I have tried many ways like using Sequelize.col() and giving all models names; using Sequelize.literal() but none works.

const data = await UserFavoriteStores.findAndCountAll({
      where: {
        customer_id: userId
      },
      include: [
        {
          model: SellerStoreDetail,
          required: false,
          include: [
            {
              model: StoreReviews,
              required: false,
              attributes: [],
              as: 'seller_details'
            }
          ],
          attributes: {
            include: [
              [
                Sequelize.fn(
                  'count',
                  Sequelize.col('favStoreData.seller_details.id')
                ),
                'totalReviewCount'
              ],
              [
                Sequelize.fn(
                  'AVG',
                  Sequelize.col('favStoreData.seller_details.rating')
                ),
                'avgRating'
              ]
            ]
          },
          as: 'favStoreData'
        }
      ],
      group: ['user_favorite_stores.id', 'favStoreData.id'],
      limit: limit,
      offset: skip,
      subQuery: false
    });


问:
Cannot access the key value inside a Redux State Object. When try to access key and value its undefined

first time userLogin successfully destructuring. but when i refresh page userLogin showing everithing in there but when i console uerInfo undefined. Why its heappening

```<code>function Header() {
  const dispatch = useDispatch();
  const userLogin = useSelector((state) => state.userLogin);
  const { userInfo } = userLogin;
  console.log(userLogin)// userInfo successfully showing
  console.log(userInfo)//undefined
  const logoutHandler = () => {
    dispatch(logout());
  };
</code>```

I expecting the value of the object key successfully. Please Help

Body:
first time userLogin successfully destructuring. but when i refresh page userLogin showing everithing in there but when i console uerInfo undefined. Why its heappening

function Header() {
  const dispatch = useDispatch();
  const userLogin = useSelector((state) => state.userLogin);
  const { userInfo } = userLogin;
  console.log(userLogin)// userInfo successfully showing
  console.log(userInfo)//undefined
  const logoutHandler = () => {
    dispatch(logout());
  };

I expecting the value of the object key successfully. Please Help


问:
Stunnel on 3 servers
How can I use stunnel like this :

Client stunnel ===> server 1 stunnel ===> server 2 stunnel

I used :

Client stunnel ===> server stunnel

It works fine, But i don't know how can I use :

Client stunnel ===> server 1 stunnel ===> server 2 stunnel

Is it possible?

Thanks.

Title: Stunnel on 3 servers


问:
Redirect to subdirectory without losing the rooting to index.php
I have the following .htacess file:

```<code><IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subdir
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [R,L]
</IfModule>
</code>```

It does what it should do - put index.php in front of every request.

What I would like to do is to redirect any request to root into the subfolder /de WITHOUT losing the above rooting. Whenever someone comes to the site he should be forwarded to the de folder. I was able to build the rooting to de:

```<code>RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/ [NC]
RewriteRule ^$ index.php/de [R,L]
</code>```

But I am not able to combine the two. I would appreciate some tips.

ContentLicense: CC BY-SA 3.0

Body:
I have the following .htacess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subdir
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [R,L]
</IfModule>

It does what it should do - put index.php in front of every request.

What I would like to do is to redirect any request to root into the subfolder /de WITHOUT losing the above rooting. Whenever someone comes to the site he should be forwarded to the de folder. I was able to build the rooting to de:

RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/ [NC]
RewriteRule ^$ index.php/de [R,L]

But I am not able to combine the two. I would appreciate some tips.


问:
How to read application.properties and set the default value to incoming API request instead of setting the default value in @RequestHeader
I want to read a property from application.properties and set as default value to @RequestHeader to an API endpoint. My properties look like
item.includePrice.value=Y

ItemController.java

```<code>@PostMapping("/item")
public String postBody(@RequestHeader String includePrice, @RequestBody SomeRequest someRequest) {
   if(includePrice != null)
       return "You searched for " + someRequest.getItemName;
}
</code>```

I have referred below questions and tried two approaches.

First approach is, tried using a custom interceptor. But, in order to set the default value for includePrice after reading the property from application.properties under the preHandle method, I do not see addHeader method for HttpServletRequest.

Application Properties value in Spring boot interceptor

Second approach is used below resources and implemented a MutableHttpServletRequest that extends HttpServletRequestWrapper and added the header.

Adding an HTTP Header to the request in a servlet filter

How to add HttpServletRequest headers in HandlerInterceptorAdapter?

Expectation:  Regardless the API request sends the includePrice header value or not, at all times, the property should be read from the application.properties and set the default value to my HttpServletRequest.

Body:
I want to read a property from application.properties and set as default value to @RequestHeader to an API endpoint. My properties look like
item.includePrice.value=Y

ItemController.java

@PostMapping("/item")
public String postBody(@RequestHeader String includePrice, @RequestBody SomeRequest someRequest) {
   if(includePrice != null)
       return "You searched for " + someRequest.getItemName;
}

I have referred below questions and tried two approaches.

First approach is, tried using a custom interceptor. But, in order to set the default value for includePrice after reading the property from application.properties under the preHandle method, I do not see addHeader method for HttpServletRequest.

Application Properties value in Spring boot interceptor

Second approach is used below resources and implemented a MutableHttpServletRequest that extends HttpServletRequestWrapper and added the header.

Adding an HTTP Header to the request in a servlet filter

How to add HttpServletRequest headers in HandlerInterceptorAdapter?

Expectation:  Regardless the API request sends the includePrice header value or not, at all times, the property should be read from the application.properties and set the default value to my HttpServletRequest.


问:
"yarn/Vite" build results in a Uncaught TypeError
This is a weird one, my react application can run without any trouble, but when I ran a yarn:build, the built dist cannot be hosted properly even though the build was successful. Following is the console output.

```<code>Uncaught TypeError: e is not a constructor
    at ETe (index.504b65a0.js:323:24562)
    at Ce (index.504b65a0.js:335:4732)
    at index.504b65a0.js:313:68312
</code>```

The most recent update I did was introducing aws-sdk to the code. And while I bumped into Uncaught ReferenceError: global is not defined and Failed to resolve entry for package "fs"., I added couple of fields in my Vite.config.

import { defineConfig } from 'vite';
import createVitePlugins from './config/plugins';
import cssOption from './config/style';
import { VITE_APP_BASE, VITE_APP_PORT, VITE_APP_OPEN } from './config';
import proxy from './config/setupProxy';
import path from 'path';
import build from './config/build';

export default defineConfig(() => {
  return {
    base: VITE_APP_BASE,
    plugins: createVitePlugins(),
    css: cssOption,
    server: {
      host: true,
      port: VITE_APP_PORT,
      open: VITE_APP_OPEN,
      proxy,
    },
    define: {
      global: 'window',  // <----------- to resolve global
    },
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src'),
        fs: require.resolve('rollup-plugin-node-builtins'), // <-------- to resolve fs
      },
    },
    build,
  };
});

```

Since the code is running fine in development mode, I don't really know what could the problem be and where shall I look into. Please let me know what other information do I have to provide to properly debug this issue.

Body:
This is a weird one, my react application can run without any trouble, but when I ran a yarn:build, the built dist cannot be hosted properly even though the build was successful. Following is the console output.

Uncaught TypeError: e is not a constructor
    at ETe (index.504b65a0.js:323:24562)
    at Ce (index.504b65a0.js:335:4732)
    at index.504b65a0.js:313:68312

The most recent update I did was introducing aws-sdk to the code. And while I bumped into Uncaught ReferenceError: global is not defined and Failed to resolve entry for package "fs"., I added couple of fields in my Vite.config.

import { defineConfig } from 'vite';
import createVitePlugins from './config/plugins';
import cssOption from './config/style';
import { VITE_APP_BASE, VITE_APP_PORT, VITE_APP_OPEN } from './config';
import proxy from './config/setupProxy';
import path from 'path';
import build from './config/build';

export default defineConfig(() => {
  return {
    base: VITE_APP_BASE,
    plugins: createVitePlugins(),
    css: cssOption,
    server: {
      host: true,
      port: VITE_APP_PORT,
      open: VITE_APP_OPEN,
      proxy,
    },
    define: {
      global: 'window',  // <----------- to resolve global
    },
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'src'),
        fs: require.resolve('rollup-plugin-node-builtins'), // <-------- to resolve fs
      },
    },
    build,
  };
});

Since the code is running fine in development mode, I don't really know what could the problem be and where shall I look into. Please let me know what other information do I have to provide to properly debug this issue.


问:
can I use the method execute() in script Groovy for Jenkins in order to execute shell command?
can I use the method execute() in script Groovy for Jenkins in order to execute shell command?

What is the best way to execute command shell in Groovy script for Jenkins?

```<code>class Example {
   static void main(String[] args) {
    def map = [:]
    def array = new File('deployable.txt') as String[];
    def versionDate = "snapshot"

      for(String i in array) {

         String[] splitedPath =i.split("/");
         int indexFilename = splitedPath.length -1

            String  fileName = splitedPath [indexFilename]

            println(fileName)
            String []name =fileName.split('.t')
            String nameOri =name[0]
            println(nameOri)
            nameOri = nameOri+"-"+versionDate+".txt"

         map.put(i, nameOri )

      }
      map.each{entry ->
      println "$entry.key: $entry.value"
      def source ="$entry.key"
      def dest="$entry.value"

        def command = 'touch '+source
        println command
        command.execute()
        command = 'mv '+source +' test/'+dest
        command.execute()

      }

   }
}
</code>```

Body:
can I use the method execute() in script Groovy for Jenkins in order to execute shell command?

What is the best way to execute command shell in Groovy script for Jenkins?

class Example {
   static void main(String[] args) {
    def map = [:]
    def array = new File('deployable.txt') as String[];
    def versionDate = "snapshot"

      for(String i in array) {

         String[] splitedPath =i.split("/");
         int indexFilename = splitedPath.length -1

            String  fileName = splitedPath [indexFilename]

            println(fileName)
            String []name =fileName.split('.t')
            String nameOri =name[0]
            println(nameOri)
            nameOri = nameOri+"-"+versionDate+".txt"

         map.put(i, nameOri )

      }
      map.each{entry ->
      println "$entry.key: $entry.value"
      def source ="$entry.key"
      def dest="$entry.value"

        def command = 'touch '+source
        println command
        command.execute()
        command = 'mv '+source +' test/'+dest
        command.execute()

      }

   }
}


问:
This MS SQL Code is safe for SQL Injection?
Good day I'm new here and i want to ask if this code is safe on SQL injection?

```<code>$stmt = $conn->prepare("Select * from PersonalInformation where ApplicantUID=? and EmailAddress=?");
$stmt->execute(array($_SESSION['ApplicantUID'], $_SESSION['EmailAddress']));
</code>```

I'm new using the PDO syntax.

Body:
Good day I'm new here and i want to ask if this code is safe on SQL injection?

$stmt = $conn->prepare("Select * from PersonalInformation where ApplicantUID=? and EmailAddress=?");
$stmt->execute(array($_SESSION['ApplicantUID'], $_SESSION['EmailAddress']));

I'm new using the PDO syntax.


问:
Chrome Extention Access Blocked (even though user in trusted accounts and in google groups)
I have a unapproved chrome extention where I want to add another developer to have access, but I contionously get this Access Blocked error. What is the reason behind this ?

Its driving me crazy and I have googled a lot. 2 things I have tried:

Adding developer to trusted account

Creating Google Groups and giving access of my extention to this group. In this group, I also added the developer who needs access and gets this error.

Sign in with Google
Access blocked: Al-EMAIL-358 has not completed the Google verification process

AI-EMAIL-358 has not completed the Google verification process. The app is currently being tested, and can only be accessed by developer-approved testers. If you think you should have access, contact the developer.
If you are a developer of Al-EMAIL-358, see error details.
Error 403: access_denied

I have added the developer to trusted accounts but it still does not work


问:
How to configure DITA DTD to VS Code?
I want to see DITA validations working for my file. How do I implement a DTD? for example, </p>

Title: How to configure DITA DTD to VS Code?


问:
ForkJoin and ConcatMap How to get the id and pass it to the other parameter
I'm trying to send my reactive formarray in my backend, when i post it, it will automatically generate a unique ID in the backend.my problem is how to get the response id of post1 and pass it to the data type of post1Id? in post2</p>
```<code>post(){
    this.serv.post1(this.fg.value).pipe(
       concatMap(data =>
        forkJoin([
          this.Post1ID = data.id
          this.serv.post2(this.fg.value?.firstArray),
          this.serv.post3(this.fg.value?.secondArray)
        ])
      )
    ).subscribe({
      next: result => console.log(result),
      error: e => console.log(e)
     })
   }
</code>```

Body:
I'm trying to send my reactive formarray in my backend, when i post it, it will automatically generate a unique ID in the backend.my problem is how to get the response id of post1 and pass it to the data type of post1Id? in post2

post(){
    this.serv.post1(this.fg.value).pipe(
       concatMap(data =>
        forkJoin([
          this.Post1ID = data.id
          this.serv.post2(this.fg.value?.firstArray),
          this.serv.post3(this.fg.value?.secondArray)
        ])
      )
    ).subscribe({
      next: result => console.log(result),
      error: e => console.log(e)
     })
   }


问:
Can we pass multiple object to template in handlebar? if yes then how can I render data in template?
I am passing the two objects to template and It is working fine but I want to use one object in another object. because first one is containing the different data and another one is containing different.

Sorry for my bad english and thanks!

I have tried multiple methods like join the table etc. but not getting expected results

You can see my code in attached screenshot

enter image description here


问:
I have a long form for adding a vehicle in my RN app, it has like 12 fields to add the vehicle which is contained in a modal, how can I improve this?
the 12 fields are text fields and they are all displayed one under another, is there any better approach for that I think the modal is too crowded, and it will act weird with keyboard avoiding behaviors.

ps: instead of thumbing the question down please suggest to me how can I make it clearer
Thanks

I didnt try anything to enhance so far, I think it needs to go in steps, instead of having it in one big blob


问:
Issue with Powershell 5.1 not copying over files with specified extensions, but does copy over directory structure
I am currently working on just some personal powershell 5.1 scripts. Ideally, I have two machines set up, one that is local (I'll call it source), and one that is remote (I'll call it destination). The source system has a certain file directory structure with various files. I've been wanting to copy over that exact directory, maintaining the structure to the destination server. I have two conditions that I am trying to maintain, to copy the source files to the destination location if the destination location does not have those files or, copy the source files to the destination if and only if the most recently modified time is earlier than that on the destination server (copying only files with specific extensions and ignoring the rest).
The issue that I am having now is that while the actual directory structure is being copied over from source to destination, the actual files with data (like .xml, .pem, etc) files are no where to be found. They are not being copied over and I have spent the better half of 10 hours trying to figure out why. I will post the code below.

```<code>foreach ($fileS1 in Get-ChildItem $RootFolder -Recurse) {
    $FolderNameS1 = $fileS1.FullName
    $FolderNameNewS1 = $fileS1.FullName

    # check if the path on the remote session exists
    $ValidPathS1 = Invoke-Command -Session $Session1 -ScriptBlock {
        Test-Path -Path $using:FolderNameNewS1
    }

    If ($ValidPathS1 -eq $False) {
        #create the folder structure
        if ($fileS1.PSIsContainer -eq $True) {
            Invoke-Command -Session $Session1 -ScriptBlock {
                New-Item -Path $using:FolderNameNewS1 -ItemType Directory -Verbose
            }
        }
    }

    # Get the files in the source folder
    $sourceFiles = Get-ChildItem $FolderNameS1 -Recurse
    # Get the files in the destination folder
    $destinationFiles = Invoke-Command -Session $Session1 -ScriptBlock {
        Get-ChildItem $using:FolderNameNewS1 -Recurse
    }

    # Compare the last write time of each source file with the last write time of its corresponding destination file
    $extensions = "p12", "properties", "pem"
    foreach ($sourceFile in $sourceFiles) {
        if($extensions -contains $sourceFile.Extension){
            $fileCopied = $False
            # check if the file on the remote session exists
                $destinationFilePath = Invoke-Command -Session $Session1 -ScriptBlock {
                $destFilePath = Join-Path $using:FolderNameNewS1 $using:sourceFile.Name
                if(!(Test-Path $destFilePath)){
                    New-Item -Path $destFilePath -ItemType File -Force
                }
                return $destFilePath
                }
            if($destinationFilePath -ne ""){
                $destinationFile = Invoke-Command -Session $Session1 -ScriptBlock {
                    Get-Item $using:destinationFilePath
                }

                $remoteFileExist = Invoke-Command -Session $Session1 -ScriptBlock {
                Test-Path $using:destinationFilePath
                }

            if(!$remoteFileExist){
                Copy-Item $sourceFile.FullName -Destination $FolderNameNewS1  -ToSession $Session1 -Force -Verbose
                }
            else{
            $remoteLastWriteTime = Invoke-Command -Session $Session1 -ScriptBlock {
            (Get-Item $using:destinationFilePath).LastWriteTime
                }
            $remoteLastWriteTime = $remoteLastWriteTime.ToLocalTime()
            # Compare the last write time of source file and destination file
            if ($sourceFile.LastWriteTime -gt $remoteLastWriteTime) {
            #copy only the files with the specified extensions
            if($extensions -contains $sourceFile.Extension){
            Copy-Item $sourceFile.FullName -Destination $FolderNameNewS1  -ToSession $Session1 -Force -Verbose
            $fileCopied = $True
        }
    }
}
            if ($fileCopied -eq $True) {
                #remove the source file
               # Remove-Item $sourceFile.FullName -Force -Verbose -ErrorAction SilentlyContinue
                $fileCopied = $False
            }
        }
    }
    }
}
</code>```

I am using PSSession to remote into the destination server, and we can assume that $RootFolder contains the entire directory.

Body:
I am currently working on just some personal powershell 5.1 scripts. Ideally, I have two machines set up, one that is local (I'll call it source), and one that is remote (I'll call it destination). The source system has a certain file directory structure with various files. I've been wanting to copy over that exact directory, maintaining the structure to the destination server. I have two conditions that I am trying to maintain, to copy the source files to the destination location if the destination location does not have those files or, copy the source files to the destination if and only if the most recently modified time is earlier than that on the destination server (copying only files with specific extensions and ignoring the rest).
The issue that I am having now is that while the actual directory structure is being copied over from source to destination, the actual files with data (like .xml, .pem, etc) files are no where to be found. They are not being copied over and I have spent the better half of 10 hours trying to figure out why. I will post the code below.

foreach ($fileS1 in Get-ChildItem $RootFolder -Recurse) {
    $FolderNameS1 = $fileS1.FullName
    $FolderNameNewS1 = $fileS1.FullName

    # check if the path on the remote session exists
    $ValidPathS1 = Invoke-Command -Session $Session1 -ScriptBlock {
        Test-Path -Path $using:FolderNameNewS1
    }

    If ($ValidPathS1 -eq $False) {
        #create the folder structure
        if ($fileS1.PSIsContainer -eq $True) {
            Invoke-Command -Session $Session1 -ScriptBlock {
                New-Item -Path $using:FolderNameNewS1 -ItemType Directory -Verbose
            }
        }
    }

    # Get the files in the source folder
    $sourceFiles = Get-ChildItem $FolderNameS1 -Recurse
    # Get the files in the destination folder
    $destinationFiles = Invoke-Command -Session $Session1 -ScriptBlock {
        Get-ChildItem $using:FolderNameNewS1 -Recurse
    }

    # Compare the last write time of each source file with the last write time of its corresponding destination file
    $extensions = "p12", "properties", "pem"
    foreach ($sourceFile in $sourceFiles) {
        if($extensions -contains $sourceFile.Extension){
            $fileCopied = $False
            # check if the file on the remote session exists
                $destinationFilePath = Invoke-Command -Session $Session1 -ScriptBlock {
                $destFilePath = Join-Path $using:FolderNameNewS1 $using:sourceFile.Name
                if(!(Test-Path $destFilePath)){
                    New-Item -Path $destFilePath -ItemType File -Force
                }
                return $destFilePath
                }
            if($destinationFilePath -ne ""){
                $destinationFile = Invoke-Command -Session $Session1 -ScriptBlock {
                    Get-Item $using:destinationFilePath
                }

                $remoteFileExist = Invoke-Command -Session $Session1 -ScriptBlock {
                Test-Path $using:destinationFilePath
                }

            if(!$remoteFileExist){
                Copy-Item $sourceFile.FullName -Destination $FolderNameNewS1  -ToSession $Session1 -Force -Verbose
                }
            else{
            $remoteLastWriteTime = Invoke-Command -Session $Session1 -ScriptBlock {
            (Get-Item $using:destinationFilePath).LastWriteTime
                }
            $remoteLastWriteTime = $remoteLastWriteTime.ToLocalTime()
            # Compare the last write time of source file and destination file
            if ($sourceFile.LastWriteTime -gt $remoteLastWriteTime) {
            #copy only the files with the specified extensions
            if($extensions -contains $sourceFile.Extension){
            Copy-Item $sourceFile.FullName -Destination $FolderNameNewS1  -ToSession $Session1 -Force -Verbose
            $fileCopied = $True
        }
    }
}
            if ($fileCopied -eq $True) {
                #remove the source file
               # Remove-Item $sourceFile.FullName -Force -Verbose -ErrorAction SilentlyContinue
                $fileCopied = $False
            }
        }
    }
    }
}

I am using PSSession to remote into the destination server, and we can assume that $RootFolder contains the entire directory.


问:
How to Redirect Form Submission to Calendly
I Create a simple html form. When user fill the value then value auto fill on calendy. For this i use calendly auto fill javascript Code.

```<code><script>

const params = (new  URL(window.location)).searchParams

Calendly.initInlineWidget({
    url: 'https://calendly.com/LINK',
    parentElement: document.getElementById('SAMPLEdivID'),
    prefill: {
        name: params.get('name'),
    }
});
</code>```

(SAMPLEdivID) i use this in my form id. Calendly autofill name that user are fill in html form. but calendly show on same screen where the form are shown.

My Form Code :

<form action="#" id="SAMPLEdivID">
  First name:

  <input type="text" id="name" name="name" value="John">

  <input type="submit" value="Submit" id="mainBtn">
</form> ```

Calendly Metting Show me on Same Screen.

I want when user click on submit then user redirect to calendly url but also prefill value are also working. Now prefill are working but calendly show on same screen.


问:
QRCODE LARAVEL is blurry
I created a QRCODE size is 80 why logo inside QRcode and QRcode is blurry
how do I fix it?
I want to QRcode and img in the logo isn't blurry.

this is my code.

```<code> QrCode::format('png')->merge(public_path('img/test.jpg'), 0.5, true)
        ->size(80)
        ->errorCorrection('H')
        ->backgroundColor(0, 0, 0)
        ->color(231,195,111)
        ->generate('test'));
</code>```

this is the solution.

Title: QRCODE LARAVEL is blurry

Body:
I created a QRCODE size is 80 why logo inside QRcode and QRcode is blurry
how do I fix it?
I want to QRcode and img in the logo isn't blurry.

this is my code.

 QrCode::format('png')->merge(public_path('img/test.jpg'), 0.5, true)
        ->size(80)
        ->errorCorrection('H')
        ->backgroundColor(0, 0, 0)
        ->color(231,195,111)
        ->generate('test'));

this is the solution.


问:
Is there any way to create shared data class instance json communication protocol?
I have some questions about using data calss in python.

I am using data class structure to create json object which is created by data class.

I'm share this protocol with C# classes using Newtonsoft.Json, Jsonconvert function.

I'd like to share some dataclass, like commented style.
Or share me, more clear way of using data class for creating json object

```<code>import os
import sys
import inspect
import json
from datetime import datetime
from dataclasses import dataclass, field, asdict
from dacite.core import from_dict

currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)

from protocol.ofrobot import RobotRaw
from protocol.ofcrawl import Crawl
from protocol.ofcomm import Comm
from protocol.ofgeneral import General

class Protocol(RobotRaw, Comm, Crawl, General):
    @dataclass
    class Data:  # I'd like to move some dataclass objects for sharing other classes
        request_id: int = -1
        result: str = ""
        message: str = ""

    @dataclass
    class Response:
        key: str = ""
        cmd: str = ""

        # @dataclass
        # class Data:
        #     request_id: int = -1
        #     result: str = ""
        #     message: str = ""

        data: Data = field(default_factory=Data)  # cannot create Data class instance

    @dataclass
    class Action:
        key: str = ""
        cmd: str = ""

        @dataclass
        class Data:
            request_id: int = -1

            @dataclass
            class ActionItem:
                ridx: int = -1
                action: str = ""
                fidx: int = -1
                fry_count: int = -1

            items: List[ActionItem] = field(default_factory=list)

        data: Data = field(default_factory=Data)

    @staticmethod
    def todict(class_object):
        return asdict(class_object)

    @staticmethod
    def tojson(class_object):
        return json.dumps(asdict(class_object))

    @staticmethod
    def toclass(protocol_type, data_dict: dict, type_recovery: bool = False):
        for key in data_dict.keys():
            if str(key).find("datetime") > -1 and type(data_dict[key]) == str:
                data_dict[key] = datetime.strptime(data_dict[key], "%Y-%m-%d %H:%M:%S")
            else:
                if type_recovery:
                    type_dict = Protocol.todict(protocol_type())
                    data_dict[key] = type(type_dict[key])(data_dict[key])

        return from_dict(protocol_type, data_dict)

if __name__ == "__main__":
    print("test code")
    items = Protocol.Action.Data.ActionItem(0, "grip", 0, 3)
    data = Protocol.Action.Data("id123", items)
    action = Protocol.Action("key", "action", data)

    json_str = Protocol.tojson(action)
</code>```

Body:
I have some questions about using data calss in python.

I am using data class structure to create json object which is created by data class.

I'm share this protocol with C# classes using Newtonsoft.Json, Jsonconvert function.

I'd like to share some dataclass, like commented style.
Or share me, more clear way of using data class for creating json object

import os
import sys
import inspect
import json
from datetime import datetime
from dataclasses import dataclass, field, asdict
from dacite.core import from_dict

currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)

from protocol.ofrobot import RobotRaw
from protocol.ofcrawl import Crawl
from protocol.ofcomm import Comm
from protocol.ofgeneral import General

class Protocol(RobotRaw, Comm, Crawl, General):
    @dataclass
    class Data:  # I'd like to move some dataclass objects for sharing other classes
        request_id: int = -1
        result: str = ""
        message: str = ""

    @dataclass
    class Response:
        key: str = ""
        cmd: str = ""

        # @dataclass
        # class Data:
        #     request_id: int = -1
        #     result: str = ""
        #     message: str = ""

        data: Data = field(default_factory=Data)  # cannot create Data class instance

    @dataclass
    class Action:
        key: str = ""
        cmd: str = ""

        @dataclass
        class Data:
            request_id: int = -1

            @dataclass
            class ActionItem:
                ridx: int = -1
                action: str = ""
                fidx: int = -1
                fry_count: int = -1

            items: List[ActionItem] = field(default_factory=list)

        data: Data = field(default_factory=Data)

    @staticmethod
    def todict(class_object):
        return asdict(class_object)

    @staticmethod
    def tojson(class_object):
        return json.dumps(asdict(class_object))

    @staticmethod
    def toclass(protocol_type, data_dict: dict, type_recovery: bool = False):
        for key in data_dict.keys():
            if str(key).find("datetime") > -1 and type(data_dict[key]) == str:
                data_dict[key] = datetime.strptime(data_dict[key], "%Y-%m-%d %H:%M:%S")
            else:
                if type_recovery:
                    type_dict = Protocol.todict(protocol_type())
                    data_dict[key] = type(type_dict[key])(data_dict[key])

        return from_dict(protocol_type, data_dict)

if __name__ == "__main__":
    print("test code")
    items = Protocol.Action.Data.ActionItem(0, "grip", 0, 3)
    data = Protocol.Action.Data("id123", items)
    action = Protocol.Action("key", "action", data)

    json_str = Protocol.tojson(action)


问:
how i can store the video and audio files in firebase storage?
i am creating an mediaRecorder webapp using javascript in visual studio code. and i want to get my audio and video files get directly stores in firebase storage. when i click on stop recording its generate a download link but in simultenously i want that when i press on stop button the file directly stores in firebase storage.?

index.html

```<code><!DOCTYPE html>
<html>
  <head>
    <title>MediaRecorder</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="WebRTC getUserMedia MediaRecorder API">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <link rel = "stylesheet" href="style.css">
    <style>
      button{
        margin: 20px 50px;
        font-style: italic;
      }
      li{
        margin: 50px;
      }
      body{
        width: 90%;
        max-width: 960px;
        margin: 0px auto;
      }
      #btns{
        display: none;
        color: rgb(252, 114, 9);

      }
      body {
      color: rgb(252, 114, 9);
      text-align: center;
      line-height: 1.8;
}

      h1 {
      color: rgb(6, 243, 6);
      text-align: center;
      line-height: 5.0;
      font-size: 40px;
      font-family: Arial, Helvetica, sans-serif;
      background: linear-gradient(to right, #f32170,
      #ffc908, #cf23cf, #eedd44);
      -webkit-text-fill-color: transparent;
      -webkit-background-clip: text;
        }
    </style>
  </head>
  <body>
    <h1> MediaRecorder Using API</h1>
    <p style="font-size: 50px"><b>Welcome to MY App.</b></p>
    <div id='gUMArea'>
      <div>
      Record:
        <input type="radio" name="media" value="video" checked id='mediaVideo'>Video
        <input type="radio" name="media" value="audio">audio
      </div>
      <button class="btn btn-default"  id='gUMbtn'><b>Request Stream</b></button>
    </div>
    <div id='btns'>
      <button  class="btn btn-default" id='start'>Start</button>
      <button  class="btn btn-default" id='stop'>Stop</button>
    </div>
    <div>
      <ul  class="list-styled" id='ul'></ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
    <script src="script.js"></script>

    <script type="module">
      // Import the functions you need from the SDKs you need
      import { initializeApp } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js";
      import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.15.0/firebase-analytics.js";
      import { getStorage, ref} from "https://www.gstatic.com/firebasejs/9.15.0/firebase-storage.js";
      // TODO: Add SDKs for Firebase products that you want to use
      // https://firebase.google.com/docs/web/setup#available-libraries

      // Your web app's Firebase configuration
      // For Firebase JS SDK v7.20.0 and later, measurementId is optional
      const firebaseConfig = {
        apiKey: "AIzaSyCWOdeArFIfm_VrhaP_Boe0Ly7ID51aodM",
        authDomain: "mediarecorder-dda3b.firebaseapp.com",
        databaseURL: "https://mediarecorder-dda3b-default-rtdb.firebaseio.com",
        projectId: "mediarecorder-dda3b",
        storageBucket: "gs://mediarecorder-dda3b.appspot.com",
        messagingSenderId: "152268264978",
        appId: "1:152268264978:web:b6233300016d25e4f12acb",
        measurementId: "G-E69QHKH7LF"
      };

      // Initialize Firebase
      const app = initializeApp(firebaseConfig);
      const analytics = getAnalytics(app);
      const storage = getStorage();
      const storageRef = ref(storage, );
      const mediaRef = ref(storageRef, 'medias');
      const fileName = '1.ogg';
      const mediasRef = ref(mediaRef, fileName);
      const path = mediaRef.fullPath;

    </script>
  </body>
</html>
</code>```

script.js

```<code>'use strict'
let log = console.log.bind(console),
  id = val => document.getElementById(val),
  ul = id('ul'),
  gUMbtn = id('gUMbtn'),
  start = id('start'),
  stop = id('stop'),
  stream,
  recorder,
  counter=1,
  chunks,
  media;

gUMbtn.onclick = e => {
  let mv = id('mediaVideo'),
      mediaOptions = {
        video: {
          tag: 'video',
          type: 'video/webm',
          ext: '.mp4',
          gUM: {video: true, audio: true}
        },
        audio: {
          tag: 'audio',
          type: 'audio/ogg',
          ext: '.ogg',
          gUM: {audio: true}
        }
      };
  media = mv.checked ? mediaOptions.video : mediaOptions.audio;
  navigator.mediaDevices.getUserMedia(media.gUM).then(_stream => {
    stream = _stream;
    id('gUMArea').style.display = 'none';
    id('btns').style.display = 'inherit';
    start.removeAttribute('disabled');
    recorder = new MediaRecorder(stream);
    recorder.ondataavailable = e => {
      chunks.push(e.data);
      if(recorder.state == 'inactive')  makeLink();
    };
    log('got media successfully');
  }).catch(log);
}

start.onclick = e => {
  start.disabled = true;
  stop.removeAttribute('disabled');
  chunks=[];
  recorder.start();
}

stop.onclick = e => {
  stop.disabled = true;
  recorder.stop();
  start.removeAttribute('disabled');
}

function makeLink(){
    let blob = new Blob(chunks, {type: media.type })
  ,  url = URL.createObjectURL(blob)
  ,  li = document.createElement('li')
  ,  mt = document.createElement(media.tag)
  ,  hf = document.createElement('a')
;
  mt.controls = true;
  mt.src = url;
  hf.href = url;
  hf.download = `${counter++}${media.ext}`;
  hf.innerHTML = `download ${hf.download}`;"<span style='color: red;'>**Message</span>";
  li.appendChild(mt);
  li.appendChild(hf);
  ul.appendChild(li);
}
</code>```

Body:
i am creating an mediaRecorder webapp using javascript in visual studio code. and i want to get my audio and video files get directly stores in firebase storage. when i click on stop recording its generate a download link but in simultenously i want that when i press on stop button the file directly stores in firebase storage.?

index.html

<!DOCTYPE html>

    <title>MediaRecorder</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="WebRTC getUserMedia MediaRecorder API">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
    <link rel = "stylesheet" href="style.css">

 MediaRecorder Using API

Welcome to MY App.

      Record:
        <input type="radio" name="media" value="video" checked id='mediaVideo'>Video
        <input type="radio" name="media" value="audio">audio

      <button class="btn btn-default"  id='gUMbtn'>Request Stream</button>

      <button  class="btn btn-default" id='start'>Start</button>
      <button  class="btn btn-default" id='stop'>Stop</button>

script.js

'use strict'
let log = console.log.bind(console),
  id = val => document.getElementById(val),
  ul = id('ul'),
  gUMbtn = id('gUMbtn'),
  start = id('start'),
  stop = id('stop'),
  stream,
  recorder,
  counter=1,
  chunks,
  media;

gUMbtn.onclick = e => {
  let mv = id('mediaVideo'),
      mediaOptions = {
        video: {
          tag: 'video',
          type: 'video/webm',
          ext: '.mp4',
          gUM: {video: true, audio: true}
        },
        audio: {
          tag: 'audio',
          type: 'audio/ogg',
          ext: '.ogg',
          gUM: {audio: true}
        }
      };
  media = mv.checked ? mediaOptions.video : mediaOptions.audio;
  navigator.mediaDevices.getUserMedia(media.gUM).then(_stream => {
    stream = _stream;
    id('gUMArea').style.display = 'none';
    id('btns').style.display = 'inherit';
    start.removeAttribute('disabled');
    recorder = new MediaRecorder(stream);
    recorder.ondataavailable = e => {
      chunks.push(e.data);
      if(recorder.state == 'inactive')  makeLink();
    };
    log('got media successfully');
  }).catch(log);
}

start.onclick = e => {
  start.disabled = true;
  stop.removeAttribute('disabled');
  chunks=[];
  recorder.start();
}

stop.onclick = e => {
  stop.disabled = true;
  recorder.stop();
  start.removeAttribute('disabled');
}

function makeLink(){
    let blob = new Blob(chunks, {type: media.type })
  ,  url = URL.createObjectURL(blob)
  ,  li = document.createElement('li')
  ,  mt = document.createElement(media.tag)
  ,  hf = document.createElement('a')
;
  mt.controls = true;
  mt.src = url;
  hf.href = url;
  hf.download = `${counter++}${media.ext}`;
  hf.innerHTML = `download ${hf.download}`;"**Message";
  li.appendChild(mt);
  li.appendChild(hf);
  ul.appendChild(li);
}


问:
Generate and return result from the XML Document
I need to generate XML to maintain the record of 10 users. I need to write a program, which takes
any input from the user from any interface and returns the user details by taking
the user information from XML document. Can someone help me?

I tried to link the XSLT file in visual studio using  in the XML file and implement the Javascript in the XSLT file. But the html contents in the XSLT file is not rendered in the browser.


问:
In React, does putting parenthesis inside an embedded Javascript expression temporarily return you to being able to use JSX again?
This isn't as much of a problem I'm having, I'm just trying to clarify why my code works. As is clear, brackets allows me to embed Javascript into the return statement. However, does the parenthesis in my map method 'return' me to JSX and allow me to render components and add other JSX elements? Like I said, this works, I just want to be sure I have a firm understanding of why it works since my Google attempts to confirm my suspicions haven't proven useful

```<code>export const TileList = ({tiles}) => {
  return (
    <div>
       {tiles.map((tile, index) => (
       <Tile tile={tile} key={index}/>
      ))
      }
    </div>
  );
};
</code>```

This is for a simple little React site that creates a 'tile' for every Contact information the user inputs. The code allows me to map through the array of contacts and create a tile for each input. Here's the subsequent component (that also works):

```<code>export const Tile = ({tile}) => {

  let tiles = Object.values(tile)

  return (
    <div className="tile-container">
      {tiles.map((tile, index) => (
      <p key={index}
      className={index === 0 ? 'tile-title' : 'tile'}
      >{tile}</p>
      ))}
    </div>
  );
};
</code>```

Body:
This isn't as much of a problem I'm having, I'm just trying to clarify why my code works. As is clear, brackets allows me to embed Javascript into the return statement. However, does the parenthesis in my map method 'return' me to JSX and allow me to render components and add other JSX elements? Like I said, this works, I just want to be sure I have a firm understanding of why it works since my Google attempts to confirm my suspicions haven't proven useful

export const TileList = ({tiles}) => {
  return (

       {tiles.map((tile, index) => (
       <Tile tile={tile} key={index}/>
      ))
      }

  );
};

This is for a simple little React site that creates a 'tile' for every Contact information the user inputs. The code allows me to map through the array of contacts and create a tile for each input. Here's the subsequent component (that also works):

export const Tile = ({tile}) => {

  let tiles = Object.values(tile)

  return (

      {tiles.map((tile, index) => (

{tile}

      ))}

  );
};


问:
aiogram, fetch all from database and message in telegram bot by 5 rows with labeks
Good day,Everyone

I am trying to build a telegram bot that fetchs all rows from database and shows message by 5 rows in tg bot with next page inline_keybord

here is my code

```<code>from aiogram import Bot, Dispatcher, executor, types
import mysql.connector as connector
from config import TOKEN_API

bot = Bot(TOKEN_API)
dp = Dispatcher(bot)

conn = connector.connect(
    database = 'awesugn_products',
    host = 'localhost',
    username = 'root',
    password = 'root'
)
cursor = conn.cursor()

def construct_keyboard(data: tuple, page: int) -> types.InlineKeyboardMarkup:
    length=len(data)
    kb={'inline_keyboard': []}
    buttons=[]
    if page > 1: #preventing going to -1 page
        buttons.append({'text':'<-', 'callback_data':f'page_{page-1}'})
    #adding a neat page number
    buttons.append({'text':f'{page}/{length}', 'callback_data':'none'})
    if page < length: #preventing going out of range
        buttons.append({'text':'->', 'callback_data':f'page_{page+1}'})
    kb['inline_keyboard'].append(buttons)
    return kb

@dp.message_handler(commands='start')
async def start (message: types.Message):
    cursor.execute("SELECT product_name, discount_price, regualar_price FROM discount_products")
    objs = cursor.fetchall()
    json_data = []
    for obj in objs:
        json_data.append({
            "product_name" : obj[0],
            "discount_price" : obj[1],
            "regualar_price" : obj[2]
            })
    await message.answer(json_data[0], reply_markup=construct_keyboard(objs, 1))

@dp.callback_query_handler(text_startswith='page_')
async def page(call: types.CallbackQuery):
    page=int(call.data.split('_')[1])
    cursor.execute("SELECT product_name, discount_price, regualar_price FROM discount_products")
    objs = cursor.fetchall()
    json_data = []
    for obj in objs:
        json_data.append({
            "product_name" : obj[0],
            "discount_price" : obj[1],
            "regualar_price" : obj[2]
            })
    await bot.send_message(call.message.chat.id, json_data[page - 1], reply_markup=construct_keyboard(objs, page))

if __name__ == "__main__":
    executor.start_polling(dp)
</code>```

my code is working like this in tg bot

I want see the result in beautiful content with bold labels and display by 5 rows on each page on telegram bot.

for example:

```<code>**product_name**: banana 240 kg
**discount_price**: 21990
**regualar_price**: 31990

**product_name**: biscuit 10 kg
**discount_price**: 21990
**regualar_price**: 31990
</code>```

in this example I showed by 2 rows in message,
how to display message like this with 5 rows in each message and with next page inline_keyboard where there bulk of rows are fetched from database?

Body:
Good day,Everyone

I am trying to build a telegram bot that fetchs all rows from database and shows message by 5 rows in tg bot with next page inline_keybord

here is my code

from aiogram import Bot, Dispatcher, executor, types
import mysql.connector as connector
from config import TOKEN_API

bot = Bot(TOKEN_API)
dp = Dispatcher(bot)

conn = connector.connect(
    database = 'awesugn_products',
    host = 'localhost',
    username = 'root',
    password = 'root'
)
cursor = conn.cursor()

def construct_keyboard(data: tuple, page: int) -> types.InlineKeyboardMarkup:
    length=len(data)
    kb={'inline_keyboard': []}
    buttons=[]
    if page > 1: #preventing going to -1 page
        buttons.append({'text':'<-', 'callback_data':f'page_{page-1}'})
    #adding a neat page number
    buttons.append({'text':f'{page}/{length}', 'callback_data':'none'})
    if page < length: #preventing going out of range
        buttons.append({'text':'->', 'callback_data':f'page_{page+1}'})
    kb['inline_keyboard'].append(buttons)
    return kb

@dp.message_handler(commands='start')
async def start (message: types.Message):
    cursor.execute("SELECT product_name, discount_price, regualar_price FROM discount_products")
    objs = cursor.fetchall()
    json_data = []
    for obj in objs:
        json_data.append({
            "product_name" : obj[0],
            "discount_price" : obj[1],
            "regualar_price" : obj[2]
            })
    await message.answer(json_data[0], reply_markup=construct_keyboard(objs, 1))

@dp.callback_query_handler(text_startswith='page_')
async def page(call: types.CallbackQuery):
    page=int(call.data.split('_')[1])
    cursor.execute("SELECT product_name, discount_price, regualar_price FROM discount_products")
    objs = cursor.fetchall()
    json_data = []
    for obj in objs:
        json_data.append({
            "product_name" : obj[0],
            "discount_price" : obj[1],
            "regualar_price" : obj[2]
            })
    await bot.send_message(call.message.chat.id, json_data[page - 1], reply_markup=construct_keyboard(objs, page))

if __name__ == "__main__":
    executor.start_polling(dp)

my code is working like this in tg bot

I want see the result in beautiful content with bold labels and display by 5 rows on each page on telegram bot.

for example:

**product_name**: banana 240 kg
**discount_price**: 21990
**regualar_price**: 31990

**product_name**: biscuit 10 kg
**discount_price**: 21990
**regualar_price**: 31990

in this example I showed by 2 rows in message,
how to display message like this with 5 rows in each message and with next page inline_keyboard where there bulk of rows are fetched from database?


问:
Kibana: How can we create visualisation for each value in a column?
I have an index in elasticsearch which contains heartbeat data coming from different machines in the following format:
Machine Name                   Heartbeat Signal Time
host_1                              2023-01-11 15:00
host_2                              2023-01-11 15:07
host_1                              2023-01-11 15:15
host_3                              2023-01-11 15:19
....                                 ....

So I want to create a visualisation for each unique value in the machine name column with value 1 on y-axis (depicting count of heartbeat signal sent at a particular time for a machine) and time range on x-axis.
In other words, I want to create a time range histogram for each machine when it was online/offline.

Is there a way to automate it or do I need to create visualisation for each unique entry in machine as the new value is added?

I tried creating buckets, canvas and all tools given in Kibana but was not able to get the required visualisations.


问:
Force English Language in ICN Desktop, irrespective of browser language
How to make English language as default language in IBM Content Navigator Desktop, Irrespective of User browser Language, using content navigator Plugin
If the browser Language is French, Once login to ICN Desktop, it should apply English Language,

Note: User will not change browser language will be in local language only, need to make these changes in ICN only.
 And the user will not change the Language setting in ICN every time, English should be default language as soon as logged in

Tried from Aspect.after OnLogin