|
Hamid. wrote: mp3.
Do you mean concise, if I guess well.
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]
|
|
|
|
|
|
That's right but we tell mp3 or (new version mp4 )(I thought you know it,why you dont know you need a travel to my country ).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: why you dont know you need a travel to my country
Yours is a wonderful Country, I would like very much to travel to.
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]
|
|
|
|
|
Best time is spring you can see four seasons at this time the south is warm the north west is cold the center is moderate(almost) and the north is sultry.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You could open the file and read each character to see if it is a newline. This is not very efficient because of disk I/O but it will handle very large files. You could also read the entire file into a buffer and then read through the buffer counting newline characters. This is more efficient because disk I/O is done once, but it will not handle very large files. There are also functions that will read lines from files (they know internally to read to the next newline) so you could just count how many times a line is read.
"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
|
|
|
|
|
Or he could do the "inbetween" solution, create a buffer of some size and read as much of the file into it as he can, start counting and when he runs out of the buffer he can read more of the file in and continue with the same buffer starting from its beginning. This is much much much faster than reading char by char or line by line even, it will handle large files, but it won't eat up every bit of memory it finds hanging around the data bus "just chillin', wathching the game, having a beer".
> 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. <
|
|
|
|
|
You need to read line by line on the text files.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You could try this:
std::ifstream myFile("a.cpp");
int count = 0;
std::string s;
while (std::getline(myFile, s))
++count;
although I suspect this (counting the line-feed characters in the file) is slightly better:
std::ifstream myFile("a.cpp", std::ios::binary);
myFile >> std::noskipws;
std::cout << 1+std::count(std::istream_iterator<char>(myFile), std::istream_iterator<char>(), (char)10) << std::endl;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hallo to all,
i have an SDI-MFC application which is divided by a CSplitterWnd object to 2 parts, the upper part for input text and the lower part for the output text, i need to be able to print out the content of both parts individually. I treid to use the OnPrint() and OnPrintFile(), but both are protected members. Any help to solve this problem will be appriciated. Please explain or give a link to a site that explain in details. Thanks.
|
|
|
|
|
Since you have two CView -derived classes, and OnPrint() is a virtual function, you should be able to override it in each view.
"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
|
|
|
|
|
I have CEditView and OnPrint() is a protected member, i did not understand what dii you mean?
|
|
|
|
|
susanne1 wrote: I have CEditView...
Derive a class from it rather than use it directly.
"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
|
|
|
|
|
after driving a class from CEditView , i will define the protected OnPrint(CDC* pDc, CPrintInfo* pInfo)
as void OnMyPrint(CDC* pDc, CPrintInfo* pInfo)
{
which code comes hier?
}
|
|
|
|
|
susanne1 wrote: which code comes hier?
What ever you need to print the contents of that view. There's no one-answer solution.
As a test to make sure you're on the right track, you could do something like:
void CEditView1::OnPrint(CDC* pDc, CPrintInfo* pInfo)
{
pDC->TextOut(5, 5, "This text is from CEditView1", 28);
}
void CEditView2::OnPrint(CDC* pDc, CPrintInfo* pInfo)
{
pDC->TextOut(5, 5, "This text is from CEditView2", 28);
}
"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
|
|
|
|
|
|
It will be my second time to design a website. Last time I use C# and ASP.net all I do in my teem is writing event manipulation C# code begind every important component(such as buttons, textbox, etc..). I know little a bout what happens after a user send a get message( which looks like: GET www.dodd.com/dkdlf.html HTTP 1.1/r/n.....) and how this data is transfered and maninulated by what? What's the relationship between Server II and C#code and ASP.net code. I really don't know nothing about this and I need a book that can at least demonstrate these things in a clear way.
Can someone provide a book fulled my demands?
It will be greatly appreciated because I really want to make myself clear at what i'm doing.
Thanks!
Jack
|
|
|
|
|
I have a book about Beginnig ASP.NET 3.5 in C# 2008 (Second Edition Matthew MacDonald)
I write for you list of its chapters:
Part 1 Introducing .NET
Part 2 Developing ASP.NET Applications
PART 3 Building Better Web Forms(Validation,Rich Controls,User Controls and Graphics,Styles, Themes, and Master Pages,Website Navigation)
PART 4 Working with Data
PART 5 Website Security
PART 6 Advanced ASP.NET
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thanks, obvious it's no my cup of tee.
btw, i have another book <high permance="" web="" site=""> that was publiched by O'lley, is extreme good.
But i need a full view of designing and publicizing of a web site.
Thanks, though.
|
|
|
|
|
BTW does your previous problem solve?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
if you are referring the Heap Management problem yes
if "CRT runtime error, must terminate the application" then no, alas.
|
|
|
|
|
JackPuppy wrote: C# and ASP.net
And so you asked in the C++/MFC message board. Good move, Einstein. Why didn't you try the correct one[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi, I have problems whith the BOOST <unordered_map> container.
GetMessageFunctorHashMap() returns an unordered_map<string,Functor*>.
Then I try to insert a new item. The operation seems to be OK but when I request if the container is empty i allways recieve TRUE.
Can anyone helps me, please?
GetMessageFunctorHashMap()["Hello"]=(Functor*) new SpecificVoidFunctor<messagesystem>(this, &MessageSystem::Exit);</messagesystem>
GetMessageFunctorHashMap().empty(); returns 1
Thanks!
|
|
|
|
|
If the result type of GetMessageFunctorHashMap is unordered_map<string,Functor*> , then your first line of code modifies a COPY of your unordered_map ...which is then discarded, because it goes out of scope.
To modify the unordered_map that GetMessageFunctorHashMap references, the return type needs to be a reference to unordered_map<string,Functor*> , i.e. unordered_map<string,Functor*>&
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
You are right! Thanks!
Now the code crashes in the string library when internally the Unordered_Map container tries to compare two strings. Anyone knows if unordered_map can compare and hash strings by default? Or i have to define the hash function and the compare function?
Thanks!
|
|
|
|