« first day (3859 days earlier)      last day (1072 days later) » 

5:51 AM
Goood moorniiiiing CeeeShaaaarp! How was your weekend? Started learning anything new? Feel dumb yet?
I for one learned how to compile and run a single java file that doesn't reference any other classes - but did not learn how to compile and run a single java file actually referencing another class in the same folder!
Feeling pretty dumb
Solved it, classpath needed to be set to src. Still feeling dumb, but glad sleeping on it helped a little.
 
6:57 AM
morning
why Javaing?
 
Lecture says java good so student have to use use java
 
mr5
7:42 AM
fck LTC. As soon as I pulled out, it went sky rocket 🤬🤬
 
Tell me where you'll pull out next so I can invest lol
 
8:01 AM
mr5: "sky rocket" ... coingecko: "+10%"
 
wow. Went above the stars...
 
Is there a way to list all API routes in an MVC project (framework not core)
 
mr5
@Wietlol no. I mean by "soon" was a week ago.
It went ~50%
this is when I bought it lol
@mshwf if they share a common base class, you can query and filter them via assembly.
Or if you're after listing it elegantly, just use Swagger
 
8:24 AM
I'm using this in .NET Core
endpoints.MapGet("/routes", request =>
{
    request.Response.Headers.Add("content-type", "application/json");

    var ep = endpoints.DataSources.First().Endpoints.Select(e => e as RouteEndpoint);
    return request.Response.WriteAsync(
        JsonSerializer.Serialize(
            ep.Select(e => new
            {
                Method = ((HttpMethodMetadata)e.Metadata.FirstOrDefault(m => m.GetType() == typeof(HttpMethodMetadata)))?.HttpMethods.First(),
                Route = e.RoutePattern.RawText
Isn't there APIs for this in .NET framework
 
8:41 AM
IActionDescriptorCollectionProvider seems to be .NET core only
 
mr5
8:54 AM
Use netcore then
 
I have to use .NET Framework for this project
 
Swashbuckle does have a netFx NuGet package that will gather all routes and optionally provide a nice GUI via another route.
 
omg,
I wasn't able to find any resource about that in Google, even with "-core"
but I set the time range to be before 2016.
a lot of resources started to show up. and found this: https://docs.microsoft.com/en-us/aspnet/web-api/overview/getting-started-with-aspnet-web-api/creating-api-help-pages
and I found it already in the project :'D it was installed with the template.
and the API is ready for use already in "/help/index"
 
9:12 AM
Haha nice^^
 
mr5
9:56 AM
<rant>

Our government spends millions of pesos (~20K+ USD) for each department's website, and despite the fact that it only consist of static contents, it is:
- ugly af (design is like by a student that learned html a week ago)
- contains hundreds of JS errors just by scrolling in a single page
- typographical errors
- some statements from the document (authored by PhDs staffs) are contradicting

</rant>
 
Conclusion: Better work for the government
Anyone know how to read a value from the gitlab job log like it parses coverage, but a custom one like "Pricessed lines: \d+"?
 
 
1 hour later…
11:09 AM
considering the following stuff in the service collection, what else do I need as a minimum to have logging done?
.AddTransient<ILogger>(...)
.AddLogging(builder =>
{
    var configSection = builder.Services
        .BuildServiceProvider()
        .GetRequiredService<IConfigurationRoot>()
        .GetSection("Logging");
    builder
        .SetMinimumLevel(LogLevel.Trace)
        .AddFilter("Default", LogLevel.Trace)
        .AddFilter("Microsoft", LogLevel.Warning)
        .AddFilter("System", LogLevel.Warning)
        .AddConfiguration(configSection);
});
one of my test fails where it waits forever when I do provider.GetRequiredService<ILoggerFactory>()
this doesnt look like Microsoft.Extensions.DependencyInjection though
 
mr5
I have 0 setup from my API and ILogger<T> just works as fine
it is
 
it is asp.net tho
 
mr5
yep
ASP inserted a bunch of vodoo spells when you create that template project
 
I am looking for the basic minimum
so that everything gets funneled into an ILogger
and to be fair, I dont really know how the logger providers and logger factories and all are integrated into each other
 
12:05 PM
2 hours and noone even reacted yet - should I have added some obvious mistake? stackoverflow.com/questions/67468368/…
 
mr5
oh wait
@Squirrelkiller shields.io
you might need to manually build the logic yourself for retrieving the correct badges for each event
 
if you have control over the program that logs that line, you could have more options
 
I do, I just sout the line into output
Just don't know how to make it display all fancy like in gitlab
 
mr5
you mean, you want to output badges on a console?
 
Woah that is a nice website
I want to display the badge on the homepage of the gitlab project, like the pipeline or coverage badges
Each time a pipeline runs on master, the jobs should be searched for "Processed lines: \d+", and that value should appear on a badge
 
1:03 PM
[Captain Obvious] Sup willies
 
Maths monday!
We're reversing RegExes today. And also map a regular language to another and then construct the regex from the mapping function.
 
1:19 PM
sounds fun
what kind of regexes?
 
Simple ones
e.g. you have an alphabet {0,1,2}, another one {a,b}, a mapping function h: h(0) = a, h(1) = ab, h(2) = ba.
Make h(0120) and h(2220).
Now make h(L1) where L1 = L(1+20) (note that this is not the unix regex notation but the formal one, where the + is unification, which is | in unix)
Then make h^-1 (L2) where L2 = L(a(ba)*)
Also the Pumping Lemma to prove that a given language is not a regular language
(or is one)
 
> While the pumping lemma states that all regular languages satisfy the conditions described above, the converse of this statement is not true
I have a faint memory about proving something is regular language is NP complete
 
To prove a language is not regular, we assume a given language is regular and solve the pumping lemma. If that becomes a contradiction (e.g. i, m > 0, i - m = i), then the given language is not regular.
 
@Squirrelkiller I'm talking about (is one)
 
Ah I see
But any concatenation or unification of words in a regular language is itself a regular language, so by solving the pumping lemma for one word of a regular language, you prove that the whole language is regular.
 
1:33 PM
I'm not sure. I learned about it a long time ago, but I have a faint memory, if you can prove under exponential time of something is regular, you are VERY rich.
In the theory of formal languages, the pumping lemma for regular languages is a lemma that describes an essential property of all regular languages. Informally, it says that all sufficiently long words in a regular language may be pumped—that is, have a middle section of the word repeated an arbitrary number of times—to produce a new word that also lies within the same language. Specifically, the pumping lemma says that for any regular language L {\displaystyle L} there exists a constant p {\displaystyle p} such...
> For example, consider the following language:
^ after that, there is a proof, that you didn't prove that the whole language is regular
8
A: Chomsky Hierarchy and P vs NP

David RicherbyRegular languages Regular languages are in $\mathbf{P}$ because a deterministic finite automaton is a restricted deterministic Turing machine that runs in linear time. Context-free languages In fact, any context-free language is in $\mathbf{P}$: Valiant showed in the 1970s that context-free gramm...

Context-sensitive languages are the problematic ones. Regulars are easy
 
Damn, I just did this for 3 hours in german, not gonna do it again in english now. Gonna keep the tab open for when my brain is done churning lol.
 
2:16 PM
Ben Popper on May 10, 2021
Spaceflight, from the beginning, has depended on computers – both on the ground and in the spacecraft. SpaceX has carried it to a new level. We recently spoke with Steven Gerding, Dragon’s software development lead, about the special challenges software development has for SpaceX’s many missions.
 
3:07 PM
How to move a question to a different SE site? I realized that SO is probably not the fitting site for my question, DevOps is way better.
 
3:31 PM
[Captain Obvious] send link
 
3:45 PM
guess who losign his mindt oday
 
is it Elon Musk?
 
4:48 PM
pls he's wario now
 
[Not Li] Someone help free. They're having a stroke.
 
I'm having a stroke? Oh good; maybe now I'll die
 
5:07 PM
I have those daily while working on current proj
 
6:01 PM
idk may get rid of my discord soon...at least I would if I didn't have to uphold a server for my story
 
 
2 hours later…
8:01 PM
 

« first day (3859 days earlier)      last day (1072 days later) »