Questions About 11 Mins

CSS - Multiple Columns with min-width & max-width

I'm having a bit of a "moment" where I am stumped on an issue I thought should be pretty easy (and probably is, I'm just over complicating I'm sure).

I'm looking to have a div with multiple children div's; the children should automatically expand or contract based on the number there are (the site I'm working on is in a CMS that allows a user to add or remove items).

My issue is having the div's respect the min- and max-width declaration. I have a hunch that it could be something to do with them being float:left, but I've tried a few other variations with no luck.

My main objective is to get these columns to fill their space on one "row", up to 4 columns.

EDIT: I need to have these columns be a minimum width, as well as a maximum width. So if there are 3 child div's, they should all be wider than if there were 4 child div's.

C styled min/max in SQL?

Possible Duplicate:
Getting the minimum of two values in sql

I'm trying to get all values between a range. I'm doing something like this

set @StartSeq = (select Sequence from MyTbl where ...)

update ... and MyCol between @StartSeq and @StartSeq+@RelativePosition

But if RelativePosition is negative it fails because its a smaller amount then startseq. The easiest solution I can think of is duplicate my code and doing an if (RelPos<0) to see if I want to do @StartSeq+@RelativePosition first or second. However that doesn't seem like the best solution. Is there a way i can do it in sql? I tried min(a,b) but it doesnt work in sql.

Is there any way to define a min and max value for edittext in android?

I want to define a min and max value for an edittext. For example if any person try to enter a month value it must be between 1-12 as you know. I want to limit this value.

I can do it by using TextWatcher but I want to learn, is there any way to do it in layout file or etc except TextWatcher?

Edit: I don't want to limit character count. I want to limit the value. For example, if I limit month edittext w characters when I enter 12 it will accept it but if I enter 22 it mustn't accept it while I am entering.

Thanks everyone. Regards.

SQL query to find the max and min for each different day

I have the following table:

id     value truncated_day just_yyyy_mm_dd
1167    300 7/1/11 0:00  7/1/11
1167    301 7/1/11 0:00 7/1/11
1167    303 7/1/11 0:00 7/1/11
1167    308 7/1/11 0:00 7/1/11
1167    312 7/2/11 0:00 7/2/11
1167    316 7/2/11 0:00 7/2/11
1167    318 7/2/11 0:00 7/2/11
1167    330 7/2/11 0:00 7/2/11
1700    0   7/1/11 0:00 7/1/11
1700    10  7/1/11 0:00 7/1/11
1700    21  7/1/11 0:00 7/1/11
1700    33  7/1/11 0:00 7/1/11
1700    34  7/2/11 0:00 7/2/11
1700    35  7/2/11 0:00 7/2/11
1700    40  7/2/11 0:00 7/2/11

The table is actually very long (more than 32 million rows!!).

I would like to have the max and min values (read_value) for each day, and for each different id. I tried the following query but it does not work:

'$'select id, 
date_trunc('day', timestamp_utc) as truncated_day, 
substring(cast(date_trunc('day', timestamp_utc) as text) from 1 for 10) as just_yyyy_mm_dd,
max(value) as maxvalue,
min(value) as minvalue

Wrap value into range [min,max] without division

Is there any way in C# to wrap a given value x between x_min and x_max. The value should not be clamped as in Math.Min/Max but wrapped like a float modulus.

A way to implement this would be:

x = x - (x_max - x_min) * floor( x / (x_max - x_min));

However, I am wondering if there is an algorithm or C# method that implements the same functionality without divisions and without the likely float-limited-precision issues that may arise when the value lies far away from the desired range.

HTML5 Range Sliders w/ jQuery occasionally not going to full max or min values

I have a fairly simple form with a single HTML5 range element in it (being rendered as a slider). The code for that looks like this:

<form name="redform" id="redform" action="/">
    <input id="id"        name="id"        type="hidden" value="<?php echo $row['id']; ?>" />
    <input id="sliderRed" name="sliderRed" type="range"  value="<?php echo $data[5]; ?>" min="0" max="255" />
<p class="note">Current value: <span id="redValue">0</span></p>
<div style="text-align:center; color:#FF0000" id="redresults"></div>

Accompanying this is some jQuery that executes an external php script whenever the slider is moved:

    var redValue = $('#redValue');
        $.post('process.php',  $("#redform").serialize(), function(data) {

How I do exclude 0 when using MIN with an IF?

I have a workbook with 2 worksheets, Sheet1 and Sheet2.

Sheet1 has a value (product code) to look up, and an empty cell to fill:

A      B

Sheet2 has a bunch of product codes and costs:

A      B
A100   35
A100   14
A100    0
A200   10
A200   12
etc, etc, etc

I'm using the following formula in Sheet1 B1 to find the MIN matching value from Sheet2:


How can I also exclude returning a match of 0? In the case of product A100, I would want to return the lowest non-zero match which would be 14.

Data inconsistent when using group by and min clauses with inner join

I am trying to fetch upcoming event based on start time from a table. let us assume the following : Actually we are joining to tables. In table A Locationid is primary key. We are joining another table to fetch name of the venue. You may think that we have redundant data but they are not. A user is visiting same venue on different days.

enter image description here

Now i would like to display only the upcoming plan i.e

locationid 2511 and 2515

Here is the query i am trying

 SELECT B.`VenueID` ,
 MIN( A.start ) ,
 MIN( A.end ) 
    FROM tbl_userselectedlocations A
    INNER JOIN tbl_Flyingapp_Venue B ON A.VenueID = B.VenueID
    WHERE A.Pilotid =  '709'
    GROUP BY  `VenueID` 
    ORDER BY A.my_favorite DESC , A.start

But at this point i am getting incorrect data It should be


SQL MIN() as subquery - "group function not allowed"

I'm trying to select a value which corresponds to the lowest number in another column, and then use it to SET in another table.

But it's telling me "group function is not allowed here"

is there any other way to accomplish this?

UPDATE team 
         FROM teamuser
         AND teamId = 5) 
WHERE teamId = 5

(Both team and teamuser tables have a column teamId).

How do I find the min and max value of a multidimensional array?

I want to find the minimum and maximum values of this array. At some point it is set to (512, 512) UShorts. A For loop would be very time consuming for this many points and am looking for something cleaner. SelectMany occurred to me but I don't know how to implement it.

Dim usResult As UShort(,)

edit: I have tried

Dim minValue As UShort = UShort.MaxValue
Dim maxValue As UShort = UShort.MinValue
Dim sw As New Stopwatch()
For i As Integer = 0 To 511 Step 1
    For j As Integer = 0 To 511 Step 1
        minValue = Math.Min(usResult(i, j), minValue)
        maxValue = Math.Max(usResult(i, j), maxValue)
' This takes 2 to 3 milliseconds

Funny Haskell Behaviour: min function on three numbers, including a negative

I've been playing around with some Haskell functions in GHCi.

I'm getting some really funny behavious and I'm wondering why it's happening.

I realized that the function min is only supposed to be used with two values. However, when I use three values, in my case

1 2 -5

I'm getting


as my result.

Why is that?

Find Consecutive Records with Timestamp Interval > 15 mins

A process runs (is supposed to run) every 15 mins and add and entry to a MS SQL 2012 logging table.

2013-02-07 10:07:47.000
2013-02-07 09:52:36.000
2013-02-07 09:37:34.000
2013-02-07 09:22:32.000
2013-02-07 09:07:31.000
2013-02-07 08:52:29.000
2013-02-07 08:37:28.000
2013-02-07 08:13:53.000
2013-02-07 07:58:51.000
2013-02-07 07:43:50.000
2013-02-07 07:28:48.000
2013-02-07 07:13:47.000
2013-02-07 06:58:37.000

I need help with a query that will return consecutive timestamps that are > 16 minutes apart. In the above records, the query would return 2013-02-07 08:37:28.000 and 2013-02-07 08:13:53.000

EDIT - Add reference to MS SQL

CSS - body background center ignore min-width

This site has a "min-width:600px" in BODY, and uses a backgroundImage in Center.

When I resize and It gets lower than 600px, it creates the scroll-bar, fine. But the background dont stop to center it.. The background ignore the min-width.

My example here:

            background ignores the min-width


    background:url( center top;


Aditional information:

I have a pretty big and bad website to fix.. So like the first move I would like to do this.. This site looks horrible when the person has less than 1024px width (600 was just an example). So I Prefer have the horizontal-scroll and let the site with min-width:1024px and do no

how to get Magento baseUrl through javascrip and then use it in jquery.hello-lightbox.min?

i'm trying to get Magento BaseUrl through javascript in head.phtml file, and then use it in jquery.hello-lightbox.min file, where i need the baseUrl to get some images.

Here's what i have in head.phtml file:

<?php $baseUrl = $this->getBaseUrl() ; ?>

<script type="text/javascript">

var baseUrl = <?php echo $baseUrl ; ?>

function getBaseUrl(baseUrl)


Then in /js/jquery.hello-lightbox.min i have:


function getBaseUrl(baseurl)
var domain = baseurl

var urrl = 'http://'+domain+'/skin/frontend/default/customtheme/images/lightbox/';

  $.fn.lightBox=function(settings)settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading: urrl+'lightbox-ico-loading.gif',imageBtnPrev:urrl+'lightbox-btn-prev.gif', . . . . . . . . . . 

But this doesn't work. In fact it seems like i can't even pass the php variable $baseUrl to var bas

How to apply max & min boundaries to a value without using conditional statements


Write a Python function, clip(lo, x, hi) that returns lo if x is less than lo; hi if x is greater than hi; and x otherwise. For this problem, you can assume that lo < hi.

Don't use any conditional statements for this problem. Instead, use the built in Python functions min and max. You may wish to read the documentation on min and the documentation on max, and play around with these functions a bit in your interpreter, before beginning this problem.

This function takes in three numbers and returns a single number.

Code Given:

def clip(lo, x, hi):
    Takes in three numbers and returns a value based on the value of x.
     - lo, when x < lo
     - hi, when x > hi
     - x, otherwise

My Code Added:

def clip(lo, x, hi):
    Takes in three numbers and returns a value based on the value of x.

displaying axis from min to max value - calculating scale and labels

Writing a routine to display data on a horizontal axis (using PHP gd2, but that's not the point here).

The axis starts at $min to $max and displays a diamond at $result, such an image will be around 300px wide and 30px high, like this:


In the example above, $min=0, $max=3, $result=0.6. Now, I need to calculate a scale and labels that make sense, in the above example e.g. dotted lines at 0 .25 .50 .75 1 1.25 ... up to 3, with number-labels at 0 1 2 3.

If $min=-200 and $max=600, dotted lines should be at -200 -150 -100 -50 0 50 100 ... up to 600, with number-labels at -200 -100 0 100 ... up to 600.

With $min=.02and $max=5.80, dotted lines at .02 .5 1 1.5 2 2.5 ... 5.5 5.8 and numbers at

min value(greater than 0) from column combined with row operation

I am trying to get the minimum value (greater than 0) from a column in a matrix and then use the row number where that minimum occurred to calculate a value that gets applied (as a formula) to all rows below the minimum row(identified previously).

Let me demonstrate with an example: If I define x as:

x<-rbind(c(0, 0, 0), c(0,0,3), c(0,3,5))

such that x is:

     [,1] [,2] [,3]
[1,]    0    0    0
[2,]    0    0    3
[3,]    0    3    5

then I would like to identify that column 1 has no minimum, column 2 has a minimum at index 3, and column 3 has an minimum at index 2.

So, I created the following attempt at creating a vector of minimums:

min<-apply(x,2,function (v) min(which(v>0), na.rm = TRUE))

This gives me a warning:

Warning message:
In min(which(v > 0), na.rm = TRUE) :
  no non-missing arguments to min; returning Inf