Home >

c#

Advertisement
  • Lightweight logging library in CMay 9

    I want to get some practice in writing C libraries and so started with something I can use straight away, a logging library. It is very basic and only has two levels: log everything and log only errors. Use logd (log debug) to log any low level thing

  • Optimize OrderBy Generic MethodMay 8

    Here is my OrderBy method which includes concatenated column names. Can this be achieved more efficiently? public static IQueryable<T> Sort<T>(this IQueryable<T> query, List<SortationDto> sortations) where T : BaseEntity { sortatio

  • Entity Framework Code First- related Data not loadingMay 5

    i want to load the product category and manufacturer into devexpress datagrid on product load, but the category which is many to one to the product is not loading This is the code for the object public class Product { public Product() { Weight = 0; H

  • Updating aiScene in ASSIMP with skeleton dataApril 24

    I am working on a project where I take an unrigged closed mesh, import it using ASSIMP, auto-rig it using the algorithm provided by Ilya Baran and Jovan Popovic and again export it using ASSIMP. I have the following code that updates the aiScene stru

  • Using goto with DataReader to get sproc return valueApril 7

    I want to get a second-opinion on my use of goto. SqlCommand and SqlDataReader only read the RETURN-value of a Stored Procedure after the SqlDataReader has been closed. This is a problem if you want to interrogate the return-value to make a decision

  • Implementing a String class using reference countApril 7

    Design a STRING class. Provide support for: Assigning one object for another, Two string can be concatenated using + operator, Two strings can be compared using the relational operators. Modify the STRING class so that assigning/initializing a string

  • Comparing two integers without logical, relational or bitwise operatorsApril 7

    I answered a question on SO today, however it did't receive any up-votes, so I want to know what's wrong with my code. The requirement is to compare the input numbers(granted to be positive) without logical, relational or bitwise operators, and inser

  • What is the difference of this code? [on hold]April 6

    #include <stdio.h> int main(void) { double aRate[10] = { 0.0, 0.1, 0.25, 0.5, 0.5, 0.6, 0.65, 0.8, 0.82, 0.97}; int nAge = 0, i = 0, nFee = 1000; int a = 0; printf("%d : \t%d \n", i, (int)(nFee*aRate[2])); return 0; } The result of this co

  • How do i stop calling the constructorApril 2

    so im working on this program, and i've been told that i should have a menu system that uses functions in my main. But the problem is that whenever i enter the function my constructor is called and resets hte value of a variable that counts the amoun

  • Creating a JObject from a list of paths and valuesApril 1

    Each JObject has a Path property (Similar to xml's XPath) that I can use for querying a JObject (using the SelectToken method). Is there any way (other than creating my own custom parser) to create a nested JObject based on a list of paths and values

  • What's the point of adding ud2 after writing to [ds:0x0]?March 31

    I was experimenting with GCC, trying to convince it to assume that certain portions of code are unreachable so as to take opportunity to optimize. One of my experiments gave me somewhat strange code. Here's the source: #include <iostream> #define UN

  • Why does EOF behave differently in fgets and readMarch 31

    #include <stdio.h> #define MAXLINE 4096 int main(int argc, char **argv) { char *s; char buf[MAXLINE]; s = fgets(buf, MAXLINE, stdin); // here, if replaced with read(0, buf, MAXLINE); return 0; } Input is:12ctrl+d fgets doesn't return until input ctr

  • Automatically reinstall application after identify missing files-setup project c# visual studio 2015March 30

    I created Setup Project in visual studio 2015. I would like to check all necessary files exists after InitializeComponent(); And if any of the files is missing I would like to re-install the application. Any suggestion about the right way to process

  • How to cast CV_64F type Matrix to 1D Array with Double elementsMarch 29

    I couldn't find an answer to this question but I believe it should be easily done. Here I have following data structures; Mat MyMatrix = Mat(3, 1, CV_64F, &targetArray) //Some 3x1 data in it // Some process... array <double ,3> MyArray MyMatrix.

  • Random Winner Based on Percentage Weighting

    Random Winner Based on Percentage WeightingMarch 12

    I have 3 variables and each one has their own percentage to win out of 99.99...%. (The 3 percentages don't act up to 100% perfectly) When button1 is clicked, it will go through 100,000 simulations and afterwards it will output how many times each var

  • Controlling parallel jobs with condition_variableMarch 12

    I'm trying to set up a system where I can have an arbitrary number of parallel tasks, all of which wait for a go signal, do their work, and then stop while a manager collects the results, prepares for the next batch of work, and so on. The easy way I

  • Type-Safe Event SystemMarch 11

    I have recently started writing C# from a strong JavaScript background, and found myself wanting to do something I do all the time in JavaScript: events. Since I have a type system at my disposal, I figured I'd make use of it and make the event syste

  • How to make my Delay Program more efficient and short?March 9

    #include<iostream> using namespace std; const int count = 0; void delay (double); int main() { //your code here... double inp; cout << "Give the desired delay in seconds : "; cin >> inp; delay (inp); return 0; } void delay (dou

  • DirectoryInfo to Resources folder in apk (Unity)March 9

    How do I write a path to Resources folder of apk that is build with Unity? For instance, I'm writing dataPath = Application.dataPath + "/Resources/"; DirectoryInfo dir = new DirectoryInfo(dataPath); in Windows (PC). How do I write this for Andro

  • Testing internal class or private method with xUnitMarch 9

    We're using xUnit as a unit testing framework. The instantiation of the internal classes can be done using [InternalsVisibleTo] attribute (like in here). What is a way to invoke a private method of the class with xUnit? The MSTest framework has Priva

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 13 q. 0.327 s.