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
E

Espen Harlinn

@Espen Harlinn
About
Posts
2.9k
Topics
374
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • To be fair...
    E Espen Harlinn

    Quote:

    unless you provide adequate references to the original source.

    And the original source of something that ChatGPT generates is what? It is not ChatGPT... I hope we can agree that ChatGPT is not capable of any kind of thinking, and I imagine that in the near future we will have a number of similar solutions that generate contents that will be published on the net somewhere. My guess is that these solutions will start to learn from each other, and there will probably be some really weird results.

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    The Lounge javascript com code-review

  • Characters no longer on here
    E Espen Harlinn

    Quote:

    I miss Ali (DeathByChocolate)

    Right, it's a pity she doesn't post any more - but who knows, perhaps she is just lurking …

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    The Lounge hosting cloud question

  • Download failures
    E Espen Harlinn

    Good idea, done :-)

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions csharp com sysadmin tools question

  • Download failures
    E Espen Harlinn

    Quote:

    Could you possibly package up the project into smaller, logical zip files?

    The purpose of the solution is to have a general purpose 'runtime' for C and C++ development based on open source for 64-bit Windows development that just works. Breaking it apart would add significant complexity, and suddenly I would need a package manager to manage the various dependencies.

    Quote:

    If the user has poor or slow internet, this file will be an issue for them

    True, but most developers regularly download archives that are way larger.

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions csharp com sysadmin tools question

  • Download failures
    E Espen Harlinn

    Hi, Gisle Vanem[^] reported that there are problems downloading article code, Download failures[^] :

    Quote:

    Please provide another download location; GitHub? Trying to download Harlinn.Windows-2021-12-90.zip in Chrome has now failed 4 times. Try to restart the D/L seems to restart from the beginning. Buggy "Range" support at Codepoject's HTTP server?

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions csharp com sysadmin tools question

  • Regarding the 10 MB source code archive limit for articles
    E Espen Harlinn

    Chris Maunder wrote:

    Please email submit@codeproject.com and Sean will look after you.

    Ok, I will do that once the text for the article is ready.

    Chris Maunder wrote:

    Has everything that can be removed, been removed? eg DLLs that can be recompiled, unneeded .obj or debug pdbs etc?

    For certes … Best regards Espen Harlinn

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions csharp c++ visual-studio com tools

  • Regarding the 10 MB source code archive limit for articles
    E Espen Harlinn

    Hi, I was about to create an article, and was unable to upload the accompanying source code archive. The size of the archive file is just shy of 79 MB, and contains the source code for a single Visual Studio 2022 solution with 437 projects. 120 of those projects are open source C and C++ libraries that have been modified to some extent, allowing them to be compiled with the /std:c++latest and /Zc:__cplusplus compiler options. Among things included are protocol buffers, gRPC, abseil, skia, angle, spirv-tools, spirv-cross, rocksDB, armadillo, SuperLU, Imgui, implot, boringssl, gdal … Is it possible to change the limit to 100 MB? Best regards Espen Harlinn

    Espen Harlinn Chief Architect - Seasurveillance AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions csharp c++ visual-studio com tools

  • C++ code formatting problems
    E Espen Harlinn

    Quote:

    Second one should not give formatting problems.

    Since we are talking about code examples, my guess is that most people would expect them to compile …

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • Azure HDInsight
    E Espen Harlinn

    Honest hindsight would be a huge leap forward, but I guess that is too much to hope for ...

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    The Lounge cloud question

  • C++ code formatting problems
    E Espen Harlinn

    Here is the contents of a header file that seems to be causing some problems, as the preview does not show anything at all:

    #pragma once
    #ifndef __HCCPERSISTENT_H__
    #define __HCCPERSISTENT_H__

    #include
    #include
    #include

    #pragma pack(push,1)

    namespace Harlinn::Common::Core::Persistent
    {
    class TypeDescriptorCursor;

    /// /// A sequence is a variable length encoding where data of the same type
    /// is stored in blocks. Each block is of the same size (SequenceBlockSize = 8)
    /// and is trailed by a byte holding the number of used slots in the 
    /// preceding block. The space not used by an element inside a bloc must
    /// be set to 0. A sequence ends with the first block that is not full, thus
    /// an empty sequence contains one block with all the bytes set to 0 and the
    /// trailing size byte set to 0.
    /// 
    constexpr size\_t SequenceBlockSize = 8;
    
    /// /// The minimum number of bytes required to hold a valid
    /// type description
    /// 
    constexpr size\_t MinimumValidTypeDescriptorDataSize = 4;
    
    enum class ModifierFlags : Byte
    {
        None,
        /// /// Indicates that type element is for an array of data. 
        /// 
        /// /// 
    
        /// If used without the ::Fixed modifier, the data representation
        /// starts with a 7-bit encoded number specifying the number of elements
        /// in the array.
        /// 
    
        /// 
    
        /// If used with the ::Fixed modifier the lenght of the fixed-size
        /// follows immedeately after the TypeElementHeader as a 7-bit 
        /// encoded number.
        /// 
    
        /// 
        Array = 0x01,
        /// /// Indicates a fixed number of elements
        /// 
        Fixed = 0x02,
        /// /// Constant data trails the declaring type description element.
        /// 
        /// /// If used together with the ::Array modifier, then the
        /// ::Fixed modifier must also be specified.
        /// 
        Constant = 0x04,
        /// /// Indicates that the data is stored in big-endian
        /// format.
        /// 
        BigEndian = 0x08,
        /// 
        /// Indicates that the data is encoded in a way that al
    
    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    Thanks Nelek, I've seen it before :-)

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    Quote:

    Interestingly the issue was you had the "Use Markdown" checkbox checked

    Right, noticed that after Richards post. Unchecking 'Use Markdown' seems to work for most cases. Now, here is another, probably unrelated, formatting issue:

    long long value = 1'000'000'000;
    for(long long i = 0; i < value; ++i)
    {
    ...
    }

    and this would probably look better with a bit more color:

    template
    inline constexpr bool IsReference = std::is_same_v< std::remove_volatile_t> , std::remove_reference_t>>> == false;

    template
    concept StreamIO = ( StreamReader && StreamWriter );

    template
    concept StreamSeek = requires( T t, long long offset, SeekOrigin seekOrigin )
    {
    { t.Seek( offset, seekOrigin ) }->std::convertible_to;
    };

    template
    concept StreamFeatureTests = requires( T t )
    {
    { t.CanRead( ) } ->std::convertible_to;
    { t.CanSeek( ) } ->std::convertible_to;
    { t.CanTimeout( ) } ->std::convertible_to;
    { t.CanWrite( ) } ->std::convertible_to;
    };

    But you are essentially right, unchecking 'Use Markdown' seems to do the trick :-)

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    That is probably worth an attempt …

    #include

    #include<std.lib>

    'Use Markdown formatting' still interferes with how the text inside <pre>...</pre> element is interpreted, and so it seems like the solution I was looking for is rather simple: Uncheck 'Use Markdown formatting'. Hopefully this will also be the case for the article editor.

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    Great, I have been planning to write a couple of articles since February, so for me this is a real showstopper.

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    That is my guess too … my gut feeling is that if markdown was disabled for anything between <pre ...> and </pre> then the problem will be solved.

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    I was using:

    <pre lang="C++">
    </pre>

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • C++ code formatting problems
    E Espen Harlinn

    I was hoping that someone would fix the C++ pretty printing code. In an ideal world, I would like to just embed plain C++ code in an article or answer:

    #include

    Currently; even pasting, and then choosing encode as HTML runs into problems:

    #include <stdlib.h>

    Yesterday I tried embedding some code in a reply, [The Lounge](https://www.codeproject.com/Messages/5813474/Re-Talk-about-demoralizing), and as all can see, this did not work all that well. Best regards Espen Harlinn

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    Site Bugs / Suggestions c++ html com help

  • Talk about demoralizing
    E Espen Harlinn

    I guess you do a bit of rounding then? If you do, it may be that it is possible to improve that by a lot of bit-fiddling … On x64 I've seen significant performance improvement, between 20% and 300%, for the following: isnan, isinf, signbit, frexp, min, max, trunc, round, clamp and lerp I have no idea about how well this will work out for an ARM cpu, but here is the core of my implementation (Sorry about the formatting, paste and encode as HTML doesn't work well for C++ code anymore :(():

    template
    struct FractionWidth;

    template <>
    struct FractionWidth
    {
    static constexpr UInt32 value = 23;
    };
    template <>
    struct FractionWidth
    {
    static constexpr UInt32 value = 52;
    };

    template
    struct ExponentWidth;
    template <>
    struct ExponentWidth
    {
    static constexpr UInt32 value = 8;
    };
    template <>
    struct ExponentWidth
    {
    static constexpr UInt32 value = 11;
    };

    template
    struct ExponenBias;
    template <>
    struct ExponenBias
    {
    static constexpr UInt32 value = _FBIAS;
    };
    template <>
    struct ExponenBias
    {
    static constexpr UInt32 value = _DBIAS;
    };

    template
    struct InfinityUnsignedValue;
    template <>
    struct InfinityUnsignedValue
    {
    static constexpr UInt32 value = 0X7F800000UL;
    };
    template <>
    struct InfinityUnsignedValue
    {
    static constexpr UInt64 value = 0x7FF0000000000000ULL;
    };

    template
    struct NegativeInfinityUnsignedValue;
    template <>
    struct NegativeInfinityUnsignedValue
    {
    static constexpr UInt32 value = 0xFF800000UL;
    };
    template <>
    struct NegativeInfinityUnsignedValue
    {
    static constexpr UInt64 value = 0xFFF0000000000000ULL;
    };
    template
    struct QuietNaNUnsignedValue;
    template <>
    struct QuietNaNUnsignedValue
    {
    static constexpr UInt32 value = 0XFFC00001UL;
    };
    template <>
    struct QuietNaNUnsignedValue
    {
    static constexpr UInt64 value = 0x7FF0000000000001ULL;
    };

    #pragma pack(push,1)
    template
    struct FloatingPoint
    {
    using ValueType = std::remove_cvref_t;
    using UIntType = MakeUnsigned;

    static constexpr Int32 FractionWidth = static\_cast( Internal::FractionWidth::value );
    static constexpr Int32 ExponentWidth = static\_cast( Internal::ExponentWidth::value );
    
    static constexpr Int32 ExponentBias = ( 1 << ( ExponentWidth - 1 ) ) - 1;
    
    st
    
    The Lounge algorithms

  • I'm stunned at how stupid EntityFramework is
    E Espen Harlinn

    Quote:

    I have been maintaining your code for a decade now, and I really HATE you!

    IMHO: If you work for a decade doing plain CRUD, without automating the process, you should probably look for a different profession …

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    The Lounge database com question

  • I'm stunned at how stupid EntityFramework is
    E Espen Harlinn

    Quote:

    But I can understand why people use Dapper

    It will still underperform compared to using the drivers directly - which, as we all know, isn't all that hard.

    Espen Harlinn Senior Architect - Ulriken Consulting AS The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.Edsger W.Dijkstra

    The Lounge database com 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