« first day (4114 days earlier)      last day (820 days later) » 

1:39 AM
@Squirrelkiller 。。。。i am not robot...
:D
 
mr5
2:39 AM
@Never.More adonbilibyu
 
@mr5 what's meanning?
 
mr5
adon = I don't
bilibyu = believe you
 
...good english
so how can i prove myself?
 
mr5
see? you can't comprehend that part. only a real human can do that.
I'm thinking of using captcha but I'm afraid it's an outdated way to distinguish robot from humans.
 
I am sorry for my pool english..But i am not robot definitely..
 
 
3 hours later…
mr5
6:47 AM
@nyconing @Wietlol are you guys familiar with OkHttpClient? Do you know how to make a HTTP GET getting the response header only but not proceeding to continue getting the response body?
 
644
Q: Getting only response header from HTTP POST using cURL

Jonathan AllardOne can request only the headers using HTTP HEAD, as option -I in curl(1). $ curl -I / Lengthy HTML response bodies are a pain to get in command-line, so I'd like to get only the header as feedback for my POST requests. However, HEAD and POST are two different methods. How do I get cURL to displ...

 
mr5
I don't want to use the Java way using the HttpURLConnection 🤮
the recommended HTTP client for the platform I'm using is OkHttpClient. As much as possible, I'd like to put all the HTTP request in a single instance of this HTTP client.
 
No on okhttp, you listening or you sending?
 
7:03 AM
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
mr5
@nyconing sending request
 
8:07 AM
@VLAZ Probably not very interesting but I ended up with a list of patterns. I might still swap to a regex if it turns out it's too strict but it should cover all reasonable inputs.
private string[] _formats = new string[]
		{
			"yyyy-MM-dd",
			"yyyy-MM-ddTHH:mm", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:ss.f",
				"yyyy-MM-ddTHH:mm:ss.ff", "yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mm:ss.ffff",
			"yyyy-MM-ddTHH:mmZ", "yyyy-MM-ddTHH:mm:ssZ", "yyyy-MM-ddTHH:mm:ssZ", "yyyy-MM-ddTHH:mm:ss.fZ",
				"yyyy-MM-ddTHH:mm:ss.ffZ", "yyyy-MM-ddTHH:mm:ss.fffZ","yyyy-MM-ddTHH:mm:ss.ffffZ",
			"yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss.f",
 
Good morning
 
you could also compute the patterns if that makes more sense
@mr5 I wrote my own http client because of reasons :D
 
Probably but I can't be bothered. It's a long-ish list but to me it's more readable. Otherwise every time I read the code that generates the formats I'll have to mentally compile it to 1. figure out what the formats are 2. if they make sense.
 
@VLAZ That's quite a list. If you're only interested in the date part anyway, why not use Wietlol's regex from yesterday and be done?
 
8:22 AM
Decided I preferred it more strict. As I said, I might swap for a regex but I'd prefer having to loosen a restriction than have it loose and try to strengthen it. Because right now I'm doing the latter and I don't like it. This code used to just allow anything for dates which was also problematic in some cases.
 
8:36 AM
you can at least put every entry on a single line so it is more readable
general rules of formatting apply
for a list, either put everything on one line or everything on their own line
 
One line is too long horizontally. One line per item is annoyingly long vertically. I'm using whitespace to format the list for readability each "line" is a list of related patterns - first one date only, then date with T for separator and times. Next one is using T for separator and Z at the end. Then space as separator and without/with Z. Since the lines are too long, I've manually "wrapped" them and indented to show continuation from before. It's a total of five groups of patterns.
 
it's totally understandable in the pattern you posted here, but it's still way nicer having everything below each other because the "yyyy-MM-dd will always be in the same place.
 
"yyyy-MM-dd",
"yyyy-MM-ddTHH:mm",
"yyyy-MM-ddTHH:mm:ss",
"yyyy-MM-ddTHH:mm:ss",
"yyyy-MM-ddTHH:mm:ss.f",
"yyyy-MM-ddTHH:mm:ss.ff",
"yyyy-MM-ddTHH:mm:ss.fff",
"yyyy-MM-ddTHH:mm:ss.ffff",
"yyyy-MM-ddTHH:mmZ",
"yyyy-MM-ddTHH:mm:ssZ",
"yyyy-MM-ddTHH:mm:ssZ",
"yyyy-MM-ddTHH:mm:ss.fZ",
"yyyy-MM-ddTHH:mm:ss.ffZ",
"yyyy-MM-ddTHH:mm:ss.fffZ",
"yyyy-MM-ddTHH:mm:ss.ffffZ",
"yyyy-MM-dd HH:mm",
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-dd HH:mm:ss.f",
"yyyy-MM-dd HH:mm:ss.ff",
"yyyy-MM-dd HH:mm:ss.fff",
obviously you know very well how the different lines mean different things and you definitely have much joy in reading it the way you posted it and you are totally certain that all entries in the list are unique and meaningful /s
 
8:52 AM
Morning
Captain Obvious not in chat? :/
 
you can also merge these into regex
\d{4}-\d{2}-\d{2}([ T]\d{2}:\d{2}(:\d{2}(\.\d{1,4}Z?)?)?)?
 
The big list is more readable though tbh
 
true, but only because you dont think in regex
same as linq being less readable as a for loop only because the developer is familiar with a for loop and not with linq
or because you used stupid sql syntax instead of methods
 
9:16 AM
Lately the automatic conversion sometimes made a foreach loop into a sql syntax LINQ. I was really confused.
 
mr5
@Wietlol what is this abomination
did you manually type them all?
 
9:59 AM
[Captain Obvious] @edgzi I am now
 
@mr5 Probably copied my list and added newlines
And I made one row of these "by hand", the other two by copy -> paste -> search&replace
 
 
1 hour later…
11:18 AM
I formatted it using my IDE
 
11:39 AM
Hi all
 
12:09 PM
HII
 
hihihi
 
Please help me know that What can I ask here and what is best here except you ?
 
mr5
lmao
 
except me? that is tough
you can ask anything here, but please dont ask if you can ask
4
 
||justask
 
12:24 PM
Aug 28 '17 at 15:53, by mikeTheLiar
Don't ask if you can ask, it creates an infinite recursive loop. Just ask your question. If someone is around who can help, they will.
 
How do I request a room to be unlocked? WPF chat was inactive for too long. Last time, I went to a chat to request it but can't remember which one
 
Found it, I think: we're supposed to ask here -- chat.stackexchange.com/rooms/2691/the-assembly
 
mr5
@Wietlol whenever I am looking at numbers, I feel like I'm being dizzy. Why?
 
@Alex why not just use this room though?
 
12:39 PM
True :)
 
@mr5 because you dont speak native algebra
 
Show me a spreadsheet and I'll slip into a coma
 
mr5
@Squirrelkiller I feel honored being on the screenshot
@Wietlol doctor says, then don't look at numbers, and charged me ₱1e4
 
12:53 PM
stupid doctor, you probably gave him only ₱14
 
mr5
1:07 PM
man, I still don't have the vaccine and all establishments here, they won't let me in
I'm only going out because of my gf, otherwise, that vaccine card wouldn't be a problem.
need to schedule some vaccination I don't have any idea how to begin with
 
How do you still not have a vaccine
I thought china throws sinovac at you at least
 
mr5
cuz I'm lazy af
 
dying < not dying
 
mr5
gf just arrived last Dec, and prior to that, I haven't really going out of my room
 
That's quite the motivation
Arrived, like by mail? I see.
 
mr5
1:11 PM
kek
 
congraz though, hope you had a nice christmas & new years
 
mr5
lul. thanks though. I was alone on new year. my gf went to their family. my family invited me to go to them but I don't want to cuz I'm lazy af.
I was able to see fireworks at least from my windows.
so tell me. how much does it cost for a vaccine?
 
Nothing
At least in germany and most other countries I heard from
Not sure about the state of health care on your side
 
mr5
Just Googled it. It's ~₱1300 here (~€22)
 
It makes sense though, both government and businesses have an interest in many people getting vaccinated quickly to end the pandemic and save the economy
 
mr5
1:17 PM
yeah, it should be free
 
Damn they make you pay for it? Are they trying to counteract overpopulation?
 
mr5
hope so
we're overpopulated anyway
but this virus is weak af
 
Still, letting people die is not the way
 
mr5
Thanos is the way
 
Except this virus has killed more people than any other and does long term damage
 
mr5
1:19 PM
Did you caught the virus?
I think me and my GF caught it. Her little brother caught it first, then her, then me. I'm the only unvaccinated.
 
Hell without the long term damage, I'd go and get it right away. I'm vaccinated, I won't feel more than from a little cold.
No I haven't been invected yet
 
I am vaccinated and have covid
 
mr5
how does it feel?
 
Damn, you guys ok? Long COVID sucks.
 
feel? what is that?
 
1:20 PM
Damn next variant incoming
||Wietlol2
 
Sep 13 '17 at 15:07, by Wietlol
i will most probably write my own
 
mr5
on my end, I have symptoms of fever, my entire body is weak for 2 days, and caught sinus infection after.
 
2 days only? That's not too bad from what I've heard.
 
mr5
but, neither of us got tested. I just concluded we had it.
 
@Squirrelkiller dont worry, my covid wont mutate
I transformed it into a pure function, so mutations are not allowed
 
mr5
1:22 PM
yeah, 2 days worst. and the virus slowly died.
wietlol writing his own virus?
can you stop writing everything from scratch
 
I never actually write things myself
I just copy what already exists
 
@Wietlol We just say it mutates as we mean the whole virus family, but technically the old virus creates new, mutated variants. So the virus is indeed functional.
 
hmm... mine isnt a factory for a next generation yet though... but I guess that would be the next pull request
 
Hope you keep with the short covid, good luck
That sentence sounds weird.
Stay with the short covid?
Grammar is hard yo.
Keep to?
 
I am just in isolation... for the past 6 years, so it doesn't really matter
 
mr5
1:27 PM
isolation, like no human interaction?
 
anyway, about 2 hours after I got it, I already deployed the first version of the anti-virus
about 12 hours later, the rona was in a stalemate position
@mr5 isolation, like no external dependencies
 
mr5
when I thought I got the virus, I can already feel something is going to happen to me. it's strange.
 
no, that is psychology
 
mr5
@Wietlol you never GET /parents/status or GET /friends/status?
 
How far is grocery delivery in the netherlands? It's still got a bit much of a delivery fee over here so it's not very common yet.
 
1:29 PM
what? what do you think I am?
I dont have parents, I am thé supertype
 
mr5
you're a computer
 
grocery delivery in the netherlands has been quite good for about a decade now
 
mr5
human test
 
I've been thinking about having groceries delivered for some time now, but it's really the only time I leave the house at all these days.
Nice
That makes isolation easier
 
mr5
at my new place, grocery is very near. I just leave the building, and walk a few meters, and that's it.
 
1:46 PM
[KidKai25] Hey
[KidKai25] I like... You all!
 
2:03 PM
[Squirrel in Training] go fuck a goat ! ♥
[Squirrel in Training] its okay to say that it's a movie quote
 
DEEEEEEEEEEEEEEAAAAAAAAAAAAAAAATTTTTTTHHH!!!
 
2:18 PM
I have a list of items. I want to turn that into a dictionary which indexes them by two fields - as in each item will have two bindings. I'm using a loop right now:
foreach (Foo x in someList)
{
	dict.TryAdd(x.A, x);
	dict.TryAdd(x.B, x);
}
More out of curiosity than necessity, I wonder if this can be easily done as single operation with LINQ methods. This is possible but IMO ugly and no benefit over the straight loop:
someList
	.SelectMany(x => new (string, Foo)[] { (x.A, x), (x.B, x) })
	.ToDictionary(x => x.Item1, x => x.Item2);
 
2:32 PM
Hello Everyone. I have a super specific question and also posted it. It's a long post, because I tried a lot of stuff, but essentially the problem is that the IIS Windows Authentication isn't used for the Microsoft SQL Server Connection with the parameter "Integrated Security=SSPI".
It's always using the local server account, which fails with the error "Login failed for user [server user]". This is the complete post stackoverflow.com/questions/70786623/… but maybe I have not properly explained it, people seem to not see what I tried or what the problem is.
 
2:52 PM
@VLAZ generally speaking, this is how it should work
but also generally speaking, LINQ does look ugly because it doesnt have the correct methods
 
OK. I guess I was wondering if there was a method that would do a dictionary as a 1:many map, rather than 1:1.
 
mr5
@Squirrelintraining waaat
 
Were this JS I'd probably elect for using generator functions and compose them together. It's probably doable in C# but I don't see a way to delegate to an iterator.
 
public static IDictionary<K, V> AssociateByMany<K, V>(this IEnumerable<V> values, Func<V, IEnumerable<K>> keyMapper) =>
    values
        .SelectMany(it => keyMapper(it).Select(k => (k, it)))
        .ToDictionary();

public static IDictionary<K, V> ToDictionary<K, V>(this IEnumerable<(K, V)> values) =>
    values.ToDictionary(it => it.Item1, it => it.Item2);
 
I guess it should be possible but I've to research it more.
 
2:57 PM
these are the two particular functions you'd want
then you can do values.AssociateByMany(it => EnumerableOf(it.A, it.B))
 
That's not bad as well.
 
not to be confused with AssociateManyBy, which returns an IDictionary<K, IList<V>>
also not to be confused with AssociateBidirectional, which returns a bidirectional map and not a mapping by direction
the sad thing about adding functions to LINQ because they are missing, wrong or slow, is that when those functions are introduced in the SDK, the library would produce a name clash and the function would be unusable
or when the function is introduced on the wrong type, it would produce that name clash on usages with that type
 
I still find extension methods a bit weird.
 
also that, LINQ should never have been extension methods
but to be fair, the alternative was butchered even worse
 
mr5
would you rather have a static utility function?
 
3:03 PM
no, interface defaults
 
mr5
extensions are introduced for syntactic sugar
 
with inherited optimizations
imagine IEnumerable having a function Last() (similar to First() but just from the other end)
 
mr5
how would you use interface defaults for extending features of class without inheritance?
 
IEnumerable can implement the basic functionality by exhausting the enumeration
and the IList interface can override that method and instead use indexed access
and a LinkedList can override that method and use it's own Last() function
the problem is that in C#, interface methods with implementations are by default hidden on the subtypes
for which, I still need to kill one of the C# devs
 
mr5
true
that feature annoys me
by defining a default interface body, you are making it available to the implementers only
 
3:08 PM
no
by defining a default interface body, you are making it private for the users of the direct interface
the subtypes also cannot access it
 
mr5
yeah, that's what I said
 
if you have a protected function in an interface, the subtype cannot call that function
 
mr5
I'm resaying what you said ...badly
otoh, my VS22 installation is doing the crazy.
it stops working after the update.
and now I think I need to update it again. It might get fixed on the update.
 
public interface IIsInterface
{
    protected void Foo()
    {
        Console.WriteLine("Foo");
    }
}

public class IsClass : IIsInterface
{
    public void Bar()
    {
        Foo(); // unresolved
        this.Foo(); // unresolved
        ((IIsInterface) this).Foo(); // cannot access protected because it is not qualified by "this"
        base.Foo(); // base is not the interface, but instead the superclass, aka System.Object
    }
}
 
mr5
what was your workaround again for that?
I'm trying to update my C# projects just not to lose my C# knowledge. Oh boi, I'm starting to get old and forgot things quickly.
 
3:15 PM
on top of that
protected void Foo() { } // method 'Foo' hides method with default implementation in interface
no, I slammed my head on the desk and ordered a new desk complaining that there was a hole in it
private IIsInterface This => this;
also doesnt help
because then, your qualifier is again not this but This which is not allowed for protected access
 
mr5
how come it got hole instead of breaking the desk? do you have nail attach on your head? xD
 
as I said, you cannot call the function
 
[Captain Obvious] Jesus christ what's been going on in here
 
so, your function must be public
 
Think with interface default methods, they could change LINQ to use that instead of extension methods?
 
mr5
3:17 PM
but you suggested a working solution right? what was it? I'm pointing a gun on you rn.
 
Like, they could still get away with that in coreFx
 
I made the functions public
which is not a solution
the goal of the type was a helper code module, which should only have protected members
 
mr5
argg. I forgot why do I have a problem with this again. I can't look at it right now because vs22 is updating.
 
but C# ain't not havin'n't no none of thatn't
 
mr5
Bill Gates, fixed your god damn mess!
 
3:19 PM
C#n't
 
I wish I C#n't
 
mr5
otoh, I would prefer working on C# than JS
JS is fucked up on another level
 
that is like saying "I would prefer living in China than in the bottom of the flerken ocean"
 
So I just realised...with default interface methods, we basically got mixins now.
 
mr5
what is flerken ocean
 
3:20 PM
we basically wasted the chance at having mixins now, yes
 
mr5
wtf is mixins
damn. have I been out of the internet for so long.
 
they could actually introduce mixins, but that'd probably be in 2060
 
mr5
> As defined in Wikipedia, a mixin is a class containing methods that can be used by other classes without a need to inherit from it.
eh wat
isn't that like a definition for a regular function?
 
> Mixins are a language concept that allows a programmer to inject some code into a class.
 
It's some kind of multiple inheritance without saying multiple inheritance
 
3:24 PM
it is not actually
it is just a fancy name for a code module
basically, you have a component which contains functions and properties (like a class)
 
mr5
I feel like I have heard this before, but due to I'm old fuk and have dementia already, I forgot or rather I don't know what it is.
 
you could include that component in your code to gain access to those functions (like using static MyClass;)
the problem with static imports is that the imports in your code are not your code
 
Imagine your own class. It is some kind of list.
Now you want to make it enumerable, use LINQ.
Imagine LINQ isn't a thing. Instead, you have a mixin called "enumerable".
To get all these fancy methods, you add the mixin to your class.
All you need to do now is build one method: GetEnumerator().
The mixin now supplies all the LINQ methods, using your GetEnumerator() to do it.
 
the imports (or usings) are things you dont want to look at, you dont want to write them and you dont want to read them
 
This is how Ruby does it for example, they have a mixin instead of extension method LINQ.
 
3:27 PM
you want the IDE to do it for you
what we can do in Java for example, is make an interface with default method implementations and we can "implement" this non-abstract interface to gain access to all dem juicy methods
without having to mess with the imports
the same should happen in C#... except that C# wont allow you to access those methods
 
...don't you have to import that interface then?
 
mr5
oic
 
so in Java, you can have code modules, aka mixins (by defining methods in an interface)
 
mr5
mixin is like the abstract concept, and extension is one of the implementations?
 
@Squirrelkiller your IDE is very good at solving that for you
your IDE is not very good at solving static imports
 
3:29 PM
Ah I see
 
@mr5 different languages would use different ways of doing mixins
C++ probably does it using templates
Java does it using interfaces
 
mr5
C++ use it using inheritance
 
Scala... scala is it's own story
true, C++ has multiple inheritance, so it might even use that... but I'd assume that templates might be more applicable
 
mr5
because multiple inheritance is allowed in C++, why not leverage that
 
because inheritance is not the best approach
the best approach is actually using a special type of component
 
mr5
3:31 PM
yeah but it's C++
 
vJASS for example actually uses code modules
which means that you could use special features to make your mixins work even better
 
mr5
the mixins in C# is through extensions?
 
their code modules are just code templates basically
you could for example define a code template like this
 
mr5
code modules?
ha! the update fixes the issue that occurred out of nowhere.
 
#module Lazy(name, type, defaultValue)
private $type _$name;
public $type $name {
	get => _$name ??= defaultValue();
	set => _$name = value;
}
#endmodule
then you can have lazy properties without re-implementing lazy properties every time
 
mr5
3:35 PM
@Squirrelkiller and the "mixin" is implemented using auto code generation?
 
public String Name { get; set; }
#Lazy("Function", "String", { "Developer" })
which would produce
public String Name { get; set; }
private String _Function;
public String Function {
	get => _Function ??= "Developer";
	set => _Function = value;
}
(the name property just to show you put it next to your other properties)
(also, we obviously already have Lazy<T> now, but that one is also annoying)
 
mr5
@Wietlol but this reads to me like it doesn't "extend" an existing class. It reads to me like it auto generates code for you instead.
 
that is true
and to be fair, these code templates aren't really necessary
but they did do the job
it is more meta programming and would easily be abused
 
mr5
reminds me of the #define on C++
 
actually called "text macros"
 
mr5
3:47 PM
vjass? another language?
again?
 
and you can easily see the example could be abused
not again, I mentioned it before
using textmacros for example, you could iterate over variables with a postfix number
like
var1
var2
var3
var4
...
 
mr5
yeah, on C++, I've seen some code where it gets abused, it almost looks like it's written on another language.
 
@mr5 No the mixin is a code module, like LINQ, very similar to extension methods in functionality. Works a bit like extending an abstract class - it makes you implement a specific thing and has the other methods already finished.
 
mr5
oh! I remember. This gets heavily used on Qt
oic
on that case, it looks like it needs some auto code generation support.
 
not necessarily
I considered adding code modules in Kodian, but havent actually done it as I can do most things in other ways
 
mr5
4:00 PM
on Kotlin, mixins is in a form of extension too right?
 
in Kotlin, you'd probably do it using interfaces for stateless modules and using delegation for stateful modules
the problem Java has with the interface approach is that interfaces wont handle your state
you still need to provide the properties in your class
for a stateful mixin, you'd have a normal class acting as the implementation
and a delegated property basically combining the separated class with the direct linking to your code by implementing the interface and delegating by the implementation
basically
2
not only does it solve the problem of duplicated code, it also allows you to easily change implementations where you need different behavior
I use this a lot in my sql library and in the kodian compiler
in both cases, I did hit some of the limits of how the delegation works
one in particular
class Bar(
	val collector: LogCollector = CollectionLogCollector()
) : LogCollector by collector
^ this is fine
class Bar : LogCollector by collector
{
	val collector: LogCollector = CollectionLogCollector()
}
^ this is not, because the collector cannot be resolved
 
4:22 PM
Any one of you used Firebase and Stripe payments ?
I'm looking to create monthly user subscriptions for an app.. so far I believe these 2 will be the best choice.
 
mr5
4:39 PM
@Wietlol what does by means on the last example?
 
delegation by
basically "implement this interface by using this implementation"
 
mr5
4:50 PM
and the class that uses this delegation is still not extending any custom class right?
and still free to extend any other class (provided multi inheritance is not supported by Kotlin)
 
5:17 PM
yes
it is "implementing" the interface though
so, an instance of your class somewhere else in the code, would also be a gateway to those functions
 

« first day (4114 days earlier)      last day (820 days later) »