Search Results

Search found 10131 results on 406 pages for 'natural sort'.

Page 84/406 | < Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >

  • Programmatically determine whether to describe an object with "a" or "an"?

    - by MarathonStudios
    I have a database of nouns (ex "house", "exclamation point", "apple") that I need to output and describe in my application. It's hard to put together a natural-sounding sentence to describe an item without using "a" or "an" - "a house is BIG", "an exclamation point is SMALL", etc. Is there any function, library, or hack i can use in PHP to determine whether it is more appropriate to describe any given noun with A or AN?

    Read the article

  • Stretch image to fill div, but not skew

    - by z0mbieParade
    I'm trying to make an image stretch to fit inside a div. However I want it to overflow so that the entire div is filled. The div resizes with the page. I want an effect similar to the jQuery bgstretcher plugin (http://www.ajaxblender.com/bgstretcher-2-jquery-stretch-background-plugin-updated.html) , but I cannot use that plugin because I'm already using it for the background image on the page, and it seems to not work when you try and activate multiple instances of it. So what I'm asking is for some sort of simple jQuery function that resizes an image to completely fill a div with overflow hidden, so that there are no gaps, but without skewing the image. Edit: http://jsfiddle.net/R7UCZ/ That's sort of what I'm after, but I want the image to fill the entire div without skewing. If the image goes out of the div a bit, that's fine, but I need it to resize with the div, which resizes with the page, both height and width.

    Read the article

  • Another Synergy issue: screen lock on Windows Server 2003

    - by pmr
    I have set up Synergy on Unix systems with no problems, however when I set up a Synergy server on a Windows Server 2003 box using I get an error message that the mouse cursor is locked when trying to move to the client system. I use a Microsoft Natural keyboard in case that matters (seems Scroll Lock might be involved). Does anyone have experience with using Synergy on Windows systems that have reported mouse screen locking in the log when unable to mouse over to a client system?

    Read the article

  • url rewriting in php htaccess

    - by HIma
    Hai I have 2 questions. 1) I want to create a clean url web site. My server is CGI/FastCGI. I know how this does in apache. But how I will do this in CGI server, does any one give me the details? 2) I want to create the clean url like mydomain/index.php?id=1&sort=a to mydomain/index/id/1/sort/a Is it possible? Does any one help me?

    Read the article

  • Can you call compiled JRuby classes from java?

    - by John Baker
    So I came up with the general idea to write some code in JRuby, then access all the classes via Java. I have no idea if this is at all possible but I wanted to ask anyway. Lets say I have some JRuby code: class adder def addme return 22 end end If I compiled this with jrubyc is there any way I could then possibly do something like this in java: import adder; class anything { void testMethod() { adder a = new adder(); int x = a.addme(); } } After looking at it now it sort of makes me think that Java will have zero idea what sort of item test addme is going to return so that might not work. I don't know but I wanted to throw it out there anyway. Thanks

    Read the article

  • Sorting Multidimensional Array with Javascript: Integers

    - by tkm256
    I have a 2D array called "results." Each "row" array in results contains both string and integer values. I'm using this script to sort the array by any "column" on an onclick event: function sort_array(results, column, direction) { var sorted_results = results.sort(value); function value(a,b) { a = a[column]; b = b[column]; return a == b ? 0 : (a < b ? -1*direction : 1*direction) } } This works fine for the columns with strings. But it treats the columns of integers like strings instead of numbers. For example, the values 15, 1000, 200, 97 would be sorted 1000, 15, 200, 97 if "ascending" or 97, 200, 15, 1000 "descending." I've double-checked the typeof the integer values, and the script knows they're numbers. How can I get it to treat them as such?

    Read the article

  • Sorting an NSArray of NSString

    - by Robert Eisinger
    Can someone please show me the code for sorting an NSMutableArray? I have the following NSMutableArray: NSMutableArray *arr = [[NSMutableArray alloc] init]; with elements such as "2", "4", "5", "1", "9", etc which are all NSString. I'd like to sort the list in descending order so that the largest valued integer is highest in the list (index 0). I tried the following: [arr sortUsingSelector:@selector(compare:)]; but it did not seem to sort my values properly. Can someone show me code for properly doing what I am trying to accomplish? Thanks!

    Read the article

  • How to handle main option with Getopt

    - by Jérôme
    I want to handle a feature which seems to me almost natural with programs, and I don't know how to handle it with Getopt perl package (no matter Std ot Long). I would like something like: ./perlscript <main option> [some options like -h or --output-file some_name] Options will be handled with - or --, but I want to be able to let the user give me the main and needed option without dashes. Is Getopt able to do that, or do I have to handle it by hand?

    Read the article

  • How to access a subset of XML data in Java when the XML data is too large to fit in memory?

    - by Michael Jones
    What I would really like is a streaming API that works sort of like StAX, and sort of like DOM/JDom. It would be streaming in the sense that it would be very lazy and not read things in until needed. It would also be streaming in the sense that it would read everything forwards (but not backwards). Here's what code that used such an API would look like. URL url = ... XMLStream xml = XXXFactory(url.inputStream()) ; // process each <book> element in this document. // the <book> element may have subnodes. // You get a DOM/JDOM like tree rooted at the next <book>. while (xml.hasContent()) { XMLElement book = xml.getNextElement("book"); processBook(book); } Does anything like this exist?

    Read the article

  • Sorting a 2D numpy array by multiple axes

    - by perimosocordiae
    I have a 2D numpy array of shape (N,2) which is holding N points (x and y coordinates). For example: array([[3, 2], [6, 2], [3, 6], [3, 4], [5, 3]]) I'd like to sort it such that my points are ordered by x-coordinate, and then by y in cases where the x coordinate is the same. So the array above should look like this: array([[3, 2], [3, 4], [3, 6], [5, 3], [6, 2]]) If this was a normal Python list, I would simply define a comparator to do what I want, but as far as I can tell, numpy's sort function doesn't accept user-defined comparators. Any ideas?

    Read the article

  • How to research unmanaged memory leaks in .NET?

    - by Brandon
    I have a WCF service running over MSMQ. Memory gradually increases over time, indicating that there is some sort of memory leak. I ran the service locally and monitored some counters using PerfMon. Total CLR memory managed heap bytes remains relatively constant, while the process' private bytes increases over time. This leads me to believe that there is some sort of unmanaged memory leak. Assuming that unmanaged memory leak is the issue, how do I address the issue? Are there any tools I could use to give me hints as to what is causing the unmanaged memory leak? Also, all my service is doing is reading from the transactional queue and writing to a database, all as part of a DTC transaction (handled under the hood by requiring a transaction on the service contract). I am not doing anything explicitly with COM or DllImports. Thanks in advance!

    Read the article

  • How to add header, footer with images using PDF::API2::Lite ?

    - by Space
    Is it possible to add header(with image) and footer (with page number) with images. I wrote below code to create a PDF document which shows png images. If this can be done easily with any other module, please suggest.Really appreciate response with sample code. use strict; use PDF::API2::Lite; use Getopt::Long; my $outfile; my $path; my $options = GetOptions( "outfile=s" => \$outfile, "images=s" => \$path,); my @images = sort glob("$path") or die "No Files\n"; my $pdf = PDF::API2::Lite->new(); for my $png ( sort @images ) { my $image = $pdf->image_png( "$png" ); $pdf->page(1150,450); $pdf->image($image, 10, 10); } $pdf->saveas( $outfile );

    Read the article

  • Proper use of of typedef in C++

    - by dicroce
    I have coworkers who occasionally use typedef to avoid typing. For example: typedef std::list<Foobar> FoobarList; ... FoobarList GetFoobars(); Personally, I always hate coming across code like this, largely because it forces me to go lookup the typedef so I can tell how to use it. I also feel like this sort of thing is a potential slippery slope... If you do this, why aren't you doing it more? (pretty soon, your code is totally obfuscated). I found this SO question regarding this issue: when should I use typedef in C I have two questions: 1) am I truly alone in disliking this? 2) If the vast majority of people think this sort of typedef use is OK, what criteria do you use to determine whether to typedef a type?

    Read the article

  • What language should I learn to make 2D turn-based video games?

    - by giggles
    I want to make 2 dimensional turn-based games for the PC. Something like early Final Fantasy or Chrono Trigger. Is C++ the only plausible option? I keep getting told that C++ is the language of choice for games, but is this the case even for 2D, turn-based games? Are any other languages good for this sort of thing? I'm really big on clean, readable, extendible code, so a language that fosters that sort of thing would be great. Doing this for fun, not business. Java is the only language I really know well right now. By the way, this is my first question and I'm a noob. I read the FAQ, but if I'm doing anything noobish anyway, then I'm sorry.

    Read the article

  • Best way to order by columns in relationships?

    - by Timmy
    im using sqlalchemy, and i have a few polymorphic tables, and i want to sort by a column in one of the relationship. i have tables a,b,c,d, with relationship a to b, b to c, c to d. a to b is one-to-many b to c and c to d are one-to-one, but polymorphic. given an item in table a, i will have a list of items b, c, d (all one to one). how do i use sqlalchemy to sort them by a column in table d?

    Read the article

  • Sorting records datewise in datatable.

    - by Harikrishna
    I have datatable and I am storing the records in that datatable. Now one of the column in the datatable is type of DateTime.That column I added by code Table.Columns.Add(new DataColumn("TradingDate",System.Type.GetType("System.DateTime"))); Now I want to sort the records datewise in ascending order. I have used following code but the records are not sorted. DataView view = new DataView(Table); view.Sort = "TradingDate ASC"; dataGridView1.DataSource=view.Table; But records are not sorted so how to do it ?

    Read the article

  • Comparator interface

    - by 1ace1
    ok I was going to edit my previous question but i wasnt sure if it was the right way to do it so i'll just give another question about Comparator, now i want to be able to sort with different ways. I have a bank checks and i want to sort with checkNumber then checkAmount i managed to do it with checkNumber but couldnt figure out how with checkAmount here is how i did it for checkNumber: import java.util.Comparator; public class Check implements Comparator { private int checkNumber; private String description; private double checkAmount; public Check() { } public Check(int newCheckNumber, double newAmountNumber) { setCheckNumber(newCheckNumber); setAmountNumber(newAmountNumber); } public String toString() { return checkNumber + "\t\t" + checkAmount; } public void setCheckNumber(int checkNumber) { this.checkNumber = checkNumber; } public int getCheckNumber() { return checkNumber; } public void setAmountNumber(double amountNumber) { this.checkAmount = amountNumber; } public double getAmountNumber() { return checkAmount; } @Override public int compare(Object obj1, Object obj2) { int value1 = ((Check) obj1).getCheckNumber(); int value2 = ((Check) obj2).getCheckNumber(); int result = 0; if (value1 > value2){ result = 1; } else if(value1 < value2){ result = -1; } return result; } } import java.util.ArrayList; import java.util.Collections; import test.CheckValue; public class TestCheck { public static void main(String[] args) { ArrayList List = new ArrayList(); List.add(new Check(445, 55.0)); List.add(new Check(101,43.12)); List.add(new Check(110,101.0)); List.add(new Check(553,300.21)); List.add(new Check(123,32.1)); Collections.sort(List, new Check()); System.out.println("Check Number - Check Amount"); for (int i = 0; i < List.size(); i++){ System.out.println(List.get(i)); } } } thank you very much in advance and please tell me if im submiting things in the wrong way.

    Read the article

  • Sorting and displaying a custom QVariant type.

    - by Kranar
    Hello, I have a custom type I'd like to use with QVariant but I don't know how to get the QVariant to display in a table or have it sort in a QSortFilterProxyModel. I register the type with Q_DECLARE_METATYPE and wrote streaming operators registered via qRegisterMetaTypeStreamOperators but for whatever reason when I use the type with a table model, it doesn't display anything and it doesn't sort. I should specify that this custom type can not be modified. It has a copy and default constructor, but I can not go in and modify the source code to get it to work with QVariant. Is there a way of non-intrusively getting the behaviour I'd like?

    Read the article

  • Sorting multidimensional array on inner value php [duplicate]

    - by Silver89
    This question already has an answer here: Reference: all basic ways to sort arrays and data in PHP 4 answers Say I have the following array, how can I sort it on sort_by? Array ( [10] => Array ( [Masthead_slide] => Array ( [id] => 1456464564 [sort_by] => 1 ) ) [6] => Array ( [Masthead_slide] => Array ( [id] => 645454 [sort_by] => 10 ) ) [7] => Array ( [Masthead_slide] => Array ( [id] => 4547 [sort_by] => 5 ) ) )

    Read the article

  • MySQL sorting: NULL to the end & use index? Not possible?

    - by Vojto
    Hello fellow experts, I have a huge table and I want simple sorting. It could be so easy. I could just create an index and do some really fast sorting thanks to that index. But my client wants to put NULLs to the end, which is complicates the whole situation. Instead of simple: SORT BY name ASC I have to do SORT BY name IS NULL ASC, name ASC. That would be ok, but it because of that my index is useless, and the sorting is very slow. I don't know if there's a way to solve this problem, but if there is one, I desperately ask for help. :'(

    Read the article

  • Sending a Java object from my Android phone to my Computer

    - by TehGoose
    Hi, I was wondering what the simplest program for sending an object from my Andriod phone to my computer wirelessly (via LAN) would be. I have created Java RMI programs with a server and multiple clients, so I have a grasp of the concept. However with android I'm just not sure where to start. What I am aiming to do is send some sort of information (could simply be text) to my computer and my computer will do an action. I have the GUI interface's and the actions to be carried out all worked out, just the sending of some sort of information is getting me. Could anyone help me out?

    Read the article

  • sorting extendeddatatable in richfaces

    - by user414597
    Hello All, does anyone know how exactly the default sorting works in richfaces datatable columns? (using sortby) My problem is that once a sort has been performed, the new data order is never preserved in my backing's bean data model (which makes me wonder where is this new order now stored?), that is the actual datamodel always contains just the original data.. So if say user goes to a another page and returns to what should be sorted data (using back button) , the data displays as original, not sorted.. Has anyone come across this? also, is there a way to do server side sorting, i.e. call my own sort method upon clicking the header..? many thanks for any advice!

    Read the article

  • Rails 3 refactoring issue

    - by Craig
    The following view code generates a series of links with totals (as expected): <% @jobs.group_by(&:employer_name).sort.each do |employer, jobs| %> <%= link_to employer, jobs_path() %> <%= "(#{jobs.length})" %> <% end %> However, when I refactor the view's code and move the logic to a helper, the code doesn't work as expect. view: <%= employer_filter(@jobs_clone) %> helper: def employer_filter(jobs) jobs.group_by(&:employer_name).sort.each do |employer,jobs| link_to employer, jobs_path() end end The following output is generated: <Job:0x10342e628>#<Job:0x10342e588>#<Job:0x10342e2e0>Employer A#<Job:0x10342e1c8>Employer B#<Job:0x10342e0d8>Employer C#<Job:0x10342ded0>Employer D# What am I not understanding? At first blush, the code seems to be equivalent.

    Read the article

  • How do C++ header files work?

    - by PulpFiction
    Hi all. When I include some function from a header file in a C++ program, does the entire header file code get copied to the final executable or only the machine code for the specific function is generated. For example, if I call std::sort from the <algorithm> header in C++, is the machine code generated only for the sort() function or for the entire <algorithm> header file. I think that a similar question exists somewhere on Stack Overflow, but I have tried my best to find it (I glanced over it once, but lost the link). If you can point me to that, it would be wonderful.

    Read the article

  • Trying to re-create UI object from the native iPhone Calendar Notes

    - by FrankOS
    Probably a lame question for a start but i'm trying to re-create the ui object that's used in Apple's native Calendar to create notes. It's the basic text-field but with multiple lines. Sort of a text-area. Now i know that anything from the calendar in terms of ui objects isn't available but i have seen this in quite few apps so i'm guessing it's some sort of standard component. I must be dumb but i just cannot find it. Help please... Thx :)

    Read the article

< Previous Page | 80 81 82 83 84 85 86 87 88 89 90 91  | Next Page >