|
Well, Did anybody use Hungarian Algorithm till now?
|
|
|
|
|
Well, I look at this code and say to myself "I don't see a VOID anywhere, so ...". But I'm interested in the things you say you'd like to accomplish. Mainly debug it so there's no redundancy in the output.
My job isn't so easy. But providing a .proj and making a CP plea out of it would certainly accomplish your goal of being insightful and adding content.
Thanks ahead of time.
|
|
|
|
|
Sorry, I didn't really understood your message..
I'm bad in English
|
|
|
|
|
Basically, what tools are you using?
By "VOID" I mean there's nothing here but Classes and the like. If this was a bonafide Visual Studio project I could open it up there, and debug it myself. At least confirm that it doesn't do what it's designed to do as-is.
I want to help. But consider how the average CPian goes about "helping" here.
|
|
|
|
|
It's visual studio 2012, C# Windows Form Application. You just have to create the method for Form1_Paint.
Thanks for your help
|
|
|
|
|
I'm certainly not going to try to run that, but I would think that you should have a set of unconnected points and a set of connected points. When you connect two unconnected points, you move them both to the connected points set.
|
|
|
|
|
i also tried in that way. But how are you going to make that? Because the algorithm works on the whole matrix, you can't call it for n times to generate n vectors...
|
|
|
|
|
No, I'm not going to "create a project" and run your code - I have better things to do with my life than run random code from random people, where I don't know what the actual code does, and am not about to wade through to find out if there's anything nasty buried in there.
Edit your question.
Cut the code down to just the relevant fragments, and explain what it is doing that you don't expect, or not doing that you do - with details on exactly how to cause it.
To be honest, I don't know why your previous post was closed, but if your attitude then was similar to you attitude this time, I'm not in the least surprised. Do try to remember that we are not paid for this - we do it to help people - so being rude, arrogant and unhelpful does not encourage people to spend their time on helping you.
Help us to help you!
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
Well you clearly copied this[^] and made a couple of changes. Try copying it without making changes.
|
|
|
|
|
only changes on algorithm is that the algorithm works for double values too, not only int
|
|
|
|
|
Oh ok, well then it should work, shouldn't it? Unless that code is broken and no one ever noticed, which is, of course, possible.
Are you sure you're expecting the right thing?
|
|
|
|
|
I have a C# object, something like:
class GUIItem
{
string Name;
string Value;
..
.. some random GUI properties
..
}
have another one that represents a database table:
class SomeDBObject
{
string Name;
string Value;
..
.. some random DB properties
..
}
So what happens is that the GUI builds up the GUIItem objects from an XML resource. However, it only has the Name property. It doesn't have the Value since that is stored in the DB. The concept is that the XML resource tells the GUI how to build the UI and the DB stores the values.
So to load the UI, I need to restore the Value properties from the DB.
So what I need to do is to match up the GUIItem and the SomeDBObject by the Name property and copy SomeDBObject.Value over to GUIItem.Value.
I know I can do this easily with a nested for loop O(n^2). But is there some cooler algorithm?
I think most of the time the KVPs in the database and the UI are going to be in the same order, so I can get by with an O(n)... but its possible a new item might be added to the GUI that is not yet configured in the DB and that would throw things off. Or if an item in the GUI was deleted or re-ordered for some reason.
Something in LINQ perhaps with some kind of join?
|
|
|
|
|
If you are certain that there is 1 DB entry per 1 GUIItem then you can build a HashTable[^] using the name as the key, then after you've initialized your GUIObjects and you are setting the values, the operation becomes an O(n), since element access in a hash table is O(n).
You'll still have to build the table, so really the operation becomes O(n) + O(n), once for building the table, and once when you are setting the GUIItems.
|
|
|
|
|
I'm curious, what benefit do you get from storing your gui item in xml rather than the database!
I have no answer but there must be a linq statement that does a join on the name fields in the 2 collections.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Well, it looks good idea I think but I've never seen like your idea yet.Sorry.
|
|
|
|
|
i have a script manager at my master page, but i have 1 page require a scriptmanager because of cant page 2 scriptmanager hwo should i do? if i open a new webform without attach master page the function can work well?
Quote: <asp:toolkitscriptmanager id="ToolkitScriptManager1" runat="server" enablehistory="true" enablesecurehistorystate="false" scriptmode="Release">
|
|
|
|
|
I think this would be better in the ASP.NET forum.
Veni, vidi, abiit domum
|
|
|
|
|
script manager only can place on one page, since all the pages i attach with master page, so it will occur error, how should i should the problem that one of the page required script manager?
|
|
|
|
|
Did you read my previous message?
Veni, vidi, abiit domum
|
|
|
|
|
inside my database have binary data. what is this problem mean
Exception Details: System.IndexOutOfRangeException: ProductImage
Source Error:
Line 70: byte[] bytes = (byte[])sqlDataReader1["ProductImage"];
SqlConnection conn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
conn1.Open();
String sqlTitle1 = "SELECT * FROM ProductImage WHERE ProductID =@ID";
SqlCommand comm1 = new SqlCommand(sqlTitle1, conn1);
comm1.Parameters.AddWithValue("@ID", Id);
SqlDataReader sqlDataReader1 = comm1.ExecuteReader();
while (sqlDataReader1.Read())
{
byte[] bytes = (byte[])sqlDataReader1["ProductImage"];
string Imageitem = Convert.ToBase64String(bytes, 0, bytes.Length);
Image1.ImageUrl = "data:image/png;base64," + Imageitem;
//Image1.Visible = true;
}
conn1.Close();
my product image table
ProductID datatype nvarchar(50) primarykey
ProductColorType nvarchar(50) primarykey
ProductImg varbinary(MAX)
thx for helping
|
|
|
|
|
byte[] bytes = (byte[])sqlDataReader1["ProductImage"];
ProductImg varbinary(MAX)
Do you see a mismatch between these two names?
Veni, vidi, abiit domum
|
|
|
|
|
haha thx ^^ i copy from old project
|
|
|
|
|
Always a good idea to try a bit of diagnosis before posting here.
Veni, vidi, abiit domum
|
|
|
|
|
|
I'm trying to find the way how to execute a string contain c# code.
Example
string st = "if (textBox1.Text == "Jon" && chkText.Checked)
MessageBox.Show("Yes!");
else
MessageBox.Show(textBox1.Text);";
I want to execute st then i want to see the result in a message box.
Please kindly help me. Thank in advance!
|
|
|
|