« first day (908 days earlier)      last day (4265 days later) » 

22:00
@zneak why?
its just stdin
could be artibtrary
in fact, it's anything you call Console.SetIn to
that said, not having a limit for buffers can theoretically turn into an attack vector
say you have that on a socket and just buffer stuff until you get a newline
an attacker could just fill your memory with gigabytes of stuff until nothing works anymore
besides, no system is limitless
if you read stuff from stdin to store in a db, you probably have a length limit
if you have no length limit, it's because you're passing the string to another system
streamreader.readline() doesnt have this limitation
and that system probably has a length limit
afaik
sure you can expect an outofmemoryexception if you a \n isnt encountered
but its weird to have to specify an buffer size on a readline
it could be worse than that, the attacker could fill your memory until you have like 16 bytes left and then stop posting data
22:05
actually... can an array have more than int.maxvalue items
yes
only on 64 bits systems though
you need to use LongLength to get its length
ah ok yeah i second guessed cause i checked array.length and it throws
but that makes sense
256 bytes is somewhat small, but 8192 bytes of text on a single line seems more than enough for anything I can think of that should fit on a single line
yeah i guess its the nature of the console since the data from console.read() isnt passed until you hit enter
its still weird that it has an internal buffer like that because you would expect console.openstandardinput().read(byte[1024]) to act like any other stream.
neat find @redtuna
user1125394
how do you transform an enum member to int
22:21
@c'c it's an int by default.
I believe it's EnumType.Value
user1125394
ah thx, but there's not such function is the enum type I'm manipulating
@c'c C# enum?
(int) enum
enum to int in c#? just cast it
user1125394
let me try casting, yes casting works
22:27
That was one of the more annoying things I rediscovered when I had to switch to java for a month: no simple way to convert enums to ints.
user1125394
yep, sucks, you need a function to return this.value
user1125394
the worse is to construct from int, you must loop
22:48
can an API be designed in an MVC fashion? (I dont know MVC, never touched it)
@StuartBlackler of course. a good way to do MVC is to use APIs as your model.
22:59
which data type is better in my sql server table for columns ClassId in chich I would store approx 20 fields only
@RyanJMcGowan ...why not an int?
how many records? millions? What if you need to spit the table across two databases? Will the id be generated by code? etc etc
GUIDs supposedly make terrible primary keys because of index fragmentation IIRC
i.e. it's better to have an incremented (monotonically increasing) identity column if feasible
@MikeF exactly. If there's not a good reason to use anything other than an identity, just use a freaking identity
23:08
they can do but there are ways around it. nhibernate for example will create guids that wont thrash indexes
guids are fine, they just make for shitty urls
@MikeF not really. that's been debunked for a while now: codinghorror.com/blog/2007/03/…
ZOMG HAXED
The primary key and the index don't have to be the same field. You can index by any field.
> You can generate IDs anywhere, instead of having to roundtrip to the database
> Most replication scenarios require GUID columns anyway
those are the biggie for me
in my apps i have a guid for id, but also generate a 8-10 character uid for urls since people seem to be accustomed to those
23:12
You can have a UNIQUE index that isn't your primary key you know....
i dont like the idea of someone increasing an int and being able to try to access a different resource
security through obfuscation!!
:P
good point
relying on id values for security is dangerously cheesy
Apr 5 at 18:23, by Mike F
I suggested we use GUIDs as product names, and come up with jingles to help people remember.
that was the best comment ever
ha
23:14
I had to explain to my wife what a Guid was just so I could share that joke.
i would have just kept that one to myself. there are limits to my nerdiness that i want people to know about
including family
lol
thats awesome :)

« first day (908 days earlier)      last day (4265 days later) »