IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-04-02 18:00:08
Channels: 41
Logged Lines: 6229042
Size: 1797.83 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-07-26
[12:08]<dnscr>ah yeah =)
[12:08]<fyfuym-syfggag>I did not even read what you typed
[12:08]<mjzymygo>=) your right =)
[12:09]<cjmgrug>whoa! 30 UKP /month????
[12:09]<nnzjpfrr>something seems nonsensical in here...
[12:10]<cjmgrug>GBP* :p
[12:10]<mjzymygo>goRoDek... because Intel based PU's are little-endian
[12:11]<nnzjpfrr>I just found my 2 years old music folder on my brother's hdd...
[12:11]<mjzymygo>s/PU/CPU
[12:11]<fyfuym-syfggag>CodeRun thats for reseller
[12:11]<fyfuym-syfggag>unlimited domains
[12:11]<fyfuym-syfggag>:)
[12:13]<nnzjpfrr>yeah, I had rage back then.
[12:14]<prnn>I receieve buffers with Socket.BeginReceieve. what would be the best way of splitting it into messages separated by "\r\n"?
[12:14]<nnzjpfrr>uhm, String.Split()?
[12:14]<prnn>it's a byte[]
[12:14]<nnzjpfrr>convert it into char[] then into string?
[12:14]<rwyfcygs>GoRoDeK: I think your problem is that you are shifting signed datatypes, which will then be implicitly cast to a unit
[12:15]<nnzjpfrr>string is the most efficient way for handling strings... obviously.
[12:15]<gjrjdnk>Moridin8, thanks for the hint. i got the problem solved: a casting did the trick: ((uint)8<<28); i'm convinced that the compiler tries to interprete the 8 as a int
[12:15]<mjzymygo>it does
[12:15]<gjrjdnk>awilkins, exactly :)
[12:15]<prnn>I want to do something more generic, so that user of my class can read until any byte
[12:16]<nnzjpfrr>you've never written c++ have you?
[12:16]<rwyfcygs>8U<<28U would also work
[12:16]<prnn>how is that relevant to this question?
[12:16]<nnzjpfrr>actually char (ascii) == byte
[12:16]<mjzymygo>um... in .NET char is a word (2 bytes)
[12:17]<nnzjpfrr>implementing substring search yourself might be a hassle...
[12:17]<nnzjpfrr>Moridin8: though, you can convert char into byte and byte into char.
[12:17]<mjzymygo>if you wanna cheat, reference the microsoft.visualbasic.dll shit
[12:17]<mjzymygo>zeroflag, thats only due to littlendianness
[12:18]<nnzjpfrr>plus, if you write an byte into your string, you always can typecast it back to a byte.
[12:18]<mjzymygo>char (space) = 32 0 byte (space 0) = 32
[12:18]<nnzjpfrr>it's that inefficient? oO
[12:18]<mjzymygo>zeroflag. yup
[12:18]<rwyfcygs>That's internationalisnm for you
[12:18]<nnzjpfrr>omg.
[12:18]<rwyfcygs>It's all those dang foreigners faults
[12:18]<nnzjpfrr>can utf8 fit into a word?
[12:19]<rwyfcygs>UTF-8 uses single bytes much of the time
[12:19]<nnzjpfrr>I know that.
[12:19]<mjzymygo>zeroflag: utf8 ensures only the first byte is used, the second is always null (zero)
[12:19]<nnzjpfrr>I want to know about, say, chinese characters.
[12:20]<prnn>the problem is I can have many messages in a single buffer, or not a single complete one. I'm not sure how to handle that without doing a mess
[12:21]<mjzymygo>doing a 'mess' is often the way to do it#
[12:21]<nnzjpfrr>well, then...
[12:21]<nnzjpfrr>let's do this messy.
[12:21]<mjzymygo>all the .net methods you call are messes themselves...
[12:21]<nnzjpfrr>set up a queue that stores all messages.
[12:21]<mjzymygo>the libraries are all developed in c#
[12:21]<nnzjpfrr>set up 2 buffers.
[12:21]<nnzjpfrr>or... 1 is enough.
[12:22]<nnzjpfrr>write to your buffer until the last set of bytes has the "string" you're searching for.
[12:22]<nnzjpfrr>search is brute force linear.
[12:22]<nnzjpfrr>whenever that buffer is done, add it to the queue and start the new buffer...
[12:23]<nnzjpfrr>buffer is List<byte> obviously.
[12:23]<nnzjpfrr>queue is some <byte[]>
[12:23]<nnzjpfrr>are there generic queues?
[12:23]<prnn>queue because I can have more than one message in a buffer?
[12:23]<nnzjpfrr>you can never be sure how many messages accumulate before the user reads them...
[12:24]<prnn>yeah. so before reading again I check if queue is full
[12:24]<prnn>or empty
[12:24]<nnzjpfrr>queue is never full.
[12:24]<nnzjpfrr>queue is a list implementation.
[12:24]<prnn>I meant non-empty
[12:25]<nnzjpfrr>you can add some byte[] GetNextMessage() method that returns null if there's nothing...
[12:26]<prnn>when I put a message in queue I should remove it from my main buffer?
[12:27]<prnn>wouldn't it also work without queue then
[12:28]<prnn>check if buffer has delimiter, remove bytes until delimiter, send that to caller
[12:33]<prnn>I'm not sure what I gain with queue
[12:37]<sdnffdxdlld>anyone know why the bastard combobox wont set a .SelectedItem?
[12:37]<nnzjpfrr>faze: is your library assynchronus or synchronus?
[12:37]<fyfuym-syfggag>smellyhippy
[12:37]<prnn>async
[12:37]<fyfuym-syfggag>how are you trying to set it?
[12:37]<nnzjpfrr>faze: then you NEED a queue.
[12:37]<sdnffdxdlld>and if anyone suggests I try .SelectedItem = validItem; then they will get a very sarcy reply :P
[12:38]<fyfuym-syfggag>smellyhippy it needs to be a index
[12:38]<prnn>zeroflag why?
[12:38]<fyfuym-syfggag>ie this.combobox1.selecteditem = 1
[12:38]<fyfuym-syfggag>and you should use this.combobox.selectedindex = 1
[12:38]<sdnffdxdlld>no thats SelectedIndex
[12:38]<fyfuym-syfggag>not item
[12:38]<sdnffdxdlld>but nice try boyo :P
[12:38]<mjzymygo>=)
[12:38]<fyfuym-syfggag>fag
[12:38]<sdnffdxdlld>right that'd be fine if i wanted selected index
[12:38]<sdnffdxdlld>but i dont
[12:38]<fyfuym-syfggag>just use selected index
[12:38]<sdnffdxdlld>i want item
[12:39]<fyfuym-syfggag>then whats the issue ?
[12:39]<nnzjpfrr>faze: how would that by assync if the user decides that he doesn't have time to handle the message when it arrives and, as a result, all messages that are sent after the message until the user handles it are lost? that'd be stupid.
[12:39]<mjzymygo>smellyhippy: but that would be too easy...
[12:39]<fyfuym-syfggag>does that item exist?
[12:39]<sdnffdxdlld>right so your syaing use like 3 lines of extra code instead of doing it the proper way? thats a work around ... not an answer ;)
[12:41]<fyfuym-syfggag>can you use system.io.directory
[12:41]<fyfuym-syfggag>tyo do recursive stuff?
[12:41]<fyfuym-syfggag>ie get files in sub dirs?
[12:41]<prnn>zeroflag I call user supplied OnRecv when there's read data, I suppose he could keep his own queue, but I'm not sure why he wouldn't process the message right there







