filter

In Python, How Do You Filter a String Such That Only Characters in Your List Are Returned?

Imagine a string, like 'Agh#$%#%2341- -!zdrkfd' and I only wish to perform some operating on it such that only the lowercase letters are returned (as an example), which in this case would bring 'ghzdrkfd'. How do you do this in Python? The obvious way would be to create a list, of characters, 'a' through 'z', then iterate over the ch...

Scaling images in IE

My page contains an image like in example below. Width of the image depends on browsers width and height is being changed authomaticly (something like ). This image looks nice after resizing in all browsers except IE (I've tested in IE7 and IE6). In IE image looks ugly. Some parts are thicker than should be and some parts are thinner. ...

xsl filter on select

I would like to select all descendant but "blog" nodes. For the example, only subtree should appear on output. I'm trying this xsl code: <xsl:template match="rdf:RDF"> <xsl:copy> <xsl:copy-of select="descendant::*[not(descendant::blog)]"/> </xsl:copy> </xsl:template> for this xml: <rdf:RDF> <profesor rdf:ID="...

ExtJS Gridfilter values to PHP

Hello. I'm using ExtJS v2.0 . I would like to grab the gridfilter values and pass them to a PHP page as $_POST, $_GET, $variable or any possible method that would work to be inserted in PHP query using this backend code: http://www.vinylfox.com/grid-filter-php-backend-code/ I will use those queryes to print one table with the results an...

jQuery: filter out elements via class?

I have a website featuring a long list of names. To make it more oversee-able, I'd like to put a text link in to (on load) show all (on clicking word "pears") hide all elements with class="apple" (on clicking word "apples") hide all elements with class="pear" (on clicking "show all") show all I suppose it'd be like a really simplif...

WordPress plugin: finding the <!--more--> in the_content

I'm writing a WordPress plugin that filters the_content, and I'd like to make use of the <!--more--> tag, but it appears that it has been stripped out by the time it reaches me. This appears to be not a filter, but a function of the way WordPress works. I could of course resort to reloading the already-loaded content from the database, ...

Check at TDataSet row against a filter string

I am using a DevExpress TdxMemData in memory TDataSet descendant. While it has Filtered: Boolean and Filter: String properties, it doesn't appear to actually do anything with them automatically, instead relying on the result of the OnFilterRecord event's Accept parameter. So what I am looking for is a way (maybe it is in TdxMemData o...

Coding Text Filters in Excel 2007

I am trying to use code to filter a spreadsheet dynamically, based on the current date. I am storing the date I need to filter on as "CurrDay" and I'm attempting to recall that stored date back into my filter algorithm. It is not working and I need to figure out how to do this to finish up this code. Everytime I run the code it retu...

Django -- how to templatetags filter with multiple arguments

I have a few values that I would like to pass into a filter and get a URL out of it. In my template I have: {% if names %} {% for name in names %} <a href='{{name|slugify|add_args:"custid=name.id, sortid=2"}}'>{{name}}</a> {%if not forloop.last %} | {% endif %} {% endfor %} {% endif %} In my templatetags I have: @registe...

how to exclude second column from selector

Hello, my question is how I can change the selector so that it wil exclude the second column off the hover event I did try some other variations like nth-child, but no luck yet. Could there be something wrong with the syntax maybe?? $('.row_class td:not(:eq(1))').hover( thanks, Richard ...

Rails: Set a common instance variable across several controller actions

How should one have several different controller' actions set a common instance variable for use in templates but after the action runs. In other words, I want this to work in my application_controller. class ApplicationController < ActionController::Base after_filter :set_something_common def set_something_common # All contro...

E4X filter by text content?

I'm trying to filter some XML in JavaScript using E4X and have some specific needs. Given the following: var xml = <body> <div> <p>This is some text that I have.</p> </div> </div>; I want to search the document for paragraphs starting with "This is some text". Currently I can the following to get at the ...

How can I use jscript assertion to filter exception types in Elmah 1.1 RC ?

The first binding against 404 works so I got the ErrorFilterModule set up properly, but the jscript section does not seems to work at all. HttpRequestValidationException is still being send in the report mail. <errorFilter> <test> <equal binding="HttpStatusCode" value="404" type="Int32" /> <jscript> <![CDATA[ ...

How can I show/hide elements based on multiple-attributes and multiple-attribute-values?

Hi, I would like to view/hide divs on a page, based on attribute filters. I've made several attributes which can have multiple values. Users can choose which ones they want to see displayed. I can't get the right algorythm (or I don't know which Javascript/jQuery function to use). The following obviously doesn't work. I'm first showing...

jQuery filter dropdown

Ok I have a drop down of countries and only want to display USA and Canada I'm looking at something like this but don't think I'm doing this right // Filter Countries $('#selectId').filter(function() { return $('#option').val() == ('USA' || 'CANADA'); }); Example HTML: <select id="country"> <option value="AFG">Afghanistan</o...

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 ...

How to filter a result set using the query string in PHP / MySQL?

I'm building an events page similar to last.fm/events The user can filter events by date, category etc, with the parameters passed in the query string My question is, what's the best way to structure your code (queries, loops) to allow for these different query types, and potentially combine them (e.g. filter by date and category) I'm...

After stripping unwanted tags, what else should I do to text input?

In a PHP script I'm accepting input from the user from a textarea and want to allow a few basic tags. So when I output the string I'm using - echo strip_tags($content, '<b><i><ul><ol><li>'); Now normally I would use FILTER_SANITIZE_STRING but that would strip all tags and I would use html_entities() but that would prevent the tags I'm...

Filter out the Users logging in time

I am new to Sharepoint 2007. I am trying to configure MOSS 2007. My question is: Can we know when a user has logged in and uploaded any document to a particular site in the central database? I know these information can get from the logs but I want any application that give only these information in readable format. that way it will sav...

In memory filtering of not persistent collection with Hibernate

Ok. What I wanted was: With Hibernate, to load once a list of MyEntity objects and have that list as the internal data of a model of a jtable. I also have a jTextField and when a key is typed, i call a method of my model that takes the text of the jtextfield as argument and filters the internal list of MyEntitys and fires the tablemod...