|
Hi,
Reply me whether my code is works for u or not.By seeing ur question i tried that program.
|
|
|
|
|
Hi all,
I am trying to develop a text mining engine and in it i need to work on large number of files...and deal with lots of words... i ve made a word class which has following variables
public string term;
public int df;
public ArrayList tf = new ArrayList();
public ArrayList docID= new ArrayList();
public static int count;
here term is the variable wich contains the actual value of the word. now when user queries for a word i need to search all these terms and find out whether the term user wants exists or not....
i ve this word class sorted w.r.t the "term" variable so it means that i can apply binary search for finding the user query.....i m doing this by adding all the term variables of the class in an arraylist and then applying binary search over it....but the problem is that i need to know the index of the arraylist where the user's queried term exists.....and i dont know the way to find out the index i ve added the sample chunk of code here.....anyone plzz help
for(int i = 0; i < Terminology .count; i ++ )
{
allTerms.Add(word[i].term);
}
for(int j = 0; j < queryList.Count; j ++)
{
if(allTerms.BinarySearch(queryList[j]) >= 0)
{
need to know the index of allTerms ArrayList.
}
}
looking forward for help
Regards,
|
|
|
|
|
Ehh, BinarySearch returns the index. If it just indicated if the item was present or not it would have returned a bool.
It is also worth noticing that in case the item is not found, the return value indicates the position the item should have been at if it was present (useful for inserting in the list after it is sorted).
All of this is in the MSDN documentation.
|
|
|
|
|
i really thought that it just returns a bool value....now i understand a little bit....but it wud b really helpful if u illustrate it with a little example
thxx in advance
regards,
|
|
|
|
|
Did you look at MSDN[^] as I wrote? Always look in MSDN first - it is the official documentation for the .NET Framework, and it contains a decent amount of samples.
|
|
|
|
|
Hello, I have looked everywhere and can not find an example of how to mimmic the right click "save picture as" in Internet Explorer. I am building my own tabbed web browser and want to right click an image and have the "save picture" dialog box pop up. I am using VS 2005. Thank you for any information.
|
|
|
|
|
How are you implementing HTML rendering?
If you're just using the MS browser control, this is difficult. It'd depend mostly on having an API hook into mapping between x, y coords and rendered elements within the control. If there's one, it's a pretty easy task (ask).
If you wrote the HTML page rendering yourself, you probably know how to do this already, but just inspect the x, y coords from the right-click event args and see if it falls within the bounds of an image. If it does, you've already rendered the image, so getting a handle to the stream and writing it to disk should be pretty easy.
|
|
|
|
|
If you want complete control you can use the WebBrowser.Document.GetElementFromPoint method. This will return a reference to the HtmlElement under the mouse. Check that the HtmlElement.Name is IMG (i.e. an image tag), if so then you can use HtmlElement.GetAttribute("src") to retrive the url of the image.
You can then use the System.Net.WebClient.DownloadFile method to actually download the file when the user has specified where the image is to be saved.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi,
Due to the fact we got billed double the monthly cost this month, i want to write a small console app that will run in the background and monitor traffic (total/daily/monthly) for the 3 machines on my home network (mainly the kids) can anyone point me in the right direction? Classes or Tutorials i should be looking at? Because i cannot find a thing on it.
I'm hoping it goes as far as accessing some of the Windows API or similar and does not involve things like network card driver wrapping or what have you. If it does i will start looking at commercial software.
These small clip video sites must be taking their toll!.
|
|
|
|
|
Take a look into WMI. There's a .NET wrapper for it. It's basically the same stuff you'd get through perfmon.msc, but an API into it. The WMI writer API for .NET is horribly sparsely documented, but the read API isn't too bad.
Start here[^].
|
|
|
|
|
Excellent just what i need to get started, thank you.
|
|
|
|
|
|
Darren,
Thanks for posting your findings. I'm sure someone will really, really appreciate that.
Isn't there some Yahoo Widget or something somewhere that will let you do this without writing it yourself? Seems like that may be much easier if you only need simple "how much bandwidth am I using right now" functionality.
Stephan
|
|
|
|
|
I found a few commercial programs and possibly some free ones too but i dont want the kids to feel im intruding, since the two that use the other computers are 12 and 14 they might feel a bit child like.
So basically i wanted to stick it in there without them noticing, have it run at startup and send results to a php script or little server running on my machine or laptop.
There are three more reasons too:
1. I wanted to analyse what it was. interested to see if its streaming video from these YouTube or similar small clip sites or if it was something else, 73GB in a month works out at 5.5 days solid full speed.
2. I have a thirst for knowlege and love programming.
3. I am thinking about writing another desktop app that does multiple funky things for you so this could be another thing to add to it (2 for the price of one )
Darren
|
|
|
|
|
I'm reading chapter 1 of Lippman's C# Primer. He talks about using the
"-t" option. Could some one please elaborate what this means and why I would want to do it... thanks a lot
|
|
|
|
|
-t option for what?
|
|
|
|
|
It means that when you can't figure something out, you should take a break for some tea. Hence the -t. You know, dash off and get some tea.
Chris Meech
I am Canadian. [heard in a local bar]
The America I believe in has always understood that natural harmony is only one meal away from monkey burgers. [Stan Shannon]
GOOD DAY FOR: Bean counters, as the Australian Taxation Office said that prostitutes and strippers could claim tax deductions for adult toys and sexy lingerie. [Associated Press]
|
|
|
|
|
Tracing is running with additional back-end output. You should be able to figure out what's going on based on this. In C#, System.Debug.Trace is a static class that drives trace output.
The C# compiler (csc) doens't have a -t command line option. What program is at the beginning of the command line that Lippman is quoting here?
|
|
|
|
|
I dont know if there is any option -t but there is a command line option /t that specifies the type of target assembly i.e. whether its exe,dll or module.
Wasif Ehsan.
|
|
|
|
|
|
maybe Stack and Heap have something to do with the answer
|
|
|
|
|
I don't think the question is so much about *recognizing* them. It recognizes them because value types are all C# reserved keywords. If it finds one where it expects an object l-value, it knows it's a value type.
Are you trying to figure out what the difference is between the two?
This isn't the right place for this question. It's a .NET question, not a C# question. Then again, if you're asking this board to answer your interview question, you probably don't know the difference between the CLR and C#. Good luck keeping the job if you get it.
|
|
|
|
|
hello all,
in my .NET 2.0 WinForm. I want to add Name, Value in Combobox. but There is no ListItem in .NET 2.0.
How to do this
regards
GV Ramana
|
|
|
|
|
Ramana. G.V wrote: There is no ListItem in .NET 2.0
Why do you think that?
---
b { font-weight: normal; }
|
|
|
|
|
Try using DisplayMember and ValueMember properties of the ComboBox with a ArrayList .
public class Person
{
public Person(string name, int age)
{
this.name = name;
this.age = age;
}
public string Name
{
get { return name; }
}
public int Age
{
get { return Age; }
}
private string name;
private int age;
}
ArrayList people = new ArrayList();
people.Add(new Person("Nick", 26));
people.Add(new Person("Bob", 20));
this.comboBox1.DisplayMember = "Name";
this.comboBox1.ValueMember = "Age";
this.comboBox1.DataSource = people;
|
|
|
|