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
Y

YvesDaoust

@YvesDaoust
About
Posts
148
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Course Selection? Discrete Mathematics, or Machine Org/Assembler Language?
    Y YvesDaoust

    Assembler language is no rocket science, you can learn it by yourself. Here is an accelerated course: Your processor has registers (int and float), it performs arithmetic & logic instructions (taking two or three operands); operands are in registers or taken from/to memory through simple address computation; memory holds a special area called the stack (lifo); you can "label" the instructions and jump to them, unconditionally or based on the result of the previous instruction (sign, overflow); there are special jumps called "calls" from which you can jump back later.

    Solve:
    load f0, K[0] // Read coefficient A
    load f1, K[1] // Read coefficient B
    load f2, K[2] // Read coefficient C
    load f3, f1 // Copy B
    mul f3, f3 // Square it
    mul f2, f0 // Multiply C by A (C overwritten)
    mul f2, 4 // 4.A.C
    sub f3, f2 // B.B - 4.A.C
    jmp neg, Done // No root
    push f3 // Push the argument onto the stack
    call Sqrt // Call the square root function
    pop f3 // Get the return value, Sqrt(B.B - 4.A.C)
    sub f3, f1 // - B + Sqrt(D)
    mul f0, 2 // 2.A
    div f3, f0 // (- B + Sqrt(D)) / 2.A
    store X, f3 // Write the root
    Done:
    ret // Return control to the caller

    If you were able to follow that code, you can move on to the Discrete Mathematics course, for which no accelerated version is available. :)

    The Lounge java visual-studio help question learning

  • Craziest fix that actually worked
    Y YvesDaoust

    Well, this is not the craziest fix but the craziest bug hunt:

    MaxValue= 0;
    for (I = 0; I < N; I++)
    {
    Value= SomePositiveFunction(I);
    if (Value > MaxValue)
    {
    MaxValue = Value;
    MaxI = I;
    }
    }

    This piece of code obviously finds MaxI, the first index I that achieves the largest value of the function (in case of ties), doesn't it ? Well, no. It was returning the last such index ! The reason was internal FP rounding, making it such that right after the assignment MaxValue = Value, the relation MaxValue < Value did hold !! Took me ages to understand that, debugger not showing what was actually going on. The fix: use the /fp:precise compiler flag.

    The Lounge help com database sysadmin question

  • Some People Shouldn't Be Allowed to Use a Computer
    Y YvesDaoust

    The explanation is obvious: the guy has no network access and can only send mail from the neighboring cybercafé, using Papernet for transfers.

    The Lounge help

  • Some People Shouldn't Be Allowed to Use a Computer
    Y YvesDaoust

    Teach them that the PDF can be OCR'ed :)

    The Lounge help

  • Misaligned elephants
    Y YvesDaoust

    Matthew, it is hard to believe that you get different behaviors with all build options being identical. Shouldn't you double check that ? It is also hard to understand the value 16. shorts are never 8 bytes long, are they ? Could it be a struct member alignment option silently set in a preceding header file ?

    The Weird and The Wonderful c++ question

  • C Specification Ideas
    Y YvesDaoust

    Just a few little things: - binary format specifier in printf format strings (i.e. printf("%03b", 3); saying 011). - array/struct initializers in place of variables, allowing expressions like Weight= { 1, 2, 5, 7 }[i]; - token pasting operator ## even outside macro definitions, like:

    #define Prefix Test
    Prefix##Data= 0;

    - built-in min and max operators, they are so useful !

    a= (i /\ j /\ k) \/ 3;
    X\/= Y;

    - <math> functions ifloor and iceil returning integer instead of floating-point.

    The Lounge linq hardware beta-testing functional

  • They are stealing my life
    Y YvesDaoust

    I noticed a trend on several free sites, like YouTube, to postpone content delivery with preamble ads that last from a few seconds to a few more seconds. Not counting the fact that this changes my well-established habits, I hate it: they are stealing bits of my life, exploiting my web-induced addiction to videos. I promise I'll quit. What about you?

    The Lounge question

  • Bug of the day
    Y YvesDaoust

    This is one of the dangers of C syntax (and friends). That's the price you pay for willing conciseness. Block-only statements like VB's

    If Condition Then
    Statement
    End If

    or Modula's

    IF Condition THEN
    Statement
    END

    are safer.

    The Weird and The Wonderful help

  • (Open)VMS - the end of an era
    Y YvesDaoust

    Sad news. Future generations will miss it, and they won't even know. In my opinion, the last OS to be documented at all ;-) I have been missing the Digital Command Language for decades :-(

    The Insider News csharp com tools question

  • Productivity Wars
    Y YvesDaoust

    When you are developing a long lasting product, using third party components has several risks: - you can face a bug all of a sudden and get in deep trouble - usually at the worst moment - because there is no maintainer available (the company went out of business, the freeware project died or you can't afford the cost); - trying to fix a bug yourself from open sources can be a nightmarish endeavour; libraries can be huge and written by gurus in the least readable way; architecture documents are often unavailable; all you can do looks like quick and dirty hacks; - adding a feature of your own when required is an assault course as well; - packages are often overfeatured for your needs; you'll have to carry a monster (redistribute it and complexify your installers) for the rest of your life; - big packages are sometimes so complex that the effort it takes to master the API and comply with it may not be worth; - last but not least, portability is the main thing; my code needs to be compatible with all MS compilers from VC6 to VC2012, as well as gcc, and future compilers; if a third party library fails to support one of these - which is quite likely to arise -, I can get in big trouble; and this is unpredictable and out of my control. When dealing with your core business, integrating black boxes is not so reasonable. In the long run, you need full mastership of your source code.

    The Weird and The Wonderful help css com business collaboration

  • Big risk
    Y YvesDaoust

    When you are developing a long lasting product, using third party components has several risks: - you can face a bug all of a sudden and get in deep trouble - usually at the worst moment - because there is no maintainer available (the company went out of business, the freeware project died or you can't afford the cost); - trying to fix a bug yourself from open sources can be a nightmarish endeavour; libraries can be huge and written by gurus in the least readable way; architecture documents are often unavailable; all you can do looks like quick and dirty hacks; - adding a feature of your own when required is an assault course as well; - packages are often overfeatured for your needs; you'll have to carry a monster (redistribute it and complexify your installers) for the rest of your life; - big packages are sometimes so complex that the effort it takes to master the API and comply with it may not be worth; - last but not least, portability is the main thing; my code needs to be compatible with all MS compilers from VC6 to VC2012, as well as gcc, and future compilers; if a third party library fails to support one of these - which is quite likely to arise -, I can get in big trouble; and this is unpredictable and out of my control. When dealing with your core business, integrating black boxes is not so reasonable.

    The Weird and The Wonderful json help asp-net business

  • Range notation
    Y YvesDaoust

    What about [a [b, completely nonstandard ? Generalizes to [a [b [c ... in case of several contiguous ranges. Or more complex configurations like [a [b] c].

    The Lounge database discussion graphics question learning

  • Worst Exception!!
    Y YvesDaoust

    "the application has failed to start because its side-by-side configuration is incorrect" This one gives me nightmares because so far I have been unable to troubleshoot it. The application refuses to start, that's it. No clue on what DLL was missing/of invalid type or whatsoever. Quite efficiently contributes to the arcane mysteries of .NET technology. One more instance of what harold aptroot said.

    The Lounge performance question

  • I've switched back to Chrome
    Y YvesDaoust

    It is hard for me to imagine a browser being better or worse than another. I just use them to display web pages. All of them do display web pages. Speed of dislay does not matter, as it is mainly page transfer which is the bottleneck. I don't care about the menus, I don't use them. Even less about the graphical design. I don't see any distinctive feature. Maybe just one: FTP access is a crap under IE and Chrome. I haven't tried with the others... :)

    The Lounge mobile adobe question

  • Programmers Today
    Y YvesDaoust

    I have been using C++ for 20+ years. I was forced to practice .NET a little, but I keep exerting substantial resistance. No doubt I will abstain from using the C++11 features for the next 10 years, both by taste and as a necessity: real-life people (or call them customers) tend to lag far behind thanks to the inertia of legacy code, and long term portability is a must. (I was recently asked to retrofit my software to 15 years old VB6!)

    The Lounge com

  • Intellisense
    Y YvesDaoust

    Intellisense in Visual Studio 2003 has impressive smartness: it runs a Nefarious Mode able to keep sleeping for days or weeks and then pops up all of a sudden to freeze the entire IDE. Need to kill the process and loose all recent work. From then on, it keeps crashing every time you dare to type in similar code, or just hover over some devil-possessed word. Just enough to ruin your day. Besides that anecdotic annoyance, I find that Intellisense under C++ is much less helpful than under C#, as it does not anticipate right-hand side of assignments based on type compatibility. In addition, it seems to stop working as soon as the slightest syntax error occurs in the text before, even though local inference remains possible.

    The Lounge visual-studio help announcement

  • My first language and interesting early software projects.
    Y YvesDaoust

    Join the club ;-)

    The Lounge delphi csharp c++ css hardware

  • My first language and interesting early software projects.
    Y YvesDaoust

    Wilkes in person, wow !

    The Lounge delphi csharp c++ css hardware

  • My first language and interesting early software projects.
    Y YvesDaoust

    Not involving a programming language, but I want to recall this anecdote. My very very first program was a procedure to quickly compute cube roots on a 4 operations calculator:

    // Store the argument to memory
    MC
    M+

    // Repeat
    *
    MR

    Sqrt
    Sqrt
    // Until convergence

    Convergence comes in about 14 iterations for an 8 digits display, for a total of 72 keystrokes. On some machines, the = operation is not required.

    The Lounge delphi csharp c++ css hardware

  • My first language and interesting early software projects.
    Y YvesDaoust

    My very first computer programming language was FORTRAN IV on an IBM 360. (I could also mention my beloved Texas Instruments SR-52 wonder, but I am no more sure it came first.) The first useful program was a function plotting utility, character-based, outputting on A3 sized pin-fed sheets with a chain printer. This program was used for real. I never saw the computer, I was living 50 km away from it.

    The Lounge delphi csharp c++ css 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