|
Thanks for the link, just read it, it's instructive. It's easy to be smart afterwards, but i wonder why they didn't originally think of identifying discs, i mean, it's quite obvious it can be useful in certain situations. On the other hand, if i had generated a GUID and written it to a file called "DISC.GUID" in the root of every disc i ever burned then i'd be smarter now, but hey, who would ever think it could be useful sometimes in the future...
I wonder what alternatives there could be...like scanning the first 10 file names + file sizes and generating a hash of those, or somesuch, but such aproaches might turn out to be rather slow. The ID itself doesn't have to be unique on this planet, just around my home.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Code-o-mat wrote: The ID itself doesn't have to be unique on this planet, just around my home.
Try something like one of these[^]
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
That's a good one, and damn the "programmer mind", i even started thinking how one could mount a web camera above the optical disc drive's tray and write a program that recognizes and reads the number stamped onto the disc as it passes...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
This scheme might work for a limited set-up; it basically tries to identify a CD by hashing as few sectors as possible.
1. have a central database that stores one record per CD, holding a unique ID (auto assigned), a sectorCount number, and a CRC number. Also have a table that holds one number: numberOfSectors (it will start at 1, and increase monotonically over time).
2. have an app that allows to add new CDs to the system.
3. have a library that supports the recognition of known CDs.
The add-a-new-CD algorithm would be like so:
1. read first few sectors (as determined by numberOfSectors).
2. for all occurring values of sectorCount, calculate CRC, and search DB for a match.
3. if none found, simply add the new disk, and terminate.
4. if one found with sectorCount<numberOfSectors, flag it as no longer valid; add the new disk; goto 5.
5. for the flagged disks, re-process them (this will yield a new CRC over a larger number of sectors).
The recognize-a-CD algorithm would be like so:
1. read first few sectors (as determined by numberOfSectors).
2. for all occurring values of sectorCount, calculate CRC, and search DB for a match.
3. if one found, that is it.
4. if none found, this is an unknown CD, you can't handle it, you need the aad-a-new-CD algorithm.
Possible refinement:
on top of the above, you could also store the "total CRC" of a CD, so when one isn't recognized according to the above, you could still recognize it by brute force, then suggest the user officially adds it to the DB.
|
|
|
|
|
Sounds reasonable, thanks, will digest it some.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
you're welcome.
|
|
|
|
|
I have an MDI application with CView based on CZoomView , based on CScrollView . In CMyView::OnKeyDown(...) I try follow :
void CMyView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
int x = -1;
switch(nChar)
{
case VK_DOWN:
x = SendMessage(WM_VSCROLL,SB_LINEDOWN,(LPARAM)0);
TRACE("\n %d \n",x);
break;
default:
break;
}
CZoomView::OnKeyDown(nChar, nRepCnt, nFlags);
}
the output of TRACE is 0 , but still the window scroll don't work ... why ?
P.S. Of course , thw window have horizontal and vertical scroll .
|
|
|
|
|
Whether CMyView is derived from CScrollView?
Величие не Бога может быть недооценена.
|
|
|
|
|
Well , this is the project , with CMyView derived from CZoomView ... it will be a difference about this problem ?
|
|
|
|
|
if CZoomView is derived from CScrollView then no problem.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi,
I am trying to set the treeview resemblence in listctrl. Like insert + , - symbol in some item of the listctrl. To have treeview look, i used the following code
HANDLE hTheme = OpenThemeData(m_hWnd, L"TREEVIEW");
But hTheme returns Null.
Kindly give your suggestions on this. Show some samples for using this functions.
Thanks.
|
|
|
|
|
Is m_hWnd valid?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
hello guys... im doing TAPI project as my final year project. I am stuck in it. Well i've been looking for TAPI forums but could't find any. Where can I find these forums where I can post TAPI related questions?? thnx
|
|
|
|
|
First try on MSDN([^]), if not able to solve then ask here. That's what i prefer you do.
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi all,
i m using a multiline edit box and use enter for new line .
i want to enter only 10 lines in edit box and each line only have max 320 char.
here SetLimitText available but its set the total length of edit box.
please help for this.
thank in advance.
|
|
|
|
|
Can't you do this with 10 single line edit boxes placed in a column all limited to 320 characters?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Retrieve the line length using LineLength [^] and set the maximum character length of 10 lines, i.e.
CEdit cEdit;
// get the Edit control from the dialog.
cEdit.SetLimitText( 10* cEdit.LineLength );
Величие не Бога может быть недооценена.
|
|
|
|
|
how there may each line have diggrent number of character.
|
|
|
|
|
hi,
i have modified my code in such a way that the value for tmpVALUE when displayed,it shows eg'22.00000000.How do i get rid of the zero(s) in order for it to be a whole number. Here's my code.
void loop()
{
float tmpVALUE=0; char dataToSend[100];
if(!BT.createConnection("0003190D102D","02"))
{
USB.println("");
USB.print("--- CONNECTION -- MTU: ");
USB.print(BT.connection_mtu[0],BYTE);
USB.print(BT.connection_mtu[1],BYTE);
USB.println(BT.connection_mtu[2],BYTE);
}
else USB.println("Connection failed");
tmpVALUE = SensorEvent.readValue(SENS_SOCKET5);
if(tmpVALUE>0.5)
{
tmpVALUE=((int)((tmpVALUE-0.5)/0.01)); }
else
{
tmpVALUE=((int)tmpVALUE*0.01);
}
delay(100);
XBee.print("Temperature: ");
XBee.println(tmpVALUE);
delay(5000);
sprintf(dataToSend,"%.0f",tmpVALUE);
if(!BT.sendData(dataToSend)) USB.println("Data sent OK");
else USB.println("Error while sending data");
|
|
|
|
|
If you want to see the output as an integer, why don't you store the result in an integer and print it as an integer ?
int printValue = 0;
if(tmpVALUE>0.5)
{
printValue=(int)((tmpVALUE-0.5)/0.01);
}
else
{
printValue=(int)(tmpVALUE*0.01);
}
...
sprintf(dataToSend,"%d",printValue);
|
|
|
|
|
hi,thanks for replying.I already tried that method but the output display shows 0 on the receiver side.However,i managed to convert the decimal to whole number before sending the value out.Thanks for the help
|
|
|
|
|
I have built a program utilizing ADO to pull data from an Access Database. I am having problems taking this data which is formated as a _variant_t data type to a floating point array in C++. The following is the initial format of the array and the process that is attempting to populate this array. Can someone help me with a good source to learn about these conversions? Secondly, can someone help me with the proper code for the array so that it can be populated? At the bottom is the error message I am getting.
const int arraySize = 5000;
_variant_t OpenArr[arraySize];
ADODB::_RecordsetPtr recOpen = NULL;
while(!recOpen->EOFile)
{
record++;
Open = pOpenField->Value;
Open.ChangeType(VT_R4);
printf("Data_Open: %4.5f\n", Open.fltVal);
printf("Record: %d\n", record);
OpenArr[record]=recOpen->GetRows(-1,0);
recOpen->MoveNext( );
}
Data_Open: 1.41283
Record: 1
Error
Code = 800a0d5d
Code meaning = U
Source = ADODB.Recordset
Description = Application uses a value of the wrong type for the current operation.
|
|
|
|
|
Have you Googled for 800a0d5d?
Mike Certini wrote: OpenArr[record]=recOpen->GetRows(-1,0);
Have you tried other arguments to GetRows() ? I've never used it, but -1 looks odd as the number of rows to retrieve.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
My bad. I was using a slightly aged version of MSDN.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|