Search Results

Search found 5323 results on 213 pages for 'associated sorting'.

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

  • Sorting by Folder and Received in Outlook 2010

    - by Simon Martin
    I want to sort my Unread Mail folder by Folder and within that by Recieved (oldest on top). I've found that by clicking the "In Folder" header, holding down Shift and clicking Received twice I can get the sort I want but if I leave that view (for example checking the calendar) and then return that the sort order has not kept things as I expect. Looking in the View Settings Sort it shows "In Folder (ascending), Received (ascending)" but that doesn't create the same view as using the shift button...

    Read the article

  • iTunes 9 not sorting albums by track order consistently

    - by joshhunt
    I have my iTunes library set to sort by music by Artist, then album (). For most of my albums this will also sort the albums in the correct track listing order (using the track number tag). Except for one album: As you can see, "The Boy Who Knew Too Much" seems to sort erratically. Why is this happening and how can I fix it?

    Read the article

  • What sorting algorithm is this?

    - by Mike
    Hi, I have a sorting algorithm as follows. My question is, which sorting algorithm is this? I thought it was bubble sort, but it does not do multiple runs. Any idea? Thanks! //sorting in descending order struct node { int value; node* NEXT; } //Assume HEAD pointer denotes the first element in the //linked list // only change the values…don’t have to change the //pointers Sort( Node *Head) { node* first,second,temp; first= Head; while(first!=null) { second=first->NEXT; while(second!=null) { if(first->value < second->value) { temp = new node(); temp->value=first->value; first->value=second->value; second->value=temp->value; delete temp; } second=second->NEXT; } first=first->NEXT; } }

    Read the article

  • Sorting by dates (including nil) with NSFetchedResultsController

    - by glorifiedHacker
    In my NSFetchedResultsController, I set a sortDescriptor that sorts based on the date property of my managed objects. The problem that I have encountered (along with several others according to Google) is that nil values are sorted at the earliest end rather than the latest end of the date spectrum. I want my list to be sorted earliest, earlier, now, later, latest, nil. As I understand it, this sorting is done at the database level in SQLite and so I cannot construct my own compare: method to provide the sorting I want. I don't want to manually sort in memory, because I would have to give up all of the benefits of NSFetchedResultsController. I can't do compound sorting because the sectionNameKeyPaths are tightly coupled to the date ranges. I could write a routine that redirects indexPath requests so that section 0 in the results controller gets mapped to the last section of the tableView, but I fear that would add a lot of overhead, severely increase the complexity of my code, and be very, very error-prone. The latest idea that I am considering is to map all nil dates to the furthest future date that NSDate supports. My left brain hates this idea, as it feels more like a hack. It will also take a bit of work to implement, since checking for nil factors heavily into how I process dates in my app. I don't want to go this route without first checking for better options. Can anyone think of a better way to get around this problem?

    Read the article

  • Custom listbox sorting

    - by Arcadian
    I need to sort the data contained within a number of listboxes. The user will be able to select between two different types of sorting using radio boxes, one of which is checked by default on form load. I have created the IF statements needed in order to test whether the checked condition is true for that radio button. but i need some help to create the custom sort algorithms. Each list with contain similar looking data, the only difference in the prefix with which each line starts. For example each line in the first listbox starts with the prefix "G30" and the second listbox will be "G31" and so on. There are 10 listboxes in total (G30-G39 in terms of prefixes). The first search algorithm has to sort the lines by the number order of the first 13 chars. Example: This is how the data looks before sorting G35:45:58:11 JG07 G35:45:20:41 JG01 G35:58:20:21 JG03 G35:66:22:20 JG05 G35:45:85:21 JG02 G35:64:56:11 JG03 G35:76:35:11 JG02 G35:77:97:12 JG03 G35:54:29:11 JG01 G35:55:51:20 JG01 G35:76:24:20 JG06 G35:76:55:11 JG01 and this is how it should look after sorting G35:45:20:41 JG01 G35:45:58:11 JG07 G35:45:85:21 JG02 G35:54:29:11 JG01 G35:55:51:20 JG01 G35:58:20:21 JG03 G35:64:56:11 JG03 G35:66:22:20 JG05 G35:76:24:20 JG06 G35:76:35:11 JG02 G35:76:55:11 JG01 G35:77:97:12 JG03 as you can see, the prefixes are the same. so it is sorted, lowest first, by the next pair integers, then the next pair and the next but not by the value after "JG". the second sort algorithm will ignore the first 13 chars and sort by order of the value after "JG", highest first. any help? theres some rep in it for you :) thanks in advance

    Read the article

  • Sorting: TransientVO Vs Query/EO based VO

    - by Vijay Mohan
    In ADF, you can do a sorting on VO rows by invoking setSortBy("VOAttrName") API, but the tricky part is that, this API actually appends a clause to VO query at runtime and the actual sorting is performed after doing VO.executeQuery(), this goes fine for Query/EO based VO. But, how about the transient VO, wherein the rows are populated programmatically..?There is a way to it..:)you can actually specify the query mode on your transient VO, so that the sorting happens on already populated VO rows.Here are the steps to go about it..//Populate your transient VO rows.//VO.setSortBy("YourVOAttrName");//VO.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);//VO.executeQuery();So, here the executeQuery() is actually the trigger which calls for VO rows sorting.QUERY_MODE_SCAN_VIEW_ROWS flag makes sure that the sorting is performed on the already populated VO cache.

    Read the article

  • Having different database sorting order (default_scope) for two different views

    - by Juniper747
    In my model (pins.rb), I have two sorting orders: default_scope order: 'pins.featured DESC' #for adding featured posts to the top of a list default_scope order: 'pins.created_at DESC' #for adding the remaining posts beneath the featured posts This sorting order (above) is how I want my 'pins view' (index.html.erb) to look. Which is just a list of ALL user posts. In my 'users view' (show.html.erb) I am using the same model (pins.rb) to list only current_user pins. HOWEVER, I want to sorting order to ignore the "featured" default scope and only use the second scope: default_scope order: 'pins.created_at DESC' How can I accomplish this? I tried doing something like this: default_scope order: 'pins.featured DESC', only: :index default_scope order: 'pins.created_at DESC' But that didn't fly... UPDATE I updated my model to define a scope: scope :featy, order: 'pins.featured DESC' default_scope order: 'pins.created_at DESC' And updated my pins view to: <%= render @pins.featy %> However, now when I open my pins view, I get the error: undefined method `featy' for #<Array:0x00000100ddbc78> UPDATE 2 User.rb class User < ActiveRecord::Base attr_accessible :name, :email, :username, :password, :password_confirmation, :avatar, :password_reset_token, :password_reset_sent_at has_secure_password has_many :pins, dependent: :destroy #destroys user posts when user is destroyed # has_many :featured_pins, order: 'featured DESC', class_name: "Pin", source: :pin has_attached_file :avatar, :styles => { :medium => "300x300#", :thumb => "120x120#" } before_save { |user| user.email = user.email.downcase } before_save { |user| user.username = user.username.downcase } before_save :create_remember_token before_save :capitalize_name validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_USERNAME_REGEX = /^[A-Za-z0-9]+(?:[_][A-Za-z0-9]+)*$/ validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false } validates :username, presence: true, format: { with: VALID_USERNAME_REGEX }, uniqueness: { case_sensitive: false } validates :password, length: { minimum: 6 }, on: :create #on create, because was causing erros on pw_reset Pin.rb class Pin < ActiveRecord::Base attr_accessible :content, :title, :privacy, :date, :dark, :bright, :fragmented, :hashtag, :emotion, :user_id, :imagesource, :imageowner, :featured belongs_to :user before_save :capitalize_title before_validation :generate_slug validates :content, presence: true, length: { maximum: 8000 } validates :title, presence: true, length: { maximum: 24 } validates :imagesource, presence: { message: "Please search and choose an image" }, length: { maximum: 255 } validates_inclusion_of :privacy, :in => [true, false] validates :slug, uniqueness: true, presence: true, exclusion: {in: %w[signup signin signout home info privacy]} # for sorting featured and newest posts first default_scope order: 'pins.created_at DESC' scope :featured_order, order: 'pins.featured DESC' def to_param slug # or "#{id}-#{name}".parameterize end def generate_slug # makes the url slug address bar freindly self.slug ||= loop do random_token = Digest::MD5.hexdigest(Time.zone.now.to_s + title)[0..9]+"-"+"#{title}".parameterize break random_token unless Pin.where(slug: random_token).exists? end end protected def capitalize_title self.title = title.split.map(&:capitalize).join(' ') end end users_controller.rb class UsersController < ApplicationController before_filter :signed_in_user, only: [:edit, :update, :show] before_filter :correct_user, only: [:edit, :update, :show] before_filter :admin_user, only: :destroy def index if !current_user.admin? redirect_to root_path end end def menu @user = current_user end def show @user = User.find(params[:id]) @pins = @user.pins current_user.touch(:last_log_in) #sets the last log in time if [email protected]? render 'pages/info/' end end def new @user = User.new end pins_controller.rb class PinsController < ApplicationController before_filter :signed_in_user, except: [:show] # GET /pins, GET /pins.json def index #Live Feed @pins = Pin.all @featured_pins = Pin.featured_order respond_to do |format| format.html # index.html.erb format.json { render json: @pins } end end # GET /pins, GET /pins.json def show #single Pin View @pin = Pin.find_by_slug!(params[:id]) require 'uri' #this gets the photo's id from the stored uri @image_id = URI(@pin.imagesource).path.split('/').second if @pin.privacy == true #check for private pins if signed_in? if @pin.user_id == current_user.id respond_to do |format| format.html # show.html.erb format.json { render json: @pin } end else redirect_to home_path, notice: "Prohibited 1" end else redirect_to home_path, notice: "Prohibited 2" end else respond_to do |format| format.html # show.html.erb format.json { render json: @pin } end end end # GET /pins, GET /pins.json def new @pin = current_user.pins.new respond_to do |format| format.html # new.html.erb format.json { render json: @pin } end end # GET /pins/1/edit def edit @pin = current_user.pins.find_by_slug!(params[:id]) end Finally, on my index.html.erb I have: <%= render @featured_pins %>

    Read the article

  • python: sorting

    - by nabizan
    hi im doing a loop so i could get dict of data, but since its a dict it's sorting alphabetical and not as i push it trought the loop ... is it possible to somehow turn off alphabetical sorting? here is how do i do that data = {} for item in container: data[item] = {} ... for key, val in item_container.iteritems(): ... data[item][key] = val whitch give me something like this data = { A : { K1 : V1, K2 : V2, K3 : V3 }, B : { K1 : V1, K2 : V2, K3 : V3 }, C : { K1 : V1, K2 : V2, K3 : V3 } } and i want it to be as i was going throught the loop, e.g. data = { B : {K2 : V2, K3 : V3, K1 : V1}, A : {K1 : V1, K2 : V2, K3 : V3}, C : {K3 : V3, K1 : V1, K2 : V2} }

    Read the article

  • Sorting a list of colors in one dimension?

    - by Ptah- Opener of the Mouth
    I would like to sort a one-dimensional list of colors so that colors that a typical human would perceive as "like" each other are near each other. Obviously this is a difficult or perhaps impossible problem to get "perfectly", since colors are typically described with three dimensions, but that doesn't mean that there aren't some sorting methods that look obviously more natural than others. For example, sorting by RGB doesn't work very well, as it will sort in the following order, for example: (1) R=254 G=0 B=0 (2) R=254 G=255 B=0 (3) R=255 G=0 B=0 (4) R=255 G=255 B=0 That is, it will alternate those colors red, yellow, red, yellow, with the two "reds" being essentially imperceivably different than each other, and the two yellows also being imperceivably different from each other. But sorting by HLS works much better, generally speaking, and I think HSL even better than that; with either, the reds will be next to each other, and the yellows will be next to each other. But HLS/HSL has some problems, too; things that people would perceive as "black" could be split far apart from each other, as could things that people would perceive as "white". Again, I understand that I pretty much have to accept that there will be some splits like this; I'm just wondering if anyone has found a better way than HLS/HSL. And I'm aware that "better" is somewhat arbitrary; I mean "more natural to a typical human". For example, a vague thought I've had, but have not yet tried, is perhaps "L is the most important thing if it is very high or very low", but otherwise it is the least important. Has anyone tried this? Has it worked well? What specifically did you decide "very low" and "very high" meant? And so on. Or has anyone found anything else that would improve upon HSL? I should also note that I am aware that I can define a space-filling curve through the cube of colors, and order them one-dimensionally as they would be encountered while travelling along that curve. That would eliminate perceived discontinuities. However, it's not really what I want; I want decent overall large-scale groupings more than I want perfect small-scale groupings. Thanks in advance for any help.

    Read the article

  • Sorting tab delimited text file based on multiple columns in natural way [duplicate]

    - by Vignesh
    This question already has an answer here: Sorting a column of CSV file resulting in 1123 appearing before 232 1 answer I am trying to sort a file based on all two columns Eg: chr19 1070019 1070020 chr16 869712 869713 chr1 1378131 1378132 chr12 189386 189387 chr4 254941 254942 chr16 1476500 1476501 chr2 1476810 1476811 chr19 313283 313284 chr17 595817 595818 chr18 656897 656898 chr19 1061829 1061830 I Tried sort -t $\t -k1,1 2,2 <filename> but doesn't work. I want the output to be sorted by first column and second column based on first column. I want to do a natural sort. Not lexical sorting. Eg: chr1 1378131 1378132 chr2 1476810 1476811 chr4 254941 254942 chr12 189386 189387 chr16 869712 869713 chr16 1476500 1476501 chr17 595817 595818 chr18 656897 656898 chr19 313283 313284 chr19 1061829 1061830 chr19 1070019 1070020 Anyone any idea?

    Read the article

  • Sorting NSTableColumn contents

    - by Yahoo
    Hey, I have a problem with sorting NSTableColumn contents. In my NSTableView there are three columns: File, Size, Path. The contents are stored in NSMutableArray. Each object in this array is a NSDictionary containing three keys: file, size and path - value for each is a NSString. In Interface Builder, in each Table Column's attributes I can choose sorting options: Selector: IB entered "compare:" which I think is ok, because I compare NSStrings. Sort Key - and that's the problem I think - I don't know what to enter here. Any clues? If you've got questions about my code, please ask.

    Read the article

  • UCA + Natural Sorting

    - by Alix Axel
    I recently learnt that PHP already supports the Unicode Collation Algorithm via the intl extension: $array = array ( 'al', 'be', 'Alpha', 'Beta', 'Álpha', 'Àlpha', 'Älpha', '????', 'img10.png', 'img12.png', 'img1.png', 'img2.png', ); if (extension_loaded('intl') === true) { collator_asort(collator_create('root'), $array); } Array ( [0] => al [2] => Alpha [4] => Álpha [5] => Àlpha [6] => Älpha [1] => be [3] => Beta [11] => img1.png [9] => img10.png [8] => img12.png [10] => img2.png [7] => ???? ) As you can see this seems to work perfectly, even with mixed case strings! The only drawback I've encountered so far is that there is no support for natural sorting and I'm wondering what would be the best way to work around that, so that I can merge the best of the two worlds. I've tried to specify the Collator::SORT_NUMERIC sort flag but the result is way messier: collator_asort(collator_create('root'), $array, Collator::SORT_NUMERIC); Array ( [8] => img12.png [7] => ???? [9] => img10.png [10] => img2.png [11] => img1.png [6] => Älpha [5] => Àlpha [1] => be [2] => Alpha [3] => Beta [4] => Álpha [0] => al ) However, if I run the same test with only the img*.png values I get the ideal output: Array ( [3] => img1.png [2] => img2.png [1] => img10.png [0] => img12.png ) Can anyone think of a way to preserve the Unicode sorting while adding natural sorting capabilities?

    Read the article

  • Using a locale-dependent sorting function in Ruby/Rails

    - by knuton
    What is a good approach to sorting an array of strings in accordance with the current locale? For example the standard Array#sort puts "Ä" after "Z", which is not correct in German. I would have expected the gem I18n to offer a hook for defining my own sorting algorithms or providing collation strings or objects. In my imagination, passing this proc or string to the sort function, would make it behave as necessary. I know that this is possible in Python, for example. Google has not helped me this time. Can you? Any advice appreciated!

    Read the article

  • Groovy: Sorting Columns in a view: list

    - by Luixv
    I have a Groovy application. I am rendering the view list using the following statement: render (view: 'list', model:[reportingInstanceList: reportingInstanceList, reportingInstanceTotal: i, params: params]) The list.gsp is as follows: The view is rendered but the default sorting is not working. <g:sortableColumn class="tabtitle" property="id" title="Id" titleKey="reporting.id" /> <g:sortableColumn class="tabtitle" property="company" title="Company" titleKey="reporting.company" /> Unfortunately the default sorting (by id, by company, etc) are not working. Any hint why? Thanks a lot in advance. Luis

    Read the article

  • 3-Way sorting in ultragrid

    - by M_Mogharrabi
    how can i have a ultragrid with 3-way sorting on every columns? I mean : a. Ascendiing -Indicated by default ascending SortIndicator. b. Descending- Indicated by default descending SortIndicator. c. No Sort- UnSort the column. Note: I have tried BeforeSortChanged Event but i had 2 problems: I could not get the previous column sort indicator to find out when should i disable sorting. I have got an Exception where it is saying that we can't change SortIndicator in BeforeSortChange Event

    Read the article

  • Sorting NSTableColumn contents

    - by Yahoo
    Hey, I have a problem with sorting NSTableColumn contents. In my NSTableView there are three columns: File, Size, Path. The contents are stored in NSMutableArray. Each object in this array is a NSDictionary containing three keys: file, size and path - value for each is a NSString. In Interface Builder, in each Table Column's attributes I can choose sorting options: Selector: IB entered "compare:" which I think is ok, because I compare NSStrings. Sort Key - and that's the problem I think - I don't know what to enter here. Any clues? If you've got questions about my code, please ask.

    Read the article

  • natural sort of text and numbers, JavaScript

    - by ptrn
    I'm looking for the easiest way to sort an array that consists of numbers and text, and a combination of these. E.g. '123asd' '19asd' '12345asd' 'asd123' 'asd12' turns into '19asd' '123asd' '12345asd' 'asd12' 'asd123' This is going to be used in combination with the solution to another question I've asked here. The sorting function in itself works, what I need is a function that can say that that '19asd' is smaller than '123asd'. I'm writing this in JavaScript. Edit: as adormitu pointed out, what I'm looking for is a function for natural sorting

    Read the article

  • alphanumeric and special character sorting

    - by Kaushik Gopal
    Hi ppl, I wanted to know the different standards of sorting. To be more specific take the sample set: (Please note there's capitals, small letters, special characters, null values and numbers here) A a 3F Zx - 1Ad NULL How would the Oracle Database sort this by default? How would LINQ sort this by default? How would db2 sort this by default? (the following may get even more vague) How does the Windows platform sort this? (I mean say you have a couple of filenames, by default how would this get treated in a name sort) How does the *nix platform sort this? Is there some sort of standard for alphanumeric/special character sorting? The Windows operating system orders with numbers first, then alphabets. The Oracle database however treats alphabets first. I'm not sure of the *nix platform. It would be nice to have one place to know all these rules for the most common platforms (listed in questions above). Would the gurus throw some light on this topic? Cheers, K

    Read the article

  • Sorting shell items like windows explorer

    - by Roy M Klever
    Hi, I am making a bread crumb bar in Delphi and having some problems regarding sorting the dropdown of the bread crumbs. Strangely enough, even Vista is not consequent when showing these items. I have tried many ways to figure out what is system folders, what is zip files and what is normal folders. It seems like an easy task but so far I have not found any good way of doing it. One way is to use TypeDisplayName from TSHFileinfo but these are localized names so I can not be sure they will be in correct order in every language. Here is the code I use to fill the menu: bool:= IsDesktop(SelectedPIDL); if bool then OleCheck(SHGetDesktopFolder(CurFolder)) else OleCheck(DesktopShellFolder.BindToObject(SelectedPIDL, nil, IID_IShellFolder, Pointer(CurFolder))); if CurFolder.EnumObjects(0, SHCONTF_FOLDERS, EnumIDList) = NOERROR then begin while EnumIDList.Next(1, CurPidl, Fetched) = S_OK do begin FName:= GetDisplayName(CurFolder, CurPidl, SHGDN_NORMAL); Text:= GetPIDLNameForAddressBar(CurFolder, CurPidl); if bool then Text:= PSpecialFolderItem(SpecialFolders[0]).Name + '\' + Text; if Text[Length(Text)] <> '\' then Text:= Text + '\'; NewPidl:= ConcatPIDLs(SelectedPIDL, CurPidl); SHGetFileInfo(PChar(NewPidl), 0, SFI, SizeOf(SFI), SHGFI_ATTRIBUTES or SHGFI_PIDL or SHGFI_SYSICONINDEX or SHGFI_TYPENAME); n:= SFI.dwAttributes; MenuList.Add(GetAttr(n) + FName); AddMenuItem(Text, FName, SFI.iIcon); CoTaskMemFree(CurPidl); CoTaskMemFree(NewPidl); end; end; CoTaskMemFree(SelectedPIDL); Any solution for how to get the correct sorting order? It is strange there is no way in dwAttributes of TSHFileInfo to tell if a folder is a system folder. Roy M Klever

    Read the article

  • sorting a gridview alphabetically when columns are codes

    - by nat
    hi there i have a gridview populated by a Web Service search function. some of the columns in the grid are templatefields, because the values coming back from the search (in a datatable) are ids - i then use these ids to lookup the values when the rowdatabound event is triggered and populate a label or some such. this means that my sorting function for these id/lookup columns sorts by the ids rather than the textual value that i have looked up and actually populated the grid with (although i do put the ids in the grids datakeys). what i want to do is top be able to sort by the looked up textual value rather than the codes for these particular columns. what i was going to do to get around this was to when the datatable comes back from the search, adding more columns the textual values and doing all the looking up then, thus being able to sort directly from the manually added columns. is there another way to do this? as that approach seems like a bit of a bodge. although i guess it does remove having to do the looking up in the rowdatabound event.... my sorting function works by sticking the datatable in the session and on each bind grabbing the sort column and binding the gridview to a DataView with the sort attribute set to the column - and the direction. thanks nat

    Read the article

  • C++ Bubble Sorting for Singly Linked List [closed]

    - by user1119900
    I have implemented a simple word frequency program in C++. Everything but the sorting is OK, but the sorting in the following script does not work. Any emergent help will be great.. #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> #include <iostream> #include <fstream> #include <cstdio> using namespace std; #include "ProcessLines.h" struct WordCounter { char *word; int word_count; struct WordCounter *pNext; // pointer to the next word counter in the list }; /* pointer to first word counter in the list */ struct WordCounter *pStart = NULL; /* pointer to a word counter */ struct WordCounter *pCounter = NULL; /* Print statistics and words */ void PrintWords() { ... pCounter = pStart; bubbleSort(pCounter); ... } //end-PrintWords void bubbleSort(struct WordCounter *ptr) { WordCounter *temp = ptr; WordCounter *curr; for (bool didSwap = true; didSwap;) { didSwap = false; for (curr = ptr; curr->pNext != NULL; curr = curr->pNext) { if (curr->word > curr->pNext->word) { temp->word = curr->word; curr->word = curr->pNext->word; curr->pNext->word = temp->word; didSwap = true; } } } }

    Read the article

  • Fastest sorting algorithm for a specific situation

    - by luvieere
    What is the fastest sorting algorithm for a large number (tens of thousands) of groups of 9 positive double precision values, where each group must be sorted individually? So it's got to sort fast a small number of possibly repeated double precision values, many times in a row. The values are in the [0..1] interval. I don't care about space complexity or stability, just about speed.

    Read the article

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