问:
How to include slick slider in this gulp build?
I connect slick slider and jquery via cdn and it doesn't work. What to do? I use this build on gulp https://github.com/maxdenaro/youtube-creatix-marathon.
Probably I need to include it in gulpfile.js. But I'm still learning gulp and don't understand how to do it in this build. I would be very grateful for your help.

```<code>**CSS head**
   <link href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"

**JS before the closing body tag**

    <script src="https://code.jquery.com/jquery-3.6.1.js" integrity="sha2563zlB5s2uwoUzrXK3BT7AX3FyvojsraNFxCc2vC/7pNI=" crossorigin="anonymous"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js" integrity="sha512-XtmMtDEcNz2j7ekrtHvOVR4iwwaD6o/FUJe6+Zq+HgcCsk3kj4uSQQR8weQ2QVj1o0Pk6PwYLohm206ZzNfubg==" crossorigin="anonymous"></script>

    $('.js-carousel').slick()

</code>```

it seems like the slider styles should immediately be connected to this class, but there is nothing in the inspector

Sorry, i am not a native speaker

I tried installing slick slider and jquery with

```<code>npm i slick-carousel jquery
</code>```

but that doesn't work either

Body:
I connect slick slider and jquery via cdn and it doesn't work. What to do? I use this build on gulp https://github.com/maxdenaro/youtube-creatix-marathon.
Probably I need to include it in gulpfile.js. But I'm still learning gulp and don't understand how to do it in this build. I would be very grateful for your help.

**CSS head**
   <link href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"

**JS before the closing body tag**

    $('.js-carousel').slick()

it seems like the slider styles should immediately be connected to this class, but there is nothing in the inspector

Sorry, i am not a native speaker

I tried installing slick slider and jquery with

npm i slick-carousel jquery

but that doesn't work either


来源: stackexchange

问:
Bundle custom session manager store in webapp archive (Tomcat 9)
I am trying to add a custom Store for the PersistentManager in Tomcat 9.0.69.

It works no problem by adding my JAR with custom Store to the tomcat/lib directory and specifying a PersistentManager with my custom Store in the context.xml which is bundled with my webapp (META-INF/context.xml). However, I need to avoid adding the JAR to the tomcat/lib directory as this will be deployed in a PaaS environment without write access to that directory.

Ideally I would like to include the JAR containing my custom Store in the webapp WEB-INF/lib alongside its other libraries, and have some way of getting Tomcat to find it when setting up the session manager. As I understand it, by default Tomcat does not find it as it is setting up the session manager in the context of its own ClassLoader, not in the context of the application ClassLoader.

I found a StackOverflow answer which seems to suggest this is achievable by specifying some sort of ClassLoader using a <Loader> element in context.xml but I have no clue where to start with that, and the answer was for Tomcat 7 so I am unsure if it would still be true.

ContentLicense: CC BY-SA 4.0


问:
the date completely changes when I change the date column to date format,
I am trying to do a timeseries analysis on a table with a date. The dates range from 1/1/2008 to 2/24/2008. However, when I try to change to date format using as.date the dates changes to somewhere in 2020.

```<code>summary_data$date <- as.Date(summary_data$date, "%d/%m/%Y")
</code>```

The dates are in mdy format. Summary_data is the name of my table. What am I doing wrong?

Body:
I am trying to do a timeseries analysis on a table with a date. The dates range from 1/1/2008 to 2/24/2008. However, when I try to change to date format using as.date the dates changes to somewhere in 2020.

summary_data$date <- as.Date(summary_data$date, "%d/%m/%Y")

The dates are in mdy format. Summary_data is the name of my table. What am I doing wrong?


问:
pyuci openwrt package installation fails (how to install libuci in first place?)
Following this link to install pyuci
https://pypi.org/project/pyuci/

```<code>$ sudo pip install pyuci
Collecting pyuci
  Using cached pyuci-0.9.0.tar.gz (33 kB)
Building wheels for collected packages: pyuci
  Building wheel for pyuci (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l1y3wubl/pyuci/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l1y3wubl/pyuci/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().re
place('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-usoi27u_
       cwd: /tmp/pip-install-l1y3wubl/pyuci/
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/euci
  copying euci/__init__.py -> build/lib.linux-x86_64-3.8/euci
  copying euci/boolean.py -> build/lib.linux-x86_64-3.8/euci
  running build_ext
  building 'uci' extension
  creating build/temp.linux-x86_64-3.8
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
 -fPIC -I/usr/include/python3.8 -c ucimodule.c -o build/temp.linux-x86_64-3.8/ucimodule.o
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
 -fPIC -I/usr/include/python3.8 -c pyuci.c -o build/temp.linux-x86_64-3.8/pyuci.o
  pyuci.c:20:10: fatal error: uci.h: No such file or directory
     20 | #include <uci.h>
        |          ^~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyuci
  Running setup.py clean for pyuci
Failed to build pyuci
Installing collected packages: pyuci
    Running setup.py install for pyuci ... error
</code>```

Although I see libuci as one of the requirements in the link I am not sure how to install libuci itself

Appreciate any suggestions and help

My dev environment:
Ubuntu 20.04.3 LTS
Python 3.8.10

Thanks in advance

Body:
Following this link to install pyuci
https://pypi.org/project/pyuci/

$ sudo pip install pyuci
Collecting pyuci
  Using cached pyuci-0.9.0.tar.gz (33 kB)
Building wheels for collected packages: pyuci
  Building wheel for pyuci (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l1y3wubl/pyuci/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l1y3wubl/pyuci/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().re
place('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-usoi27u_
       cwd: /tmp/pip-install-l1y3wubl/pyuci/
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/euci
  copying euci/__init__.py -> build/lib.linux-x86_64-3.8/euci
  copying euci/boolean.py -> build/lib.linux-x86_64-3.8/euci
  running build_ext
  building 'uci' extension
  creating build/temp.linux-x86_64-3.8
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
 -fPIC -I/usr/include/python3.8 -c ucimodule.c -o build/temp.linux-x86_64-3.8/ucimodule.o
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
 -fPIC -I/usr/include/python3.8 -c pyuci.c -o build/temp.linux-x86_64-3.8/pyuci.o
  pyuci.c:20:10: fatal error: uci.h: No such file or directory
     20 | #include <uci.h>
        |          ^~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyuci
  Running setup.py clean for pyuci
Failed to build pyuci
Installing collected packages: pyuci
    Running setup.py install for pyuci ... error

Although I see libuci as one of the requirements in the link I am not sure how to install libuci itself

Appreciate any suggestions and help

My dev environment:
Ubuntu 20.04.3 LTS
Python 3.8.10

Thanks in advance


问:
What are Hydra Fail String from webapp
I got this response from webapp when login failed as Json:

```<code>{
    "result": null,
    "errorCode": "UNKNOWN_ERROR",
    "message": "Bad credentials",
    "responseCode": 400
}
</code>```

How can i put those as Failed string to Hydra parameter (F=...)

Title: What are Hydra Fail String from webapp

Body:
I got this response from webapp when login failed as Json:

{
    "result": null,
    "errorCode": "UNKNOWN_ERROR",
    "message": "Bad credentials",
    "responseCode": 400
}

How can i put those as Failed string to Hydra parameter (F=...)


问:
react dynamic language change in url
i use react, react-router-dom, i18next for internationalization my application.
I want my url to look like this when changing the language: https://sitename.com/en/\*\*\* or https://sitename.com/es/\*\*\*

in general, I can’t even set up the structure of the routes and I don’t understand whether my routes should be children of the main route "/:lang".

withLocalization HOC

app routes

how i can do this?

i tried to do hoc in which i just did window.history.replaceState(***), but this is very bad, because it violates the principles react-router-dom, and also when refreshing the page everything breaks

Title: react dynamic language change in url


问:
What is the math behind the Keras Tokenizer() function?
I would like to know the mathematics behind Tokenizer()

Good morning, first of all I would like to thank you in advance for your answer. I am doing an essay on the mathematics behind a text classifier with NLP and neural networks and I would like to know how exactly the TOKENIZER function of keras works. Whether cosine similarity is involved and how the dictionary creation is carried out taking frequency into account. If anyone knows the answer or a book/article where it is reflected, I will be eternally grateful.


问:
How to use Nodejs build in production mode using babel for my DockerImage
i Have a nodejs application and its working fine but in my structure i dont have a src folder i just have all other files and am using MVC but am having the error
here is my script</p>
```<code>    "scripts": {
    "start": "babel-node server.js",
    "dev": "nodemon --exec npm start",
    "build-babel": "babel -d ./build ./server.js -s",
    "build": "babel ./Myfolder --out-dir dist --copy-files",
    "serve": "node dist/index.js",
    "sequelize": "sequelize"
</code>```

Body:
i Have a nodejs application and its working fine but in my structure i dont have a src folder i just have all other files and am using MVC but am having the error
here is my script

    "scripts": {
    "start": "babel-node server.js",
    "dev": "nodemon --exec npm start",
    "build-babel": "babel -d ./build ./server.js -s",
    "build": "babel ./Myfolder --out-dir dist --copy-files",
    "serve": "node dist/index.js",
    "sequelize": "sequelize"


问:
How to set time manually when @UpdateTimestamp and @CreationTimestamp is used in entity
I am doing data migration from legacy system to my system.

In my application, I have used @UpdateTimestamp and @CreationTimestamp to auto update date time for my entity. this works fine.

When I do data migration from other system, I want create time and last update time should be as it was in legacy system.

This is not happening even if I set time manually in entity. It always takes system time.

Is there any way to disable this auto update for certain call like data migration?


问:
SocketIO 4 - manually try to connect once again if first time doesn't succeed
I have following code for the SocketIO client:

```<code>import { io } from "socket.io-client";

const token = window.localStorage.getItem('TOKEN') || window.sessionStorage.getItem('TOKEN')

const ioSocket = io("xxxx", {
    autoConnect: false,
  'reconnection': true,
  'reconnectionDelay': 500,
  'reconnectionAttempts': 10,
  reconnectionDelayMax: 10000,
  reconnectionAttempts: Infinity,
  transportOptions: {
    polling: {
      extraHeaders: {
        authorization: `${token}`,
      },
    },
  },
});

export const socket = ioSocket
</code>```

Before user is not logged in, token is not available, and when user perform login action, the page is not refreshed (I am using Vue 3 with vue-router), and the connection is never established. Once I manually refresh the page, connection is created. Is there a way to try to connect once again after some period of time?

This is the code I tried to manually connect:

```<code>socket.on("connect", () => {
  console.log(socket.id);
});

onMounted(() => {

  if(!socket.connected)
  {
    socket.connect();
  }

  socket.emit("join", import.meta.env.VITE_SOCKET_ROOM, (message) => {
      console.log(message);
    });
})
</code>```

Body:
I have following code for the SocketIO client:

import { io } from "socket.io-client";

const token = window.localStorage.getItem('TOKEN') || window.sessionStorage.getItem('TOKEN')

const ioSocket = io("xxxx", {
    autoConnect: false,
  'reconnection': true,
  'reconnectionDelay': 500,
  'reconnectionAttempts': 10,
  reconnectionDelayMax: 10000,
  reconnectionAttempts: Infinity,
  transportOptions: {
    polling: {
      extraHeaders: {
        authorization: `${token}`,
      },
    },
  },
});

export const socket = ioSocket

Before user is not logged in, token is not available, and when user perform login action, the page is not refreshed (I am using Vue 3 with vue-router), and the connection is never established. Once I manually refresh the page, connection is created. Is there a way to try to connect once again after some period of time?

This is the code I tried to manually connect:

socket.on("connect", () => {
  console.log(socket.id);
});

onMounted(() => {

  if(!socket.connected)
  {
    socket.connect();
  }

  socket.emit("join", import.meta.env.VITE_SOCKET_ROOM, (message) => {
      console.log(message);
    });
})


问:
Serial number or Auto Increment number is getting sorted
I have a react-datatable in which i am having first column as auto increment, But when i filter the other column serial number column is also getting changed.

Before

After

I want serial number always be serialized

Code for datatable column is as followed

```<code>const columns = [
{
  name: "#",
  selector: (row) => row.index,
  sortable: true,
  maxWidth: 50,
  minWidth: 50,
},
{
  name: "Name",
  selector: (row) => row.lo_name,
  sortable: true,
},
];
</code>```

Body:
I have a react-datatable in which i am having first column as auto increment, But when i filter the other column serial number column is also getting changed.

Before

After

I want serial number always be serialized

Code for datatable column is as followed

const columns = [
{
  name: "#",
  selector: (row) => row.index,
  sortable: true,
  maxWidth: 50,
  minWidth: 50,
},
{
  name: "Name",
  selector: (row) => row.lo_name,
  sortable: true,
},
];


问:
Why does HTML's select onchange cause a TypeError on its second change?
This is my first time building a website, so far its almost ready to go, but for some reason when I try to change a dropdown menu to trigger a function, it works as expected on the first time but not the second?

My html code:

```<code><select onchange="list();" id="listSelect">
    <option disabled selected value> -- Select a list -- </option>
    <option value="list1">Item 1</option>
    <option value="list2">Item 2</option>
</select>

<p id="randomItem">(choose a list first)</p>

<iframe id="list" src="(REDACTED)"></iframe>
</code>```

And my javascript code:

```<code>async function list() {
    list = document.getElementById("listSelect").value;
    if (list.length == 0) {
        alert("You need to choose a list first!");
        return;
    }
    document.getElementById('list').src="(REDACTED)" + list;
    randomItem();
}

async function randomItem() {
    list = document.getElementById("listSelect").value;
    if (list.length == 0) {
        alert("You need to choose a list first!");
        return;
    }
    const response = await fetch("(REDACTED)" + list, {
        method: 'GET',
        mode: 'cors',
        cache: 'no-cache',
        credentials: 'same-origin',
        headers: {
            'Content-Type': 'application/json'
        },
        redirect: 'follow', // manual, \*follow, error
        referrerPolicy: 'no-referrer',
    });
    const json = await response.json();
    var item = json\[Math.floor(Math.random()\*json.length)\];
    document.getElementById("randomItem").innerHTML = item;
}
</code>```

Expected outcome: When the select menu's value has changed, it will update the iframe "list" and update the p "randomItem"
Actual outcome: Expected outcome occurs on the first time the value changes, but throws

```<code>Uncaught TypeError: list is not a function
at HTMLSelectElement.onchange ((index):23:50)
onchange @ (index):23
</code>```

in the console on each consecutive attempt.

Body:
This is my first time building a website, so far its almost ready to go, but for some reason when I try to change a dropdown menu to trigger a function, it works as expected on the first time but not the second?

My html code:

<select onchange="list();" id="listSelect">
    <option disabled selected value> -- Select a list -- </option>
    <option value="list1">Item 1</option>
    <option value="list2">Item 2</option>
</select>

(choose a list first)

And my javascript code:

async function list() {
    list = document.getElementById("listSelect").value;
    if (list.length == 0) {
        alert("You need to choose a list first!");
        return;
    }
    document.getElementById('list').src="(REDACTED)" + list;
    randomItem();
}

async function randomItem() {
    list = document.getElementById("listSelect").value;
    if (list.length == 0) {
        alert("You need to choose a list first!");
        return;
    }
    const response = await fetch("(REDACTED)" + list, {
        method: 'GET',
        mode: 'cors',
        cache: 'no-cache',
        credentials: 'same-origin',
        headers: {
            'Content-Type': 'application/json'
        },
        redirect: 'follow', // manual, \*follow, error
        referrerPolicy: 'no-referrer',
    });
    const json = await response.json();
    var item = json\[Math.floor(Math.random()\*json.length)\];
    document.getElementById("randomItem").innerHTML = item;
}

Expected outcome: When the select menu's value has changed, it will update the iframe "list" and update the p "randomItem"
Actual outcome: Expected outcome occurs on the first time the value changes, but throws

Uncaught TypeError: list is not a function
at HTMLSelectElement.onchange ((index):23:50)
onchange @ (index):23

in the console on each consecutive attempt.


问:
The client has disconnected; The specified network name is no longer available. (0x80070040)
I have noticed in the log file the following exception The client has disconnected. The possibility is very rare- ~3 times in a week so its hard to reproduce. Application runs on IIS windows server 2019.

The middleware witch handles exception:

```<code>    public class RequestHandlingMiddleware
    {
        private readonly RequestDelegate _next;
        public RequestHandlingMiddleware
            (RequestDelegate next)
        {
            _next = next;
        }

        public async Task InvokeAsync(HttpContext httpContext, IWallesterLogger logger)
        {
            try
            {
                await _next(httpContext); //<- This line throws an exception

                var rawRequestBody = await (new StreamReader(httpContext.Request.Body).ReadToEndAsync());

                await logger.Log(WallesterLogSection.RequestInfoLog, httpContext.Request.Path.Value,
                     new
                     {
                         httpContext.Request.Path.Value,
                         httpContext.Request.Method,
                         rawRequestBody,
                         httpContext.Request.Headers
                     }
                    );
            }
            catch (Exception ex)
            {
                await HandleExceptionAsync(httpContext, ex, logger);
                throw;
            }
        }
        private async Task HandleExceptionAsync
                                (HttpContext context, Exception exception, IWallesterLogger logger)
        {
            await logger.Log(exception, WallesterLogSection.Exception);
        }

    }

    // Extension method used to add the middleware to the HTTP request pipeline.
    public static class LoggerkMiddlewareExtensions
    {
        public static IApplicationBuilder UseLoggerMiddleware(this IApplicationBuilder builder)
        {

            return builder.UseMiddleware<RequestHandlingMiddleware>();
        }
    }
</code>```

Program.cs:

```<code>// Add services to the container.
var mocking = builder.Configuration.GetValue<bool>("Mocking");
var MockingDb = builder.Configuration.GetValue<bool>("MockingDb");
if (MockingDb)
{
    builder.Services.AddDbContext<ApplicationDbContext>(x => x.UseInMemoryDatabase(databaseName: "ApplicationDb"));
}
else
{
    var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
    builder.Services.AddDbContext<ApplicationDbContext>(options =>
        options.UseSqlServer(connectionString));
}

builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>();
builder.Services.AddDatabaseDeveloperPageExceptionFilter();

builder.Services.AddControllersWithViews();

builder.Services.AddSingleton<IConfiguration>(builder.Configuration);

builder.Services.AddMemoryCache();
builder.Logging.ClearProviders();
builder.Logging.AddConsole();

var logger = new LoggerConfiguration()
    .ReadFrom.Configuration(builder.Configuration)
    .WriteTo.File($"logs/{DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss")}-logs.txt", rollingInterval: RollingInterval.Day)
    .Enrich.FromLogContext()
    .CreateLogger();

builder.Logging.AddSerilog(logger);

var app = builder.Build();
app.UseDeveloperExceptionPage();
app.UseStaticFiles();
app.UseLoggerMiddleware(); // <- add middleware logger
app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");
app.MapRazorPages();

app.Run();
</code>```

And the controller action it tried to reach looks like this:

```<code>[HttpPost("event")]
        public async Task<IActionResult> PostEvent(
            [FromBody] object obj)
</code>```

Full exception callstack:

```<code>Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected
 ---> System.Runtime.InteropServices.COMException (0x80070040): The specified network name is no longer available. (0x80070040)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Server.IIS.Core.IO.AsyncIOOperation.GetResult(Int16 token)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ReadBody()
   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ReadAsync(Memory`1 memory, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.IIS.Core.HttpRequestStream.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
   at System.Text.Json.JsonSerializer.ReadFromStreamAsync(Stream utf8Json, ReadBufferState bufferState, CancellationToken cancellationToken)
   at System.Text.Json.JsonSerializer.ReadAllAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
   at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder.BindModelAsync(ModelBindingContext bindingContext)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value, Object container)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at WebApp.Middleware.RequestHandlingMiddleware.InvokeAsync(HttpContext httpContext, IWallesterLogger logger) in C:\Projects\Pasts\PNS\Wallester\WebApp\Middleware\RequestHandlingMiddleware.cs:line 19
   at WebApp.Middleware.RequestHandlingMiddleware.InvokeAsync(HttpContext httpContext, IWallesterLogger logger) in C:\Projects\Pasts\PNS\Wallester\WebApp\Middleware\RequestHandlingMiddleware.cs:line 44
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
</code>```

From the callstack line:19 is code in the middleware await _next(httpContext); and line:44 is throw command in the catch block.

My question would be what could cause this error, and is there anything we could change to fix it?

Body:
I have noticed in the log file the following exception The client has disconnected. The possibility is very rare- ~3 times in a week so its hard to reproduce. Application runs on IIS windows server 2019.

The middleware witch handles exception:

    public class RequestHandlingMiddleware
    {
        private readonly RequestDelegate _next;
        public RequestHandlingMiddleware
            (RequestDelegate next)
        {
            _next = next;
        }

        public async Task InvokeAsync(HttpContext httpContext, IWallesterLogger logger)
        {
            try
            {
                await _next(httpContext); //<- This line throws an exception

                var rawRequestBody = await (new StreamReader(httpContext.Request.Body).ReadToEndAsync());

                await logger.Log(WallesterLogSection.RequestInfoLog, httpContext.Request.Path.Value,
                     new
                     {
                         httpContext.Request.Path.Value,
                         httpContext.Request.Method,
                         rawRequestBody,
                         httpContext.Request.Headers
                     }
                    );
            }
            catch (Exception ex)
            {
                await HandleExceptionAsync(httpContext, ex, logger);
                throw;
            }
        }
        private async Task HandleExceptionAsync
                                (HttpContext context, Exception exception, IWallesterLogger logger)
        {
            await logger.Log(exception, WallesterLogSection.Exception);
        }

    }

    // Extension method used to add the middleware to the HTTP request pipeline.
    public static class LoggerkMiddlewareExtensions
    {
        public static IApplicationBuilder UseLoggerMiddleware(this IApplicationBuilder builder)
        {

            return builder.UseMiddleware<RequestHandlingMiddleware>();
        }
    }

Program.cs:

// Add services to the container.
var mocking = builder.Configuration.GetValue<bool>("Mocking");
var MockingDb = builder.Configuration.GetValue<bool>("MockingDb");
if (MockingDb)
{
    builder.Services.AddDbContext<ApplicationDbContext>(x => x.UseInMemoryDatabase(databaseName: "ApplicationDb"));
}
else
{
    var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
    builder.Services.AddDbContext<ApplicationDbContext>(options =>
        options.UseSqlServer(connectionString));
}

builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>();
builder.Services.AddDatabaseDeveloperPageExceptionFilter();

builder.Services.AddControllersWithViews();

builder.Services.AddSingleton<IConfiguration>(builder.Configuration);

builder.Services.AddMemoryCache();
builder.Logging.ClearProviders();
builder.Logging.AddConsole();

var logger = new LoggerConfiguration()
    .ReadFrom.Configuration(builder.Configuration)
    .WriteTo.File($"logs/{DateTime.Now.ToString("dd-MM-yyyy-HH-mm-ss")}-logs.txt", rollingInterval: RollingInterval.Day)
    .Enrich.FromLogContext()
    .CreateLogger();

builder.Logging.AddSerilog(logger);

var app = builder.Build();
app.UseDeveloperExceptionPage();
app.UseStaticFiles();
app.UseLoggerMiddleware(); // <- add middleware logger
app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");
app.MapRazorPages();

app.Run();

And the controller action it tried to reach looks like this:

[HttpPost("event")]
        public async Task<IActionResult> PostEvent(
            [FromBody] object obj)

Full exception callstack:

Microsoft.AspNetCore.Connections.ConnectionResetException: The client has disconnected
 ---> System.Runtime.InteropServices.COMException (0x80070040): The specified network name is no longer available. (0x80070040)
   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Server.IIS.Core.IO.AsyncIOOperation.GetResult(Int16 token)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ReadBody()
   at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
   at System.IO.Pipelines.Pipe.ReadAsync(CancellationToken token)
   at System.IO.Pipelines.Pipe.DefaultPipeReader.ReadAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.ReadAsync(Memory`1 memory, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.IIS.Core.HttpRequestStream.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
   at System.Text.Json.JsonSerializer.ReadFromStreamAsync(Stream utf8Json, ReadBufferState bufferState, CancellationToken cancellationToken)
   at System.Text.Json.JsonSerializer.ReadAllAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
   at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
   at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder.BindModelAsync(ModelBindingContext bindingContext)
   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value, Object container)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at WebApp.Middleware.RequestHandlingMiddleware.InvokeAsync(HttpContext httpContext, IWallesterLogger logger) in C:\Projects\Pasts\PNS\Wallester\WebApp\Middleware\RequestHandlingMiddleware.cs:line 19
   at WebApp.Middleware.RequestHandlingMiddleware.InvokeAsync(HttpContext httpContext, IWallesterLogger logger) in C:\Projects\Pasts\PNS\Wallester\WebApp\Middleware\RequestHandlingMiddleware.cs:line 44
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

From the callstack line:19 is code in the middleware await _next(httpContext); and line:44 is throw command in the catch block.

My question would be what could cause this error, and is there anything we could change to fix it?


问:
How do I update the page contents inside an iframe using Selenium in Python
I'm trying to navigate through contents of an iframe.

When the page loads, I can switch to the context, and then submit a form. What I need to capture is the resulting page from submission. However, when i try printing out the page source, I only get the original contents. How do I get info on the updated frame?

Below is the sample code(real website removed):

```<code># Import the necessary libraries
from selenium import webdriver
from selenium.webdriver.common.by import By

# Import the Firefox class from the selenium.webdriver.firefox.webdriver module
driver = webdriver.Firefox()

# Navigate to the URL
driver.get("example.com")

# Switch frame by id
driver.switch_to.frame('appointment')

# Find an element on the page using its id attribute
form = driver.find_element(By.ID, "Form1")
form.submit()

# Print the HTML source code of the current page
print(driver.page_source)
</code>```

I've tried switching into and out of the context and it still did not help

Example of trying to switch back out and into the context:

```<code>    # switch back to default content
    driver.switch_to.default_content()

    # Switch frame by id
    driver.switch_to.frame('appointment')
</code>```

Body:
I'm trying to navigate through contents of an iframe.

When the page loads, I can switch to the context, and then submit a form. What I need to capture is the resulting page from submission. However, when i try printing out the page source, I only get the original contents. How do I get info on the updated frame?

Below is the sample code(real website removed):

# Import the necessary libraries
from selenium import webdriver
from selenium.webdriver.common.by import By

# Import the Firefox class from the selenium.webdriver.firefox.webdriver module
driver = webdriver.Firefox()

# Navigate to the URL
driver.get("example.com")

# Switch frame by id
driver.switch_to.frame('appointment')

# Find an element on the page using its id attribute
form = driver.find_element(By.ID, "Form1")
form.submit()

# Print the HTML source code of the current page
print(driver.page_source)

I've tried switching into and out of the context and it still did not help

Example of trying to switch back out and into the context:

    # switch back to default content
    driver.switch_to.default_content()

    # Switch frame by id
    driver.switch_to.frame('appointment')


问:
API documentation for KMM modules?
I am using KMM for writing the business logic and further exporting to native ios, Android, and JS libraries. I followed the Dokka` documentation to write the documentation which is working perfectly fine for me.

However, Is there a way to convert the dokka-generated doc-generated into native library syntax such as ios, android, and js?

Title: API documentation for KMM modules?


问:
Custom validation error message in Swagger
I have a Swagger definition for a Rest API, with regex patterns for validation of fields in the request body. But when the validation fails, a default error message is thrown -
{field}: must match {regex pattern}. With regex pattern in the error message, it makes less sense to the end user. How to customise this message preferably by using Swagger? I could add a handler in Java for 400 Bad request exception and handle it there, but that will be the last option, to modify java code.


问:
Is there a way to debug windows forms draw string?
I am scared of 1 pixel gaps, cause they can occur everywhere and take different approaches to solve:

From (Int32)((Decimal)(Decimal))

To Math.Floor and Math.Round

To (2 % X)

I'm getting better at solving those, but I have a string drawing as a title and I do not know how to debug math errors and pixel gaps as the font is not touching the borders of the string and there are no borders to begin with, is there efficient way to debug DRAW STRING and pixel gaps in draw string and mis calculation in draw string


问:
Code written on tensorflow 1.7 has wildly different performance in tensorflow 2
A few years ago I created a NN to analyze an accelerometer signal for my experiments. I recently got a new computer and after having installed tflow and all the appropriate drivers, my code no longer works (even after the version 2 converter). In version 1, my model was 97% accurate on predicting the class on my test set. On tensorflow 2, on the same data, my model performance is 75%. I have tried everything I can think of to no avail and am losing it because my thesis needs to be finished soon. Any help would be greatly appreciated.

```<code>
# tf Graph input
X = tf.placeholder("float", [None, n_input])
Y = tf.placeholder("float", [None, n_classes])
pred=tf.placeholder("float",)

initializer=tf.contrib.layers.xavier_initializer()

##XAVIER INITIALIZATION##
weights = {
    'h1': tf.Variable(initializer([n_input, n_hidden_1])),
    'h2': tf.Variable(initializer([n_hidden_1, n_hidden_2])),
    'h3': tf.Variable(initializer([n_hidden_2, n_hidden_3])),
    'weight_out': tf.Variable(initializer([n_hidden_3, n_classes]))
}

biases = {
    'b1': tf.Variable(initializer([n_hidden_1])),
    'b2': tf.Variable(initializer([n_hidden_2])),
    'b3': tf.Variable(initializer([n_hidden_3])),
    'bias_out': tf.Variable(initializer([n_classes]))
}

# Create model
def multilayer_perceptron(x):
    # Hidden fully connected layer with 256 neurons
    layer_1 = tf.nn.relu(tf.add(tf.matmul(x, weights['h1']), biases['b1']))
    # Hidden fully connected layer with 256 neurons
    layer_2 = tf.nn.relu(tf.add(tf.matmul(layer_1, weights['h2']), biases['b2']))
    layer_3 = tf.nn.relu(tf.add(tf.matmul(layer_2, weights['h3']), biases['b3']))
    # Output fully connected layer with a neuron for each class
    out_layer = tf.matmul(layer_3, weights['weight_out']) + biases['bias_out']
    return out_layer

logits = multilayer_perceptron(X)
'''
# Define loss and optimizer
#loss_opo no weights
loss_op = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(
    logits=logits, labels=Y))
'''

###############################################################
#weighted_loss
loss_weights=tf.constant(([[0.8, 1.2, 1.1, 1.05, 1.1]]))
loss_op=tf.reduce_mean(tf.nn.weighted_cross_entropy_with_logits(
        logits=logits,targets=Y,pos_weight=loss_weights))

################################################################

optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate)
optimizer_SGD=tf.keras.optimizers.SGD(lr=learning_rate)
train_op = optimizer.minimize(loss_op)

#######################################
## EVALUATE MODEL
# evaluates accuracy of softmax of logit output
#
pred=tf.nn.softmax(logits)
correct_prediction = tf.equal(tf.argmax(pred, 1), tf.argmax(Y, 1))
#
## Calculate accuracy
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))

</code>```

I have tried everything

Body:
A few years ago I created a NN to analyze an accelerometer signal for my experiments. I recently got a new computer and after having installed tflow and all the appropriate drivers, my code no longer works (even after the version 2 converter). In version 1, my model was 97% accurate on predicting the class on my test set. On tensorflow 2, on the same data, my model performance is 75%. I have tried everything I can think of to no avail and am losing it because my thesis needs to be finished soon. Any help would be greatly appreciated.

# tf Graph input
X = tf.placeholder("float", [None, n_input])
Y = tf.placeholder("float", [None, n_classes])
pred=tf.placeholder("float",)

initializer=tf.contrib.layers.xavier_initializer()

##XAVIER INITIALIZATION##
weights = {
    'h1': tf.Variable(initializer([n_input, n_hidden_1])),
    'h2': tf.Variable(initializer([n_hidden_1, n_hidden_2])),
    'h3': tf.Variable(initializer([n_hidden_2, n_hidden_3])),
    'weight_out': tf.Variable(initializer([n_hidden_3, n_classes]))
}

biases = {
    'b1': tf.Variable(initializer([n_hidden_1])),
    'b2': tf.Variable(initializer([n_hidden_2])),
    'b3': tf.Variable(initializer([n_hidden_3])),
    'bias_out': tf.Variable(initializer([n_classes]))
}

# Create model
def multilayer_perceptron(x):
    # Hidden fully connected layer with 256 neurons
    layer_1 = tf.nn.relu(tf.add(tf.matmul(x, weights['h1']), biases['b1']))
    # Hidden fully connected layer with 256 neurons
    layer_2 = tf.nn.relu(tf.add(tf.matmul(layer_1, weights['h2']), biases['b2']))
    layer_3 = tf.nn.relu(tf.add(tf.matmul(layer_2, weights['h3']), biases['b3']))
    # Output fully connected layer with a neuron for each class
    out_layer = tf.matmul(layer_3, weights['weight_out']) + biases['bias_out']
    return out_layer

logits = multilayer_perceptron(X)
'''
# Define loss and optimizer
#loss_opo no weights
loss_op = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(
    logits=logits, labels=Y))
'''

###############################################################
#weighted_loss
loss_weights=tf.constant(([[0.8, 1.2, 1.1, 1.05, 1.1]]))
loss_op=tf.reduce_mean(tf.nn.weighted_cross_entropy_with_logits(
        logits=logits,targets=Y,pos_weight=loss_weights))

################################################################

optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate)
optimizer_SGD=tf.keras.optimizers.SGD(lr=learning_rate)
train_op = optimizer.minimize(loss_op)

#######################################
## EVALUATE MODEL
# evaluates accuracy of softmax of logit output
#
pred=tf.nn.softmax(logits)
correct_prediction = tf.equal(tf.argmax(pred, 1), tf.argmax(Y, 1))
#
## Calculate accuracy
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))

I have tried everything


问:
How to block adding a header and footer on the first few pages when printing
When printing the page, I add a header and footer.

I want these elements to appear only from the 5th page. I have different ones on the front pages and I don't want the standard ones to appear.

This solution causes that there is a header and footer on each page.

```<code>export default function DynamicPages() {
  return (
    <div>
      <table>
        <thead>
          <tr>
            <td>
              <HeaderSpace> </HeaderSpace>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>
              <div class="content">
                <div>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                </div>
                <div>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                </div>
                <div>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                </div>
                <div>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                </div>
                <div>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                  <p>Element</p>
                </div>
              </div>
            </td>
          </tr>
        </tbody>
        <tfoot>
          <tr>
            <td>
              <FooterSpace> </FooterSpace>
            </td>
          </tr>
        </tfoot>
      </table>

      <Header>H</Header>
      <Footer>F</Footer>
    </div>
  );
}

const Header = styled.div`
  @media print {
    position: fixed;
    top: 0;
    width: 100%;
    height: 200px;
    background: red;
  }
  @media screen {
    display: none;
  }
`;

const HeaderSpace = styled.div`
  @media print {
    height: 200px;
  }
  @media screen {
    display: none;
  }
`;

const FooterSpace = styled.div`
  @media print {
    height: 50px;
  }
  @media screen {
    display: none;
  }
`;

const Footer = styled.div`
  @media print {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 50px;
    background: green;
  }
  @media screen {
    display: none;
  }
`;
</code>```

Is there any way to start adding elements from a selected page?

Body:
When printing the page, I add a header and footer.

I want these elements to appear only from the 5th page. I have different ones on the front pages and I don't want the standard ones to appear.

This solution causes that there is a header and footer on each page.

export default function DynamicPages() {
  return (

              <HeaderSpace> </HeaderSpace>

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

Element

              <FooterSpace> </FooterSpace>

      H
      F

  );
}

const Header = styled.div`
  @media print {
    position: fixed;
    top: 0;
    width: 100%;
    height: 200px;
    background: red;
  }
  @media screen {
    display: none;
  }
`;

const HeaderSpace = styled.div`
  @media print {
    height: 200px;
  }
  @media screen {
    display: none;
  }
`;

const FooterSpace = styled.div`
  @media print {
    height: 50px;
  }
  @media screen {
    display: none;
  }
`;

const Footer = styled.div`
  @media print {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 50px;
    background: green;
  }
  @media screen {
    display: none;
  }
`;

Is there any way to start adding elements from a selected page?


问:
How to uninstall/remove openproject completely?
I have followed openproject.org and installed with latest version 12. But I want to check some feature in version 10. So I tried removing by sudo apt-get remove openproject and reinstalled with 10. While configure it getting an error like,

```<code>ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "updated_on" does not exist
LINE 1: SELECT MAX(updated_on) FROM "settings"
</code>```

Not sure why this error is throwing. So I thought to remove openproject again completely. Please confirm the above command is enough to do this or anything else I need to do.

Body:
I have followed openproject.org and installed with latest version 12. But I want to check some feature in version 10. So I tried removing by sudo apt-get remove openproject and reinstalled with 10. While configure it getting an error like,

ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "updated_on" does not exist
LINE 1: SELECT MAX(updated_on) FROM "settings"

Not sure why this error is throwing. So I thought to remove openproject again completely. Please confirm the above command is enough to do this or anything else I need to do.


问:
Suffix to convert scientific notation to a type other than double
I'm looking for a literal which would convert scientific notation to a type other than double. In my case, i need uint64_t. It should do something like this:

```<code>uint64_t x = 1e6_ui64;
</code>```

But I'm not sure if there is something already present in C++ or one of its standard libs.

Where can I find literals for scientific notation? Do they exist in C++? Or should I implement them myself?

Body:
I'm looking for a literal which would convert scientific notation to a type other than double. In my case, i need uint64_t. It should do something like this:

uint64_t x = 1e6_ui64;

But I'm not sure if there is something already present in C++ or one of its standard libs.

Where can I find literals for scientific notation? Do they exist in C++? Or should I implement them myself?


问:
NextJs getInitialProps convert to react componentDidMount
So I'm quite new to nextJs. I'm integrating code from a NextJs project into a react Project. In the nextJs project, the getInitialProps is used to gather initial data and I want to do the same but in react. I'm also using Lodash.

Here is the NextJs example code:

```<code>  static async getInitialProps({req}) {
const testData = _.get(req, 'params.test', '');

console.log(req);
}
</code>```

and here is what I'm trying to do with react:

```<code>  async componentDidMount({ req }) {
    const testData = _.get(req, 'params.test', '');

    console.log(req);
}
</code>```

so I assume the req in NextJs directly ties into the server function. Can this be replicated in react as I've tried? or do I need to use something like an API URL in react instead?

Any help would be great. Thanks!

Body:
So I'm quite new to nextJs. I'm integrating code from a NextJs project into a react Project. In the nextJs project, the getInitialProps is used to gather initial data and I want to do the same but in react. I'm also using Lodash.

Here is the NextJs example code:

  static async getInitialProps({req}) {
const testData = _.get(req, 'params.test', '');

console.log(req);
}

and here is what I'm trying to do with react:

  async componentDidMount({ req }) {
    const testData = _.get(req, 'params.test', '');

    console.log(req);
}

so I assume the req in NextJs directly ties into the server function. Can this be replicated in react as I've tried? or do I need to use something like an API URL in react instead?

Any help would be great. Thanks!


问:
Can anyone help me with this error for dpkg-buildpackage?
Any idea about this error in gitlab-ci. Seems like the version of debhelper is not proper and I am not able to figure out what should be right version for this. Or there might be some other issue as well. Can anyone tell me what is the issue with this and how to resolve this?

```<code>$ dpkg-buildpackage -us -uc
dpkg-buildpackage: source package gentoo
dpkg-buildpackage: source version 0.9.12-1
dpkg-buildpackage: source changed by root <root@localhost>
dpkg-buildpackage: warning: debian/rules is not executable; fixing that
 dpkg-source --before-build edge_release_management
dpkg-buildpackage: host architecture amd64
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 10)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
</code>```

here is my control file :

```<code>Source: gentoo
Section: unknown
Priority: optional
Maintainer: root <root@localhost>
Build-Depends: debhelper (>=10)
Standards-Version: 4.0.0
Homepage: <insert the upstream URL, if relevant>

Package: gentoo
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
</code>```

here is my changelog file:

```<code>gentoo (0.9.12-1) unstable; urgency=medium
  * Initial release. (Closes: #nnnn)  <nnnn is the bug number of your ITP>
 -- root <root@localhost>  Mon, 22 Mar 2010 00:37:31 +0100
</code>```

here is my gitlab-ci.yml file

```<code># Is performed before the scripts in the stages step
before_script:
  - source /etc/profile
  - echo "Hello, $GITLAB_USER_LOGIN!"
  - echo "Hello, $GITLAB_USER_PASSWORD"
#  - sudo rm /var/cache/apt/archives/lock
#  - sudo rm /var/lib/dpkg/lock
#  - sudo su
#  - sudo -S su < $password_secret

# Defines stages which are to be executed
stages:
  - build

# Stage "build"
run-build:
  stage: build
  script:
#    - apt-get install --force-yes libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
#    - autoreconf -fvi
#    - mkdir debian
    - ls
    - mkdir -p debian/usr/local/bin/
    - cp COPYING debian/copyright
    - cp ermbuild debian/usr/local/bin/ermbuild
#    - cp changelog debian
#    - cd ..
    - ls
#    - cd debian
    - pwd
    - ls
    - echo $EDITOR
#    - export EDITOR="/usr/bin/vim"
    - echo $EDITOR
#    - dch --create
#    - dpkg-depcheck -d ./configure #to check which all dependent packages are required
    - dpkg-buildpackage -us -uc
    - mkdir build
    - mv ../ermbuild.deb build/

  # This stage is only executed for new tags
  only:
    - tags

  # The files which are to be made available in GitLab
  artifacts:
    paths:
      - build/*
</code>```

I also tried to change my Dockerfile from:

```<code>FROM dockette/wheezy
ADD  setup.sh /opt/
RUN  /bin/bash /opt/setup.sh
</code>```

to

```<code>FROM ubuntu
ADD  setup.sh /opt/
RUN  /bin/bash /opt/setup.sh
</code>```

Edit 1: Seems like the docker debPackageBuilder requires a version of debhelper which is greater than 10 but the docker container only allows debhelper to be 9.2
See this what I got when did apt-cache policy debhelper

```<code>root@2713bee502ea:/code# apt-cache policy debhelper
debhelper:
  Installed: 9.20120909
  Candidate: 9.20120909
  Version table:
 *** 9.20120909 0
        500 http://archive.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status
</code>```

Body:
Any idea about this error in gitlab-ci. Seems like the version of debhelper is not proper and I am not able to figure out what should be right version for this. Or there might be some other issue as well. Can anyone tell me what is the issue with this and how to resolve this?

$ dpkg-buildpackage -us -uc
dpkg-buildpackage: source package gentoo
dpkg-buildpackage: source version 0.9.12-1
dpkg-buildpackage: source changed by root <root@localhost>
dpkg-buildpackage: warning: debian/rules is not executable; fixing that
 dpkg-source --before-build edge_release_management
dpkg-buildpackage: host architecture amd64
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 10)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

here is my control file :

Source: gentoo
Section: unknown
Priority: optional
Maintainer: root <root@localhost>
Build-Depends: debhelper (>=10)
Standards-Version: 4.0.0
Homepage: <insert the upstream URL, if relevant>

Package: gentoo
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>

here is my changelog file:

gentoo (0.9.12-1) unstable; urgency=medium
  * Initial release. (Closes: #nnnn)  <nnnn is the bug number of your ITP>
 -- root <root@localhost>  Mon, 22 Mar 2010 00:37:31 +0100

here is my gitlab-ci.yml file

# Is performed before the scripts in the stages step
before_script:
  - source /etc/profile
  - echo "Hello, $GITLAB_USER_LOGIN!"
  - echo "Hello, $GITLAB_USER_PASSWORD"
#  - sudo rm /var/cache/apt/archives/lock
#  - sudo rm /var/lib/dpkg/lock
#  - sudo su
#  - sudo -S su < $password_secret

# Defines stages which are to be executed
stages:
  - build

# Stage "build"
run-build:
  stage: build
  script:
#    - apt-get install --force-yes libncurses5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev zlib1g-dev libncursesw5-dev libbz2-dev
#    - autoreconf -fvi
#    - mkdir debian
    - ls
    - mkdir -p debian/usr/local/bin/
    - cp COPYING debian/copyright
    - cp ermbuild debian/usr/local/bin/ermbuild
#    - cp changelog debian
#    - cd ..
    - ls
#    - cd debian
    - pwd
    - ls
    - echo $EDITOR
#    - export EDITOR="/usr/bin/vim"
    - echo $EDITOR
#    - dch --create
#    - dpkg-depcheck -d ./configure #to check which all dependent packages are required
    - dpkg-buildpackage -us -uc
    - mkdir build
    - mv ../ermbuild.deb build/

  # This stage is only executed for new tags
  only:
    - tags

  # The files which are to be made available in GitLab
  artifacts:
    paths:
      - build/*

I also tried to change my Dockerfile from:

FROM dockette/wheezy
ADD  setup.sh /opt/
RUN  /bin/bash /opt/setup.sh

to

FROM ubuntu
ADD  setup.sh /opt/
RUN  /bin/bash /opt/setup.sh

Edit 1: Seems like the docker debPackageBuilder requires a version of debhelper which is greater than 10 but the docker container only allows debhelper to be 9.2
See this what I got when did apt-cache policy debhelper

root@2713bee502ea:/code# apt-cache policy debhelper
debhelper:
  Installed: 9.20120909
  Candidate: 9.20120909
  Version table:
 *** 9.20120909 0
        500 http://archive.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status


问:
Why I can't overwrite scss variables?
For example, I have this kind of code

In scss file at the top I have something like this:

```<code>$bgc-color: var(--color-daybreak-blue-6);
</code>```

Then I use this in class, and it works perfectly.

```<code>.primary {
  background-color: $bgc-color;
  color: $bgc-color;
}
</code>```

Now I want to change $bgc-color value based on media queries

```<code>@media (min-width: 600px) {
    $bgc-color: var(--color-red-1);
  }
</code>```

And this is not working, I have still main value  $bgc-color: var(--color-daybreak-blue-6);

In my project I used React and Sass, but what may be important I use also scss.modules, so my file is button.module.scss

Does anyone know what I do wrong? in normal css files, when I use css variables is working perfectly :(

Title: Why I can't overwrite scss variables?

Body:
For example, I have this kind of code

In scss file at the top I have something like this:

$bgc-color: var(--color-daybreak-blue-6);

Then I use this in class, and it works perfectly.

.primary {
  background-color: $bgc-color;
  color: $bgc-color;
}

Now I want to change $bgc-color value based on media queries

@media (min-width: 600px) {
    $bgc-color: var(--color-red-1);
  }

And this is not working, I have still main value  $bgc-color: var(--color-daybreak-blue-6);

In my project I used React and Sass, but what may be important I use also scss.modules, so my file is button.module.scss

Does anyone know what I do wrong? in normal css files, when I use css variables is working perfectly :(


问:
renv: Disable all repos exept local repo
I'm using the renv package but can only install R packages from a local source/repo. The local source/repo is in my profile as checked with options('repos'). renv also installs packages correctly from the local source/repo.

However, apparently renv is checking external sources (online) first when installing packages. I get a lot of (!) warnings when using renv saying:

curl: (6) Could not resolve host: rstudio-buildtools.s3.amazonaws.com

I suppose this is because renv always tries to access online resource first (which I cannot use).

Is there any way/option to tell renv to only use local sources/repos without looking for online resources (so to avoid the numerous warnings)?


问:
WPF Data binding issue for user control inside another user control
I have created one multi select combobox user control because i need to use it multiple times, like

```<code><GroupBox  Width="auto" Height="auto" Header="Title" Style="{StaticResource LeidosGroupBoxStyle}"
                   FontSize="9" Foreground="{StaticResource LeidosDarkGreyBrush}">
            <ComboBox Width="auto"  Height="auto" x:Name="MultiSelectCombo"  SnapsToDevicePixels="True"
                OverridesDefaultStyle="True"
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                ScrollViewer.CanContentScroll="True"
                IsSynchronizedWithCurrentItem="True"
                Style="{StaticResource ComboBoxStyle}"
                ItemContainerStyle="{StaticResource CBoxItemStyle}" FontSize="12" Foreground="{StaticResource LeidosVioletBrush}"
                >
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding ItemText}" Style="{StaticResource CheckBoxStyle}"
                          IsChecked="{Binding Path=IsSelected, Mode=TwoWay}"
                          Tag="{RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}"
                           Click="Checkbx_Click" >
                        </CheckBox>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
                <ComboBox.Template>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="17*"/>
                                <ColumnDefinition Width="377*"/>

</code>```

with dependency properties for Itemsource and selected items

```<code>public ObservableCollection<DropDownListVM> ItemsSource
        {
            get
            {
                return (ObservableCollection<DropDownListVM>)GetValue(ItemsSourceProperty);
            }
            set
            {
                SetValue(ItemsSourceProperty, value);
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Selected item list
        /// </summary>
        public ObservableCollection<DropDownListVM> SelectedItems
        {
            get
            {
                return (ObservableCollection<DropDownListVM>)GetValue(SelectedItemsProperty);
            }
            set
            {
                SetValue(SelectedItemsProperty, value);
                OnPropertyChanged();
            }
        }

</code>```

Now i am trying to use this control in another panel like this:

```<code><local:MultiselectCombobox HorizontalAlignment="Left" Margin="15" VerticalAlignment="Top"
                                         Height="38" Width="150" x:Name="ComboboxFlightData"
                                         ItemsSource="{Binding FlightItems,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
                                         SelectedItems="{Binding SelectedFlights}" Grid.Row="1">
         </local:MultiselectCombobox>
</code>```

and i am using this panel in windows application from where i am setting values to this 'FlightItems'.
But drop down list is blank and there's no output. Can you please help

there's no data binding error. I have VM for panel and using properties for binding

```<code> public ObservableCollection<DropDownListVM> SelectedFlights
        {
            get
            {
                return _selectedItems;
            }
            set
            {
                _selectedItems = value;
                OnPropertyChanged("SelectedFlights");
                //updateEvent?.Invoke(this, new UpdateEventArgs("SelectedFlights"));
            }
        }

        public ObservableCollection<DropDownListVM> FlightItems
        {
            get
            {
                return _items;
            }
            set
            {
                _items = value;
                OnPropertyChanged("FlightItems");
                //updateEvent?.Invoke(this, new UpdateEventArgs("FlightItems"));
            }
        }
</code>```

Body:
I have created one multi select combobox user control because i need to use it multiple times, like

<GroupBox  Width="auto" Height="auto" Header="Title" Style="{StaticResource LeidosGroupBoxStyle}"
                   FontSize="9" Foreground="{StaticResource LeidosDarkGreyBrush}">
            <ComboBox Width="auto"  Height="auto" x:Name="MultiSelectCombo"  SnapsToDevicePixels="True"
                OverridesDefaultStyle="True"
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                ScrollViewer.CanContentScroll="True"
                IsSynchronizedWithCurrentItem="True"
                Style="{StaticResource ComboBoxStyle}"
                ItemContainerStyle="{StaticResource CBoxItemStyle}" FontSize="12" Foreground="{StaticResource LeidosVioletBrush}"
                >
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <CheckBox Content="{Binding ItemText}" Style="{StaticResource CheckBoxStyle}"
                          IsChecked="{Binding Path=IsSelected, Mode=TwoWay}"
                          Tag="{RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}"
                           Click="Checkbx_Click" >
                        </CheckBox>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
                <ComboBox.Template>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="17*"/>
                                <ColumnDefinition Width="377*"/>

with dependency properties for Itemsource and selected items

public ObservableCollection<DropDownListVM> ItemsSource
        {
            get
            {
                return (ObservableCollection<DropDownListVM>)GetValue(ItemsSourceProperty);
            }
            set
            {
                SetValue(ItemsSourceProperty, value);
                OnPropertyChanged();
            }
        }

        ///
        /// Selected item list
        ///
        public ObservableCollection<DropDownListVM> SelectedItems
        {
            get
            {
                return (ObservableCollection<DropDownListVM>)GetValue(SelectedItemsProperty);
            }
            set
            {
                SetValue(SelectedItemsProperty, value);
                OnPropertyChanged();
            }
        }

Now i am trying to use this control in another panel like this:

<local:MultiselectCombobox HorizontalAlignment="Left" Margin="15" VerticalAlignment="Top"
                                         Height="38" Width="150" x:Name="ComboboxFlightData"
                                         ItemsSource="{Binding FlightItems,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"
                                         SelectedItems="{Binding SelectedFlights}" Grid.Row="1">
         </local:MultiselectCombobox>

and i am using this panel in windows application from where i am setting values to this 'FlightItems'.
But drop down list is blank and there's no output. Can you please help

there's no data binding error. I have VM for panel and using properties for binding

 public ObservableCollection<DropDownListVM> SelectedFlights
        {
            get
            {
                return _selectedItems;
            }
            set
            {
                _selectedItems = value;
                OnPropertyChanged("SelectedFlights");
                //updateEvent?.Invoke(this, new UpdateEventArgs("SelectedFlights"));
            }
        }

        public ObservableCollection<DropDownListVM> FlightItems
        {
            get
            {
                return _items;
            }
            set
            {
                _items = value;
                OnPropertyChanged("FlightItems");
                //updateEvent?.Invoke(this, new UpdateEventArgs("FlightItems"));
            }
        }


问:
What is the best way to allow a file sync with my own cloud storage?
I have a service that allows users to upload/download their files to our cloud based storage through the browser. I want to enable an automatic two-way sync with local devices (mostly Windows/MacOS) similar to OneDrive, Dropbox etc. but seems like a lot of platform specific effort. I was thinking WebDAV, Browser addin, or any open source base to build on - but did not find anything matching.
What are practical, modern solutions without doing this from scratch?</p>


问:
AdMob and fragments in Kotlin issue
I have an app that has two AdMob banner ads. So my question is not necessarily the how to do it, but the concept behind it.

I have a fragment layout app that is a live app on google play. I have they banner ads implemented. It works like a charm. However I have noticed the impression rate is very low out of 65 daily active users.

So the issue I am trying to figure out is, when the AdMob banner ad runs on a fragment. Is the fragment destroying the AdMob banner ad on transition?

Example

MainActivity holds the frame layout. Then in the two fragments in its own constraint layout is the banner ad. When I transition to another fragment to enter info and save it. It then goes back to the Home Fragment. During those transitions when the fragment changes does it destroy the banner ad?

I am not wanting to know how to implement the banner ad, I am just trying to figure out why and how my banner ads is not showing the data metrics in AdMob. Is my code destroying the ad so the impression is not counted if so I need to figure out a better solution on the implementing process.

However, you would think 65 DAU with an impression rate and the Average DAU Session I would get more than 15 impressions off of 65 sessions with an average of 3 minutes per session.

So with fragments, does the ad impression get destroyed with the fragment? The ads show fine but upon testing I get poor results. Banner ad cycles every 30 seconds roughly. So out the data my ad is being killed somewhere or the impressions are not being counted.

Out of Days having the ads implemented I have only gotten 144 requests and 65 impressions.

So again the question at hand is,.. Does Fragments kill the ad upon transition?

Title: AdMob and fragments in Kotlin issue


问:
How to get images src but restrict access?
Users can upload files and these files are stored in app/storage/uploads/

Then I want to display the uploaded images in the browser as a grid of images

I am using the Fetch API to get the images (or AJAX)

So I created a symlink from app/storage/uploads/ to app/public/storage/uploads.

But now everyone has access to all the images because they are publicly available.

What is the correct way to restrict access to these images then (So that every user can only view his uploaded files, or files that other users gave him permission to view)?

Edit: The uploaded images are randmoly stored in the uploads folder:

```<code>app/storage/uploads/a/image1.jpg
app/storage/uploads/b/c/image2.jpg
app/storage/uploads/d/e/f/image3.jpg
app/storage/uploads/z/image4.jpg
</code>```

So there isn't any relation to the user's id.

Body:
Users can upload files and these files are stored in app/storage/uploads/

Then I want to display the uploaded images in the browser as a grid of images

I am using the Fetch API to get the images (or AJAX)

So I created a symlink from app/storage/uploads/ to app/public/storage/uploads.

But now everyone has access to all the images because they are publicly available.

What is the correct way to restrict access to these images then (So that every user can only view his uploaded files, or files that other users gave him permission to view)?

Edit: The uploaded images are randmoly stored in the uploads folder:

app/storage/uploads/a/image1.jpg
app/storage/uploads/b/c/image2.jpg
app/storage/uploads/d/e/f/image3.jpg
app/storage/uploads/z/image4.jpg

So there isn't any relation to the user's id.


问:
Flutter gradient particle color lerp without ColorFilter
I have the following particle with color lerp over time

```<code>class Particle extends ImageParticle {
  final Color _start;
  final Color _end;
  final Paint _paint;

  Particle({
    required super.image,
    required Color start,
    required Color end,
    super.lifespan,
  })  : _start = start,
        _end = end,
        _paint = Paint();

  @override
  void render(Canvas canvas) {
    canvas.scale(2 * Curves.decelerate.transform(1 - progress));
    canvas.drawImageRect(
      image,
      src,
      dest,
      _paint,
    );
  }

  @override
  void update(double dt) {
    _paint.colorFilter = ColorFilter.mode(
      Color.lerp(
        _start,
        _end,
        Curves.decelerate.transform(progress),
      )!,
      BlendMode.modulate,
    );
    super.update(dt);
  }
}
</code>```

But I need to reassign the color filter each update. I know that assigning a new Paint each update has a big performance impact and from tests I see that assigning a ColorFilter each update also has a performance impact. Mostly because it causes the garbage collector to have spikes on web. Is there a way to lerp the color without having to reassign a color filter each update?

The docs show to do it in the following way

https://docs.flame-engine.org/1.5.0/flame/rendering/particles.html?highlight=particle#computedparticle

But this will give the same issue.

Body:
I have the following particle with color lerp over time

class Particle extends ImageParticle {
  final Color _start;
  final Color _end;
  final Paint _paint;

  Particle({
    required super.image,
    required Color start,
    required Color end,
    super.lifespan,
  })  : _start = start,
        _end = end,
        _paint = Paint();

  @override
  void render(Canvas canvas) {
    canvas.scale(2 * Curves.decelerate.transform(1 - progress));
    canvas.drawImageRect(
      image,
      src,
      dest,
      _paint,
    );
  }

  @override
  void update(double dt) {
    _paint.colorFilter = ColorFilter.mode(
      Color.lerp(
        _start,
        _end,
        Curves.decelerate.transform(progress),
      )!,
      BlendMode.modulate,
    );
    super.update(dt);
  }
}

But I need to reassign the color filter each update. I know that assigning a new Paint each update has a big performance impact and from tests I see that assigning a ColorFilter each update also has a performance impact. Mostly because it causes the garbage collector to have spikes on web. Is there a way to lerp the color without having to reassign a color filter each update?

The docs show to do it in the following way

https://docs.flame-engine.org/1.5.0/flame/rendering/particles.html?highlight=particle#computedparticle

But this will give the same issue.


问:
How can I make the waves higher?
I'm trying to figure out what I'm doing wrong.

I've created this water effect text but I would like that the waves should be almost at the 85% of the text and now it's probably around 50%.

Also the width of the waves sometimes it doesn't cover the whole width of the text and since it's a counter and there is no limit time, the number could be also conceptually infinite and I would like that the waves cover the whole text independently by its length.

Here is a fiddle: https://jsfiddle.net/6txf03od/.

function diff_seconds(dt2, dt1) //Secondi
{

  dt1 = new Date();
  dt2 = new Date("December 7, 2022 11:30:00");

  var diff = (dt2.getTime() - dt1.getTime()) / 1000;

  //per ore   diff /= (60 * 60);
  //per minuti   diff /= (60 * 1);
  //per giorni   diff /= (60 * 60)*24;

  return Math.abs(Math.round(diff));

}

function printx() {
  var dt1, dt2;
  var contatore = 0;

  contatore = diff_seconds(dt1, dt2) * 80;
  document.getElementById("contatore").innerHTML = contatore;
  document.getElementById("contatorex").innerHTML = contatore;

}

setInterval(printx, 1000);```
<pre class="snippet-code-css lang-css prettyprint-override"><code>@import url("https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900");
h2 {
  font-family: "Poppins", sans-serif;
}

.content h2 {
  color: red;
  font-size: 90px;
  position: absolute;
  left: 27% !important;
  right: 20% !important;
  transform: translate(-50%, -50%);
}

.content h2:nth-child(1) {
  color: transparent;
  -webkit-text-stroke: 1px black;
}

.content h2:nth-child(2) {
  color: #007fff;
  animation: animate 4s ease-in-out infinite;
}

@keyframes animate {
  0%,
  100% {
    clip-path: polygon( 0% 45%, 16% 44%, 33% 50%, 54% 60%, 70% 61%, 84% 59%, 100% 52%, 100% 100%, 0% 100%);
  }
  50% {
    clip-path: polygon( 0% 60%, 15% 65%, 34% 66%, 51% 62%, 67% 50%, 84% 45%, 100% 46%, 100% 100%, 0% 100%);
  }
}</code>```

Litri depurati

```

Title: How can I make the waves higher?

Body:
I'm trying to figure out what I'm doing wrong.

I've created this water effect text but I would like that the waves should be almost at the 85% of the text and now it's probably around 50%.

Also the width of the waves sometimes it doesn't cover the whole width of the text and since it's a counter and there is no limit time, the number could be also conceptually infinite and I would like that the waves cover the whole text independently by its length.

Here is a fiddle: https://jsfiddle.net/6txf03od/.

function diff_seconds(dt2, dt1) //Secondi
{

  dt1 = new Date();
  dt2 = new Date("December 7, 2022 11:30:00");

  var diff = (dt2.getTime() - dt1.getTime()) / 1000;

  //per ore   diff /= (60 * 60);
  //per minuti   diff /= (60 * 1);
  //per giorni   diff /= (60 * 60)*24;

  return Math.abs(Math.round(diff));

}

function printx() {
  var dt1, dt2;
  var contatore = 0;

  contatore = diff_seconds(dt1, dt2) * 80;
  document.getElementById("contatore").innerHTML = contatore;
  document.getElementById("contatorex").innerHTML = contatore;

}

setInterval(printx, 1000);

@import url("https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900");
h2 {
  font-family: "Poppins", sans-serif;
}

.content h2 {
  color: red;
  font-size: 90px;
  position: absolute;
  left: 27% !important;
  right: 20% !important;
  transform: translate(-50%, -50%);
}

.content h2:nth-child(1) {
  color: transparent;
  -webkit-text-stroke: 1px black;
}

.content h2:nth-child(2) {
  color: #007fff;
  animation: animate 4s ease-in-out infinite;
}

@keyframes animate {
  0%,
  100% {
    clip-path: polygon( 0% 45%, 16% 44%, 33% 50%, 54% 60%, 70% 61%, 84% 59%, 100% 52%, 100% 100%, 0% 100%);
  }
  50% {
    clip-path: polygon( 0% 60%, 15% 65%, 34% 66%, 51% 62%, 67% 50%, 84% 45%, 100% 46%, 100% 100%, 0% 100%);
  }
}

Litri depurati


问:
Creating probability by values in loop
I have a while loop of the following type:

```<code>while(num < border):
    Create defaultdict with some values
</code>```

Each dictionary is filled with different values (this values can be repeated for different num's).

So, how can I collect overall statistics for all values from dictionaries in the loop?
I need something like this:  value_1 was found in 3% of num's ... etc. I think that the final result would be best to formalize in the pandas table.

The main task is to collect statistics as the cycle runs, and not just save all the dictionaries and make a selection based on them. I have not encountered statistics in python before, so I would be glad to hear what methods I should consider and use in this case.

Title: Creating probability by values in loop

Body:
I have a while loop of the following type:

while(num < border):
    Create defaultdict with some values

Each dictionary is filled with different values (this values can be repeated for different num's).

So, how can I collect overall statistics for all values from dictionaries in the loop?
I need something like this:  value_1 was found in 3% of num's ... etc. I think that the final result would be best to formalize in the pandas table.

The main task is to collect statistics as the cycle runs, and not just save all the dictionaries and make a selection based on them. I have not encountered statistics in python before, so I would be glad to hear what methods I should consider and use in this case.


Title: Understanding RGB channels order

Body:
I have an RGB image which I load from keras CIFAR10: https://keras.io/api/datasets/cifar10/.
If I pick the first image from the training set, I get a tensor of shape (32,32,3).

(x_train, y_train), (x_test, y_test) = tf.keras.datasets.cifar10.load_data()
img = x_train[0]

print(f"shape of a single image: {img.shape}")
print(f"IMG:\n{img}")

By printing such image i got the following tensor.

  [[[ 59  62  63]
  [ 43  46  45]
  [ 50  48  43]
  [ 68  54  42]
  [ 98  73  52]
  [119  91  63]
  [139 107  75]
  [145 110  80]
  [149 117  89]
  [149 120  93]
  [131 103  77]
  [125  99  76]
  [142 115  91]
  [144 112  86]
  [137 105  79]
  [129  97  71]
  [137 106  79]
  [134 106  76]
  [124  97  64]
  [139 113  78]
  [139 112  75]
  [133 105  69]
  [136 105  74]
  [139 108  77]
  [152 120  89]
  [163 131 100]
  [168 136 108]
  [159 129 102]
  [158 130 104]
  [158 132 108]
  [152 125 102]
  [148 124 103]]

 [[ 16  20  20]
  [  0   0   0]
  [ 18   8   0]
  [ 51  27   8]
  [ 88  51  21]
  [120  82  43]
  [128  89  45]
  [127  86  44]
  [126  87  50]
  [116  79  44]
  [106  70  37]
  [101  67  35]
  [105  70  36]
  [113  74  35]
  [109  70  33]
  [112  72  37]
  [119  79  44]
  [109  71  33]
  [105  69  27]
  [125  89  46]
  [127  92  46]
  [122  85  39]
  [131  89  47]
  [124  82  41]
  [121  79  37]
  [131  89  48]
  [132  91  53]
  [133  94  58]
  [133  96  60]
  [123  88  55]
  [119  83  50]
  [122  87  57]]

 [[ 25  24  21]
  [ 16   7   0]
  [ 49  27   8]
  [ 83  50  23]
  [110  72  41]
  [129  92  54]
  [130  93  55]
  [121  82  47]
  [113  77  43]
  [112  78  44]
  [112  79  46]
  [106  75  45]
  [105  73  38]
  [128  92  48]
  [124  87  47]
  [130  92  56]
  [127  89  56]
  [122  85  51]
  [115  79  43]
  [120  85  47]
  [130  95  54]
  [131  96  55]
  [139 102  62]
  [127  90  51]
  [126  89  49]
  [127  89  50]
  [130  92  53]
  [142 105  68]
  [130  94  58]
  [118  84  50]
  [120  84  50]
  [109  73  42]]

 [[ 33  25  17]
  [ 38  20   4]
  [ 87  54  25]
  [106  63  28]
  [115  70  33]
  [117  74  35]
  [114  72  37]
  [105  62  33]
  [107  68  33]
  [121  84  45]
  [125  90  53]
  [109  75  40]
  [113  77  38]
  [146 105  58]
  [133  91  47]
  [127  84  45]
  [118  76  40]
  [117  76  41]
  [127  87  52]
  [122  81  43]
  [132  92  51]
  [137  99  58]
  [136  99  57]
  [131  93  52]
  [124  86  44]
  [130  91  50]
  [132  90  49]
  [135  93  51]
  [130  90  50]
  [125  87  50]
  [121  85  48]
  [ 94  62  35]]

 [[ 50  32  21]
  [ 59  32  11]
  [102  65  34]
  [127  79  39]
  [124  77  36]
  [121  77  36]
  [120  78  40]
  [114  74  39]
  [107  72  34]
  [125  88  49]
  [129  89  51]
  [106  68  31]
  [108  71  33]
  [124  83  42]
  [121  78  39]
  [108  68  29]
  [ 98  65  23]
  [110  74  37]
  [117  80  49]
  [120  80  41]
  [134  93  50]
  [140 106  66]
  [131  95  58]
  [141  98  66]
  [135  92  51]
  [127  84  45]
  [121  79  41]
  [119  79  40]
  [103  67  32]
  [ 87  57  27]
  [ 75  47  23]
  [ 67  42  25]]

 [[ 71  48  29]
  [ 84  53  24]
  [110  73  37]
  [129  82  38]
  [136  88  45]
  [131  84  42]
  [129  84  43]
  [119  77  37]
  [108  70  33]
  [122  82  44]
  [123  81  39]
  [105  65  25]
  [107  72  31]
  [111  77  31]
  [108  74  34]
  [ 98  65  27]
  [ 94  62  21]
  [ 97  63  32]
  [ 83  56  38]
  [ 88  58  36]
  [102  68  42]
  [ 97  69  46]
  [ 88  54  36]
  [118  74  72]
  [140  96  79]
  [136  97  64]
  [120  80  45]
  [107  68  34]
  [ 88  54  24]
  [ 67  39  15]
  [ 35  10   0]
  [ 32  13   4]]

 [[ 97  69  40]
  [111  75  36]
  [123  85  43]
  [130  84  38]
  [136  88  44]
  [132  83  40]
  [122  74  30]
  [121  74  31]
  [127  83  46]
  [138  94  54]
  [124  79  34]
  [120  79  39]
  [107  71  34]
  [ 80  50  14]
  [ 68  43  17]
  [ 74  41  17]
  [101  51  21]
  [105  56  23]
  [ 65  37  16]
  [ 58  36  19]
  [ 63  37  18]
  [ 78  51  31]
  [136  93  83]
  [122  68  80]
  [139  86  79]
  [151 106  69]
  [129  87  49]
  [108  68  36]
  [ 95  59  29]
  [ 96  63  37]
  [ 89  61  38]
  [ 66  47  30]]

 [[115  82  49]
  [119  76  33]
  [130  90  47]
  [140  97  53]
  [133  88  48]
  [127  81  40]
  [138  90  47]
  [137  89  46]
  [131  86  48]
  [133  89  46]
  [134  91  46]
  [108  70  39]
  [ 72  39  19]
  [ 51  26  10]
  [ 41  22  14]
  [ 72  31  17]
  [181 102  69]
  [209 127  81]
  [125  76  47]
  [ 68  40  23]
  [ 64  38  17]
  [ 82  53  30]
  [123  77  62]
  [112  56  55]
  [135  81  60]
  [151 103  61]
  [137  95  54]
  [114  76  39]
  [105  69  34]
  [101  66  33]
  [126  92  59]
  [102  74  46]]

 [[137 100  68]
  [128  82  41]
  [132  91  51]
  [128  87  48]
  [119  81  44]
  [123  82  43]
  [128  85  44]
  [130  85  44]
  [121  80  40]
  [137  97  54]
  [131  94  53]
  [ 74  42  20]
  [ 54  25  16]
  [ 50  29  16]
  [ 44  29  18]
  [ 86  39  15]
  [203 106  56]
  [217 109  62]
  [162  90  71]
  [100  58  49]
  [ 77  42  27]
  [ 75  43  24]
  [ 74  39  24]
  [ 76  35  22]
  [107  67  36]
  [135  96  59]
  [135  97  58]
  [129  91  49]
  [127  89  48]
  [119  83  43]
  [125  86  45]
  [134  95  56]]

 [[154 120  89]
  [154 112  77]
  [156 114  82]
  [140 100  65]
  [123  89  53]
  [125  86  50]
  [126  86  48]
  [127  91  52]
  [133  97  60]
  [132  97  68]
  [ 90  60  30]
  [ 63  35   9]
  [ 62  33  16]
  [ 70  39  20]
  [ 79  50  30]
  [103  53  26]
  [152  70  33]
  [148  64  37]
  [141  79  61]
  [121  75  57]
  [101  58  41]
  [ 96  54  33]
  [ 86  48  24]
  [ 75  38  21]
  [101  63  32]
  [136  91  53]
  [136  92  53]
  [134  93  50]
  [133  93  52]
  [132  93  52]
  [128  86  45]
  [133  92  55]]

 [[154 122  94]
  [155 117  82]
  [156 117  82]
  [147 108  70]
  [133 100  64]
  [137 100  66]
  [139 102  68]
  [134 102  66]
  [141 111  81]
  [121  87  68]
  [ 80  40  13]
  [ 97  53  17]
  [ 90  45  17]
  [ 98  56  30]
  [137  91  57]
  [139  84  49]
  [148  87  54]
  [134  73  37]
  [138  82  46]
  [134  85  57]
  [140  92  76]
  [175 129 106]
  [142  99  53]
  [102  61  26]
  [108  67  25]
  [135  90  41]
  [131  87  45]
  [133  91  51]
  [138  97  57]
  [136  95  55]
  [130  86  46]
  [134  93  57]]

 [[145 114  89]
  [146 109  73]
  [146 109  69]
  [135  97  55]
  [127  92  57]
  [129  94  65]
  [117  84  55]
  [103  74  42]
  [130 103  70]
  [120  83  55]
  [111  60  14]
  [146  86  22]
  [136  78  23]
  [163 116  77]
  [169 115  69]
  [152 100  52]
  [161 116  73]
  [148  97  57]
  [177 121  82]
  [161 110  71]
  [195 150 113]
  [209 167 123]
  [189 146  94]
  [125  78  40]
  [108  63  25]
  [140  96  52]
  [137  95  59]
  [132  93  56]
  [136  95  57]
  [133  90  51]
  [132  87  46]
  [133  92  56]]

 [[142 115  86]
  [141 106  69]
  [140 105  68]
  [144 105  64]
  [147 110  74]
  [121  89  65]
  [ 84  56  34]
  [ 88  61  33]
  [109  80  44]
  [101  57  23]
  [138  79  19]
  [213 150  59]
  [178 123  41]
  [191 150  98]
  [211 169 122]
  [189 148  99]
  [205 164 110]
  [207 162 115]
  [213 164 118]
  [191 143  91]
  [199 158  97]
  [188 151  88]
  [161 121  76]
  [130  83  50]
  [124  77  38]
  [131  87  51]
  [130  91  61]
  [131  93  60]
  [134  93  57]
  [135  91  52]
  [136  89  48]
  [133  91  56]]

 [[158 131  98]
  [154 119  82]
  [142 107  74]
  [143 102  65]
  [132  92  59]
  [ 90  59  36]
  [ 72  44  22]
  [ 81  52  24]
  [ 84  47  19]
  [107  55  25]
  [165 106  50]
  [229 176  92]
  [183 137  57]
  [191 158 103]
  [239 216 176]
  [219 192 149]
  [228 188 128]
  [225 188 120]
  [214 177 112]
  [216 174 112]
  [210 171 110]
  [200 169 109]
  [189 162 114]
  [174 137 100]
  [161 118  76]
  [139  95  57]
  [134  96  66]
  [126  90  59]
  [131  92  56]
  [142  98  60]
  [136  89  48]
  [138  97  61]]

 [[145 115  79]
  [149 109  66]
  [147 108  68]
  [147 105  65]
  [136  95  62]
  [ 80  47  21]
  [ 89  57  32]
  [105  68  40]
  [ 96  51  26]
  [129  81  45]
  [192 152 113]
  [185 148 107]
  [145 101  51]
  [203 162 121]
  [223 200 170]
  [242 227 196]
  [244 227 186]
  [238 220 165]
  [241 219 163]
  [227 197 144]
  [225 191 139]
  [235 209 157]
  [219 206 164]
  [224 208 181]
  [215 192 156]
  [156 118  78]
  [128  89  57]
  [129  95  62]
  [131  95  60]
  [133  97  60]
  [128  89  50]
  [130  92  56]]

 [[148 116  79]
  [146 100  54]
  [145 100  55]
  [147 100  51]
  [133  96  54]
  [ 63  42  21]
  [ 66  43  31]
  [ 88  50  34]
  [113  65  37]
  [182 146 110]
  [220 191 169]
  [138  94  71]
  [162 105  63]
  [206 156 112]
  [196 166 135]
  [247 234 212]
  [255 253 232]
  [255 252 219]
  [245 234 197]
  [236 217 180]
  [230 208 170]
  [215 196 160]
  [231 217 197]
  [250 241 229]
  [241 229 195]
  [158 132  78]
  [125  95  49]
  [126  97  58]
  [124  92  52]
  [125  91  49]
  [126  88  46]
  [124  88  54]]

 [[149 115  79]
  [143  95  49]
  [144  97  51]
  [151  99  51]
  [132  87  49]
  [ 64  40  21]
  [ 84  59  41]
  [112  69  37]
  [163 121  75]
  [223 204 166]
  [206 182 157]
  [145  90  56]
  [196 133  84]
  [204 157 110]
  [220 188 156]
  [243 226 208]
  [245 237 226]
  [239 233 215]
  [234 224 201]
  [231 217 192]
  [195 181 152]
  [150 137 100]
  [208 193 154]
  [250 241 216]
  [227 216 173]
  [163 142  78]
  [145 127  60]
  [143 129  62]
  [140 123  55]
  [136 116  46]
  [121  95  30]
  [114  82  40]]

 [[147 111  76]
  [134  88  47]
  [140  99  61]
  [148 103  66]
  [135  89  60]
  [100  64  38]
  [108  73  43]
  [144 104  66]
  [210 181 140]
  [248 243 212]
  [175 147 115]
  [175 119  73]
  [220 176 129]
  [226 197 164]
  [230 207 179]
  [233 218 196]
  [224 212 195]
  [201 186 166]
  [184 163 138]
  [181 158 128]
  [190 171 136]
  [170 157 105]
  [179 167 105]
  [231 218 181]
  [223 206 161]
  [162 133  71]
  [146 116  43]
  [140 115  34]
  [139 116  33]
  [145 123  38]
  [142 119  35]
  [128 102  41]]

 [[152 114  80]
  [117  75  37]
  [114  80  48]
  [123  90  57]
  [126  91  56]
  [122  83  48]
  [ 93  58  32]
  [179 154 138]
  [238 226 212]
  [248 243 229]
  [170 134 104]
  [185 132  88]
  [241 214 177]
  [230 218 195]
  [187 169 142]
  [180 160 131]
  [166 146 115]
  [146 119  85]
  [149 116  79]
  [157 124  83]
  [184 157 110]
  [216 195 141]
  [212 198 152]
  [236 221 197]
  [236 212 176]
  [166 125  63]
  [136  85  16]
  [134  81  13]
  [130  83  13]
  [127  86  16]
  [137 105  27]
  [151 128  54]]

 [[145 105  72]
  [127  82  41]
  [128  90  51]
  [133  92  53]
  [132  89  49]
  [135  95  51]
  [171 145 110]
  [237 227 205]
  [252 247 235]
  [229 213 194]
  [173 136 100]
  [169 121  73]
  [220 182 138]
  [194 169 135]
  [123  89  55]
  [135  98  60]
  [127  91  48]
  [151 114  63]
  [165 127  74]
  [132  99  50]
  [151 126  79]
  [202 183 142]
  [240 228 203]
  [240 225 210]
  [222 196 169]
  [156 117  64]
  [119  76  12]
  [120  75  16]
  [112  66  14]
  [100  65  15]
  [ 99  74  19]
  [140 121  54]]

 [[143 104  66]
  [127  80  38]
  [129  86  49]
  [129  85  46]
  [130  86  45]
  [140 102  59]
  [219 196 161]
  [244 232 210]
  [210 199 186]
  [193 173 151]
  [166 129  92]
  [153 104  55]
  [191 146  96]
  [179 145 105]
  [128  86  47]
  [147 102  58]
  [149 106  59]
  [172 131  78]
  [147 108  54]
  [128  94  45]
  [141 113  67]
  [173 150 112]
  [202 183 160]
  [190 171 147]
  [198 175 146]
  [152 124  86]
  [100  72  26]
  [109  81  34]
  [119  88  43]
  [121  92  50]
  [108  82  36]
  [136 119  50]]

 [[143 104  64]
  [125  76  32]
  [131  85  48]
  [128  81  43]
  [123  81  39]
  [153 117  76]
  [148 118  85]
  [166 141 118]
  [188 166 147]
  [182 156 132]
  [171 134  99]
  [165 115  69]
  [195 148  99]
  [190 153 110]
  [152 108  66]
  [143  95  49]
  [152 105  56]
  [153 110  58]
  [142 102  51]
  [141 102  54]
  [135 101  55]
  [136 101  60]
  [148 110  74]
  [141 106  65]
  [141 111  68]
  [138 113  71]
  [111 100  37]
  [111 111  31]
  [121 118  35]
  [129 116  39]
  [138 116  45]
  [179 162  83]]

 [[141 102  65]
  [131  80  35]
  [139  89  46]
  [139  87  44]
  [138  90  50]
  [151 111  71]
  [128  91  52]
  [136  97  61]
  [175 136 104]
  [173 136 107]
  [189 151 118]
  [205 160 120]
  [201 157 113]
  [168 131  89]
  [151 108  65]
  [145  97  53]
  [146 101  52]
  [149 106  57]
  [153 110  61]
  [149 108  61]
  [144 104  59]
  [144 105  59]
  [145 104  59]
  [143 102  60]
  [129  96  48]
  [123 103  39]
  [124 126  30]
  [113 135  14]
  [108 133   8]
  [113 122  10]
  [148 136  44]
  [199 184 102]]

 [[143 103  72]
  [139  87  44]
  [138  89  42]
  [149  96  52]
  [160 109  72]
  [150 106  64]
  [147 104  58]
  [151 104  57]
  [169 121  81]
  [167 123  87]
  [179 141 105]
  [212 174 138]
  [203 168 132]
  [207 177 141]
  [149 112  74]
  [139  96  55]
  [144 102  56]
  [137  94  47]
  [151 107  61]
  [155 111  65]
  [152 109  63]
  [140 101  55]
  [107  76  38]
  [ 91  60  34]
  [ 84  61  23]
  [105  99  25]
  [132 142  34]
  [118 141  20]
  [ 96 121   4]
  [102 113   9]
  [159 149  63]
  [190 174  99]]

 [[149 107  74]
  [133  80  37]
  [136  88  48]
  [147  99  59]
  [150 104  63]
  [153 109  62]
  [157 112  67]
  [162 117  78]
  [175 131  96]
  [190 145 107]
  [166 124  84]
  [202 168 133]
  [224 197 168]
  [197 175 148]
  [192 165 133]
  [180 144 107]
  [146 106  64]
  [126  82  40]
  [141  97  52]
  [156 112  66]
  [153 109  61]
  [115  74  29]
  [ 77  43  14]
  [ 79  50  25]
  [ 93  73  33]
  [126 117  47]
  [133 134  39]
  [119 116  31]
  [113  99  24]
  [140 121  42]
  [187 165  91]
  [154 132  75]]

 [[172 128  76]
  [144  88  18]
  [135  85  35]
  [136  88  48]
  [135  90  45]
  [139  94  49]
  [153 108  68]
  [163 117  83]
  [166 120  82]
  [184 136 100]
  [166 118  88]
  [150 110  75]
  [184 149 110]
  [156 121  86]
  [158 123  87]
  [168 130  92]
  [149 109  71]
  [135  91  51]
  [130  85  43]
  [132  88  43]
  [128  84  37]
  [127  83  36]
  [135  92  52]
  [143 105  66]
  [139 108  62]
  [136 112  52]
  [127 105  39]
  [121  92  39]
  [135 102  44]
  [189 159  87]
  [211 181 114]
  [136 107  58]]

 [[202 157  82]
  [187 129  26]
  [151 100  25]
  [128  79  34]
  [122  76  41]
  [134  88  49]
  [142  98  53]
  [150 106  56]
  [153 106  58]
  [148  99  63]
  [135  87  59]
  [127  82  44]
  [153 109  60]
  [166 121  77]
  [143  99  59]
  [130  88  51]
  [128  87  52]
  [151 108  70]
  [152 106  65]
  [135  90  48]
  [139  95  50]
  [155 110  63]
  [161 113  65]
  [154 107  63]
  [154 112  67]
  [143 105  54]
  [130  93  44]
  [132  90  46]
  [171 131  70]
  [215 183 106]
  [186 155  91]
  [117  86  48]]

 [[216 174  87]
  [193 136  16]
  [168 122  19]
  [151 111  35]
  [131  88  34]
  [126  82  35]
  [138  94  49]
  [144 100  53]
  [142  95  53]
  [137  92  51]
  [120  78  34]
  [131  87  41]
  [145  99  52]
  [144 101  57]
  [137  94  54]
  [127  83  48]
  [126  82  51]
  [139  94  60]
  [153 108  69]
  [149 104  63]
  [140  95  53]
  [135  91  46]
  [147 103  57]
  [148 105  59]
  [149 108  62]
  [149 109  63]
  [137 101  54]
  [143 107  57]
  [203 167 102]
  [206 173 105]
  [124  93  49]
  [ 71  48  26]]

 [[220 182  91]
  [201 150  22]
  [186 148  24]
  [172 139  28]
  [156 120  26]
  [142 103  30]
  [142 100  51]
  [153 108  75]
  [150 105  73]
  [139  98  57]
  [126  88  38]
  [136  92  47]
  [148 102  62]
  [141 101  60]
  [131  89  51]
  [126  82  49]
  [127  81  51]
  [138  88  52]
  [150 100  60]
  [154 104  65]
  [149 101  60]
  [124  78  36]
  [126  85  41]
  [141 101  55]
  [145 107  61]
  [147 112  68]
  [127 101  59]
  [114  87  46]
  [186 155  98]
  [173 144  87]
  [ 56  29   9]
  [ 33  19   9]]

 [[208 170  96]
  [201 153  34]
  [198 161  26]
  [191 157  27]
  [183 146  34]
  [171 135  32]
  [159 121  42]
  [147 107  52]
  [135  95  49]
  [130  87  46]
  [139  93  57]
  [147  98  62]
  [144  95  55]
  [145  99  57]
  [137  91  51]
  [136  89  52]
  [137  90  54]
  [148 102  58]
  [152 106  60]
  [150 103  61]
  [155 110  64]
  [138  94  46]
  [120  76  33]
  [128  84  39]
  [142 102  58]
  [135 103  62]
  [ 90  69  40]
  [ 50  24  11]
  [137 105  60]
  [160 133  70]
  [ 56  31   7]
  [ 53  34  20]]

 [[180 139  96]
  [173 123  42]
  [186 144  30]
  [194 153  25]
  [198 158  34]
  [201 164  36]
  [189 153  32]
  [173 137  32]
  [156 118  38]
  [139  99  38]
  [142  97  49]
  [145  97  56]
  [141  92  52]
  [141  93  52]
  [139  91  51]
  [140  91  53]
  [143  95  58]
  [139  99  60]
  [138  98  60]
  [143  96  56]
  [146  93  43]
  [135  84  33]
  [117  80  38]
  [112  72  29]
  [122  81  39]
  [104  67  30]
  [ 58  31  11]
  [ 34   5   0]
  [131  94  57]
  [184 148  94]
  [ 97  62  34]
  [ 83  53  34]]

 [[177 144 116]
  [168 129  94]
  [179 142  87]
  [188 149  67]
  [202 168  68]
  [218 189  76]
  [218 191  72]
  [207 181  70]
  [191 163  79]
  [175 143  82]
  [166 132  86]
  [163 128  92]
  [163 127  94]
  [161 123  92]
  [153 114  84]
  [159 120  90]
  [162 124  93]
  [149 116  91]
  [140 104  83]
  [148 103  77]
  [161 105  69]
  [144  95  55]
  [112  90  59]
  [119  91  58]
  [130  96  65]
  [120  87  59]
  [ 92  67  46]
  [103  78  57]
  [170 140 104]
  [216 184 140]
  [151 118  84]
  [123  92  72]]]

To which pixels of the image do the numbers of the first two innermost lines of the tensor refer: [ 59 62 63] and [ 43 46 45]?