IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.21 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-07-04
[13:45]<mjzymygo>byte[]?
[13:45]<ddx>well, I got a string from the server
[13:45]<mjzymygo>so it *is* stored in a string?
[13:45]<ddx>split it at \, which is strings
[13:45]<ddx>yes, I guess so
[13:45]<ddx>converted it
[13:45]<ddx>hang on, let me play with somethnig
[13:46]<mjzymygo>ok. well, in that case stuffing it through encoding is gonna trash and alter stuff
[13:46]<mjzymygo>you need to directly handle the data within the string.
[13:46]<sdnffdxdlld>its still deploying X(
[13:46]<ddx>ok, how so?
[13:46]<mjzymygo>for that you need to understand how .NET works with strings
[13:46]<ddx>And if that were true why are the IPs working ? :P
[13:46]<mjzymygo>well, in your place i'd use pointers.
[13:46]<sdnffdxdlld>20 minutes!
[13:47]<mjzymygo>dmh: blind luck?
[13:47]<ddx>probably :]
[13:47]<rwyfcygs>I found that : short port = (short)(bytes[0] << 8 | bytes[1]);
[13:47]<ddx>I'm using
[13:47]<ddx>byte[] converted = Encoding.ASCII.GetBytes(chunk);
[13:47]<mjzymygo>fuck dude
[13:47]<ddx>so
[13:47]<rwyfcygs>That seems to work, if you have port 4627 = new byte[2] { 0x12, 0x13};
[13:47]<mjzymygo>dmh: with that, any number >127 is fubar
[13:47]<ddx>no wonder IPs appear to work :/
[13:47]<ddx>ok so its not encoded for sure then
[13:48]<ddx>I just overthought it and confused that bit
[13:48]<ddx>I will just use the String indexer to do it by hand
[13:48]<rwyfcygs>Is there an absolute requirement to keep the byte count down?
[13:49]<ddx>awilkins, no - not at all
[13:49]<ddx>I just dont know what the hell I'm doing
[13:49]<ddx>I'm going to remove the encoding bit
[13:49]<rwyfcygs>Just seems that it's a bit overcomplicated for storing a port number, why not just use the number as a string
[13:49]<ddx>well, its a protocol
[13:49]<ddx>q2 server query at that
[13:49]<rwyfcygs>So it's predefined?
[13:50]<ddx>yes
[13:50]<rwyfcygs>Bloody propellor-head id developers.
[13:50]<ddx>heheh
[13:50]<mjzymygo>dmh: you should really be dealing with protocol based stuff within a byte array, not a string anyway, unless its a text based one by design
[13:51]<rwyfcygs>That, is the product of someone who just dumps the bytes into a struct with a pointer assignation.
[13:51]<ddx>its just protocol based
[13:51]<ddx>reading bytes directly
[13:51]<ddx>i was sorely wrong
[13:51]<vyzusdjvnev>would it be better to use seperate aspx.cs files for each page or all pages share one aspx.cs file?
[13:51]<mjzymygo>seperate!!!!
[13:52]<rwyfcygs>Seperate ; if you want re-use, make common classes
[13:52]<vyzusdjvnev>okay i just was making sure ;)
[13:53]<vyzusdjvnev>omg
[13:53]<vyzusdjvnev>if they did everyone would quit
[13:53]<ddx>awilkins, short port = (short)(chunk[4] << 8 | chunk[5]); didnt work right for me
[13:53]<mjzymygo>I never use cut and paste...
[13:53]<ddx>well let me dobule check
[13:53]<mjzymygo>strange huh
[13:54]<rwyfcygs>I'll refine that ; COPY and paste should be outlawed
[13:54]<rwyfcygs>CUT and paste is ok
[13:55]<mjzymygo>*disamiguation* I agree with awilkins
[13:55]<mjzymygo>*disamBiguation
[13:57]<mjzymygo>ASPX/ASCX files should be baned
[13:57]<mjzymygo>*banned
[13:57]<rwyfcygs>Or maybe you should just bind ctrl-X to a WAV player that says "Fucktard". It wouldn't remove your ability to do it, but you'd think twice after a day or so.
[13:57]<rwyfcygs>*ctrl-C
[13:58]<zyccus>I've done my first proper web development with ASP.NET. It hasn't been the nicest experience.
[13:59]<mjzymygo>don't get me wrong, I appreciate wilko's and other view points.
[13:59]<mjzymygo>but I've created models like ASP.NET for CMS systems and the like, and I know for a fact that ASP.NET is a ball-ache
[13:59]<rwyfcygs>I did my first web development with VBscript ASP pages and VB6 components.
[13:59]<mjzymygo>it feels like a bolt it together
[14:00]<rwyfcygs>I tend to avoid web development on principle.
[14:00]<ddx>so
[14:00]<mjzymygo>awilkins: me too. some C++ tho.
[14:00]<sdnffdxdlld>hmmm it seems to be visual studio taking the time ... not sql server
[14:00]<ddx>on a side note
[14:00]<mjzymygo>I prefer direct CGI
[14:00]<ddx>since this isnt string
[14:00]<ddx>i cant use Split('\\') :(
[14:00]<pfrsdr>anyone played with SslStream before? Having some issues with authentication
[14:00]<rwyfcygs>dmh ; Is it fixed length? (presume not)
[14:00]<pfrsdr>'the token passed to the function was not valid'
[14:00]<ddx>no, its rather annoying
[14:01]<ddx>I'm thinking, read the crap into a big byte
[14:01]<mjzymygo>dmh: shame ;) then find the ascii code for the '\' and run a search for the index. then do your stuff from that index+1
[14:01]<pfrsdr>Which is irritating, because that error is less than helpful :) - msdn/google is not really any help. I think maybe the certificate format im using (PEM) may not be compatible
[14:01]<ddx>there are multiple \ though, how woudl that work out?
[14:01]<ddx>wouldnt it be easier to convert the byte array into a string, split it, then conver the chunks?
[14:01]<ddx>convert
[14:01]<ddx>that was fairly painless
[14:02]<rwyfcygs>Array.IndexOf takes a start index parameter
[14:02]<ddx>right
[14:02]<mjzymygo>dmh: you not ever done any (FOSP) work huh? forward-only-stream-parsing?
[14:02]<rwyfcygs>Or yes, you could use a Stream
[14:02]<ddx>no, I haven't done much with sockets, encoding, text parsing
[14:02]<ddx>its UDP
[14:02]<ddx>:(
[14:02]<rwyfcygs>MemoryStream?
[14:02]<mjzymygo>you could throw the byte array into a memory stream.
[14:02]<ddx>like a textstream?
[14:03]<mjzymygo>System.IO.MemoryStream <--
[14:03]<ddx>Ok, but what capabilities does
[14:03]<mjzymygo>works forward only
[14:03]<ddx>nm I'll msdn







