filtering

Filtering in LINQ

From the given setup IEnumerable<int> one = new int[] { 1, 2, 3, 4, 5, 6, 7 }; IEnumerable<int> two = new int[] { 12, 34, 56, 7, 8 }; MySet[] sets = new MySet[] { new MySet{ MySetID =100, MySubSet=new MySubSet{SubSet=new List<int>(one), SubSetID=1212}}, new MySet{ MySetID =101, MySubSet=new MySubSet{SubSet=new List<int>(t...

Design pattern for filtering a collection of items?

Imagine the typical type of application where you have a list of items with different properties. E.g. a tree-view with 100 items, each having a name, a rating, a rank-within-the-hottest-items-on-the-planet etc. Probably there are also many-to-many relationships between items and item-catalogs, or between items and item-creators etc etc....

Better to filter a stream of data at its start or end?

Hi folks, I'm working on a project in which I need to process a huge amount (multiple gigabytes) of comma separated value (CSV) files. What I basically do is as follows: Create an object that knows how to read all related files Register with this object a set of Listeners that are interested in the data Read each line of each file,...

Creating and using Multiple Filters/Searches using JTable or GlazedLists

I looked up how to use multiple filters on here with a regular table and the answers all pointed to GlazedLists. However, the answers didn't specify how to use it. I was able to get one filter to work but do not know how to get more than one. For one filter I used: // nameE is a BasicEventList containing classes (name) which // c...

Filter a dataGrid with a comboBox in flex

How can I filter a datagrid based on the value in the combo box? Can anyone show me some good examples on it? In my application, I already filter a datagrid based on the text entered by the user. I check if the entered string matches the column entry of the datagrid and if a match is found,the filterFunction on the dataprovider is calle...

Why is break point unreachable when using jQuery Droplistfilter

I am using this drop list filter on my Asp.Net Form. jQuery plugin DropListFilter The filter on the dropdownlist list works perfecty. <script type="text/javascript"> $(document).ready(function() { $('select').droplistFilter(); }); </script> <asp:DropDownList ID="ddlMonth" runat="server" CssClass="ddlStyle"></asp:DropDownList> <asp:R...

Between code (C#, Java) and database (SQL) where should we sort or filter?

Between code (C#, Java) and database (SQL) where should we sort or filter? In code it means having a single stored procedure to retrieve all data from the database and then filter my data (in the business or data layer). In database it means having a stored procedure. In this case the code (data layer) send my filter settings to stored...

Consolidated: SQL Pass comma separated values in SP for filtering

I'm here to share a consolidated analysis for the following scenario: I've an 'Item' table and I've a search SP for it. I want to be able to search for multiple ItemCodes like: - Table structure : Item(Id INT, ItemCode nvarchar(20)) - Filter query format: SELECT * FROM Item WHERE ItemCode IN ('xx','yy','zz') I want to do this dynamic...

Python list filtering and transformation

Hello, I have a list of library filenames that I need to filter against regular expression and then extract version number from those that match. This is the obvious way to do that: libs = ['libIce.so.33', 'libIce.so.3.3.1', 'libIce.so.32', 'libIce.so.3.2.0'] versions = [] regex = re.compile('libIce.so\.([0-9]+\.[0-9]+\.[0-9]+)') for l ...

How to do filtering data in UITableView like 'Recents' view in Phone application?

Hi, everyone. I am planning to applied the feature like 'Recents' view in Phone application of iPhone. This view show option on the top, 'All' and 'Missed'. Default option is 'All' but if you tap 'Missed' option the entry in UITableView which aren't 'Missed call' will slide out and disappear. This is the good feature. So I know you can...

Best practice for filtering items client-side with JavaScript, hide or remove from DOM?

I have a relatively large dataset of items (a few thousand items) that I want to navigate by applying a number of filters client side in a web application. Applying the filtering logic itself is not an issue, the question is about which method to use for updating the table of matching results to get the best user experience. The methods ...

Filter visits to a site generated by "Top Sites" feature of some browsers

In this answer to a Meta question, Jeff states that he has fixed the problem where visits created by the "Top Sites" feature in Safari were counted for the Fanatic and Enthusiast badges. My question is: how can this be done? How I programatically tell a "top sites" visit and a regular visit apart? I'm looking for a general solution, a...

VB: Allowing Only Numbers (not Letters) To Be Entered Into Textbox

I have a textbox which controls the interval of a Timer control. How do I filter out letters? Is it possible to restrict entry to numbers only (like if you enter a letter or a space, nothing happens)? Is there a property of the textbox that can accomplish this? Thanks! ...

Mean filter for smoothing images in Matlab

I need to test some basic image processing techniques in Matlab. I need to test and compare especially two types of filters: mean filter and median filter. To smooth image using median filtering, there is a great funtion medfilt2 from image processing toolbox. Is there any similar function for mean filter? Or how to use the filter2 func...

Filtering records by incrementing parameters in Django

I've been able to implement a filtering solution for my app...so far I have filtering by year, make and body style for a vehicle inventory. What I want to do is to filter the record this way: Lets assume I choose Acura in make, in the resultant page, if I choose one of the other filters i.e. year or body style, I'll need only the recor...

Creating "holey" median filter in Matlab

Hi What I need to do is to create a "special" kind of median filter for image processing in Matlab - the "holey" median filter. This is a filter that excludes the element at the center of the area. For standard median filter I use the medfilt2 function, but I can't pass the mask (kernel) for it as a matrix (it's not a linear transform...

php regular expression to filter out junk

So I have an interesting problem: I have a string, and for the most part i know what to expect: http://www.someurl.com/st=???????? Except in this case, the ?'s are either upper case letters or numbers. The problem is, the string has garbage mixed in: the string is broken up into 5 or 6 pieces, and in between there's lots of junk: unpri...

Sorting Core Data with Predicate to eliminate duplicates

I have an Event database loaded into Core Data that has duplicate Event titles. This has been made so the database can provide unique information for each day of the event. Eg fluctuations in pricing on each date. I now need to remove the duplicate event titles from a list that will be displayed as table view with NSFetchRequest and NS...

Setting up a filter in django

Hi, I'd like to set up a filter in my app...I'd like to have my filters being done in increments, kinda like what is running at this site. So far my filter views are separate (is there a way of combining the filtering logic into one view?) and I'm supposing I'll need some way of saving the chosen filter (possibly sessions...but I'm not...

Pass several values in a manager

I was wondering if there a way I can pass two or more variables in a custom manager...there are five variables that come from different views but in the model, I've declared a manager to handle filtering based on one of these variables...I want to have all the variables being considered in the filter query. Is there a way to do this? c...