Posts

Showing posts with the label c#

issues rotating an arbitrary point around another arbitrary point

I have written the following methods to rotate an arbitrary point around another arbitrary point. When I rotate the point using the code below, it doesn't rotate to the desired angle over the specified duration. It moves immediately by the wrong angle. How can I solve this? Please note that the points are independent of a game object. I can really help you with quartonians much, but I can offer some advice about movement over time. I hard lesson I had to learn was to avoid using Co-routines wherever possible. While they seem pretty slick, they are a bit confusing to get right and the was Unity uses them isn't exactly how you are supposed to use them in other areas of C#. Wherever possible, I just use a unity class that updates each frame. Its much simpler to understand and to debug. The drawback in your case is that you need a new component for each point you are trying to rotate, but that shouldn't be a big deal. { } Try something like that and see if your problem goes aw...

How to integrate biometric device of SecuSearch SDK PRO in ASP.NET

I am facing problem with integrating Bio metric device of Secugen Hemister Pro Duo SC PIV . I describing steps that I have done with this. Client and server are same machine. It is working in visual studio not in IIS on same machine . If I run the asp.net project from IIS , then "device open failed " error is thrown . But If I run the project in visual studio , then it is run successfully . I have enabled windows authentication . Please tell me how can I solve this error . Check for some reason: By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Building a shared object from a single .cpp

I am trying to build a shared object library from a cpp file that is a simple set of functions. I want to use ctypes to interface with python. Say I have the cpp file: and header file I tried to build Then in python the line yields nm -D print.so gives the output What am I fundamentally doing wrong in the compilation step? In short, you are calling a c++ function while ctypes expects C functions linkage: In short, you are missing an extern "C" declaration right before the function declaration in the header file: This will prevent the C++ name mangling. Using vectors and other C++ types will likely cause you ABI issues It's a good idea to use C functions with plain C types in your functions as an interface. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Could not resolve DbContext after deployment in Asp.Net Core 2.X

I have a webapi in asp.net core 2.1 and that is working properly if I press F5 from the Visual Studio, I can hit my controllers, but when I deploy the application to the IIS, it says that it can resolve the DbContext on the Configure method. My Configure looks like this on my ConfigureServices I inject the dbcontext on this way and as I said is working. In order to deploy the application to an IIS I added the following information on the Program class The ApplicationPool is running under No Managed Code do I need to check something else? Issue was identified to be the connection string was using integrated security which was not working when deployed to run under IIS as web app was running under application pool identity. Since application pool identity does not have access to database, connection was failing. Suggested fix was to create a new sql server login, assign that user to application database, update connection string to use the userid and password instead of integrated sec...

Misfired Simple triggers are executing Jobs in spite of Setting misfire policy to “IGNORE”

I am using Quartz in .Net. Irrespective of "quartz.jobStore.misfireThreshold" i set and setting misfire policy to ignore, still i see job getting executed. Ideally this should never happen. I have initialized both JobListener and Trigger listeners for the same Here is my snippet .WithMisfireHandlingInstructionIgnoreMisfires() fires all triggers that were missed as soon as possible and then goes back to ordinary schedule. You should use .WithMisfireHandlingInstructionDoNothing() , trigger with explicitly set "MISFIRE_INSTRUCTION_DO_NOTHING" misfire instruction handler, meaning that all misfired executions are discarded, it simply waits for next scheduled time. A misfire occurs if a trigger "misses" its firing time because there are no available threads in Quartz’s thread pool for executing the job By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privac...

why thread has no effect on change made on class variable?

Why does the execution of thread which eventually adds +1 to value has no effect? The std::cout is just zero. I was expecting 1. You are passing a by value, so the thread gets its own private copy that is distinct from the a in main - the thread then modifies the copy and when the thread dies that object dies with it and the change to it is nowhere to be found. The a in main is never modified, so it retains its original value. You want to pass a reference or pointer if you want to change the a in main from within the thread. You probably also want to read up on synchronization and atomic if you are going to be accessing variables from multiple threads. As @JesperJuhl says, you are passing a copy of a so the main's variables is never modified, but, besides, references cannot be passed to other threads. The thread's parameters are always passed by value, so, you need to pass a pointer or a reference_wrapper , which allows to pass a reference, but wrapped in a copyable o...

C-variable string argument [on hold]

I want to run the code blow: and put the strings in array1 . ps function has variable arguments. how should i define ps ? Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

AutoMapper Update UseDestinationValue Not Working as expected on Virtual Properties

Struggling to get AutoMapper (6.1.1) to work in this scenario of attempting to update an existing Vendor and associated Vendor Contacts. I've tried using .ignore() and .UseDestinationValues() on the related entities, both to no avail. Here's what happens to the destination values after the map: What am I doing wrong or am I misunderstanding how this is supposed to work? POCOs Maps Code both entities has the same name, it looks like you are missing a namespace By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

input value either string or integer c++ [on hold]

I need to write a program, which would keep asking for inputs until the word "exit" is an input. If the given input is an integer, the program should keep the integer in a vector. (Also if the input is the word "sort" program should sort given vector and print it and if the input is the word "search x" it should search the vector and inform whether the value is in the vector.) Besides the rest my main problem is how can I allow the input to be both either integer or string value for the further commands??? Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. You can just cast the input into a string and let the code tell you if the input is equal == to "exit". You can also use the isdigit...

can I Run the PHP Script in Visual studio c# Program? [on hold]

I'm writing c# program in Visual studio and in the c# Program I'm trying to include my PHP Script path in commandline arguments. Do we have any example how to run a php script in c# program? Please provide me? Thank you in advance. Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. You can do this, you can use the Process.Start method in C# to call the php interpreter using commandline arguments. Here is a quick example: Here are a few other posts that may help on this note: Run command line code programatically Running PHP script from the command line If you were looking for something more specific please edit your question and I'm sure people would be glad to help.

For the first TextBox txtName, it is showing a dropdown list but for the other TextBox i am not getting any dropdownlist

Below code is of .net windows form app showing 2 TextBoxes with drop down suggestion when user types something in it. the code for first TextBox txtName is working but the other one is not....i need hellp on this. To say that one of these is working and the other is not leads me to believe that you have set up something in the gui properties because I see nowhere where you set this stringcollection to your autocompletecustomsource. That being said, let's use 2 new textboxes and set up a demo that you can test on your own machine. For the building of the AutoCompleteStringCollection, I'm going to just use a list but you would use your query. I will try to denote where you would use those methods. Since you're using the same data for both textboxes, we only need to create the collection once. We'll do this in the form load. Notice that this code is not in any of the textbox events. Especially the TextChanged event as that would run with every change to the textbox and we ...

How to access C# project directory [duplicate]

This question already has an answer here: I am trying to set up unit tests for a C# project and I think I'm confused about how the directory structure of my test project is set up In VS2017, I the project expands as follows I have some pre-configured test directories and files in the 'Files' directory that I would like to access from my test classes, but I cannot figure out for the life of me how to express the path to that directory programmatically. I have tried Which (I think) would navigate to the TestDir directory relative to the project in Java, but I guess C# does not share this convention. I also tried: And Both of which navigate to the following directory Which (obviously) is not correct. Is there a good way to access my project directory programmatically? Or would it be better to get it this way and navigate out of it? If so, how could I do that? This question has been asked before and already has an answer. If those answers do not fully address your question, ple...