|
Hee-hee - I've been through this sort of pain - except we had it easy - we were developing an embedded system, so we had no OS (and no OS loader), so had a raw binary (an S-Record file) that we could compare. That had no timestamps, no fixups, no extraneous metadata. Easy!
_aesthetic_ wrote: Is it possible to specify their build and link orders short of a .bat file
A response file[^]? Can you stick a list of all the object and library files into a text file and use that on your command line.
I'd recommend getting away from using the IDE to build. Create yourself a makefile or something - give yourself control over the build process.
To be honest...could you not save yourself a whole heap of pain by configuring binaries in your version control system as part of your release procedure - that way you always have the released code.
BTW - why is your auditor going to be getting quite so het up about this? Do you have some sort of certification authority to satisfy? The FDA or something? If not, then you really, really don't need this level of reproducibility.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I want to write a small mfc dialog app that executes some code when the user changes the desktop settings (resolution / color depth), but I want to execute this code before the event occurs (so I can store current window position before the layout changes). I have not had much luck googling this, can someone point me in a direction?
Thank You -
Mike
|
|
|
|
|
rognorak wrote: (so I can store current window position before the layout changes).
You mean your size settings are automatically updated when the display resolution changes?
Btw, I am not sure about such a message that will inform before the display change. But I wonder if you can't store the size informations always (at the beginning itself). So that when you get the display change message you can make the use of them.
- ns ami -
|
|
|
|
|
Well what I am doing is switching between clone and extended desktop. What I want my app to do, is remember the position for each configuration, so for instance, when I switch back to extended desktop, it will return all windows to the position they were in before I had switched to clone. I dont want to constantly be polling window position, so I wanted to be notified right before the resulution was changed so I could store the last known position before the resolution changes in each configuration -
Any Thoughts ?
Thanks -
Mike
|
|
|
|
|
I think I have no such experience.
Who is updating the position when the desktop is changed?
I was thinking, if it is done in our code, we can store that.
- ns ami -
|
|
|
|
|
I am making a program that takes a binary number (a boolean array) and gives numerous representations.
For example, Enter binary (8 bits): 10001000
-Unsigned int: 136
-Hexadecimal: 88
-Octal: 210
-Two's complement: -120
-Sign magnitude: -8
-One's complement: -119
-Excess-127: 9
-ASCII: N/A
-Pep/8: SUBX immediate
-Floating-point: -0.125
I currently have all of the representations working, except floating-point.
Does anyone have any suggestions on how to go about doing this? Thanks.
|
|
|
|
|
Floating point value depends on how do you split the number into mantissa and exponent fields. AFAIK there is no convention on how to do this given a 'boolean array' of arbitrary length.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The program only needs to work for an 8-bit binary input. Floating point format: 1 bit sign, 3 bit exponent (Excess 3 representation), 4 bit significand.
modified on Tuesday, March 17, 2009 6:10 PM
|
|
|
|
|
using you prescription, supposing a IEEE-like format, 10001000 binary turns out to be -0,1875 float (if I didn't make mistakes).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Which bits are which? Is there a leading implied '1' bit on the significand like IEEE754 has?
With your spec, I'd interpret 10001000 as sign = 1 (is that + or -?), exponent = 000 (decodes to -3), significand = 1000. Now...what's the most significant bit of the significand represent? 2^-1? 2^0?
But is that the way the bits are distributed within the byte?
You need a bit more detail in your specification of floating point numbers before you can decode a byte to floating point.
If 10001000 == -0.125, as in your first message, I'd say sign=1 implies negative and that the significand has an implied binary point after the first bit. That would mean your byte decodes as:
1 | negative | 000 | exponent = -3 | 1 | significand = 1.0 |
So, you have - 1.0 x 2^-3, which is -0.125. Does that sound right?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yeah, I apologize I was not very clear. I am using C++, by the way.
The floating point format should be:
First bit is sign bit(- == 1, + == 0).
Next three bits are the exponent in excess-3 representation.
The last four bits are the significand (with 4 significant bits.)
*I forgot to mention that there is a hidden 1 bit to the left of the binary point for normalized
So, normalized 1 000 1000 would be...
-1.1000 x 2^-3 = -.0011 = -0.1875
and, using denormalized 1 000 1000 would be...
-0.1000 x 2^-2 = -.0010 = -0.125
Which explains the two different answers, however I want to use denormalized here.
In my program, it takes the users input for the binary byte and puts the input into a bool array of size 8. I want to write a function, "valueFP(bool input[], int 8)". Here is what I have, just kind of a test function. I need to make it so that the string output becomes it's mathematical representation.
void valueFP(bool input[], int n)
{
string sign;
string expCode = "";
int hiddenBit;
int exp;
string operand = "";
string tempVal;
float fpDecVal;
if(input[0] == 1)
sign = "-";
else
sign = "";
for(int i=1; i<=3; i++){
if(input[i] == 1)
expCode += "1";
else if(input[i] == 0)
expCode += "0";
}
for(int j=4; j<=7; j++){
if(input[j] == 1)
operand += "1";
else if(input[j] == 0)
operand += "0";
}
if(expCode == "000"){
exp = -2;
hiddenBit = 0;
}
else if(expCode == "001"){
exp = -2;
hiddenBit = 1;
}
else if(expCode == "010"){
exp = -1;
hiddenBit = 1;
}
else if(expCode == "011"){
exp = 0;
hiddenBit = 1;
}
else if(expCode == "100"){
exp = 1;
hiddenBit = 1;
}
else if(expCode == "101"){
exp = 2;
hiddenBit = 1;
}
else if(expCode == "110"){
exp = 3;
hiddenBit = 1;
}
else if(expCode == "111"){
exp = 3;
hiddenBit = 0;
}
else{
exp = 999;
hiddenBit = 999;
}
cout << sign << hiddenBit << "." << operand << " X " << "2^" << exp << endl;
}
modified on Wednesday, March 18, 2009 12:06 AM
|
|
|
|
|
Why are you using, at the same time the 'normalized' form and the 'de-normalized' one (depending on exponent)?
Do you know that, with the above code 10001000b != -.125f ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This should work.
void valueFP(bool input[], int n)
{
const int sign = input[0]?-1 : 1;
const int expCoded = (input[1]?4 : 0) + (input[2]?2 : 0) + (input[3]?1 : 0);
const bool denormalized = (expCoded==0) || (expCoded==7);
const int expDecoded = (expCoded^(denormalized?1 : 0)) - 3;
const double significand = (input[4]?0.5 : 0) + (input[5]?0.25 : 0) +
(input[6]?0.125 : 0) + (input[7]?0.0625 : 0) +
(denormalized?0.0 : 1.0);
cout << (significand * sign) << " x 2^" << expDecoded << endl;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Great, thank you. I changed the output to cout << (significand * sign) * (pow(2.0, exp)) << endl; which obviously just gives the floating point value once multiplied out.
After finishing this function I noticed that my one's and two's complement representation function is not working correctly. Any help would be greatly appreciated. Thanks.
void valueONESTWOS(bool input[], int n)
{
bool tempBin[8];
int intVal;
for(int z=0; z<8; z++)
tempBin[z] = input[z];
intVal = valueUINT(tempBin, 8);
if(tempBin[0] == 1)
{
int i = 7;
while(tempBin[i] != 1)
i--;
while(i>=0)
{
if(tempBin[i] == 1)
tempBin[i] = 0;
else if(tempBin[i] == 0)
tempBin[i] = 1;
i--;
}
cout << "One's complement: " << "-" << valueUINT(tempBin, 8) << endl;
cout << "Two's complement: " << "-" << valueUINT(tempBin, 8) + 1 << endl;
}
else
{
cout << "One's Complement: " << intVal << endl;
cout << "Two's Complement: " << intVal << endl;
}
}
|
|
|
|
|
WIth 2's complement, all you need to do is assign the bools to the bits of a signed char - integers on virtually all (if not actually all) processors are represented in 2s complement.
With 1's complement, assign the bools to the bits of a signed char and invert the bits if the most significant bit is set:
void valueONESTWOS(bool input[], int n)
{
const unsigned char raw = (input[0]?128 : 0) + (input[1]?64 : 0) + (input[2]?32 : 0) + (input[3]?16 : 0)
(input[4]?8 : 0) + (input[5]?4 : 0) + (input[6]?2 : 0) + (input[7]?1 : 0);
const signed char twosComplement = raw;
const signed char onesComplement = input[0]?(~raw):(raw);
const bool onesComplementIsNegative = input[0];
cout << "Twos complement = " << twosComplement << endl;
cout << "Twos complement = " << (onesComplementIsNegative?'-':' ') << twosComplement << endl;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'm trying to change the image from a excel picture object
VARIANT vindex;
vindex.vt = VT_INT;
vindex.intVal = 1;
Excel::Pictures pics;
m_CurrentWS.InvokeHelper(0x00000303,DISPATCH_PROPERTYGET, VT_DISPATCH, &pics, NULL);
Excel::Picture pic = pics.Item(vindex);
now how do I change the image? Is there a way around deleting the image and adding a new one?
modified on Wednesday, March 18, 2009 6:43 AM
|
|
|
|
|
Hi,
Please anyone can tell in which type of window our application
does not get WM_WINDOWPOSCHANING message,
What type of window I need to create so that i'll get this message in my application.
thanx in advance.
|
|
|
|
|
I think Windows will send WM_WINDOWPOSCHANING message for all type of windows. There is no exception in this case.
prvn
|
|
|
|
|
would u please give me sample code to trap this messagfe in dialog based application.
|
|
|
|
|
The same way you would any other message. If you are using VS6, open ClassWizard (Ctrl+W) and click the Class Info tab. In the Message filter combobox, select Window. Now go back to the Message Maps tab. Look in the Messages listbox for WM_WINDOWPOSCHANGING . Using VS200x is similar but I do not have it in front of me.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I use VC++2008, I show The result of my programs in Dos environment.
I want to know how I can showing the executed (RESULT) of my program in C++ (Win32ConsoleApplecation) in the windows environment ?
Thank you
thank you
soso
|
|
|
|
|
Could you explain that a bit more?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Is your program console or GUI (EXE or DLL)?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
my program (Win32 console Application )
thank you
soso
|
|
|
|
|
Then you can use printf() , fprintf(stdout, ...) , or cout to show the result(s) of your program.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|