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
T

The Nightcoder

@The Nightcoder
About
Posts
226
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Do you still like to code?
    T The Nightcoder

    I have consistently refused "advancements" into project management and other shit I'm not good at. So yes, I am coding and I LOVE coding. The old stuff, the new stuff, the bleeding edge stuff... all the stuff. And I'm 54, and have been coding for 35 years. Salary? Yeah, it's a lot lower than it would have been if I had accepted the suggestions to go the management path. But do you know what? I fall asleep smiling every night.

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question career

  • Catalysts
    T The Nightcoder

    Sorry, I've been working too long as a network techie, so for me a Catalyst is a Cisco Catalyst switch. Old shit, and probably not relevant to your question... And by the way, why aren't *technical* questions banned in the Lounge as well as *coding* questions. Or is it? Long time since I read the rules, sorry... :D

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge hosting cloud question

  • Back To Pretending I Know How To Program
    T The Nightcoder

    I seem not to remember what the rules say about programming ANSWERS to "almost not programming questions"... so... asbestos pants: on I always do that kind of flat file imports in VBScript (*blushes*), scheduled by the OS. Why? Because it takes fifteen minutes to write and I can change it on the fly from Notepad (always available even on a server) when the customer makes unannounced changes to the files. Then, I let a stored procedure dig in - normalizing and "transmogrifying" the data into my own tables. Finally, my app (web or whatever) steps in, doing what it does - normally using C# and either PetaPOCO or a similar thingy I built myself (they both have pros and cons so it depends). In your case: google PetaPOCO. It does what you need in a jiffy, and can do a ton more. From one cs file that you just drop in your project. Entity Framework meets "Biggest Loser"... Optimally you could do what i did in a voluminous case - built a text file DataReader implementation which I fed to the SQL Server Bulk Import classes... whooooosh! asbestos pants: off /Peter

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge csharp database css sql-server sysadmin

  • for(int i=0; i<size; i++)
    T The Nightcoder

    Hi, Others have said this, but it deserves to be repeated: This is classical math (handwritten, typed or printed), from a couple of centuries before the advent of computers. It's pretty natural that it was adopted by most mathematically-oriented computer languages (and, consequently, by later languages), and it also explains why it feels natural to most programmers (who have read any math - which should be a reasonable expectation) even today. indices: i, j, k (don't remember how it goes on after that quantities: n, m (then p, q if I remember correctly - o can be confusing). dimensions: x, y, z, t, (xi), (eta), (theta). I don't remember what happens when we run out of letters for indices and quantities, but if I remember correctly these sequences also continue with greek letters. So:

    for (i = 0; i < n; i++)
    {
    for (j = 0; j < m; i++)
    {
    for (k = 0; k < p; k++)
    {
    }
    }
    }

    Pretty straightforward. And Newton would have understood it without thinking... :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Weird and The Wonderful csharp c++ java question

  • Is this a little bug in Windows 7?
    T The Nightcoder

    Windows has been "case preserving, case insensitive" by design from start (unless you enable case sensitivity to be able to run POSIX apps that require it). The problem here is the UI (Explorer). Renaming a file like you want to via the API works fine, but Explorer doesn't understand that the name has change, and ignores the rename. It has come and gone and come again - like someone said - it works in Windows 7. Seems like someone missed checking the fix in to the right repo...

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge help question

  • Cannot do "Preview"
    T The Nightcoder

    It's quite remarkable that the web doesn't follow the procedures used for everything else on the Internet (protocol standardization etc - it's the principles that gave us Internet). In short: Until something is proven to work consistently and reliably between/with two separate products from two separate vendors, it is a draft. When it is, the draft *MAY* become a standard. So... if everyone used webkit, no version or flavor of IE could be regarded as a standard. Ever. And rightly so...

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    Site Bugs / Suggestions question

  • In love with C#
    T The Nightcoder

    Indeed - it's my favourite workaround... :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge csharp c++

  • In love with C#
    T The Nightcoder

    I'm totally with you on all that... :(

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge csharp c++

  • In love with C#
    T The Nightcoder

    To answer the original question: Love: - Clean, very readable and minimalistic syntax - C with object orientation the way it should have been done in C++ (backwards compatibility made C++ extremely ugly and cluttered in my opinion). - The type system in general. Admittedly a .NET feature, but integrates nicely with C#. - Reflection, generics, namespaces, lambdas and a lot of other stuff. - The ability to perform like C++ using "unsafe" and "unchecked" blocks, and possibly ngen when needed (almost never happens, but nice to know its there). Hate: - Inability to write methods in methods. The original docs say "we don't compile code onto the stack", which is ridiculous. It's a matter of scope and visibility, not where it gets compiled (of course not the stack). I don't want to clutter class namespace with small helpers only used in one method - presumably using local variables. - Inability to declare variables outside of getter and setter blocks in properties. I don't want shadow members in class namespace - too easy to inadvertently use the shadow member instead of the property. Those variables would work exactly like class members but would be invisible to the rest of the class. Maybe with a special keyword to make it clear that they aren't on the stack, but persist with the instance (or forever, if the property is static).

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge csharp c++

  • In love with C#
    T The Nightcoder

    I'd like to split that in two parts... I love C# and I love .NET Framework. - I love C# because it is terse yet elegant, like C, and - in contrast with C++ - has very little syntactic weirdness going on to support object-orientation. I especially like recent additions such as generics and lambda expressions, that while introducing some syntactic weirdness does so in a very careful and minimalistic way. - I love the .NET Framework for all the stuff I don't have to do. My first project in C# was an industrial control system using multi-threading, serial ports and TCP services. I was quite shocked when I realized I didn't have to implement any of that stuff myself. When I was about to implement an event queue to pass machine events between threads, I found the Queue class and just had to laugh... As for the VB:ers commenting here... you have the .NET Framework as well, and what you write will be compiled into the same MSIL or machine code. And what is beautiful in a language is purely a matter of taste. So I wouldn't even think of looking down on you. After all, I've spent over 10 years in earlier versions of VB, and although I come from C and prefer strong typing, it isn't THAT bad (the old versions, that is - I have spent very little time in VB.NET, but from what I understand, it is nowadays as strongly typed as you want it to be - making it better, in my opinion). And... I'm VERY jealous of one thing. Using C# in ASP.NET (or Razor), you're in a method body, and can't write other methods or functions. I know, views should be lightweight, but I prefer writing a four-line method over repeating the code ten times, and sometimes the task is too trivial and implementation-dependent that it doesn't belong in the controller. In VB, you can do that... :( If ony I could stand the syntax... but again, that's a matter of taste... :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge csharp c++

  • Why the world hates Hungarian notation?
    T The Nightcoder

    MSBassSinger wrote:

    Fields are rarely ever appropriate in professional code.

    You meant "public fields", right? :) By the way, that is stressed in the .NET FrameWork class design guidelines as well, and the reasons are good and many.

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question csharp c++ collaboration tutorial

  • Why the world hates Hungarian notation?
    T The Nightcoder

    Hi, Thanks for the enlightenment! I was almost sure that this was the case, although most of the examples I've seen say "m_CustomerId" instead of "mCustomerId". My confusion on this probably comes from interpreting the word "member" as meaning "property, method or field", which is probably incorrect. I write _customerId myself when I need a shadow field for a property called CustomerId. That also works well. Incidentally, that's how I wrote struct field names meant to be private - which wasn't possible to enforce back then - in C back in the early 80's. I think most people did - it became a habit to see it as a bug to touch something starting with _ unless you owned (had defined) it. So using that convention now feels quite familiar and natural. When I work with other people's code I generally don't have any problem with different styles, as long as ALL public identifiers (including parameters - camelCased) strictly follow the .NET guidelines. When you've chosen your environment, stick to its conventions - otherwise you're just confusing the people who use your stuff. Most people seem to follow them, though. I occassionally see camelCasing of classes, methods and properties, but that usually only happens when a web designer/javascript coder makes an occassional visit to .NET (and that code comes to me for refactoring anyway, as a matter of procedure)... Later,

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question csharp c++ collaboration tutorial

  • Why the world hates Hungarian notation?
    T The Nightcoder

    Haha, That's why I like working for a small company... :) But seriously, our environment isn't really that insecure. I don't download any software (can't even see that I mentioned downloading software) that isn't licensed or free and approved (although I do the approving here), and I don't run any of the tools on any computer that isn't owned by the company (usually, my work laptop). Termial services access is over SSL and we have a reasonably secure password policy. It doesn't violate any security policy at all (since I write the security policies, I know). But... I mostly write customer specific back-end software for web sites - code that is useful in one and exactly one place... so if someone WOULD get at it, it wouldn't be much of a problem anyway. But I can understand your situation. Was a while ago since I used "vi"... almost 30 years now... some things never die... :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question csharp c++ collaboration tutorial

  • Why the world hates Hungarian notation?
    T The Nightcoder

    Just a thought: Maybe the project is too big then? And by project I mean (in the VS sense) project, not solution. Even if you have a huge solution, it's usually sufficient to check out a project - since it will include the output (DLL:s, for example) from the other projects it needs. That way, you get full intellisense, mouseover type information and so on (for instance, you can view metadata and declarations of classes from the other projects) even without checking out the entire solution. Viable?

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question csharp c++ collaboration tutorial

  • Why the world hates Hungarian notation?
    T The Nightcoder

    Exactly what does m mean? I've seen it for years and never understood the point - I thought it was just some kind of typing mistake that spread? For private members (oh - maybe it means member - but no, people never use it on public members, so it can't be that) I used to use the "p" prefix... but ended up with "_" instead (after a short period of camel casing - but it ended up being too hard to spot unintentional recursions then - and also, camel casing is reserved for parameters). But... back to the original question. What does the "m" or "m_" prefix on private fields in a class really mean? Ten years since I first saw it (and barfed on it), still no clue... :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question csharp c++ collaboration tutorial

  • Why the world hates Hungarian notation?
    T The Nightcoder

    VuNic wrote:

    in notepad

    Yep, there's your problem. Coding in text editors is what we did in the early eighties. Since the concept of an IDE came, I never looked back. But... I never used Hungarian notation back then either, as the C compiler would tell me of any (most - pointers are a bit troublesome) mistakes with variable types. Conceptual Hungarian Notation (App Hungarian, as linked to in an answer above), however, I've done at times. But I tend to write longer variable names instead, nowadays, such as: double RelativePosition; double AbsolutePosition; ...or something similar. Opening my code in Notepad? Not likely, except in VERY extraordinary situations. I tend to see my source code as binary files that can only be interpreted by the IDE. If I don't have IntelliSense or don't get red squigglies under type mixups, I'm pretty much handicapped. And seriously, checking a project out from the CVS takes seconds these days (even from home). If not, the project is overdue for being split into smaller subprojects. Also, if I don't have the IDE, I can always hop onto a terminal server at work that has. No problem. Hava a nice weekend!

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question csharp c++ collaboration tutorial

  • Scientists and ther PCs
    T The Nightcoder

    PaulowniaK wrote:

    connected to heavy duty analytical instruments

    There you have it. Drivers and/or background data collection services for that hardware. Think about the sales volumes for that kind of hardware - virtually nil compared to, say, a printer. Then think about the code coverage they get during beta testing - nil, because they don't do external beta testing. Then think about the number of users using the drivers and discover bugs - virtually nil. Result? Utter crap, in most cases. What does a crappy driver do? Undermine the OS. By definition, a driver is the only piece of software (except the OS kernel) that is permitted to really mess the OS up. Running at IPL, a badly chosen algorithm in an interrupt handler can slow down a computer almost to a halt. I work a lot with computers hooked up to industrial control systems - I write PC software for higher-level control. This is a constant problem - the drivers very often have inefficient polling loops that absolutely cripple the machines. The only thing that helps is chasing the suppliers with a torch - and it only helps sometimes. It is also very time-consuming. *sigh* Second "usual suspect", like many have said - antivirus software. For much the same reasons, actually. Just my two cents... :) EDIT: A printer was a bad example. They often suffer the exact same problems. Let's say a popular graphics card instead (yes, they are sometimes buggy too, but the high volume cards usually get stable drivers eventually).

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge adobe question discussion announcement

  • Apologies in Advance, Folks...
    T The Nightcoder

    Dear Lord, Please give us Jeff Porcaro back. You can have Justin Bieber instead.

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge

  • googling
    T The Nightcoder

    I've always been puzzled over the fact that my colleagues so frequently come to me and ask me to google something for them. I've come to the conclusion that googling is hard. For some concepts, it's trivial to figure out a search phrase that gives you a useful signal-to-noise ratio in the results, but in many cases this is definitely not the case. You REALLY need to know what to search for. This is especially true for us who don't speak English natively. Most of the information we want is in English, but we may not know the English terms for what we search for. Sometimes we are searching for error messages that are shown in our own language - reverse-translating them before searching isn't at all trivial. The main reason that my colleagues often seek my help is probably that I'm somewhat of a language nerd (and absolutely love the English language). While certainly not perfect, I'm better at English (especially IT-oriented English) than probably all of my colleagues - which makes googling a lot easier for me. Also, finding the useful article in a result list mainly consisting of beginner stuff can be really hard unless you're already somewhat familiar with the basics of the concept at hand. And after all, I AM the senior in my office. In short: Googling for complex subjects is hard, requires languages skills and lots of experience. So... in SOME cases I think it's excusable to ask more experienced programmers on Code Project for help instead of googling. At least after unsuccessully trying to google the problem. Of course, MOST cases are not excusable, but SOME probably are... :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question

  • code signing certificate...
    T The Nightcoder

    Hi again, Major OOOPS here! Just looked at godaddys support page. They don't issue code signing certificates to Belgium. Didn't think about checking that before, because Sweden is on the list. They need a reliable way of verifying that a company exists and has no major legal issues, and for some reason they don't seem to have that with Belgian authorities. The godaddy countries list[^] So... godaddy won't work and you should check if the other issuers you have suggested to the client work. I don't mind that complicated things are complicated... but why must the simple things be complicated as well??? :)

    Peter the small turnip (1) It Has To Work. --RFC 1925[^]

    The Lounge question cryptography
  • Login

  • Don't have an account? Register

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