Friday, March 14, 2008

Some String manipulation

I have written down few string manipulation routines. First one can replace a word. Here is the code:


std::string string_replace(std::string src, const std::string fnd, const std::string rep, int time=-1) {
int count = 0;

std::string::size_type index = src.find(fnd);
while(index != std::string::npos && (count < time || time == -1) {
src.erase(index, fnd.size());
src.insert(index, rep);
index = src.find(fnd, index + rep.size());
count++;
}

return src;
}


Second routine is a string splitter:
std::vector string_split(std::string str, const std::string deli) {
std::string::size_type pos = 0, index;
std::vector result;
std::string token;

index = str.find(deli);
while(index != std::string::npos) {
token = str.substr(pos, index - pos);
if(token.size())
result.push_back(token);
pos = index + deli.size();
index = str.find(deli, pos);
}

if(pos <>
result.push_back(str.substr(pos, str.size()));
}

return result;
}


Wednesday, November 28, 2007

Plug-in development for VS 2005
I am thinking about to development a plug-in for VS2005. I think it will not be a very hard job. I started google search to find any sample project which could help me jump start into it. I found this useful visual studio extensibility site.
I found initial information from that site to kick off my self study project. I am confident that I could write down a sample plug-in for microsoft visual studio 2005.
The following types of plugin was walking around in my mind:
  1. Java source code compilation add-in for VS2005.
  2. Test class generator add-in for C# class for NUnit.
  3. more...

My primary target is to develop a very simple one within next four days. This plug-in might help my current EA (Electronic Arts) project.

Now it's time to firing...

Labels:

Sunday, October 28, 2007

Today I got my high speed internet connection. :)

Now I can participate different events. Learn more from web. And don't need to worry about the time when I am online.

I rent the connection from GP. It is called EDGE P2 connection. It will cost 850TK per month.

Connection speed is good. I am enjoying...

I bought a new cell phone. It is Nokia-5700. I like it. I am accessing internet through this cell phone. It looks good.

Tuesday, October 02, 2007

Binary Search in 3D Sorted Data Structure

I am thinking about it. Hopefully it will be more efficient then one or two dimensional binary search.


To be continue...

Labels:

Real Time Video Searching

Is it possible to extract the voice data to text format from a video file. If it is possible then we could use the text searching strategy to search a specific context inside a video file. We might get some issue over it.
  • How could we differentiate music and speech data?
  • How could we translate a voice data to text data?
It will continue...

Labels:

Sunday, September 23, 2007

How do I feel?

Life is very much----???

Need to find...

Monday, June 12, 2006

This is my first night to spot a blog.

Nothing to say.