« first day (3882 days earlier)      last day (1056 days later) » 

12:39 AM
I've actually never had an issue with ClickOnce apps or deployments. I made and distributed a few decent utility programs with it
it's really the only app publishing I've done outside of web applications over the years
 
 
4 hours later…
4:44 AM
hi
so with Xamarin it seems you have a wrapper sort of thing around Apple components. you have to use NSButton, NSView etc
i can see using C# over Objective C
 
 
2 hours later…
6:17 AM
[Yaazarai (FatalSleep)] Quick question: Where can I find info on the DelegateExtensions class? Someone recommended using it to write an invocation extension method.
 
6:44 AM
Would it be more advantageous to have a look-up array uint128s of dimensions 81x128 with a lot of repeated entries, or to try to reduce the size of the array to 81x16 by figuring out a perfect hashing function that goes from 7 bits to 4 bits?
The latter one takes up 1/8th the total space in memory, but involves extra instructions to perform the hashing
 
7:07 AM
Wow generics in java have some really weak inference
 
[Kid25] why you studying Java?
 
weak?
inference in Java generics is quite a bit more powerful than C#'s
 
Hell no
 
example?
 
Fucking lambdas don't realise what I'm trying to compare
 
7:12 AM
example?
 
List<Movies> movies = stuff();
movies.stream().sorted(Comparator.comparing(movie -> movie.wheresthefuckingtype
How hard can it be to infer the type from movies into the stream into the comparator into the lambda
Also infere doesn't look right
Because it's infer, got it
@Botler Studying applied informatics, we of course learn programming with java
I miss Linq
 
looks fine by me
 
Folks, how knows website-server communication here?
 
var sorted = movies.stream()
	.sorted(comparing(Movie::getName))
	.collect(toList());
 
Yes, when using Movies::getTitle it works, that's how I have it now
But that solution fails when I want to use a nested property
@TheShortestMustacheTheorem I know 418 is I'm a teapot
 
7:20 AM
nested property?
 
movie.Actors.size()
for example
Only works in the second comparing
 
Assume a user visiting a domain www.domain.com/page1.
The server sends a response that redirects the user to www.domain.com/page2.

What I don't understand is what content is sent by the server for this redirection. Is it a javascript code?
 
ah, I see
the inference rules are taken from both sides
 
It's a header field called location with a corresponding http code
 
@Squirrelkiller for mathematician, a mug and a doughnut are the same species. :-)
 
7:23 AM
the sorted() demands a Comparator<Movie>, which it gets from comparing()
however, if you chain comparing() with another function, like thenComparing() then sorted() demands a Comparator<Movie> from thenComparing() and it will lose the inference on comparing()
to be fair, C# won't help you either though
 
The server sends a response http status code like 301 (moved permanently) or 302 (found/moved temporarily), so the browser looks at a possible location-header. When the server sent a location-header, the browser automatically calls the website from the location header.
 
Java's generic inference is from both supply and demand, C#'s generic inference is from only supply
 
@Squirrelkiller I see. You are so helpful! THank you!!!!
 
Except java's inference just doesn't work at all in this case
@TheShortestMustacheTheorem Glad to help :)
 
neither does C#'s
 
7:28 AM
I don't think C#'s inference ever failed me like this
It's a pretty trivial example even
 
C# just knows it's limitations and avoids it in the api
this is the C# equivalent code:
var sorted1 = movies
    .OrderWith(ComparingBy<Movie, String>(it => it.Name));
where the inference won't help at all
because it only infers from the supply (the lambda)
it doesnt infer from what OrderWith asks for
you can also do this ofcourse
var sorted1 = movies
    .OrderWith(ComparingBy((Movie it) => it.Name));
which has the same rules
but the C# devs know this and avoid such a design
that is why in C#, you dont have ComparingBy
or OrderWith
the downside is that there is no nice way to properly pass a comparer in C# and use it appropriately
on the bright side... "hello world" works better
 
C# doesn't even need the whole Comparing-class, since it just uses lambdas directly
 
var sorted1 = movies
    .OrderWith(ComparingBy((Movie it) => it.Name)
        .ThenComparingBy(it => it.ReleaseDate));

var comparer = ComparingBy((Movie it) => it.Name)
    .ThenComparingBy(it => it.ReleaseDate);
var sorted2 = movies
    .OrderWith(comparer);

var sorted3 = movies
    .OrderBy(it => it.Name)
    .ThenBy(it => it.ReleaseDate)
    .ToList();
 
movies.OrderBy(m => m.Title).ThenBy(m => m.Actors.Count);
And here I could also order by actor count first
 
yes, which is fine for the few examples that they show in "hello world", but as soon as you step out of the "hello world" domain, you immediately have to provide your own classes for comparers to compare stuff
and lambdas just stop being useful
because you need a comparer
and you cannot make a comparer because it is missing the comparer builder (comparingBy() function stuff)
if you want to receive the order rules via a parameter for example, you cant ask for a series of lambdas
 
7:38 AM
Sure you can
todict takes two lambdas to select key and value
 
you have to either
1, ask for a list of lambdas and reduce them with OrderBy calls (and figure out how to do the descending part)
2, ask for a lambda to convert your IEnumerable to a sorted IEnumerable
3, use IComparer
I mean, if you want to pass that .OrderBy(m => m.Title).ThenBy(m => m.Actors.Count) as parameter, how would you do that?
public void Foo(IList<Movie> movies, dynamic sortingRules)
{
    var sorted = movies.OrderBy(sortingRules).ToList();
what type would sortingRules have?
and what value would it have?
or what function would you use instead of OrderBy()?
 
@TheShortestMustacheTheorem That's topology specifically, and it goes as far as "you can define a homeomorphism from one to the other"
Or "they are equivalent up to deformation retract" if I remember my topology terms correctly
 
@Wietlol Func<Movie, T>
Just a selector
It takes a movie and from that selects whatever the user of the API wants to sort it with
Or maybe even an Expression, I never know when I need to use that one
Ah no I just wanna select so no expressoin
 
@Squirrelkiller and how do you pass the order rules to order by title and then by actor count?
 
I make a params array and iterate though that, chaining another thenby for each one
Although there's probably a better way I can't think of right now, that's the most straight ofrward one
Guess I'd do that and let R# tell me how to make nicer lol
 
7:48 AM
[Kid25] ❤️
 
Turns out orderby also has an overload that takes a comparer, so for more dynamic comparing I could use that one
I'm not sure I can still get you the kids discount at 25
 
OrderBy(x => x, comparer) ?
 
[Kid25] lol
 
then the question is, how do you get that comparer?
 
[Kid25] is it true that people are preferring vs code over vs?
[Kid25] for .net
 
8:09 AM
Rider > vs+vscode
 
There are indeed some people prefering vscode
Depends on how you work I guess? Not sure why I'd use vscode for .NET over VS
 
mr5
8:42 AM
Why is "doge" pronounced as "dodge"?
Shouldn't it be "though-geh"?
As in dog with an extra "e" on it.
 
it is pronounced "dowj" though
unlike dodge, which is pronounced as "doj"
 
My inner voice is never sure how to pronounce doge
 
mr5
Yeah for Google translate, it kinda sound more like that, but for other people, I just heard them pronouncing as "dodge"
 
dawg? Doge like "load"? dodge? Dafuq is that word even
 
mr5
lol
USAnians pronounce it like that
 
8:49 AM
Does not compute with my knowledge of english grammar rules
 
mr5
Same thing for YouTube. I thought it's "you-choob", then I hear westerners pronounced it as "you-toob"
 
well "toob" is still not entirely correct, more like "tioob" or "tjoob" depending on how the prnounciation-grammar works lik
Like any other tube
The only time tube is pronounced like toob was in call of duty, when we needed a derogatory term for people using an underbarrel grenade launcher to it's the noob toob
 
9:26 AM
[Captain Obvious] I pronounce it like dough, but then with the -ge sound like in the word age
[Captain Obvious] Americans are dumb
[Captain Obvious] I agree that it's you-choob, not you-toob
[kesarling] @butler1233?
[kesarling] I don't know why, but I always feel after looking at the spelling that the bri'ish pronunciation is correct
 
9:50 AM
@Wietlol What's java for .SelectMany? flatmap makes the IDE shout at me.
 
flatMap is
what does the IDE shout?
 
no instance(s) of type variable(s) R exist so that List<Actor> conforms to Stream<? extends R>
movie has List<Actor> and I want al of them
so I went movies.stream().flatMap(Movie:getActors) but well...no.
 
ah
in Java there is a clear distinction between an iterable and a stream
such that an iterable is just something you can iterate over
and a stream is a one-time use
 
Ah so I do it in the collector?
 
iterables and streams are incompatible
you can flatMap(it -> it.getActors().stream())
you could even split it into two
 
9:54 AM
[Captain Obvious] I got distracted making a brew
 
if you want to be fancy
 
Ah that one works, thanks^^
Did I mention I miss Linq?
 
.map(Movie::getActors).flatMap(Collection::stream) or something
to be fair, I like the distinction between iterable and stream... but for flatMap, I do wish they added an overload for the counterpart
I did include that in my utility library on kotlin
 
I wonder what the prof would do if I just...wrote Kotlin
 
hehe
you could...
write Groovy
and the prof would probably not see the difference
until he tries to compile your code perhaps and see the file extension
 
10:08 AM
Nah I just demo the code via screen share^^
Unfortunately though we are given a file with existing methods we needs to implement^^
 
groovy is to java what typescript is to javascript
except swapping the type safety
typescript is a superset of javascript that adds static typing
groovy is a superset of java that adds dynamic typing
groovy does have overloads for Stream.flatMap() for List receivers
 
Isn't my stream supposed to have groupingBy?
 
depends
but you are probably fine by using collect(groupingBy(...))
 
Oh its a collector
yup lol
 
mr5
10:48 AM
Why is there a lot of "date & time" variations in Java
LocalDate
LocalDateTime
ZonedDateTime
Instant
Calendar
GregorianCalendar
Date
 
[Captain Obvious] That's because java is dumb
 
mr5
LocalTime
 
[Captain Obvious] And didn't originally include a DateTime solution that actually worked
 
mr5
ZonedTime
working in Kotlin now is infuriating knowing I have to deal with this
Period
fck
 
[Captain Obvious] Just use a good language
[Captain Obvious] Like C#
 
11:01 AM
@mr5 because they are useful for different situations
also because you mix old deprecated stuff with new stuff
there are basically 3 different categories: Local, Zoned and Offset
 
mr5
Yeah. C# is better in this regard. I only need to deal with DateTime, DateTimeOffset, and TimeSpan
 
and there are a few different types: Date, Time, DateTime and a few special ones like Instant
@mr5 except it isnt
 
mr5
@Wietlol the problem is, you need a certain amount of time to master all of it.
 
you dont need to master all of it, only what you need
and in C#, you just have to deal with the bugs once your app is in production
 
mr5
never experienced that
 
11:06 AM
because you probably never did anything interesting with date stuff
 
mr5
true
That's what most front end dev does for most common apps.
 
one simple problem for example is storing dates
 
mr5
and this Java's mess on date is making my life even harder
store it as a string on ISO-something UTC format
 
imagine you have a target date, say first of november and it is currently the first of october
how many days are in the timespan between those two dates?
 
mr5
does subtracting dates on C# produces a TimeSpan?
 
11:10 AM
[Captain Obvious] (targetDate - currentDate).TotalDays
 
mr5
I think there's a problem with that.
Can't recall exactly what it is
 
[Captain Obvious] There's a problem if you do Days instead of TotalDays
[Captain Obvious] Actually in that specific instance it wouldn't look like a problem
 
the difference between 2021-11-01 and 2021-10-31 is actually 25 hours in my place though
 
[Captain Obvious] Because of daylight savings?
 
yep
 
mr5
11:20 AM
can't wrap my head around how do I interpret it
 
in some cases, you want it to calculate to 24h difference and sometimes to 25h difference
for example, if you want to schedule something with start date 2021-10-25 and end date 2021-11-05, you actually use 2 different time offsets
so OffsetDateTime would be a horrible choice
on the other hand LocalDateTime would be bad as well because you do want to include the offset that the people of your site use
and people from different zones might want to attend your (for example, online) event
ZonedDateTime would be optimal here because the zone doesnt change
it would provide you with sufficient information in a single object
the only object in the java.time api, that is redundant, is Instant
it represents an OffsetDateTime with a set offset to UTC
it is just for convenience since it is so commonly used
 
12:08 PM
no way, chat is active today??
 
12:31 PM
[Captain Obvious] Don't say anything, you'll curse it
 
mr5
too late
 
[Captain Obvious] Yeah I know 😔
 
23 minuts late
 
[Captain Obvious] I was busy generally procrastinating
 
 
1 hour later…
1:57 PM
lol
 
2:11 PM
I cannot get my damn ClientSecret to work from an Azure App Registration
driving me nuts
anyone have experience with this ??
 
 
1 hour later…
3:23 PM
so i posted a bounty on my question but no one answered. shouldn't i get my bounty back?
 
is it possible to just retract it manually?
I know nothing of Azure tho :(
 
3:42 PM
I think once you issue a bounty on a question, those points are gone. Remember running into this a while back. Could be wrong though
 
i think so too
 
Put a 500 pt bounty on a question and regretted it immediately
 
it doesn't make sense if no one answers that it's unrefundable
 
Haven't seen bounties do anything to fetch good answers
 
200 for me :( welp
 
3:44 PM
It's okay. You'll earn 'em back. For now, lesson learned
I stopped using bounties. Easy way to lose a bunch of pts
 
@Squirrelkiller: As far as I know, redirections make a web browser to send HTTP GET to the server that issues the redirections. My question, is it possible to do redirection but the web browser send HTTP POST instead of GET?
 
so i'm making a Xamarin app in OSX and i found Visual Studio is compiling a EXE for me!
this is great but i'm using Apple controls like NSButton, NSView, and Apple APIs
 
@TheShortestMustacheTheorem . stackoverflow.com/questions/2604530/…
 
@TheShortestMustacheTheorem Could try it, I guess the use case would be submitting a form and the target redirects somewhere else?
 
what happens if i run EXE on windows?
 
3:47 PM
Well exe is the only thing you can run on windows so, whatever the exe tells windows to do
 
Alex and Squirrelkiller: Thank you!!!!!!!!!
 
right but i'm guessing it will say, "Program crash: Could not find NSButton"
 
NP!
 
4:05 PM
@Squirrelkiller Redirection as far as I know is done without user intervention. How can server force the user browser to send POST request?
 
Depends - redirecting a GET request also only happens when the user opens a website
So why would the POST request not happen via another user action - submitting a form?
 
mr5
4:30 PM
@TheShortestMustacheTheorem on C#'s HttpClient, it automatically do the redirection by default. I think it's part of the specs.
 
Prashanth Chandrasekar on June 02, 2021
This morning, Prosus (PROSY) has announced its intention to acquire Stack Overflow for 1.8 billion dollars. This is tremendously exciting news for our employees, our customers, our community members, and for our shareholders, and I will share a bit more about what it all means.
 
Never heard of prosus
 
Me neither
Hope they don't fuck it up
please don't fuck it up
There's literally no alternative
 
Nope. No other site like it
Even major companies tell folks to post questions to SO. That says it all
These chat rooms are a hidden SO treasure. Most don't know they exist
 
mr5
Alternative is 9gag
 
5:16 PM
@Squirrelkiller Submitting form values via POST request is not what I am interested in. I want the server to redirect the user to send HTTP POST to the server without user intervention as if the user click submit button. :-) It is not possible I think!
 
This is a whole lto of XY right here
What's your actual use case?
I only answered on the technical side
 
@Squirrelkiller: I want to understand whether or not this is possible.
 
Why
with context, a solution is easier to find
and a fitting one
As you saw, I did find a solution, but not a fitting one
 
lmao SO sold out?
 
yup :/
 
5:22 PM
does this mean the tyranny here will end or endure?
 
@Squirrelkiller: For academic purposes!
 
Give me an academic use case then!
 
For $1.8 billion. Wow
 
Servers can redirect user to submit HTTP GET to the server.
Is it posible the server to redirect user to submit HTTP POST to the server without having to ask user to press submit button? It is what I want to know. I think it is not possible because of security issue maybe!
 
mr5
If the company is sold, will the CEO be replaced?
@TheShortestMustacheTheorem Do you have access to the server?
 
5:25 PM
@mr5 Yes. Of course.
 
mr5
Then why the need to redirect when you can just execute the service you wanted?
 
If you control the server and it's an actual API, you can 1) make the POST request 2) return that response to the client
 
@mr5 I want to know whether it is possible or not. Not about calling another actions methods.
 
mr5
I think it's part of consortium spec, and by default, all redirects are expected to be GET only.
not something you can do much about
 
Or like, a redirect is, as the name implies, the method of changing direction?
So from one location to another
 
mr5
5:29 PM
unless it's not web browser client you're concerned of, in which case, you can override that functionality
 
The communication I want to achieve is as follows:

1. Client sends HTTP GET to server
2. Server sends response to client. The response makes client send HTTP POST without user intervention (user don't know the web browser send HTTP POST to server)


This is the scenario I want to know. :-)
If it is not possible, the discussion ends. Thank you very much!
 
You can do a POST via Javascript
But that requires a page to load with the logic
 
@Alex: OK thanks !!!!!
 
mr5
You can also do this but I think this is not what you're looking for:
let response = await fetch(GET)
if (response should post)
    await fetch(POST)
 
Oh my ghost, apparently when redirection occurs, the GET request sent by the client will be responded by the server only with header without body. I learnt something new today!
 
6:02 PM
That's the point - the server doesn't send any actual data, just the information that the actual data is at another castle
 
6:57 PM
anyone know how to PushStreamContent through an HttpResponse? Because I keep seeing "'Request' does not exist in the current context" when trying to set httpresponse to Request.CreateResponse().
 
 
3 hours later…
9:59 PM
 

« first day (3882 days earlier)      last day (1056 days later) »