filter

How do I get a particular derived object in a List<T>?

Let's say I have a generic list of Fruit (List<Fruit> fruits = new List<Fruit>()). I then add a couple of objects (all derived from Fruit) - Banana, Apple, Orange but with different properties on the derived objects (such as Banana.IsYellow). List<Fruit> fruits = new List<Fruit>(); Banana banana1 = new Banana(); Banana banana2 = new Ban...

How do I attach a stream filter to echo?

Is there a way to attach a stream filter to echo so that any data that is echoed goes through the stream filter? My idea is to write an output escaping filter to protect against XSS. I found this bug report http://bugs.php.net/bug.php?id=30583 but it is from 2004 and I didn't know if this is now possible or not. class strtoupper_filter...

jQuery - filter element based on .data() key/value

Say I have 4 div elements with class .navlink, which, when clicked, use .data() to set a key called 'selected', to a value of true: $('.navlink')click(function() { $(this).data('selected', true); }) Every time a new navlink is clicked, I would like to store the previously selected navlink for later manipulation. Is there a quick and e...

AJAX-safe way to post-process / "wrap" arbitrary web pages?

I manage a system for academic software projects which, as well as other things, allows projects to provide web pages integrated with an instance of the Trac bug tracker / wiki / source browser. The idea is that the users have freedom to design their main pages as they like (they really like that), but with some convenience/branding feat...

How can I remove/filter/ignore some package from Emma (code coverage)

Hi all... I`m trying to remove some package from my report and having trouble. Could some one give me some help? I'm using EMMA in my ant process. <!-- Generate the emma report both in xml and html --> <emma>   <report     sourcepath="${build.report.src}"     metrics="class:${coverage.classes.min},method:${coverage.methods.min}">  ...

Is there a standalone Java library which provides LDAP style parsing?

I'm looking for a standalone Java library which allows me to parse LDAP style filter expressions Is such thing available, or is it advisable to use ANTLR instead and build it by one self? As background: the filter itself is submitted through a network, and I want to create say, the appropriate hibernate Criteria. I'm not doing anything ...

Django ORM: filter by a list of objects

I have the following code to put all my users from a multichoice field into a list USERS = [] for user in User.objects.filter(groups__name='accountexec'): USERS.append((user.id,user)) I need to use Log.objects.filter() to get all the logs with a user= to a user in the USERS list ...

SubSonic .Filter() in memory filter

hi guys, i'm having some issues getting the .Filter() method to work in subsonic, and i'm constantly getting errors like the one below: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Line 36: bool remove = false; Line 37: System.Reflec...

Filter subform using combobox

This has taken me nearly 2 weeks and I dont know what else to do. I have a main form (UserSearch) that has a subform (TestUserSub). The associated table for both forms is tblusers. very simple; on the main form (UserSearch) I have a comboboxes associated with the fields in the tblusers eg cmbid, cmbname, cmbdept and so on. All I want, is...

How to filter a very big json string without looping every object in it?

Hi, I'm currently developing a calendar with all standard views (day, week, month). To load my calendar events I use JSON. When the events are loaded I have to map them on the active view (day, week or month). For each view I only need a particular set of events, the events between the date range of the current view (=timeframe). S...

Have a jcombobox filter a jtable

following this tutorial http://www.netbeans.org/kb/docs/java/gui-db-custom.html#enhancements it shows how to use a textbox to filter out the master table. Could anyone instruct me on how to do a similiar thing but use a dropdown to test against a specific column? (ie a dropdown of countries, to filter by the country column? thanks ...

How to add greater than/less than to Hibernate filters

How can you add greater than or less than symbols to the condition on a Hibernate filter specified in the hbm.xml file? I am trying to add a filter to limit the collection to a specific date range: <filter name="limitTalksByDateRange" condition="talkstart >= :tstart and talkstart <= :tend" /> Unfortunately this breaks the XML parsing...

preg_replace Filter for Passwords

With PHP, I'd like to use a preg_replace() filter for passwords such that the only characters available for passwords are US ASCII typable, minus control codes and NULL. What's the RegEx to achieve that which I can plugin to preg_replace()? EDIT: I've been advised to edit this question since I "get it" now and won't be doing this terr...

ASP:Chart method FilterTopN, How can I also keep "Other" as aggregate value?

I have a pie chart that I'm using to show the top sales per manufacturer. I would like to show the top N manufacturers, and have the remainder show on the chart as "Other". If I do FilterTopN, it displays the chart so Area(manufacturer 1, 2, ..., N) is 100%, rather than showing them as a percent of the total. So if I have 5 companies:...

JSF Filter prevent direct access certain page.

I created a filter to prevent the user by typing the url to access certain page. I have 3 page, the user supposed to access page2 or page3 only through page1. First page required the user enter username, den go to page2 and so on. I have a managed bean user scoped session.This is my filter method. The problem is that when i never enter t...

How do you implement a custom filter with Lucene.net?

The code below is from the Lucene In Action book (originally in Java). It's for building a list of 'allowed' documents (from a user permission point of view) to filter search results with. The problem is the termsDocs.Read() method does not accept the 'doc' and 'freq' arrays to be passed by reference, so they're still empty when it comes...

Asp.NET MVC: Practices questions

1) Isn't it a bad practice to use these attributes on all of my Controllers? [HandleError] [CompressFilter(Order = 1)] Compress filter is defined as: public class CompressFilter : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { if ( !AppConfig.IsResponseCompressionEnabled ) {...

Retrieve GridView row based on unique cell value

Hi, I want to retrieve the grid view row based on the cell value. For example, I am having a grid view with 4 columns (name,m1,m2,m3) and name contains unique values. So, I want to get the grid view row corresponding to the name specified. Thanks ...

Filtering data shown on linechart in flex.

Hi guys, i am working on a line chart on flex which enable me to view the progress of data according to the year. I have tried using a slider to filter but it doesn't seemed to work. any help please? i am not exactly filtering the dataprovider, but the alpha. My function will retrieve all the information from my array collection, but set...

How to disable some items in XAML for a WPF ListView

ok, sorry for the overly broad question, but lets see what you guys suggest.. I have a WPF ListView loaded by an XML file, using XAML (code below) I have a second xml file with items that match what is in my ListView. However, if there is not a match in the 2nd file, then i want that listitem disabled. a simple example: my ListView...