• Advertisement

deffer

Member
  • Content count

    1004
  • Joined

  • Last visited

Community Reputation

754 Good

About deffer

  • Rank
    Contributor
  1. Shows you grew up with

    1. McGyver - no one could forget that 2. A-Team 3. Columbo Also cartoons: 4. The Mysterious Cities of Gold - thanks for the reminder, Trapper Zoid! 5. Inspector Gadget
  2. Quote:Original post by superpig What resolution are you working at? I can fit about 120 characters on a line without any scrolling. And you're able to read at most half a line at a single glance (sorry if I'm underestimating your reading abilities - I simply know _my_ limits). I prefer looking at a whole block at a time. Quote:Original post by superpig Reading it back, it's the difference between "if w is not null" and "if window handle is not null." The second allows me to jump straight into the code without having to go and check what 'w' is, because the variable name matches its semantic value. I find it easier to read. IMO, jumping into an unknown code gives you absolutely nothing. You have to read the whole thing (or at least some larger parts) to understand the context anyway. Quote:Original post by superpig Quote:That's why I like explaining in plain english what the code does - to speed up reading.Why not make the code read as close as possible to plain english to start with? In my experience, code does _not_ translate well from/to plain english. I often write a short briefing in a comment before a loop or inside an if, just to summarize what the situation is, so any reader wouldn't have to decipher the whole stuff just to know what's going on. I mostly do low-level stuff, so using more than several local variables in a function is pretty common - refactoring such pieces of code to some another function would require passing many parameters around, which would be suboptimal (and doubtfully more readable).
  3. Quote:Original post by superpig Quote:Original post by T1Oracle windowHandle is a very long variable name. ! You're kidding, right? Or is your typing speed really that bad? Excessively long variable/function names bloat the code and make it hard to read. If every line of your code has at least 40 characters, it is a good candidate for a novel, not for a source code. Classic rule: smaller the scope of a variable, shorter its name you're allowed (and encouraged) to make. -------- Quote:Original post by Oluseyi A programmer spends more time reading code than writing it That's why I like explaining in plain english what the code does - to speed up reading.
  4. I have exact same problem! Forgive the hijack...[embarrass] Hope it can help the OP. I read some tutorials and massive amounts of MSDN, and I still can't get it right. Unless I switch my systems language to Japanese, then it displays just fine. But then I cannot make it display polish characters! Sample: static const TCHAR* locale_name_jap = _T("Japanese_Japan.932"); static const TCHAR* locale_name_pol = _T("Polish_Poland.1250"); int main() { const TCHAR* locale_string = NULL; locale_string = _tsetlocale(LC_ALL, locale_name_jap); if (locale_string == NULL) { _tprintf(_T("Japanese locale not enabled. Exiting.\r\n")); goto end; } else { _tprintf(_T("Locale set to %s\r\n"), locale_string); }; _tprintf(_T("%s\r\n"), _T("<<&#12354;&#12356;&#12358;&#12360;&#12362;>>\r\n")); locale_string = _tsetlocale(LC_ALL, locale_name_pol); if (locale_string == NULL) { _tprintf(_T("Polish locale not enabled. Exiting.\r\n")); goto end; } else { _tprintf(_T("Locale set to %s\r\n"), locale_string); }; _tprintf(_T("%s\r\n"), _T("<<&#261;&#263;&#281;&#324;ó&#347;&#378;&#380;>>\r\n")); end: _tprintf(_T("\r\nEND\r\n")); getc(stdin); return 0; } With system language set to Polish: Quote:Locale set to Japanese_Japan.932 <<?????>> Locale set to Polish_Poland.1250 <<ąćęńóśźż>> With system language set to Japanese: Quote:Locale set to Japanese_Japan.932 <<あいうえお>> Locale set to Polish_Poland.1250 <<????o???>> What am I still doing wrong? EDIT: seems like the "source box" doesn't like utf-8. It should read: "あいうえお" and "ąćęńóśźż" respectively.
  5. Quote:Original post by Skizz Scary, edge of the seat stuff or what? Skizz Yeah, I actually found myself screaming a few times. I really surprise myself sometimes... Also, watching the episode, I kept thinking that they won't be able to explain all this strange stuff happening, like the half-message on the DVDs, or the writings on the wall in just the right places. But they did. And that's what makes this show great. Edit: 1000 post! [Edited by - deffer on June 12, 2007 1:41:39 PM]
  6. What kind of keyboard do you use?

    Quote:Original post by mhamlin The Microsoft Ergonomic Keyboard 4000 is a dream to use. It is quite comfortable and my wrists haven't gotten sore since I acquired my keyboard. Another vote for MS Ergonomic. I requested it at work and after a few days I'm not getting back to old ways. And - classic crappy keyboard at home - I don't write enough at home to justify any expenses in this matter. But - mouse is more important at home - so I use Logitech MX 400 Laser Mouse. Really nice.
  7. Got a spare 1h 30mins of PC time? :)

    Quote:Original post by Extrarius [...]This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.[...] Same thing. Vista Home Premium + X1600Pro. Sorry.
  8. Fraps video editing on Vista?

    Quote:Original post by Yazilliclick hmm I checked there and only had one showing up for avi and it was already checked. Hm. I was trying to edit mkv. And I had to un-check Haali Media Splitter and check ffmpeg. Check if you don't have to un-check something! Quote:Original post by Yazilliclick where did you grab your codecs from? I'm using ffmpeg from CCCP
  9. Fraps video editing on Vista?

    I too have been unable to open/edit most of my files using Windows Movie Maker. Then I discovered: "Tools->Options->Compatibility" There, you'll have all the installed codecs/filters with checkboxes activating/deactivating them. In my case, I just needed to turn some on and turn some off, and voila! it worked. Hope it will help you.
  10. Duke Nukem Forecer release date announced

    lol, I was waiting for this announcement to appear today [grin]
  11. Works? Say - compiles. It shouldn't work, since you can't call another constructor on the same object. Terrain::Terrain(const string& fileName) { Terrain(Bitmap(fileName)); } is same as: Terrain::Terrain(const string& fileName) { Terrain __a_temporary_object__(Bitmap(fileName)); } As for why you get an error there, I cannot see atm. EDIT: this: Terrain __a_temporary_object__(Bitmap(fileName)); seems to be a function declaration, change it to: Terrain __a_temporary_object__( (Bitmap(fileName)) ); (if I'm not mistaken, again)[smile].
  12. I'd use: gettimeofday() and usleep() with some priority queue for scheduling events.
  13. It compiles for me :( No SP1, fresh VS install. Disabled precompiled header. Even after I examined generated asembly, I cannot find what it's doing: //... object has just been constructed (eax=this) 0040103E xor eax,eax 00401040 je main+18h (401048h) // else
  14. Quote:Original post by Nypyren See if the command line "mountvol" will let you do anything. It let's you do anything if you have the partition already assigned to some volume (which I don't). Anyway, I eventually booted once again to my old XP and launched some external program - which allowed me to unhide the partition. After logging back to Vista, the partition was detected automatically and assigned to a new volume. Shame that I couldn't do this with some standard system tools... or could I?
  15. I've already been there. It sees my partition, but doesn't want to do anything with it, except deleting it (all other actions are grayed out).[sad]
  • Advertisement