« first day (3666 days earlier)      last day (1265 days later) » 
00:00 - 14:0014:00 - 21:00

user14200771
12:03 AM
Anyone know how to retrieve multiple images from Amazon s3 using one imagePath at once?
 
user14200771
My current code:

public async Task<(string url, Image image)> GetAWSPreSignedS3Url(entities.Cafe cafe, string mimeType, Constants.ImageType type)
        {
            AmazonS3Client s3Client = new AmazonS3Client(_appSettings.AWSPublicKey, _appSettings.AWSPrivateKey, Amazon.RegionEndpoint.APSoutheast2);

            string imagePath;
            string cafeName = trimSpecialCharacters(cafe.Name);
            var cafeId = cafe.CafeId;
            Image image;
            switch (type)
            {
 
user14200771
12:44 AM
or even if it's possible to get all images in a particular folder e.g. Business_menu/{cafeId}/{images}.{mimetype}
 
1:13 AM
 
user14200771
1:30 AM
haha what is happening
 
mr5
2:55 AM
@d4rk4ng31 hey. I think I'm going to be in the same page as you. I'm hearing a lot of scaffolding words.
 
mr5
3:06 AM
never mind
iz working now
 
 
1 hour later…
4:22 AM
@mr5 hey
what was the issue?
 
mr5
the code generator
 
yes, but what is the error?
*was
@mr5 The requirements had been captured kinda wrong
 
mr5
did it compiled though?
@d4rk4ng31 something 'Microsoft.Bcl.AsyncInterfaces'
 
@mr5 Yes
@mr5 hmm
 
mr5
I just re downloaded the EF Core packages and it worked on the 3rd try
 
4:34 AM
lol
 
mr5
I might have actually installed the pre-releases, idk, can't remember.
 
last I remember, it worked after I reinstalled visual studio
 
mr5
why would you not have VS in the first place
 
@mr5 re
 
mr5
I misread. my bad
 
4:50 AM
:)
 
 
1 hour later…
mr5
6:58 AM
I would like to put that in a single query but I can't think of the right keyword to search for it.
 
you have probably a bug in that query:
{
X = point.X,
Y = point.Y,
Dx = point.Dx,
Dy = point.Y <-- Shouldn't be .Dy?
}
 
mr5
ah yeah
 
7:16 AM
You could do a single query doing:
List<int> entryIds = (from reg in caveQuery select reg.Id).ToList();
and changing your where statement
where entryIds.Contains(cave.Id)
 
mr5
lul
just implemented it and was going to ask if it's valid
so this is where the LINQ query syntax shines huh
it's much readable compared to method syntax
 
Nah, avoid doing subqueries, they do work but hurt performance
 
mr5
what would be the efficient way?
 
With your first query and my change
That would make only one data access with no subqueries
I have not checked if your second query is valid, but this forces subqueries:

.Points = (from pt in context.Point
for each CaveDto you are doing an aditional query to context.Point
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
mr5
7:25 AM
o/
 
morning rodent
 
mr5
@Cleptus it looks like this is just another subquery too
 
@Cleptus who did you call ro?!
 
No, my .ToList() only gets the data that was already fetched from the database
 
mr5
would there be a difference if I started my SQL to:
"SELECT * FROM Point ...<followed by joins>"?
as oppose to "SELECT * FROM Cave ...<followed by joins>"
 
7:29 AM
And even if caveQuery was not in memory but database, the total amount of queries would be 2 not N (being N 1 + the number of caves).
 
mr5
caveQuery is IQueryable still
 
Total amount would be 2 then
 
@mr5 wadafaq is this 😂😂
hillarious
async .ToListAsync
Also make only 1 db call not vor every item in the foreach
g2g
seeing oyu guys later
 
mr5
now you see him now you don't
@Squirrelintraining I've stolen it from 9gag kek
@Cleptus afaik, IQueryable is suppose to be deferred right? What happens if I mutate one of its value during enumeration?
the thing still looks subquery to me
 
There is a difference between doing two queries (2 total queries) and having a subquery (O-n)
 
mr5
7:39 AM
ah gotcha
 
Thes both queries with data in the database and a profiler in the database to check what would happen when there are many caves
 
That foreach (var entry in caveQuery) is introducing N database queries
 
mr5
ah wait
@Cleptus can you give more hint how to integrate the two queries?
I came up with an ugly solution using that, and probably slower as compared to the subquery I did earlier.
 
gtg, have several hours of documentation to do, sorry
 
mr5
7:53 AM
o/
thanks
 
\o
 
8:24 AM
o/
 
8:35 AM
~o~
Am now in Zoom call with 180 students and professors.
 
mr5
@Squirrelkiller time to shine
 
They told us to keep the cameras off :/
 
@Squirrelkiller lul
where have you been all this time killerino?
 
AC Rogue and Battle Royal in VR mostly
If anyone has VR here: Take a look at Population: One, it's basically Fortnite but in first person and VR. Pretty awesome: You climb, you fly (with your arms!)...I love it.
It's also cross platform
So doesn't matter which VR headset you have
 
okay kids am in meting gl hf
 
8:48 AM
meeting bad
 
mr5
 
9:19 AM
Hey @mr5
How's the scaffolding coming along?
 
mr5
scaffolding just means code generator right?
 
Yep
 
I think the whole code generation thing is an awful idea in general
 
Why>
*?
 
if you can write a program that can generate code, then you could have written code that eliminates said boilerplate code
 
9:23 AM
No
It does not eliminate boilerplate code
 
oh? care to give me a counterexample?
 
It literally creates a templated boilerplate code!
Have you ever used it?
 
mr5
the only reason I'm using code generator is because I'm new to ASP
 
I've used tools which generate code before
 
@Neil Well, I agree partially with you
 
9:26 AM
I see why it's useful, but it's compensating for a lack of support in the language you're using
 
You see, as Herb Sutter has said, using defaults is not dumbing the process down
So, if the code generator generates good code, I don't find anything wrong with using it
Though everyone have their opinions :)
 
there's nothing wrong with the generated code per se, it's that you need it to begin with
 
Yeah, that I agree with
 
mr5
I've heard that name before
I think he's from C++
 
If the generator is good enough, and creates flexible code, that's an awesome generator
 
mr5
9:30 AM
oh yes he is
 
@mr5 The guy who created MSVC
Also, I wanted to know if teaching programming to a complete newbie (with 0 background in computers) by teaching him to make games is a good idea. I don't know of anyone who learnt to program by creating games, neither did I; that's why I ask :)
 
mr5
that's actually the path I've taken.
 
Even for a 14yr old (my lil bro)?
 
@d4rk4ng31 I wouldn't recommend it. I started out in C/C++ in game modding and I had an awful time.
 
mr5
I started from developing input/output game in console just for fun, then it leads me to create more
 
9:33 AM
No, video games
@Hozuki Even I had that opinion
 
mr5
@d4rk4ng31 with graphics already?
 
@mr5 In python!!!
 
@d4rk4ng31 That said, the most important thing is his interest in the outcome... if he's totally into games and dedicated to making a certain thing, it can work... but games is the most difficult example and likely to discourage
 
there's some aspect about programming in C++ that's really fun though
Not sure if it's having full control of pointers or what
It has been a while since I used it though
 
mr5
nice. so you want your brother to be a nerd huh
 
9:35 AM
Well, what I feel is that, when you learn a language, you want to learn the language and not just the logic. By language, I mean, the intricacies and the various concepts of the language. I feel, this kind of learning will not be language centric
 
mr5
introduce him to basic console first. If showing a "hello world" on a console excites him, then that's the flag.
 
@mr5 Well, I ain't gonna teach him, he's gonna learn from a programming class
 
mr5
does he really wants it?
 
@d4rk4ng31 I'm the complete opposite. I don't think the language matters at all. It's all about learning how to think logically and solve problems to come to a desired outcome.
 
@mr5 yeah, mostly because for such a small thing, you kinda have to get excited to want to fully emerse oneself in this field
 
9:37 AM
@mr5 Yes
 
@Hozuki I disagree. If you try to learn a language expecting it to work like every other language you've familiarized yourself with, you'll be disappointed at best and not see why it's useful
 
@Hozuki Umm... maybe, but that's when you are trying to learn a concept in programming (like Problem Solving with OOP using C++/JAVA). When you just want to learn the language, it needs to be language centric
 
To understand the strengths of a language, you kinda have to really understand what it does best
 
@Neil Agree 100%
 
Hmm, let me clarify. If you don't have a goal, something you wish to create, there is no point to learning the language. If the language has concepts you don't need to get to that goal, you shouldn't have to spend the time to learn those concepts. In the end, a language is a tool, a tool that brings you to your goal. You need to learn to work your tool, but you don't learn the tool for the sake of learning the tool.
 
9:40 AM
DAMN FRIGGN MEETINGS
taking away all my produciton time
 
you write a program using the tool to learn the tool, but I would argue that there is merit to just learning the tool just for the sake of learning the tool
 
@Hozuki Hmm... You need to have a goal. That is right. But, you also need to know if you can achieve that goal with the given tool. Trying to unscrew an Allen's Screw with a spanner is generally a bad idea :)
 
mr5
@Neil I thought every other (high) languages was derived from C++, now, when I learned about making methods as properties, I can't help to think how other languages managed to do it elegantly knowing that in C++, it's really messy. So, I think I've focused too much on the language rather than the logic.
 
@d4rk4ng31 Sure, but most modern languages all can do the same shit. It's like having 10 different hammers that are all just a little different :P
 
@mr5 You kinda just have to categorize language concepts into a generic language thing or a C++ thing, and go from there
It's nice to pull examples when learning a language from other specific language syntax, but it can also mislead you at times
 
9:44 AM
@mr5 Well, in C, it was dirty, in C++, a little less dirty, in JAVA kinda elegant, in C# and Python, nicely elegant... That's called evolution
 
mr5
I forgot to say that was my thinking before I dive into other languages.
 
and you have to learn several languages before making that distinction clearly in your mind
 
+1
@Neil Exactly, so, when you learn a new language, its usually just the same concept with a different syntax (unless the concept was newly introduced by the language of course)
Well, anyways, I'll see how this goes with him :)
Thanks a lot guys :)
 
Hi guys
what is the best way to UNIT Test
c# API
and azure function too
?
also .net core API
 
The best way to unit test...? Is to write a unit test...
What are you asking?
 
9:56 AM
yes
to write Unit test
for developers
 
mr5
PostCave(Cave cave)
the Cave model is direct model from the db
Should I change that to the DTO instead?
I feel like I'm over complicating this by using foreign keys here instead of an actual model.
 
@underscore by doing it lul
@mr5 it's easy to fall into that trap
TRAAAP
 
mr5
did I fall into the trap?
is there a way to convert DTO to database tables?
 
maybe
who knows
duno what yu mean by that.
Map(dto, entity);
mb
also automapper succs
 
mr5
I mean, to auto generate the tables for me (or SQL)
yeah, automapper succs
manual mapping ftw!
 
10:08 AM
AHU
@mr5 I still don't get the question 😂😂
do you mean code first=?
 
So our college has its own Gitlab instance
 
10:22 AM
But why
 
Nice
@CaptainObvious big cocc reasons
 
Nice attempt at dopdgionig feeds
Jesus christ what the fuck was that
dodging
 
mr5
10:52 AM
is this how a usual insertion of data in EF looks like? gist.github.com/mr5z/14d3023934f4bacc80c5c01d09288964
the foreign keys are cyclical and I think I would be needing to call context.SaveChangesAsync() twice.
 
open tab..
see `wtf.cs`
close tab
 
11:19 AM
tf they changed the google calendar icon lol
 
Yeah no you've cocked that up
 
yet another coworker got the virus weee...
 
Bet you're happy you're not in the office
 
@Freerey murrica is nr°1 afgain
 
USA IS THE BEST AT EVERYTHING
 
11:30 AM
@Squirrelintraining what does that mean?
oh nvm
why would you spell it like that?
 
@Freerey lul
@CaptainObvious yes
 
#1 for most expensive healthcare, military spending, covid cases, covid deaths, etc
 
I've been telling my countrymen to stop spending so much on military, but they keep telling me I'm a commie who wants us all to die
"enjoy your hegemony"
 
@CaptainObvious don't forget #1 in hollywood hits
 
I've always thought that America's biggest defect is that your average American thinks that being critical of your country is not being American, when really it's the contrary
fanaticism is not what made American a great country, but reason and science
 
11:36 AM
American culture is so much of an ouroboros that the guy who said we should have a revolution every 25 years is the same one who put in a clause that says the president shall use military on his own people to protect himself
 
^ 😂😂😂
america and culture
😂😂😂😂
good one 👍
 
^^"I can't trust my own people to have specific kinds of knives without a goddamn permit"
I'm assuming you're from the UK
if you're from Germany, "Half-Life is scary so we censored the military grunts by replacing them with robots"
 
did they really replace the military grunts with robots?
 
yes omg -- the German version of hl1 is hilariously bad
up until a couple years ago Germany had a heavily censored version
if you killed one of the scientists, instead of dying they would sit down and shake their head at you, then disappear
 
😂
 
11:44 AM
like I think even the guy who panics and walks over the tripmine ("oh my god, we're doomed!") does the same thing
 
Scientist trips the mine, sits down, shakes his head, and disappears forever.
every generation there's some new thing that younger generations latch onto that older generations assume is the root of all evil
in the 70s it was Led Zeppelin and in the 80s it was MTV
in the 90s internet, 00s it was cell phones
I'm waiting for the point where I'm the older generation and I disapprove of something new that I don't understand
 
10s it was social media
but usually it is some music trend that gets demonized
it felt like Lil Pump and these other rappers who promote violence were the "root of all evil" last decade
 
that has never been the cause, and frankly it's a little naive to assume it could come from a single source like that
 
nah you right
like in the late 90s people thought nu metal was the root of all evil and that genre died quick
 
mr5
is this okay or am I over complicating things again? gist.github.com/mr5z/a4ff5a4faa5fef5fb5437c155246b832
this is the DTO I'm trying to match: gist.github.com/mr5z/10d8015800f572a95c18235a85527264
 
11:58 AM
@Freerey watch yugi-oh
 
I did when I was 6....didn't like it
 
mr5
boo
 
@Freerey so you know what censorship is
litereally the 2nd 4kids search
 
oh yeah I know how 4kids censored like crazy
but at least I can say that 4kids was catering to children; hl1 was rated M at least
 
mr5
12:13 PM
now let's see if they can censor this: Summons internet in attack position
 
Want some more censorship/adjustment laughs? screenrant.com/cardcaptors-sakura-censored-america
They butchered that show. :-D
 
https://codewithshadman.com/generics-in-csharp/
>shadman
 
mr5
Americans really like those silly and funny-looking characters e.g., Cow and chicken
 
cow&chicken was just a ren&stimpy ripoff
 
mr5
12:32 PM
How do I tell EF in which table does a particular object gets inserted into?
Say I have this: class Test { int Id, List<Model> models, ... }
how does models get saved here without manually/directly saving it to the table it belongs to?
table == DbSet<Model>
 
12:47 PM
What area you trying to acchive hooman?
 
mr5
1:05 PM
see, I only have foreign keys in my tables, but in the C# model, they are actual objects.
those foreign keys are auto incremented in SQL server and before inserting them to db, I need to set those first. So I'm heading into a solution that will require me to call `context.SaveChangesAsync()` multiple times.
just so I can retrieve the auto-generated IDs
I also found out that I can wrap them into a transaction, but still doesn't remove the invocation of context.SaveChangesAsync() mutliple times.
and now I think I'm doing this wrong.
 
@mr5 Look up EF Code first foreign keys.
If you have an int FooId {get; set;} and { virtual Foo Foo {get; set;} it should detect that automatically
--> It detects the foo and insterts it to
 
mr5
@Squirrelintraining ahh thank you
 
np brah
glad 2help huumans
 
mr5
I was actually just searching "code first ef core" that's why I didn't see it the first time lol
 
and rip theri eyes out
I mean eat ther nuits
 
mr5
1:14 PM
thanks squirerles!
 
Yeah, eat hooman nuts
tasty
 
mr5
mmm
the virtual keyword is the key!
 
1:36 PM
aaaaaaa
my prop shortcut has died
I'm having to manually write {get;set;} like some sort of pleb
 
Restart VS. VS goes wonky and needs to have a little lie down
 
@mr5 not reeally afaik
@CaptainObvious lol
resharper?
 
Thinking prop is a VS shortcut though I have R# installed too
 
prop/s are VS snippets, yes
@CaptainObvious Have you tried pressing ctrl+j
 
It's fine I don't need it now
I only needed to write like 6 new props
Maybe it's because I had to turn r# off yesterday and then I turned it back on before
 
00:00 - 14:0014:00 - 21:00

« first day (3666 days earlier)      last day (1265 days later) »