filtering

xcopy directories and subdirectories recursively and filter only filenames by extension

Here is what i have for now: xcopy "c:\projects\SampleProject" "c:\temp\copytest" /E /H /EXCLUDE:elist.txt It does all the job i need except filtering filenames by extensions. For example: copy all *.exe files from c:\temp\copytest and subdirectories. How to do that? ...

Django: how to cleanup form fields and avoid code duplication

Quite often I need to filter some form data before using it (saving to database etc.) Let's say I want to strip whitespaces and replace repeating whitespaces with a single one in most of the text fields, in many forms. It's not difficult to do this using clean_<fieldname> methods: # Simplified model with two text fields class MyModel(mo...

Datagridview filter on database view

My database contains two tables and two views. So far I've been able to filter my DataGridViews that are bound to the tables just fine by using code like myBindingSource.Filter = String.Format("columnName LIKE '{0}*'", FilterBox.Text); Only problem is, when I use that format for my DataGridViews that are bound to my Database Views I g...

Filtering forms in MS Access

I have a simple form showing products from my database. Each product has a foreign key to manufacturer_id . I would like to filter my form by manufacturer_id instead of default product_id. How I can do that ? I know I must create a macro. Also I've already created a query, that takes manufacturer's name as argument and returns manufactur...

Remember (persist) the filter, sort order and current page of jqGrid

My application users asked if it were possible for pages that contain a jqGrid to remember the filter, sort order and current page of the grid (because when they click a grid item to carry out a task and then go back to it they'd like it to be "as they left it") Cookies seem to be the way forward, but how to get the page to load these a...

Filtering constant noise out of a sound stream

After watching the first game of the FIFA worldcup I was very annoyed by the sound of the Vuvuzelas. A theoretical question came up about filtering that noise out of the sound stream. What algorithms are needed to remove such a "constant" noise and is it possible to keep the quality of other background sounds? ...

Django excluding specific instances from queryset without using field lookup

Hi, I sometimes have the need to make sure some instances are excluded from a queryset. This is the way I do it usually: unwanted_instance = Mymodel.objects.get(pk=bad_luck_number) uninteresting_stuff_happens() my_results = MyModel.objects.exclude(id=unwanted_instance.id) or, if I have more of them: my_results = MyModel.objects.exc...

Django model timerange filtering method

I saw the next two method on old question here but it is not clear for me what is the difference between: {'date_time_field__range': (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max))} and YourModel.objects.filter(datetime_published__year='2008', ...

Filtering Hudson build results by description

I need to filter the build results of a job based on the description of the build in Hudson. I found a plugin that allows for filtering based on the job description, however I'm not sure how I would begin to do the same for builds. ...

How to check for mip-map availability in OpenGL?

Recently I bumped into a problem where my OpenGL program would not render textures correctly on a 2-year-old Lenovo laptop with an nVidia Quadro 140 card. It runs OpenGL 2.1.2, and GLSL 1.20, but when I turned on mip-mapping, the whole screen is black, with no warnings or errors. This is my texture filter code: glTexParameteri(GL_TEXTU...

Structuring SQL querie based on multiple checkboxes state.

Hi, I'm making a restaurant search in which users can filter the search based on many criteria... I have three tables: Table1 - **Restaurant** ------+----------+---------- id + name + place ------+----------+---------- 1 Rest1 Ny 2 Rest2 La 3 Rest3 Ph Table2 - **r_type** ------+-----...

Data View Concept/Library/Pattern ?

Any application that deals with data, has one screen or more to allow the user to look at data. Usually we dont offer all the 10 million records to look at, but a subset, defined by a filter (or a view) that the user can create (and save). How to define these views that are translated (behind the scene) into some kind of "select from xxx...

How to efficiently filter a collection of child objects by a property with NHibernate

I've been trying unsuccessfully to filter a collection of child objects for a few hours how and have finally thrown my hands up! I'm new to NHibernate and was hoping for a couple of pointers on this. I've tried various ICriteria etc. with no luck. I'm just not getting it. I have a parent object 'Post' with a collection of child objects ...

Dojo // dijit.form.FilteringSelect // How to add a class to a <select> field in Dojo's filter Select

Hi, I am trying to add a class to some of my dojo.filterselect in order to color them in Blue. Does anyone know how to do that? thanks, Alon ...

DOJO Filtering Select

I have a filtering select emplemented on a large dataset (~10,000) and it works rather well. However, what I would like to do is as the user is typing, display how many records match. So let's say you have the data set: 1A 1B 1C 2A 2B 2C ...and the user types the number 1, the number I would like to return to the users is (3 matches). ...

NSPredicate help

NSPredicate *pred = [NSPredicate predicateWithFormat:@"firstname contains[cd] %@" argumentArray:firstNames]; NSArray *ar = [contactList filteredArrayUsingPredicate:pred]; What I want is to filter the contact list matching the values in the firstNames array. But this always results one element even if there are multiple matches? ...

what is the best routing url strategy for supporting multi field filtering in asp.net mvc

i have an asp.net mvc page where i show a dataset in a report. I have a filter section at the top and each filter changes the dataset from: Controller/Action to something like this: Controller/Action/Field1Filter If there is no filter selected, i put a zero in this part of the url. I keep adding more fields to filter by and now ...

BPF filtering on more than 3 ports?

Hi there, I have a piece of software which uses BPF filtering on the command line. The packets that I am interested in always have either a source or destination UDP port from the following list: o 1645 o 1646 o 1812 o 1813 Unfortunately, my BPF syntax can only filter a maximum of three ports: udp port (1645 or 1646 or 181...

Is there a better way to filter the types of objects that can be passed into an inherited class's constructor?

I know the title's a bit wordy, but I don't know how else to ask this question. This is basically the technique that I've been using to filter the types of objects you pass into an inherited class. Have a look at the code first and I'll explain more... public interface IProjectile {} public interface IPaintBall : IProjectile {} public i...

How do I filter this line "XX<i>\r</i><i>\n</i>" to XX?

Question is in the title. I tried strip_tags, but that shows up blank and I tried using preg_replace, but I don't quite understand the syntax apparently.. Tried this $test = "Home<i>\r</i><i>\n</i>"; $patterns = array(); $patterns[0] = '<i>'; $test = preg_replace($patterns, '', $test); but echo $test is still...