« first day (3743 days earlier)      last day (1203 days later) » 

1:52 AM
 
 
2 hours later…
4:14 AM
[mr5] @Wietlol still using PAT?
 
ye
 
[mr5] Why not OAuth?
[mr5] PAT will eventually expire, unless you set the expiration to indefinite, then that's understandable.
 
4:35 AM
I havent tested with OAuth yet
how would that work?
 
4:50 AM
[kesarling] morning guys
[kesarling] If I want to have a navigation bar, which will render different components in the view depending on the tab, do I need to use partial views?
[kesarling] .net core razor (MVVM)
[mr5] <@211519661420838912> You will authorize it once, a code will be returned to you and you will use it to generate a request for access token. You must also specify the scope so that it will return a refresh token along with the expiration time. If the access token expires, you will use the refresh token to generate a new access token and it that's the whole cycle.
[mr5] I think the scope needed to have a refresh token is, putting a scope of "offline". It basically means act on behalf of user.
 
5:11 AM
but what creds do I provide?
> It basically means act on behalf of user.
that is exactly what I do not want tho
 
5:37 AM
[mr5] username & password but once only
[kesarling] How does one add Bing Maps to a .Net Core Razor Project?
[mr5] Is Razor a web thing?
[kesarling] .NET Core Web App (Default is Razor MVVM model)
[mr5] I mean, does it run on browser?
[kesarling] Yes
[mr5] Then you use JS
[kesarling] Can't we use html and C# instead?
[mr5] Of course you can, if Bing offers a web assembly
[kesarling] So I, like, search for Bing Maps Web Assembly?
[kesarling] in google>
[mr5] yes
[kesarling] Its redirecting to blazor
[kesarling] JS it is 😄
[kesarling] But the thing is, I don't know JS very nicely
[mr5] As long as Web Assembly is not yet mature, always know that client side tasks are done in JS/TS.
[kesarling] Hmm... okay 🙂 Thanks a lot
[kesarling] umm, how do I add partialviews in my razor pages?
 
6:21 AM
@Botler and that password would never change either?
with a pat, you can specify the permissions that the usage has
with oauth, you get the permissions from the user
so we would need dedicated users for each task
I prefer dedicated pats
 
6:43 AM
                var x = 1;
                MyFunction(x)

                Public void MyFunction(input)
                {
                    //Print x here which is the variable name
                }
Hi guys, is possible to do this?
 
have you tried?
 
Can get "input" but not "x"
I want the "x" not the value of "x"
var width = 0;
var height = 0;
Helper(width, height);
// Print "width: 0, height: 0"
Real word feature I want
 
you could just define it as a lambda
var myFunction = (int input) => {
    // access x
};
 
[kesarling] how would we do that?
 
6:58 AM
but that is pretty bad
@kesarling (empty message)
 
[kesarling] umm...?
 
message is empty
 
oh!
wait
 
@MichaelMao or do you mean to access a local variable from somewhere in a different function? that wont be possible
 
@model MapModel

<head>
    <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=<my api key>&callback=initMap&libraries=&v=weekly"
            defer></script>
    <style type="text/css">
        .map-div {
            height: 100%;
        }
        html,
        body {
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
    <script>
        let map;
        function initMap()
There you go @Wietlol :)
 
7:00 AM
ew html and js
 
@Wietlol no other way apparently
1 hour ago, by Botler
[mr5] Then you use JS
 
ew
:)
 
Any idea?
 
nope
 
@WietlolI think so just want to confirm
Just want to write a helper function for easier Print
Code this every time take times
Console.WriteLine($"width: {wdith}, area {area}");
 
7:09 AM
ah you want a reference to the variable...
 
var width = 0;
var area = 0;

Console.WriteLine($"width: {width}, area {area}");
//So this print "width: 0, area 0"

//And I want a helper function like blow
Helper(width, area);
//Also can print "width: 0, area 0"
 
Buenos dias
@MichaelMao void Helper(int width, int area) => Console.WriteLine($"width: {width}, area {area}"));
Put this into your class definition
 
mr5
7:28 AM
@Wietlol did you just mix c# and js
 
He did not, you can declare myFunction as a variable, right?
 
@mr5 no
yes
 
I think typescript linters even suggest this way to you
@d4rk4ng31 Syncfusion has components for that
 
@Squirrelkiller I am using google maps
 
7:46 AM
Then there's is a nice step-by-step for that
Even without a third party component
 
hmm... will take a look. Thanks :)
 
@Squirrelkiller sure, but I want a general helper don't want defined it everytime
 
8:01 AM
Could then either 1) get used to using the snippet (type 'cw' -> press tab) or 2) Create an internal class C that has a static void W(int width, int area) => Console.WriteLine($"width: {width}, area {area}");
 
I mean sometimes is width, height, area
sometimes is max, min, middle
 
Could make the method take (string message, params object values) and just concatenate that. Of course then you'll messages like "width/height/area: 20 12 156".
Or you just use cw->tab
 
8:19 AM
good!
 
8:38 AM
you could perhaps write a shortcut... but I am not sure if it will work that well in VS relatives
I know someone who wrote a shortcut for IntelliJ, which would be equivalent to writing "cwv" which would add the code Console.WriteLine($"<var>: {var}"); where var would be replaced by the variable of the line above it
not sure if he implemented multiple variables, but then you have ambiguity anyway over how many of the above defined variables you want printed
maybe "cwv2" "cwv3" etc would be appropriate then
in any case, it relies on the templating that the Jetbrains IDEs (and maybe only IntelliJ) provides
I doubt you can achieve the same in VS Code or Visual Studio without writing an actual plugin for it
 
VS can do that too, they're called snippets
You build the template in xml and put it into VS's snippets folder
Or add your own folder to its snippets locations
 
but can you achieve this snippet's behavior?
looking at the previous statement, assuming it is a variable declaration statement and reading the variable name
 
It can't read the previous statement, you'd have to select the variable you want read
 
8:59 AM
just implemented it in rider as well... quite interesting to see how it works again
 
Basically can't do it only by C# I think
 
nope
 
Depends on what you want. There are now several possible solutions here
 
you could do it in Kodian though
print(::x)
function print(variable: Variable<?>) {
    printLine("$variable.name = $variable.value")
}
I think in kotlin you can do the same... never tested it actually
 
[Captain Obvious] Hey I recognise what you're trying to do
 
9:06 AM
well... not yet
 
[Captain Obvious] It's not possible to get the name of parameters at runtime
 
perhaps in 1.5
well... yes it is
nameof(x)
but you cant get both the name and the value without duplication of telling which variable they came from
 
[Captain Obvious] Not with the values. Automatically. Without already knowing what the paramter is
 
so you have to do Print(nameof(x), x)
 
[Captain Obvious] But you still need to know what x is
 
9:08 AM
true
 
[Captain Obvious] My solution in the end worked out alright
 
but that is why you decide on that when passing the variable
 
[Captain Obvious] I pass a dynamic parameter with whatever name, and call the method by using an anonymous type and reflect the property names and values out of it
[Captain Obvious] It sounds dirty (and don't get me wrong, it is, but it WORKS
 
uhm what?
you mean
Print(new { x })
?
 
[Captain Obvious] essentially yes
 
9:10 AM
I suppose that is better than Print(nameof(x), x)
 
@Wietlol Pretty sure nameof(x) is compile time
 
[Captain Obvious] Except then you can have as many "parameters" (which are actually properties) as you like
 
@Squirrelkiller well obviously, but you only need compile-time data
 
[Captain Obvious] I'll see if I can find it
 
@Botler why not?
 
9:12 AM
[Captain Obvious] I was looking for a way to automatically make a rest request without me having to define all of the details of all the methods manually because I'm lazy
 
get a list of properties from the param, then do props.StringJoin(", ", (prop) => $"{prop.name} = {prop.value}")
 
I would use Express<> parameter for that method. You can traverse the Expression for variable names, and compile + run to get the value
 
[Captain Obvious] 🤷‍♂️, it's still more than fast enough
[Captain Obvious] It was for jamming some new functionality into an ancient Xamarin forms app
 
9:49 AM
[Hozuki Ferrari] @butler1233 Look at Flutter (manual~ish), RestSharp (manual~ish) or Refit (auto-wire)
 
@Wietlol Hey good point. ...you should be able to make a similar attribute to [CallerMemberName] that somehow...passes the parameter name.
 
true... but then you assume that the caller's argument was a simple variable
that wont always work
 
Oh good point
Actually
Just do what ntohl suggested
Then my var name is new object[] {"test"} whatever
 
23
A: Get the parameter value from a Linq Expression

Jürgen SteinblockThis method works pretty well. It returns the argument types and values for an Expression> private static KeyValuePair<Type, object>[] ResolveArgs<T>(Expression<Func<T, object>> expression) { var body = (System.Linq.Expressions.MethodCallExpression)expression.Body; var va...

 
meh, I think the dynamic object is the cleanest
and the most appropriate
because you describe a collection of variables (properties)
and it is a collection of variables that the print method desires
this keeps a right tool for the right job which means that you have related features for edge cases
such as
new { x: x.floor(), y: y.floor() } if you want to print the floored values
without introducing a new variable for the floored value just to be printed
 
10:09 AM
x => Math.Floor(x), y => Math.Floor(y) // this expression might save type safety laterz
 
?
 
??
 
confusion intensifies
 
x => Math.Floor(x), y => Math.Floor(y) is LambdaExpression[].
 
ah, it was in fact nyconing itself and not the bot
but how would you use that lambda expression?
 
10:12 AM
each item in the array have functions to get the param name, the type of the result, value of the result
 
but you cant get the value of the result because you dont have arguments to match the parameters
 
using parts of that code> stackoverflow.com/a/24403382/1859959
true
x => Math.Floor(someConst), y => Math.Floor(someConst2)
ehh
not like this
// Math.Floor(someConst), Math.Floor(someConst2) would be the way
off to eat
 
in the case of x => Math.Floor(someConst) you would still want to insert the value to be floored from a variable called "x" in an outer scope
but then that variable is shadowed by the lambda parameter
so you would have to come up with new names for the parameters to represent variable names of the outer scope
 
10:54 AM
yeah. That's why the Math.Floor(someConst), Math.Floor(someConst2) is the Expression[] that would be passed
if that's even possible
 
Uhh test
How is this working my internet is down
Ok it was DNS
 
11:44 AM
[Captain Obvious] That was using restsharp
 
> C# 10 introduces a new keyword: "abusing", to allow developers to clearly specify how much they intend a certain namespace to be used.
- source: unknown, probably unreliable
 
@Squirrelkiller I need a hand with blazor
I'm trying to pass a list into a blazor file
and its complaining like the parameter isn't set to expect a list
when it is
 
Do you actually pass a list?
 
[Hozuki Ferrari] @butler1233 try refit then 🙂
 
11:49 AM
So
 
show me the param declaration
 
The issue is
When i'm calling that component & putting the list into Fields=""
The "Fields" bit is trying to say it shouldn't be a list
when it clearly is
ffs
 
[Captain Obvious] Maybe it's actually being passewd through as an array
 
[Captain Obvious] Or some other IEnumerable
 
11:51 AM
It's saying its just being passed as the object
not List<object>
 
sorry no
it's saying I can only pass object, not List<object>
Even though it needs List<object>
 
[Captain Obvious] Maybe it doesn't like generics
 
It's getting a specific class
 
maybe it expects Fields="obj1" Fields="obj2"
but that would be silly
 
11:53 AM
Restart VS
 
but it is blazor...
also, ye, clearing cache and restarting could do wonders
 
Fucking caching I tell ya
 
[Captain Obvious] I mean that is how it comes through in requests
 
@Squirrelkiller if it was caching then the build would work surely?
am trying tho
oh boy
 
11:54 AM
I wouldnt be so sure about that
 
i restarted and VS crashed when it started again lel
 
builds also have caches
 
[Captain Obvious] Standard VS
 
F
FUCKING CACHING
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
 
maybe the link I posted can help you in the future
 
11:56 AM
[Captain Obvious] i think it was the cache lads
 
lol ffs
 
I doubt it is VS' fault tho
Rider also has this shiny button "Invalidate cache and restart" which we spam from time to time
yet for other enviroments, such as JVM, for IntelliJ, I dont even know if it has such a button
maybe it is msbuild or something weird
 
12:20 PM
[Captain Obvious] I forgot how much I hate working with WPF images
 
I forgot how much I hate
speaking of which, I probably have to catch up on some
can someone just list me cool stuff in .net so I can say they suck?
 
Rider sucks
2
 
[Captain Obvious] Yes it does
 
18 secs ago, by Wietlol
Rider sucks
Just coming on here to immortalise that message
2 mins ago, by Wietlol
Rider sucks
 
12:23 PM
[mr5] Do you guys have any idea of what "Android Reverse Engineer" do, aside from my speculation that it's about reverse engineering the code?
 
I mean, when I paste text into a string literal HOW DO I EVER NOT WANT TO ESCAPE THE DAMNED THINGS THAT STRING LITERALS CANT JUST HAVE?!
wait... thats unfair, I cant move them back
 
There we go
You could move mine to the bin too
Except now I've edited the audit message which can't be moved
 
true, but why?
 
10/10 stack
 
I mean, it mostly doesnt suck, but it is still silly from time to time
 
mr5
12:25 PM
@Wietlol ikr, IJ is good in this regard.
 
Rider sucks... not as bad as VS and VS Code, but still sucks
 
Any time I paste stuff I get asked whether I want to escape it
 
VSCode is only like npp++ lol
 
@mr5 I suppose we have tasted the greener grass :D
 
12:25 PM
Can't back out now
It's stuck forever
 
@Squirrelkiller any time I paste stuff in IJ, IJ knows how to properly escape
 
Hmm. I wonder if feeds can delete audit messages
 
and when
and not only for Java/Kotlin, but for many other languages
such as json and xml
 
Like if I posted something "offensive" it normally deletes messages or whatever
But audit messages can't be moved and presumably can't be deleted either
 
Only if it gets flagged
 
12:28 PM
ok, other than the escaping thing, I cant really think of anything that it does weird...
oh wait...
 
Yeah but that's not an audit message
 
wellsexIguess
 
Oh there we go
 
you VS plebs, can you run unit tests and always ignore a certain category?
 
Now edit that to something offensive
I think so? I don't run tests lol
 
12:29 PM
@Squirrelkiller HOW DARE YOU!
is offended
 
Sorry changed it
Guess someone's gotta flag me
see you in an hour then lol
 
essex?
 
Ew essex
 
hehe
 
Anyway I'm going back to my discord hole
 
12:30 PM
anyway, can someone answer
> can you run unit tests and always ignore a certain category?
^ in VS
 
Define "category"?
 
"Trait"
 
...or is there an actual attribute you put on a test?
 
xUnit specific perhaps?
 
If I open your code - how do I know what category a test is?
 
12:32 PM
attributes
 
Like?
 
I use this github.com/brendanconnolly/Xunit.Categories which works on top of xUnit traits
[Fact]
[Bug]
public void TestDisShhh_tuff() { ... }
 
I mean, it seems dotnet test brings a nice filter for that?
 
that would be the "bug category"
 
Ah you mean the test explorer in VS?
 
12:34 PM
true, dotnet test works fine
but from the IDE, I see weird behavior
so I was wondering if anyone else uses categories
for example for integration tests which only run in CD
and unit tests which only run from your local machine or CI
or manually invoked tests, which only run from your local machine and only when specifically asked to run that test
 
We do it differently: We have a project.Integration.Tests and project.Unit.Tests and the ncrunch engine mode filters on that
 
ah...
I mean... ew
 
Test Explorer does indeed have settings for that, but I'm in a lecture so can't really get into it right now
 
:p
 
||google "visual studio test runsettings"
 
there
 
mr5
@Wietlol wat. What does [Bug] attribute do? Does it mark that a certain behavior is a bug?
 
just a category
just like [IntegrationTest] or [UnitTest]
that way, we can run all tests except this and that category or run only test in this and that category
 
mr5
Well, a category of [Bug] would make a justification for a certain bug. "If this [Bug] test failed, we should regress"
Bug would become a feature now.
Voila, problem solved.
 
I think [Bug] [UnitTest] [Feature] [UserStory] [Documentation] [KnownBug] [WorkItem] and [TestCase] would always run or not together
we mostly are going to use it to just describe what kind of test it is
[Exploratory] [SystemTest] and [IntegrationTest] would be the odd ones out
where [SystemTest] and [IntegrationTest] would run in CD
and [Exploratory] only from your device... maybe
 
mr5
12:49 PM
I don't even test.
 
>pink shirt with a collar up
this guy's got style
 
mr5
I used to own a lot of pink t shirts. I wonder where all those shirts went.
 
Humans: ROBOTS WILL TAKE OVER THE WORLD!!!
meanwhile robots: https://imgur.com/gallery/fJefrtP
 
mr5
Now that I think about it, a lot of my clothes have actually mysteriously gone. Like, 70% of my clothes are missing.
@Wietlol retrain and equip them with guns. Dayum, that's scary already.
 
12:57 PM
they are still a bit too unstable to be used in the field
 
chappie be like
 
1:11 PM
Hi all
 
 
2 hours later…
3:31 PM
Ryan Donovan on January 14, 2021
NoSQL climbed up the charts as the next big thing in system architecture in 2011, but overall interest in it has plateaued recently. You’ve may have heard of it and ignored it, safe in the knowledge that you can always have a an SQL command line at your fingertips. But what is NoSQL, what does…
 
why does the NoSQL logo look like Supreme?
 
3:50 PM
yo yo yo
@Freerey because NoSQL is Supreme
 
What's Supreme
Except, you know, NoSQL
 
Supreme is an expensive clothes brand
 
4:14 PM
 
that's not what snoke looks like
 
Hi all,
I'm reading some crypto docs, is there a strict meaning of "printable string" or it's just a string for end-users (not encoded)?
 
Maybe not made of control characters
 
I guess that also
 
doesn't it have to do with the type of character
I think it just readable characters by the end-users
A PrintableString is a restricted character string type in the ASN.1 notation. It is used to describe data that consists only of a specific printable subset of the ASCII character set. According to the ASN.1 Specification of basic notation, the character set of PrintableString can be expressed as: The PrintableString definition does not include the at sign (@) or ampersand (&). This sometimes causes problems for naive implementers who attempt to put an SMTP email address into an X.509 digital certificate Distinguished Name. The PrintableString definition does not include asterisk (*) which means...
 
4:28 PM
The table doesn't include control characters
 
5:13 PM
posted on January 14, 2021 by Scott Hanselman

I think we can all agree 2020 sucked. Hopefully 2021 will be better. I've been a remote worker for 13 years by choice but in 2020 I HAD TO DO IT because, well, most programmers and tech workers did. I wrote about how Remote work != Quarantine Work while our whole division and then the whole company moved back home! We were a fairly remote-friendly company before but I have to admit I didn't

 
 
1 hour later…
mr5
6:30 PM
@Freerey supreme noodles mmm!
limaw
 
xkcd's humor makes me wanna die sometimes :')
 

« first day (3743 days earlier)      last day (1203 days later) »