[Solved] c# logic approach to dispatch efficiency [closed]

[ad_1] If you are allowed to use external libraries (I assume some homework assignment) you should use the Combinatorics library (via NuGet). If not, do the combinatoric stuff yourself 😉 The idea: You need all possible (non repeating) combinations of cars and zones to find the combination(s) that gets the most jobs done. Using Variations … Read more

[Solved] Display my form behind other windows [closed]

[ad_1] Something like this: public partial class Form1 : Form { Dictionary<int, string> Windows = new Dictionary<int, string>(); public delegate bool WindowEnumCallback(int hwnd, int lparam); [DllImport(“user32.dll”)] public static extern bool EnumWindows(WindowEnumCallback lpEnumFunc, int lParam); [DllImport(“user32.dll”)] static extern bool SetForegroundWindow(IntPtr hWnd); [DllImport(“user32.dll”)] public static extern bool IsWindowVisible(int h); [DllImport(“user32.dll”)] public static extern void GetWindowText(int h, StringBuilder … Read more

[Solved] How to cast an int to a char * in C? [duplicate]

[ad_1] This is just not valid code. Even if you resolve the compile-time error, the result will likely be some sort of memory access error at run time. The result will be a pointer to a string that you have no idea where it actually points to. And so you’ll have an error when your … Read more

[Solved] Accessing Forms data from another form

[ad_1] First of all you have to create an instance of Form2. namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Form2 form2; public Form1() { InitializeComponent(); form2 = new Form2(); } private void button1_Click(object sender, EventArgs e) { String value1 = File.ReadAllText(textBox1.Text); foreach (string line in value1.Split(‘\n’)) { form2.listBox1.Items.Add(line); } } } … Read more

[Solved] Map::insert does not work [closed]

[ad_1] See the reference: template< class Key, class T, class Compare = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T> > > class map; http://en.cppreference.com/w/cpp/container/map An std::map takes a comparator that tells if the first argument is less than the second. Not if they are equal. Otherwise it could not build a binary tree. You don’t … Read more

[Solved] Deserialize nested JSON into C# class

[ad_1] Your data model should be as follows: public class Info { public string prop1 {get;set;} public string prop2 {get;set;} public int prop3 {get;set;} // Modified from //public Dictionary<string, List<int>> prop4 {get;set} public List<Dictionary<string, int>> prop4 {get;set;} } public class Response { // Modified from //public class Dictionary<string, List<Info>> Item {get;set;} public Dictionary<string, Info> Items … Read more

[Solved] Creating a list with elements other lists (same struct)

[ad_1] Nested* Nested_create(List list) { Nested* new = malloc(sizeof(Nested)); new->list = list; new->next = NULL; return new; } void Nested_add(Nested** proot, Nested* node) { if (*proot == NULL) { *proot = node; } else { Nested* cur = *proot; while (cur->next) cur = cur->next; cur->next = node; } } void createlistoflists(Nested **LIST, List list1, List … Read more

[Solved] C# Asynchronous Server Sockets – Thread-Safety/Performance (MMO Gaming) [closed]

[ad_1] The first thing I want to mention, since I believe it is answers the root of your question, is that your performance (latency, concurrent connection capacity, etc) is going to be largely defined by the hardware you are running this software on and the network performance for each specific client. Software can improve some … Read more