Click here to Skip to main content
15,917,565 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: And Or and Xor with floating point Pin
supercat925-Feb-09 6:08
supercat925-Feb-09 6:08 
GeneralRe: And Or and Xor with floating point Pin
PIEBALDconsult25-Feb-09 6:48
mvePIEBALDconsult25-Feb-09 6:48 
QuestionCalculate intersection between arcs / lines and arc /arc Pin
sagaert21-Feb-09 8:12
sagaert21-Feb-09 8:12 
AnswerRe: Calculate intersection between arcs / lines and arc /arc Pin
Arash Partow21-Feb-09 16:40
Arash Partow21-Feb-09 16:40 
GeneralRe: Calculate intersection between arcs / lines and arc /arc Pin
sagaert22-Feb-09 3:13
sagaert22-Feb-09 3:13 
QuestionCaculate time left for data transfer Pin
cdpace17-Feb-09 6:21
cdpace17-Feb-09 6:21 
GeneralRe: Caculate time left for data transfer Pin
Luc Pattyn17-Feb-09 6:32
sitebuilderLuc Pattyn17-Feb-09 6:32 
GeneralRe: Caculate time left for data transfer Pin
cdpace17-Feb-09 11:30
cdpace17-Feb-09 11:30 
Hello m8, I pated the reciever's code below do you think im implementing what you said correctly?

/
/Retrieve Stream from the socket that is connected to the client machine
                    NetworkStream incomingNetworkStream = new NetworkStream(clientsocket);
                    //Output Stream which will be used to store the incoming file onto the machine's HDD
                    FileStream fsout = new FileStream(parser.TemporaryFilesPath + @"\database.zip", FileMode.OpenOrCreate, FileAccess.Write);

                    long size = Convert.ToInt64(incomigFileSize);
                    long rdby = 0;
                    int len = 0;

                    //Starting time
                    DateTime starttime = DateTime.Now;
                    bool isfirst = false;

                        if (incomingNetworkStream.DataAvailable)
                            {
                                while (rdby < size)
                                {
                                    //buffer to store a portion of the incoming file
                                    byte[] buffer = new byte[65535];

                                    len = incomingNetworkStream.Read(buffer, 0, buffer.Length);
                                    fsout.Write(buffer, 0, len);

                                    rdby = rdby + len;

                                    if (downloadpercentage > 10)
                                    {
                                        if (!isfirst)
                                        {
                                            EstimatedTransfertime = DateTime.Now.Subtract(starttime);
                                            isfirst = true;
                                        }

                                        Minutes = EstimatedTransfertime.Minutes * (100 / size - 1);
                                        Seconds = EstimatedTransfertime.Seconds * (100 / size - 1);
                                    }

                                    downloadpercentage = (int)(((double)rdby / (double)size) * 100.00);
                                }
                                fsout.Flush();
                                fsout.Close();
                                isReading = false;

                            }
                            else
                            {

                            }


THank you Smile | :)
GeneralRe: Caculate time left for data transfer Pin
Luc Pattyn17-Feb-09 13:51
sitebuilderLuc Pattyn17-Feb-09 13:51 
AnswerRe: Caculate time left for data transfer Pin
Leonardo Muzzi17-Feb-09 9:12
Leonardo Muzzi17-Feb-09 9:12 
Questionthinning algorithm Pin
Swati Khanna17-Feb-09 1:40
Swati Khanna17-Feb-09 1:40 
AnswerRe: thinning algorithm Pin
riced17-Feb-09 2:33
riced17-Feb-09 2:33 
AnswerRe: thinning algorithm Pin
Andrew Kirillov5-Mar-09 0:49
Andrew Kirillov5-Mar-09 0:49 
QuestionAES Rijndael Cryptography fails Pin
Leonardo Muzzi16-Feb-09 10:16
Leonardo Muzzi16-Feb-09 10:16 
GeneralRe: App fails to use AES Rijndael Cryptography correctly? Pin
Luc Pattyn16-Feb-09 10:41
sitebuilderLuc Pattyn16-Feb-09 10:41 
AnswerRe: App fails to use AES Rijndael Cryptography correctly? Pin
Leonardo Muzzi17-Feb-09 3:13
Leonardo Muzzi17-Feb-09 3:13 
QuestionCreating graph of file usage in build tree Pin
Adam Dare13-Feb-09 3:38
Adam Dare13-Feb-09 3:38 
AnswerRe: Creating graph of file usage in build tree Pin
ky_rerun24-Feb-09 15:16
ky_rerun24-Feb-09 15:16 
GeneralRe: Creating graph of file usage in build tree Pin
Adam Dare24-Feb-09 18:35
Adam Dare24-Feb-09 18:35 
GeneralRe: Creating graph of file usage in build tree Pin
ky_rerun24-Feb-09 20:24
ky_rerun24-Feb-09 20:24 
GeneralRe: Creating graph of file usage in build tree Pin
Adam Dare25-Feb-09 4:13
Adam Dare25-Feb-09 4:13 
Questionerror correction Pin
Deresen12-Feb-09 2:02
Deresen12-Feb-09 2:02 
AnswerRe: error correction Pin
Ravadre12-Feb-09 4:44
Ravadre12-Feb-09 4:44 
GeneralRe: error correction Pin
Deresen12-Feb-09 5:07
Deresen12-Feb-09 5:07 
GeneralRe: error correction Pin
Ravadre12-Feb-09 6:45
Ravadre12-Feb-09 6:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.