15,918,808 members
Home / Discussions / Algorithms

# Algorithms

 Re: Unique number from two numbers harold aptroot15-May-10 5:43 harold aptroot 15-May-10 5:43
 Re: Unique number from two numbers Luc Pattyn15-May-10 6:00 Luc Pattyn 15-May-10 6:00
 Re: Unique number from two numbers CPallini18-May-10 1:52 CPallini 18-May-10 1:52
 Re: Unique number from two numbers CPallini17-May-10 22:37 CPallini 17-May-10 22:37
 Re: Unique number from two numbers theCPkid18-May-10 1:39 theCPkid 18-May-10 1:39
 Re: Unique number from two numbers CPallini18-May-10 1:45 CPallini 18-May-10 1:45
 Socket message(frame) pattern matching Hamed Musavi13-May-10 7:42 Hamed Musavi 13-May-10 7:42
 Re: Socket message(frame) pattern matching Luc Pattyn13-May-10 7:55 Luc Pattyn 13-May-10 7:55
 Hamed Mosavi wrote:matching packets I see nothing to match; you said the message would start with a size, so the first 1/2/4/? bytes should be aggregated into a size value (maybe `BitConverter.ToInt32` comes in handy), then that number of bytes of data are expected, then the next 1/2/4/? bytes should be aggregated into a checksum value, which when it matches the local checksum calculation will make the message acceptable, otherwise unacceptable. You may apply extra checks, such as upper/lower limits to datasize. When multiple systems (and maybe multiple implementations) are going to be used, you should carefully specify the checksum algorithm used, and the byte order ("endianness") in multi-byte values (probably size and checksum). If you need syncing capabilities (e.g. because some bytes may get lost underway), you should start with a fixed header, sometimes called an eye catcher, akin to the start bit of RS232C. Then your receiver should check the data starts with a correct header, and ignore anything that does not. Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] I only read formatted code with indentation, so please use PRE tags for code snippets. I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
 Re: Socket message(frame) pattern matching Hamed Musavi13-May-10 8:21 Hamed Musavi 13-May-10 8:21
 Re: Socket message(frame) pattern matching Luc Pattyn13-May-10 8:31 Luc Pattyn 13-May-10 8:31
 Re: Socket message(frame) pattern matching Hamed Musavi13-May-10 8:55 Hamed Musavi 13-May-10 8:55
 Re: Socket message(frame) pattern matching Luc Pattyn13-May-10 9:05 Luc Pattyn 13-May-10 9:05
 Re: Socket message(frame) pattern matching Hamed Musavi13-May-10 9:25 Hamed Musavi 13-May-10 9:25
 Re: Socket message(frame) pattern matching Luc Pattyn13-May-10 9:34 Luc Pattyn 13-May-10 9:34
 Re: Socket message(frame) pattern matching Hamed Musavi13-May-10 9:39 Hamed Musavi 13-May-10 9:39
 find a sulution! wbgxx3-May-10 3:59 wbgxx 3-May-10 3:59
 Re: find a sulution! Kevin Drzycimski3-May-10 4:06 Kevin Drzycimski 3-May-10 4:06
 Re: find a sulution! wbgxx3-May-10 4:12 wbgxx 3-May-10 4:12
 Re: find a sulution! Luc Pattyn3-May-10 4:13 Luc Pattyn 3-May-10 4:13
 Re: find a sulution! wbgxx3-May-10 4:15 wbgxx 3-May-10 4:15
 Re: find a solution! theCPkid6-May-10 2:21 theCPkid 6-May-10 2:21
 Re: find a solution! [modified] Radhakrishnan G.18-May-10 3:30 Radhakrishnan G. 18-May-10 3:30
 Re: find a solution! talazz12-May-11 2:53 talazz 12-May-11 2:53
 Simulating movement Code-o-mat24-Apr-10 5:49 Code-o-mat 24-Apr-10 5:49
 Last Visit: 31-Dec-99 18:00     Last Update: 17-Jun-24 16:08 Refresh ᐊ Prev1...120121122123124125126127128129 Next ᐅ