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
Mircea NeacsuM

Mircea Neacsu

@Mircea Neacsu
About
Posts
1.1k
Topics
42
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • When programming was (still) fun
    Mircea NeacsuM Mircea Neacsu

    I got hooked to computers in mid ‘70s, at the end of the era of punch cards and program listings on accordion paper. At the start of the first semester in CS, I meet a friend from high school, a year older and also in CS who says:
    “I have a nice little problem for you. Write a program to find all the ways you can position 8 queens on a chessboard so that they don’t attack each other.”
    The only game in town at the time was FORTRAN, and there is no recursion in FORTRAN, and this was my first program so, obviously it didn’t work. Cocky, like most 18 years old are, I said to myself “sure it’s compiler’s fault, my logic is impeccable” so I started to look at the assembler code generated by compiler. The only problem was that I didn’t knew assembler, so I started to learn assembler. Now I couldn’t understand how the compiler knew what code to generate, so I started to learn about context-free grammars, LL(1) and LR(1) parsers, and so on. Never finished the stupid program, but by the end of my adventure, I was thoroughly hooked. And still am.

    The Lounge

  • Bubble sort was not what I thought it was.
    Mircea NeacsuM Mircea Neacsu

    It is "exchange sort" https://en.wikipedia.org/wiki/Sorting_algorithm#Exchange_sort

    Algorithms

  • You see where your innocent-seeming comments can lead...?
    Mircea NeacsuM Mircea Neacsu

    Use WSL. Download Ubuntu from Microsoft store and you have a pretty decent Linux box. That’s what I do to save me the trouble of having a separate Linux box.

    The Lounge

  • You see where your innocent-seeming comments can lead...?
    Mircea NeacsuM Mircea Neacsu

    @PIEBALDconsult as you seem to be a lot into PowerShell (bleh, can't stand the thing!), this one just appeared in my GitHub feed: https://github.com/PowerShell/PowerShell. Thought you might enjoy it.

    The Lounge

  • VS Copilot - Seeing is believing
    Mircea NeacsuM Mircea Neacsu

    One day I may expand this in an article or tip, but for the moment, just wanted to share my first experience with Copilot in Visual Studio.

    Context: writing a MTTQ client in C++ almost from scratch.

    One line summary: Wow!

    After logging in, Copilot started producing ghosted text suggestions, sometimes one line at a time, sometimes full blocks. For the most part it was very accurate and didn't go ahead of itself hallucinating code. It clearly knew a bit about the protocol itself suggesting for instance that a publish method should have a flags parameter. On the other hand, when validating a received PUBLISH packet, it fumbled the flags validation code.

    At times it was scaringly accurate: I had my packet sending code spread in various parts of the code with associated critical section locks and error checking. This morning I Visual Studio with the intention of grouping said code in one method. I just pressed "enter" in the header file and Copilot suggested erc send_packet (Packet& pkt);. I felt like it was reading my mind.

    In general reminds me of a time when I was doing pair programming with a junior programmer: I had to look over his shoulder and take control from time to time, but it saves so much time on repetitive code sections that is definitely worth it.

    C / C++ / MFC

  • Who is updating CodeProject? (public video or write-up)
    Mircea NeacsuM Mircea Neacsu

    Best of luck David and D2 team!

    Site Bugs / Suggestions

  • Encoding rationale
    Mircea NeacsuM Mircea Neacsu

    I think I may have found an answer to your question (thanks @Jorgen-Andersson for the link): with UTF-8 the first byte of the encoding indicates the number of expected continuation bytes.

    Your proposed system, I'll call it T-8 for brevity, is also somewhat less robust for initial sync if you are "eavesdropping" on a communication stream. You have to drop all initial bytes with 8th bit set up until, and including, the first byte with 8th bit clear. Only after that you can be sure that you are in sync.

    The Lounge

  • Not enough rep point
    Mircea NeacsuM Mircea Neacsu

    Thanks. Still early days! :)

    Site Bugs / Suggestions

  • Not enough rep point
    Mircea NeacsuM Mircea Neacsu

    Today I tried for the first time to post in the lounge. Post went into moderation queue as seemingly I don’t have enough rep points. It wasn’t happening in previous incarnation of this site. What are the new rep levels?

    Site Bugs / Suggestions

  • Encoding rationale
    Mircea NeacsuM Mircea Neacsu

    His proposal would fits the 1 and 2 points. If I understand it correctly, it allows you to encode 2^14 code points in 2 bytes vs 2^11 in UTF-8. On one side of the balance you have 15000 code points that would get a shorter encoding and on the other side, the drawbacks of yet another encoding standard. I think I'd vote for keep just one standard.

    The Lounge

  • Variables
    Mircea NeacsuM Mircea Neacsu

    trønderen wrote:

    class objects (instances), the compiler adds another "semi-hidden" field to hold a reference to the class definition object. The class definition is present at run time, and may be interrogated. The class definition is the type of the class instances.

    With the small caveat that classes need at least one virtual function to get this RTTI (Run-Time Type Information). Classes without virtual function members don't get this vtable member. Pretty sure this is standard required behavior, but I haven't checked. It is true however at least in the case of MSVC, the compiler I know best.

    Mircea (see my latest musings at neacsu.net)

    C / C++ / MFC performance question

  • Variables
    Mircea NeacsuM Mircea Neacsu

    To add just a bit more to the previous answer, in C/C++ you can even use the fact that memory is uniform, in other words there is no way of saying what is stored in a memory location. An union declaration is just a redefinition of the same memory area to be interpreted in different ways:

    union {
    char ch[4];
    int ival;
    } s;

    //...
    printf ("Size of union is %d\n", sizeof(s)); //should print "4"
    s.ch[0] = 'A';
    s.ch[1] = 'B';
    s.ch[2] = 'C';
    s.ch[4] = 'D';

    printf ("Integer value is 0x%x\n", s.ival); //should print 0x44434241 or 0x41424344

    The results of the second printf depends of the endianness of the machine (little endian vs big endian).

    Mircea (see my latest musings at neacsu.net)

    C / C++ / MFC performance question

  • Generate SHA256 Hash of every file on my computer.
    Mircea NeacsuM Mircea Neacsu

    raddevus wrote:

    2. It's super slow to use EntityFramework to insert those dir names into the sqlite db. Super slow means it takes more than 10 minutes.

    Take a look at my article[^] about sqlite multi-threading. Might give you some ideas how to speed up things.

    Mircea (see my latest musings at neacsu.net)

    The Weird and The Wonderful database learning csharp css sqlite

  • I know a lot of you nerds will like this...
    Mircea NeacsuM Mircea Neacsu

    To the best my eyes can see, there is no TARDIS. There are other Dr. Who ships like "Judoon rocket" and "SS Madame de Pompadour", but no TARDIS. The scale of the image might explain that: 1pixel = 10m, so the outside of TARDIS would be less than a pixel. But we all know it's bigger on the inside. :)

    Mircea (see my latest musings at neacsu.net)

    The Lounge javascript cloud csharp linq com

  • CodeProject email addresses appear to be down
    Mircea NeacsuM Mircea Neacsu

    Without any inside information, my bet is Chris and team cashed their chips and sold to a big corporation - after all CP should be a fairly valuable piece of web real-estate - and now the new owners are scratching their heads how to integrate this new thing in their corporate profile. Maybe someone has already found that it fits like a square peg in a round hole. If my scenario is right, I'd say well done for Chris, Dave, Mathew and the whole team! They've done an awesome work over the years and deserve their reward. The scenario is consistent with the complete lack of communication as they could be bound by some NDAs and the new owners still don't know what to say.

    Mircea (see my latest musings at neacsu.net)

    The Lounge design com graphics iot

  • 10 Pages of Pascal code vs 1 Shell script
    Mircea NeacsuM Mircea Neacsu

    It is a funny story but I'm sure you realize some details got swept under the rug. Beside, from the blurbs on the Amazon page you linked:

    Quote:

    Everything in software architecture is a trade-off. First Law of Software Architecture

    Some trade-offs: 1. The pipeline solution works only in *nix environments while Knuth's algorithm can probably be implemented on many platforms. 2. tr, uniq, sort and sed were all written by someone; maybe some of their cost should be added to the cost of the pipeline solution. Or, if the problem of finding most frequent words turns out to be important and frequently used, Knuth's program might become a new utility — dek. The new solution would than be "just use the dek command". 3. The anecdote doesn't say how big the text file is and how fast the solution should run. If you have to find the most frequent words in Encyclopedia Britannica in under 10ms, I doubt the pipeline solution would win the day.

    Mircea (see my latest musings at neacsu.net)

    The Weird and The Wonderful delphi visual-studio com linux algorithms

  • Commas
    Mircea NeacsuM Mircea Neacsu

    A short search through Unicode code chart shows Arabic comma, reversed comma, medieval comma, ideographic comma, Georgian comma, Ehtiopic comma, and so on. Sadly there is no Oxford comma :laugh:

    Mircea (see my latest musings at neacsu.net)

    The Lounge com question

  • Oh, yeah, that was why...
    Mircea NeacsuM Mircea Neacsu

    DOS, .NET, whatever... plus ça change[^] :D PS Believe it or not, I've survived 20+ years without touching .NET and I don't plan to start now :)

    Mircea (see my latest musings at neacsu.net)

    The Lounge csharp visual-studio announcement learning

  • Oh, yeah, that was why...
    Mircea NeacsuM Mircea Neacsu

    I've used NSIS for installers for years now. I don't particularly like it but it does its job and I've used the same template script for so long that I don't feel like changing it. In the end is just like you said:

    PIEBALDconsult wrote:

    Installers just aren't important enough to me to get me all excited about learning a new tool for creating them.

    Oh BTW: lately I've got into shipping one EXE applications just like in the days of good old DOS. They are fancy C++ thingies with an embedded HTTP server and all the UI done through a browser. All nicely packed in a single EXE that contains HTML, CSS, SQL, etc. It would probably make for a nice (and long) article but I don't see many people following on this path, so why bother!

    Mircea

    The Lounge csharp visual-studio announcement learning

  • I should not touch computers today
    Mircea NeacsuM Mircea Neacsu

    Sometimes the dragon wins :-D Dust off your hat, jump on the broom and fly again :laugh:

    Mircea

    The Lounge graphics design sharepoint com hardware
  • Login

  • Don't have an account? Register

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