I tried Dvorak once. The problem I had was that I often worked on computers other than my own, troubleshooting software, etc. My poor brain never got far enough along in learning Dvorak to successfully switch back and forth. I wound up typing gibberish fheipamd. Whs ohro kws fnsusmf.
cgh1977
Posts
-
Typing -
Logical genius!I know this is an old thread, but being the pedant I am I can't resist. None of the examples of the 'right' way to do it are optimal. Remember that m_bUsed is already defined to be a bool. Also notice iHandle is an int, which could be negative.
typedef struct
{
// Lot of stuffs..
bool m_bUsed;
} CONFIG;#define MAX_CFG 10
static CONFIG g_vConfigurations[MAX_CFG];
...bool IsUsed ( int iHandle )
{
if (iHandle >= 0 && iHandle < MAX_CFG)
return g_vConfigurations[iHandle ].m_bUsed;
return false;
} -
Where Is IntelliSense For "goto" statements?Sorry.. I see the case you are trying to make, but in this specific case there is a simpler goto-less construct:
private static void AltFoo(int x)
{
Console.WriteLine(String.Concat("Option: ", x));if (x != 1) { Console.WriteLine("English"); } if (x == 0 || x == 1) Console.WriteLine("Spanish"); } Console.WriteLine();
}
I expect your response will be something along the line of 'extend the example to more complex cases and the if-then approach becomes unwieldy'. Granted. Of the three examples (mine and your two), your second example is the best solution. It is considerably easier to understand and is more maintainable. Suppose the specification adds support for three other languages: French, German, and Italian. The goto version becomes impossible (without a lot of convoluted spaghetti code), but this code is very clear:
private static void AltFoo(int x)
{
Console.WriteLine(String.Concat("Option: ", x));switch (x) { case 0: DisplayEnglish(); DisplaySpanish(); DisplayGerman(); DisplayItalian(); break; case 1: DisplaySpanish(); break; case 2: DisplayGerman(); break; case 3: DisplayItalian(); break; default: DisplayEnglish(); break; } Console.WriteLine();
}
private static void DisplayItalian()
{
Console.WriteLine("Italian");
}private static void DisplayGerman()
{
Console.WriteLine("German");
}private static void DisplaySpanish()
{
Console.WriteLine("Spanish");
}private static void DisplayEnglish()
{
Console.WriteLine("English");
} -
Backup/Sync tool suggestions?Based on a quick Google search, have a look at: Sync Tools (wade through a few) Top Results in Sychronization Software I used Cobian a few years ago and stopped (I don't remember why). Currently, I need something similar myself but I haven't looked at anything yet. Here are some that I will be taking a closer look at: DirSync Pro (free)
Unison (FOSS)
All Way Sync ($19.95, free for limited personal use)
FreeFileSync (FOSS)modified on Wednesday, June 9, 2010 3:50 PM
-
Notepad++ and programmer's editorsI have used EditPadPro for years. It compares nicely to UltraEdit, is $10 cheaper, and Jan has some other nice utilities that integrate with it. I particularly like his RegexBuddy... It makes debugging regular expressions a dream. Updates are free for life. :-D Check them out at http://www.jgsoft.com
-
Why are computers so unpronouncable?When it comes to pronouncing computers, the most common instance for me has been to pronounce it..... DEAD.
-
Learning Words While ReadingI guess you were tired when you wrote your sig line too? :zzz:
-
Personal Financial Management Software RecommendationIt has sure annoyed me. I've sent several emails to Quicken support with specific lists of problems, but have never received a response and none of their "Updates" has addressed any of the issues I've seen. I suppose there could be something weird about my computer, but I have had *NO* problems with any other applications. I looked at GnuCash last year; I think I will look again and if it has most of the features I need, I may switch to it and donate some time developing properly functioning enhancements to make it more competitive with Quicken. If you can't join them, beat them!
-
Personal Financial Management Software Recommendation:mad: Sorry, but Quicken has degenerated into a marginally usable random aggravation generator. I loved it back in the DOS days, but the Windows versions have progressively added features that are so buggy you're better off not even TRYING to use them. Just when you think, "Cool! It does that?" you try it and bizarre roadblocks pop up at every turn. One example: Quicken 2009 Rental Manager: if you click the search tab in the Help window... nothing happens; no search box, no list of subjects, nothing. Completely unusable. Even rudimentary QA should have caught that one. Here's another one: If you try to enable online update for an existing credit card account it gets stuck in a mode where it refuses to list the available credit card accounts so you can't do it. You have to export the data, delete the account, recreate the account and configure online update, then reimport the data. Feh! They're pinging me about upgrading to Quicken 2010, and I've heard rumors they have a hidden time limit on certain features that stop working after a particular date. If that's true, I'll drop Quicken like I did TurboTax. Using clay tablets and a pointed stick is less frustrating than Quicken. X|
-
Positive Post PrizeI prefer, "Sex is like documentation. When it's good, it's very, very good. And when it's bad, it's better than nothing."
-
What do you doYou sound like me. X| I'll offer a suggestion, but in practice I'm a pretty staunch hypocrite when it comes to following the 'rules' I know would work if I would only apply them. I often get overwhelmed by the magnitude of the work that needs to be done. I find myself thinking, "I want the problem solved now. It's too big to solve in one sitting, so feh." I vapor lock, just like writer's block. "They" say the approach there is to bite off small pieces and ignore the size of the big pro(blem|ject). Once some progress is made, no matter how little, it can inspire one to keep slogging through. I think that's what Brady is saying : if you can do something, anything, it can get you moving in the right direction.
-
Looking for suggestions for dealing with stupid peopleAt some point in this process I'd ask myself how important is it to get the point across. If they want to know, show them a Google search box and tell them not to come back until they've figured it out themselves. If you are obsessing about getting the point across, save yourself an ulcer and stop trying. Maybe tell them you don't know the answer either. A [white] lie perhaps, but it ends your grief.