[Solved] What is this code doing& [closed]

Maybe this is just overwhelming you. Just start with the first line of main: What does foo bar(0xe8e711395e65686d); do? It creates a variable named bar, which has type foo, and a constructor is called with a parameter 0xe8e711395e65686d. So what does this do? Reading the comment of Mooing Duck: What is it intended to do, … Read more

[Solved] Project of WPF app [closed]

1) The constructor of dialog window can accept parameters. Pass whatever you want from MainWindow to dialog window. DialogWindow dialogwindow = new DialogWindow(params); dialogwindow.ShowDialog(); 2) In DialogWindow, expose the array of ints by a Property. public int[] EditedValues { get; private set;} and access it in MainWindow like int[] editedValues = dialogwindow.EditedValues; 3) same as … Read more

[Solved] How to pass data from WPF form to WPF usercontrol? [closed]

1)You can create public property in UserControl like: public string SomeString { get; set; } And then pass string by xaml: <UserControl1 SomeString=”String”/> or bind SomeString property to property in your MainWindow <UserControl1 SomeString=”{Binding MyStr}”/> 2)You can pass your string to UserControl by constructor. var uc = new UserControl(MyString); solved How to pass data from … Read more

[Solved] Why is there no output for this program? [duplicate]

Computers only store digital information. Integers can be represented accurately in binary, but floating point numbers are approximated. It seems that in the approximations, additional tiny values are preventing your exact comparison from being true. Now is a good time to google “what every programmer should know about floating point numbers” and read it. It … Read more

[Solved] Linq: help me to make this work

You should group all person skills by person id, and then select only those groups, which contain both given category and sub category: unitOfWork.PersonSkillsRepository.GetAll() .GroupBy(p => p.PersonId) .Where(g => g.Any(p => p.IdCategory == ids.IdCategory) && g.Any(p => p.IdSubCategory == ids.IdSubCategory)) .Select(g => g.Key) For optimization, you can filter out skills which do not match any … Read more

[Solved] What is the difference between a double and short type in C? [closed]

From Wikipedia: Short: Short signed integer type. Capable of containing at least the [−32,767, +32,767] range;[3][4] thus, it is at least 16 bits in size. The negative value is −32767 (not −32768) due to the one’s-complement and sign-magnitude representations allowed by the standard, though the two’s-complement representation is much more common. Double: Real floating-point type, … Read more

[Solved] how to set values in a 2d matrix [closed]

Here’s the Linq approach using Enumerable.GroupBy: List<string> strings = new List<string>() { “a”, “b”, “c”, “d”, “e”, “f”, “g”, “h” }; var trios = strings .Select((s, i) => new { Str = s, Index = i }) .GroupBy(x => x.Index / 3); foreach(var trio in trios){ var newRow = table.Rows.Add(); // your DataTable here newRow.ItemArray … Read more

[Solved] Pseudo code to C++ code [closed]

Can this be done better using standard library functions? Hell yes. At the very least, temp = RandomizeArray[i]; RandomizeArray[i] = RandomizeArray[j]; RandomizeArray[j] = temp; Is all replaced by std::swap(RandomizeArray[i], RandomizeArray[j]); The whole process is sort-of replaced (but not quite. Almost certainly a different backing algorithm) by the std::random_shuffle family, but that would be totally defeating … Read more

[Solved] What is the best way to organize a lot of data which contains multiple conditions?

You could organize your data as follows: class Program { static void Main(string[] args) { List<Criteria> list = new List<Criteria>() { new Criteria(Color.green, Country.england, Town.london, GoodBad.good, DayOfTheWeek.sunday, Daytime.evening), new Criteria(Color.red, Country.thenetherlands, Town.amsterdam, GoodBad.bad, DayOfTheWeek.monday, Daytime.night), new Criteria(Color.blue, Country.america, Town.newyork, GoodBad.bad, DayOfTheWeek.tuesday, Daytime.morning), }; Console.WriteLine(“- Native sorting:”); list.Sort(); foreach(var criteria in list) { Console.WriteLine(criteria); } Console.WriteLine(); … Read more

[Solved] Incomplete type is not allowed in swap program

The below program does what you want: #include<stdio.h> #include<conio.h> #include<string.h> void swapping(char s1[],char s2[]) { char temp[30]; //create an array of char in order to store a string strcpy(temp,s1); strcpy(s1,s2); strcpy(s2,temp); //use strcpy to swap strings } int main (void) { char st1[30],st2[30]; printf(“Enter the first string”); scanf(“%s”,st1); printf(“Enter the second string”); scanf(“%s”,st2); //the & … Read more