[Solved] How can I check time in C++?

[ad_1] You have to use C time function for getting computer clock’s time. The basic idea is following: Ask the user for “his” time In the same time save the computer’s current time When is time to showing updated current time: Check computer current time Calculate the users’s current time using previous stored times as … Read more

[Solved] How to update database using dictionary with linq

[ad_1] This will let you loop over your dictionary values: foreach (string key in dictionary.Keys) { string value = dictionary[key]; //Now, do something with value, such as add to database } And this will let you find a specific dictionary value: string key = “a_key”; if (dictionary.ContainsKey(key)) { string value = dictionary[key]; //Now do something … Read more

[Solved] WPF Calling thread cannot access with eventargs

[ad_1] The FinalFrame_NewFrame event is raised on a worker thread by your “video device”…thus as you have figured out you need to use Invoke to get access to your pboLive element on the UI thread…but you need to pass across the “bitmap”. I believe you just need this: this.Dispatcher.Invoke( new Action<Bitmap>( (bitmap) => { pboLive.Source … Read more

[Solved] pass two dimensional array to a method C++ [duplicate]

[ad_1] That would be okay if you were to read or modify the positions of the matrix, however you are going to modify the matrix itself. In your example, you’ll need to create another matrix. EDITED: I’ve modified this to use unique_ptr, because of the comments (though I don’t think the OP is really ready … Read more

[Solved] A simple C program output is not as expected

[ad_1] signed char c; unsigned char b; b = 0xf4; /* … */ c = (signed)b; The value of b is 0xf4 (244) but c type (signed char) can only hold values between -128 and 127 (in your implementation). So when 244 is assigned to c it is first converted to signed char and C … Read more

[Solved] Unable to read from a CSV using List

[ad_1] Your example will print something like “System.Collections.Generic.List’1[System.String]” This is because the Console.WriteLine() is expecting a string (which it may be receive using the object’s ToString() method) yet you pass it a List<> object whose ToString() method returns “System.Collections.Generic.List’1[System.String]”. Instead you need to retrieve each string from the list with a foreach loop and then … Read more

[Solved] Drawing a rectangle with a certain angle of degree

[ad_1] It depends on the drawing environment you’re using. For example, if you use HTML5 canvas, you could rotate the canvas, draw the rectangle and then return the canvas to the original position, obtaining the “rotated” rectangle. You should check your environment documentation for further info or give more info in the question so we … Read more

[Solved] For condition running only once when calling JS File

[ad_1] What @Lloyd said is correct, the + i is necessary to make unique pairs. Try this: for (int i = 0; i <= 2; i++) { Page.ClientScript.RegisterStartupScript(GetType(), “a”+ i, “foo(‘hello’);”, true); } You were missing the semicolon at the end of the javascript function. This is what was being generated with what @Lloyd suggested … Read more

[Solved] Automapper custom object

[ad_1] First: You should really read the FAQs on how to post a question and what information should be added. (No, I’m not the downvoter) Here is an example how to get your mapping to work. Please note, that I’ve changed your classes a bit, because AutoMapper needs properties. Source source = new Source(); source.Id … Read more

[Solved] Linq – cast anonymous type to concrete type

[ad_1] Simply create instances of the concrete type (there is no requirement to use an anonymous types in LINQ): var suppliers = SupplierView.Select() .GroupBy(x => x.Name.Substring(0, 1).ToUpper(), (alphanumeric, suppliers) => new AlphanumericSuppliers // concrete { Alphanumeric = alphanumeric, Suppliers = suppliers.OrderBy(x => x.Name).ToList() // * }) .OrderBy(x => x.Alphanumeric); *As mentioned in comments, either change … Read more