问:
How to request a fullscreen on new window?
I want to make an element on my document into a fullscreen display but to do so on a new browser window. If you Alt+Tab on your screen, it will show both the new fullscreen element as well as the original document body on two separate windows.

The reason why I wanted to do this is because I am currently running a dual-monitor setup such that the element will be displayed on the second monitor instead of the first when you go fullscreen using the following Javascript snippet which I have done successfully. Source.

```<code>const screenDetails = await window.getScreenDetails()
if (screenDetails.screens.length > 1) {
        var elem = document.querySelector("#defect-map-table-main")

        try {
          const projectorScreen = screenDetails.screens[1]
          console.log(projectorScreen)
          await elem.requestFullscreen({screen: projectorScreen})
        } catch (err) {
          console.error(err.name, err.message)
        }
}
</code>```

Body:
I want to make an element on my document into a fullscreen display but to do so on a new browser window. If you Alt+Tab on your screen, it will show both the new fullscreen element as well as the original document body on two separate windows.

The reason why I wanted to do this is because I am currently running a dual-monitor setup such that the element will be displayed on the second monitor instead of the first when you go fullscreen using the following Javascript snippet which I have done successfully. Source.

const screenDetails = await window.getScreenDetails()
if (screenDetails.screens.length > 1) {
        var elem = document.querySelector("#defect-map-table-main")

        try {
          const projectorScreen = screenDetails.screens[1]
          console.log(projectorScreen)
          await elem.requestFullscreen({screen: projectorScreen})
        } catch (err) {
          console.error(err.name, err.message)
        }
}


来源: stackexchange

问:
Compatibility issue between Rust's crates tokio and hidapi
I need to use hid device with tokio. I am using tokio="1.22.0" and hidapi="2.0.2". Here is a code snippet with shorthands.

pub async fn new_hid(     to_net : tokio::syn::cmpsc::Sender<Vec<u8>>,
                    mut from_net : tokio::syn::mpsc::Receiver<Vec<u8>>,
                    ) -> Result<(), Box<dyn Error>> {
    let api = HidApi::new()?;
    for d in api.device_list() {
        if d.vendor_id()==VENDOR_ID && d.product_id()==PRODUCT_ID {
            let d=d.open_device(&api)?; // ***** d is HidDevice *****
            d.set_blocking_mode(false)?;
            let d=Arc::new(Mutex::new(d));
            // let d=d.clone();
            tokio::spawn(async move {
                let mut inbuf  = vec![0u8;HID_INPUT_REPORT_SZ+1];
                let mut outbuf = vec![0u8;HID_OUTPUT_REPORT_SZ+1];
                'outer: loop {
                    'read: loop {
                        if let Ok(sz) = d.lock().unwrap().read(&mut inbuf){
                            if sz>1 {
                                if let Err(_) = to_net.send(Vec::from(& inbuf[1..=sz])).await {
                                    break 'outer;
                                }
                            }else{
                                break 'read;
                            }
                        }else{
                            break 'outer;
                        }
                    }
                    match from_net.recv().await {
                        Some(b) => {
                            outbuf[1 ..= b.len()].copy_from_slice(b);
                            if let Err(r) = d.lock().unwrap().send_feature_report(&outbuf[ ..= b.len()]) {
                                break 'outer;
                            }
                        },
                        None => {
                            break 'outer;
                        }
                    }
                    sleep(Duration::from_millis(50)).await;
                }
            });
            return Ok(())
        }
    }
    Err(Box::new(io::Error::new(io::ErrorKind::NotFound,"device not found")))
}
```
<p>But the compiler reports an error</p>
<blockquote>
```error: future cannot be sent between threads safely
help: within `HidDevice`, the trait `Sync` is not implemented for `*mut c_void`
note: future is not `Send` as this value is used across an await
```

How can hidapi::HidDevice be used in asynchronous programming with tokio?

ContentLicense: CC BY-SA 4.0

Body:
I need to use hid device with tokio. I am using tokio="1.22.0" and hidapi="2.0.2". Here is a code snippet with shorthands.

pub async fn new_hid(     to_net : tokio::syn::cmpsc::Sender<Vec<u8>>,
                    mut from_net : tokio::syn::mpsc::Receiver<Vec<u8>>,
                    ) -> Result<(), Box<dyn Error>> {
    let api = HidApi::new()?;
    for d in api.device_list() {
        if d.vendor_id()==VENDOR_ID && d.product_id()==PRODUCT_ID {
            let d=d.open_device(&api)?; // ***** d is HidDevice *****
            d.set_blocking_mode(false)?;
            let d=Arc::new(Mutex::new(d));
            // let d=d.clone();
            tokio::spawn(async move {
                let mut inbuf  = vec![0u8;HID_INPUT_REPORT_SZ+1];
                let mut outbuf = vec![0u8;HID_OUTPUT_REPORT_SZ+1];
                'outer: loop {
                    'read: loop {
                        if let Ok(sz) = d.lock().unwrap().read(&mut inbuf){
                            if sz>1 {
                                if let Err(_) = to_net.send(Vec::from(& inbuf[1..=sz])).await {
                                    break 'outer;
                                }
                            }else{
                                break 'read;
                            }
                        }else{
                            break 'outer;
                        }
                    }
                    match from_net.recv().await {
                        Some(b) => {
                            outbuf[1 ..= b.len()].copy_from_slice(b);
                            if let Err(r) = d.lock().unwrap().send_feature_report(&outbuf[ ..= b.len()]) {
                                break 'outer;
                            }
                        },
                        None => {
                            break 'outer;
                        }
                    }
                    sleep(Duration::from_millis(50)).await;
                }
            });
            return Ok(())
        }
    }
    Err(Box::new(io::Error::new(io::ErrorKind::NotFound,"device not found")))
}

But the compiler reports an error

error: future cannot be sent between threads safely
help: within `HidDevice`, the trait `Sync` is not implemented for `*mut c_void`
note: future is not `Send` as this value is used across an await

How can hidapi::HidDevice be used in asynchronous programming with tokio?


问:
VBA Editor: Letter capitalization vs scope of variables
I realized that VBA Editor (Excel 2019 VBE) change case of variables when you have different variables (different scope) but same name with different case.
For example, we have the code below, which have 3 "variables" Var1, Var2 and Var3, and it works fine:

```<code>Const Var1 As Long = 1
Dim Var2 As Long

Public Property Get Var3() As Long
    Var3 = 3
End Property

Sub Test_A()
    Debug.Print Var1, Var2, Var3 'prints 1 0 3
End Sub
</code>```

IF we add a second subroutine Test_B, and inside it we declare 3 variables with same name but different case, var1, var2 and var3, the code still works just fine, but all 6 variables (3 module level and 3 subroutine level) change case to be in the same case as the last one declared (so module-level Var1 change to var1 because I've just declared a subroutine-level var1).

```<code>Const var1 As Long = 1
Dim var2 As Long

Public Property Get var3() As Long
    var3 = 3
End Property

Sub Test_A()
    Debug.Print var1, var2, var3 '1 0 3
End Sub

Sub Test_B()
    Dim var1 As Long, var2 As Long, var3 As Long
    var1 = 10: var2 = 20: var3 = 30
    Debug.Print var1, var2, var3 'prints 10 20 30
End Sub
</code>```

Should that behaviour trying to say something? Is it some real issue to be concerned with? Or is it just fine?

Body:
I realized that VBA Editor (Excel 2019 VBE) change case of variables when you have different variables (different scope) but same name with different case.
For example, we have the code below, which have 3 "variables" Var1, Var2 and Var3, and it works fine:

Const Var1 As Long = 1
Dim Var2 As Long

Public Property Get Var3() As Long
    Var3 = 3
End Property

Sub Test_A()
    Debug.Print Var1, Var2, Var3 'prints 1 0 3
End Sub

IF we add a second subroutine Test_B, and inside it we declare 3 variables with same name but different case, var1, var2 and var3, the code still works just fine, but all 6 variables (3 module level and 3 subroutine level) change case to be in the same case as the last one declared (so module-level Var1 change to var1 because I've just declared a subroutine-level var1).

Const var1 As Long = 1
Dim var2 As Long

Public Property Get var3() As Long
    var3 = 3
End Property

Sub Test_A()
    Debug.Print var1, var2, var3 '1 0 3
End Sub

Sub Test_B()
    Dim var1 As Long, var2 As Long, var3 As Long
    var1 = 10: var2 = 20: var3 = 30
    Debug.Print var1, var2, var3 'prints 10 20 30
End Sub

Should that behaviour trying to say something? Is it some real issue to be concerned with? Or is it just fine?


问:
Error Running Python Script from Batch File from the remote machine FileNotFoundError: [Errno 2] No such file or directory: '[]'
I have a python script in a server. I am able to execute this from the local server using a batch script. But when I try to execute this same batch file from remote server I get this error.

"can't open file 'E:\test.py': [Errno 2] No such file or directory"

This is the bat file we are using. In place of servername we have the server where the test.py file is placed.

```<code>@echo off
pushd "\\servername\c$\"
"Program Files\Python310\python.exe" "E:\test.py"
</code>```

Note: When I run this:

```<code>@echo off
pushd "\\servername\c$\"
"Program Files\Python310\python.exe"
</code>```

Python is opened with the same version that I have in the local server. I tested with os.listdir(/) all the files in the C drive of that local server gets printed.

Could someone please help here.

Thanks in advance

I want the python file to be executed from the remote machine using batch script.

Body:
I have a python script in a server. I am able to execute this from the local server using a batch script. But when I try to execute this same batch file from remote server I get this error.

"can't open file 'E:\test.py': [Errno 2] No such file or directory"

This is the bat file we are using. In place of servername we have the server where the test.py file is placed.

@echo off
pushd "\\servername\c$\"
"Program Files\Python310\python.exe" "E:\test.py"

Note: When I run this:

@echo off
pushd "\\servername\c$\"
"Program Files\Python310\python.exe"

Python is opened with the same version that I have in the local server. I tested with os.listdir(/) all the files in the C drive of that local server gets printed.

Could someone please help here.

Thanks in advance

I want the python file to be executed from the remote machine using batch script.


问:
Error in webview "net::ERR_UNKNOWN_URL_SCHEME" in flutter
I encountered a problem in the webview (flatter) that I cannot solve in any way. When I go to the checkout page, I get the following error "intent://". I was looking for a solution to this problem but could not find it. Has anyone faced this problem??

          body: WebView(
            javascriptMode: JavascriptMode.unrestricted,
            initialUrl: widget.dateFromOrder.urlForPay,
            onWebViewCreated: (WebViewController webViewController) {
              controller = webViewController;
            },
            onPageFinished: (url) {
              url;
            },
          ),```


问:
is this possible to insert List<BilledItemModel> type values to sqflite database?

foodModel.dart

```<code>class foodModel{
  String foodName;
  int rate;
  bool isVeg;

  foodModel({required this.foodName,required this.rate,this.isVeg = false});
}
</code>```

billedItemModel.dart

```<code>import 'package:sqflite_example/models/foodModel.dart';

class BilledItemModel{
  foodModel itemDetails;
  int Qty;
  int totalAmount;

  BilledItemModel({required this.itemDetails, required this.Qty, required this.totalAmount});
}
</code>```

datas.dart

```<code>import 'package:sqflite_example/models/billedItemModel.dart';
import 'package:sqflite_example/models/foodModel.dart';

List<BilledItemModel> foods = [BilledItemModel(itemDetails: foodModel(foodName: "curry",rate: 50), Qty: 3, totalAmount: 150),
BilledItemModel(itemDetails: foodModel(foodName: "beef",rate: 70), Qty: 2, totalAmount: 140),
];

</code>```

// is this possible to insert List type values to sqflite database ??

```<code>

</code>```

db.insert(List allOrders,int grandTotalAmount)

Body:
foodModel.dart

class foodModel{
  String foodName;
  int rate;
  bool isVeg;

  foodModel({required this.foodName,required this.rate,this.isVeg = false});
}

billedItemModel.dart

import 'package:sqflite_example/models/foodModel.dart';

class BilledItemModel{
  foodModel itemDetails;
  int Qty;
  int totalAmount;

  BilledItemModel({required this.itemDetails, required this.Qty, required this.totalAmount});
}

datas.dart

import 'package:sqflite_example/models/billedItemModel.dart';
import 'package:sqflite_example/models/foodModel.dart';

List<BilledItemModel> foods = [BilledItemModel(itemDetails: foodModel(foodName: "curry",rate: 50), Qty: 3, totalAmount: 150),
BilledItemModel(itemDetails: foodModel(foodName: "beef",rate: 70), Qty: 2, totalAmount: 140),
];

// is this possible to insert List type values to sqflite database ??

db.insert(List allOrders,int grandTotalAmount)


问:
When using Microsoft.Azure.WebJobs.Extensions.OpenApi for swagger how can you make enum return with their names? C#
We create lots of Azure functions and I know using Swashbuckle you can add ISchemaFilter to create x-enumNames for your enum.  I would ideally like to use Microsoft.Azure.WebJobs.Extensions.OpenApi alone though to save having to add the additional http functions and startup configuration that swashbuckle requires.  This seem simple enough, but I was unable to find any way to do this at all using the Azure Open API</p>


问:
Facebook Secure Login with App Engine Proxy
Trying to make an app engine proxy server that lets me access facebook from sites that block it.

I follow the tutorial at http://lifehacker.com/5484934/run-your-own-free-proxy-through-the-google-app-engine
but it seems like secure logins are not supported.
I know there are proxy websites that let me access, but i don't like the idea of my password floating past a middleman.
Any idea on how to implement an app engine proxy with secure login support?

ContentLicense: CC BY-SA 3.0


问:
List sub Mailfolders using Microsoft Graph Authentication
I am building a console application in C#.
I want to Microsoft Graph Authentication to access Mailbox and list the Milfolders so I can use the authentication part  my Organization.

Below is the code I am using:

```<code>namespace ConsoleApp1
{
    public class Program

    {
       public static void Main(string[] args)
        {

            var scopes = new string[] { "https://graph.microsoft.com/.default" };

            var tenantId = ConfigurationManager.AppSettings["APP_TENANT_ID"];

            var clientId = ConfigurationManager.AppSettings["APP_CLIENT_ID"];
            var clientSecret = ConfigurationManager.AppSettings["APP_CLIENT_SECRET"];

            // using Azure.Identity;
            var options = new TokenCredentialOptions
            {
                AuthorityHost = AzureAuthorityHosts.AzurePublicCloud
            };

            var clientSecretCredential = new ClientSecretCredential(
                tenantId, clientId, clientSecret, options);

            var graphClient = new GraphServiceClient(clientSecretCredential, scopes);

            try
            {
                var mailFolder = graphClient.Me.MailFolders
                                 .Request()
                 .Expand("childFolders");

                var task = System.Threading.Tasks.Task.Run(async () => await mailFolder.GetAsync());

                var authResult = task.Result;

                Console.WriteLine(authResult);
                Console.ReadLine();

            }
            catch (Exception ex)
            {
                Console.WriteLine("error:" + ex);
            }

        }
    }
}

</code>```

But it is giving the below exeception.
enter image description here

Body:
I am building a console application in C#.
I want to Microsoft Graph Authentication to access Mailbox and list the Milfolders so I can use the authentication part  my Organization.

Below is the code I am using:

namespace ConsoleApp1
{
    public class Program

    {
       public static void Main(string[] args)
        {

            var scopes = new string[] { "https://graph.microsoft.com/.default" };

            var tenantId = ConfigurationManager.AppSettings["APP_TENANT_ID"];

            var clientId = ConfigurationManager.AppSettings["APP_CLIENT_ID"];
            var clientSecret = ConfigurationManager.AppSettings["APP_CLIENT_SECRET"];

            // using Azure.Identity;
            var options = new TokenCredentialOptions
            {
                AuthorityHost = AzureAuthorityHosts.AzurePublicCloud
            };

            var clientSecretCredential = new ClientSecretCredential(
                tenantId, clientId, clientSecret, options);

            var graphClient = new GraphServiceClient(clientSecretCredential, scopes);

            try
            {
                var mailFolder = graphClient.Me.MailFolders
                                 .Request()
                 .Expand("childFolders");

                var task = System.Threading.Tasks.Task.Run(async () => await mailFolder.GetAsync());

                var authResult = task.Result;

                Console.WriteLine(authResult);
                Console.ReadLine();

            }
            catch (Exception ex)
            {
                Console.WriteLine("error:" + ex);
            }

        }
    }
}

But it is giving the below exeception.
enter image description here


问:
How to use enums as parameter for policy-based authorization in ASP.NET MCV controllers?
I was trying to implement policy-based authorization on ASP.NET MVC 5 and I was able to make it work (with this).

But I'd like to replace the magic strings like in the following example...

```<code>[PolicyAuthorize(Policy = "Admin")]
        public ActionResult Index()
        {
            return View();
        }
</code>```

... with Enums somewhat like this:

```<code>[PolicyAuthorize(Policy.Admin & Policy.Owner)]
        public ActionResult Index()
        {
            return View();
        }
</code>```

I've read on this post that it can be done by creating a custom attribute with the following example but I just can't figure out how to implement it properly:

```<code>public class AuthorizeRoles : AuthorizeAttribute
{
    public AuthorizeRoles(params MyEnum[] roles)
    {
        ...
    }
    protected override bool AuthorizeCore(HttpContextBase httpContext)
    {
        ...
    }
}
</code>```

That's the custom ResourceAuthorizeAttribute I made for that:

```<code>[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
public class PolicyAuthorizeAttribute : Microsoft.Owin.Security.Authorization.Mvc.ResourceAuthorizeAttribute
{
    public Policy[] Policies { get; }

    public PolicyAuthorizeAttribute(params Policy[] policies)
    {

    }

    protected override void HandleUnauthorizedRequest(System.Web.Mvc.AuthorizationContext filterContext)
    {
        if (filterContext.HttpContext.Request.IsAuthenticated)
        {
            filterContext.Result = new System.Web.Mvc.HttpStatusCodeResult((int)System.Net.HttpStatusCode.Forbidden);
        }
        else
        {
            base.HandleUnauthorizedRequest(filterContext);
        }
    }
}
</code>```

My Policy Enum:

```<code>public enum Policy
{
    Admin = 1,
    Office = 2,
    Teacher = 3,
    Student = 4,
    Owner = 5
}
</code>```

My Startup class wuth the policies:

```<code>public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        ConfigureAuth(app);

        app.UseAuthorization(options =>
        {
            options.AddPolicy(Policy.Admin.ToString(), policy => policy.RequireRole(Rolle.Admin.ToString()));
            options.AddPolicy(Policy.Office.ToString(), policy => policy.RequireRole(Rolle.Office.ToString()));
            options.AddPolicy(Policy.Teacher.ToString(), policy => policy.RequireRole(Rolle.Teacher.ToString()));
            options.AddPolicy(Policy.Student.ToString(), policy => policy.RequireRole(Rolle.Student.ToString()));
            // still working on the following policy
            //options.AddPolicy(Policy.Owner.ToString(), policy => policy);
        });
    }
}
</code>```

I'd be very grateful for any help!

Body:
I was trying to implement policy-based authorization on ASP.NET MVC 5 and I was able to make it work (with this).

But I'd like to replace the magic strings like in the following example...

[PolicyAuthorize(Policy = "Admin")]
        public ActionResult Index()
        {
            return View();
        }

... with Enums somewhat like this:

[PolicyAuthorize(Policy.Admin & Policy.Owner)]
        public ActionResult Index()
        {
            return View();
        }

I've read on this post that it can be done by creating a custom attribute with the following example but I just can't figure out how to implement it properly:

public class AuthorizeRoles : AuthorizeAttribute
{
    public AuthorizeRoles(params MyEnum[] roles)
    {
        ...
    }
    protected override bool AuthorizeCore(HttpContextBase httpContext)
    {
        ...
    }
}

That's the custom ResourceAuthorizeAttribute I made for that:

[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
public class PolicyAuthorizeAttribute : Microsoft.Owin.Security.Authorization.Mvc.ResourceAuthorizeAttribute
{
    public Policy[] Policies { get; }

    public PolicyAuthorizeAttribute(params Policy[] policies)
    {

    }

    protected override void HandleUnauthorizedRequest(System.Web.Mvc.AuthorizationContext filterContext)
    {
        if (filterContext.HttpContext.Request.IsAuthenticated)
        {
            filterContext.Result = new System.Web.Mvc.HttpStatusCodeResult((int)System.Net.HttpStatusCode.Forbidden);
        }
        else
        {
            base.HandleUnauthorizedRequest(filterContext);
        }
    }
}

My Policy Enum:

public enum Policy
{
    Admin = 1,
    Office = 2,
    Teacher = 3,
    Student = 4,
    Owner = 5
}

My Startup class wuth the policies:

public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        ConfigureAuth(app);

        app.UseAuthorization(options =>
        {
            options.AddPolicy(Policy.Admin.ToString(), policy => policy.RequireRole(Rolle.Admin.ToString()));
            options.AddPolicy(Policy.Office.ToString(), policy => policy.RequireRole(Rolle.Office.ToString()));
            options.AddPolicy(Policy.Teacher.ToString(), policy => policy.RequireRole(Rolle.Teacher.ToString()));
            options.AddPolicy(Policy.Student.ToString(), policy => policy.RequireRole(Rolle.Student.ToString()));
            // still working on the following policy
            //options.AddPolicy(Policy.Owner.ToString(), policy => policy);
        });
    }
}

I'd be very grateful for any help!


问:
Cloudinary get video duration with resources
How to get Cloudinary video duration along with the other properties using Node.js & cloudinary.v2.api.resources?

Haven't you read the other posts about the topic? Yes I have. They all say pass in image_metadata: true. Does not work.

I am searching like this:

```<code>cloudinary.api.resources(
  {
    ...
    image_metadata: true,
  },
  (err: any, result: any) => {
    console.log(err, result);
  }
);
</code>```

Passing in image_metadata: true, does not return video duration. Well, it does not change anything to be fair, while I get everything else I want.

Am I missing an update on this? Been searching for it a while now but no result.
Thanks for any suggestions!

Body:
How to get Cloudinary video duration along with the other properties using Node.js & cloudinary.v2.api.resources?

Haven't you read the other posts about the topic? Yes I have. They all say pass in image_metadata: true. Does not work.

I am searching like this:

cloudinary.api.resources(
  {
    ...
    image_metadata: true,
  },
  (err: any, result: any) => {
    console.log(err, result);
  }
);

Passing in image_metadata: true, does not return video duration. Well, it does not change anything to be fair, while I get everything else I want.

Am I missing an update on this? Been searching for it a while now but no result.
Thanks for any suggestions!


问:
Groovy findFiles doesn't find .info files
```<code>f = findFiles(glob: '**xml')
f.each { cov_file->
    println cov_file
}
</code>```

The above code lists xml file whereas fails to print *.info lcov files when I use **info. The xml and info are in the same directory(current directory and also in sub dirs). The above steps are configured in a jenkins pipeline script. jenkins version - 2.346.3

Body:
f = findFiles(glob: '**xml')
f.each { cov_file->
    println cov_file
}

The above code lists xml file whereas fails to print *.info lcov files when I use **info. The xml and info are in the same directory(current directory and also in sub dirs). The above steps are configured in a jenkins pipeline script. jenkins version - 2.346.3


问:
Entity Framework: When Applying migration I get: The ConnectionString property has not been initialized
I am trying to add a new field to one of my existing tables on azure. I create a migration to my db and it generates a migration file and a snapshot.

If I now try to apply the migration it fails with this error:

```<code>The ConnectionString property has not been initialized..
</code>```

Which is redicuouls, because I am able to deploy to azure and use my DB just fine, meaning the connection string WAS initialized and everything was working.

Here is the full error:

This is the migrationcontext:

```<code>public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<MigrationDbContext>
{
    public MigrationDbContext CreateDbContext(string[] args)
    {
        IConfigurationRoot configuration = new ConfigurationBuilder()
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json")
            .Build();
        var builder = new DbContextOptionsBuilder<MigrationDbContext>();
        var connectionString = configuration.GetConnectionString("C10");
        builder.UseSqlServer(connectionString);
        return new MigrationDbContext(builder.Options);
    }
}
public partial class MigrationDbContext : DbContext
{
    public MigrationDbContext()
    {
    }

    public MigrationDbContext(DbContextOptions<MigrationDbContext> options): base(options)
    {
    }

    public DbSet<UserItem> User => Set<UserItem>();
    public DbSet<UserDetailItem> UserDetail => Set<UserDetailItem>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<UserItem>(entity =>
        {
            entity.Property(e => e.Email).IsRequired();
            entity.Property(e => e.Password).IsRequired();

            entity.Property(e => e.Version)
                .IsRowVersion()
                .IsConcurrencyToken();
        });

        modelBuilder.Entity<UserDetailItem>(entity =>
        {
            entity.Property(e => e.Version)
                .IsRowVersion()
                .IsConcurrencyToken();
        });

        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
</code>```

Why is it failing? :(

EDIT:

This is my appsettings.json file:

```<code>{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=NewDb;Trusted_Connection=True"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
</code>```

... however, I dont use a localDB. In my connected services I set up connectionstring c10 to connect to azure. I dont know if this might cause any issues?

Body:
I am trying to add a new field to one of my existing tables on azure. I create a migration to my db and it generates a migration file and a snapshot.

If I now try to apply the migration it fails with this error:

The ConnectionString property has not been initialized..

Which is redicuouls, because I am able to deploy to azure and use my DB just fine, meaning the connection string WAS initialized and everything was working.

Here is the full error:

This is the migrationcontext:

public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<MigrationDbContext>
{
    public MigrationDbContext CreateDbContext(string[] args)
    {
        IConfigurationRoot configuration = new ConfigurationBuilder()
            .SetBasePath(Directory.GetCurrentDirectory())
            .AddJsonFile("appsettings.json")
            .Build();
        var builder = new DbContextOptionsBuilder<MigrationDbContext>();
        var connectionString = configuration.GetConnectionString("C10");
        builder.UseSqlServer(connectionString);
        return new MigrationDbContext(builder.Options);
    }
}
public partial class MigrationDbContext : DbContext
{
    public MigrationDbContext()
    {
    }

    public MigrationDbContext(DbContextOptions<MigrationDbContext> options): base(options)
    {
    }

    public DbSet<UserItem> User => Set<UserItem>();
    public DbSet<UserDetailItem> UserDetail => Set<UserDetailItem>();

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<UserItem>(entity =>
        {
            entity.Property(e => e.Email).IsRequired();
            entity.Property(e => e.Password).IsRequired();

            entity.Property(e => e.Version)
                .IsRowVersion()
                .IsConcurrencyToken();
        });

        modelBuilder.Entity<UserDetailItem>(entity =>
        {
            entity.Property(e => e.Version)
                .IsRowVersion()
                .IsConcurrencyToken();
        });

        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}

Why is it failing? :(

EDIT:

This is my appsettings.json file:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=NewDb;Trusted_Connection=True"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}

... however, I dont use a localDB. In my connected services I set up connectionstring c10 to connect to azure. I dont know if this might cause any issues?


问:
Infinite Scrolling Text in 2 rows
I am building a scrolling text RSS feed based on this solution:
https://ryanmulligan.dev/blog/css-marquee/

But the text should be duplicated into a second row. In the second row the text should enter the viewport on the right side when text exits the left side of the first row.

I have tried to place a 100vw (or 100%) left padding on the second row, but it breaks the logic of the continuous loop.

Here is the example: https://codepen.io/hexagoncircle/pen/eYMrGwW

Does anyone have an idea how to create infinite scrolling text within 2 rows based on the CodePen example?

```<code>    <div>
    <div class="marquee">
        <div class="marquee__content"></div>

        <div aria-hidden="true" class="marquee__content"></div>
    </div>

    <div class="marquee2">
        <!-- <div class="empty-div"></div> -->
        <div class="marquee__content2"></div>

        <div aria-hidden="true" class="marquee__content2"></div>
    </div>
</div>

<style>
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - var(--gap)));
  }
}

@keyframes scroll2 {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - var(--gap2)));
  }
}

.marquee {
  --gap: 0.1rem;
  position: relative;
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--gap);
}

.marquee__content {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  gap: var(--gap);
}

.marquee__content {
  animation: scroll 15s linear infinite;
}

.marquee__content > * {
  flex: 0 0 auto;
  color: white;
  text-align: center;
}

.marquee2 {
  --gap2: 0.1rem;
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--gap2);
}

.marquee__content2 {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  gap: var(--gap2);
}

.marquee__content2 {
  animation: scroll2 15s linear infinite;
}

.marquee__content2 > * {
  flex: 0 0 auto;
  color: white;
  text-align: center;
}

* {
  box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    font-size: 25vh;
}

img {
    transform: scale(1.6) translate(0, 10%);
    height: 25vh;
}
</code>```

Title: Infinite Scrolling Text in 2 rows


问:
Email is not sending to Mailchimp API Data Center

Type in my email in the newsletter

Email get load in the JSON data

Email will be sent to Mailchimp Data Center

Error of undefined.api.mailchimp.com trying to figure out why is the server not detecting are Mailchimp API

What are some suggestions or advice you can give me?

How can I move forward to solving this issue?

Image of the terminal error message.

If you would like to review the code: the server.js please clicked on the link below:
https://github.com/brandonpowell/pw-2023/blob/error/src/backend/server.js

I have console.log to figure out what happening but not give me clear understand of what getting this error in the first place an just saying that the undefined.api.mailchimp but where the undefined is at that where the data center number and letter should be at.

```<code>    request(options, function(error, response, body) {
      console.log('error:', error);
      console.log('statusCode:', response && response.statusCode); //print the response status code if a response was received.
      console.log('body:', body);

        try {// eslint-disable-next-line react/no-typos
            var respObj = {}; //Initial response object...
            if ( response.statusCode === 200) {//What is the statusCode for Mailchimp API?....
              respObj = { success: `Subscribed using ${email}!`, message: JSON.parse(response.body) };
              console.log(respObj.statusCode);
            } else {
              respObj = { error: `Error trying to subscribe ${email}. Please try again.`, message: JSON.parse(response.body) };
            }
            res.send(respObj);
            return next();
          } catch (err) {
            console.log(err);
            var respErrorObj = { error: 'There was an error with your request', message: err.message };
             //This message just for the developer to see what going on.
            res.send(respErrorObj);
            return next();
        }
    });
</code>```

Body:
Type in my email in the newsletter

Email get load in the JSON data

Email will be sent to Mailchimp Data Center

Error of undefined.api.mailchimp.com trying to figure out why is the server not detecting are Mailchimp API

What are some suggestions or advice you can give me?

How can I move forward to solving this issue?

Image of the terminal error message.

If you would like to review the code: the server.js please clicked on the link below:
https://github.com/brandonpowell/pw-2023/blob/error/src/backend/server.js

I have console.log to figure out what happening but not give me clear understand of what getting this error in the first place an just saying that the undefined.api.mailchimp but where the undefined is at that where the data center number and letter should be at.

    request(options, function(error, response, body) {
      console.log('error:', error);
      console.log('statusCode:', response && response.statusCode); //print the response status code if a response was received.
      console.log('body:', body);

        try {// eslint-disable-next-line react/no-typos
            var respObj = {}; //Initial response object...
            if ( response.statusCode === 200) {//What is the statusCode for Mailchimp API?....
              respObj = { success: `Subscribed using ${email}!`, message: JSON.parse(response.body) };
              console.log(respObj.statusCode);
            } else {
              respObj = { error: `Error trying to subscribe ${email}. Please try again.`, message: JSON.parse(response.body) };
            }
            res.send(respObj);
            return next();
          } catch (err) {
            console.log(err);
            var respErrorObj = { error: 'There was an error with your request', message: err.message };
             //This message just for the developer to see what going on.
            res.send(respErrorObj);
            return next();
        }
    });


问:
Xcode There is no XCFramework found on Flutter SDK Pluggin
I just merge from my old developer that already gone, he developing a feature using flutter and he put the SDK into the project, but I cannot run the project on my production env cause apparently the SDK doesn't have XCFramework for my production env, is there any way I can install or add this SDK XCFramework into my current production env?

this is what I got from my Xcode everytime i run the project on prod env

can anyone knows how to solve this? or maybe how do i add this sdk plugin into my "Production" env to my project, cause the last developer embed this a long time ago and the code base have a lot of changes since then.

Thank you


问:
symbol visibility for member functions of explicit specializations
I'm building an extensible "type system" in C++ that, amongst other things, needs to map C++ float types to my "wobbly types". The mechanism I've devised for this is to construct a helper struct, templated by the concrete C++ type, that has a single static function get_type that returns a pointer to my type:

template <typename T> struct type_helper {
    static const my_type* get_type();
};
```
<p>Now the common types like <code>float</code> and <code>double</code> have a specialization of this struct, and the corresponding <code>get_type</code> method is defined in a cpp file:</p>
<pre class="lang-cpp prettyprint-override"><code>// in types.h
template <> const my_type* type_helper<float>::get_type();

// in float_type.cpp
#include "types.h"
template <> const my_type* type_helper<float>::get_type() {
    static const float_type ftype;
    return &ftype;
}
</code>```

Note that the definition of float_type is not externally visible, and nor should it be.

This works great inside the shared library in which these objects are commonly defined, but I need the symbols to be visible outside for the other components of the library to find. Using the standard design, I've got a macro EXPORT_SYMBOL that is replaced by __attribute__((visiblity('default')) on GCC (for example) that I use to make symbols linkable. However, simply adding this attribute to the specialized declarations doesn't seem to have the desired effect, and neither does adding it to the primary template. (E.g.

template <> EXPORT_SYMBOL const my_type* type_helper<float>::get_type();
```

It seems to me that the "correct" strategy for this particular problem is to declare an extern template specialization of the primary template but, to my knowledge, that doesn't allow for specializing definition of individual member functions. What is the "correct" way to solve this problem?

I want to add that this is for the other library components and not the "user facing" part of the interface. For them, there is a type registration system and a separate retrieval function (with no templates, using a type id string) that all works fine.

Body:
I'm building an extensible "type system" in C++ that, amongst other things, needs to map C++ float types to my "wobbly types". The mechanism I've devised for this is to construct a helper struct, templated by the concrete C++ type, that has a single static function get_type that returns a pointer to my type:

template <typename T> struct type_helper {
    static const my_type* get_type();
};

Now the common types like float and double have a specialization of this struct, and the corresponding get_type method is defined in a cpp file:

// in types.h
template <> const my_type* type_helper<float>::get_type();

// in float_type.cpp
#include "types.h"
template <> const my_type* type_helper<float>::get_type() {
    static const float_type ftype;
    return &ftype;
}

Note that the definition of float_type is not externally visible, and nor should it be.

This works great inside the shared library in which these objects are commonly defined, but I need the symbols to be visible outside for the other components of the library to find. Using the standard design, I've got a macro EXPORT_SYMBOL that is replaced by __attribute__((visiblity('default')) on GCC (for example) that I use to make symbols linkable. However, simply adding this attribute to the specialized declarations doesn't seem to have the desired effect, and neither does adding it to the primary template. (E.g.

template <> EXPORT_SYMBOL const my_type* type_helper<float>::get_type();

It seems to me that the "correct" strategy for this particular problem is to declare an extern template specialization of the primary template but, to my knowledge, that doesn't allow for specializing definition of individual member functions. What is the "correct" way to solve this problem?

I want to add that this is for the other library components and not the "user facing" part of the interface. For them, there is a type registration system and a separate retrieval function (with no templates, using a type id string) that all works fine.


问:
Is it possible to allow requests from a specific site?
I use declarativeNetRequest.updateDynamicRules blocking some requests by rules.
I'm blocking bing.com for all sites. But for the site test.com I have to allow sending requests to bing.com .

Using excludedInitiatorDomains I added a rule:

```<code>"condition": {
          "regexFilter": "bing.com",
          "resourceTypes":
            [
              "xmlhttprequest",
            ],
          "excludedInitiatorDomains": ["test.com"]
        }
</code>```

The extension continues to block bing.com on the website test.com.

Did I misunderstand how excludedInitiatorDomains works?
What settings will help me?

Body:
I use declarativeNetRequest.updateDynamicRules blocking some requests by rules.
I'm blocking bing.com for all sites. But for the site test.com I have to allow sending requests to bing.com .

Using excludedInitiatorDomains I added a rule:

"condition": {
          "regexFilter": "bing.com",
          "resourceTypes":
            [
              "xmlhttprequest",
            ],
          "excludedInitiatorDomains": ["test.com"]
        }

The extension continues to block bing.com on the website test.com.

Did I misunderstand how excludedInitiatorDomains works?
What settings will help me?


问:
python Inheritance, super, go two level up
```<code>class GeometricShape
    def __init__(self, x, y) :
        ...
        self._fill = None
        self._outline = "black"
    def draw(self, canvas) :
        canvas.setFill(self._fill)
        canvas.setOutline(self._outline)
class Line(GeometricShape)
    def __init__(self, x1, y1, x2, y2) :
        super().__init__(min(x1, x2), min(y1, y2))
    ...
    def draw(self, canvas) :
       super().draw(canvas)
       canvas.drawLine(self._startX, self._startY, self._endX, self._endY
class DashedLine(Line)
    def __init(x1,y1,x2,y2, dash, space)
        super().__init__(x1,y1,x2,y2)
    def draw(self, canvas) :
       super().super().draw(canvas)
</code>```

In DashedLine I would like override Line.draw(), but want to call GeometricShape.draw() to get the properties in GeometricShape. Is this the right way to do it?

I was trying to call the super function, but two levels up.

Body:
class GeometricShape
    def __init__(self, x, y) :
        ...
        self._fill = None
        self._outline = "black"
    def draw(self, canvas) :
        canvas.setFill(self._fill)
        canvas.setOutline(self._outline)
class Line(GeometricShape)
    def __init__(self, x1, y1, x2, y2) :
        super().__init__(min(x1, x2), min(y1, y2))
    ...
    def draw(self, canvas) :
       super().draw(canvas)
       canvas.drawLine(self._startX, self._startY, self._endX, self._endY
class DashedLine(Line)
    def __init(x1,y1,x2,y2, dash, space)
        super().__init__(x1,y1,x2,y2)
    def draw(self, canvas) :
       super().super().draw(canvas)

In DashedLine I would like override Line.draw(), but want to call GeometricShape.draw() to get the properties in GeometricShape. Is this the right way to do it?

I was trying to call the super function, but two levels up.


问:
Excel color cells based on each column value
I'm coloring a worksheet.

For example,

Value1
Value2

1.2
1.33

1.7
1.12

1.1
1.07

1.0
1.22

Put dark blue on the largest one (1.7 in first column, 1.33 in second column), light blue on the smallest one(1.0 in first column, 1.07 in second column), and a gradient color in the middle according to the order.

My worksheet is a large table with more than 2000 columns and more than 2000 rows.

What I want is that each column has its own rules, not the largest dark blue in the entire worksheet, but each individual column, for example, the largest dark blue in Value1, the largest dark blue in Value2, so that analogy.

If I select the entire worksheet, add a new rule, and select the three-color rule, it will become a rule for the entire sheet.

I can select and add one column at a time, but I have over 2000 rows...that's too time consuming.

Is there any good way for me to do it quickly please? thanks.


问:
Protocols get - set | I couldn't set new value
I cannot add a new value to the dictionary. I can't see the value I added in the URL.
I'm trying to add the genres parameter.

I assign genders to parameters in GameListRequestModel, but I can't see it in the URL, why?

URL on Postman:

https://api.rawg.io/api/games?key=6b4fab3e88ecfake2c15379&genres=4

URL on Xcode Console:

There is no genres.

https://api.rawg.io/api/games?key=6b4fab3e88ec48aab19933b2c153c7c9

Requestable Protocol:

```<code>protocol Requestable {
    var baseURL: String? { get }
    var paths : [String]? { get }
    var parameters : [String : Any]? { get set }
    var headers : [String : String]? { get }
    var method : RequestMethod? { get }
    var body : [String : Any]? { get }

    func generateRequest() -> URLRequest?
    mutating func prepareRequest()
}

extension Requestable {

    var baseURL: String? {
        return ApiConstant.baseUrl.rawValue
    }
    var method: RequestMethod? {
        return .get
    }
    var body: [String : Any]? {
        return nil
    }
    var parameters: [String: Any]? {
        get {
            return [
                "key": "6b4fab3e88ec48aab19933b2c153c7c9"
            ]
        } set { } //genres ?
    }
    var headers: [String : String]? {
        return nil
    }

    mutating func prepareRequest() { }
}
</code>```

GameListRequestModel:

```<code>struct GameListRequestModel: Requestable {
    var paths: [String]?

    private var genres: Int? = nil

    init(paths: [String], genres: Int? = nil) {
        self.paths = paths
        self.genres = genres
        prepareRequest()
    }

    mutating func prepareRequest() {
        guard let genres = genres
        else { return }
        let stringGenres = String(genres)
        self.parameters = [
            "genres": stringGenres
        ]
        print("foo parameters: \(self.parameters)")
    }
}
</code>```

Body:
I cannot add a new value to the dictionary. I can't see the value I added in the URL.
I'm trying to add the genres parameter.

I assign genders to parameters in GameListRequestModel, but I can't see it in the URL, why?

URL on Postman:

https://api.rawg.io/api/games?key=6b4fab3e88ecfake2c15379&genres=4

URL on Xcode Console:

There is no genres.

https://api.rawg.io/api/games?key=6b4fab3e88ec48aab19933b2c153c7c9

Requestable Protocol:

protocol Requestable {
    var baseURL: String? { get }
    var paths : [String]? { get }
    var parameters : [String : Any]? { get set }
    var headers : [String : String]? { get }
    var method : RequestMethod? { get }
    var body : [String : Any]? { get }

    func generateRequest() -> URLRequest?
    mutating func prepareRequest()
}

extension Requestable {

    var baseURL: String? {
        return ApiConstant.baseUrl.rawValue
    }
    var method: RequestMethod? {
        return .get
    }
    var body: [String : Any]? {
        return nil
    }
    var parameters: [String: Any]? {
        get {
            return [
                "key": "6b4fab3e88ec48aab19933b2c153c7c9"
            ]
        } set { } //genres ?
    }
    var headers: [String : String]? {
        return nil
    }

    mutating func prepareRequest() { }
}

GameListRequestModel:

struct GameListRequestModel: Requestable {
    var paths: [String]?

    private var genres: Int? = nil

    init(paths: [String], genres: Int? = nil) {
        self.paths = paths
        self.genres = genres
        prepareRequest()
    }

    mutating func prepareRequest() {
        guard let genres = genres
        else { return }
        let stringGenres = String(genres)
        self.parameters = [
            "genres": stringGenres
        ]
        print("foo parameters: \(self.parameters)")
    }
}


问:
How to keep cursor at chosen pos when value is changing?
Hello my full question is "how to keep cursor at the chosen position while :model.value change on different circumstances?
code example:

```<code><q-input
 :modelValue="article"
 ref="editor"
/>
</code>```

script:

```<code>const article = ref( 'is a very popular animal')

function writeCrocodyle() {
 setInterval(()=>{
  doc_text.insert(0, 'Crocodyle')
 },1000)
}
writeCrocodyle()

/* Pretend this function is called each time when some differences in text show up
 to be more specific in my app is managed by websocket an yjs lib for this question absolute negligible */
function update() {
article.value = doc_text.toString()
editor.value?.getNativeElement().setSelectionRange(pos.value.index, pos.value.index)
}

</code>```

it works this way

```<code>function update() {
 article.value = doc_text.toString()
 setTimeout(()=>{
  editor.value?.getNativeElement().setSelectionRange(pos.value.index, pos.value.index)
 }, 100)
}
</code>```

but then i have un wanted delay. im looking for something like onAfterModelChangeRerender or orher solution please help.

```<code></code>```

Body:
Hello my full question is "how to keep cursor at the chosen position while :model.value change on different circumstances?
code example:

<q-input
 :modelValue="article"
 ref="editor"
/>

script:

const article = ref( 'is a very popular animal')

function writeCrocodyle() {
 setInterval(()=>{
  doc_text.insert(0, 'Crocodyle')
 },1000)
}
writeCrocodyle()

/* Pretend this function is called each time when some differences in text show up
 to be more specific in my app is managed by websocket an yjs lib for this question absolute negligible */
function update() {
article.value = doc_text.toString()
editor.value?.getNativeElement().setSelectionRange(pos.value.index, pos.value.index)
}

it works this way

function update() {
 article.value = doc_text.toString()
 setTimeout(()=>{
  editor.value?.getNativeElement().setSelectionRange(pos.value.index, pos.value.index)
 }, 100)
}

but then i have un wanted delay. im looking for something like onAfterModelChangeRerender or orher solution please help.


问:
Strapi CMS CKEditor html support issue
Using CKEditor 5 marketplace plugin in Strapi CMS.
I want to extend the usage of all html tags.

configured as per documentation.

```<code>htmlSupport: {
          allow: [
            {
              name: /.*/,
              attributes: true,
              classes: true,
              styles: true
            }
          ],
        },
</code>```

Tried adding div to source but it doesn't work when I switch back or even save the data. Gets replaced with p tag only.

Title: Strapi CMS CKEditor html support issue

Body:
Using CKEditor 5 marketplace plugin in Strapi CMS.
I want to extend the usage of all html tags.

configured as per documentation.

htmlSupport: {
          allow: [
            {
              name: /.*/,
              attributes: true,
              classes: true,
              styles: true
            }
          ],
        },

Tried adding div to source but it doesn't work when I switch back or even save the data. Gets replaced with p tag only.


问:
Azure NotificationHub Bulk import is still on Running state only
I followed the sample given by NotificationHub for the bulk import of registrations.

I have an existing NotificationHub and tried to export the registrations and the file was downloaded to the Azure storage container. Added some new tags to the exported file and tried to import the updated file to the same NotificationHub. A jobId was created and the status was running state. It's been more than 24 hours and the status shows still running and the job progress parameter is still showing 0.


问:
How to receive path from internal storage in android and transform it into view?
I'm new to android development and I've been building an app for studies purposes that is supposed to display one of the images selected from the gallery previously in a recyclerview.

```<code>private fun configDocImageDialog(pathGallery: Int, pathCamera: Int) {
        MaterialAlertDialogBuilder(requireContext())
            .setTitle(getString(R.string.camera_or_gallery))
            .setMessage(getString(R.string.image_path))
            .setPositiveButton(getString(R.string.gallery)) { _, _ ->
                val intent = Intent()
                intent.type = "image/*"
                intent.action = Intent.ACTION_GET_CONTENT
                startActivityForResult(Intent.createChooser(intent, "Select: "), pathGallery)
            }.setNegativeButton(getString(R.string.camera)) { _, _ ->
                val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
                startActivityForResult(Intent.createChooser(intent, "Take: "), pathCamera)
            }.setNeutralButton(getString(R.string.cancel)) { dialog, _ ->
                dialog.dismiss()
            }.show()
    }
</code>```

Not I'm not worried about the camera result.
Then receiving the result as:

```<code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if(resultCode == RESULT_OK) {
            val selectedImage = data!!.data
            val pathImage = selectedImage.toString()
            try {
                when (requestCode) {
                    GALLERY_1 -> {
                        binding.imageDoc1.setImageURI(selectedImage)
                    }
                    CAMERA_1 -> {
                        binding.imageDoc1.setImageURI(selectedImage)
                    }
                    GALLERY_2 -> {
                        binding.imageDoc2.setImageURI(selectedImage)
                    }
                    CAMERA_2 -> {
                        binding.imageDoc2.setImageURI(selectedImage)
                    }
                    GALLERY_3 -> {
                        binding.imageDoc3.setImageURI(selectedImage)
                    }
                    CAMERA_3 -> {
                        binding.imageDoc3.setImageURI(selectedImage)
                    }
                }
                imageList.add(pathImage)
            } catch (e: Exception){
                e.printStackTrace()
            }
        }
    }
</code>```

I received as a result from the intent a list with this kind of content:

```<code>content://com.android.providers.media.documents/document/image%3A20

</code>```

And those are saved into the database, the list of paths. /
Is it possible to use this path to my exhibit the image in my adapter? I've been trying different treatments but it always blank.
I've trying to use Picasso as:

```<code>override fun onBindViewHolder(holder: DocViewHolder, position: Int) {
        val doc = docs[position]
        holder.binding.apply {
            Picasso.get()
                .load(doc.docImageList[0])
                .into(imageDoc)
            textDocName.text = doc.title
            textValidity.text = doc.validity
        }
        holder.itemView.setOnClickListener {
            onItemClickListener?.let {
                it(doc)
            }
        }
    }
</code>```

I want to display an image from internal storage in a recyclerview but the image is always blank.
Any ideas how to do it properly? Thanks

Body:
I'm new to android development and I've been building an app for studies purposes that is supposed to display one of the images selected from the gallery previously in a recyclerview.

private fun configDocImageDialog(pathGallery: Int, pathCamera: Int) {
        MaterialAlertDialogBuilder(requireContext())
            .setTitle(getString(R.string.camera_or_gallery))
            .setMessage(getString(R.string.image_path))
            .setPositiveButton(getString(R.string.gallery)) { _, _ ->
                val intent = Intent()
                intent.type = "image/*"
                intent.action = Intent.ACTION_GET_CONTENT
                startActivityForResult(Intent.createChooser(intent, "Select: "), pathGallery)
            }.setNegativeButton(getString(R.string.camera)) { _, _ ->
                val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
                startActivityForResult(Intent.createChooser(intent, "Take: "), pathCamera)
            }.setNeutralButton(getString(R.string.cancel)) { dialog, _ ->
                dialog.dismiss()
            }.show()
    }

Not I'm not worried about the camera result.
Then receiving the result as:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if(resultCode == RESULT_OK) {
            val selectedImage = data!!.data
            val pathImage = selectedImage.toString()
            try {
                when (requestCode) {
                    GALLERY_1 -> {
                        binding.imageDoc1.setImageURI(selectedImage)
                    }
                    CAMERA_1 -> {
                        binding.imageDoc1.setImageURI(selectedImage)
                    }
                    GALLERY_2 -> {
                        binding.imageDoc2.setImageURI(selectedImage)
                    }
                    CAMERA_2 -> {
                        binding.imageDoc2.setImageURI(selectedImage)
                    }
                    GALLERY_3 -> {
                        binding.imageDoc3.setImageURI(selectedImage)
                    }
                    CAMERA_3 -> {
                        binding.imageDoc3.setImageURI(selectedImage)
                    }
                }
                imageList.add(pathImage)
            } catch (e: Exception){
                e.printStackTrace()
            }
        }
    }

I received as a result from the intent a list with this kind of content:

content://com.android.providers.media.documents/document/image%3A20

And those are saved into the database, the list of paths. /
Is it possible to use this path to my exhibit the image in my adapter? I've been trying different treatments but it always blank.
I've trying to use Picasso as:

override fun onBindViewHolder(holder: DocViewHolder, position: Int) {
        val doc = docs[position]
        holder.binding.apply {
            Picasso.get()
                .load(doc.docImageList[0])
                .into(imageDoc)
            textDocName.text = doc.title
            textValidity.text = doc.validity
        }
        holder.itemView.setOnClickListener {
            onItemClickListener?.let {
                it(doc)
            }
        }
    }

I want to display an image from internal storage in a recyclerview but the image is always blank.
Any ideas how to do it properly? Thanks


问:
How to use extract subview in swift playgrounds?
I am trying to learn swift language with swift playgrounds application on ipad. However, I couldn't find how to use the extract subview tool, please help :D

I can't find the extract subview tool in swift playgrounds interface.


问:
Add text after the counter
I want to add text as a unit after the calculator calculates the numbers. The text to be displayed after the counter is a "%" and "st" how do I put it in the code?

```<code><script src="https://cdn.jsdelivr.net/npm/@srexi/purecounterjs/dist/purecounter_vanilla.js"></script><script>new PureCounter({// Setting that can't' be overriden on pre-elementselector: '.tips',      // HTML query selector for spesific element
</code>```
```<code>// Settings that can be overridden on per-element basis, by \`data-purecounter-\*\` attributes:
start: 190000,                      // Starting number \[unit\]
end: 200000,                        // End number \[unit\]
duration: 6,                    // The time in seconds for the animation to complete \[seconds\]
delay: 10,                      // The delay between each iteration (the default of 10 will produce 100 fps) \[miliseconds\]
once: true,                     // Counting at once or recount when the element in view \[boolean\]
repeat: false,                  // Repeat count for certain time \[boolean:false|seconds\]
decimals: 0,                    // How many decimal places to show. \[unit\]
legacy: true,                   // If this is true it will use the scroll event listener on browsers
filesizing: false,              // This will enable/disable File Size format \[boolean\]
currency: false,                // This will enable/disable Currency format. Use it for set the symbol too \[boolean|char|string\]
separator: false,               // This will enable/disable comma separator for thousands. Use it for set the symbol too \[boolean|char|string\]
</code>```
```<code>});new PureCounter({// Setting that can't' be overriden on pre-elementselector: '.tips3',       // HTML query selector for spesific element
</code>```
```<code>// Settings that can be overridden on per-element basis, by \`data-purecounter-\*\` attributes:
start: 0,                       // Starting number \[unit\]
end: 30,                        // End number \[unit\]
duration: 1,                    // The time in seconds for the animation to complete \[seconds\]
delay: 10,                      // The delay between each iteration (the default of 10 will produce 100 fps) \[miliseconds\]
once: true,                     // Counting at once or recount when the element in view \[boolean\]
repeat: false,                  // Repeat count for certain time \[boolean:false|seconds\]
decimals: 0,                    // How many decimal places to show. \[unit\]
legacy: true,                   // If this is true it will use the scroll event listener on browsers
filesizing: false,              // This will enable/disable File Size format \[boolean\]
currency: false,                // This will enable/disable Currency format. Use it for set the symbol too \[boolean|char|string\]
separator: false,               // This will enable/disable comma separator for thousands. Use it for set the symbol too \[boolean|char|string\]
</code>```
```<code>});
</code>```
```<code>\</script\>
</code>```

I don't know how to put it in the code. Have tried putting in at "start" and adding [%] after the start value. But it doesn't work. Tested also with ["%"] same thing applies with [st] tested also with ["st"].

Title: Add text after the counter

Body:
I want to add text as a unit after the calculator calculates the numbers. The text to be displayed after the counter is a "%" and "st" how do I put it in the code?

I don't know how to put it in the code. Have tried putting in at "start" and adding [%] after the start value. But it doesn't work. Tested also with ["%"] same thing applies with [st] tested also with ["st"].


问:
Where does pip install fetches project metadata (like version) from?
I am installing a project that I got the files for, locally with pip like:
pip intall ~/my_local_path/project_name

That project uses a versioning system where it introspects the version after installation from the metadata like this:

```<code>from importlib.metadata import version

__version__ = version(__name__)
</code>```

it is described here as well

After installing the package from my local filesystem I see that the package version is the same as the version of the package in the original repo. So I am assuming that pip fetches these data from somewhere? How can I make pip fetch a version that I want because I want to fork the project and have my own versioning.

Body:
I am installing a project that I got the files for, locally with pip like:
pip intall ~/my_local_path/project_name

That project uses a versioning system where it introspects the version after installation from the metadata like this:

from importlib.metadata import version

__version__ = version(__name__)

it is described here as well

After installing the package from my local filesystem I see that the package version is the same as the version of the package in the original repo. So I am assuming that pip fetches these data from somewhere? How can I make pip fetch a version that I want because I want to fork the project and have my own versioning.


问:
Linkedin Oauth doesn't work when i'm not logged into linkedin
This is basically a repost of me previous question, but with an update.
Now issue is that if user is not logged in to linkedin itself then it shows "bummer, something wen't wrong" error  and there's this error in the console.

Since then i have checked documentation, numerous tutorials, logs and everything but i can't resolve the issue. Please help!

I'm using passport auth with linkedin and node.js and it suddenly started returing . It was working for years, so it's an old code. I haven't changed or updated anything. Checked my logs nothing, checked linkedin logs, nothing. Sometimes it works with some accounts, with others it doesn't.

These are my scopes and profileFields

scope: ['r_emailaddress', 'r_liteprofile'],
profileFields: ['id', 'first-name', 'last-name', 'email-address', 'public-profile-url'],
You can see the error message image from authentication attempt

I have checked my logs, i have sentry setup and logs on the server too, nothing. Authentication doesn't reach our callback url, thus no error on our side. I checked logs in developer portal, nothing. Authentication works 100% of the time for somelinkedin users, for example mine, for others it doesn't at all.

here's my Node.js code snippet, but thing is that, it doesn't even come to backend when error happens. And everything is alright, this code works perfectly

```<code>new LinkedInStrategy(
            {
                clientID: CONFIG.li_clientID,
                clientSecret: CONFIG.li_clientSecret,
                callbackURL: CONFIG.li_callbackURL,
                scope: ['r_emailaddress', 'r_liteprofile'],
                profileFields: ['id', 'first-name', 'last-name', 'email-address', 'public-profile-url'],
            },
</code>```

Body:
This is basically a repost of me previous question, but with an update.
Now issue is that if user is not logged in to linkedin itself then it shows "bummer, something wen't wrong" error  and there's this error in the console.

Since then i have checked documentation, numerous tutorials, logs and everything but i can't resolve the issue. Please help!

I'm using passport auth with linkedin and node.js and it suddenly started returing . It was working for years, so it's an old code. I haven't changed or updated anything. Checked my logs nothing, checked linkedin logs, nothing. Sometimes it works with some accounts, with others it doesn't.

These are my scopes and profileFields

scope: ['r_emailaddress', 'r_liteprofile'],
profileFields: ['id', 'first-name', 'last-name', 'email-address', 'public-profile-url'],
You can see the error message image from authentication attempt

I have checked my logs, i have sentry setup and logs on the server too, nothing. Authentication doesn't reach our callback url, thus no error on our side. I checked logs in developer portal, nothing. Authentication works 100% of the time for somelinkedin users, for example mine, for others it doesn't at all.

here's my Node.js code snippet, but thing is that, it doesn't even come to backend when error happens. And everything is alright, this code works perfectly

new LinkedInStrategy(
            {
                clientID: CONFIG.li_clientID,
                clientSecret: CONFIG.li_clientSecret,
                callbackURL: CONFIG.li_callbackURL,
                scope: ['r_emailaddress', 'r_liteprofile'],
                profileFields: ['id', 'first-name', 'last-name', 'email-address', 'public-profile-url'],
            },


问:
HereMap Get toll fares corresponding to transponders
I would like the server to send me information on Tolls, where payment is made only by transponders. Unfortunately, as I use the command:

```<code>tolls[transponders]=all
</code>```

I got others payments like :

```<code> "paymentMethods":
                                    [
                                        "bankCard",
                                        "creditCard",
                                        "travelCard"
                                    ]
</code>```

Anybody have any idea how to get tolls paid only with transponders?

Please, specifying the appropriate command

Body:
I would like the server to send me information on Tolls, where payment is made only by transponders. Unfortunately, as I use the command:

tolls[transponders]=all

I got others payments like :

 "paymentMethods":
                                    [
                                        "bankCard",
                                        "creditCard",
                                        "travelCard"
                                    ]

Anybody have any idea how to get tolls paid only with transponders?

Please, specifying the appropriate command


问:
How can I hide bars with null values in C3.js?
I have a C3 chart with data as given in columns.
Notice that there are null values in data1 and in between data 3. C3 is trying to display my bar chart in groupings of 5, creating a separate bar for null values. I'm trying to hide these null values.

```<code>var chart = c3.generate({
    data: {
        x : 'x',
        line:{connect_null: true},
        columns: [
            ['x','x1' ,'x2', 'x3', 'x4', 'x5', 'x6', 'x7'],
            ['data1',null ,30, 200, 100, 400, 150, 250],
            ['data2',null ,130, 100, 140, 200, 150, 50],
            ['data3',null ,130, null, 200, 300, -200, 100],
            ['data4',null ,20, -90, 200, 130, -20, 90],
            ['data5',-90, 20, -90, 200, 130, -20, 90]
        ],
        type: 'bar'
    },
    axis: {
        x: {
            type: 'category', // this needed to load string x value
        }
    },
    bar: {
        width: {
            ratio: 0.7 // this makes bar width 50% of length between ticks
        },
        space:0.05
        // or
        //width: 100 // this makes bar width 100px
    }
});
</code>```

output(https://i.stack.imgur.com/PVei1.png)

How can I hide the bars with null values?

Body:
I have a C3 chart with data as given in columns.
Notice that there are null values in data1 and in between data 3. C3 is trying to display my bar chart in groupings of 5, creating a separate bar for null values. I'm trying to hide these null values.

var chart = c3.generate({
    data: {
        x : 'x',
        line:{connect_null: true},
        columns: [
            ['x','x1' ,'x2', 'x3', 'x4', 'x5', 'x6', 'x7'],
            ['data1',null ,30, 200, 100, 400, 150, 250],
            ['data2',null ,130, 100, 140, 200, 150, 50],
            ['data3',null ,130, null, 200, 300, -200, 100],
            ['data4',null ,20, -90, 200, 130, -20, 90],
            ['data5',-90, 20, -90, 200, 130, -20, 90]
        ],
        type: 'bar'
    },
    axis: {
        x: {
            type: 'category', // this needed to load string x value
        }
    },
    bar: {
        width: {
            ratio: 0.7 // this makes bar width 50% of length between ticks
        },
        space:0.05
        // or
        //width: 100 // this makes bar width 100px
    }
});

output(https://i.stack.imgur.com/PVei1.png)

How can I hide the bars with null values?


问:
Plotting a dataset and an SVM model for text classification
for educational purpose I have to create a model for text classification using Rapidminer.
I downloaded a dataset made of the attributes "text" and "sentiment", each of them containing respectively the text of some tweets and their sentiment (positive or negative).
First of all, I would know if there is a way to plot this dataset for seeing data distribution using python on any other tools and if I have to calculate other attributes to see this data distribution (for example polarity and subjectivity, or anything else). My teacher wants me to plot the data first in order to undastand whether it is a linear distribution or not.
Secondly, I would know how to plot the results of an SVM model on this dataset.

I've already build the model using the LibSVM on Rapidminer, but this software doesn't provide any way to plot the model results seeing also the decision boundaries.
I tried to calculate polarity and subjectivity of the texts of the dataset using both Textblob and Vader on python and then I plotted the dataset on rapidminer using this new attributes, but the data distribution looks non-linear (and I didn't exppect this result) since both TextBlob and Vader calculate a positive polarity for some texts tagged as negative and viceversa.
I show you a screen of the data plotting I did to know if and how I have to fix it. How would you define this actual data distribution, linear or non-linear?

data plotting using subjectivity and polarity extracted with Vader and Textblob


问:
copy multiple columns from file1 of an excel sheet to other column in file2 excel sheet using python
I need to copy from file1, from column A2 and B2 and their entire column and paste the data into column B from B2 and C from C2 down in file 2 using python.

Rows A and B on file 1 copied and pasted into Column B and C in File 2.

```<code>import openpyxl as xl
from openpyxl import load_workbook
import pandas as pd
import os
import dateutil.parser as parser
import datetime as datetime

objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objWorksheetobjExcel.Workbooks.Open("File 1.xlsx")
objWorkbook2 = objExcel.Workbooks.Open("File 2.xlsx")

objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

objRange = objWorkSheet.Range("A2:B2").EntireColumn
objWorkSheet.Range("A2:B2").EntireColumn.Copy
objWorkSheet2.Paste objWorkSheet2.Range("B4")

objWorksheet2 = objWorkbook2.Worksheets(1)
objWorksheet.Activate

objRange = objWorkSheet2.Range("A1")
objRange = objWorkSheet2.Range("B1")
objWorksheet.Paste(objRange)
</code>```

Body:
I need to copy from file1, from column A2 and B2 and their entire column and paste the data into column B from B2 and C from C2 down in file 2 using python.

Rows A and B on file 1 copied and pasted into Column B and C in File 2.

import openpyxl as xl
from openpyxl import load_workbook
import pandas as pd
import os
import dateutil.parser as parser
import datetime as datetime

objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objWorksheetobjExcel.Workbooks.Open("File 1.xlsx")
objWorkbook2 = objExcel.Workbooks.Open("File 2.xlsx")

objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

objRange = objWorkSheet.Range("A2:B2").EntireColumn
objWorkSheet.Range("A2:B2").EntireColumn.Copy
objWorkSheet2.Paste objWorkSheet2.Range("B4")

objWorksheet2 = objWorkbook2.Worksheets(1)
objWorksheet.Activate

objRange = objWorkSheet2.Range("A1")
objRange = objWorkSheet2.Range("B1")
objWorksheet.Paste(objRange)


问:
Fluent Linq and SQL Server
This may be a silly question, but I have fluent linq query that is pulling data off a DB, but, of course, it processes the data in memory, not on the DB.

Is there a means of taking a query (Say table.Where(t => t. id > 22)) and having it run as a db query (i.e. SELECT * FROM TABLE WHERE ID > 22).

I want to use the fluent style because I am building up the query from various places. I know I can make this specific query into query syntax, but my actual queries are more complex.

I have tried standard searches, but I suspect it is not going to be possible, as nothing comes up.

Yes using EF Core.

The code is not necessarily clear:

var getTableData = table.Where(base.whereSelection);
whereSelection.ForEach(w => getTableData = getTableData.Where(w));
```
<p>At the moment, all of the Where Selections are Funcs - they could be converted to something else (like Expressions) if I knew that would make them run on the DB. The rest of the code is also building up this set of details programatically:</p>
<pre class="lang-cs prettyprint-override"><code>var selectedData = getTableData.Select(Convert);
var sortedTableData = GetSort(selectedData, Ordering);
var sorted = PickDataFrom(sortedTableData);
return CheckAndTake(sorted, pageSize);
</code>```

Everything seems to work. Just in the wrong place.

Title: Fluent Linq and SQL Server

Body:
This may be a silly question, but I have fluent linq query that is pulling data off a DB, but, of course, it processes the data in memory, not on the DB.

Is there a means of taking a query (Say table.Where(t => t. id > 22)) and having it run as a db query (i.e. SELECT * FROM TABLE WHERE ID > 22).

I want to use the fluent style because I am building up the query from various places. I know I can make this specific query into query syntax, but my actual queries are more complex.

I have tried standard searches, but I suspect it is not going to be possible, as nothing comes up.

Yes using EF Core.

The code is not necessarily clear:

var getTableData = table.Where(base.whereSelection);
whereSelection.ForEach(w => getTableData = getTableData.Where(w));

At the moment, all of the Where Selections are Funcs - they could be converted to something else (like Expressions) if I knew that would make them run on the DB. The rest of the code is also building up this set of details programatically:

var selectedData = getTableData.Select(Convert);
var sortedTableData = GetSort(selectedData, Ordering);
var sorted = PickDataFrom(sortedTableData);
return CheckAndTake(sorted, pageSize);

Everything seems to work. Just in the wrong place.


问:
How to transform a table data into a csv format in javascript ? And use those converted data(csv) in an ajax
I have this table data and I want to transform them in csv format by specific column. I am, planning to use those converted data (csv) in defining data: property of an ajax call. I am currently using jquery for this question. Important to note: In rendering table rows, it is based on user input. For my example below, the user entered 2, which rendered as 2 table rows.

Sample Table:
|     Car     |     Phone  |
|-------------|------------|
|     Ferrari |     Apple  |
|     Tesla   |     Samsung  |

What I have done so far:

```<code> function fetchRowData() {
        $('#myTable tbody tr').each(function () {
            let car= $(this).find("td").eq(0).html();
            let phone= $(this).find("td").eq(1).html();

           //In this part, I do not know how to transform the fetched data from `table` in a csv format
        })
    };
</code>```

Expected CSV Format:

```<code>car = "Ferrari, Tesla"
phone= "Apple, Samsung"
</code>```

Expected usage in an ajax call:

```<code>$.ajax({
   //some code....
   data: car, phone
//not sure if I am passing those data correctly. I would appreciate correction in here.
})
</code>```

Body:
I have this table data and I want to transform them in csv format by specific column. I am, planning to use those converted data (csv) in defining data: property of an ajax call. I am currently using jquery for this question. Important to note: In rendering table rows, it is based on user input. For my example below, the user entered 2, which rendered as 2 table rows.

Sample Table:
|     Car     |     Phone  |
|-------------|------------|
|     Ferrari |     Apple  |
|     Tesla   |     Samsung  |

What I have done so far:

 function fetchRowData() {
        $('#myTable tbody tr').each(function () {
            let car= $(this).find("td").eq(0).html();
            let phone= $(this).find("td").eq(1).html();

           //In this part, I do not know how to transform the fetched data from `table` in a csv format
        })
    };

Expected CSV Format:

car = "Ferrari, Tesla"
phone= "Apple, Samsung"

Expected usage in an ajax call:

$.ajax({
   //some code....
   data: car, phone
//not sure if I am passing those data correctly. I would appreciate correction in here.
})


问:
I am getting an error while running aws configure in command prompt
'''aws configure'''
Error
*While running aws configure in command prompt i am getting this error:

aws configure
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\garud\AppData\Local\Programs\Python\Python311\Scripts\aws.exe_main.py", line 4, in
File "C:\Users\garud\AppData\Local\Programs\Python\Python311\Lib\site-packages\aws\main.py", line 23
print '%(name)s: %(endpoint)s' % {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?*


问:
Pandas pandarallel parallel_aply
Here is a simple program that works in parallel. But in has an issue when I want to use a previous result to apply.

```<code>import pandas as pd
import numpy as np
from pandarallel import pandarallel

pandarallel.initialize(nb_workers=8)  # nb_workers=NUMBER_OF_CPU_CORES

def dummy_fit(x, y_hint=0.5):
    # Imagine quite a complicated code here
    # y_hint is a previous fit. When it is not given, use default
    y = (x.mean() + y_hint) / 2
    return y

df = pd.DataFrame(np.random.random((10, 3)), columns=list("ABC"))
print("data:\n", df)
result = df.parallel_apply(dummy_fit, axis=1)
print(result)
</code>```

We can use a global variable, but it is only one (we have more threads)

How to make it work in parallel?

Title: Pandas pandarallel parallel_aply

Body:
Here is a simple program that works in parallel. But in has an issue when I want to use a previous result to apply.

import pandas as pd
import numpy as np
from pandarallel import pandarallel

pandarallel.initialize(nb_workers=8)  # nb_workers=NUMBER_OF_CPU_CORES

def dummy_fit(x, y_hint=0.5):
    # Imagine quite a complicated code here
    # y_hint is a previous fit. When it is not given, use default
    y = (x.mean() + y_hint) / 2
    return y

df = pd.DataFrame(np.random.random((10, 3)), columns=list("ABC"))
print("data:\n", df)
result = df.parallel_apply(dummy_fit, axis=1)
print(result)

We can use a global variable, but it is only one (we have more threads)

How to make it work in parallel?


问:
Flutter - Make flutter app appear in printing menu (ios and android)?
Is it possible to make flutter app appear in native printing menu on ios and android?

Example

Thank you in advance!

Any suggestions welcomed!


问:
How can I use a saved file variable in separate shells?
I'm wondering how I can use this csvfile file saved via python:

```<code>csvfile = open("/tmp/" + ip + "-report.csv", "w")
    csvfile.write(report.text)
    csvfile.close()
</code>```

to then be used in the next executed shell which is in cURL:

```<code>curl -u $PLATFORM_CREDS -XPUT https://domain.url.test/directory/savetohere -T $filename
</code>```

How can I make csvfile a global variable to be used in other shell executables?

Body:
I'm wondering how I can use this csvfile file saved via python:

csvfile = open("/tmp/" + ip + "-report.csv", "w")
    csvfile.write(report.text)
    csvfile.close()

to then be used in the next executed shell which is in cURL:

curl -u $PLATFORM_CREDS -XPUT https://domain.url.test/directory/savetohere -T $filename

How can I make csvfile a global variable to be used in other shell executables?


问:
Woocommerce - replace attributes multi-select field with select field or limit selection to max one item
In Woocommerce at creating product back-end, in product options>attributes tab,

We can add attribute and its terms(values) trough a multi-select field.

But for example if we use that attribute to select Brand of the product, then the logic is that we can select only one brand. Or if that is a color, then we have to be able to select only one color. Scenario is that we have simple product and we are not going to use that attribute for variations.

So my question is - how to restrict selection of terms for an attribute only to one.

Any help is appreciated.

I did not tried anything, as that should be a question with common solution. I think.


问:
Import nibabel Jupyter Notebook
How do I import the nibabel module in Jupyter notebook on MacOS?

I already installed nibabel on my Macbook using PIP, but the jupyter notebook still gives

```<code>ModuleNotFoundError: No module named 'nibabel'
</code>```

Title: Import nibabel Jupyter Notebook

Body:
How do I import the nibabel module in Jupyter notebook on MacOS?

I already installed nibabel on my Macbook using PIP, but the jupyter notebook still gives

ModuleNotFoundError: No module named 'nibabel'


问:
Magento Security alert notificaiton after upgrade to magento 2.4.4-p2 or magento 2.4.5-p1
I have upgraded my magento store from 2.3.x to magento 2.4.4-p2. Everything runs smooth but after when I login to admin it again shows a security notification. There was no any error in the require-commerce steps.
I even try to upgrade it on magento 2.4.5-p1 everything runs smooth but again the security notification after login admin is constant.

Did anyone have gone through with this ?

Here is the screenshot.

I have upgraded to the max magento upgrade that have a max security releases.
But have no luck.


问:
Clone an internal repository from the GitHub Action of another internal repository without PAT?
I have 2 repositories within a GitHub organization:

https://github.com/my-org/site

https://github.com/my-org/shared-pipelines

From the site repo, I use the enterprise feature of referencing another internal GitHub Action:

# [...]
jobs:
  deploy:
    name: Deploy

    uses: 'my-org/shared-pipelines/.github/workflows/deploy.yml@main'
# [...]
```

I would like to check out the code of my-org/shared-pipelines from the my-org/shared-pipelines/.github/workflows/deploy.yml GitHub Action to get access to the files in the repo.

Is that possible without having to generate a Personal Access Token that gives access to all the same repos I have access to?

Fine-grained personal access tokens (currently in beta) don't let me chose an internal repo as scope, only the ones under my own account. Trying to check out using actions/checkout@v3 with or without persist-credentials results in a "Not found" error.

Body:
I have 2 repositories within a GitHub organization:

https://github.com/my-org/site

https://github.com/my-org/shared-pipelines

From the site repo, I use the enterprise feature of referencing another internal GitHub Action:

# [...]
jobs:
  deploy:
    name: Deploy

    uses: 'my-org/shared-pipelines/.github/workflows/deploy.yml@main'
# [...]

I would like to check out the code of my-org/shared-pipelines from the my-org/shared-pipelines/.github/workflows/deploy.yml GitHub Action to get access to the files in the repo.

Is that possible without having to generate a Personal Access Token that gives access to all the same repos I have access to?

Fine-grained personal access tokens (currently in beta) don't let me chose an internal repo as scope, only the ones under my own account. Trying to check out using actions/checkout@v3 with or without persist-credentials results in a "Not found" error.


问:
Android Target version update issue
I had to update the sdk version from 30 to 31. I am getting error in Android 11, this is working fine in android 10. Please suggest me what is wrong.</p>
```<code>E/AndroidRuntime: FATAL EXCEPTION: WorkManager-WorkManagerTaskExecutor-thread-0
    Process: com.cpplusworld.ams, PID: 25796
    java.lang.IllegalArgumentException: com.cpplusworld.ams: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
</code>```

Title: Android Target version update issue

Body:
I had to update the sdk version from 30 to 31. I am getting error in Android 11, this is working fine in android 10. Please suggest me what is wrong.

E/AndroidRuntime: FATAL EXCEPTION: WorkManager-WorkManagerTaskExecutor-thread-0
    Process: com.cpplusworld.ams, PID: 25796
    java.lang.IllegalArgumentException: com.cpplusworld.ams: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.


问:
How to set manually custom range label functionality ngxDaterangepickerMd in ngrx state
Once select the custom range option in date range filter - suggested to display empty view without any selection issue

Please consider the reference image as well

I used ngxDaterangepickerMd in my project all works are fine but when click the custom range label option is not work properly however is working previous select option rather than custom selection


问:
Debugging COM objects using Visual Studio 2022
I try to debug a COM object using Visual Studio 2022 but can't get the internal values from it. Everything is in place, my object is already displayed as {System.__ComObject} but I like to visualize in a Watch window the data it contains.
There is also exactly the same question as this one, in this link:
Enable native code debugging to deep into COM-object
but unfortunately for Visual Studio 2022 that is not a solution and I do not have enough points reputation to add a comment, so my only choice is to create a new one.

Any idea is welcome!


问:
Why is my implementation of AwsSignatureVersion4 responding with a Forbidden status
I am making use of the .Net AwsSignatureVersion4 package to facilitate the signing of the AWS request.

Part of the process is to first assume an IAM role, and use the credentials received from the AWS.SDK STS service (AccessKeyId, SecretAccessKey and SessionToken) as parameters to the overloaded HttpClient.PostAsync method.  I am however unable to get a successful response, all the requests responds with Forbidden.

The steps I follow to perform the request are as follows:

Assume Role via AWS.SDK

Use the credentials retrieved from step 1 as input parameters to HttpClient.PostAsync.

In addition to the credentials parameter, an endpoint, a null instance of HttpContent (because there is no post body), aws region and -service name are provided:

HttpClient.PostAsync("api gateway endpoint", null, "aws region", "execute-api", credentials)

Performing these steps and executing the Post responds with a Forbidden status.

Any guidance on where I might be going wrong please?


问:
"deploy-php-ext-configure" in /bin/sh missing when building docker laravel image
i am trying to build image and container from a project but i am having an issue when trying to build the image. the project is a template and I already have a project using this template in my computer. I would like to know how to solve it and understand a little more. I hope somebody would help me.

here is the error log when I run the command "docker build -t my-payments ." :

```<code>#7 200.3 /bin/sh: 1: deploy-php-ext-configure: not found
</code>```

here is the "docker-compose.yml" :

```<code>version: '3.8'

services:
    web:
        container_name: laravel-template-...
        build:
            context: ./
            dockerfile: ./Dockerfile.dev
        volumes:
          - .:/var/www-data
        environment:
            - PORT=80
        ports:
            - 81:80
        links:
            - db

    db:
        image: postgres:13
        container_name: db-lrv-postgres-...
        restart: always
        environment:
            POSTGRES_DB: db-lrv-postgres
            POSTGRES_USER: ...
            POSTGRES_PASSWORD: ...
            TZ: ...
            PORT: ${PORT:-5432}
        ports:
            - "5434:5432"
</code>```

here is "Dockerfile" :

```<code>FROM php:7.4-fpm

USER root

WORKDIR /var/www-data

RUN apt-get update \
    # gd
    && apt-get install -y --no-install-recommends build-essential openssl nginx libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev zlib1g-dev libzip-dev gcc g++ make nano vim unzip curl git jpegoptim optipng pngquant gifsicle locales libonig-dev nodejs npm libpq-dev \
    #custom-dependencies installed: libpq-dev
    && deploy-php-ext-configure gd  \
    && deploy-php-ext-install gd \
    # gmp
    && apt-get install -y --no-install-recommends libgmp-dev \
    && deploy-php-ext-install gmp \
    # pdo
    && deploy-php-ext-install pdo \
    # pdo_pgsql
    && deploy-php-ext-install pgsql pdo_pgsql mbstring \
    # opcache
    && deploy-php-ext-enable opcache \
    # zip
    && deploy-php-ext-install zip \
    && apt-get autoclean -y \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /tmp/pear/

COPY . /var/www-data

COPY ./deploy/php.ini /usr/local/etc/php/conf.d/local.ini

COPY ./deploy/nginx.conf /etc/nginx/nginx.conf

RUN mv .env.production .env

RUN chmod +rwx /var/www-data

RUN chmod -R 777 /var/www-data

#RUN npm install -g npm@latest

RUN npm install

RUN npm run prod

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN composer install --working-dir="/var/www-data"

RUN composer dump-autoload --working-dir="/var/www-data"

RUN php artisan optimize

EXPOSE 8080

RUN ["chmod", "+x", "./deploy/post_deploy.sh"]

CMD [ "sh", "./deploy/post_deploy.sh" ]

</code>```

Body:
i am trying to build image and container from a project but i am having an issue when trying to build the image. the project is a template and I already have a project using this template in my computer. I would like to know how to solve it and understand a little more. I hope somebody would help me.

here is the error log when I run the command "docker build -t my-payments ." :

#7 200.3 /bin/sh: 1: deploy-php-ext-configure: not found

here is the "docker-compose.yml" :

version: '3.8'

services:
    web:
        container_name: laravel-template-...
        build:
            context: ./
            dockerfile: ./Dockerfile.dev
        volumes:
          - .:/var/www-data
        environment:
            - PORT=80
        ports:
            - 81:80
        links:
            - db

    db:
        image: postgres:13
        container_name: db-lrv-postgres-...
        restart: always
        environment:
            POSTGRES_DB: db-lrv-postgres
            POSTGRES_USER: ...
            POSTGRES_PASSWORD: ...
            TZ: ...
            PORT: ${PORT:-5432}
        ports:
            - "5434:5432"

here is "Dockerfile" :

FROM php:7.4-fpm

USER root

WORKDIR /var/www-data

RUN apt-get update \
    # gd
    && apt-get install -y --no-install-recommends build-essential openssl nginx libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev zlib1g-dev libzip-dev gcc g++ make nano vim unzip curl git jpegoptim optipng pngquant gifsicle locales libonig-dev nodejs npm libpq-dev \
    #custom-dependencies installed: libpq-dev
    && deploy-php-ext-configure gd  \
    && deploy-php-ext-install gd \
    # gmp
    && apt-get install -y --no-install-recommends libgmp-dev \
    && deploy-php-ext-install gmp \
    # pdo
    && deploy-php-ext-install pdo \
    # pdo_pgsql
    && deploy-php-ext-install pgsql pdo_pgsql mbstring \
    # opcache
    && deploy-php-ext-enable opcache \
    # zip
    && deploy-php-ext-install zip \
    && apt-get autoclean -y \
    && rm -rf /var/lib/apt/lists/* \
    && rm -rf /tmp/pear/

COPY . /var/www-data

COPY ./deploy/php.ini /usr/local/etc/php/conf.d/local.ini

COPY ./deploy/nginx.conf /etc/nginx/nginx.conf

RUN mv .env.production .env

RUN chmod +rwx /var/www-data

RUN chmod -R 777 /var/www-data

#RUN npm install -g npm@latest

RUN npm install

RUN npm run prod

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN composer install --working-dir="/var/www-data"

RUN composer dump-autoload --working-dir="/var/www-data"

RUN php artisan optimize

EXPOSE 8080

RUN ["chmod", "+x", "./deploy/post_deploy.sh"]

CMD [ "sh", "./deploy/post_deploy.sh" ]