|
???? The method only return Zero - one as integer.
Does the method print/compute "translatioin" for user????????
I am out of here. It's not worth to "chat"...........
|
|
|
|
|
You obviously missed Chen's original post. It had TWO 'for' loops. The first one translated the string. The second one counted the 0s and 1s.
|
|
|
|
|
I have a popup in my pc that have me very tired.
Every time that I start my explorer it starts and I am very closer to format my machine....
any body knows where I can look in the registry to find the dll that is making that. The popup is the green lotery of USA. Please any body can help me. May be Michael Dunn knows where the dll is....
Thanks in Advance
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Unfortunately, IE launching popup-ad windows is an all too common occurence these days. Its not a DLL that is the culprit but embedded script and/or an ActiveX control.
One thing you can do is to change your browser's security settings. By default, most items are set to Enable, where they should actually be Disable or Prompt.
Another is to install an ad-blocker program. These are just BHOs (Browser Helper Objects). Some are good while others aren't.
|
|
|
|
|
Haven't you been visiting pr0n sites lately ? or serialz sites ?
It's very likely the plugin registers as the default IE/Explorer search extension :
check out weird values in HKCR\Software\Microsoft\Internet Explorer and
HKLM\Software\Microsoft\Internet Explorer.
Look up those subkeys :
- Main
- Search
- Toolbar
- Extensions
|
|
|
|
|
I have these two lines in my code but the second line throws an exception saying that the recordset is writeprotected, what could be the problem>?
<br />
CRecordset myRecordSet.Open(CRecordset::dynaset, NULL, CRecordset::appendOnly);<br />
myRecordSet.AddNew();<br />
|
|
|
|
|
Upon failure, what is the value of CDBException.m_nRetCode?
|
|
|
|
|
I found the problem, it was caused by one of the columns in the table having the identity field set so that it automatically filled in the id for the row. Apparantly the CRecordSet class cannot handle that ...
|
|
|
|
|
Hi!
I have a vector<int> which could be {0 2 53 84 962 1120}, i.e. it is sorted.
Now assume I have a value x, i'd like to get the highest value which is lower than x in the list. (i.e. if x =250, the result would be 84, since 84<250 and 250>962)
Of course, I already have a solution -- iterating through the vector, but i'd like to know if there is a way to do it using algorithm (like defining a predicate less<int,250> and using the max_element algorithm with that predicate (which would throw the max value of the vector which is lower than 250 Ouf !). Is that possible ? If yes, what would be the exact code for it ?
Thanks !
~RaGE();
|
|
|
|
|
You could use lower_bound() to get the position of first equal or greater element and then move 1 place back in the vector (after checking you didn't get the begin or end iterator).
|
|
|
|
|
clever ! Thanks !
~RaGE();
|
|
|
|
|
A very quick response - not much thought went into it. Please check it before using.
Sort the vector descending
ie, {1120, 962, 84, 53, 2, 0}
Now look for the first value less than 250
comparison fn:
bool compare(value1, value2)
{
return value1 < value2;
}
std::lower_bound(vec.begin(), vector.end(), 250, compare);
returns the required iterator.
Thomas
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
thanks, very good !
~RaGE();
|
|
|
|
|
If your looking for a little more speed on the lookup, you could use a 'set', as it will be pre-sorted. Only thing is there is an increased overhead in loading the items.
Of course a 'set' is for unique values. If you require the abbility to store duplicates then you could use a 'multiset'.
All you need to do then, is find the value you are looking for or the nearest one, and search one place in the correct direction.
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
|
Note the use of reverse iterators and binders.
vector<int> v;
vector<int>::reverse_iterator iter;
iter = find_if(v.rbegin(), v.rend(), bind2nd(less<int>(),250));
|
|
|
|
|
|
Dear all,
I have two template functions for displaying books and members respectively from arrays.
<br />
template<class Object><br />
void List<Object>::displayBook(char* type)<br />
{<br />
if (num_elements == 0)<br />
cout<<"No "<<type<<" is found in the "<<type<<" array.\n";<br />
else<br />
for(int element=0; element<this->num_elements; element++)<br />
{<br />
cout<<'\n';<br />
this->element_list[element]->display(association_list.get_member(element_list[element]));<br />
}<br />
}<br />
<br />
template<class Object><br />
void List<Object>::displayMember(char* type)<br />
{<br />
if (num_elements == 0)<br />
cout<<"No "<<type<<" is found in the "<<type<<" array.\n";<br />
else<br />
for(int element=0; element<this->num_elements; element++)<br />
{<br />
cout<<'\n';<br />
this->element_list[element]->display(association_list.get_book(element_list[element]));<br />
}<br />
}<br />
The function prototypes are:
<br />
Member* get_member(Book* book);<br />
Book* get_book(Member* member);<br />
and the functions implementation code is:
<br />
template<class Book,class Member><br />
Member* AssociationList<Book,Member>::get_member(Book* book)<br />
{<br />
Member* member=0;<br />
bool searching=true;<br />
int index=0;<br />
<br />
while(searching)<br />
{<br />
if (this->association_list[index])<br />
if (this->association_list[index]->linked_book()==book)<br />
{<br />
member=this->association_list[index]->linked_member();<br />
searching=false;<br />
}<br />
else<br />
index++;<br />
else<br />
index++;<br />
if (searching && (index == LIST_SIZE))<br />
{<br />
searching=false;<br />
}<br />
}<br />
return member;<br />
}<br />
<br />
template<class Book,class Member><br />
Book* AssociationList<Book,Member>::get_book(Member* member)<br />
{<br />
Book* book=0;<br />
bool searching=true;<br />
int index=0;<br />
<br />
while(searching)<br />
{<br />
if (this->association_list[index])<br />
if (this->association_list[index]->linked_member()==member)<br />
{<br />
book=this->association_list[index]->linked_book();<br />
searching=false;<br />
}<br />
else<br />
index++;<br />
else<br />
index++;<br />
if (searching && (index == LIST_SIZE))<br />
{<br />
searching = false;<br />
}<br />
}<br />
return book;<br />
}<br />
Could someone tell me how can I use One Template Function Instead of Two (if this is possible)?
Apologies for posting the similar question many times.
grscot
|
|
|
|
|
try implement func^n overloading/overriding
|
|
|
|
|
I'm looking for an editor which I can use for C or C++ application compiled from command prompt with build.exe or nmake.exe utility.
It is difficult for me to use the MSDEV.EXE.
Thank you in advance,
Seval YILMAZ
|
|
|
|
|
|
I am using VC7, non-MFC
I have two DateTimePicker controls in a dialog box
one to display Time and one to display Date(ShortDate)
The my main problem is I CAN NOT DISPLAY ANY TIME OR ANY DATE I WANT => they always only display current time and current date
such as:
now = 05:57:00 PM Wed 30th, April 2003
so, they display as "05:57:00 PM" and "30-04-2003"
If I want them display as "02:12:53 PM" and "03-03-1990"
How can I do to obtain the correct results ??????
thank alot!!!!!!
and how to change "02:12:53 PM" to "14:12:53" format ???
|
|
|
|
|
Have you looked at any of the following messages:
DTM_SETFORMAT
DTM_SETSYSTEMTIME
|
|
|
|
|
that is DTM_SETSYSTEMTIME
thank
it's my mistake >> i dont check return value
thank you
|
|
|
|
|
Hi all,
I need to implement a small editor using syn.-coloring and multiple undo/redo actions.
Syn.-coloring works fine for riched32.dll, but this does not support multiple undo/redo.
1.
Richedit 2.0 supports undo/redo, but there is a strange diffrence between RE 1.0 and 2.0 which causes problems with my coloring function. Version 1.0 translates CR/LF pairs into one '\n', when copying the contents of the control into a CString, Version 2.0 does not (leaves the pairs, so there are to chars in the CString). That of course confuses the syntax coloring when using diffrent versions. Has anybody an idea to work around this diffrence without version checking of the RE versions?
2.
Does anybody know if there is a possibility to prevent coloring and selection actions inside the RE 2.0 control from being recorded into the undo/redo buffer? I just want to record typing actions.
Thanks for replies,
Giovanni
|
|
|
|