Skip to content
Fix Code Error

Tag: c++

MapGeneratorEditor.OnInspectorGUI() No suitable method found to override

July 18, 2021 by Code Error

Posted By: Anonymous I have recently been following a tutorial series on Procedurally Generated world generation, I am fairly new to coding and I have come across the following problem. I have 3 error messages in my code, The first error says: Error CS0115 ‘MapGeneratorEditor.OnInspectorGUI()’: no suitable method found to override The second says: Error …

Continue Reading

Exporting .csv file in ssis with seperated columns

July 18, 2021 by Code Error

Posted By: Anonymous I have ssis package. And i can successfully export .csv file to local folder. In my package i have db connection and getting columns from stored procedure. But while exporting data to .csv file all columns stands togetger by separated commas. How can i fix this? Thanks Solution If you want to …

Continue Reading

How to add test authorization with inherited TestContext in BUnit?

July 18, 2021 by Code Error

Posted By: Anonymous I have an inherited TestContext in BUnit and I want to add the Testauthorization. This doesn’t work: using Bunit; using Bunit.TestDoubles; public class TestClass : TestContext { [Fact] public void CompTest() { AddTestAuthorization(); } } if I use the "normal" version with the boilerplate code like following it works. This works: using …

Continue Reading

What are .o.d files used for?

July 18, 2021 by Code Error

Posted By: Anonymous I use netbeans and notice that in addition to creating the .o files, it also creates .o.d files. What are these files (.o.d) for? Solution As described by Netbeans: Dependency files. Build systems try to make it so that if you recompile, you save effort by not recompiling translation units whose generated …

Continue Reading

Why is Logger not automatically available as DI service

July 17, 2021 by Code Error

Posted By: Anonymous When trying to instantiate public class MyClass : BackgroundService { private ILogger<MyClass> Logger {get;} public MyClass(Logger<MyClass> logger) { Logger = logger } } through .Net DI by registering MyClass through services.AddHostedService<MyClass>(); When the class is activated, an exception is thrown: System.InvalidOperationException: ‘Unable to resolve service for type ‘Microsoft.Extensions.Logging.Logger1[MyClass]’ while attempting to activate …

Continue Reading

Unable to send the data from view to controller Asp.net MVC using Jquery

July 17, 2021 by Code Error

Posted By: Anonymous I am trying to post the data from my View to controller, but the count is always 0. I can see in the developer console the data is passed as part of the request but my action method is unable to receive it, I am unable to figure the issue here. Data …

Continue Reading

Check if using termux or normal distro in C++

July 17, 2021 by Code Error

Posted By: Anonymous I have a program that checks if apt, apt-get and dpkg are installed. But now I need to check if using a normal distro (like Mint, Ubuntu, etc.) or using termux to change the path, how can I do that? I already tried this, but then it says the path doesn’t exist …

Continue Reading

Entity Framework – Rollback for Mix of Stored Procedures and Entities

July 16, 2021 by Code Error

Posted By: Anonymous I need to call a few stored procedures (data inserts) plus update an entity value to the database. I want these operations to be atomic, so if an error occurs, they all rollback. In my code, if I force an exception to observe the behavior of the rollback, my entity changes are …

Continue Reading

How to get IRandomAccessStreamReference from image resource?

July 16, 2021 by Code Error

Posted By: Anonymous I’m working with a Map view in a UWP application. I want to initialize a Map icon (Windows.UI.Xaml.Controls.Maps.MapIcon) using an image. The image file is stored as a resource in my project. The MapIcon object contains an Image property, which is of type "IRandomAccessStreamReference". How do I create an IRandomAccessStreamReference from the …

Continue Reading

Timed functions in CVI GUI

July 16, 2021 by Code Error

Posted By: Anonymous I’m working on an application in Windows CVI that needs to run some code for a series of time intervals set by the user via text entry boxes. The boxes include three for how long to run each process, one to show the total time the processes will take, and one to …

Continue Reading

Mailkit folder.Search method includes the last email, even if its ID is less that specified

July 16, 2021 by Code Error

Posted By: Anonymous I am using Mailkit, and want to get all messages whose UniqueId is greater than a specified value. According to the accepted answer here, "If the last UID that your client program has seen in a previous session was 123456, you’ll actually want your search to start with UID 123457", and so …

Continue Reading

C++ ValueError bitset::_M_copy_from_ptr when string and bitset are correct size

July 16, 2021 by Code Error

Posted By: Anonymous I have a string which should represent a 32 bit integer, so i’m creating a bitset to print the bits: std::string str = rocksDBSlice.ToString(); std::cout << str.length() << std::endl; std::bitset<32> bits(str); std::cout << bits.to_string() << std::endl; But at run-time I get: 4 ValueError bitset::_M_copy_from_ptr If the string length is 4 why does …

Continue Reading

setsimplecolumn doesn’t position the text to the given coordinates in PDF using itextsharp 5 in C#

July 16, 2021 by Code Error

Posted By: Anonymous I am new to iTextShap and I am trying to add two text columns using SetSimpleColumn and somehow the second column is not positioning to the given x-coordinate. I have already gone through a lot of content available on the internet and the iTextSharp documentation for the version(5.5.13.2), that I am using …

Continue Reading

How am I supposed to build an emscripten project with the stb_image headers?

July 15, 2021 by Code Error

Posted By: Anonymous I have a webassembly project, and I want to build it with emscripten. I cloned the stbi image header files in my project and then tried to compile everything. My main.c looks like that: #include "stb_image.h" #include <emscripten.h> … EMSCRIPTEN_KEEPALIVE void my_func(int test) { // I need some functions from stbi image …

Continue Reading

Autodesk Forge Error trying to access the API online

July 15, 2021 by Code Error

Posted By: Anonymous I have a problem loading a 3D model on an online server, the error shown is related to accessing the Forge API, locally works smoothly however when mounted on the server or a website is made marks the following error "Failed to load resource: the server responded with a status of 404 …

Continue Reading

Values of member struct get lost after being passed to a function as a pointer

July 15, 2021 by Code Error

Posted By: Anonymous Summary: I have an issue where my pointer inside a struct gets randomised after being passed to the function. So I pass the original struct with the pointer being in-tact (I checked it there and it works), but after being passed to the function the stated pointer doesn’t work anymore. The pointer …

Continue Reading

How to copy dependent executable also to the same folder where the main executable lives while deploying with CQtDeployer?

July 15, 2021 by Code Error

Posted By: Anonymous I will start my question with an example. Suppose I have a qt application named ‘MyApp’ and there are two dependent executable ‘xprintidle’ and ‘xdotool’ . For perfect working of my application I need MyApp, xprintidle and xdotool are to be in same folder after installing. I am using CQtDeployer to deploy …

Continue Reading

How to get error line using Microsoft.CodeAnalysis.Diagnostic

July 15, 2021 by Code Error

Posted By: Anonymous i hope you have a great day. I have this piece of code for evaluating code on runtime: SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText("Code goes here…"); string assemblyName = Path.GetRandomFileName(); string corePath = Path.GetDirectoryName(typeof(object).GetTypeInfo().Assembly.Location); MetadataReference[] references = new MetadataReference[] { MetadataReference.CreateFromFile(typeof(object).Assembly.Location), MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location), MetadataReference.CreateFromFile("Newtonsoft.Json.dll"), MetadataReference.CreateFromFile(Path.Combine(corePath, "System.Net.dll")), MetadataReference.CreateFromFile(Path.Combine(corePath, "System.Text.RegularExpressions.dll")) }; CSharpCompilation compilation = CSharpCompilation.Create( assemblyName, syntaxTrees: …

Continue Reading

How to play beep in GTK Linux (MonoDevelop)

July 15, 2021 by Code Error

Posted By: Anonymous I’m working on a simple project to play a beeping noise in a C# application. I assume you can’t use the System.Console.Beep(100, 100); function, because you need a console for that to work. Is there an alternative function I can use that let’s me specify the frequency and duration of the beep? …

Continue Reading

How to pass multiple structs as same parameter using void pointer through multiple levels

July 15, 2021 by Code Error

Posted By: Anonymous I have multiple structs I am trying to pass into the same parameter for a function using void pointers, but it is not working and I don’t know why. I created a simple test case to show what I’m running into. If I compile with clang in repl it works, but if …

Continue Reading

Why am I getting a null exception when trying to assign a value to a nested object in C# asp.net 5?

July 15, 2021 by Code Error

Posted By: Anonymous I am trying to assign a value to a nested object however I get a null exception. System.NullReferenceException: Object reference not set to an instance of an object. code below addingTaskScheduleDto addToReturnTask = new addingTaskScheduleDto(); userTaskDto test = new userTaskDto(); test.UserId = task.UserTasks.FirstOrDefault().UserId; test.TaskScheduleId = task.UserTasks.FirstOrDefault().TaskScheduleId; // null exception happens on the …

Continue Reading

How to assign a value to an array inside a structure using pointer arithmetic?

July 15, 2021 by Code Error

Posted By: Anonymous typedef struct TILE{ char p[4]; char ladder,snake; char end; int boardLoc; struct TILE *pointer; }tile; tile *myTable = (tile*) calloc(row*col,sizeof(tile)); //This code works (using brackets []) (myTable+90)->p[0] = ‘a’; (myTable+90)->p[1] = ‘b’; (myTable+90)->p[2] = ‘c’; (myTable+90)->p[3] = ‘d’; //This code does not work (using pointer arithmetic) *(myTable+90).(*(p+0)) = ‘a’; *(myTable+90).(*(p+1)) = ‘b’; …

Continue Reading

Add to List from XElement in foreach loop

July 15, 2021 by Code Error

Posted By: Anonymous Program.cs using ConsoleApp2.Models; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; namespace ConsoleApp2 { class Program { static void Main(string[] args) { string City_Name = "GdaÅ„sk"; var doc = XElement.Load($"https://maps.googleapis.com/maps/api/place/textsearch/xml?key={key}&query=restaurants+in+{City_Name}&language=pl&fields=place_id"); List<PlaceIdModel> IdList = doc.Descendants("result").Select(n => new PlaceIdModel { PlaceId = n.Element("place_id").Value }).ToList(); List<PlaceDetailsModel> placeDetailsModel = new List<PlaceDetailsModel>(); foreach (var item in IdList) { var …

Continue Reading

User can’t add empty new row on wpf datagrid

July 15, 2021 by Code Error

Posted By: Anonymous At runtime, user can’t add new empty row on my wpf datagrid. I tried CanUserAddRow="True", IsReadOnly="False" XAML <DataGrid x:Name="UrunGrid" Grid.Row="0" CanUserAddRows="True" AlternatingRowBackground="LightGray" AlternationCount = "2" AutomationProperties.IsOffscreenBehavior="Offscreen"> <DataGrid.Columns> <DataGridTextColumn Header="ISBN/Barkod" Binding="{Binding BARCODE}"/> <DataGridTextColumn Header="Ürün Açıklaması" Binding="{Binding PRODUCT_NAME}"/> <DataGridTextColumn Header="Adet" Binding="{Binding QUANTITY}"/> <DataGridTextColumn Header="ISK" Binding="{Binding DISCOUNT}"/> <DataGridTextColumn Header="KDV" Binding="{Binding TAX}"/> <DataGridTextColumn Header="Birim Fiyat" Binding="{Binding …

Continue Reading

How to handle mail delivery failure notice in a C# VSTO Addin

July 14, 2021 by Code Error

Posted By: Anonymous I’m working on an C# VSTO Outlook addin, that extracts some information out of received mails. For normal messages this works fine, but if it’s a mail delivery notice it fails because it’s not a mailitem. foreach (Outlook.MailItem mail in outlookApp.ActiveExplorer().Selection) { //get some information } The errormessage is: System.__ComObject can’t be …

Continue Reading

pugixml – iterating over specific nodes

July 14, 2021 by Code Error

Posted By: Anonymous I have a xml document with a node which has children nodes but I want to iterate over specific nodes which names are stored in the array, for example: const char* childrenNodes[]={"childNodeA", "childNodeC", "childNodeK"}; I can use next_sibling function which takes as an argument the element of the above array. Do you …

Continue Reading

no matching function for call to ‘regex_match’

July 14, 2021 by Code Error

Posted By: Anonymous Can anyone tell me why function regex_match is not working. It is always giving error saying [cquery] no matching function for call to ‘regex_match’. I am familiar with regex library of python but I was trying whether this works for cpp. #include <iostream> #include <string> #include <regex> using namespace std; int main …

Continue Reading

Measure execution efficiency for compairing two solutions?

July 14, 2021 by Code Error

Posted By: Anonymous I want to measure the efficiency for two solutions for the same problem. I don’t need to include any environmental "noise" into the calculation, just I want to know which of these below solutions would perform better in a perfect world, ie.: which needs more steps to execute? string a; int b; …

Continue Reading

Designing file reader for multiple file formats/headers

July 14, 2021 by Code Error

Posted By: Anonymous I’m trying to design a Reader class, that would be able to read multiple file types (mostly binary representation of something). To get all the metadata from the file, it’s going to use Header class which will somehow tell the Reader class size of the file header, (maybe through static field, idk) …

Continue Reading

Is it possible to register multiple consumers for a RabbitMQ queue using MassTransit?

July 14, 2021 by Code Error

Posted By: Anonymous I use awesome MassTransit (v7.1.6) with .NET to publish and consume messages with RabbitMQ To bind consumer to a specific queue I configure endpoints this way: configurator.ReceiveEndpoint( "QueueName", cfg => { cfg.ConfigureConsumer<MyConsumer>(context); cfg.ExchangeType = Direct; }); So when I start my app I see only one consumer (and one connection for it) …

Continue Reading

Posts navigation

  • 1
  • 2
  • 3
  • 4
  • …
  • 215
  • Next

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error