google cloud platform – Internal error encountered during integrating dialogflow with Facebook messenger

I integrated Facebook messenger and dialogflow before. After that they cannot connect and respond together and then I try to set up integration between them again. When I click stop button to stop integration, I try to fill all information again, token URL and then click start button. Unfortunately, it shows internal error encountered. Please give me advice
Thanks a lot in advance for your help

bluetooth – Options for Integrating or developing a physical security solution (physical access control via in-house mobile apps [NFC/Bluetooh])

Our team is looking to either integrate or develop a physical security solution for a rather large campus.

Requirements:

Ability to either integrate (with reader/electronic lock hardware) from our mobile apps which would allow access control (over NFC/Bluetooth) to areas.

We will be writing to our already existing identity management api’s and expanding them to support what we need to for this project.

We are looking to write our own mobile integrations with purchased hardware, since this functionality has to exist within our organization’s already existing mobile apps we developed. (we haven’t found a company that offers the level of integration we want… most of the solutions we see out there are fantastic, but require downloading the security company’s mobile app, managing access control via their cloud resources, etc).

What reader/electronic door lock hardware can we buy to build this level of in-house integration with?

To summarize: we are looking to buy scanners/door locks with NFC/Bluetooth capability and write security integrations for access control through already existing mobile apps we have developed…

I realize product suggestions can be of bad taste on here, but I invite them for the sake of discussion in addition to solutions that companies offer.

Our team will be expanding to hire security professionals in this realm to assist, so you can save the “don’t roll your own auth” type of answers and comments 🙂

Thanks in advance!

assumptions – Why is this integrand not integrating to a Bessel function?

I know from the identities of Bessel functions that the following is true:
$$
J_{m}left( x right) = frac{ 1 }{ 2 pi i^{m} } int_{0}^{2 pi} dphi e^{i left( x cos{phi} – m phi right)} tag{0}
$$

However, when I try to integrate the following, Mathematica doesn’t actually integrate the result. It just spits back the input.

Assuming(Element(k, Reals) && Element(m, Integers), Integrate(Exp(I (m x + k Cos(x))),{x, 0, 2 Pi}))

Should I allow m to be more general, i.e., any numeric value (not necessarily fond of fractional Bessel function indices) or am I missing some other assumption that is preventing Mathematica from giving the proper result?

(I doubt this matters but for completeness, I have v12.1.1.0 and am using a Macbook Pro laptop.)

Note the linked question Evaluate the defining Integral of the Bessel functions of the first kind has several answers that kind of answer my question, but I am curious why the above does not actually integrate. That is, I specify the regions of validity clearly and arguments so Mathematica should recognize that the input is the integral form of the Bessel function. I want to know why it’s not evaluating, not just that it won’t or how to make it work by explicitly specifying the Bessel function index m using something like Table.

real analysis – Integrating Gaussian with a periodic step function

Let us fix an integer $nin2mathbb{Z}+1$ and consider the function $f(x)=exp(pi i n {x})$ that is a step function attaining 1 on intervals of the form $(2k,2k+1)$ and -1 on intervals of the form $(2k+1,k)$ (with $kinmathbb{Z}$). The integral $$int_{mathbb R}exp(-ax^2+iJx),qquad ainmathbb R_+,Jinmathbb R$$ is quite standard and can be computed using completion to a sqaure. However I wonder about the “modified” integral $$int_{mathbb R}f(x)exp(-ax^2+iJx),qquad ainmathbb R_+,Jinmathbb R.$$ In this case completion to square allegedly does not work and as long as $Jneq 0$ we lose a lot if we try to bound this integral naively by an absolute value.

Does the second integral has a closed form and can be computed explicitly?

c# – Asp.Net overall design pattern integrating REST, dependency injection, and Hosted Services (See full project at Github)

I’m new to C#, and want to conform as much as possible to good design patterns. This code is the beginning of a Microservice, running as Asp.Net. It is based on a Microsoft tutorial doing similar work.

It has three functional components currently:

  1. Converts a CSV file to JSON, for return via REST
  2. A REST controller to test the conversion of the CSV to JSON return
  3. A background service which monitors a directory looking for changed files. The file attributes (Path, Date, Checksum) are stored in a MongoDB database via a Repository.

Opinions/Recommendations regarding the design patterns welcomed.

The full code can be found at: https://github.com/BioComSoftware/unite-radimaging-source-n2m2.git

BONUS: Notice in FileSearchHostedService.cs, I instantiate the Repository objects explicitly. I think it would be more appropriate to have them as Dependency Injection – but I couldn’t get it to work. Notice the commented-out lines that would have done this. My understanding is; I would need to do this with IScopedProcessingService – but I have no idea how to do this with this specific code.

Structure

(Startup.cs)

using unite.radimaging.source.n2m2.Data;
using unite.radimaging.source.n2m2.Repositories;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
//using Microsoft.OpenApi.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace unite.radimaging.source.n2m2 {
    public class Startup {
        public Startup(IConfiguration configuration) {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime.
        // Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services) {

            services.AddControllers();

            services.AddScoped<IFoundFileContext, FoundFileContext>();
            services.AddScoped<IFoundFileRepository, FoundFileRepository>();
        }

        // This method gets called by the runtime.
        // Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
            if (env.IsDevelopment()) {
                app.UseDeveloperExceptionPage();
            }
            app.UseExceptionHandler("/error");
            app.UseRouting();
            app.UseAuthorization();
            app.UseEndpoints(endpoints => { 
                endpoints.MapControllers(); 
            });
        }
    }
}

(FoundFileRepository.cs)

using unite.radimaging.source.n2m2.Data;
using unite.radimaging.source.n2m2.Entities;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace unite.radimaging.source.n2m2.Repositories {
   public class FoundFileRepository : IFoundFileRepository {
       private readonly IFoundFileContext _context;
       public FoundFileRepository(IFoundFileContext context) {
           _context = context ?? throw new ArgumentNullException(nameof(context));
       }

       public async Task<IEnumerable<FoundFile>> GetFiles() {
       return await _context
           .FoundFiles
           .Find(p => true)
           .ToListAsync();
       }

       public async Task<FoundFile> GetFile(string id) {
           return await _context
                          .FoundFiles
                          .Find(p => p.Id == id)
                          .FirstOrDefaultAsync();
       }

       public async Task<FoundFile> GetFileByPath(string path) {
           return await _context
                          .FoundFiles
                          .Find(p => p.Path == path)
                          .FirstOrDefaultAsync();
       }

       public async Task<FoundFile> GetFileByChecksum(string checksum) {
           return await _context
                          .FoundFiles
                          .Find(p => p.Checksum == checksum)
                          .FirstOrDefaultAsync();
       }

       //public async Task<IEnumerable<FoundFile>> GetFileByMtime(string mtime) {
       //    FilterDefinition<FoundFile> filter = Builders<FoundFile>.Filter.ElemMatch<DateTime>(p => p.Mtime, mtime);

       //    return await _context
       //                    .FoundFiles
       //                    .Find(filter)
       //                    .ToListAsync();
       //}

       //public async Task<IEnumerable<FoundFile>> GetFileBySize(long size) {
       //    FilterDefinition<FoundFile> filter = Builders<FoundFile>.Filter.ElemMatch<long>(p => p.Size, size);

       //    return await _context
       //                    .FoundFiles
       //                    .Find(filter)
       //                    .ToListAsync();
       //}

       public async Task CreateFile(FoundFile foundFile) {
           await _context.FoundFiles.InsertOneAsync(foundFile);
       }

       public async Task<bool> UpdateFile(FoundFile foundFile) {
           var updateResult = await _context.FoundFiles.ReplaceOneAsync(
               filter: g => g.Path == foundFile.Path, replacement: foundFile);
           return updateResult.IsAcknowledged && updateResult.ModifiedCount > 0;
       }

       public async Task<bool> DeleteFile(string path) {
           FilterDefinition<FoundFile> filter = Builders<FoundFile>.Filter.Eq(p => p.Path, path);

           DeleteResult deleteResult = await _context
                                               .FoundFiles
                                               .DeleteOneAsync(filter);

           return deleteResult.IsAcknowledged
               && deleteResult.DeletedCount > 0;
       }
   }
}

(FileSearchHostedService.cs)

using unite.radimaging.source.n2m2.Repositories;
using unite.radimaging.source.n2m2.Entities;
using unite.radimaging.source.n2m2.Data;
using Serilog;
using Microsoft.Extensions.Configuration;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace unite.radimaging.source.n2m2.HostedServices {
    public class FileSearchHostedService : BackgroundService {
        private readonly IConfiguration _configuration;
        //private IFoundFileRepository _repository;

        public FileSearchHostedService(
            //IFoundFileRepository repository,
            IConfiguration configuration
            ) {
            //_repository = repository ?? throw new ArgumentNullException(nameof(repository));
            _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
        }

        protected override async Task ExecuteAsync(CancellationToken cancellationToken) {
            Log.Information("FileSearchHostedService: File searching started.");

            cancellationToken.Register(() => Log.Information("Processing service stopped"));

            //string checksum;
            string _current_path;
            FileInfo _current_file;
            FoundFile _foundFile;
            FoundFile _existingFile;
            FoundFile _addFoundFile;
            FoundFileContext FoundfileContext = new FoundFileContext(_configuration); // Normal instantiation, in leiu of injection
            FoundFileRepository _repository = new FoundFileRepository(FoundfileContext);  // Normal instantiation, in leiu of injection

            while (!cancellationToken.IsCancellationRequested) {
                Log.Information("Searching files...");
                string dir = _configuration.GetValue<string>("FileSearchSettings:SearchDir");
                string() files = Directory.GetFiles(dir);
                foreach (string filename in files) {
                    Log.Debug($"Parsing '{filename}'");

                    _current_file     = new FileInfo(filename);
                    _current_path = Path.GetFullPath(Path.Combine(_current_file.Directory.ToString(), _current_file.Name));

                    _foundFile = new FoundFile() {
                        Path = _current_path,
                        Size = _current_file.Length,
                        Mtime = _current_file.LastWriteTime,
                        Checksum = FileChecksum.getChecksum(filename)
                    };
                    Console.WriteLine("==========================");
                    _existingFile = await _repository.GetFileByPath (_current_path);
                    Console.WriteLine("past _repository.GetFileByPath");

                    try {
                        Console.WriteLine($"{_existingFile.Path} exists!!!");
                        Console.WriteLine($"     _existingFile.Checksum: {_existingFile.Checksum}");
                        Console.WriteLine($"     _existingFile.Length = {_existingFile.Size}");
                        Console.WriteLine($"     _existingFile.LastWriteTime = ({_existingFile.Mtime}");
                    }
                    catch {
                        Console.WriteLine($"Creating MongoDB for file {_foundFile.Path} ");
                        _addFoundFile = new FoundFile() {
                            Path = _foundFile.Path,
                            Size = _foundFile.Size,
                            Mtime = _foundFile.Mtime,
                            Checksum = _foundFile.Checksum
                        };
                        await _repository.CreateFile(_addFoundFile);
                    }
                }

                await Task.Delay(
                    _configuration.GetValue<int>("FileSearchSettings:Delay"),
                    cancellationToken
                    );
            }
        }
    }
}

sql – Problem in integrating pqxx library postgresql in visual studio

In visual studio 2019, I need to build a library management system using C++ and SQL. So I have chosen the Desktop Application C++ option in the project in visual studio.

I have chosen C++ 17 standard. I have also installed CMake and Postgresql libraries for integration I have also added pqxx as additional library to include while compiling.

The project is not building what should I do to fix this?

calculus and analysis – Variable substitution when integrating with Mathematica

When I try to integrate this MMA freezes:

II = (2 fx R Cos(ϕ) Sin(θ))/(R^2 + ρz^2 - 2 R ρz Cos(θ))^(3/2)

Integrate(II, {ϕ, 0, 2 π}, {θ, 0, π})

But if I impose ρz=0 the integral is very quickly solved. Any suggestions to why this happens and how to encourage MMA to find a useful substitution?

calculus – Differential Equation. Need to find integrating factor to make it exact.

I’m currently doing my pre-u and during one of my maths coursework (MathsIA), I ended up with this differential equation. I need to find y in term of x. This is clearly beyond my syllabus. I managed to manipulate the equation to get u= Mdx + Ndy, which can be solve using exact. However, I fail to find the integrating factor to make it exact, because of the square root. How do I solve this differential equation?

The differential equation