filtering

Preserve listbox item selection

Hi, First the code (sorry if its not 100%) I am no expert and then the question follows. public partial class Window1 : Window { CollectionView cv; public Window1() { InitializeComponent(); List<Person> ppl = new List<Person>(); BitmapImage b = new BitmapImage(new Uri(@"http://i.stackoverfl...

Filter a wpf collectionviewsource in VB?

Hi, I want to filter a collectionviewsource using a filter I've written, but I'm not sure how I can apply the filter to it? Here is my collection view source: <Grid.Resources> <CollectionViewSource x:Key="myCollectionView" Source="{Binding Path=Query4, Source={x:Static Application.Current}}"> <Colle...

Using a function in a filter query in Solr

I want to filter my result set before I search. I know the correct way to do this is by using the filter query (fq) parameter. However, I want to filter based on the output of a function performed on a field. I have a field 'rating' which is an integer in the range of 1 to ~75000. The upper limit may change. I want to filter to the top ...

ADO.NET Data Services: How to filter a entity based on foriegn keys?

Hi This might be a entity framework related question, anyway, here goes: Consider the following simple database schema: CREATE TABLE Supplier( SupplierId int identity(1,1) not null primary key, DisplayName nvarchar(50) ) CREATE TABLE Category( CategoryId int identity(1,1) not null primary key, DisplayName nvarchar(50)...

Sound sampling at low frequencies

I've actually posted this question before, but it hasn't been answered. Maybe I wasn't clear enough, so let me rephrase: As you know, when you're sampling a signal at a certain sampling rate, any frequency that's higher than half of the sampling rate gets aliased. In order to avoid it, you need to pass the signal (either in the analog f...

How do I pass a list of 'allowed' IDs to filter a Lucene search?

I need to return just the documents that a user has access to from a Lucene search. I can get a list of IDs from a database that make up the 'allowed' subset. How can I pass these to Lucene? The articles I've found on the web suggest I need to use a BitSet and FieldCache (am I right?), but I'm having trouble finding good examples. Does a...

JQuery Table Filter on Multiple Criteria

Hi Everyone, I currently have a table with three drop down lists above it. As the user selects a value from each drop down to filter the results I'd like the table to hide the rows that do not fit ALL of the criteria selected so far. The closest I have gotten is this: $("#ReportControls #InventoryReports select").change(function(){...

What's the most efficient way of filtering an array based on the contents of another array?

Say I have two arrays, items and removeItems and I wanted any values found in removeItems to be removed from items. The brute force mechanism would probably be: var animals = ["cow","dog","frog","cat","whale","salmon","zebra","tuna"]; var nonMammals = ["salmon","frog","tuna","spider"]; var mammals = []; var isMammal; for(var i=0;i<ani...

Adding the current date with Maven2 filtering

I have a Maven2 project, and I need to add, in a properties file, the current version and the current date. For the current version, I've used ${project.version}, which works correctly. My question is how can I set the current date (i.e. the date when the build is done by Maven2) in my properties file: client.version=Version ${project...

Filter Replication set by username

I have a Merge Replication setup between a central server and 200 clients. The vast majority of the clients do not need all 5000 client records. Only the 50 or so that are assigned to them. How would I go about applying a Filter based on who's logged in? Should I create a NEW DB that maps user names to Client Records and go down that...

What is the best freeware / open source Log File Viewer with a filter and sort option?

I saw the posting about the Best Tail Log Viewer, but it does not support filtering or sorting of custom column names. I've been testing out the Kiwi Syslogd, and you have to pay for the ability to sort and filter. Does anyone know of a log viewing software tool that also supports filtering and sorting? ...

jQuery Filtering

Is there a way to filter a multi-line select box using jQuery? I'm a new to jQuery and can't seem to figure out the best way to do this. For example if I have: <select size="10"> <option>abc</option> <option>acb</option> <option>a</option> <option>bca</option> <option>bac</option> <option>cab</option> <option>cba...

How can I filter compilation output only for a specific mode or buffer in Emacs?

I have a HTML page, with html-mode enabled. I call function sgml-validate to check for any markup errors. It's based on compilation-mode. I want to remove some warnings from the compilation output, so I wrote a function and hooked it to compilation-filter-hook (this variable is not documented, but compilation-filter invokes it). Everythi...

Filtering JavaScript out of HTML

I have a rich text editor that passes HTML to the server. That HTML is then displayed to other users. I want to make sure there is no JavaScript in that HTML. Is there any way to do this? Also, I'm using ASP.NET if that helps. ...

Filter a String

I want to make sure a string has only characters in this range [a-z] && [A-Z] && [0-9] && [-] so all letters and numbers plus the hyphen. I tried this... C# App: char[] filteredChars = { ',', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '=', '{', '}', '[', ']', ':', ';', '"', '\'', '?', '/', '.', '<', '>', '\\...

T-SQL filtering on dynamic name-value pairs

I'll describe what I am trying to achieve: I am passing down to a SP an xml with name value pairs that I put into a table variable, let's say @nameValuePairs. I need to retrieve a list of IDs for expressions (a table) with those exact match of name-value pairs (attributes, another table) associated. This is my schema: Expressions ta...

Filter/Sort in the view or in the model?

Having a list of data object and something visual to represent each, where would you code the sorting/filtering logic? Why? Edit : All the answers so far are good, but I forgot to add another constraint. What if I don't want to reconstruct the view each time? ...

array_filter filtering out entire array

I have an array of arrays, each array containing details of a scan by a medical device. I'm getting this data from text logs that are dumped nightly. The format of which is this: $this->scans = array( array( 'patientid' => (int), 'patientname' => 'John Skeet', 'reviewed' => 0 or 1 //plus more irrelevant ), arr...

Filter XSLT results

Hi there I have a questing about XSLT. I am making a website on Sitecore CMS, and some of the pages have to show a list of articles. That's not a problem. Every articlelist can be 'tagged' with one or more tags, and the same for every article. Let's say that I have an articlelist that have been tagged with 'Wordpress'. Then I only wan...

Is it irrational to sanitize random character strings for curse words?

If you exposing randomly generated strings or strings with data encoded in them (Product keys). Is it irrational to sanitize them for curse words to avoid the client possibly getting offended in the rare case an offensive word is generated. Anybody ever have a customer get offended by a randomly generated curse word? Anybody out there ...