|
YardKGnome posted:3 is 0011 in binary. & is the bit-wise and operator. Basically, its giving you a random number between 0 and 3 (inclusive). It is equivalent to "% 4" That seems like a bad idea. Somebody is going to want to add another case, change the 3 to a 4, and now you have a bug.
|
# ¿ Mar 3, 2008 16:32 |
|
|
# ¿ Apr 29, 2024 05:14 |
|
karuna posted:::Visual Basic:: If you want something to take a certain amount of time, you can use a timer. Timers have a tick function that gets called every specific amount of time, and you can turn them on and off and specify the amount of time etc. In order to be able to refer to your controls by number, you need to make a control array. I don't know the specifics of how to implement these in VB, and it probably depends on what version of VB you are using, but at least you know what to google for now.
|
# ¿ Mar 4, 2008 19:59 |
|
I'm trying to add a dynamic number of items to a Windows CMenu. The only example of doing this in our codebase is this horrible hack: Every menu item has to have a unique resource ID, so what this person did was to reserve a range of IDs in the resource.h file like this: code:
code:
This is obviously a lovely solution, and I was pissed when one of our Sr. developers told me that it was the only way to do this. Surely there must be a way to set up a message map that can take a parameter of some sort, and make a menu item that passes the parameter along? I couldn't find anything that would tell me how to do this, or if it were even possible, but really I don't know what to search for.
|
# ¿ Sep 19, 2008 15:41 |
|
csammis posted:You shouldn't be creating static IDs for dynamic menus. Does this help?
|
# ¿ Sep 19, 2008 23:06 |
|
So I hear that unit testing is a thing that real grown-up programmers do... How can I start unit testing in an environment that is seemingly hostile towards testing? I don't really have time to finish what I'm working on in the first place. Secondly, most of the classes that I want to test can only be instantiated through a de-serialization process that takes input from a hugely complicated asset build system. Needless to say, nobody really tests anything here. We've got xunit with some stuff plugged into it, but if you invoke the existing tests, everything simply explodes because nobody has run them for years. The leads don't really care about this. I'm positive that I've never written a single piece of code here that is testable, let alone tested. Do I just ignore all of the code that I've already written and try to test new stuff? The problem with that is that I usually have no idea what I'm writing until I've written it (two or three times). How can I test the unknown?
|
# ¿ Mar 22, 2011 16:00 |
|
|
# ¿ Apr 29, 2024 05:14 |
|
Sneftel posted:This book was specifically written to address your problem. Thanks. This book looks great.
|
# ¿ Mar 22, 2011 19:27 |