« first day (3465 days earlier)      last day (1483 days later) » 

4:41 AM
@Feeds I didnt know there are other units than celsius and kelvin
 
 
2 hours later…
7:00 AM
life is a mystery
 
 
2 hours later…
V.7
9:12 AM
@Wietlol There is one: Celsius + 1 - 1 = Wietsius
 
9:29 AM
@V.7 @V.7 superb comment man , lmao
 
 
3 hours later…
12:33 PM
@V.7 nah, I wouldnt invent stuff like that myself, I only copy what is already good
so, Kelvin = Wietvin
 
 
1 hour later…
mr5
1:37 PM
TIL: pressing ctrl+e in Chrome will turn the focus in address bar ready to search in Google
 
ofc, that is different than alt-d
in that... they both search for stuff on google except if you type a valid url
 
2:23 PM
any golang expert
 
2:42 PM
Hey folks – can anybody explain to me why all over the C# standard libraries, `int` is used where `uint` should be used instead?
Classic example: negative values don't make sense for `Length`.
Also, every for-loop I've seen everywhere uses an `int` counter instead of a `uint` one. Why?
(inb4 historical reasons :D)
 
even then, even if it does make sense to use uint because negative values are invalid for this part, it still isnt a good way of using the type system imho
should you then not also have a special type for non-zero integers?
or one that only allows between 0 and x?
 
3:40 PM
@Wietlol this seems like a really odd argument to me: „C#'s type system is not powerful enough to represent arbitrary restrictions of allowed values, so you shouldn't even start to do that in simple cases“?
I mean, to be fair, what I would actually want is something encapsulating `uint` which does not provide subtraction from itself.
I mean this is nothing new, the idea of value objects kinda goes in that direction as well – you create new data types (even encapsulating simple types such as strings) which may impose restrictions on the allowed values.
 
it is not what the type system is for
 
Then what is a type system (resp. type checker) for in your opinion?
 
I cant really find the article about it, which explains it a lot better than I can do
 
mr5
There's one instance that I recall when I was coding in C++. I started to learn what this signedness then deliberately use it in for-loops. Things get nasty when I iterate backwards i.e., --index (it would overflow) when you wrote a wrong logic and it would make the debugging much harder. There's this warning that is being generated by the C++ compiler also when you're comparing between different signed numbers (signed vs unsigned)
 
but in simple terms, the type system would define the structure of objects
 
mr5
3:50 PM
So I guess, C# compiler writers have C++ backgrounds so they also follow that convention.
 
type A and type B only differ in how their structure relates to their behavior and responsibilities
there are only a few cases where this distinction is not only based on those two
and one of those cases are unsigned counterparts
yes their structure is slightly different, but only because they exist because of a different value range
using an unsigned integer instead of a signed integer would have one of the two reasons:
1, you want to rule out negative values
2, you want to have a slightly higher upper bound on your x-bit integer
that first one is basically value validation
the second one is arguably a case for a long over an int, or int over a short, etc
or a BigInteger over a long
there are very few cases where signed ints are insufficient where unsigned ints are sufficient
 
mr5
also, int is easier to type compared to uint
 
the first case could make you argue "shouldnt I also have an ArrayWithAtLeastOneElement<T> type?"
because, behavior is often different in the case of empty collections and non-empty collections (often also different between 1 item collections and >1 item collections)
having different types representing a subset of valid values is not what the type system is for
 
mr5
I forgot, it was unsigned int in C++ so it's much easier to type int i = ...
 
so, if you use an unsigned int because of reason 1, then please consider making an EmptyArray<T> class and an ArrayWithOneElement<T> class and an ArrayWithMoreThanOneElement<T> class
if you use unsigned int because of reason 2, ye... you need a REALLY good reason for that
hence why I dont really think not having unsigned integers is a bad thing
I have been programming in JVM for... forever? and never had the need of unsigned integer types
 
mr5
4:00 PM
embracing Java's principle -- remove unsigned
@Wietlol well, you can't represent all ASCII in char so you need unsigned char, but I have never tried this in C#
 
considering ASCII is 7-bit and char is 16-bit, yes, you can represent all ascii in char
 
mr5
oh I thought char in C# is 8 bit also
 
on top of that, char is theoretically not integral
unsigned char makes no sense
 
mr5
they have the reason why they named it char
but that meaning deprecated too soon
 
the binary representation of 0b1000_0000_0000_0000 is not negative or positive, it is a character
(iirc, that particular set of bytes is not valid in utf8 tho)
0b1101_1111_1000_1100 might be a better example
in utf-8, those bytes are "ߌ" while those bytes as short are -8308
what always bugs me is that byte is signed
byte itself (in theory) is also non-integral
0b1111_1111 converted to an integer should be 255, not -1
 
mr5
4:13 PM
byte is signed?
US takes the #1 spot
 
4:27 PM
@Wietlol „having different types representing a subset of valid values is not what the type system is for“ I'd argue most of the functional programmers of the past few decades would completely disagree with this statement.

Perhaps you mean something more specific, like „This is unusual for C# and/or hard to do / not effective with the C# type system“?

Conceptualizing „Types“ as „Sets of allowed values“ and, consequently, „subtypes“ as „subsets of allowed values“ is a standard way of thinking about types, at least from what I've encountered. Note that this conceptualization does not care a
 
mr5
you have a weird keyboard
 
I dont think most of the functional programmer of the past few decades would disagree tho
at the very least... I dont
 
 
2 hours later…
mr5
6:17 PM
found another gem
 
@mr5 no u :>
 
for asp.net web applications, could someone please tell me some reasonably good open source licensed pdf generators apis?
 
6:43 PM
I would recommend an external service
if security of sensitive information is a thing, ask them to provide stuff that you can host yourself
 
6:57 PM
@Wietlol Thanks for responding, when you say external service, do you mean like a 3rd party vendor providing a Web Service over the internet that will generate the pdf for us? I was actually looking for some kind of open-source licensed pdf generator that we can just add as a dll or install on our local server. It's Not confidential business data.
 
7:11 PM
using a 3rd party's service would make it easier
 
7:32 PM
if you use IText before version 5? it's commercial free license
iText-4.2.0 last version
 
 
2 hours later…
user12960916
9:21 PM
does anyone know what you would use if you wanted to the read the lines in a binary file? for a streamreader i used peak but im not sure what i would replace that with if im using a binary reader
 
9:56 PM
A...binary file?
PDF?
I mean, technically all files are binary, just some are encoded so we can read that
But AFAIK binary basically means "not simply encoded text" so...what kinda file? What's the definition of the "lines" here? What's a line?
 

« first day (3465 days earlier)      last day (1483 days later) »