for example you run some client program, this program communicate with server to recieve data in realtime ... how can i listen to this network traffic and filter / store data in python?
I am using Groovy in a Java Swing application as part of my plan to force-feed myself dynamic languages until I like them (which is happening, partly).
My stack traces are filled with Groovy stuff like
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor
is there a way to get Eclipse to remove all of that codehaus stuff (filter stack traces, basically)?
Edit: I can do this from the command-line with grep (well, not yet) so it's not so bad, but inside of Eclipse would be great too.
XML spec defines a subset of Unicode characters which are allowed in XML documents:
http://www.w3.org/TR/REC-xml/#charsets.
How do I filter out these characters from a String in Java?
simple test case:
Assert.equals("", filterIllegalXML(""+Character.valueOf((char) 2)))
I have a custom template tag:
def uploads_for_user(user):
uploads = Uploads.objects.filter(uploaded_by=user, problem_upload=False)
num_uploads = uploads.count()
return num_uploads
and I'd like to do something like this, so I can pluralize properly:
{% with uploads_for_user leader as upload_count %}
{{ upload_count }} upload{{ upload_count|pluralize }}
{% endwith %}
However, uploads_for_user leader doesn't work in this context, because the 'with' tag expects a single value - Django returns:
TemplateSyntaxError at /upload/
u'with' expected format is 'value as name'
Any idea how I can get round this?
How can you select an element that has current focus?
There is no :focus filter in jQuery, that is why we can use something like this:
$('input:focus').someFunction();
I am working on an application where the app user can create / delete queues . Also , he would be able to move a message from 1 queue to another, delete a message , rearrange the messages in the queue based on some filter.
One possible design is to use activemq for queues and apache camel for various other operations having integrated with Grails.
But I am not sure whether ActiveMQ allows creation /deleltion queues at runtime.
Would this be a good choice to implement such system?
I'm using jQuery :contains selector to filter through some link tags. The following code works great.
$('a:contains('string').each(function(i){
//do some stuff
});
I'd like only run this function if the anchor tags are inside a specific class, I've tried the following but it does not appear to work:
$('my_class a:contains('string').each(function(i){
//do some stuff
});
Hi!
I have a collection of elements of type B and C, which all extends A. I need to filter the collection to get elements of only B type.
Is there any way to do it except:
for (A a : initCollection) {
if (a instance of B) {
newCollection.add(a)?
}
}
Thanks
I am using EF 3.5 with MVC.
I want to made a search page, has some fields for criteria like date, int etc.
What is the way in linq to entities to filter the result dynamically.
If there are one parameter we can use
.where(a=a.id==1)
but many combination with optional param how can i load results and then pass to model.
I am looking for more complete sample code on how TeeFilter of Logback can be used to log HTTP messages.
I am trying to add this support to my Spring 3 (MVC)/Hibernate 3/Annotations Maven2 project. I have the config and xml files but I need to know where and how I can trigger this Filter to do the job for me in the Spring MVC framework.
Any help will be greatly appreciated.
I have a jQueryUI slider on my website that deals with price range.
I have a products table in mysql that has various entries.
I am using the slider to filter the results, but I need to set the minimum and maximum prices from the records in my database.
Should I just generate (with php) hidden fields in my html that contain the minimum and maximum and then use jQuery to obtain them? Or is there a better way of achieving this, maybe using AJAX?
Thanks
Hi,
i have this page.
login: [email protected] password: m
You can see two selects in the filter for which i have this rule in gente.css:
td.select label{
margin-left:12px;
}
The problem: the rule is applied but doesn't appear in the Style tab of Firebug.
Any idea?
Regards
Javi
i have a telerik menu control that can have an <ItemTemplate>.
suppose i have :
<telerik:RadMenuItem Text="Filter" Value="Search" >
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server""/>
</ItemTemplate>
</telerik:RadMenuItem>
how can i dynamically create the textbox itemTemplate in code behind?
I've looked around for a while, but there doesn't seem to be a simple way to do this. jQuery doesn't help the in least, it seems to entirely lack any support for selection or DOM ranges. Something which I hoped would be as simple as $.selection.filter('img') seems to only be doable with dozens of lines of code dealing with manually enumerating elements in ranges and browser implementation inconsistencies (though ierange helps here). Any other shortcuts?
I use apache common lang to unescape a block of html text which contains ,
I want to filter out blocks that contains only whitespaces.
But I can't test the as a whitespace. It's not in the normal whitespace list(http://en.wikipedia.org/wiki/Whitespace_character), and I try to print its Hex form by calling Character.getNumericValue which return -1.
  should be a whitespace,isn't? But How can I test it?
Hi Guys,
Is there a built-in functionalities in solr/lucene to filter the results if they fall below a certain score threshold? Let's say if I provide a score threshold of .2, then all documents with score less than .2 will be removed from my results. My intuition is that this is possible by updating/customizing solr or lucene.
Could you point me to right direction on how to do this?
Thanks in advance!
I have a Perl script to open this page http://svejo.net/popular/all/new/ and filter the names of the posts but except headers everything seems encrypted. Nothing can be read. When I open the same page in a browser everything looks fine including the source code. How is it possible to encrypt a page for a script and not for a browser? My Perl script sends the same headers as my browser (Google Chrome).
I run a site where users can content that is tagged by a special set of tags. While implementing RSS feeds, I was wondering what, if any, rules or guidelines exist for using a querystring to filter what content an RSS feed shows. For example, the feed that shows all content on the site would be:
/feed
If someone was interested in all the work that was tagged with fashion, the URL would be
/feed?tag=fashion
I have a model that looks like this:
class Client(models.Model):
name = models.CharField(max_length=100, primary_key=True)
user = models.ForeignKey(User)
class Contract(models.Model):
title = models.CharField(max_length=100, primary_key=True)
start_date = models.DateField()
end_date = models.DateField()
description = models.TextField()
client = models.ForeignKey(Client)
user = models.ForeignKey(User)
How can i configure a django form so that only clients associated with that user show in the field in the form?
My initial thought was this in my forms.py:
client = forms.ModelChoiceField(queryset=Client.objects.filter(user__username = User.username))
But it didn't work. So how else would I go about it?
I run a site where users can upload content that is displayed in a gallery where other users can sort and filter that content. While implementing RSS feeds, I was wondering how common it was for an RSS feed to display items in an order that's different from chronological. For example, displaying content by Most Views first. This could be useful for someone wanting to keep tabs on trending content. How do RSS readers handle this, since most RSS feeds are ordered chronologically?
What's the cleanest way of filtering a Python string through an external program? In particular, how do you write the following function?
def filter_through(s, ext_cmd):
# Filters string s through ext_cmd, and returns the result.
# Example usage:
# filter a multiline string through tac to reverse the order.
filter_through("one\ntwo\nthree\n", "tac")
# => returns "three\ntwo\none\n"
Note: the example is only that - I realize there are much better ways of reversing lines in python.
Hi all,
I currently have a JAX-WS Web Service that receives some credentials in the HTTP header. These are used for BASIC authentication.
There is a filter that performs authentication by reading the HTTP headers and checking against the database.
Still, I need the username from within the Web Service in order to perform other service logic related stuff. Is there a way of accessing the HTTP headers from within the Web Service?
Thanks.
Here's the setup. I have web site which is essentially a simple CMS. Here is the routes file:
map.connect ':url', :controller => :pages, :action => :show
map.root :controller => :pages, :action => :show, :url => "/"
The page controller is thus:
class PagesController < ApplicationController
before_filter :verify_access, :except => [:show]
# Cache show action if we are not logged in.
caches_action :show, :layout => false, :unless => Proc.new { |controller| controller.logged_in? }
def update
@page = Page.find(params[:id])
respond_to do |format|
expire_action :action => :show, :url => @page.url
So when a visitor hits "/" it maps to :controller = "pages, :action = "show, :url = "/". This generates a cached version on first try, then returns the appropriate result there after. The log files show:
Processing PagesController#show (for 127.0.0.1 at 2009-08-02 14:15:01) [GET]
Parameters: {"action"=>"show", "url"=>"/", "controller"=>"pages"}
Cached fragment hit: views/out.local// (0.1ms)
Rendering template within layouts/application
Filter chain halted as [#<ActionController::Filters::AroundFilter:0x23eb03c @identifier=nil, @method=#<Proc:0x01904858@/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/caching/actions.rb:64>, @kind=:filter, @options={:only=>#<Set: {"show"}>, :if=>nil, :unless=>#<Proc:0x025137ac@/Users/askegg/Sites/out/app/controllers/pages_controller.rb:6>}>] did_not_yield.
Completed in 2ms (View: 1, DB: 0) | 200 OK [http://out.local/]
OK - all good so far. When I update the page, it should expire the cache (see above). The logs show:
Page Load (0.2ms) SELECT * FROM "pages" WHERE ("pages"."id" = 3)
Page Load (0.1ms) SELECT "pages".id FROM "pages" WHERE ("pages"."url" = '/' AND "pages".domain_id = 1 AND "pages".id <> 3) LIMIT 1
Expired fragment: views/out.local/index (0.1ms)
Redirected to http://out.local/pages/3
Completed in 9ms (DB: 0) | 302 Found [http://out.local/pages/3]
See the problem? Rails is clearing the cache named "index", but it sets it as "/". Naturally this results in the cache NOT being cleared, so visitors are now seeing the old version.
I have added a 'cancelled' field to my model, is there a way to modify the model default query to something like cancelled=False ? without having to modify all my filter/exclude queries ?
My sql query gives the columns:
product_id (which is an integer)
pnl (which is float - can be negative)
I get more than 100 rows.
I want to filter out the top 40 rows based on abs(pnl).
But the results should be ordered by pnl column only and not by abs(pnl).
I want to do this for MSSQL 2005.
Is there a way to do this?