|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Even if we did, we have no idea what question your teacher has set, so we have no idea why you want to include a heap sort into existing K-means code.
The only way to do that would be: understand each bit of code, and think about what you are trying to achieve. Try it yourself, you may find it is not as difficult as you think! Just grabbing bits of code from the internet and slamming them together is like assuming you can use the wheels from any vehicle to replace the ones on your car: some will not fit on the hub (four bolts instead of five), some won't fit under the wheel arches as they are too wide, others won't fit because they are too tall. You need to look carefully at the car and at potential wheels in order to determine if they can be fitted and if so what you need to do to fit them.
A much better solution is to write your own code instead of trying to hand in somebody else's and risking plagiarism allegations...
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
ok just tell me where to start just say 1 tip please
|
|
|
|
|
If you mean "tell me where to start to bolt these two together" then I already did:
Quote: The only way to do that would be: understand each bit of code, and think about what you are trying to achieve.
If you mean "how do I start to do it for myself?" then that's just the same as any other coding homework you have been given: read the question carefully, research the algorithms (which are not code) you need, write yourself a specification (so you know exactly what you are working towards), expand that to a design, and then code and test. I can't even see your homework question, so I can't be any more specific than that!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi guys,
I am working in something new and I would like to write a binary file with fields of different length, being it 2, 4, 8 bytes mostly.
I already get the desired conversion for doubles with
double dTest_max = 15.020245207;
byte[] bytesDouble_max = BitConverter.GetBytes(dTest_max);
Console.WriteLine("Hexa Double MAX (byte[]) = 0x" + BitConverter.ToString(bytesDouble_max).Replace("-", ""));
Using the same with the integer "312" gives me: output = 0x38010000
If I cast the int to long I do get my desired: output = 0x380100000000
But as the desired length of the parameter in the binary telegram is fixed by header (dynamic) I would like to avoid having to evaluate the respective length of the actual parameter to choose if I have to cast it or not.
Is there any hidden function / method in .Net that could do that?
I mean something like:
Console.WriteLine("0x"+int.ToString("X"));
Console.WriteLine("0x"+int.ToString("X12"));
But for the BitConverter?
I have already had a look to: BitConverter Class (System) | Microsoft Docs[^] and its overloads, but the "start" and "length" are only to be used if the data input is an array, and haven't seen anything to determine the length of the output
If not... I am already thinking to use workarounds like filling bytes[] with different fixed lengths and then replacing only the bytes given by the conversion.
Using int.ToString("X12") and the "reversing" it would do the job too, but I am not sure if that would be reliable enough for my use case.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
No, there isn't - ToString is a presentation function, so it adds a lot of formatting so you can present your data in "user friendly" formats depending on how they need to view the data.
But an integer only has one size: 32 bits. And a long is always 64 bits - so BitConverter will always reflect that.
However, this might be of use to you: ByteArrayBuilder - a StringBuilder for Bytes[^]
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: No, there isn't I already thought that, but dreaming is for free, isn't it?
Thanks for the link. I have had a fast a look and seems promising. Pity that you didn't find the time in 5 years to complete it as you said in the comment
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
modified 11-Dec-18 3:46am.
|
|
|
|
|
Quote: I'll think about it, and maybe add it when I have a little time. A little time ... a little time ... I need a time machine some days.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Only in some days? For me would be the other way around, some days is when I don't need it.
I am starting to think about inventing the days of 30 hours. But I know for sure that a lot of people would be pissed off and try to kill me if I did
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I know what you mean! Maybe I'll just edit the comment ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: Maybe I'll just edit... If you find a little time?
I kind of have a deja vou...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: I am starting to think about inventing the days of 30 hours. I will shorten my days by 8 hours; that'll get you your 30. Time is moving too slowly for me these days.
cheers, Bill
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I want open-source project to manage super market .
Is there any one help me?
|
|
|
|
|
I ran your question through Google Translate, and it said:
Student - Detected: I want a supermarket management project I can hand in as my own work so I don't have to do my own homework. We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Mody_2004 wrote: I want open-source project to manage super market .
Is there any one help me? There's already a boatload of free POS-software.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You do realize that any "open source" project you try to hand in will not look anything like the code you've been turning in? You're going to be immediately called out for not doing your own work and will fail the class on the spot or lose your job.
|
|
|
|
|
People in hell want ice water
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
how to bind all text filed with dropdownlist data selection in kendo grid,give any example
please help me
|
|
|
|
|
Member 11567959 wrote: please help me
What have you tried?
Where are you stuck?
What help do you need?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Whenever I see this, I always think of the main character in that movie, The Fly, saying "Help me! Help me!".
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi All,
In my application i am calling one method to fetch the results from DB. In that DAL layer method i used dataadapter to fetch the results. It is working fine for one user. When multiple users are invoking the same page i am getting the error as "There is already an open DataReader associated with this Command which must be closed first." In the code i haven't used any Datareader to execute. i don't understand why i am getting this error. Can any one help me in this.
Reagrds,
Govind.
|
|
|
|
|
You have missed out an awful lot of information here. I assume that this is for a web page. I am also going to assume that you haven't disposed of your DataAdapter (or your Connection or Command if you have created one). Make sure that you Dispose of these objects as soon as you are done with them.
This space for rent
|
|
|
|
|
To add to Pete's excellent advice, the best way to do this is to put the construction of all database related items (Connections, Commands, Adapters, ...) inside a using block. That way, when the item goes out of scope for whatever reason (even if there is a failure) the object is automatically closed and disposed.
Do that, and you will never have the problem again, as well as not hogging scarce resources.
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand cmd = new SqlCommand("SELECT Id, description FROM myTable", con))
{
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
int id = (int) reader["Id"];
string desc = (string) reader["description"];
Console.WriteLine("ID: {0}\n {1}", id, desc);
}
}
}
}
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I almost didn't up-vote this due to your horrific brace indentation!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Philistine!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|