问:
How to Extract data from XML using Nokogiri Ruby library?
Here is a sample of a XML data that is being fetched, from a seperate GTFS server (Transit Data):

```<code><?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
        <GetNextTripsForStopResponse xmlns="http://octranspo.com">
            <GetNextTripsForStopResult>
                <StopNo>3023</StopNo>
                <StopLabel>HURDMAN</StopLabel>
                <Error/>
                <Route>
                    <RouteDirection>
                        <RouteNo>45</RouteNo>
                        <RouteLabel>Hospital</RouteLabel>
                        <Direction></Direction>
                        <Error>12</Error>
                        <RequestProcessingTime>20221212125854</RequestProcessingTime>
                        <Trips>
                            <Trip>
                                <Longitude/>
                                <Latitude/>
                                <GPSSpeed/>
                                <TripDestination>Hospital</TripDestination>
                                <TripStartTime>13:03</TripStartTime>
                                <AdjustedScheduleTime>4</AdjustedScheduleTime>
                                <AdjustmentAge>-1</AdjustmentAge>
                                <LastTripOfSchedule>false</LastTripOfSchedule>
                                <BusType/>
                            </Trip>
                            <Trip>
                                <Longitude/>
                                <Latitude/>
                                <GPSSpeed/>
                                <TripDestination>Hospital</TripDestination>
                                <TripStartTime>13:18</TripStartTime>
                                <AdjustedScheduleTime>19</AdjustedScheduleTime>
                                <AdjustmentAge>-1</AdjustmentAge>
                                <LastTripOfSchedule>false</LastTripOfSchedule>
                                <BusType/>
                            </Trip>
                            <Trip>
                                <Longitude/>
                                <Latitude/>
                                <GPSSpeed/>
                                <TripDestination>Hospital</TripDestination>
                                <TripStartTime>13:33</TripStartTime>
                                <AdjustedScheduleTime>34</AdjustedScheduleTime>
                                <AdjustmentAge>-1</AdjustmentAge>
                                <LastTripOfSchedule>false</LastTripOfSchedule>
                                <BusType/>
                            </Trip>
                        </Trips>
                    </RouteDirection>
                </Route>
            </GetNextTripsForStopResult>
        </GetNextTripsForStopResponse>
    </soap:Body>
</soap:Envelope>
</code>```

I am trying to extract the data inside 'Trips' and use my maping to return the data. here is the mappinngs I am using:

```<code>@mappings = {
      :next_for_route => {
        'TripDestination'     => { :key => :destination, :conv => lambda { |s| s } },
        'TripStartTime'       => { :key => :departure_from_origin, :conv => lambda { |s| hour_and_minutes_to_elapsed(s) } },
        'AdjustedScheduleTime'=> { :key => :expected, :conv => lambda { |s| secs_elapsed_today + 60 * s.to_i } },
        'AdjustmentAge'       => { :key => :age, :conv => lambda { |s| '-1' == s ? nil : (s.to_f * 60).to_i } },
        'BusType'             => { :key => :bus_type, :conv => lambda { |s| s } },
        'Latitude'            => { :key => :latitude, :conv => lambda { |s| s.to_f } },
        'Longitude'           => { :key => :longitude, :conv => lambda { |s| s.to_f } },
        'GPSSpeed'            => { :key => :approximate_speed, :conv => lambda { |s| s.to_f } },
      },
      :route_summary => {
        'RouteNo'      => { :key => :route_no, :conv => lambda { |s| s.to_i } },
        'DirectionID'  => { :key => :direction_id, :conv => lambda { |s| s.to_i } },
        'Direction'    => { :key => :direction, :conv => lambda { |s| s } },
        'RouteHeading' => { :key => :heading, :conv => lambda { |s| s } },
      }
   }
</code>```

I tried the following but I still can't get the data. I am not sure why it isn't working I checked if my xpath works in online format checker and it worked.

```<code>def request(op, root, payload)
    payload['appID'] = @app_id
    payload['apiKey'] = @api_key
    payload['format'] = 'xml'
    resp = @conn.get("/v2.0/#{op}") do |req|
      req.params = payload
    end
    doc = Nokogiri::XML(resp.body)
    doc.namespace_inheritance = true
    yield(doc.at_xpath("//#{root}"))
  end

  def apply_mapping(key, node, vals)
    @mappings[key].each do |k, v|
      n = node.css(k.to_s)
      vals[v[:key].to_sym] = v[:conv].call(n.first.content) if n
    end
    vals
  end

  def next_for_route(stop_no, route_no)
    # BUG: docs have <StopInfoData> as root node; running system yields <GetNextTripsForStopResult>
    request('GetNextTripsForStop', 'GetNextTripsForStopAllRoutes', { 'stopNo' => stop_no, 'routeNo' => route_no }) do |root_node|
      arr = root_node.at('/Trips/Trip') do |pn|
        apply_mapping(:next_for_route, pn, { :stop_no => stop_no, :route_no => route_no })
      end
      yield(arr)
    end
  end
</code>```

Body:
Here is a sample of a XML data that is being fetched, from a seperate GTFS server (Transit Data):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body>
        <GetNextTripsForStopResponse xmlns="http://octranspo.com">
            <GetNextTripsForStopResult>
                <StopNo>3023</StopNo>
                <StopLabel>HURDMAN</StopLabel>
                <Error/>
                <Route>
                    <RouteDirection>
                        <RouteNo>45</RouteNo>
                        <RouteLabel>Hospital</RouteLabel>
                        <Direction></Direction>
                        <Error>12</Error>
                        <RequestProcessingTime>20221212125854</RequestProcessingTime>
                        <Trips>
                            <Trip>
                                <Longitude/>
                                <Latitude/>
                                <GPSSpeed/>
                                <TripDestination>Hospital</TripDestination>
                                <TripStartTime>13:03</TripStartTime>
                                <AdjustedScheduleTime>4</AdjustedScheduleTime>
                                <AdjustmentAge>-1</AdjustmentAge>
                                <LastTripOfSchedule>false</LastTripOfSchedule>
                                <BusType/>
                            </Trip>
                            <Trip>
                                <Longitude/>
                                <Latitude/>
                                <GPSSpeed/>
                                <TripDestination>Hospital</TripDestination>
                                <TripStartTime>13:18</TripStartTime>
                                <AdjustedScheduleTime>19</AdjustedScheduleTime>
                                <AdjustmentAge>-1</AdjustmentAge>
                                <LastTripOfSchedule>false</LastTripOfSchedule>
                                <BusType/>
                            </Trip>
                            <Trip>
                                <Longitude/>
                                <Latitude/>
                                <GPSSpeed/>
                                <TripDestination>Hospital</TripDestination>
                                <TripStartTime>13:33</TripStartTime>
                                <AdjustedScheduleTime>34</AdjustedScheduleTime>
                                <AdjustmentAge>-1</AdjustmentAge>
                                <LastTripOfSchedule>false</LastTripOfSchedule>
                                <BusType/>
                            </Trip>
                        </Trips>
                    </RouteDirection>
                </Route>
            </GetNextTripsForStopResult>
        </GetNextTripsForStopResponse>
    </soap:Body>
</soap:Envelope>

I am trying to extract the data inside 'Trips' and use my maping to return the data. here is the mappinngs I am using:

@mappings = {
      :next_for_route => {
        'TripDestination'     => { :key => :destination, :conv => lambda { |s| s } },
        'TripStartTime'       => { :key => :departure_from_origin, :conv => lambda { |s| hour_and_minutes_to_elapsed(s) } },
        'AdjustedScheduleTime'=> { :key => :expected, :conv => lambda { |s| secs_elapsed_today + 60 * s.to_i } },
        'AdjustmentAge'       => { :key => :age, :conv => lambda { |s| '-1' == s ? nil : (s.to_f * 60).to_i } },
        'BusType'             => { :key => :bus_type, :conv => lambda { |s| s } },
        'Latitude'            => { :key => :latitude, :conv => lambda { |s| s.to_f } },
        'Longitude'           => { :key => :longitude, :conv => lambda { |s| s.to_f } },
        'GPSSpeed'            => { :key => :approximate_speed, :conv => lambda { |s| s.to_f } },
      },
      :route_summary => {
        'RouteNo'      => { :key => :route_no, :conv => lambda { |s| s.to_i } },
        'DirectionID'  => { :key => :direction_id, :conv => lambda { |s| s.to_i } },
        'Direction'    => { :key => :direction, :conv => lambda { |s| s } },
        'RouteHeading' => { :key => :heading, :conv => lambda { |s| s } },
      }
   }

I tried the following but I still can't get the data. I am not sure why it isn't working I checked if my xpath works in online format checker and it worked.

def request(op, root, payload)
    payload['appID'] = @app_id
    payload['apiKey'] = @api_key
    payload['format'] = 'xml'
    resp = @conn.get("/v2.0/#{op}") do |req|
      req.params = payload
    end
    doc = Nokogiri::XML(resp.body)
    doc.namespace_inheritance = true
    yield(doc.at_xpath("//#{root}"))
  end

  def apply_mapping(key, node, vals)
    @mappings[key].each do |k, v|
      n = node.css(k.to_s)
      vals[v[:key].to_sym] = v[:conv].call(n.first.content) if n
    end
    vals
  end

  def next_for_route(stop_no, route_no)
    # BUG: docs have <StopInfoData> as root node; running system yields <GetNextTripsForStopResult>
    request('GetNextTripsForStop', 'GetNextTripsForStopAllRoutes', { 'stopNo' => stop_no, 'routeNo' => route_no }) do |root_node|
      arr = root_node.at('/Trips/Trip') do |pn|
        apply_mapping(:next_for_route, pn, { :stop_no => stop_no, :route_no => route_no })
      end
      yield(arr)
    end
  end


来源: stackexchange

问:
Php Wordpress (is_rtl()) ? 'rtl' : 'ltr'; add Multi-Languages
I have this code for WordPress with WPML (but the theme was built with laravel-blade). I need to add Chain Lang (zh-hans), so how can I do that?

$context['direction'] = (is_rtl()) ? 'rtl' : 'ltr';
$context['lang'] = (is_rtl()) ? 'ar' : 'en';
```
<p>I need to write this (zh-hans with EN in LTR), how can I do that?</p>
<p>Also, <code>EN</code> is the defult... this code for <code>AR</code>, how can I add <code>zh-hans</code> lang to this code?</p>
<pre class="lang-php prettyprint-override"><code>/**
 *  Get Customizer Options
 */
public static function get_option($option, $type = '', $default = '') {
    $option_trans = (is_rtl()) ? $option.'_ar' : $option;

    $value = ($default == 'trans') ? get_theme_mod($option, '') : get_theme_mod($option_trans, '');

    if ($type === 'img') {
        $option_trans = (is_rtl()) ? $option.'_ar' : $option;

        $value = ($default == 'trans')
            ? wp_get_attachment_image_url(get_theme_mod($option_trans, ''), 'full')
            : wp_get_attachment_image_url(get_theme_mod($option, ''), $default);
    }

    if ($type === 'editor') {
        $value = wpautop(get_theme_mod($option_trans, $default));
    }

    if ($type === 'group') {
        $trans_value = get_theme_mod($option_trans, '');

        $value = ($default == 'trans') ? $trans_value : get_theme_mod($option, '');
    }

    return $value;
}

/**
 * Get Translation
 */
public static function get_trans($rtl, $ltr) {
    $value = (is_rtl()) ? $rtl : $ltr;

    return $value;
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have this code for WordPress with WPML (but the theme was built with laravel-blade). I need to add Chain Lang (zh-hans), so how can I do that?

$context['direction'] = (is_rtl()) ? 'rtl' : 'ltr';
$context['lang'] = (is_rtl()) ? 'ar' : 'en';

I need to write this (zh-hans with EN in LTR), how can I do that?

Also, EN is the defult... this code for AR, how can I add zh-hans lang to this code?

/**
 *  Get Customizer Options
 */
public static function get_option($option, $type = '', $default = '') {
    $option_trans = (is_rtl()) ? $option.'_ar' : $option;

    $value = ($default == 'trans') ? get_theme_mod($option, '') : get_theme_mod($option_trans, '');

    if ($type === 'img') {
        $option_trans = (is_rtl()) ? $option.'_ar' : $option;

        $value = ($default == 'trans')
            ? wp_get_attachment_image_url(get_theme_mod($option_trans, ''), 'full')
            : wp_get_attachment_image_url(get_theme_mod($option, ''), $default);
    }

    if ($type === 'editor') {
        $value = wpautop(get_theme_mod($option_trans, $default));
    }

    if ($type === 'group') {
        $trans_value = get_theme_mod($option_trans, '');

        $value = ($default == 'trans') ? $trans_value : get_theme_mod($option, '');
    }

    return $value;
}

/**
 * Get Translation
 */
public static function get_trans($rtl, $ltr) {
    $value = (is_rtl()) ? $rtl : $ltr;

    return $value;
}


问:
While testing the model on test dataset of MaskRCNN, the result shows blank images and shows the low contrast image
I am training and testing a MaskRCNN model for detecting the anomaly in patterns of brain. The image size is 112*112 (3 channels) and format is .dicom. While testing the model on the actual radiographic images, the result shows blank image with the below warning message.

However, I have checked the standard deviation to check the contrast and intensity of images. Also, I applied Gamma correction and other contrast enhancement with the failed testing images. But, still getting the same issue.

Please help me on this! Do we have any solution to handle such situation in MaskRCNN?


问:
MUI Datagrid disable user from typing further if validation does not pass
Is there any way to prevent a user from typing into a cell during edit mode if a validation fails? MUI documentation only shows validation in form of a snack bar but still allows users to continue to type.

In the below example, the field "data" should only allow the user to type up to 10 characters in length. The expected behavior would be to not record any new characters after 10.

DataGrid Component So Far

```<code>import React from "react";
import { DataGrid } from "@mui/x-data-grid";

export default function FairValuePricingLatest({ rows, handleCellEdit }) {
    const columns = [
    {
      field: "id",
      headerName: "Id"
    },
    {
      field: "data",
      headerName: "Data",
      editable: true,
      preProcessEditCellProps(params) {
        const invalid = params.props.value.length > 10;
        if (invalid) {
          return { ...params.props, error: invalid }
        }
      }
    ];

    return (
      <DataGrid
        editMode="cell"
        experimentalFeatures={{ newEditingApi: true }}
        processRowUpdate={handleCellEdit}
        rows={rows}
        columns={columns}
      />
    )
}

</code>```

Body:
Is there any way to prevent a user from typing into a cell during edit mode if a validation fails? MUI documentation only shows validation in form of a snack bar but still allows users to continue to type.

In the below example, the field "data" should only allow the user to type up to 10 characters in length. The expected behavior would be to not record any new characters after 10.

DataGrid Component So Far

import React from "react";
import { DataGrid } from "@mui/x-data-grid";

export default function FairValuePricingLatest({ rows, handleCellEdit }) {
    const columns = [
    {
      field: "id",
      headerName: "Id"
    },
    {
      field: "data",
      headerName: "Data",
      editable: true,
      preProcessEditCellProps(params) {
        const invalid = params.props.value.length > 10;
        if (invalid) {
          return { ...params.props, error: invalid }
        }
      }
    ];

    return (
      <DataGrid
        editMode="cell"
        experimentalFeatures={{ newEditingApi: true }}
        processRowUpdate={handleCellEdit}
        rows={rows}
        columns={columns}
      />
    )
}


问:
Where can i get Podman version 3.3 to install in RedHat linux 8 server
I have a RedHat Linux Server with version 8 and Podman included version 4.2.0. But we need to have Podman version 3.3. Here my questions:

1- Where can i get the Podman version 3.3 ?
3 - How to install the Podman version 3.3 if can i get it ?

I've tried to get Podman version 3.3 from google. But i couldn't find it. If you can give a hand where i can to get it, will be a good help.


问:
How to correctly reference IHeaderDictionary?
I want to use interface IHeaderDictionary (or the class HeaderDictionary) in a class library. It is an interface defined in ASP.NET Core which represents a collection of http request or response headers. We have some classes working with it in a separate git repository and we want to define a contract separately in a yet another separate git repository. So I have a tiny C# project and there is only a contract in it, nothing else.

The question is this: Which nuget should I reference to be able to use IHeaderDictinary in my contract?

MSDN says it is defined in nuget Microsoft.AspNetCore.App.Ref. And it is really there, but it is forbidden to reference that nuget. (It has package type DotnetPlatform which effectively prevents it to be included in regular class libraries, as mentioned in other discussions.) But which nuget should I reference if not that one? I tried to reference Microsoft.AspNetCore.App, but it is a framework one, so it cannot be referenced too. Then we found that in an older application we used this interface from nuget called Microsoft.AspNetCore.Http.Features. And it works, I can still use this one but when I look to nuget gallery, I can see it is an abandoned nuget, the latest version is 6.0.0-preview, so apparently this is not the correct way how Microsoft intended us to use IHeaderDictionary.

So what am I missing here? Typically, authors of nugets provide something like "contract" or "abstractions" nugets which are tiny and can be included in other contracts. Please help me to understand what is the problem with ASP.NET and how to use it in contracts.


问:
How to hide the default registration form created by the response from the server?
So... I am facing a very unusual problem.
I'm making an application on react + django. I decided to use djoser for authorization. This works fine until I try to call any method with incorrect authorization data. For example, with or without the wrong token. Then django returns a 401 error, as it should, and at the same time this form appears.

The problem is that this is the first time I see something like this in the browser and I don't even know what it's called in order to accurately Google information about it. This screenshot uses yandex browser


问:
No thread bound Request in Spring Boot
I am new to Spring boot.

I have two microServices(MS) running.

From 1st MS, I have a code like below

List models.
and for each of the entries of the models, I am invoking a call to 2nd MS like below

models.stream().filter(mod -> isModActive(<Call to 2nd MS>)).collect(Collectors.toList()) --- (Invoker)

The above code snippet takes a time of 30 secs.

Now, I want to optimize the code.
For this, I divided the models into batches of 20.
For Each batch, I am invoking the code like below

```<code>CompletableFuture.supplyAsync(() -> batch1.stream().filter(mod -> isModActive(<Call to 2nd MS>)).collect(Collectors.toList()))
</code>```

After invoking the batches using CompletableFuture, I am combining their results in code.

During execution, I am getting an exception - No thread bound request for Dispatcher Servelet. Use RequestContextListener instead.

I checked this error and tried using all the scenarios which were mentioned like - making a bean method to return RequestContextListnere, using @Async and making a custom threadpoolExecutor in the main Application class, nothing helped.

Can anyone please help?

Thanks

Already mentioned in the description.

Title: No thread bound Request in Spring Boot

Body:
I am new to Spring boot.

I have two microServices(MS) running.

From 1st MS, I have a code like below

List models.
and for each of the entries of the models, I am invoking a call to 2nd MS like below

models.stream().filter(mod -> isModActive(<Call to 2nd MS>)).collect(Collectors.toList()) --- (Invoker)

The above code snippet takes a time of 30 secs.

Now, I want to optimize the code.
For this, I divided the models into batches of 20.
For Each batch, I am invoking the code like below

CompletableFuture.supplyAsync(() -> batch1.stream().filter(mod -> isModActive(<Call to 2nd MS>)).collect(Collectors.toList()))

After invoking the batches using CompletableFuture, I am combining their results in code.

During execution, I am getting an exception - No thread bound request for Dispatcher Servelet. Use RequestContextListener instead.

I checked this error and tried using all the scenarios which were mentioned like - making a bean method to return RequestContextListnere, using @Async and making a custom threadpoolExecutor in the main Application class, nothing helped.

Can anyone please help?

Thanks

Already mentioned in the description.


问:
Minhook crashes when the function returns
I'm having some issues with Minhook. When the modified function returns a value, application getting crashed. And I don't quite understand what the problem is.

As I understand it, the hooked function must return the original function with parameters, these parameters can be changed in the hook function.
This is the function I want to hook, taken from decompiler. I did not copied the function code because you would most likely be tired of scrolling through the page:

```<code>__int64 __fastcall SendPacket(int eNetMessageType, _QWORD *a2, __int64 _ENetPeer);
</code>```

This is the original function that I have already moved to my code:

```<code>void(__thiscall* SendPacket)(int, long double*, __int64);
</code>```

And this is the modified (hooked) function:

```<code>void __fastcall SendPacketLog(int eNetMessageType, long double* a2, __int64 _ENetPeer) {
std::cout << "[SendPacketLog]\nType: " << eNetMessageType << "\nUnknown: " << a2 << "\nENetPeer: " << _ENetPeer << "\n\n";

return SendPacket(eNetMessageType, a2, _ENetPeer);
}
</code>```

The modified function should simply log the parameters of the function and then return the original function in the end. I manage to get the log, which is what the modified function should do, but immediately after that the game crashes.

In general, I can guess about the incorrect transfer of variables from the disassembler (From C and assembly to C ++, but at first glance everything is correct).
I attached a debugger to the process and when I crashed I got an error: "access violation while executing at address"
I also tried to return the value 0. Someone suggested this to me, but it did not help, it just saved from crashes, but broke the application.

Body:
I'm having some issues with Minhook. When the modified function returns a value, application getting crashed. And I don't quite understand what the problem is.

As I understand it, the hooked function must return the original function with parameters, these parameters can be changed in the hook function.
This is the function I want to hook, taken from decompiler. I did not copied the function code because you would most likely be tired of scrolling through the page:

__int64 __fastcall SendPacket(int eNetMessageType, _QWORD *a2, __int64 _ENetPeer);

This is the original function that I have already moved to my code:

void(__thiscall* SendPacket)(int, long double*, __int64);

And this is the modified (hooked) function:

void __fastcall SendPacketLog(int eNetMessageType, long double* a2, __int64 _ENetPeer) {
std::cout << "[SendPacketLog]\nType: " << eNetMessageType << "\nUnknown: " << a2 << "\nENetPeer: " << _ENetPeer << "\n\n";

return SendPacket(eNetMessageType, a2, _ENetPeer);
}

The modified function should simply log the parameters of the function and then return the original function in the end. I manage to get the log, which is what the modified function should do, but immediately after that the game crashes.

In general, I can guess about the incorrect transfer of variables from the disassembler (From C and assembly to C ++, but at first glance everything is correct).
I attached a debugger to the process and when I crashed I got an error: "access violation while executing at address"
I also tried to return the value 0. Someone suggested this to me, but it did not help, it just saved from crashes, but broke the application.


问:
How to improve efficiency of applying custom function for dataset of 1million rows
I have a dataset of close to 1million boards(chess) in a dataframe. I want to apply a custom function to get an evaluation score for each board using stockfish. Is there a way to speed up this process? Here are the applicable code

```<code>def getScoreFromBoard(board):
  return engine.analyse(board,chess.engine.Limit(time=1))['score'].pov(chess.WHITE)

extendedBoardsArray = [] # THIS IS WHERE THE AROUND 1 MILLION BOARDS ARE KEPT
boardsWithEval = pd.DataFrame([x,getScoreFromBoard(x)]for x in extendedBoardsArray)
</code>```

Will using pandas.apply be faster? Using the swifter package? I am open to any other alternative methods. I am using google colab if that matters.

Body:
I have a dataset of close to 1million boards(chess) in a dataframe. I want to apply a custom function to get an evaluation score for each board using stockfish. Is there a way to speed up this process? Here are the applicable code

def getScoreFromBoard(board):
  return engine.analyse(board,chess.engine.Limit(time=1))['score'].pov(chess.WHITE)

extendedBoardsArray = [] # THIS IS WHERE THE AROUND 1 MILLION BOARDS ARE KEPT
boardsWithEval = pd.DataFrame([x,getScoreFromBoard(x)]for x in extendedBoardsArray)

Will using pandas.apply be faster? Using the swifter package? I am open to any other alternative methods. I am using google colab if that matters.


问:
New to Jupyter Notebook. Can someone tell me pls?
Trying to scrape an ecommerce website. It has rows of buttons/images which keeps loading more products as you scroll. On which element or element-id should the code perform Click() so as to retrieve product name, price, description ....attributes

Getting an error on

```<code>btn = driver.find_element_by_xpath("//*[@class='productTitle']")
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'
</code>```

Can anyone please tell me with an example? Thank you so much

Thanks,

Sunil

Body:
Trying to scrape an ecommerce website. It has rows of buttons/images which keeps loading more products as you scroll. On which element or element-id should the code perform Click() so as to retrieve product name, price, description ....attributes

Getting an error on

btn = driver.find_element_by_xpath("//*[@class='productTitle']")
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'

Can anyone please tell me with an example? Thank you so much

Thanks,

Sunil


问:
How to split the pattern with fuse.js
```<code>const list = [{ product: "Nike Trail Running Shoes" }]

const options = {
  includeScore: true,
  ignoreLocation: true,
  keys: ["product"],
};

const fuse = new Fuse(list, options);
return fuse.search(pattern);
</code>```

If pattern = "Nike" score will be 0.03

But if pattern = "Nike shoes" score will be 0.655

I want "Nike shoes" to get a better score than "Nike", since it contains both Nike and shoes

Can this be solved, so Nike Shoes get a better score? Be aware that the closer 0, the better.

Title: How to split the pattern with fuse.js

Body:
const list = [{ product: "Nike Trail Running Shoes" }]

const options = {
  includeScore: true,
  ignoreLocation: true,
  keys: ["product"],
};

const fuse = new Fuse(list, options);
return fuse.search(pattern);

If pattern = "Nike" score will be 0.03

But if pattern = "Nike shoes" score will be 0.655

I want "Nike shoes" to get a better score than "Nike", since it contains both Nike and shoes

Can this be solved, so Nike Shoes get a better score? Be aware that the closer 0, the better.


问:
C++ Code crashing when I reference a file
You can see by the "In what file is the data for the graph contained?" prompt, that I have to input a file to get the code to function properly. The program gets up to "In what file is the data for the graph contained?", then I input a file name, it freezes then crashes. My whole computer freezes and other applications begin to crash. I even ran the code by removing my own code, and the same problem occurs. What is causing this? And how can I fix this?</p>
```<code>#include <fstream>
#include <iostream>
using namespace std;

struct edge {
    struct vertex* Vertex;
    int weight;
    edge* nextedge;
    edge(edge* e = 0, struct vertex* v = 0, int w = 0)
    {
        Vertex = v;
        weight = w;
        nextedge = e;
    }
};
struct vertex {
    char name;
    vertex* nextvertex;
    edge* edgelist;
    int index;
    bool final;
    vertex* pre;
    vertex(char n = '\0', vertex* v = 0)
    {
        name = n;
        nextvertex = v;
        edgelist = 0;
        index = -1;
        final = false;
        pre = 0;
    }
};

int main()
{
    char input_file[128];
    cout << "In what file is the data for the graph contained?\n> ";
    cin.getline(input_file, 128);
    ifstream infile(input_file);
    vertex* graph = 0;
    vertex *startptr = 0, *finishptr = 0;
    vertex *vertexsearch = 0, *vptr = 0;
    vertex* last;
    vertex* w;
    edge* edgeptr = 0;
    int weight;
    char start, finish, comma;
    bool startnotfound = true, finishnotfound = true;
    infile >> start >> comma >> finish >> comma >> weight;
    while (!infile.eof()) {

        /* build the edge list */
        startptr = new vertex(sizeof(struct vertex));
        finishptr = new vertex(sizeof(struct vertex));
        finishptr->name = finish;
        startptr->name = start;
        startptr->nextvertex = finishptr;

        edgeptr = new edge();

        edgeptr->Vertex = startptr;
        edgeptr->weight = weight;
        edgeptr->nextedge = NULL;

        graph = new vertex(sizeof(struct vertex));
        graph->name = finish;
        graph->edgelist = edgeptr;
    }

    // Output the graph
    vptr = graph;
    while (vptr) {
        cout << vptr->name << '\n';
        edgeptr = vptr->edgelist;
        while (edgeptr) {
            cout << " Edge to " << edgeptr->Vertex->name
                 << " with weight " << edgeptr->weight << '\n';
            edgeptr = edgeptr->nextedge;
        }
        vptr = vptr->nextvertex;
    }

    // From where to where
    cout << "From where: ";
    cin >> start;
    cout << "to where: ";
    cin >> finish;

    vertex* s = graph;
    startptr = finishptr = 0;
    while (s) {
        if (s->name == start) {
            startptr = s;
        }
        if (s->name == finish) {
            finishptr = s;
        }
        s = s->nextvertex;
    }

    if (!startptr) {
        cout << "Start point given is not a valid vertex.\n";
        return 1;
    }
    last = startptr;
    last->index = 0;
    last->final = true;
    while (!(finishptr->final)) {
        /* Search for shortest path */
    }

    vptr = finishptr;

    if (vptr->pre)
        while (vptr) {
            cout << vptr->name << '\n';
            vptr = vptr->pre;
        }
    else
        cout << "No such path.\n";

    return 0;
}
</code>```

Body:
You can see by the "In what file is the data for the graph contained?" prompt, that I have to input a file to get the code to function properly. The program gets up to "In what file is the data for the graph contained?", then I input a file name, it freezes then crashes. My whole computer freezes and other applications begin to crash. I even ran the code by removing my own code, and the same problem occurs. What is causing this? And how can I fix this?

#include <fstream>
#include <iostream>
using namespace std;

struct edge {
    struct vertex* Vertex;
    int weight;
    edge* nextedge;
    edge(edge* e = 0, struct vertex* v = 0, int w = 0)
    {
        Vertex = v;
        weight = w;
        nextedge = e;
    }
};
struct vertex {
    char name;
    vertex* nextvertex;
    edge* edgelist;
    int index;
    bool final;
    vertex* pre;
    vertex(char n = '\0', vertex* v = 0)
    {
        name = n;
        nextvertex = v;
        edgelist = 0;
        index = -1;
        final = false;
        pre = 0;
    }
};

int main()
{
    char input_file[128];
    cout << "In what file is the data for the graph contained?\n> ";
    cin.getline(input_file, 128);
    ifstream infile(input_file);
    vertex* graph = 0;
    vertex *startptr = 0, *finishptr = 0;
    vertex *vertexsearch = 0, *vptr = 0;
    vertex* last;
    vertex* w;
    edge* edgeptr = 0;
    int weight;
    char start, finish, comma;
    bool startnotfound = true, finishnotfound = true;
    infile >> start >> comma >> finish >> comma >> weight;
    while (!infile.eof()) {

        /* build the edge list */
        startptr = new vertex(sizeof(struct vertex));
        finishptr = new vertex(sizeof(struct vertex));
        finishptr->name = finish;
        startptr->name = start;
        startptr->nextvertex = finishptr;

        edgeptr = new edge();

        edgeptr->Vertex = startptr;
        edgeptr->weight = weight;
        edgeptr->nextedge = NULL;

        graph = new vertex(sizeof(struct vertex));
        graph->name = finish;
        graph->edgelist = edgeptr;
    }

    // Output the graph
    vptr = graph;
    while (vptr) {
        cout << vptr->name << '\n';
        edgeptr = vptr->edgelist;
        while (edgeptr) {
            cout << " Edge to " << edgeptr->Vertex->name
                 << " with weight " << edgeptr->weight << '\n';
            edgeptr = edgeptr->nextedge;
        }
        vptr = vptr->nextvertex;
    }

    // From where to where
    cout << "From where: ";
    cin >> start;
    cout << "to where: ";
    cin >> finish;

    vertex* s = graph;
    startptr = finishptr = 0;
    while (s) {
        if (s->name == start) {
            startptr = s;
        }
        if (s->name == finish) {
            finishptr = s;
        }
        s = s->nextvertex;
    }

    if (!startptr) {
        cout << "Start point given is not a valid vertex.\n";
        return 1;
    }
    last = startptr;
    last->index = 0;
    last->final = true;
    while (!(finishptr->final)) {
        /* Search for shortest path */
    }

    vptr = finishptr;

    if (vptr->pre)
        while (vptr) {
            cout << vptr->name << '\n';
            vptr = vptr->pre;
        }
    else
        cout << "No such path.\n";

    return 0;
}


问:
Microsoft Web Infrastructure server error

Server Error in '/' Application. Could not load file or assembly
'Microsoft.Web.Infrastructure' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040) Description: An unhandled
exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and
where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'Microsoft.Web.Infrastructure' or one of its dependencies.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to
determine why the assembly 'Microsoft.Web.Infrastructure' could not be
loaded.

WRN: Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

```<code>[FileLoadException: Could not load file or assembly 'Microsoft.Web.Infrastructure' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +232
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +113
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +23
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +49

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +762
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +259
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +167
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +238
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +78
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +334
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +178
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +746

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +732
</code>```

I need help on solving this problem. I've been trying to solve this problem for several days.

Body:
Server Error in '/' Application. Could not load file or assembly
'Microsoft.Web.Infrastructure' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040) Description: An unhandled
exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and
where it originated in the code.

Exception Details: System.IO.FileLoadException: Could not load file or
assembly 'Microsoft.Web.Infrastructure' or one of its dependencies.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to
determine why the assembly 'Microsoft.Web.Infrastructure' could not be
loaded.

WRN: Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[FileLoadException: Could not load file or assembly 'Microsoft.Web.Infrastructure' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]

[FileLoadException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +232
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +113
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +23
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +49

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +762
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +259
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +167
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +238
   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +78
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +334
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +178
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +746

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +732

I need help on solving this problem. I've been trying to solve this problem for several days.


问:
The correct Syntax for checking the keys in the hashmap inside ArrayList<HashMap<String,Object>>
This works for me, however I know that it is incorrect to use a parameter Raw type, so how am I supposed to do this correctly? The end goal is to check each key for correctness in a test suite.

I have other ideas but I want to learn the correct way to do this rather than guess.

```<code>ArrayList<HashMap<String,Object>> results = dbConn.getDataFromTable("select * from paf_extract_in.hcr_retro_chart_list WHERE payer = 'HEALTHTEAMADVANTAGE'");

for (HashMap result: results) {
     if (!result.containsKey("hcr_retro_chart_list.packetid")) {
         Assertions.fail();
     }

}
</code>```

I can do this as well, however this feels wrong and I can not do any other Assertions on the items.

```<code>for (Object result: results) {
    if (!result.toString().contains("hcr_retro_chart_list.packetid")) {
        Assertions.fail();
    }
}
</code>```

Body:
This works for me, however I know that it is incorrect to use a parameter Raw type, so how am I supposed to do this correctly? The end goal is to check each key for correctness in a test suite.

I have other ideas but I want to learn the correct way to do this rather than guess.

ArrayList<HashMap<String,Object>> results = dbConn.getDataFromTable("select * from paf_extract_in.hcr_retro_chart_list WHERE payer = 'HEALTHTEAMADVANTAGE'");

for (HashMap result: results) {
     if (!result.containsKey("hcr_retro_chart_list.packetid")) {
         Assertions.fail();
     }

}

I can do this as well, however this feels wrong and I can not do any other Assertions on the items.

for (Object result: results) {
    if (!result.toString().contains("hcr_retro_chart_list.packetid")) {
        Assertions.fail();
    }
}


问:
How to translate a SaaS application in Laravel 7?
I have an application that each platform has its own domain example:

```<code>test2020.mycompany.cl
test2021.mycompany.cl
test2022.mycompany.cl
</code>```

The issue is that each tenant has a different name, it could be placed at DB level but in reporting would be to make too many calls to DB to change the titles to those texts.

This is the library I use for the SaaS architecture.
https://tenancy.dev/

Body:
I have an application that each platform has its own domain example:

test2020.mycompany.cl
test2021.mycompany.cl
test2022.mycompany.cl

The issue is that each tenant has a different name, it could be placed at DB level but in reporting would be to make too many calls to DB to change the titles to those texts.

This is the library I use for the SaaS architecture.
https://tenancy.dev/


问:
Json Parsing using pyspark
I am trying to load a JSON file by providing the schema but still, there is something wrong
and it returns everything as a single row whereas I want to break it into rows

I want it to be displayed as

schema specified code

```<code>`https://github.com/umerrkhan/Reference-Code-databricks/blob/main/00%20-%20JSON-%20Loading%20-%20Option%203.py
</code>```

Title: Json Parsing using pyspark

Body:
I am trying to load a JSON file by providing the schema but still, there is something wrong
and it returns everything as a single row whereas I want to break it into rows

I want it to be displayed as

schema specified code

`https://github.com/umerrkhan/Reference-Code-databricks/blob/main/00%20-%20JSON-%20Loading%20-%20Option%203.py


问:
Where do I need to add `if(chrome.runtime.id == undefined) return;` for Uncaught Error: Extension context invalidated
This post is connected to my previous post. I am creating a Chrome extension. I want to insert text into the Gmail reply field - based on a click. I use MutationObserver for getting the changes and not only the initial HTML. Since I implemented MutationObserver I get the error:

content.js:63 Uncaught Error: Extension context invalidated. at HTMLDocument.<anonymous> (content.js:63:20)

Like its stated here. I tried to insert if (chrome.runtime.id == undefined) return; for avoiding the error. But it's not working. Where do I need to add the insert if (chrome.runtime.id == undefined) return;?

content.js

document.addEventListener("click", (event) => {
  if (event.target.innerText == "Reply") {
    const element = document.querySelector(".a3s.aiL");
    const textContent = element.textContent;
    const allElements = document.querySelectorAll("*");
    const observer = new MutationObserver((mutations) => {
      const insertField = allElements.forEach((element) => {
        if (element.classList.contains("aO7")) {
          console.log("found it");
        }
      });
    });

    observer.observe(document.body, {
      attributes: true,
      childList: true,
      subtree: true,
    });

    chrome.runtime.sendMessage({
      type: "click_event",
    });
  }
});
```
<p><strong>background.js</strong></p>
<pre class="lang-js prettyprint-override"><code>chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
  if (request.type == "click_event") {
    console.log("click event captured in current webpage");
  }
});
</code>```

Body:
This post is connected to my previous post. I am creating a Chrome extension. I want to insert text into the Gmail reply field - based on a click. I use MutationObserver for getting the changes and not only the initial HTML. Since I implemented MutationObserver I get the error:

content.js:63 Uncaught Error: Extension context invalidated. at HTMLDocument.<anonymous> (content.js:63:20)

Like its stated here. I tried to insert if (chrome.runtime.id == undefined) return; for avoiding the error. But it's not working. Where do I need to add the insert if (chrome.runtime.id == undefined) return;?

content.js

document.addEventListener("click", (event) => {
  if (event.target.innerText == "Reply") {
    const element = document.querySelector(".a3s.aiL");
    const textContent = element.textContent;
    const allElements = document.querySelectorAll("*");
    const observer = new MutationObserver((mutations) => {
      const insertField = allElements.forEach((element) => {
        if (element.classList.contains("aO7")) {
          console.log("found it");
        }
      });
    });

    observer.observe(document.body, {
      attributes: true,
      childList: true,
      subtree: true,
    });

    chrome.runtime.sendMessage({
      type: "click_event",
    });
  }
});

background.js

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
  if (request.type == "click_event") {
    console.log("click event captured in current webpage");
  }
});


问:
Can Frida track any memory read/write access on X86?
I'm currently trying to implement a custom function that can track any memory read/write access on X86 assembly code. I've been browsing and searching around the Frida document or any examples for a while, but I didn't see anything similar.

Could any one please let me know how can I use Frida to do this? Thanks!


问:
How would you go about using 'wheel event' to detect what percentage the user has scrolled in a certain element?
I want to detect a percentage of a element scrolled through so to speak and record the minimum value scrolled, current value of what's scrolled and maxiumum value of what's scrolled. At the moment I have a set of images assigned to a track via html and have them positioned adjacent to eachother via css.

```<code><html>
    <head>
        <title>Parallax</title>
        <link rel = "stylesheet" href = "css/style.css"> <!--linking css to html-->
        <script defer src = "js/main.js"></script>  <!--added defer-->
    </head>

    <body> <!--Container for all of the images + set draggable to false because default behaviour means you would just pick up the image-->
       <div id="image-track" data-mouse-down-at="0" data-prev-percentage="0">
        <img class="image" src="https://images.unsplash.com/photo-1539002848952-aeb10e58c2ef?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=871&q=80" draggable="false" />
        <img class="image" src="https://images.unsplash.com/photo-1509175593937-1c8ea89aa049?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80" draggable="false" />
        <img class="image" src="https://images.unsplash.com/photo-1477088139840-0f0a9cb47cce?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80" draggable="false" />
        <img class="image" src="https://images.unsplash.com/photo-1508162942367-e4dd4cd67513?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80" draggable="false" />
      </div>
    </body>
</html>
</code>```
```<code>body { /*this body is just setting a black background + removing any scroll-bars */
    height: 100vh;
    width: 100vw;
    background-color: rgb(0, 0, 0);
    margin: 0rem;
    overflow: hidden;
    position: relative;
  }

  #image-track > .image { /*giving images a set height + aspect ratio + center*/
    width: 40vmin;
    height: 56vmin;
    object-fit: cover;
    object-position: 100% center;
  }

  #image-track { /*actually putting all of the images next to each other*/
    display: flex;
    gap: 4vmin;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(0%, -50%);
    user-select: none; /* -- prevent image highlighting -- */
  }
</code>```

I've tried to detect any mouse movement and recording it to "minDelta, maxDelta, and currentDelta"

```<code>const track = document.getElementById("image-track");

const handleOnUp = () => {
  track.dataset.deltaY = "0";
  track.dataset.prevPercentage = track.dataset.percentage;
}

const currentDelta = parseFloat(track.dataset.deltaY)
        maxDelta = window.innerWidth / 2; //calculates max distance that can be traveled (50% of the webpage)

const percentage = (currentDelta / maxDelta) * -100, //constantly gather the progress of how much the "slider" has moved, i.e 30/50, 56/50, etc.
        nextPercentageUnconstrained = parseFloat(track.dataset.prevPercentage) + percentage,
        nextPercentage = Math.max(Math.min(nextPercentageUnconstrained, 0), -100);

track.animate({
    transform: `translate(${nextPercentage}%, -50%)`
    }, { duration: 1200, fill: "forwards" })
</code>```

There's a very good chance that 'wheel event' is being used incorrectly but I am also struggling to figure out how else it may be used. (I'm attempting to use it in a similar sense to a 'mousedown' event at this moment in time.

Body:
I want to detect a percentage of a element scrolled through so to speak and record the minimum value scrolled, current value of what's scrolled and maxiumum value of what's scrolled. At the moment I have a set of images assigned to a track via html and have them positioned adjacent to eachother via css.

        <title>Parallax</title>
        <link rel = "stylesheet" href = "css/style.css">

body { /*this body is just setting a black background + removing any scroll-bars */
    height: 100vh;
    width: 100vw;
    background-color: rgb(0, 0, 0);
    margin: 0rem;
    overflow: hidden;
    position: relative;
  }

  #image-track > .image { /*giving images a set height + aspect ratio + center*/
    width: 40vmin;
    height: 56vmin;
    object-fit: cover;
    object-position: 100% center;
  }

  #image-track { /*actually putting all of the images next to each other*/
    display: flex;
    gap: 4vmin;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(0%, -50%);
    user-select: none; /* -- prevent image highlighting -- */
  }

I've tried to detect any mouse movement and recording it to "minDelta, maxDelta, and currentDelta"

const track = document.getElementById("image-track");

const handleOnUp = () => {
  track.dataset.deltaY = "0";
  track.dataset.prevPercentage = track.dataset.percentage;
}

const currentDelta = parseFloat(track.dataset.deltaY)
        maxDelta = window.innerWidth / 2; //calculates max distance that can be traveled (50% of the webpage)

const percentage = (currentDelta / maxDelta) * -100, //constantly gather the progress of how much the "slider" has moved, i.e 30/50, 56/50, etc.
        nextPercentageUnconstrained = parseFloat(track.dataset.prevPercentage) + percentage,
        nextPercentage = Math.max(Math.min(nextPercentageUnconstrained, 0), -100);

track.animate({
    transform: `translate(${nextPercentage}%, -50%)`
    }, { duration: 1200, fill: "forwards" })

There's a very good chance that 'wheel event' is being used incorrectly but I am also struggling to figure out how else it may be used. (I'm attempting to use it in a similar sense to a 'mousedown' event at this moment in time.


问:
Unwanted space after footer when using a container with a large scroll in the body
I have this interface

It is composed of an accordion with a container that has a large list of items and, therefore, a scrollbar. After the accordion, there is a big notice and then the footer. I notice that when the container has so many items, there is a space after the footer. However, when I remove the scrollbar while keeping all the items (i.e., a very large container), the space after the footer disappears, and then the footer is the very last element of the page.
I have created 2 fiddles to reproduce the problem

https://jsfiddle.net/3rmjh9p7/ - here, there is a scrollbar and an unwanted space after the footer

https://jsfiddle.net/5g087fxs/ - exactly the same code but no scrollbar and no space after the footer.

Since all the items in the container take too much space to write, I will write below the skeleton of the page without the items, please check the jsfiddle links above for the full minimal code example.

I want to have the scrollbar, but I don't want to have the space after the footer. I haven't been able to fix it, but I believe the scrollbar is not properly created, and somehow there is a hidden overflow I don't see. Does anybody have any pointers?

Thank you!

```<code><!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>

<body>
    <div class="row mt-4 mt-md-0 mb-4">
        <div class="accordion" id="accordionExample">
            <div class="accordion-item">
                <h2 class="accordion-header" id="headingOne">
                    <button v-on:click="changeInputMode()" id="btn_collapseOne" class="accordion-button" type="button"
                        data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true"
                        aria-controls="collapseOne">
                        Lorem ipsum dolor:
                    </button>
                </h2>
                <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne"
                    data-bs-parent="#accordionExample">
                    <div class="accordion-body">
                        <div class="bg-light border rounded shadow mb-3 w-100 p-3">
                            <div class="container">
                                <div class="row align-items-center mb-2 ">

                                    <div class="container text-center" style="height: 20em; overflow-y: auto;">
                                        <div class="row row-cols-1 row-cols-sm-2 row-cols-md-4">

                                            <div class="col mb-2">
                                                <div class="d-flex flex-wrap w-100 h-100">
                                                    <input type="checkbox" id="b" class="btn-check" value="b">
                                                    <label
                                                        class="btn btn-outline-primary d-flex align-middle align-items-center justify-content-center w-100 h-100">
                                                        <span class="text-break">Lorem ipsum dolor<br><small
                                                                class="text-muted">Lorem ipsum</small></span>
                                                    </label>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</body>

<footer class="py-3 bg-light border-top">
    <div class="container">
        <ul class="nav justify-content-center">
            <li class="nav-item">Lorem ipsum dolor</li>
        </ul>
    </div>
    <div class="container my-3">
        <ul class="nav justify-content-center">
            <li class="nav-item">Lorem ipsum dolor</li>
        </ul>
    </div>
</footer>
</html>
</code>```

Body:
I have this interface

It is composed of an accordion with a container that has a large list of items and, therefore, a scrollbar. After the accordion, there is a big notice and then the footer. I notice that when the container has so many items, there is a space after the footer. However, when I remove the scrollbar while keeping all the items (i.e., a very large container), the space after the footer disappears, and then the footer is the very last element of the page.
I have created 2 fiddles to reproduce the problem

https://jsfiddle.net/3rmjh9p7/ - here, there is a scrollbar and an unwanted space after the footer

https://jsfiddle.net/5g087fxs/ - exactly the same code but no scrollbar and no space after the footer.

Since all the items in the container take too much space to write, I will write below the skeleton of the page without the items, please check the jsfiddle links above for the full minimal code example.

I want to have the scrollbar, but I don't want to have the space after the footer. I haven't been able to fix it, but I believe the scrollbar is not properly created, and somehow there is a hidden overflow I don't see. Does anybody have any pointers?

Thank you!

<!doctype html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap demo</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">

                    <button v-on:click="changeInputMode()" id="btn_collapseOne" class="accordion-button" type="button"
                        data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true"
                        aria-controls="collapseOne">
                        Lorem ipsum dolor:
                    </button>

                                                    <input type="checkbox" id="b" class="btn-check" value="b">

                                                        Lorem ipsum dolor
Lorem ipsum

Lorem ipsum dolor

Lorem ipsum dolor


问:
Error while trying to deploy in Vercel, differs from file name
I am trying to deploy in Vercel, but I get the next error:

```<code>TS1261: Already included file name '/vercel/path0/src/components/Cell/Cell.tsx' differs from file name '/vercel/path0/src/components/cell/Cell.tsx' only in casing.
</code>```

The thing is that in my files it's spelled correctly, and I don't know why Vercel has one right, the first one, and then out of nowhere appears the second that differs from the first because of cell and not Cell

This is how I'm importing in my files

import Cell, { CELL_HEIGTH, CELL_WIDTH } from "../Cell/Cell";
```

Body:
I am trying to deploy in Vercel, but I get the next error:

TS1261: Already included file name '/vercel/path0/src/components/Cell/Cell.tsx' differs from file name '/vercel/path0/src/components/cell/Cell.tsx' only in casing.

The thing is that in my files it's spelled correctly, and I don't know why Vercel has one right, the first one, and then out of nowhere appears the second that differs from the first because of cell and not Cell

This is how I'm importing in my files

import Cell, { CELL_HEIGTH, CELL_WIDTH } from "../Cell/Cell";


问:
Kafka container on local Kubernetes for integration tests - crashing or not accessible
I am setting up integration tests that need a brand new kafka container for other containers to talk to.  I don't want to connect to an existing cluster and will tear this down the moment the integration tests are done.

I have a docker-compose file that does this, and having the ability to spin up an entire microservice whose containers can all connect to a brand new broker is great.  This is an excerpt from that docker-compose file for zookeeper and the broker:

```<code>  zookeeper:
    image: wurstmeister/zookeeper
    ports:
      - "2181:2181"

  kafka:
    image: wurstmeister/kafka:2.11-0.10.2.2
    environment:
      - KAFKA_CREATE_TOPICS="newproj:1:1,newprojres:1:1,chproj:1:1,chprojres:1:1"
      - KAFKA_LISTENERS=internal_listener://kafka:9092,external_listener://kafka:29092
      - KAFKA_ADVERTISED_LISTENERS=internal_listener://kafka:9092,external_listener://localhost:29092
      - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=internal_listener:PLAINTEXT,external_listener:PLAINTEXT
      - KAFKA_INTER_BROKER_LISTENER_NAME=internal_listener
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_NUM_PARTITIONS=6
    ports:
      - 29092:29092
</code>```

You'll notice that I call the container "kafka", and that docker will resolve kafka:9092 so that any containers that need to communicate to the broker can be configured with that value.

When I try to do this in kubernetes, the Kafka broker throws an exception and shuts down.  With kubernetes, I have to create a deployment and service.  I call the service kafkaservice (you can't use kafka or the broker will throw an error, and I noticed that you can't use dashes in the name either, even though I've seen examples online of people saying it works). I have tried a lot of variations on the service, but the end result is always the same.  The broker throws this exception and shuts down:

```<code>Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
kafka.common.KafkaException: Socket server failed to bind to kafkaservice:9092: Address not available.
</code>```

Newer brokers get this exception:

```<code>Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.kafka.common.KafkaException: Socket server failed to bind to kafkaservice:9092: Cannot assign requested address.
        at kafka.network.Acceptor.openServerSocket(SocketServer.scala:667)
        at kafka.network.Acceptor.<init>(SocketServer.scala:560)
        at kafka.network.SocketServer.createAcceptor(SocketServer.scala:288)
        at kafka.network.SocketServer.$anonfun$createDataPlaneAcceptorsAndProcessors$1(SocketServer.scala:261)
        at kafka.network.SocketServer.$anonfun$createDataPlaneAcceptorsAndProcessors$1$adapted(SocketServer.scala:259)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:919)
        at kafka.network.SocketServer.createDataPlaneAcceptorsAndProcessors(SocketServer.scala:259)
        at kafka.network.SocketServer.startup(SocketServer.scala:131)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:285)
        at kafka.Kafka$.main(Kafka.scala:109)
        at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.BindException: Cannot assign requested address
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Unknown Source)
        at java.base/sun.nio.ch.Net.bind(Unknown Source)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at kafka.network.Acceptor.openServerSocket(SocketServer.scala:663)
</code>```

I have tried configuring the broker with kafkaservice as the listener.  I have also tried variations on no name or IP, 0.0.0.0, and using different values for KAFKA_LISTENERS and KAFKA_ADVERTISED_LISTENERS.  I have tried a target ports and node ports.  If I use no IP, localhost, 127.0.0.1, or 0.0.0.0, the broker will be fine but never allow containers to connect, though I can telnet into the port.  If I name the connection with kafkaservice, it says that it cannot assign the address and shuts down.

I have tried a lot of different configurations, but here is an example yaml for deployment/service (just for kafka and zookeeper):

```<code>---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.26.1 (a9d05d509)
  creationTimestamp: null
  labels:
    io.kompose.service: zookeeper
  name: zookeeperservice
spec:
  type: NodePort
  ports:
    - name: "2181"
      port: 2181
      nodePort: 30181
  selector:
    io.kompose.service: zookeeper
status:
  loadBalancer: {}

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.26.1 (a9d05d509)
  creationTimestamp: null
  labels:
    io.kompose.service: kafkaservice
  name: kafkaservice
spec:
  #externalTrafficPolicy: Local
  type: NodePort
  ports:
    - name: "9092"
      port: 9092
      nodePort: 30092
  selector:
    io.kompose.service: kafka-deployment
status:
  loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.26.1 (a9d05d509)
  creationTimestamp: null
  labels:
    io.kompose.service: zookeeper
  name: zookeeper
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: zookeeper
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.26.1 (a9d05d509)
      creationTimestamp: null
      labels:
        io.kompose.service: zookeeper
    spec:
      containers:
        - image: wurstmeister/zookeeper
          name: zookeeper
          ports:
            - containerPort: 2181
            - containerPort: 30181
          resources: {}
      restartPolicy: Always
      imagePullSecrets:
        - name: regcred
status: {}

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kafka-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: kafka-deployment
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.26.1 (a9d05d509)
      creationTimestamp: null
      labels:
        io.kompose.service: kafka-deployment
    spec:
      containers:
        - env:
            - name: KAFKA_ZOOKEEPER_CONNECT
              value: zookeeperservice:2181
            - name: KAFKA_LISTENERS
              value: INTERNAL://kafkaservice:9092,EXTERNAL://:30092
            - name: KAFKA_ADVERTISED_LISTENERS
              value: INTERNAL://kafkaservice:9092,EXTERNAL://localhost:30092
            - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
              value: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
            - name: KAFKA_INTER_BROKER_LISTENER_NAME
              value: INTERNAL
          image: wurstmeister/kafka:2.13-2.8.1
          name: kafka-deployment
          ports:
            - containerPort: 9092
          resources: {}
      restartPolicy: Always
      imagePullSecrets:
        - name: regcred
status: {}

</code>```

Can someone tell me how to get a broker running in kubernetes and listening on a routable address?

Body:
I am setting up integration tests that need a brand new kafka container for other containers to talk to.  I don't want to connect to an existing cluster and will tear this down the moment the integration tests are done.

I have a docker-compose file that does this, and having the ability to spin up an entire microservice whose containers can all connect to a brand new broker is great.  This is an excerpt from that docker-compose file for zookeeper and the broker:

  zookeeper:
    image: wurstmeister/zookeeper
    ports:
      - "2181:2181"

  kafka:
    image: wurstmeister/kafka:2.11-0.10.2.2
    environment:
      - KAFKA_CREATE_TOPICS="newproj:1:1,newprojres:1:1,chproj:1:1,chprojres:1:1"
      - KAFKA_LISTENERS=internal_listener://kafka:9092,external_listener://kafka:29092
      - KAFKA_ADVERTISED_LISTENERS=internal_listener://kafka:9092,external_listener://localhost:29092
      - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=internal_listener:PLAINTEXT,external_listener:PLAINTEXT
      - KAFKA_INTER_BROKER_LISTENER_NAME=internal_listener
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_NUM_PARTITIONS=6
    ports:
      - 29092:29092

You'll notice that I call the container "kafka", and that docker will resolve kafka:9092 so that any containers that need to communicate to the broker can be configured with that value.

When I try to do this in kubernetes, the Kafka broker throws an exception and shuts down.  With kubernetes, I have to create a deployment and service.  I call the service kafkaservice (you can't use kafka or the broker will throw an error, and I noticed that you can't use dashes in the name either, even though I've seen examples online of people saying it works). I have tried a lot of variations on the service, but the end result is always the same.  The broker throws this exception and shuts down:

Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
kafka.common.KafkaException: Socket server failed to bind to kafkaservice:9092: Address not available.

Newer brokers get this exception:

Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.kafka.common.KafkaException: Socket server failed to bind to kafkaservice:9092: Cannot assign requested address.
        at kafka.network.Acceptor.openServerSocket(SocketServer.scala:667)
        at kafka.network.Acceptor.<init>(SocketServer.scala:560)
        at kafka.network.SocketServer.createAcceptor(SocketServer.scala:288)
        at kafka.network.SocketServer.$anonfun$createDataPlaneAcceptorsAndProcessors$1(SocketServer.scala:261)
        at kafka.network.SocketServer.$anonfun$createDataPlaneAcceptorsAndProcessors$1$adapted(SocketServer.scala:259)
        at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
        at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:919)
        at kafka.network.SocketServer.createDataPlaneAcceptorsAndProcessors(SocketServer.scala:259)
        at kafka.network.SocketServer.startup(SocketServer.scala:131)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:285)
        at kafka.Kafka$.main(Kafka.scala:109)
        at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.BindException: Cannot assign requested address
        at java.base/sun.nio.ch.Net.bind0(Native Method)
        at java.base/sun.nio.ch.Net.bind(Unknown Source)
        at java.base/sun.nio.ch.Net.bind(Unknown Source)
        at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at java.base/sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at kafka.network.Acceptor.openServerSocket(SocketServer.scala:663)

I have tried configuring the broker with kafkaservice as the listener.  I have also tried variations on no name or IP, 0.0.0.0, and using different values for KAFKA_LISTENERS and KAFKA_ADVERTISED_LISTENERS.  I have tried a target ports and node ports.  If I use no IP, localhost, 127.0.0.1, or 0.0.0.0, the broker will be fine but never allow containers to connect, though I can telnet into the port.  If I name the connection with kafkaservice, it says that it cannot assign the address and shuts down.

I have tried a lot of different configurations, but here is an example yaml for deployment/service (just for kafka and zookeeper):

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.26.1 (a9d05d509)
  creationTimestamp: null
  labels:
    io.kompose.service: zookeeper
  name: zookeeperservice
spec:
  type: NodePort
  ports:
    - name: "2181"
      port: 2181
      nodePort: 30181
  selector:
    io.kompose.service: zookeeper
status:
  loadBalancer: {}

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.26.1 (a9d05d509)
  creationTimestamp: null
  labels:
    io.kompose.service: kafkaservice
  name: kafkaservice
spec:
  #externalTrafficPolicy: Local
  type: NodePort
  ports:
    - name: "9092"
      port: 9092
      nodePort: 30092
  selector:
    io.kompose.service: kafka-deployment
status:
  loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.26.1 (a9d05d509)
  creationTimestamp: null
  labels:
    io.kompose.service: zookeeper
  name: zookeeper
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: zookeeper
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.26.1 (a9d05d509)
      creationTimestamp: null
      labels:
        io.kompose.service: zookeeper
    spec:
      containers:
        - image: wurstmeister/zookeeper
          name: zookeeper
          ports:
            - containerPort: 2181
            - containerPort: 30181
          resources: {}
      restartPolicy: Always
      imagePullSecrets:
        - name: regcred
status: {}

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kafka-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: kafka-deployment
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.26.1 (a9d05d509)
      creationTimestamp: null
      labels:
        io.kompose.service: kafka-deployment
    spec:
      containers:
        - env:
            - name: KAFKA_ZOOKEEPER_CONNECT
              value: zookeeperservice:2181
            - name: KAFKA_LISTENERS
              value: INTERNAL://kafkaservice:9092,EXTERNAL://:30092
            - name: KAFKA_ADVERTISED_LISTENERS
              value: INTERNAL://kafkaservice:9092,EXTERNAL://localhost:30092
            - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
              value: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
            - name: KAFKA_INTER_BROKER_LISTENER_NAME
              value: INTERNAL
          image: wurstmeister/kafka:2.13-2.8.1
          name: kafka-deployment
          ports:
            - containerPort: 9092
          resources: {}
      restartPolicy: Always
      imagePullSecrets:
        - name: regcred
status: {}

Can someone tell me how to get a broker running in kubernetes and listening on a routable address?


问:
How to structure a json with react native
I have this function which execute some queries at local sqlite database and then use the result to create a JSON, which will be send to an API.

```<code>db.transaction(async(tx) => {
  var tempPic = [];
  console.log('Get audits results'+ auditsTosend[0].ID);
  await tx.executeSql('select id, audit_item_id,od,comments,status_id,scanned_code,findings from tb_audits where audit_id = ? ', [auditsTosend[0].ID], async (tx, results) =>
  {
    //auditTosend.push(results);
    for (let i = 0; i < results.rows.length; ++i)
    {
      await tx.executeSql('select AUDIT_ID,PICTURE_URI from tb_AuditPictures where audit_ID =?', [results.rows.item(i).ID], async(tx, resultsPic) =>
      {
          console.log('Pictures Result inside full audit:' + resultsPic.rows.length +' for item:'+results.rows.item(i).ID);
          if (resultsPic.rows.length > 0)
          {
            for (let i = 0; i < resultsPic.rows.length; ++i)
            {
              tempPic.push(resultsPic.rows.item(i));
              console.log('Inside resultsPic.rows.length > 0'+ tempPic[i].PICTURE_URI);
              auditPictures = await RNFS.readFile( tempPic[i].PICTURE_URI, 'base64').then(res => { return res });
              Picture.content = auditPictures;
              auditItemToSend.push(Picture);
              console.log('ITEM WITH PICTURE:'+JSON.stringify(auditItemToSend));
            }
          }
      });
      auditItemToSend.push(results.rows.item(i));
    }
    auditHeader.push(auditItemToSend);
    console.log('stringFy headerItem:' + JSON.stringify(auditHeader));
  });  });
</code>```

I have a Header, then some Items and pictures inside items. Not all items have pictures.
I want to set the JSON like this : [Header {Item  {Picture Item}}], with the pictures as an property inside the Item. But what I am receiving is this:

```<code>[{"AREA":"AREA DESC","CHECKLIST_ID":5,"USER_ID":"TIAGO AUGUSTO MARTINS","AUDIT_DATE":"2022-12-7 8:59:12","ADDITIONAL_INFO":null,"AUDIT_END_DATE":"2022-12-7 8:59:12","FGI_NUMBER":"3AMMMAB","STATUS":"Completed","PO_NUMBER":"140922","ID":4234},[{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131308,"OD":1,"AUDIT_ITEM_ID":12},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131309,"OD":3,"AUDIT_ITEM_ID":13},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131310,"OD":1,"AUDIT_ITEM_ID":14},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131311,"OD":1,"AUDIT_ITEM_ID":15},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131312,"OD":1,"AUDIT_ITEM_ID":16},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131313,"OD":5,"AUDIT_ITEM_ID":33},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131314,"OD":5,"AUDIT_ITEM_ID":34},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131315,"OD":5,"AUDIT_ITEM_ID":35},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131316,"OD":5,"AUDIT_ITEM_ID":36},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131317,"OD":5,"AUDIT_ITEM_ID":37},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131318,"OD":5,"AUDIT_ITEM_ID":38},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131319,"OD":5,"AUDIT_ITEM_ID":39},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131320,"OD":5,"AUDIT_ITEM_ID":39},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131321,"OD":5,"AUDIT_ITEM_ID":40},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131322,"OD":5,"AUDIT_ITEM_ID":41},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131323,"OD":5,"AUDIT_ITEM_ID":42},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131324,"OD":5,"AUDIT_ITEM_ID":43}]]
</code>```

And what I need is something like this:

```<code>[{
  "AREA":"AREA DESC",
  "CHECKLIST_ID":5,
  "USER_ID":"TIAGO AUGUSTO MARTINS",
  "AUDIT_DATE":"2022-12-7 8:59:12",
  "ADDITIONAL_INFO":null,
  "AUDIT_END_DATE":"2022-12-7 8:59:12",
  "FGI_NUMBER":"3AMMMAB",
  "STATUS":"Completed",
  "PO_NUMBER":"140922",
  "ID":4234 },[{
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131308,
     "OD":1,
     "AUDIT_ITEM_ID":12
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131309,
     "OD":3,
     "AUDIT_ITEM_ID":13
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131310,
     "OD":1,
     "AUDIT_ITEM_ID":14
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131311,
     "OD":1,
     "AUDIT_ITEM_ID":15
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131312,
     "OD":1,
     "AUDIT_ITEM_ID":16
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131313,
     "OD":5,
     "AUDIT_ITEM_ID":33
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131314,
     "OD":5,
     "AUDIT_ITEM_ID":34
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131315,
     "OD":5,
     "AUDIT_ITEM_ID":35
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131316,
     "OD":5,
     "AUDIT_ITEM_ID":36
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131317,
     "OD":5,
     "AUDIT_ITEM_ID":37
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131318,
     "OD":5,
     "AUDIT_ITEM_ID":38
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131319,
     "OD":5,
     "AUDIT_ITEM_ID":39
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131320,
     "OD":5,
     "AUDIT_ITEM_ID":39
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131321,
     "OD":5,
     "AUDIT_ITEM_ID":40
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131322,
     "OD":5,
     "AUDIT_ITEM_ID":41
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131323,
     "OD":5,
     "AUDIT_ITEM_ID":42
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131324,
     "OD":5,
     "AUDIT_ITEM_ID":43,
     "content":"/9j/4QBqRXhpZgAATU0AKgAAAAgABAEAAAQAAAABAAAB9AEBAAQAAAABAAABOIdpAAQAAAABAAAAPgESAAMAAAABAAYAAAAAAAAAAZIIAAQAAAABAAAAAAAAAAAAAQESAAMAAAABAAYAAAAAAAD/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/bAEMA///////////////////////////////////////////////////////////////////////////////////////bAEMB///////////////////////////////////////////////////////////////////////////////////////AABEIATgB9AMBIgACEQEDEQH/xAAVAAEBAAAAAAAAAAAAAAAAAAAAA//EABQQAQAAAAAAAAAAAAAAAAAAAAD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//Z"
  }   ]]
</code>```

The JSON is generated without the pictures, someone can point what I am doing wrong?

Body:
I have this function which execute some queries at local sqlite database and then use the result to create a JSON, which will be send to an API.

db.transaction(async(tx) => {
  var tempPic = [];
  console.log('Get audits results'+ auditsTosend[0].ID);
  await tx.executeSql('select id, audit_item_id,od,comments,status_id,scanned_code,findings from tb_audits where audit_id = ? ', [auditsTosend[0].ID], async (tx, results) =>
  {
    //auditTosend.push(results);
    for (let i = 0; i < results.rows.length; ++i)
    {
      await tx.executeSql('select AUDIT_ID,PICTURE_URI from tb_AuditPictures where audit_ID =?', [results.rows.item(i).ID], async(tx, resultsPic) =>
      {
          console.log('Pictures Result inside full audit:' + resultsPic.rows.length +' for item:'+results.rows.item(i).ID);
          if (resultsPic.rows.length > 0)
          {
            for (let i = 0; i < resultsPic.rows.length; ++i)
            {
              tempPic.push(resultsPic.rows.item(i));
              console.log('Inside resultsPic.rows.length > 0'+ tempPic[i].PICTURE_URI);
              auditPictures = await RNFS.readFile( tempPic[i].PICTURE_URI, 'base64').then(res => { return res });
              Picture.content = auditPictures;
              auditItemToSend.push(Picture);
              console.log('ITEM WITH PICTURE:'+JSON.stringify(auditItemToSend));
            }
          }
      });
      auditItemToSend.push(results.rows.item(i));
    }
    auditHeader.push(auditItemToSend);
    console.log('stringFy headerItem:' + JSON.stringify(auditHeader));
  });  });

I have a Header, then some Items and pictures inside items. Not all items have pictures.
I want to set the JSON like this : [Header {Item  {Picture Item}}], with the pictures as an property inside the Item. But what I am receiving is this:

[{"AREA":"AREA DESC","CHECKLIST_ID":5,"USER_ID":"TIAGO AUGUSTO MARTINS","AUDIT_DATE":"2022-12-7 8:59:12","ADDITIONAL_INFO":null,"AUDIT_END_DATE":"2022-12-7 8:59:12","FGI_NUMBER":"3AMMMAB","STATUS":"Completed","PO_NUMBER":"140922","ID":4234},[{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131308,"OD":1,"AUDIT_ITEM_ID":12},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131309,"OD":3,"AUDIT_ITEM_ID":13},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131310,"OD":1,"AUDIT_ITEM_ID":14},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131311,"OD":1,"AUDIT_ITEM_ID":15},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131312,"OD":1,"AUDIT_ITEM_ID":16},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131313,"OD":5,"AUDIT_ITEM_ID":33},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131314,"OD":5,"AUDIT_ITEM_ID":34},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131315,"OD":5,"AUDIT_ITEM_ID":35},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131316,"OD":5,"AUDIT_ITEM_ID":36},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131317,"OD":5,"AUDIT_ITEM_ID":37},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131318,"OD":5,"AUDIT_ITEM_ID":38},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131319,"OD":5,"AUDIT_ITEM_ID":39},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131320,"OD":5,"AUDIT_ITEM_ID":39},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131321,"OD":5,"AUDIT_ITEM_ID":40},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131322,"OD":5,"AUDIT_ITEM_ID":41},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131323,"OD":5,"AUDIT_ITEM_ID":42},{"FINDINGS":0,"STATUS_ID":1,"SCANNED_CODE":"","COMMENTS":"","ID":131324,"OD":5,"AUDIT_ITEM_ID":43}]]

And what I need is something like this:

[{
  "AREA":"AREA DESC",
  "CHECKLIST_ID":5,
  "USER_ID":"TIAGO AUGUSTO MARTINS",
  "AUDIT_DATE":"2022-12-7 8:59:12",
  "ADDITIONAL_INFO":null,
  "AUDIT_END_DATE":"2022-12-7 8:59:12",
  "FGI_NUMBER":"3AMMMAB",
  "STATUS":"Completed",
  "PO_NUMBER":"140922",
  "ID":4234 },[{
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131308,
     "OD":1,
     "AUDIT_ITEM_ID":12
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131309,
     "OD":3,
     "AUDIT_ITEM_ID":13
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131310,
     "OD":1,
     "AUDIT_ITEM_ID":14
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131311,
     "OD":1,
     "AUDIT_ITEM_ID":15
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131312,
     "OD":1,
     "AUDIT_ITEM_ID":16
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131313,
     "OD":5,
     "AUDIT_ITEM_ID":33
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131314,
     "OD":5,
     "AUDIT_ITEM_ID":34
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131315,
     "OD":5,
     "AUDIT_ITEM_ID":35
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131316,
     "OD":5,
     "AUDIT_ITEM_ID":36
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131317,
     "OD":5,
     "AUDIT_ITEM_ID":37
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131318,
     "OD":5,
     "AUDIT_ITEM_ID":38
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131319,
     "OD":5,
     "AUDIT_ITEM_ID":39
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131320,
     "OD":5,
     "AUDIT_ITEM_ID":39
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131321,
     "OD":5,
     "AUDIT_ITEM_ID":40
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131322,
     "OD":5,
     "AUDIT_ITEM_ID":41
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131323,
     "OD":5,
     "AUDIT_ITEM_ID":42
  },
  {
     "FINDINGS":0,
     "STATUS_ID":1,
     "SCANNED_CODE":"",
     "COMMENTS":"",
     "ID":131324,
     "OD":5,
     "AUDIT_ITEM_ID":43,
     "content":"/9j/4QBqRXhpZgAATU0AKgAAAAgABAEAAAQAAAABAAAB9AEBAAQAAAABAAABOIdpAAQAAAABAAAAPgESAAMAAAABAAYAAAAAAAAAAZIIAAQAAAABAAAAAAAAAAAAAQESAAMAAAABAAYAAAAAAAD/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/bAEMA///////////////////////////////////////////////////////////////////////////////////////bAEMB///////////////////////////////////////////////////////////////////////////////////////AABEIATgB9AMBIgACEQEDEQH/xAAVAAEBAAAAAAAAAAAAAAAAAAAAA//EABQQAQAAAAAAAAAAAAAAAAAAAAD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//Z"
  }   ]]

The JSON is generated without the pictures, someone can point what I am doing wrong?