I think it's nation wide. I just saw a note in the news about it, too. I think it is that people think a petrol price rise from a little under one pound to a little over makes all the difference. I suggest driving less in the first place.
berndg
Posts
-
UK Panic Buying Fuel -
Is there a #define for Multi-Threading?I see. Duno.
-
Is there a #define for Multi-Threading?Since it is your process that actually creates those threads, wouldn't you be the best person to know whether or how many threads are in use? It seems a bit hard expecting Microsoft to predict your source code. What am I missing?
-
dynamic class instantiation in c++?The typical C++ approach to this would be like so: 1. Create an abstract base class that defined the interface common to all classes that might be instantiated with this mechanism. Assuming the popular musical example, make this base class an "Instrument" and give it virtual methods like "Play", "Tune", "ThrowAway", etc. 2. Create all classes that need instantiating so, and make sure they all derive from this base class: Flute, Piano, Viola, etc. 3. Read your configuration file, and evaluate it using a simple (or powerful) parser, like so:
Instrument* parse(const char* word) { Instrument* result = NULL; if (!strcmp(word, "Flute")) { Instrument = new Flute(); } else if (!strcmp(word, "Viola")) { Instrument = new Viola(); } else ... ... } return Instrument; }
-
Escape from YesterworldSuch a shame I have no use for Microsoft SQL Server. These guys certainly did a brilliant job advertising[^] it.
-
Use of string in switch caseI would recommend not to use the hash approach, for at least these: i) it is hard to maintain - always think a couple of years and several generations of fellow programmers ahead. Who's going to remember how to create the keys, why and when? ii) it is doomed to fail - hash keys are not unique, so there is a chance that two different strings produce the same key.
-
Use of string in switch caseI can only guess and believe you might want to do something like this:
switch (myString) { case "Blue": ... break; case "Red": ... break; ... }
Trouble is, the C or C++ languages don't do that. C# does. Thus, one solution is to use C#. If you want to use C/C++, you must use nested if/else clauses to emulate the same effect, something like so:if (_tcsicmp(myString, _T("blue")) == 0) { ... } else if (_tcsicmp(myString, _T("red")) == 0) { ... ... }
Doesn't look as nice, but, compared to the above fictivious switch statement, gives you control over the comparison algorithm (e.g. use _tcsicmp for case-insensitive comparison, or _tcscmp for case-sensitive comparison), etc. -
pls suggest a gifthttp://www.iwantoneofthose.com/[^] always comes nice for small and funny presents fit for use with geek colleagues. The gyroscopic arm twister[^] or the L39 Fighter Jet[^]always come nicely.
-
WinExecYou may not have VS, but you have the Internet[^]. ShellExecute performs verbs on an object. This can be "open" (verb) abc.zip (object), or "print" zorro.doc - anything that is registered within the local system. Your application need not even know what the application is; and it will automatically use the user's default application. For instance, "edit" readme.txt will laucnh that file in the user's preferred editor for txt file.
-
WinExecYou're looking at ShellExecute(). Or, you should be.
-
DLLMichael Dunn wrote: The DLL should go in the same directory as your EXE. ... or anywhere else on your search path. The MSDN description of the ::LoadLibrary() function details the search algorithm.
-
array in enum?As unsure as DavidCrow in what you mean. Assuming you mean an array of enumerated values, then the answer is simple: typedef enum { Blue, Red, Yellow } Color; Color colors[100]; Otherwise... please clarify.
-
Latest Microsoft patch deleted my user accountYou'll find that kind of effect if your account has been locked. This could happen if you (or maybe some software) tries to log on against cached account information (i.e. your domain controller is not accessible) with the wrong password more than 3 (?) times. This happened to me recently, but in my case I simply had accidentally used the old password. The fix involved driving 26 miles through London suburbia so that I could access the domain controller on its own network, reboot, log on, done. Account restored.
-
MP3 -> MIDI -
To Do or Not to DoJoin the big company. You need experience first, and contacts, and a name in the industry. If everything still looks cool in 3 to 5 years, then revisist this decision.
-
hang that hard driveI bought an external hard drive[^] - which is great but contains an annoyingly noisy fan for forced ventilation. Contained is a Hitachi Deskstar drive. Like most hard drives, this is only specified for horicontal use, or vertical use "on the side". I would like to hang it, or stand it up on the IDE connector (not physically, but orientiation-wise) - the idea being to allow for convection to flow freely without the noisy little bugger. Has anyone tried using hard drives in this orientation before? Good idea? Bad idea? Thanks.
-
Google in the 60's....:-D:-D:-D:-D
-
Arrrrg. I need to vent off.No, C++ is not a type-safe language. It has better type-safety as ANSI-C does, but that's the begin and that end of it. Example:
int eBool; bool bBool; enum { FALSE, TRUE } eBool; eBool = bBool = eBool = 1u;
Where is that type-safe? -
Arrrrg. I need to vent off.I don't have the time to dig through the ANSI-C papers, but I am pretty sure this is a valid (though unhelpful) C assignment, just like all these: unsigned int a = -2; signed char b = 128; unsigned char c = 500; unsigned short s = -1L;
-
Arrrrg. I need to vent off.You might expect a warning from a modern compiler maybe, but clearly it is not the compiler, but the ANSI-C specification that needs to face the criminal charges here. The assignment is as legal as assigning +128 to a signed (8 bit) integer, and many other cases. As long as implicit conversion rules allow for the conversion, it's fine as far as the language standard is concerned. Use PC-Lint to find these, and many other, issues!