|
Hello,
Do someone can provide me with a simple full text search that search for english and arabic words.
I tried Lucene.dll but it not supporting arabic words.
best regards.
Elie
dghdfghdfghdfghdgh
|
|
|
|
|
Try to compose your own code, we'll be happy to help you with any bugs.
or, try rentacoder[^] if you're willing to pay to get it done, no one does work for free.
|
|
|
|
|
I'm implementing a filter, and need to indicate if the filters applied are hiding one or more row, or if all the rows are visible.
My first thought was to use DataGridView.DisplayedRowCount() , but it returns the number of rows that are actually shown on the screen. If there are enough rows to trigger a vertical scroll this isn't the same because rows that are off the top/bottom of the list are not counted.
Is there another method/property I'm not seeing, or will I have to iterate over the entire Rows collection?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
I can think of two ways: put the filtered rows in a datatable and then get the count or iterate.
By the way, how are you doing the filtering? It might help finding a better way.
जय हिंद
|
|
|
|
|
foreach (DataGridView row in myDataGridView)
{
Row.Visible = PassesFilter (row);
}
The data is not coming from a database, and isn't coming via a datatable as a result.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Why not have a variable to hold the number of visible and hidden rows here itself? Something like:
int VisibleRows = myDataGridView.Rows.Count;
foreach (DataGridView row in myDataGridView)
{
if(!PassesFilter (row)){
Row.Visible = false;
VisibleRows--;
}
}
जय हिंद
|
|
|
|
|
That sounds like the way to go. Sometimes the problem with refactoring older uglier code* is that obvious solutions are missed.
* I started out with two ListViews, one displayed and a hidden one storing an unfiltered copy of the data. The code cleared the displayed one and then repopulated it with rows that passed the filter.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Hi, I'm doing a calendar like program and I'm using buttons as time slots. And I need to simply call a method that will be called by any button that is clicked inside this time slot and when the method is called it will read the button's name.
example
btn800Am_clicked - will open timeslot
btn900Am_clicked - will open timeslot
btn1000Am_clicked - will open timeslot
private void timeslot_Click(object sender, EventArgs e)
{
calculate(x.name);
}
private void calculate(string name)
{
messagebox.show(name);
}
|
|
|
|
|
the sender is the buttun that sent the object so you can do
button x = (button)sender;
PS please put code in code blocks makes it easier to read!
|
|
|
|
|
"PS please put code in code blocks makes it easier to read!" Thanks for the suggestion will use it next time. And thank you for the quick response.
|
|
|
|
|
You already have this information - in the sender parameter. All you need do is cast it to a Button and then use the name from that, e.g.
string name = ((Button)sender).Name;
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Oww yeah... I'm quite fresh in coding. But thank you very much for the quick response and right what I needed
|
|
|
|
|
Hi,
on top of that all, you don't have to use the Name property (if the Form got designed with Visual Designer it won't like you change a Control's Name). You could use its Text property instead, or store something in the Tag property.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Yeah, I prefer to use the Tag too, that way I can associate an object with the control, much cleaner.
|
|
|
|
|
private void btn0_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
check();
if (btn.Name == btn0.Name)
{
txtcalculate.Text = txtcalculate.Text + "0";
}
if (btn.Name == btn1.Name)
{
txtcalculate.Text = txtcalculate.Text + "1";
}
if (btn.Name == btn2.Name)
{
txtcalculate.Text = txtcalculate.Text + "2";
}
}
//make all the button event to be btn0_Click
Padmanabhan
|
|
|
|
|
Thank you. Got it working now
|
|
|
|
|
hi peoples..
i m designing an application in wpf scree, of which i have to dunamically move the label.. for that i have to set the margin,
how to set the margin in c# coding??
|
|
|
|
|
yourLabelName.Margin = new Thickness(5);
Try asking in the WPF forum next time.
(Also setting the margin from code kinda breaks the idea of WPF code/UI separation, you should be binding to something instead, but I'm not gonna interfere, maybe your doing it for a good reason. Just read about MVVM and WPF design)
Simon
|
|
|
|
|
Hi there,
I'm working on a program which has to record as many video streams as it can, coming from a server. I tested the source capacity with some other programs and it got up to 100 streams coming without any problem.
So I made my own program, using a class which starts a thread. This thread opens a connection using HttpWebRequest and gets its response stream and writes incoming data into a file, all of them done synchronously.
I create one class per one video stream. using this method everything is OK just before I reach 10 records, from this time on, no new stream opens.
What do I have to do?
I'm not reaching any memory, network bandwidth or things like that.
Thanks for your help.
|
|
|
|
|
Limitation on concurrently running threads would be my assumption, from a quick search on google you can only have 25 threads running concurrently.
Check me out[^]
|
|
|
|
|
I don't think so.
1. The ThreadPool has some methods to find out the limits, and they typically are well above 100. I got maxPoolThreads=500 the other day.
2. It isn't even sure the ThreadPool is getting involved in all this.
I rather suspect the networking itself having a built-in concurrency limitation.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
That's why you have a 'spiffy-er' icon then me.
I knew it had to do with concurrent thread limitations, just I remembered reading the XP SP2 had reduced the limit to 50 (I think, may be smaller) so I just assumed it was a .net limitation.
You're probably right though, it was a loooo-ooo-ooo-ng time ago.
|
|
|
|
|
EliottA wrote: That's why you have a 'spiffy-er' icon then me.
Yes the icon is fine, however on the who-is-who pages 5000-plussers get called "fixtures", makes me feel like part of the furniture around here.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks for answers, but I found the reason.
I just found out about req.ServicePoint.ConnectionLimit where req is my HttpWebRequest object. I had to increase this one instead of ServicePointManager.DefaultConnectionLimit.
now I got 60 threads running simultaneously but I want to ask if there is such a limit to concurrent threads or I can increase thread counts up to any where?
Thanks again
|
|
|
|
|
Hi,
AFAIK the Thread class can be instantiated as long as you don't run out of very basic resources, such as virtual memory (maybe physical memory), and Windows handles. After all, when you look at Task Manager, Windows is running some 100 processes while "doing nothing", and most of these processes have several threads.
There are some limitations in other layers, some fixed, some variable; IIRC the maximum number of threads in the ThreadPool is fixed as the ThreadPool is used by .NET initialization code, hence it is created when a .NET process gets started but long before the user's code is running. And they did not provide a way to grow it.
Networking code often has limitations because it is deemed counterproductive to exceed a certain number, which probably is right most of the time, but would work against you in some situations, e.g. when you want to stress test a server with as few physical clients as possible.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|