[Solved] Stable sort with OrderBy [closed]

you can order by the key like this : var ordered = lstValuesTemp.OrderBy(v => v.Key); or you can order with fonction declare the function like this: public static string CustomOrder(KeyValuePair<string, List<string>> item) { //TODO: add some logic that return a string to compare this item } and than call thia function: var ordered = lstValuesTemp.OrderBy(CustomOrder); … Read more

[Solved] Solving ax^2+bx+c=0 equation using C [closed]

The problem is in your first if statement: if (d=0) This is not comparing d to 0, but is assigning 0 to d. This expression then takes on the value of the assignment, i.e. 0, which evaluates to false. That in turn causes else if (d>0) to evaluate to false, bringing you to the else … Read more

[Solved] Functions in Structures ? C++

Options() is your default constructor. Structs and classes are equivalent in the sense that they can have methods and constructors. What’s after : is the initialisation list for Options(). It tells you that in your default constructor for Options(): num_particles is initialised to NUM_PARTICLES ule_lbp is initialised to false infile initialised to an empty string … Read more

[Solved] How to generate an xml file in C of 1GB

I solved it by creating three files. One with the xml until the opening of the tag in which the data should reside. The second with the generated junk data. The third with the close tag of the bulk data en the rest of the xml. Like so: // Open two files to be merged … Read more

[Solved] how can I replace 2 dim array? [closed]

Basically you need to do the transpose of a given matrix. public T[,] TransposeMatrix(T[,] matrix) { var rows = matrix.GetLength(0); var columns = matrix.GetLength(1); var result = new T[columns, rows]; for (var c = 0; c < columns; ++c) { for (var r = 0; r < rows; ++r) { result[c, r] = matrix[r, c]; … Read more

[Solved] Displaying error message “Email not valid” but still saving to database file

Because all of your code is outside of your if block. So it’s going to execute every time, regardless of the condition. Put the code in the if block: Regex regMail = new Regex(@”^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$”); if (regMail.IsMatch(mailID.Text)) { Email email = new Email(); string emailAdd = mailID.Text; string phone = phoneBox.Text; string messageEmail = email.Text; System.IO.StreamWriter … Read more

[Solved] C++ Text Files usage [closed]

I ran the code in gdb, it runs perfectly. It opens the file, gets the < cr > character from stdin, writes that to the first line which wipes out the first line, then tries to read the first line which is empty so there is no output. Good job 8). You’re just having trouble … Read more