Search Results

Search found 1555 results on 63 pages for 'filtering'.

Page 12/63 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Filtering data in an array.

    - by user276424
    Hi all, I have an array that has 30 date objects. The date objects are indexed in the array from the minimum date value to the maximum date value. What I would like to do is retrieve only 7 dates from the array. Out of the 7, the first one should be the minDate and the last should be the maxDate, with 5 dates in the middle. The 7 numbers should increment evenly from the minDate to the maxDate. How would I accomplish this? Hope I was clear. Thanks, Tonih

    Read the article

  • Retrieving multiple rows in SQL Server but distinct filtering only on one

    - by Nicklas
    I have this: SELECT Product.ProductID, Product.Name, Product.GroupID, Product.GradeID, AVG(tblReview.Grade) AS Grade FROM Product left Join tblReview ON Product.GroupID = tblReview.GroupID WHERE (Product.CategoryID = @CategoryID) GROUP BY Product.ProductID, Product.Name, Product.GroupID, Product.GradeID I would like to return only the rows where Product.Name is unique. If I make a SELECT DISTINCT the ProductID is different on every row so all the rows are unique.

    Read the article

  • Filtering records in controller

    - by Elliot
    So in my model, there is a field user_id - which holds the ID of the user who created the record. To display the ID of the current user, I have @current_user.id My question is this, in the controller I want @posts to only have records created by @current_user.id how can I do this?

    Read the article

  • Linq To Sql Left outer join - filtering null results

    - by Harry
    I'd like to reproduce the following SQL into C# LinqToSql SELECT TOP(10) Keywords.* FROM Keywords LEFT OUTER JOIN IgnoreWords ON Keywords.WordID = IgnoreWords.ID WHERE (DomainID = 16673) AND (IgnoreWords.Name IS NULL) ORDER BY [Score] DESC The following C# Linq gives the right answer. But I can't help think I'm missing something (a better way of doing it?) var query = (from keyword in context.Keywords join ignore in context.IgnoreWords on keyword.WordID equals ignore.ID into ignored from i in ignored.DefaultIfEmpty() where i == null where keyword.DomainID == ID orderby keyword.Score descending select keyword).Take(10); the SQL produced looks something like this: SELECT TOP (10) [t0].[DomainID], [t0].[WordID], [t0].[Score], [t0].[Count] FROM [dbo].[Keywords] AS [t0] LEFT OUTER JOIN (SELECT 1 AS [test], [t1].[ID] FROM [dbo].[IgnoreWords] AS [t1]) AS [t2] ON [t0].[WordID] = [t2].[ID] WHERE ([t0].[DomainID] = 16673) AND ([t2].[test] IS NULL) ORDER BY [t0].[Score] DESC How can I get rid of this redundant inner selection? It's only slightly more expensive but every bit helps!

    Read the article

  • Filtering a PHP array containing dates into a yearly summary

    - by privateace
    I'm looking at a way to create a summary of transactions within a certain month based on the contents of a PHP array. Intended outcome (excusing layout): ------------------------------------------- | December 2009 | 12 | | January 2010 | 02 | | February 2010 | 47 | | March 2010 | 108 | | April 2010 | 499 | ------------------------------------------- Based on my array: Array ( [0] => Array ( [name] => 2009-10-23 [values] => Array ( [0] => INzY2MTI4ZWM4OGRm ) ) [1] => Array ( [name] => 2009-10-26 [values] => Array ( [0] => IYmIzOWNmMmU3OWQz ) ) [2] => Array ( [name] => 2009-11-23 [values] => Array ( [0] => INTg4YzgxYWU1ODkx [1] => IMjhkNDZkY2FjNDhl ) ) [3] => Array ( [name] => 2009-11-24 [values] => Array ( [0] => INTg4YzgxYWU1ODkx [1] => INTg4YzgxYWU1ODkx ) ) [4] => Array ( [name] => 2009-12-01 [values] => Array ( [0] => IMWFiODk5ZjU1OTFk ) ) I've had absolutely no luck no matter what I've tried. Especially with adding months that do not contain any variables.

    Read the article

  • Filtering accelerometer data noise

    - by Faiz
    Hi How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high frequency components. I have read that Kalman filter might be the best candidate for this, but how do I integrate or use this method in my application which will mostly written in Android Java? or can it be done in the first place? or through Android NDK? Is there by any chance that this can be done in real-time? Any idea will be much appreciated. Thank you!

    Read the article

  • Filtering out specific objects from a search query in Alfresco using Java

    - by Snowright
    I have a HashSet containing all groups I've retrieved from my database. I've been asked to filter this result by removing two specific groups. It seems trivial but I can't seem to come up with a solid solution for storing the specific groups I want to filter out. My idea is to just create an array containing references to the two groups I need to filter out. I can then filter out my search query with whatever is in the array. My concern is that in the future they may ask to filter out more groups and maybe an array may not be a good idea. //Creates the array containing groups to filter out String[] hiddenGroups = {"group1","group2"}; //retrieves all groups Set<String>allGroups = new HashSet<String>(); allGroups.addAll(authorityService.getAllAuthorities(AuthorityType.GROUP); List<String>results = new ArrayList<String>(); //filters out specified groups for (String group : allGroups) { boolean isHidden = false; for (String hiddenGroup : hiddenGroups) { if (hiddenGroup.equalsIgnorecase(group)) { isHidden = true; } } if (!isHidden){ results.add(group); } }

    Read the article

  • django admin site - filtering available objects for user

    - by JPG
    I have models that belong to some 'group' (Company class). I want to add users, who will also belong to a one group and should be able to edit/manage/add objects with membership in associated group. something like: class Company() class Something() company = ForeignKey(Company) user Microsoft_admin company = ForeignKey(Company) and this user should only see and edit objects belonging to associated Company in the Admin Interface. How to acomplish that?

    Read the article

  • Filtering duplicate array entries with JQuery

    - by systempuntoout
    How do i filter duplicates of two arrays before appending entries to a DOM node (#list)? (function($) { $(document).ready(function() { var item_category1 = $('li.category1').get(); var item_category2 = $('li.category2').get(); $('#list') .append( $(item_category1).clone() ) .append( $(item_category2).clone() ); }); })(jQuery);

    Read the article

  • filtering elements from list of lists in Python?

    - by user248237
    I want to filter elements from a list of lists, and iterate over the elements of each element using a lambda. For example, given the list: a = [[1,2,3],[4,5,6]] suppose that I want to keep only elements where the sum of the list is greater than N. I tried writing: filter(lambda x, y, z: x + y + z >= N, a) but I get the error: <lambda>() takes exactly 3 arguments (1 given) How can I iterate while assigning values of each element to x, y, and z? Something like zip, but for arbitrarily long lists. thanks, p.s. I know I can write this using: filter(lambda x: sum(x)..., a) but that's not the point, imagine that these were not numbers but arbitrary elements and I wanted to assign their values to variable names.

    Read the article

  • Filtering coluns in SQL Server replication - how?

    - by truthseeker
    Hi, I need to replicate some data from two tables in one database to another databases. I used snapshot replication. The issue is that I would like to replicate only some selected columns and the others should stay with untouched data. I don't want to loose their data. The sours of those columns is other system. So I need to replicate only data from my columns. Do anybody know how to achieve this?

    Read the article

  • Filtering Questions (posts) by tag_name in TagController#index passing /tags?tag_name=something

    - by bgadoci
    I am trying to get my TagsController#index action to display only the Questions that contain certain tags when passing the search parameter tag_name. I am not getting an error just can't get the filter to work correctly such that upon receiving the /tags?tag_name=something url, only those questions are displayed . Here is the setup: class Tag < ActiveRecord::Base belongs_to :question def self.search(str) return [] if str.blank? cond_text = str.split.map{|w| "tag_name LIKE ? "}.join(" OR ") cond_values = str.split.map{|w| "%#{w}%"} all(:order => "created_at DESC", :conditions => (str ? [cond_text, *cond_values] : [])) end end and class Question < ActiveRecord::Base has_many :tags, :dependent => :destroy end tag link that would send the URL to the TagsController looks like this: <%= link_to(tag_name, tags_path(:tag_name => tag_name)) %> and outputs: /tags?tag_name=something In my /views/tags/index.html.erb view I am calling the questions by rendering a partial /views/questions/_question.html.erb. <%= render :partial => @questions %> When I send the URL with the search parameter nothing happens. Here is my TagsController#index action: def index @tags = Tag.search(params[:search]).paginate :page => params[:page], :per_page => 5 @tagsearch = Tag.search(params[:search]) @tag_counts = Tag.count(:group => :tag_name, :order => 'count_all DESC', :limit => 100) @questions = Question.all( :order => 'created_at DESC', :limit => 50) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @tags } end end How can I properly filter questions displayed in the /views/tags/index.html.erb file for the parameter tag.tag_name?

    Read the article

  • filtering and though a sharepoint list items with powershell

    - by naijacoder
    I have tried below but not getting any result back Not sure if i'm doing this well. Can i filter in the foreach or in my if statement Thanks in advance [DateTime] $CreatedDate = $item["Created"] $convertedCreatedDate = $CreatedDate.ToString("yyyy-MM-dd") $today = (Get-Date).AddDays(-1).ToString("yyyy-MM-dd") foreach ($item in $list.items | where {$convertedCreatedDate -eq $today}) { if ($list.items | where {$convertedCreatedDate -eq $today}) { Write-Host $item["Created"] } Write-Host $item["Created"] }

    Read the article

  • Filtering content (jQuery)

    - by Nimbuz
    HTML: <div class="filter"> <a href="#category-1">category 1</a> <a href="#category-2">category 2</a> </div> <ul class="items"> <li class="category-1">item 1</li> <li class="category-1">item 2</li> <li class="category-2">item 3</li> <li class="category-2">item 4</li> </ul> What I want is for example clicking on 'category 1' link should hide all other category items from the list. I understand jQuery's .filter() selector can be used but I'm not sure how to implement it for my purpose here. Thanks for your help!

    Read the article

  • Filtering subsets using Linq

    - by Nathan Matthews
    Hi All, Imagine a have a very long enunumeration, too big to reasonably convert to a list. Imagine also that I want to remove duplicates from the list. Lastly imagine that I know that only a small subset of the initial enumeration could possibly contain duplicates. The last point makes the problem practical. Basically I want to filter out the list based on some predicate and only call Distinct() on that subset, but also recombine with the enumeration where the predicate returned false. Can anyone think of a good idiomatic Linq way of doing this? I suppose the question boils down to the following: With Linq how can you perform selective processing on a predicated enumeration and recombine the result stream with the rejected cases from the predicate?

    Read the article

  • filtering value of a grid by selecting dropdownlist

    - by Nandini
    I have a grid and dropdownlist.I want to filter values in a grid by the selection of dropdownlist.How Can i do this? My code is like this <asp:DropDownList ID="DDLVisitedVol" runat="server" AutoPostBack="true" DataSourceID="DsVisitedVol" DataTextField="VisitedVol" DataValueField="VisitedVol" Width="244px"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="" ProviderName="" SelectCommand="SELECT [ID],[UserName], [Email], [visitedVol] FROM [HitTracker] where visitedVol=@VisitedVol "> <SelectParameters> <asp:Parameter Name="VisitedVol" Type="String"/> </SelectParameters> How can i pass the selected value of dropdown list to @VisitedVol . If anyone knows pls help me. tHANK YOU

    Read the article

  • Filtering and then counting distinct values

    - by Deon
    This is for Excel: I've been tasked with counting distinct records after I have filtered the data. I have 330 rows with column A containing the 'name' and in Column B I have the name of a test that was done for each 'name', which each 'name' could have taken several iterations of the same test. The test results are in Column C. Col A -Student Col B -Exam Col C - Grade Student 1 Exam 1 .80 Student 2 Exam 1 .50 Student 3 Exam 1 .90 Student 2 Exam 1 .75 Student 4 Exam 1 .90 Student 5 Exam 1 .55 Student 2 Exam 2 .90 Student 1 Exam 2 .90 .... .... ... If I filter col B for Exam 1, I want to count the unique number of students that have taken Exam 1.

    Read the article

  • Can FFT length affect filtering accuracy?

    - by Charles
    Hi, I am designing a fractional delay filter, and my lagrange coefficient of order 5 h(n) have 6 taps in time domain. I have tested to convolute the h(n) with x(n) which is 5000 sampled signal using matlab, and the result seems ok. When I tried to use FFT and IFFT method, the output is totally wrong. Actually my FFT is computed with 8192 data in frequency domain, which is the nearest power of 2 for 5000 signal sample. For the IFFT portion, I convert back the 8192 frequency domain data back to 5000 length data in time domain. So, the problem is, why this thing works in convolution, but not in FFT multiplication. Does converting my 6 taps h(n) to 8192 taps in frequency domain causes this problem? Actually I have tried using overlap-save method, which perform the FFT and multiplication with smaller chunks of x(n) and doing it 5 times separately. The result seems slight better than the previous, and at least I can see the waveform pattern, but still slightly distorted. So, any idea where goes wrong, and what is the solution. Thank you.

    Read the article

  • UIAcceleration filtering

    - by Ilya
    Hi, I found the following piece of code in apple guidelines: - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration { //Use a basic low-pass filter to only keep the gravity in the accelerometer values accel[0] = acceleration.x * kFilteringFactor + accel[0] * (1.0 - kFilteringFactor); accel[1] = acceleration.y * kFilteringFactor + accel[1] * (1.0 - kFilteringFactor); accel[2] = acceleration.z * kFilteringFactor + accel[2] * (1.0 - kFilteringFactor); } What does it exactly do? What is this low-pass filter? Why do I have to apply it? Thank you in advance.

    Read the article

  • CakePHP HABTM Filtering

    - by James Haigh
    Hi, I've got two tables - users and servers, and for the HABTM relationship, users_servers. Users HABTM servers and vice versa. I'm trying to find a way for Cake to select the servers that a user is assigned to. I'm trying things like $this->User->Server->find('all'); which just returns all the servers, regardless of whether they belong to the user. $this->User->Server->find('all', array('conditions' => array('Server.user_id' => 1))) just gives an unknown column SQL error. I'm sure I'm missing something obvious but just need someone to point me in the right direction. Thanks!

    Read the article

  • Is angularjs capable of filtering based on keywords?

    - by Alex90
    I have 30 categories in mysql. I have 450 subcategories which are related to the 30 categories in another table. Categories table id _ title _ Keywords 1 _ Animals _ animal, animals, pet, parrot 2 _ Books _ books, book, educational n _ xxx _ xxx Subcategories table id _ ref _ title _ keywords 1 _ 1 _ cats _ cats, persian cat, bengal cat 2 _ 1 _ dogs _ dogs, labrador, golder retriver 3 _ 2 _ Classic _ The davinci code, books, book, classical books I need to implement the filter to a textfield. If the users enters labrador in the textfield then show the categories or/and subcategories which contain 'labrador' in the keywords. In this case the "dogs" subcategory would appear! I know that this has been done using jquery. But is there anyway to implement this with angularJs? If you got a jsfiddle then it would be awesome! :) Thank you

    Read the article

  • Symfony: Pre filtering submitted values before/after validation

    - by Rob
    Hi All I've been scouring the net and i have found nothing! I am using symfonys form framework to build a simple 'Create' form. Validation is fine. However i'd like to pre-filter my submitted values, so adding ucfirst, strtoupper, and the like. I'm not sure if im missing something crucial here, but the way i see it is the only way to do this would be to create my own custom validators and utilizing the doClean method, which seems daft since i'd have hundreds of validators for each php function! Hope you guys can help, i've been crawling through source code, api's, numerous books and blogs and i haven't found a thing :( Either it's impossible, or it's really easy, i hope its the latter!

    Read the article

  • an algorhithm for filtering out raw txt files

    - by Roman Luštrik
    Imagine you have a .txt file of the following structure: >>> header >>> header >>> header K L M 200 0.1 1 201 0.8 1 202 0.01 3 ... 800 0.4 2 >>> end of file 50 0.1 1 75 0.78 5 ... I would like to read all the data except lines denoted by >>> and lines below the >>> end of file line. So far I've solved this using read.table(comment.char = ">", skip = x, nrow = y) (x and y are currently fixed). This reads the data between the header and >>> end of file. However, I would like to make my function a bit more plastic regarding the number of rows. Data may have values larger than 800, and consequently more rows. I could scan or readLines the file and see which row corresponds to the >>> end of file and calculate the number of lines to be read. What approach would you use?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >