Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

lmoelleb

@lmoelleb
About
Posts
473
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to get image Thumbnail without open it?
    L lmoelleb

    Some file formats allow embedding a thumbnail in metadata. For example JPG allows it in the EXIF data section. Not all image formats support this, and even if they do, not all images will have it. And even if it is present, the quality might not be sufficient. I have not looked at it for years (decade+) so have no code nor libraries, but maybe googling "EXIF thumbnail c#" or similar will help.

    C# tutorial question

  • I came into this with a vague plan, and I don't quite know where to go with this
    L lmoelleb

    The major values you are adding are: 1) Users who pick up your library now will get the new version and will get fewer breaking changes down the line. 2) Users already using your library will have longer to adapt to the new version, giving them more time to experiment with it and align it with their releases. As a developer I would not consider these two points "small". Just make sure you communicate clear what is in the release.

    The Lounge announcement hardware performance help question

  • I have anxiety now...
    L lmoelleb

    It seems you are under the impression I am preferring local time instead of UTC time. I do not. I prefer DateTimeOffset over DateTime. With DateTime you have to be carefull not making mistakes. DateTimeOffset eliminates several of these possible mistakes.

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    A local time in c# does not represent a unique point in time as it can't store A and B times when transitioning from daylight saving time to standard time. So once you go from local to universal... Good luck. But sure, maybe they chose an implementation that happens to always work in that specific case... But just realizing this is not clear is enough for me to stay clear of that problem.

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    The main advantage is that it natively protect against mistakes. It does not use the same logic internally as DateTime - it stores the offset instead of DateTimeKind. You never have to deal with DateTimeKind.Unknown (primary reason for mistakes I have seen). You never have some database layer having to be told if it is local time or utc. If some idiot use local time... Then nothing happens because it still accurately represents a unique point in time - no matter where in the world that local time was used.

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    Oh, that is clearer then. Funnily enough I can't really find any better reason to make a decision than avoiding developers making mistakes.

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    Why would it be a bad idea to store DateTimeOffset? The way to store date/time I have the most experience with is DateTime stored as UTC. But I see no reason to go back to that - what is the benefit?

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    Yet I have seen a developer I would clarify as highly competent do "DateTime.Now.ToUniversalTime()". I have seen code break because it did not handle DateTimeKind.Unknown and some upstream code changed. Yes, it is quite simple, yet mistakes happens.

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    You said it was not a great idea? I agree it is hard to clasify as "great", just an extremely simple way to minimize a problem.

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    Why would it be better to use DateTime than DateTimeOffset? Edit: and why would you not want to minimize the possibility of doing stupid things?

    The Lounge javascript cloud csharp linq com

  • I have anxiety now...
    L lmoelleb

    I use DateTimeOffset instead of storing in UTC. Too many things can go wrong in the conversion when using DateTime. I have seen highly experienced developers doing stupid things like DateTime.Now.ToUniversalTime()

    The Lounge javascript cloud csharp linq com

  • Oh Microsoft, you dullards....
    L lmoelleb

    A colleague once installed the wrong version of VS on a fresh Windows version. Once he saw the uninstall (lack of) progress indicator he did the smart thing and wiped the disk and reinstalled Windows.

    The Lounge visual-studio sysadmin sales announcement

  • Visual Basic 6 did this, why can't you, C#?
    L lmoelleb

    It does allow multiple "entry points", so case 1: case 2: Some code break; So it can't just assume a break. Sure they can come up with rules for how it would be interpreted, but kind of glad they didn't.

    The Lounge csharp c++ help question

  • Communication "Server / Service" for older .NET Framework application
    L lmoelleb

    Did you try this approach: Using TLS 1.3 from .NET 4.0 Application – Medo's Home Page[^]

    C# csharp dotnet com design sysadmin

  • How to start creating a WinUI project ?
    L lmoelleb

    A Google for: devexpress winui tutorial Led me to this page: Getting Started | WinUI Controls | DevExpress Documentation[^] Have you tried following that?

    C# visual-studio wpf tutorial question

  • Unit Testing... yay or nay?
    L lmoelleb

    Funny how experience can be different. For me, unit tests speed up changing code.

    The Lounge testing beta-testing question

  • Unit Testing... yay or nay?
    L lmoelleb

    Sometimes I am lazy and skip them - typically when I am not quite sure I have the main "flow" worked out. It gives a short term benefit not spending time on them, but of course that has to be paid later - so I do at least make sure to write decoupled code that I can easily add the test. If I am reasonable certain of the flow, I write the test along with the code (sometimes even before as TDD, but that is rare). It is often much faster to itterate over a code block in the test than running an application. And of course, when I do go back and write the tests I skipped I find a bug or two.... In general it works as an investment: loose an hour writing a test now, or waste a day at a later time due to lack of tests... Sometimes the hour now is worth more than the day in the future. It only becomes a problem if the cost of the day in the future isn't even considered when skipping the test.

    The Lounge testing beta-testing question

  • (Current) AI Rant.
    L lmoelleb

    Besides AI getting it wrong: 1) If you have concurrent writers to the queue you do not know something else does not insert a new "last" item after you checked what it is. This can of course be solved with some locking, but then we are at the next point: 2) If you do not have concurrent writers you can just capture the last item to a variable as you enqueue it.

    C# data-structures csharp visual-studio ai-models ai-coding

  • (Current) AI Rant.
    L lmoelleb

    The good thing about the new "AI" tools is that they always give a reasonable and convincing looking answer.... especially when they are wrong.

    C# data-structures csharp visual-studio ai-models ai-coding

  • .NET's Sometimes Nonsensical Logic
    L lmoelleb

    Wikipedias page on Empty set[^] shows the properties of an empty set - which defined this behavior. Personally I would have been very surprised if All() on an empty set would ever return false - as I one or another time managed to get "everything applies to all elements in the empty set" stuck in my head. :D

    The Lounge csharp visual-studio question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups