« first day (3062 days earlier)      last day (2112 days later) » 
00:00 - 16:0016:00 - 00:00

user10864482
00:17
no one heh
01:32
Should Cryptography be in Architecture or Foundation
 
3 hours later…
mr5
mr5
04:38
I think I am wasting resources here. Can I use the same stream to return here?
 
3 hours later…
07:33
ohayou
08:06
yo yo
@mr5 Streams aren't necessarily "resources", as such. A stream represents a view over a sequence of bytes, but doesn't necessarily tell you what those bytes are.
In this case, this FileWrapper you're returning just holds a file stream, meaning it's just a pointer to a file, and reading from the stream will perform the I/O operations over it. On one hand, no resources are used until it's read. On the other hand, if this is read more than once, you'll perform (potentially slow) I/O operations more than once.
08:21
What resources are you worried about wasting here? The save-to-file operation probably uses some resource internally, like byte[] buffers, but I won't be surprised if they're reused.
mr5
mr5
08:33
@AvnerShahar-Kashtan just the stream. I'm aware it's just a pointer to some resources. Since I am saving the content to a FileStream, would it be more efficient if I just returned the one from the original stream? In this case, the stream came from Network (await'ed HttpClient.Content.ReadStreamAsync()) I am not just sure if it's a memory stream or still an open socket stream.
@mr5 Streams aren't reusable.
mr5
mr5
Well, some say I could just reset its length to 0
The underlying data might be (for instance, the byte[] underlying a MemoryStream) but streams themselves shouldn't be treated as reusable.
mr5
mr5
So that's the way to go then?
Yeah. Don't worry about streams. They're disposable, anyway. Pump'em and dump'em.
The original stream was a NetworkStream retrieved from the HTTP response - it doesn't exist anymore.
mr5
mr5
08:40
I'm having an issue with that approach. If the FileStream is already opened, I get an Exception. I'm on a different task right now so I just skipped this from now.
That's not about streams, it's about how file I/O works. Reusing the filestream won't help - you can't have two concurrent reads from the same filestream.
mr5
mr5
It's returning different FileStreams though
Same thing. FileStreams are just wrappers over file IO, and if file IO doesn't supprot concurrency, that simply won't work.
mr5
mr5
I'm suspecting I can't do multiple reads on the same file
You can do this in several ways:
1. Cache the file contents to memory, so you can easily share access to it. Pros: fast access, multiple access. Cons: Can be very memory intensive.
2. Fine-tune your file IO. When yuo do `File.Open`, you can specify file modes.
If you know that you only need read access, you can specify the sharing mode, meaning that the file IO won't lock the file.
mr5
mr5
08:44
Oh. So the first time I create the file, I am setting also its RW?
After all, if you know you won't be changing the file, there's no reason not to allow access to other processes if the file is, effectively, immutable.
mr5
mr5
I'm the one creating the file
See the overloads for File.Open - one takes both a FileMode, FileAccess and FileShare enums.
File.Open(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read) will allow others who open it with similar parameters to access the file concurrently.
But it will cause subsequent attempts to open it for writing to fail.
morn
08:51
!!morn or mornmorn
@Hans1984 morn
mr5
mr5
@AvnerShahar-Kashtan what does that mean?
!!mornmorn or murnmarn
@Hans1984 mornmorn
08:52
ok
!!morn or mourn
@LeeButler mourn
Today I shall do something I haven't done in weeks. I shall go forth and write new code. Not bug fixes. Not small tweaks in preparation for a product milestone or client demo. I shall write new code for a new feature. Yay!
oh RIP
!!Are your mourning ?
08:52
@Hans1984 Probably
mr5
mr5
What combination of modes should I set in order to Create|Read|Write|ConcurrentRead?
lol probably
@mr5 When you open a file, you can set locks on it. If you open a file for reading, you don't want someone else to go and change the file while you're reading, so you can set a lock on it that prevents opening it for writes. But you don't care if anyone else reads from it, so you allow reads.
only a bot would answer this way since it cant mourn
In a different scenario, you might open a file for reading but disallow other reads. Why? Maybe you're reading in preparation for a write, so you don't want someone to read soon-to-be-outdated data.
@mr5 You have two different phases there, don't you - one writing the downloaded file, closing the write, then returning read-only stream right?
mr5
mr5
08:57
@AvnerShahar-Kashtan yes. Once I have downloaded it, I will never write on it again. Probably a file replace but not overwrite
@AvnerShahar-Kashtan 'tis a prize you were never meant to possess
*Ghosts whirl around monitor*
`face-melting.gif`
@TomW No! It has been promised to me! I have paid my dues, done things - horrible things - in preparation for this exaltation!
spectral shrieking
lol
:D
09:30
Status update: I have not yet started work on the new code because of crashes in some old code. Hubris shall, once more, be my undoing.
Heavy re-code and re-structuring
So delays the quest for new code by another week
@AvnerShahar-Kashtan smug.gif
muffled shrieking
10:09
@AvnerShahar-Kashtan rip you, you will create a new feature that makes even more bugs you need to solve
He doesn't write bugs
He's a Senior
@Wietlol Yes! I want to fix new bugs in new code! Not the same old bugs in the old code!
@TomW Yes, by definition my bugs are actually quirky little undocumented features .
hmm... havent thought of that
good point
@TomW he is a senior, he knows he writes bugs
juniors make the mistake of assuming that there are no bugs
Sure boss, I can fix this bug easy. I've fixed it dozens of times before.
@TomW You think you're joking, don't you?
But right now we have this ongoing situation where occasionally one of the security camera feeds would get corrupted and cause a crash. So we're slowly collecting those weird feed corruptions and preventing them from crashing our app.
I talked to a guy in the Windows Media Foundation team about it, he said "hey, there shouldn't be any problem to support RTSP natively, it's a simple enough protocol and we support it". So I sent him 4-5 cameras we work with. His repsonse was "Oh, we don't support that combination. Oh, and not that profile for MP4 video. Oh, and that isn't even a valid video frame there". Because protocols are nice, and standards are nice, but actual cameras do whatever the hell they want.
10:16
@TomW I have a recursion bug, I have fixed it 100 times, but every time I fix it, it comes back 10 times
groan
Then you need someone big enough and ugly enough to be prepared to fight with the hardware vendor
@Wietlol I have a null-terminated string problem®”gý”gý”gýâútýgýâúbý—gý”gýgý³¡dý“gý³¡cý•gý³¡týgý³¡wýågý³¡eý‌​•
ew, null terminated strings
@TomW Not necessarily an option, since we're planning to sell this product to orgs that already have existing camera infrastructure, meaning we need to be able to accept any feed. I don't mind not being able to display the feed when it's crapped out, but I just need my client not to crash on an unmanaged memory violation.
10:58
Ok, sure, the cameras now crash occasionally again and our latest server release failed to deploy to ServiceFabric for unknown reasons, but hey, that shouldn't prevent me from writing my new goddamn code for my new goddamn feature.
11:44
hey, if you're on service fabric
ideal architecture to be able to try out different codec libraries in a bunch of agents, and see which ones are successful
bin the one that breaks all the time
12:05
Nah, the server is on SF, but the camera codecs are on the client.
Hello guys
any Azure and Certificate "expert" here? :)
0
Q: How to handle client certificate in Azure

MarkusWe have an application running on a VM in our service fabric in Azure. To communicate with one of our partners RestAPI we need to use a client certificate. (_restClient.ClientCertificate = ...) So my first attempt was to add the Certificate (pfx, including a private key) to our Azure Key Vault....

I certainly am an "expert"
hehe great!
@AvnerShahar-Kashtan which part is the part that's broken?
expert squirrel
;)
12:19
@Markus need more information. What exactly does the REST API expect you to do with the certificate?
Is it expecting a TLS client certificate, or a signed body, or something else?
Oh sorry I see the code snippet
Yes, I don't know what you are asking, but if I read the certificate from a file it works great, but when I get the certificate from the Key Vault, it doesn't (and the certificate doesn't contain the private key)
I think the right place is to get an X509Certificate2 from the certificate store on the host machine. From the question you referenced it sounds like Key Vault is not the right place
HM, that doesn't sound right, thinking about it. You can download a private key certificate from the portal, I'm sure of it
I've done it
I guess they mean that's a portal feature and there's no API for it
Mind the quotes
I never said I was an expert
12:34
Although this seems to say you can stackoverflow.com/questions/40151705/…
@TomW Both! Neither! All!
@Markus I'm trying it out.
That's right, you can download it, but not from the API as it looks
13:01
Seems to work for me.
If you have a certificate in your vault, it has a property Secret Identifier. Call GetSecretAsync against that with a valid token and you can construct an X509Certificate2 from it like in the link I pasted earlier. I haven't tried to use it to make an HTTP request but it does construct a cert with HasPrivateKey=true
The application has to have the right policies set up, I chose Key, Secret and Certificate Management when I created it
 
1 hour later…
14:10
The stack service name "Service-Example-[object Object]" is not valid.
thank you, Jakarta Script
Hi! :)
Is there a good soul that could've help me with creating a good feature folder structure?
It's quite opinion-based, thats why I decided to write here instead of creating a question.
14:25
@TomW Hmm, I'm amlost certain my had HasPrivateKey = false, for sure the PrivateKey property was empty.
Maybe it's the policies...
@Markus did you generate it in the Key Vault or import it?
mr5
mr5
void Something(..., CancellationToken cancellationToken = default)
Is this new syntax?
NO that's been a feature forever
Optional parameters
mr5
mr5
I used to write ..., CancellationToken cancellationToken = default(CancellationToken))
And by "forever" I mean a while
14:31
default == default(T)
Ohhhhhhhhh. I don't know about that specifically
in your case, default(CancellationToken)
mr5
mr5
Oh
Why is the VS I used in office doesn't suggest that?
Only in VS2019
Because intellisense is Thicc
@mr5 C# 7
7.2 maybe?
14:33
C# 17.2
C#++
mr5
mr5
Nah. Too lazy to figure out which version I am using.
Java#++
I'm new in C#, so I'm asking for your understanding.

In a brief. I created functionality that parse from different files to objects, and then do something with parsed object.

I created 3 very basic class structures:
- FromCsv (object to parse csv to this object)
- FromText (object to parse txt to this object)
- FromPdf (object to parse pdf to this object)

I also created Interface `IParser` with 3 implementations:
- CsvParser
- TextParser
- PdfParser

And I created `facade class` that choose correct implementation and do some magic with them.
(see full text)
imo, parsing functions should be exposed as functions
but whatever
14:37
Feature?
Implementation?
FromCsv
I would suggest
Feature/Parsers/CsvParser
Feature/Parsers/IParser
Feature/Parsers/TextParser
but what is feature anyway
that
@misha130 irrelevant placeholder
@misha130 you can replace feature as ImportUser
technically on a bigger scope of things I'd put it into something like Services/Parsers/...Parser
14:40
@degath you should ask yourself, do the parsers belong to this feature alone?
or are they just service objects that this feature uses?
mr5
mr5
@degath why is the parser under DTO?
@Wietlol they are parsers for only this feature, so I belive they belong to them.
@mr5
mr5
mr5
Agree with Wiet. Parsers should go under services.
It's in a feature folder, but after @Wietlol suggestion I moved IParser to the other parsers.
@degath can you show the implementation of CsvParser? (just curious)
Test execution time: 1,630 Seconds
0.o?
1.63 seconds or 1630 seconds?
mr5
mr5
14:47
that's why people should stop using ,(comma) as a digit separator.
obligatory
drives me crazy that most euros use the separators the opposite way round
@Wietlol yes, give me a second. But it's quite big. Don't be shocked :P
Well it's CSV, so it's clearly 1 instance of 630 seconds
@Wietlol bro do you even significant digits
!!tell deg format
@deg Format your code - hit Ctrl+K before sending and see the faq
14:51
    public class UserFromCsv : IUserParser
    {
        public bool DoesAccept(string fileExtension, byte[] attachmentBytes)
        {
            const string csvExtension = ".csv";

            return fileExtension.Equals(csvExtension) && GetUserFromCsv(attachmentBytes) != null;
        }

        public List<PrivilegedUser> Parse(aba_beholdningslinje byte[] attachmentBytes)
        {
            return PrivilegedUsers(GetUserFromCsv(attachmentBytes));
        }

        private static List<UserFromCsv> GetUserFromCsv(byte[] attachmentBytes)
(see full text)
@TomW euros are the standard, everything else is weird
@MikeTheLiar sorry.
No worries
@Wietlol no euro, no euro, no you're the euro
csv.Configuration.Delimiter = ";";
@MikeTheLiar no u
!!giphy marge simpson disappointed
Well phooey.
TIL "CSV" stands for "semiColon separated value"
Column Separated Values
wait, what?
"comma-separated values"
comma,separated,values
14:54
"Comma" does not mean "arbitrary character that I decide on a whim"
definitely not the weirdest delimited file format
you see semicolon used a lot though anyway
CSV has a standard, or at least, a widely accepted one.
@degath why do you have UserFromCsv?
does that imply you also haveUserFromText? and UserFromPdf?
The best flat file formats are the ones which change mid-way through the document
I love those.
14:56
@MikeTheLiar it's funny you should say that, because I was having an argument against Wietlol some time ago about how csv widely varies
and he says the standard is with semicolon :P
rofl
He's a.....special case.
I think something should be said for there not really being a standard
@Neil NO NO NO NO NO!!!
I DID NOT!
CSV is used as COMMA
@Wietlol I can look it up you know
escaped values are enclosed by double quotes
14:57
@Neil in lieu of an official standard, I think in this case "whatever Excel does" is good enough
record separators are newlines
@Neil there can be a standard, but it doesn't mean a lot if nobody obeys it
double quotes, commas and newlines demand the value to be escaped
What about escaped values which themselves contain double quotes?
if I ever write contracts
14:58
@MikeTheLiar I think that's as close to a standard as we'll ever get
@Neil the good news is that Excel doesn't use fucking semicolons
there will be a provision that if we ever find a behaviour that doesn't conform to standard, we can force you to fix it out of band for free
otherwise you owe us a financial penalty
@TomW a standard that isn't followed is like a theory which is proven wrong
my elementary school follows the standards that they annually create each year
very well
14:59
I separate the fields in my csv with "ಠ_ಠ"
I'd have thought you'd have taken the upgrade to Premium by now
@Neil emoji or GTFO
💩SV
≖_≖
If you're not using ‮ are you even trying
@Wietlol

Let me explain you the logic behind it a little bit more.
Maybe my name convension sucks, but:

I have Pdf, Txt, Csv file.

In Pdf I have properties like: userFirstName, userPhoneNumber, userAddress and I want to create PrivilegedUser that will have all of those fields.
In Csv I have properties like: userFirstName, userAddress, userHeight, userAbilities and I want to create PrivilegedUser that will have all of those fields.
In Txt I have properties like: userFirstName, userAddress, userAbilities and I want to create PrivilegedUser that will have all of those fields.
(see full text)
15:04
but why?
@MikeTheLiar if at least one of your internal tools hasn't been converted to use poo-delimited files by the time you leave I'll be very disappointed
what is the difference in behavior or usage of a PdfUser and a CsvUser?
hmmm, I think you opened my eyes.
I did 3 different objects, because e.g.
I have field UserName in Pdf, Name in Csv and FullName in Text.
But maybe there is a way to map all inputs into a single object instead of 3 different.
Thanks!
if things are being used equally, you should have one data class for them
the convertion from csv to that data object could use a translation tho
mr5
mr5
@MikeTheLiar holy. This is the moment I realized what does the CSV stands for.
15:11
Most people seem to think it's "Character that I just randomly chose Separated Values"
@Wietlol he should probably have a class for the internal mapping of the csv to a class
and then mapping a class to a class
that is one solution
then you should use an adapter
and... INTERFACES!
hides before Neil jumps in
Seems my error was that I created 3 mappers instead of 1 :/ You're all right.
so... question: does anyone use jenkins?
@Wietlol a bit
mr5
mr5
15:15
I wish there was a Dialogflow that I can just tell to make me an interface
@mr5 poof! You're an interface.
jrh
jrh
I have kind of a silly trivia question, why don't // comments support XML styled features like <see, etc? I can see why Microsoft didn't do that for C/C++ because it might cause unintentional effects (because C/C++ didn't have <see/etc. from the start) but didn't .NET always have <see? Why did they make /// instead of just adding the features to // since it was a new language anyway?
hypothetical question: imagine a setup of 200 microservices, all with the exact same deployment pipeline... is it stupid to make one pipeline and make all 200 services * 4 stages use that one pipeline?
@jrh so you can have comments that aren't picked up by the docstring parser
@Wietlol That's an interesting question. My gut says no, that's not stupid.
@mr5 I wish I had warnings on every method that isnt exposed via an interface...
oh wait, I do have that
jrh
jrh
15:17
@MikeTheLiar does the docstring parser pick up comments without a category like <summary> though?
If any of those microservices deployment process changes though, I think you're in for a world of hurt
@MikeTheLiar my fear is the tooling, for example a visualization tool of the deployments
Don't start changing requirements now, it's far too late for that.
could I easily list/show the last builds of each stage of a particular service?
mr5
mr5
@Wietlol everytime I hear pipeline, I always thought of a plumber
15:18
questions like that
@Wietlol I think it has a matrix build template, so there can be like, one pipeline with many modes
it's been years since I used it though
mr5
mr5
@Wietlol I wish interface are named contract
@jrh Intellisense doesn't but there are tools out there that generate documentation for you that do
@mr5 same
@mr5 my language uses contract class
because interface is too broad
15:19
wouldn't call it a class though
interface in Java for example is covers:
mr5
mr5
oh. yeah. let's build a language where singletons, factory, DIs are built on top of the language
contract class
module class
trait
mr5
mr5
@Wietlol drop the class
i might
15:19
lovely day today, innit
but everything is a class tho :)
mr5
mr5
how about you rename class into model?
user10864482
good morning
@mr5 my initial idea was "blueprint"
but I was like "meh"
@mr5 you could probably say all of these are memes
of todays software
15:21
At first I was 😂 but then I 😐
jrh
jrh
@MikeTheLiar ok, wasn't aware of that. Thanks, makes sense, that explains why // exists. Maybe using <see in a comment in the middle of a function is a rather unusual use case I adopted. It's handy though (IMO).
mr5
mr5
@Wietlol or blueprint instead of interface. that could work also
also... @mr5 my language has some weird magic shit that makes libraries able to provide language support for their stuff
@mr5 a class is also a blueprint
mr5
mr5
@misha130 that's a dream not a meme
oh yea, I remember why I went for class all the way
mr5
mr5
15:22
like ultimate dream of hardcore abstractors
because I take classes more abstract
@jrh well there's also the simple fact that C# was specifically created to try to lure C++ programmers over to the dark side
microsoft is the dark side?
interfaces in... lets say Kotlin are classes in my language
Also literally every other C-style language supports //
15:23
classes the way Java or C# have them dont exist any more
a contract class would be a class with certain limitations
mr5
mr5
@Wietlol how about you rename abstract class into a single name?
like just abstract
those limitations make it valid as contract
@mr5 meh
why though
mr5
mr5
I mean, don't you want to be consistent.
what do you call to "multiple keywords" again?
multiple keywords that resolves in a single keyword?
single names for all data modelling
if I wanted to be consistent, why should I not call everything a class?
mr5
mr5
15:28
when you combine two keywords, it just adds complexity to the language.
from the top of my head
class
	// default object blueprint

contract class
	// object blueprint without allowing implementations to strongly couple data or implementation to the type

module class
	// a class module, allowed to be included in other classes

trait class
	// a class decorator

enum class
	// a class with only compile-time known instances
I could rip the class keywords from all except the actual class
oh, wait, I forgot abstract class
mr5
mr5
don't you think the class just adds noise there?
jrh
jrh
@MikeTheLiar Yeah but is it worthwhile to have comment backwards compatibility? It's not like you can copy/paste C/C++ code into C#, and even if you did, anything in // is ignored by the compiler, the worst you'd get by enhancing // is a false positive ref; besides that setup is already highly fragmented due to all the different IDEs for C/C++.
im not sure
it is debatable, for sure
I could try removing the "class" keywords there
mr5
mr5
I'm still trying to recall the CS jargon, that when a keyword combined to another formed another meaning
15:31
composition?
mr5
mr5
@Wietlol No. I think the word starts with "di...". I'm think diacritic but it's not.
@jrh hmm. I think it's just a C++ thing
It's diagraphs and it's not keyword but operators.
so that trait class is a decorator over the constructor of the original class?
jrh
jrh
C++ seems to call virtual a specifier?
15:37
Hello
I used the C# XML /// documentation feature to document my code. Now, how would I go ahead and 'extract' that documentation to a document?
from those coments.
mr5
mr5
@jrh what does the C# called it?
user10864482
mr5
mr5
modifiers?
@Wietlol do you also plan to make an IDE?
@J.L.Louis there's a setting in Properties > Build > Output > XML documentation file
it's not particularly readable so you'll have to feed it to something else
Sandcastle (SHFB) linked above is one
NDoc, Doxygen, GhostDoc are alternatives
mr5
mr5
if so, please make a feature that, when I ctrl+click on a symbol, it would open a browser and redirect me to SO
C# documentation is a blatant lie.
It was never useful for me.
I always end up searching on the internet what the symbol means.
user10864482
15:45
true story: working on a +- 20 years old app. No documentation. Really strong naming convention but still a pain in the butt. 4 releases a year (including fixes and new features)
@mr5 not before I finished an LLVM generator
im trying to replace antlr in the build process rn
so I am stuck with doing left recursive pattern rules
but when that is done, I have a full build process completely cross platform
the output is what I call a "program instruction declaration" which contains very simplistic instructions, which I should be able to convert to any build target (JS, wasm, llvm, etc)
but llvm is a bish
@mr5 when you [ctrl]+[click] a symbol, it will go to its declaration
I will provide a keymap where you can edit the keybindings
but that one in particular will not be editable
it will be hardcoded into the program
mr5
mr5
@User23332 and every year new developers maintain it?
@Wietlol when you do, please just use the IntelliJ. It's configurable
user10864482
@mr5 yes. Including some contractor that come and go
I think I use ctrl q for documentation
@mr5 you mean just using intellij? or copying intellij?
@jrh it has nothing to do with backwards compatibility and everything to do with familiarity
mr5
mr5
15:51
@User23332 I'd imagine the code base to be a total mess.
(intellij is the best IDE I have seen so far, but I still get annoyed by some things)
user10864482
@mr5 you imagine right
(also, making a plugin is really annoying)
mr5
mr5
@Wietlol personalize IntelliJ according to your language. Android did the same way
wait, IJ is open source?
mr5
mr5
15:52
I'm not sure. I think Google bought a license for it.
android studio is made by jetbrains afaik
mr5
mr5
@User23332 why did you say something positive to it earlier: "strong naming convention"?
Yes. I think IntelliJ is the base of all of their IDEs
@Wietlol I'm not sure about that.
hmm... its actually not in the ide list
user10864482
@mr5 yes it is positive . The naming convention is very strong and mostly followed by everyone . And because of our process even if not followed it is corrected by fellow devs trough peer review . It is not that bad but it lead to situation where just to find the way to a perticular screen it take a lot of time.
AS is made by google
mr5
mr5
15:56
Can't find it.
user10864482
but there is also part of the code where its a completely lalaland.
mr5
mr5
Maybe Google bought a license for it then configure the IDE to suit the language and platform.
mr5
mr5
Well, even if they outsourced it they could still claim they're the one who did it.
Same for all the mobile apps we made.
00:00 - 16:0016:00 - 00:00

« first day (3062 days earlier)      last day (2112 days later) »