Search Results

Search found 17924 results on 717 pages for 'z order'.

Page 38/717 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • Why does order matter for ImageMagick's -colorspace operation?

    - by Mark Trapp
    Starting with ImageMagick 6, the command style changed to solve a bunch of problems outlined in the Basic Usage document. That document does imply that for simple operations, one should only need to move the options from before the source file to between the source and output files to convert from the "old" style to the "new" style. However, this doesn't seem to work for the -colorspace operation. When I use the following command, I get an output file with the correct colors: convert -colorspace rgb input.pdf output.png But when I try to use the new command style, the -colorspace operation is never applied: convert input.pdf -colorspace rgb output.png Samples: Why does this occur?

    Read the article

  • Change library load order at run time (like LD_PRELOAD but during execution)

    - by tylerl
    How do I change the library a function loads from during run time? For example, say I want to replace the standard printf function with something new, I can write my own version and compile it into a shared library, then put "LD_PRELOAD=/my/library.so" in the environment before running my executable. But let's say that instead, I want to change that linkage from within the program itself. Surely that must be possible... right?

    Read the article

  • ORACLE SQL ROWNUM execution order

    - by iwan
    Dear expert, in Oracle SQL, there is a possible criteria called rownum. Can i confirm that rownum will be executed at last as just a limit for number of records return? or could it be executed first, before other WHERE SQL criteria (let's if we put rownum prior to the others)?

    Read the article

  • Re-order mysql rows using PHP

    - by dave e
    | id | url | title | menu_id | ------+--------+--------+---------- | 1 | http://| link 1 | 1 | | 2 | http://| link 2 | 2 | | 3 | http://| link 3 | 3 | | 4 | http://| link 4 | 4 | Hi, I was wondering if its possible using PHP to reorder the above to something like below. I am trying to generate a menu which can easily be reordered by clicking an up or down arrow. I have no idea where to start. Any help would be much appreciated. | id | url | title | menu_id | ------+--------+--------+---------- | 1 | http://| link 1 | 2 | | 2 | http://| link 2 | 4 | | 3 | http://| link 3 | 3 | | 4 | http://| link 4 | 1 |

    Read the article

  • Django: order by count of a ForeignKey field?

    - by AP257
    This is almost certainly a duplicate question, in which case apologies, but I've been searching for around half an hour on SO and can't find the answer here. I'm probably using the wrong search terms, sorry. I have a User model and a Submission model. Each Submission has a ForeignKey field called user_submitted for the User who uploaded it. class Submission(models.Model): uploaded_by = models.ForeignKey('User') class User(models.Model): name = models.CharField(max_length=250 ) My question is pretty simple: how can I get a list of the three users with the most Submissions? I trued creating a num_submissions method on the User model: def num_submissions(self): num_submissions = Submission.objects.filter(uploaded_by=self).count() return num_submissions and then doing: top_users = User.objects.filter(problem_user=False).order_by('num_submissions')[:3] but this fails, as do all the other things I've tried. Can I actually do it using a smart database query? Or should I just do something more hacky in the views file?

    Read the article

  • Using :limit and :order in the associated model

    - by r2b2
    Hello, Is there any way i can limit the results of an associated model? This what i was trying to do : <ul> <% account.logins.slice(0,5).sort_by(&:login_date).reverse.each do |login| -%> <li><%=h login.login_date.strftime("%d.%m.%Y")%></li> <% end -%> </ul> I'm trying to get the last five logins of the account. I cant seem to do it with account.logins(:limit=5) Thanks !

    Read the article

  • C#: reflection alternative for switch on enum in order to select namespace/class

    - by Am
    Hi, I have an interface named IHarvester. There are 3 implementations of that interface, each under their own namespace: Google Yahoo Bing A HarvesterManager uses the given harvester. It knows the interface and all 3 implementations. I want some way of letting the class user say in which harvester it wants to use. And in the code select that implementation, without a switch-case implementation. Can reflection save my day? Here is the code bits: // repeat for each harvester namespace Harvester.Google { public abstract class Fetcher : BaseHarvester, IInfoHarvester {...} } public enum HarvestingSource { Google, Yahoo, Bing, } class HarvesterManager { public HarvestingSource PreferedSource {get;set;} public HarvestSomthing() { switch (PreferedSource) .... // awful... } } Thanks.

    Read the article

  • Generate combinations by order and fixed length.

    - by roconmachine
    Suppose there is array main[] = [a,b,c,....z]; a[] = [a1,a2,a3,....] , b[] = [b1,b2,b3,....] and so on. So if we generate combination in main.length of ordered then it looks like ..... a1 b1 c1, a1 b1 c2, a1 b1 c3 ...... a1 b2 c1, a1 b3 c1, ..... a2 b1 c1, a3 b1 c1, ..... and total count will be a.length * b.length * c.length ........ = ? So write a code in any language to generate those combination. all the best. alex

    Read the article

  • CRC function without order dependency

    - by Pirks
    I need a CRC mechanism to calculate the CRC of a number of strings, such that, given two strings, A and B, the sum crc(A) + crc(B) == crc(A+B). P.S. XOR is too weak---the algorithm should be not trivial for reverse engineering.

    Read the article

  • order of initialization in Java

    - by M.H
    Hi, I want to ask why java initializes the static objects before the non-static objects ? in this example b3 will be initialized after b4 and b5 : class Cupboard { Bowl b3 = new Bowl(3); static Bowl b4 = new Bowl(4); Cupboard() {} static Bowl b5 = new Bowl(5); }

    Read the article

  • Z-Index: Divs still overlap in the wrong order (browserwide)

    - by BeatMe
    Hi, I can't select one of those dropdrown-links, although the #header div has a higher z-index than the rest. All relevant divs are in the same level but do not align properly: http://img32.imageshack.us/img32/4245/zindex.png <div id="header"> <div id="navigation"> </div> </div> <div id="sidebar"></div> <div id="content"> ... </div> #header { width: 915px; height: 76px; z-index: 5; } #content { width: 677px; height: 412px; margin-left: 202px; z-index:1; } #sidebar { float: left; width: 200px; height: 448px; z-index: 2; } #navigation { height: 28px; width: 915px; float: right; }

    Read the article

  • Parallel Haskell in order to find the divisors of a huge number

    - by Dragno
    I have written the following program using Parallel Haskell to find the divisors of 1 billion. import Control.Parallel parfindDivisors :: Integer->[Integer] parfindDivisors n = f1 `par` (f2 `par` (f1 ++ f2)) where f1=filter g [1..(quot n 4)] f2=filter g [(quot n 4)+1..(quot n 2)] g z = n `rem` z == 0 main = print (parfindDivisors 1000000000) I've compiled the program with ghc -rtsopts -threaded findDivisors.hs and I run it with: findDivisors.exe +RTS -s -N2 -RTS I have found a 50% speedup compared to the simple version which is this: findDivisors :: Integer->[Integer] findDivisors n = filter g [1..(quot n 2)] where g z = n `rem` z == 0 My processor is a dual core 2 duo from Intel. I was wondering if there can be any improvement in above code. Because in the statistics that program prints says: Parallel GC work balance: 1.01 (16940708 / 16772868, ideal 2) and SPARKS: 2 (1 converted, 0 overflowed, 0 dud, 0 GC'd, 1 fizzled) What are these converted , overflowed , dud, GC'd, fizzled and how can help to improve the time.

    Read the article

  • Teaching a kid to type in order to start programming

    - by at
    My 5 year old wants to start programming, but he doesn't yet know how to type without looking for each letter 1 at a time. I know it's going to frustrate him to go so slow because of his typing speed. And it's not going to be fun looking for all the letters constantly... So what's the best way to get him to type fast? Clearly he'll need to type a lot of punctuation like semicolons, colons and symbols. So his little hands will have to get used to spreading over the keyboard... I did some google searches and found some very poor looking apps that focused on the letters.

    Read the article

  • Linq order by aggregate in the select { }

    - by Joe Pitz
    Here is one I am working on: var fStep = from insp in sq.Inspections where insp.TestTimeStamp > dStartTime && insp.TestTimeStamp < dEndTime && insp.Model == "EP" && insp.TestResults != "P" group insp by new { insp.TestResults, insp.FailStep } into grp select new { FailedCount = (grp.Key.TestResults == "F" ? grp.Count() : 0), CancelCount = (grp.Key.TestResults == "C" ? grp.Count() : 0), grp.Key.TestResults, grp.Key.FailStep, PercentFailed = Convert.ToDecimal(1.0 * grp.Count() /tcount*100) } ; I would like to orderby one or more of the fields in the select projection.

    Read the article

  • Elegant way to reverse order Formtastic nested objects?

    - by stephan.com
    I'm presenting a list of items to the user with a field for a new item, like this: - current_user.tasks.build - semantic_form_for current_user do |f| - f.semantic_fields_for :tasks do |t| - t.inputs do = t.input :_destroy, :as => :boolean, :label => '' - if t.object.new_record? = t.input :name, :label => false - else = t.object.name Which looks lovely and works like a charm. My only problem is I want the new record at the TOP of the list, not the bottom. Is there an elegant and easy way to do this, or am I going to have to do the new element separately, or loop through the list manually?

    Read the article

  • order array containing text and numbers

    - 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.

    Read the article

  • ideas: per-file authentication in order to download

    - by suIIIha
    i would love to use mod_xsendfile but i live in a shared environment which does not provide such a module. processing large files such as videos through a server-side script and sending it to the browser that way seems to be unacceptable in my case, so i am looking for a way to enable per-file authentication in such a way that is not going to consume resources much. nobody shall know what the actual path is to the file they are downloading. please suggest how to do that.

    Read the article

  • Union Distinct rows but order them by number of occurrences in mysql

    - by Baversjo
    Hi I have the following query: SELECT o.id,o.name FROM object o WHERE ( o.description LIKE '%Black%' OR o.name LIKE '%Black%' ) UNION ALL SELECT o2.id,o2.name FROM object o2 WHERE ( o2.description LIKE '%iPhone%' OR o2.name LIKE '%iPhone%' ) Which procude the following: id name 2 New Black iPhone 1 New White iPhone 2 New Black iPhone I would like to UNION DISTINCT, but I would also like the result ordered by the number of occurrences of each identical row (primary: id).

    Read the article

  • Change index order in array (php)

    - by Trikks
    Hi Been kind of stuck on this one for a while now, so any help would be appreciated. I have one array (left) that contains a list of elements, the goal is to sort another arrays (right) keys with the values from the left array. The left array Array ( [0] => ID [1] => FirstName [2] => LastName [3] => Address ) The right array Array ( [0] => Array ( [FirstName] => Pim [Address] => Finland [LastName] => Svensson [ID] => 3 ) [1] => Array ( [FirstName] => Emil [Address] => Sweden [LastName] => Malm [ID] => 5 ) ) What I'm trying to accomplish would be similar to this Array ( [0] => Array ( [ID] => 3 [FirstName] => Pim [LastName] => Svensson [Address] => Finland ) Anyone? :) Oh, I'm running php 5.3, if it helps!

    Read the article

  • How to re-order a List<String>

    - by tarka
    I have created the following method: public List<String> listAll() { List worldCountriesByLocal = new ArrayList(); for (Locale locale : Locale.getAvailableLocales()) { final String isoCountry = locale.getDisplayCountry(); if (isoCountry.length() > 0) { worldCountriesByLocal.add(isoCountry); Collections.sort(worldCountriesByLocal); } } return worldCountriesByLocal; } Its pretty simple and it returns a list of world countries in the users locale. I then sort it to get it alphabetic. This all works perfectly (except I seem to occasionally get duplicates of countries!). Anyway, what I need is to place the US, and UK at the top of the list regardless. The problem I have is that I can't isolate the index or the string that will be returned for the US and UK because that is specific to the locale! Any ideas would be really appreciated.

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >