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
O

oggenok64

@oggenok64
About
Posts
28
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Comma operator considered harmful
    O oggenok64

    I'm glad to say that i like this code :-) No horror there i my opinion.

    - oggenok

    The Weird and The Wonderful graphics game-dev question

  • warning C4706: assignment within conditional expression
    O oggenok64

    I've never seen this code before but assume it must be TKSpell. Yes, it's a horribly long conditional, but the code layout and comments make it reasonably clear as to what's happening. I know that i'm going to offend a lot of people, but a large function is not, repeat not, in itself a sign of bad programming. If the routine does exactly one well defined thing, it doesn't matter how large it is counting lines of code. And now i hear the refactoring crowd shouting at me. OK guys, you spend your time refactoring. I spend my time producing good solid production code.

    The Weird and The Wonderful help

  • More on string comparison
    O oggenok64

    However unlikely, things that CAN happen eventually WILL happen. Illogical or not.

    The Weird and The Wonderful csharp

  • More on string comparison
    O oggenok64

    Straight out of a C# Unified Communications code sample from MS:

    if (string.IsNullOrEmpty(customMessage.Trim()))
    ...

    The Weird and The Wonderful csharp

  • My first rant in a long time...
    O oggenok64

    "object-oriented design is the roman numerals of computing." -- Rob Pike

    The Lounge question csharp wcf oop tutorial

  • Is this how we deprecate now?
    O oggenok64

    I like that! A former collegue of mine had a tendency to use very long and elaborate variable/function/method/property names. One day i invented an unused property called __AVeryLongAndLargelyUnusedProperty_PKA. PKA being his initials. Need i say that i forgot all about it. The thing went into production, until years later PKA one day yelled at me: What the shikes is this?

    The Weird and The Wonderful com question

  • Something's out of round here
    O oggenok64

    Holy Lord.

    The Weird and The Wonderful c++

  • 3 way byte merge
    O oggenok64

    Looks like an ideal case for some loop unrolling. If say bmp.Width is always even, the inner col loop could be rewritten as

    for ( int col = 0; col < w; col += 2 ) {
    *imgPtr++ = *b++;
    *imgPtr++ = *g++;
    *imgPtr++ = *r++;
    *imgPtr++ = *b++;
    *imgPtr++ = *g++;
    *imgPtr++ = *r++;
    }

    saving half the overhead of loop management. C# doesn't allow fallthrough in switch statements, otherwise Duffs device would be perfect here. - turin

    C# csharp c++ graphics json performance

  • lineCallbackFunc not returning message..... [modified]
    O oggenok64

    You need to open a TAPI-device before you can receive any events - use lineOpen. Most likely you will wan't to preceede that with lineNegotiateAPIVersion and lineGetDevCaps.

    C / C++ / MFC delphi json question

  • String with \r in the end
    O oggenok64

    Now i understand why they call it careless return :-) - turin

    Clever Code help c++ debugging json

  • Unsigned/Signed
    O oggenok64

    Yes, it should most definitely be doing this! What you are assigning to a variable is a bit pattern - not a value. Whether the variable is signed or not is a question of interpretation. Your interpretation! Assigning a negative constant to an unsigned variable is perfectly legitimate. As Tim Craig pointed out, you should trust your beloved and most obedient servant - the compiler. All compilers will warn you about signed/unsigned mismatch. - turin

    C / C++ / MFC c++ question

  • 558 Lines Of QuickBasic Glory
    O oggenok64

    Straightforward Basic code and not even close to a horror in my opinion. The purpose of the routine is clear, there are no wacky algorithms, and it's easy to locate an error, if say a "j" is not being displayed correctly. And yes, I know that "Else If" would have been preferable and a "Select ... Case" even better.

    The Weird and The Wonderful com question

  • One of those bad days and now i find stuff like this...
    O oggenok64

    Future enhancement perhaps.

    The Weird and The Wonderful question

  • Uh...check what?
    O oggenok64

    I love it! Being on holliday, i can't wait to get back to implement this wonderful scheme. - turin

    The Weird and The Wonderful com sysadmin question

  • YAVH - Yet another VBA horror
    O oggenok64

    What i really like the most is the "Err_Handler". So beautiful, so classical, so elegant :-)

    The Weird and The Wonderful database help career

  • Funny strings
    O oggenok64

    No, you are not standing in shame. A great many people have bitten by trigraphs because they are so counterintuitive.

    Clever Code c++ csharp visual-studio debugging

  • Funny strings
    O oggenok64

    The string literal "??)" will be replaced with the single character ']' which looks consistent with what you've seen. I don't have VS around so i can't immediately reproduce the output. By default gcc ignores trigraphs, so it's not a surprise you don't see the "problem" there. Try compiling with the -trigraphs switch.

    Clever Code c++ csharp visual-studio debugging

  • Funny strings
    O oggenok64

    Ye olde trigraph strikes again. It's well documented in my old Kernighan & Ritchie: "The C Programming Language", 2nd edition from 1988.

    Clever Code c++ csharp visual-studio debugging

  • String.Format???
    O oggenok64

    No, i'm not working in the financial sector. And yes, my example was a reporting system having read-only access to everything - not just implementing a SP but also to your savings account :-)

    The Weird and The Wonderful ruby database help question learning

  • String.Format???
    O oggenok64

    Using an SQL IN-clause is definetely not a design flaw. Forcing everything into JOIN's is on the other hand an odd self-imposed hinderence.

    The Weird and The Wonderful ruby database help question learning
  • Login

  • Don't have an account? Register

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