Click here to Skip to main content
15,892,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Internet Time? Pin
David Crow19-Sep-06 9:52
David Crow19-Sep-06 9:52 
GeneralRe: Internet Time? Pin
Larsson19-Sep-06 12:55
Larsson19-Sep-06 12:55 
GeneralRe: Internet Time? Pin
Christian Graus19-Sep-06 13:21
protectorChristian Graus19-Sep-06 13:21 
QuestionRe: Internet Time? Pin
David Crow20-Sep-06 2:42
David Crow20-Sep-06 2:42 
Questionsend args to constructor when using RUNTIME_CLASS Pin
BlackDice19-Sep-06 9:02
BlackDice19-Sep-06 9:02 
AnswerRe: send args to constructor when using RUNTIME_CLASS Pin
Christopher Duncan19-Sep-06 16:56
Christopher Duncan19-Sep-06 16:56 
QuestionNeed fast method to read/convert floats from disk Pin
nadiric19-Sep-06 8:35
nadiric19-Sep-06 8:35 
AnswerRe: Need fast method to read/convert floats from disk Pin
Zac Howland19-Sep-06 9:01
Zac Howland19-Sep-06 9:01 
nadiric wrote:
not sure if reading them all in at once, and applying a macro-bit-shift would be faster?


Yes. Reading them in one at a time increases disk access (which is expensive). Reading them in as a block decreases the number of reads required to get your data.

Something along the lines of the following should work:

// for converting float
float endian_shift(const float& f)
{
	float ret = 0.0;
	ret |= (f << 24);
	ret |= ((f >> 8) << 24) >> 8;
	ret |= ((f >> 16) << 24) >> 16;
	ret |= (f >> 24);
	return ret;
}

// for reading data
ifstream fin;
fin.open("myfile.dat", ios::binary);
vector<float> myData(SIZE);
copy(istream_iterator<float>(fin), istream_iterator<float>(), back_inserter(myData));
fin.close();
transform(myData.begin(), myData.end(), myData.begin(), endian_shift);


If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

QuestionRe: Need fast method to read/convert floats from disk Pin
nadiric19-Sep-06 10:46
nadiric19-Sep-06 10:46 
AnswerRe: Need fast method to read/convert floats from disk Pin
Zac Howland20-Sep-06 10:25
Zac Howland20-Sep-06 10:25 
QuestionEnumerate USB Hubs? Pin
4tau19-Sep-06 8:31
4tau19-Sep-06 8:31 
AnswerRe: Enumerate USB Hubs? Pin
jk chan20-Sep-06 21:10
jk chan20-Sep-06 21:10 
QuestionMoving the mouse pointer Pin
Grimes19-Sep-06 8:06
Grimes19-Sep-06 8:06 
AnswerRe: Moving the mouse pointer Pin
Chipperm19-Sep-06 8:22
Chipperm19-Sep-06 8:22 
QuestionRe: Moving the mouse pointer Pin
Grimes19-Sep-06 8:54
Grimes19-Sep-06 8:54 
AnswerRe: Moving the mouse pointer Pin
Chipperm19-Sep-06 8:59
Chipperm19-Sep-06 8:59 
AnswerRe: Moving the mouse pointer Pin
PJ Arends19-Sep-06 9:02
professionalPJ Arends19-Sep-06 9:02 
QuestionHow to display bitmap in another window? Pin
ajcrm12519-Sep-06 7:52
ajcrm12519-Sep-06 7:52 
AnswerRe: How to display bitmap in another window? Pin
Christopher Duncan19-Sep-06 17:01
Christopher Duncan19-Sep-06 17:01 
GeneralRe: How to display bitmap in another window? Pin
ajcrm12520-Sep-06 3:13
ajcrm12520-Sep-06 3:13 
GeneralRe: How to display bitmap in another window? Pin
Christopher Duncan21-Sep-06 0:39
Christopher Duncan21-Sep-06 0:39 
QuestionSpy mouseclicks with LibUsb in windows Pin
Lastwebpage19-Sep-06 7:14
Lastwebpage19-Sep-06 7:14 
QuestionGetTextExtent(str) returns different sizes when zooming. Pin
dpicon19-Sep-06 7:11
dpicon19-Sep-06 7:11 
AnswerRe: GetTextExtent(str) returns different sizes when zooming. Pin
includeh1019-Sep-06 7:42
includeh1019-Sep-06 7:42 
GeneralRe: GetTextExtent(str) returns different sizes when zooming. Pin
David Crow19-Sep-06 7:52
David Crow19-Sep-06 7:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.