Search Results

Search found 1505 results on 61 pages for 'filters'.

Page 5/61 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Help with django filters

    - by Cato Johnston
    In a django template, I want to get an value from the first object in a list's field. I have the following code {{ list.object|first.field }} But it results in an error. Is there a way to achieve this without writing a loop or doing it in the view?

    Read the article

  • Pattern filters in Laravel 4

    - by ali A
    I want to make a pattern route, to redirect users to login page when they are not logged in. I searched but couldn't find a solution. as always Laravel's Documentation is useless! I have this in my filter.php Route::filter('auth', function() { if (Auth::guest()) return Redirect::guest('login'); }); Route::filter('auth.basic', function() { return Auth::basic(); }); And this route in my routes.php Route::when('/*', 'auth' ); but It's not working. How can I do that?

    Read the article

  • How necessary is using PHP filters?

    - by Jamie
    I'm a relatively newbie to PHP and just making my way through the W3Schools tut. The tut makes a big point of saying you must always filter external data (i.e. cookies, form data etc). I'm writing a fairly simple system that talks with a third party Joomla extension. It's at a prototype stage where I'm just wanting to demonstrate the functionality in a minimum viable product. Basically, I'd like to know... what's the worst that could happen in I don't filter content. Are we talking 'I might get a bunch of spam', or 'a good hacker could get root server access'? Have hunted around online, but would love any of your experience / insight on the matter!

    Read the article

  • I can't use Spring filters in servlet-context XML

    - by gotch4
    For some reason both Eclipse and Spring can't find the filter tag (there is even a red mark)... What's wrong? <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"></bean> <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost/jacciseweb" /> <property name="username" value="root" /> <property name="password" value="siussi" /> </bean> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="myDataSource" /> <property name="annotatedClasses"> <list> <value>it.jsoftware.jacciseweb.beans.Utente </value> <value>it.jsoftware.jacciseweb.beans.Ordine </value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql"> true </prop> <prop key="hibernate.hbm2ddl.auto"> update </prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop> </props> </property> </bean> <filter> <filter-name>hibernateFilter</filter-name> <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter </filter-class> <init-param> <param-name>singleSession</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>mySessionFactory</param-value> </init-param> </filter> <!-- <aop:config> --> <!-- <aop:pointcut id="productServiceMethods" --> <!-- expression="execution(* product.ProductService.*(..))" /> --> <!-- <aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods" /> --> <!-- </aop:config> --> <bean id="acciseHibernateDao" class="it.jsoftware.jacciseweb.model.JAcciseWebManagementDaoHibernate"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <tx:annotation-driven /> <bean id="acciseService" class="it.jsoftware.jacciseweb.model.JAcciseWebManagementServiceImpl"> <property name="dao" ref="acciseHibernateDao" /> </bean> <context:component-scan base-package="it.jsoftware.jacciseweb.controllers"></context:component-scan> <mvc:annotation-driven /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" p:synchronizeOnSession="true" /> <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" /> <mvc:resources mapping="/resources/**" location="/resources/" /> <!-- non serve, è annotato --> <!-- <bean name="/accise" class="it.jsoftware.jacciseweb.controllers.MainController"> </bean> --> </beans> in particular it says "filter" is invalid content

    Read the article

  • how to apply filters in jsf

    - by johnbritto
    Hi I have filter code Page not Found error while any client request for Jsf Page in my Jsf application.I dont Know How to Fix this issue This is My Filter Code: HttpServletRequest req =(HttpServletRequest)request; HttpServletResponse res =(HttpServletResponse)response; HttpSession ses = req.getSession(true); String pageRequested =req.getRequestURL().toString(); if (ses.getAttribute("userDetails")!=null) { fc.doFilter(request,response); }else{ RequestDispatcher dis = request.getRequestDispatcher(LOGIN_PAGE); dis.forward(request,response); } This code inside the DoFilter Method I done all The settings in Web.xml deployment Descriptor

    Read the article

  • Android Signal analysis + some filters.

    - by Profete162
    Hello, as the world cup is the main sport event and the Vuvuzelas are the most annoying sound in the world, I had an idea to remove them definitively by reading this new ( http://www.popsci.com/diy/article/2010-06/simple-software-can-filter-out-vuvuzela-whine) that told us that the sound has some frequencies at 233Hz + 466,932,1864Hz. I have already made a lot of Android application by myself but never touching the signal analysis and filtering part, so here are a few questions, I do not ask for precise answer but maybe links and tutorial to find something to work on. I guess that a new Android phone has the CPU and power to make real-time filtering. 1) How can I intercept the sound coming from the Jack microphone - Line-IN plug- ( I plan to link my TV to my phone with Jack to Jack plug). My question is totally software and coding, I have all the wires and adapters to plug a jack into my android phone Line IN. 2) Are there some Fourier analysis librairies, may I have a look to Java libraries on the web and import them to my Android project? I really apologize because my question seem not precise, but I think that would be something great. Thank you for your answers.

    Read the article

  • ASP.NET MVC Filters: How to set Viewdata for Dropdown based on action paramter

    - by CRice
    Hi, Im loading an entity 'Member' from its id in route data. [ListItemsForMembershipType(true)] public ActionResult Edit(Member someMember) {...} The attribute on the action loads the membership type list items for a dropdown box and sticks it in viewdata. This is fine for add forms, and search forms (it gets all active items) but I need the attribute to execute BASED ON THE VALUE someMember.MembershipTypeId, because its current value must always be present when loading the item (i.e. all active items, plus the one from the loaded record). So the question is, what is the standard pattern for this? How can my attribute accept the value or should I be loading the viewdata for the drop down in a controller supertype or during model binding or something else? It is in an attribute now because the code to set the viewdata would otherwise be duplicated in each usage in each action.

    Read the article

  • Parse multiple filters in SQL

    - by Jeff Meatball Yang
    I have a problem parsing a stored procedure parameter in the form: declare @S varchar(100) set @S = '4=2,24=1534' Here's the query: select cast(idx as varchar(100)) 'idx' , value , SUBSTRING(value, 1, charindex(value, '=')+1) 'first' , SUBSTRING(value, charindex(value, '=')+1, LEN(value)-charindex(value, '=')-1) 'second' from Common.SplitToTable(@S, ',') -- returns (idx int, value varchar(max)) where len(value) > 0 But here is the result I get: idx value first second 0 4=2 4 4= 1 24=1534 2 24=153 Here's what I expected: idx value first second 0 4=2 4 2 1 24=1534 2 1534 Help?

    Read the article

  • Help with concept - filters and number of items

    - by dreamer
    Please check http://www.alibaba.com/catalogs/cid/702/Laptops.html they have nice filter here with number of items for each. Note one detail - they have locations here. Same thing on olx.com - location and number of items for each category. Now imagine I have tables: [products] (Id, Name, CategoryId, LocationId) [Categories] (Id,Name) [Location] (Id, Name) My question how can I do the same, cause count things even with caching looks expensive? And they give results pretty fast... Please advice with possible ways to do that in ASP.NET, C#, MVC, MS SQL, but avoice simple answers like "count and change" Thank you in advance.

    Read the article

  • ASP.NET MVC Filters: How to set Viewdata for Dropdown based on action parameter

    - by CRice
    Hi, Im loading an entity 'Member' from its id in route data. [ListItemsForMembershipType(true)] public ActionResult Edit(Member someMember) {...} The attribute on the action loads the membership type list items for a dropdown box and sticks it in viewdata. This is fine for add forms, and search forms (it gets all active items) but I need the attribute to execute BASED ON THE VALUE someMember.MembershipTypeId, because its current value must always be present when loading the item (i.e. all active items, plus the one from the loaded record). So the question is, what is the standard pattern for this? How can my attribute accept the value or should I be loading the viewdata for the drop down in a controller supertype or during model binding or something else? It is in an attribute now because the code to set the viewdata would otherwise be duplicated in each usage in each action.

    Read the article

  • Zend Framework AjaxContext filters the results and Decorators not removable

    - by Janis Peisenieks
    Ok, since this problem has 2 parts, it will be easier to explain them together. So here goes: I am trying to remove the default decorators from these elements, since I am using a little different way of styling them. But no matter what i do, the DtDDWrapper still shows up. If I try to remove all of the decorators, all of the fields below disappear. public function newfieldAction() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('newfield', 'html')->initContext(); $id = $this->_getParam('id', null); $id1=$id+1; $id2=$id+2; $element = new Zend_Form_Element_Text("newTitle$id1"); $element->setOptions(array('escape'=>false)); $element->setRequired(true)->setLabel('Vertiba')->removeDecorator('label'); $tinyelement=new Zend_Form_Element_Text("newName$id"); $tinyelement->setRequired(true)->setOptions(array('escape'=>false))->setLabel('Vertiba')->removeDecorator('label'); $textarea_element = new Zend_Form_Element_Textarea("newText$id2"); $textarea_element->setRequired(true)->setOptions(array('escape'=>false))->setLabel('Vertiba')->removeDecorator('label'); $this->view->descriptionField = "<td>".$textarea_element->__toString()."</td>"; $this->view->titleField = $element->__toString(); $this->view->field = $tinyelement->__toString(); $this->view->id=$id; } The context view script seams to trim my code in one way or another. When I try to put a <td> or a <table> tag in the view script, it just skips the tags. Is there a way to stop this escaping from happening? My view script: id; ?" asdfasdfasdfasd field ? titleField ? descriptionField ? id ?"remove P.S. the code formatting system is barfing at me, could someone please help me with the formatting of the code?

    Read the article

  • How to apply multiple filters to sharepoint list

    - by Juraj Hajek
    Hi all, I have sharepoint list with several columns - month, year and some custom data. I want to provide 2 dropdowns to allow user select month and year to filter rows. I added "Choice Filter" webpart for month and set connection to list (this works). I added second "Choice Filter" for year and I wanted to do the same. However, I cannot set connection to list, because mylist is disabled in webpart menu "Edit-Connections-Send filter values to". How can I apply 2 filtering criteria? Thanks, Juraj

    Read the article

  • Spring annotation-based container configuration context:include & exclude filters

    - by lisak
    Hey, first off I point to the similar question. I spent more than an hour to set this up, but PathMatchingResourcePatternResolver still scans everything. I have one common.xml (that is imported from specific.xml) and a specific.xml bean definition file. The context is loaded from specific.xml. In common.xml there is this element: <context:component-scan base-package="cz.instance.transl"> <context:exclude-filter type="aspectj" expression="cz.instance.transl.model..* &amp;&amp; cz.instance.transl.service..* &amp;&amp; cz.instance.transl.hooks..*"/> </context:component-scan> Where classes in packages like cz.instance.transl.service.* should not be subject of scanning, but everything else in here cz.instance.transl.* should be scanned through. But PathMatchingResourcePatternResolver marks everything as matching resources. It is the same with regex. BTW: in xml style configuration, one can have many components that share a common.xml beans via "import resource" when loading context. How this is done when Annotation-based container configuration is used ?

    Read the article

  • Can you call Directory.GetFiles() with multiple filters?

    - by Jason Z
    I am trying to use the Directory.GetFiles() method to retrieve a list of files of multiple types, such as mp3's and jpg's. I have tried both of the following with no luck: Directory.GetFiles("C:\\path", "*.mp3|*.jpg", SearchOption.AllDirectories); Directory.GetFiles("C:\\path", "*.mp3;*.jpg", SearchOption.AllDirectories); Is there a way to do this in one call?

    Read the article

  • JavaScript Show/Hide as Filters to list of divs

    - by deconspray
    Looking to create Javascript that acts like a filter on a list of divs. For instance, here's the intended markup... <a href="#" onclick="">Filter Item 1</a> <a href="#" onclick="">Filter Item 2</a> <a href="#" onclick="">Filter Item 3</a> <a href="#" onclick="">Filter Item 4</a> <a href="#" onclick="">Filter Item 5</a> <div class="1">Item 1</div> <div class="1">Item 1</div> <div class="2">Item 2</div> <div class="3">Item 3</div> <div class="1">Item 1</div> <div class="4">Item 4</div> <div class="4">Item 4</div> <div class="1">Item 1</div> <div class="5">Item 5</div> I want to be able to click on the link for Item 1, and show only Item 1 divs and hide all other divs, click the link of Item 2, and show only Item 2 divs and hide all other divs and so on. I've seen several similar scripts but nothing that seemingly turns divs matching the class on/off in this manner. TIA.

    Read the article

  • Multiple collections tied to one base collection with filters and eventing

    - by damienc88
    I have a complex model served from my back end, which has a bunch of regular attributes, some nested models, and a couple of collections. My page has two tables, one for invalid items, and one for valid items. The items in question are from one of the nested collections. Let's call it baseModel.documentCollection, implementing DocumentsCollection. I don't want any filtration code in my Marionette.CompositeViews, so what I've done is the following (note, duplicated for the 'valid' case): var invalidDocsCollection = new DocumentsCollection( baseModel.documentCollection.filter(function(item) { return !item.isValidItem(); }) ); var invalidTableView = new BookIn.PendingBookInRequestItemsCollectionView({ collection: app.collections.invalidDocsCollection }); layout.invalidDocsRegion.show(invalidTableView); This is fine for actually populating two tables independently, from one base collection. But I'm not getting the whole event pipeline down to the base collection, obviously. This means when a document's validity is changed, there's no neat way of it shifting to the other collection, therefore the other view. What I'm after is a nice way of having a base collection that I can have filter collections sit on top of. Any suggestions?

    Read the article

  • How well are SVG filter elements defined?

    - by Peter Becker
    We are considering using SVG filters as part of our toolchain, serving the SVG to browsers capable of supporting it, while serving pre-rendered PNGs to other. One problem we noticed is that the rendering of the filter chains seems to be very inconsistent across renderers. When looking at the "filters01" example from the SVG specification, the rendering looks very different across the tools we tried. Chrome (5.0.307.11) failed to render the image, while other tools (Firefox 3.6, Opera 10.10, Inkscape 0.47, GIMP 2.6.7) render something vaguely similar in style to the picture in the specification, but no two are truly the same. Is that an issue of under-specification or are the tools just not there? If we would use SVG with filter effects: is there a reference tool that can give us a rendering the way it is intended by the spec?

    Read the article

  • Java Servlet framework that does things like rencoding images to preferred format etc.

    - by mP
    Are there any frameworks/libraries that provide servlets/filters etc that handle reencoding on the fly of images. interpret the accept headers and output the file, reencoding into the new format if necessary by checking the actual format of the original image file. provide a low and high quality version of an image. re encode an image into new dimensions. width and height parameters might query string parameters. I could create versions of the file in all the formats, at upload time but the seems overkill. I would rather lazily create the rencoded file and stick it in a cache if it gets served again etc.

    Read the article

  • Weird response for controller.request.format.html? in Rails

    - by Tony
    In my main controller, I have this: class MainController < ApplicationController before_filter do |controller| logger.info "controller.request.format.html? = #{controller.request.format.html?}" logger.info "controller.request.format.fbml? = #{controller.request.format.fbml?}" controller.send :login_required if controller.request.format.html? controller.send :facebook_auth_required if controller.request.format.fbml? end As expected, I get "true" for the ...fbml? line if a request comes from Facebook (my facebooker gem automatically sets the format). However, I get "5" for the ...html? line if the request comes from Facebook. Why would a method with a ? ever return a "5"? Isn't that against Rails conventions? Also, I think "5" is considered true so this might mess up my filters. Still looking into that... Any ideas?

    Read the article

  • Can I add a spring mvc filter using jetty with a jar file?

    - by Juan Manuel
    I have a simple web application disguised as a java application (as in, it's a .jar instead of a .war), and I'd like to use a filter for my requests. If it was a .war, I could initialize it with a WebAppContext and specify a web.xml file where I'd have my filter declaration like this <filter> <filter-name>myFilter</filter-name> <filter-class>MyFilterClass</filter-class> </filter> <filter-mapping> <filter-name>myFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> However, I'm using a simple Context to initialize my application with Spring. Server server = new Server(8082); Context root = new Context(server, "/", Context.SESSIONS); DispatcherServlet dispatcherServlet = new DispatcherServlet(); dispatcherServlet.setContextConfigLocation("classpath:application-context.xml"); root.addServlet(new ServletHolder(dispatcherServlet), "/*"); server.start(); Is there a way to programmatically specify filters for the spring servlet, without using a web.xml file?

    Read the article

  • From a performance standpoint, is there a preferred way to set up Thunderbird message filters?

    - by Steve V.
    When I used Kontact, I used filters heavily to sort my incoming email into various folders. Since switching to Thunderbird, I've been slowly recreating these filters as new mail arrives. This seems like the perfect time to rethink how I use message filters. The way I see it, there are two basic ways to filter messages. Either I can have lots of filters, or I can have lots of criteria. An example is in order. Assume that I get emails from four people (Boss, CEO, Intern, and StackOverflow) that I want to sort into two folders, "Stack" and "Work" Option A: Filter 1: if FROM contains "Boss" -> move to "Work" Filter 2: if FROM contains "CEO" -> move to "Work" Filter 3: if FROM contains "Intern" -> move to "Work" Filter 4: if FROM contains "StackOverflow" -> move to "Stack" Option B: Filter 1: if FROM contains "Boss" OR FROM contains "CEO" OR FROM contains "Intern" -> move to "Work" Filter 2: if FROM contains "StackOverflow" -> move to "Stack" Assuming that when I'm done, I'll have about a hundred different criteria to filter on, is one of these methods better than the other from a performance standpoint?

    Read the article

  • CSS Shaders : la proposition d'Adobe pour les animations 3D acceptée par le W3C, elle devient les Custom Filters

    CSS Shaders : la proposition d'Adobe pour les animations 3D a été acceptée par le W3C Elle devient les Custom Filters Il y a plusieurs mois déjà, Adobe, avec l'aide d'Opera et d'Apple, avait proposé au W3C une nouvelle technologie : CSS Shaders. Cette nouveauté qui permettrait d'intégrer des animations 3D aux feuilles de style CSS vient d'être acceptée par le World Wide Web Consortium. Ce qui signifie que les CSS Shaders vont devenir un standard du Web. Ils seront intégrés dans les spécifications effets de filtres

    Read the article

  • How to retain the values of the filters and its result using asp.net c#?

    - by user144842
    Question:- Page is a typical search page with few filters on it. When search for records based on filters, it shows result in Gridview. From grid view records, user can click on any record to see the details which takes the focus on new page. Its working fine so far. Now when user comes back from details page to search page. I am loosing selected filters values and no result in grid view. How can i display selected filters and its results in gridview when user is coming back on search page? Any example etc.? FYI, I am using sessions to pass parameters to the ObjectDatasource.

    Read the article

  • Liferay hook: filter url giving filterstart error and current url generates exception null

    - by jack
    I'm trying to make an autologinfilter in Eclipse using a liferay hook. Now I've added the: <filter> <filter-name>myautologinfilter</filter-name> <filter-class>bla.bla.xyz</filter-class> </filter> <filter-mapping> <filter-name>myautologinfilter</filter-name> <url-pattern>/c/login/myurl</url-pattern> </filter-mapping> To the liferay hook's web.xml. In the liferay-hook.xml I added: portal.properties And in that hook.xml I added: auto.login.hooks=bla.bla.xyz bla.bla.xyz implements AutoLogin, but for now it's pretty gutted: @Override public String[] login(HttpServletRequest request, HttpServletResponse response) throws AutoLoginException { Object parameters = request.getAttribute("javax.servlet.forward.query_string"); Map<String, String> x = parserClass.parsing(parameters.toString()); System.out.println("voornaam: " + geparsdeParameters.get("tokenvalue1")); try { return null; } catch (Exception e) { throw new AutoLoginException(e); } } Since the hook doesn't start when I add the filtering I removed it and just tried: http://localhost:8080/c/portal/login?tokenvalue1=55 but when I check my tomcat I see: Error XYZ Url: url myUsedUrl exception null Also I tried adding some util classes but I got: classnotfoundexceptions. Is there anything specific I have to do when I add extra classes in a hook? Any advice/input would be appreciated. Or someone's ear I could lend so I could mail them a little bit so I could pick their brain a bit would be really appreciated since I don't know anyone who programs for liferay.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >