« first day (3704 days earlier)      last day (1231 days later) » 

5:18 AM
The ArrayPool<T> class in System.Buffers has a create() overload that takes two arguments, minLength and arraysPerBucket. Does anyone know the default # of arrays per bucket or how to set a good variable for it?
 
 
8 hours later…
1:11 PM
Why ViewBag can't be filled in an async method, it's filled when debugging, but the ViewBag variable is not available in the view?
 
Hello friends!
[Captain Obvious] Ahhah yeah that one got me
[Captain Obvious] When you're in the cshtml, you refer to it as ViewData["PropertyName"], where you set it like ViewBag.PropertyName
 
1:37 PM
Hello everyone... Is there a way to use an Object like a string?
public class TodoStatus
{
    private TodoStatus(string value) { Value = value; }

    public string Value { get; set; }

    public static TodoStatus None { get { return new TodoStatus("None"); } }
    public static TodoStatus Completed { get { return new TodoStatus("Completed"); } }
    public static TodoStatus Cancelled { get { return new TodoStatus("Cancelled"); } }
    public static TodoStatus Deleted { get { return new TodoStatus("Deleted"); } }

    public override string ToString()
    {
I'm not using an enum for the status because I want database to be self-documenting... is there a simple way to make Status equal to the Value property?
 
mr5
override the == and Equals?
 
you can make the status property be an adapter around a private status property
private TodoStatus StatusValue { get; set; }
public String Status {
    get => StatusValue.Value;
    set => StatusValue.Value = value;
}
althought, I can highly recommend making the TodoStatus class immutable
and provide a TodoStatus.Parse(value) function
 
@Wietlol I like this
 
I dont, but it is what you asked for
 
I was considering User-defined conversion (implicit and explicit)
 
1:48 PM
ye, that is even worse
if you want it to be a string, why not make it a string?
if you dont want it to be a string, dont pretend it is a string
 
I'll just go with the simplest solution. Make it a string and validate if I need to.
Thanks guys.
 
mr5
@Wietlol please tell me, how did you figure out that is what he's asking?
 
because he told us
> Is there a way to use an Object like a string?
 
mr5
Oh. I didn't follow. I focused on the last question. lol
 
2:08 PM
What no
Definitely don't do what wiet says
In other newsd
I fucking hate WCF
 
0.o?
 
[Captain Obvious] I have 2 services
[Captain Obvious] Which are hosted in exactly the same way
 
I mean, "Definitely don't do what wiet says"
why?
 
[Captain Obvious] because u dum
[Captain Obvious] And I'm trying to connect to them, and one of them works perfectly
 
I might be dum, but what I say is sometimes smart
 
2:12 PM
[Captain Obvious] And the other one keeps aborting for some reason
 
meanwhile I am trying to build a native image for linux... on a windows machine
and peeps keep telling me "no, that is impossibru"
 
[Captain Obvious] Anything's possible with enough willpower
 
it appears not
 
[Captain Obvious] You just need more willpower
[Captain Obvious] And knowledge
[Captain Obvious] Image for what anyway
 
binary
program
so it runs faster
hopefully
 
2:14 PM
[Captain Obvious] Oh as in compiling for linux
 
yep
 
[Captain Obvious] I thought you meant like docker image or somethign
 
people say "if you want to build a linux image on a windows machine, then you need docker"
installs docker
runs build
 
"oh yea, it wont work like that"
 
2:15 PM
[Captain Obvious] WSL would probably do just fine
 
I think I will try to run a linux machine on my windows machine using WSL and then doing the build
but still...
 
[Captain Obvious] It makes sense
 
the process is from one application package to some binary executable
 
[Captain Obvious] The easiest way to build apps for any platform is to build on that platform
 
are the bytes in the result for linux somehow illegal on a different machine?
even Kodian can build for everywhere on a windows machine
 
2:18 PM
[Captain Obvious] Wtf is kodian
 
but I cant move to that yet
Wietlang
 
[Captain Obvious] So Java
 
the compiler is still Java
and Java can run on windows
 
[Captain Obvious] So that's why
[Captain Obvious] Becauise it's not building for everywhere
 
the process is always the same
 
2:18 PM
[Captain Obvious] Not linux or windows
[Captain Obvious] It's building for the JVM
 
no no no, it is building through llvm
and builds a native executable for each platform
 
at least... for the time being only windows and linux because I havent bothered with mac yet
the compiler is written in JVM, but Kodian itself has nothing to do with Java
the compiler could also be written in .net
 
[Captain Obvious] It might spit out a native dll and so and whatever for each platform
 
or javascript
 
2:20 PM
[Captain Obvious] But the actual application binary is exactly the same and is wrapped in something
[Captain Obvious] Probably jvm
 
nope
 
the application binary gets converted to LLVM IR
which then gets converted to x64
and builds an .exe
then I can run it on windows
no virtual machine, no nothing
 
[Captain Obvious] So I looked it up
[Captain Obvious] And oh look
[Captain Obvious] the IR is wrapped with a compat layer
 
source?
 
2:24 PM
[Captain Obvious] Your application compile to LLVM IR, which then runs on the LLVM backend for the platform
[Captain Obvious] Which is the compat layer
[Captain Obvious] When the actual compat layer does it's magic and converts to real native code doens't really matter
 
that is while it is in the llvm pipeline
 
[Captain Obvious] But the final "compilation" to actually platform native code doesn't happen until it lands on the platform
 
nope
that is at the end of the pipeline
 
[Captain Obvious] Whether it JITs it at runtime, compiles the entire app AOT on startup or at "install time", it's still on the target platform
 
you distribute the native executables
 
2:28 PM
[Captain Obvious] If you strip the LLVM backend out of your binaries it 100% will not run
 
if it wouldnt, then llvm would be required to be present on the target machine
 
[Captain Obvious] What no
[Captain Obvious] The backend is included in the binary
 
like how java or dotnet need to be present in order to do java -jar myjar.jar or dotnet run mydll.dll
 
[Captain Obvious] Yeah that's because JVM code and MSIL are nowhere even near anything native
[Captain Obvious] LLVM's IR is much lower level than lava bytecode or msil, but it's still not native
 
as long as it isnt native, it needs to be interpreted
or converted
 
2:31 PM
[Captain Obvious] Exactly
[Captain Obvious] hence the backend
 
can a .exe contain anything other than machine code?
 
[Captain Obvious] EXEs can contain allsorts of crap
 
2:56 PM
[Captain Obvious] So it turns out I was just being retarded
[Captain Obvious] The 2 services weren't being hosted the same way at all, the host bindings were slightly different
 
3:27 PM
[mr5] An idea came to me but I don't know how it can be done.
[Li] Mood
[mr5] Ideas always flying above and it chose people randomly.
[mr5] Is Lee Butler and Li the same user?
[Li] Yes im totally the alt of that person
[mr5] I see
 
4:26 PM
[Captain Obvious] Yes we are the same person
[Captain Obvious] you caught me
 
YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAS
 
finally have a native linux image built on windows
 
[Captain Obvious] """""native""""""
 
iDunno
they named it "native"
> or you can build a native executable and use Amazon’s Custom Runtime if you want a smaller memory footprint and faster cold boot startup time.
if my assumptions were correct, it should reduce startup times from 6 seconds to 0.5 seconds
 
4:30 PM
[Captain Obvious] 6 sceonds?
 
ye
0.5 seconds should be relatively acceptable tho
 
[Captain Obvious] yeah that should be fine
 
it is only for cold starts tho
 
[Captain Obvious] How often is it going to cold start
 
although, that is assuming my assumptions are correct
but I still doubt that is going to be the case
 
4:31 PM
[Captain Obvious] If it's anything like this project then it'll be always on anyway so it'll never cold staret
[Captain Obvious] Which is good for this project too, because it takes ages to start
 
normal containers had an init time of 200ms and a cold start of 100ms with further invokes being 50 to 80 ms
so, ~300ms first, then ~65ms
but containers with network traffic, which used client libraries and weird shit had a 200ms init time plus a 6000ms cold start
 
[Captain Obvious] Wait so when would you experience the 65ms
[Captain Obvious] Or is that your app startup after the 300ms container startup
 
further invokes were 200ms
200ms container startup, 100ms jvm startup (and my code executing)
after that, 50 to 80ms of my code being executed
(assuming some simple in-memory processing)
 
[Captain Obvious] Does your code only do one thing?
 
my testing code does
but once that testing code invokes another function (it be hello world in this example, on a hot container), then it suddenly had 6000ms additional startup time
for which, the reason was difficult to find
people said that most of that time is due to how AWS Lambda handles the built package
it downloads the zip (containing the .dll files) or the jar (containing the .class files) and extracts it to its disk
then it loads those files into memory from that disk
but those have to go through the kernel
normally, you run a fat jar in java as one file, which causes it to be quite fast
in this case, it gets extracted and spread out over many files
 
4:39 PM
[Captain Obvious] Wait wtf why does it extract the class files from the jar
 
and because it lazily loads the files, I cannot all do it at the startup
iDunno
 
[Captain Obvious] That's so retarded
[Captain Obvious] Amazon pls
 
so, when I publish my first message to a message queue or invoke a different remote function, then it loads more classes from disk
that is why the first message publish and lambda invoke are slow
at least, as I have been told
now I have a running single-file binary specifically built for linux
now I need dinner
but after that, imma test how fast that will be
I hope for <1s cold starts
 
[mr5] please be 1 minute
 
:(
 
although, the 6s were already a bad case
 
[Captain Obvious] Yeah this is an old project
 
I used 1024mb as runtime capacity (which also determines the vcpu power)
 
[Captain Obvious] It's by a mile the slowest startup project we have
[Captain Obvious] .net (not core) is well known for having insane warmup times
 
turns out that <1769 is just using a partial vcpu
 
4:44 PM
 
I will probably use a 3gb setting cause it will be approximately the most cost efficient setting
being 3 times as fast already
so start ups will be 2s without native images
.net core (which we use at work) is also having heavy startup times
we are also looking at building native images for them
mostly when we use EF
because it is loading in many dlls lazily
 
mr5
Where are you hosting it?
 
both for my projects and work projects the idea is to not have to rely on warm containers
AWS Lambda
 
mr5
How much is the cost per month with your current setup? Or it depends on use?
 
it depends on use
currently, €0,00
I just paid €45,00 for a 3-year reserved VM
now the entire cost is at €0,00 per month
but the VM is only used for the connection and as sandbox
 
mr5
4:49 PM
What is your guess for the cost if it reaches a 5 minutes per day in a month?
 
it is not running all the other things
 
mr5
> €45,00
how much is this?
 
50 trigger per day?
 
mr5
4500? 45?
 
with the current setup, it is having a warmup call every 10 minutes... for each available function
 
mr5
4:51 PM
I changed the trigger to 5 minutes / day
 
I think about 60 functions are in the warmup list
so, 6 calls per hour per container
24 * 6 * 60 = 8640 invokes per day
times 31 days = 267840 invokes per month
I still pay €0,00
but that is because of the free tier
the actual pricing on that without the free tier would be...
$4,34
considering the
$0.20 per 1M requests
$0.0000166667 for every GB-second
 
mr5
So €45,00 is actually just €45 right?
 
ye
it is just how I format stuff
 
mr5
Weird grouping but ok
 
dutch grouping
1.000.000,00
 
mr5
4:56 PM
underscore grouping best grouping
 
if you want weird, go see french
(I think it is french)
1.00.000,00
like... how?
 
mr5
I've heard the way how they build their numbers. I'm expecting a weird groupings also.
 
four twenties and sixteen?
yes, that be ninety-six please
 
mr5
@Wietlol does this mean it will never cost you any as long as you don't outreach the quota?
or does it have any quota?
 
yep
AWS Lambda is a service with a permanent free tier
each month, the first 1,000,000 million invokes are free and the first 400,000 GB-seconds are free
so, that saves you up to... $0.20 and $6.67 per month
for me, I am closer to the invoke limit than the GB-seconds limit
so even if I break out of the free tier, it will be cents that I have to pay
the majority of the payment goes to EC2 (virtual machine) and RDS (database server)
they were free for the first 12 months
now I have to pay tho
but even then, the price is reasonable as long as I dont use on-demand instances
and if I dont use the same settings as the free tier had
for example, the free tier included 750 hours of EC2 t2.micro per month
now, I run a reserved t4g.nano
which is like... half of the capacity?
> Until March 31st, 2021, all new and existing AWS customers can try the t4g.micro instances free for up to 750 hours per month.
hmm... if I got the larger instance, it would be free tho
for a few months
 
mr5
5:21 PM
@Wietlol dang. I need to make an AWS account!
I think I can't do that in Azure
But Amazon discriminates our country atm.
I need a fake phone from different country. How can I do that?
 
6:03 PM
tbh, the free tier of Azure looks more promising
but I had the same feeling when I just started with AWS, so it might be not as good as I expect it to be atm
Azure doesnt have something similar to AWS Lambda tho
it has Azure Functions, but those seem to be more aimed at http services
AWS Lambda is a more low level version of that
Azure Functions is like AWS Lambda + AWS Api Gateway
 
@Wietlol There are other ways to trigger Azure functions...
Generally, I think AWS Lambda is a superior offering.
 
6:18 PM
ye, you can have it as a handler behind a message queue and other things, but the general assumption is that you use it as web service
so, it's design is primarily based on that
AWS Lambda's design is based on a function as simple as input -> output
depending on what event/trigger you are using, the input will provide all that context
 
6:46 PM
[Captain Obvious] Aws lambda = az functions
 
mr5
7:03 PM
GPT-3, can you fathom this image:
 
8:00 PM
> After some investigation, I discovered the reason: Lamdba unpacks the contents of the deployment package into its filesystem. Which means that an UberJAR turns into a lot of little files, each of which must be read using several kernel calls.
@CaptainObvious ^ source of what I said earlier... couldnt find it back then :D
 
8:38 PM
[Captain Obvious] Thats dumb
 
 
3 hours later…

« first day (3704 days earlier)      last day (1231 days later) »