minimum

Fetching Minimum/Maximum for each group in ActiveRecord

This is an age-old question where given a table with attributes 'type', 'variety' and 'price', that you fetch the record with the minimum price for each type there is. In SQL, we can do this by: select f.type, f.variety, f.price from ( select type, min(price) as minprice from table group by type ) as x inner join table as f on f....

Using a Delegate with Messages

I'm learning about delegates and think I may have found a use for one. Basically what I have is a series of string properties that take in a minimum value and a maximum value, like so: string weightInvalid(min as int32, max as int32) There are several messages like this, all with unique messages but all sharing the same signature of ...

How do I determine the maximum and minimum value for an Oracle NUMBER column?

Is there a simple formula for determining the maximum and minimum values for an Oracle NUMBER column with (p, s)? ...

How do I declare MAX_DOUBLE in VB6?

According to the MSDN help for VB6 Floating-point values can be expressed as mmmEeee or mmmDeee, in which mmm is the mantissa and eee is the exponent (a power of 10). The highest positive value of a Single data type is 3.402823E+38, or 3.4 times 10 to the 38th power; the highest positive value of a Double data type is 1.7976931348623...

Select distinct from usercolumn and minimum value of dates for each field in usercolumn

Hello I have some data like this but more than 1500000 records and more than 700 users: usercolumn , datecolumn\ a1 , 1998/2/11\ a2 , 1998/3/11\ a1 , 1998/2/15\ a4 , 1998/4/14\ a3 , 1999/1/15\ a2 , 1998/11/12\ a2 , ...

Minimum version of Java required to run my applet

Hi, How can you determine the minimum version of Java required on a client's browser to run an applet that I've developed? I would like to do this so that I can determine, through, javascript, if the browser the user is running is capable of running my applet and displaying a message if not. Thanks in advance, Tim ...

Shortest path between two nodes in a graph (Java)

I have a program with a graph whose nodes represent some processes, and the proccess computing time is the node's cost.This graph is maintainded in memory as a list of nodes and each nod has a list of parent and children, and his execution time. I must find the path with the minimum execution time. Each node can connect with any other...

PHP Retrieve minimum and maximum values in a 2D associative array

I have an array in this format: Array ( [0] => Array ( [id] => 117 [name] => Networking [count] => 16 ) [1] => Array ( [id] => 188 [name] => FTP [count] => 23 ) [2] => Array ( [id] => 189 ...

given 5 numbers, what is the minimum number of comparisons needed to find the median?

how do you setup minimum number of comparisons in general? ...

Set minimum iPhone OS version for app?

I'm about to publish an app on the app store, and I'm looking to set the minimum OS version as it appears in iTunes as "Requires iPhone OS 3.x or later". 2 questions: 1) Where do I set this in my Xcode project? 2) I'm aware of the UITableViewCell numberOfLines property that is present only in OS > 3.1. If I set my minimum as OS 3.0, wi...

Is there a standard way to represent TSQL Minimum date in ASP.NET

Hi all, I want to initialize a DateTime entity to the minimum possible date in TSQL. (as you all know its 1/1/1753) Is there a standard way to represent this date in ASP.NET ? I mean doing something like DateTime.SQLMinValue (this doesn't exist), instead of doing new DateTime(year, month, date) ? If so, please post it, Thanks! ...

A function to get the smaller number

Hi, I have 2 variables each containing a number (integer). I would like to sort them to have the lowest number first and the second largest. For example: $sortedVar = getSmaller(45, 62); // Will return 45 $sortedVar = getSmaller(87, 23); // Will return 23 Do you see what I want to do? Can you help me please? Thanks :) ...

Getting the minimum of two values in sql

I have two variables, on is called PaidThisMonth, and the other is called OwedPast. They are both results of some subqueries in SQL. How can I select the smaller of the two and return it as a value titled PaidForPast? The MIN function works on columns, not variables. ...

Need a solution to display minimum pricing for products sold as sets.

By default, at least in v1.3.2.4, Magento doesn't have an option for products that are sold as sets. e.g. Product A sold as 4 units per order. So I created an Attribute called product_set and assigned a default value of 1. Any product that is sold by more than one unit, I consequently updated that said product. The reasoning behind this...

List minimum in Python with None?

Is there any clever in-built function or something that will return 1 for the min() example below? (I bet there is a solid reason for it not to return anything, but in my particular case I need it to disregard None values really bad!) >>> max([None, 1,2]) 2 >>> min([None, 1,2]) >>> ...

How can I override the minimum-font-size in Firefox?

My site displays just like in need in IE and Opera, but in Firefox I can't get (via CSS) to have font sizes smaller than Firefox' default minimum-font-size. Of course I can go to Tools>Options and remove this value, but other users will see some of the elements displaced. I have tried using !important, but it doesn't work. And I can't s...

C Macro for minimum of two numbers

I want to make a simple macro with #define for returning the smaller of two numbers. How can i do this in C ? Suggest some ideas, and see if you can make it more obfuscated too. ...

Is there any way in Java to enforce a minimum window size?

Is there any way in Java to enforce a minimum window size? The last article I can find is from 1999, and has some complicated code to mimic the behaviour... http://www.javaworld.com/javaworld/javaqa/1999-10/03-qa-window.html Surely there is a simple method that can be used? ...

Fetched Property in XCode Data Model Editor for minimum value

How do I add a Fetched Property in XCode's Data Model Editor for minimum value of one attribute?? My model: Item (name, note, storedItem) StoredItem (price, item) Item 1 ---> N StoredITem (1->N Relationship) I want that Item has a fetched property named minPrice and its value is the minimum value setted for price in the storedItems...

A two way minimum spanning tree of a directed graph

Given a directed graph with weighted edges, what algorithm can be used to give a sub-graph that has minimum weight, but allows movement from any vertex to any other vertex in the graph (under the assumption that paths between any two vertices always exist). Does such an algorithm exist? ...