Thursday, 11 March 2010
so my mom wouldn't forget what she looks like
Barn Owl - (made front page of Explore)
Beauty
Emsworth Jetty Sunset
bball - Final shot
Summer pleasures
Samuel Gaudreault, Clarinettiste
Explosion
Moments.............
Praliament & Wake sneak peek
Zsofia
Airportman #2
shine
Below the Lighthouse
“Insecurity is just something that's there all the time. I've never been crippled by it.” ~ Catherine Keener
the overpass
Remnants of Christmas...
sorting and cleaning text file with link list c++ PDF Print E-mail

(link list ilen saçmalamaca) txt dosyamızdaki tüm veriler önce link listimize geçirilir ardından sıraya sokulur ardından aynı olanlar silinir sonra her iteratordeki abuk sabuk karakterler silinir sonra tekrar sırala tekrar sil yaz out.txt ye yeah
6 mb lık veriyi 6 sn de işlemektedir afferim ona diorum p4 3ghz ilen.

#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <list>
#include <windows.h>

using namespace std;


int main()
{

long int before = GetTickCount();

list<string>::iterator it;
list<string> sL;
ifstream in("in.txt");
ofstream outL("out.txt");
string word;
char ignore[] = { '`''!''’''-''_''0''1''2''3''4',
'5''6''7''8''9''@''#''$''%''^''&''*''('')',
'~''"'',''.''=''/''<''>''['']''{''}'';'':',
'?''|''+''*'"'" };


while(in >> word){
transform(word.begin(), word.end(), word.begin()tolower);
sL.push_back(word);
}

sL.sort();
sL.unique();

for ( it = sL.begin() ; it != sL.end() ; it++ )
{
for (int i=0;< 43; i++)
it._Ptr->_Myval.erase( remove(it._Ptr->_Myval.begin(),it._Ptr->
_Myval.end(), ignore[i]) , it._Ptr->_Myval.end() );
}

sL.sort();
sL.unique();

for ( it = sL.begin() ; it != sL.end() ; it++ )
outL << *it << endl;

long int after = GetTickCount();
cout << "Elapsed Time "<< (after-before) << " ms\n";

system("PAUSE");
return 0;
}

Bookmark with:

Deli.cio.us    Digg    Facebook   
 

Your are currently browsing this site with Internet Explorer 6 (IE6).

Your current web browser must be updated to version 7 of Internet Explorer (IE7) to take advantage of all of template's capabilities.

Why should I upgrade to Internet Explorer 7? Microsoft has redesigned Internet Explorer from the ground up, with better security, new capabilities, and a whole new interface. Many changes resulted from the feedback of millions of users who tested prerelease versions of the new browser. The most compelling reason to upgrade is the improved security. The Internet of today is not the Internet of five years ago. There are dangers that simply didn't exist back in 2001, when Internet Explorer 6 was released to the world. Internet Explorer 7 makes surfing the web fundamentally safer by offering greater protection against viruses, spyware, and other online risks.

Get free downloads for Internet Explorer 7, including recommended updates as they become available. To download Internet Explorer 7 in the language of your choice, please visit the Internet Explorer 7 worldwide page.