min

Change min/max/close buttons theme

Hi, im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme. I looked into what controls them and the mouse messages do. However they also contol resizing and...

MySQL: Select N rows, but with only unique values in one column

Given this data set: ID Name City Birthyear 1 Egon Spengler New York 1957 2 Mac Taylor New York 1955 3 Sarah Connor Los Angeles 1959 4 Jean-Luc Picard La Barre 2305 5 Ellen Ripley Nostromo 2092 6 James T. Kirk Riverside 2233 7 Henry Jones Chica...

Using Min, Max and Count on HQL

Hello there. Does hibernate HQL queries support using select min, max, count and other sql functions? like select min(p.age) from person p Thanks ...

What's the best way to select the minimum value from multiple columns?

Given the following table in SQL Server 2005: ID Col1 Col2 Col3 -- ---- ---- ---- 1 3 34 76 2 32 976 24 3 7 235 3 4 245 1 792 What is the best way to write the query that yields the following result (i.e. one that yields the final column - a column containing the minium...

Min/Max Width in IE6 without javascript?

Is it possible to get min/max width working in IE6 without the use of javascript? On a somewhat related note, does Google Chrome not understand, <!--[if IE 6]><!--> <!--<![endif]--> or am I just screwing up that code. Thanks. ...

NetCdf: how to obtain min and max for variable

NetCdf: For a grid you can obtain the minimum and maximum value for data in the following way: MAMath.MinMax dataMinMax = grid.getMinMaxSkipMissingData( data); float min = (float) (dataMinMax.min); float max = (float) (dataMinMax.max); but what if you just have a ucar.nc2.Variable. Can you also obtain this kind of information? Kind reg...

Mathematically Find Max Value without Conditional Comparison

----------Updated ------------ codymanix and moonshadow have been a big help thus far. I was able to solve my problem using the equations and instead of using right shift I divided by 29. Because with 32bits signed 2^31 = overflows to 29. Which works! Prototype in PHP $r = $x - (($x - $y) & (($x - $y) / (29))); Actual code for LEADS...

Fastest way to zero out low values in array?

So, lets say I have 100,000 float arrays with 100 elements each. I need the highest X number of values, BUT only if they are greater than Y. Any element not matching this should be set to 0. What would be the fastest way to do this in Python? Order must be maintained. Most of the elements are already set to 0. sample variables: a...

Use of min and max functions in C++

From C++, are min and max preferable over fmin and fmax? For comparing two integers, do they provide basically the same functionality? Do you tend to use one of these sets of functions or do you prefer to write your own (perhaps to improve efficiency, portability, flexibility, etc.)? Notes: The C++ Standard Template Library (STL) d...

A select question

There are groups like this; USER_ID SEQ_ID NAME 1 2 Armut 1 3 Elma 1 4 Kiraz 2 1 Nar 2 2 Uzum 4 3 Sheftali 4 4 Karpuz 4 5 Kavun After select query I want to see only; USER_ID SEQ_ID NAME 1 2 Armut 2 1 Nar 4 3 Karpu...

Mysql Foreach Child show Max() and Min() in a single line.

Is it possible to use a select statement so that it returns Max and min columns of a child row foreach Parent record? So foreach parent record that has MANY child records I want to see the Max and Min of those child records for any given column. How can I do this within a single select statement? It should read something like: Return ...

C# arrays: finding custom minimal element

How do I specify a custom code for comparison when finding a minimal element in my Array? For example, I have two arrays: int[] a = new int[] {3, 6, 8}; int[] b = new int[] {9, -2, 5}; I want to figure out, what would be the minimal ratio of the elements with respective indexes (i.e. find minimum of 3/9, 6/(-2) and 8/5) and then retu...

How would you define a simple "min" method in obj-c

I want to define a min and max methods in a Utils class. @interface Utils int min(int a, int b); int max(int a, int b); @end But I don't want to have named parameters. It would be a too heavy notation. I wanted to use the C-style definition. But then [Utils min(a, b)] as a call doesn't work. What is my problem? Thanks in advance fo...

How to calculate Min and Max values for IEEE Extended Double precision?

I know that the min and values are: 3.362... 10-4932 1.189... 10+4932 and log(2^14)~4932 which gives me the exponential part. But I can't figure out mantissa. ...

C# - Calculate min date / max date from a List

I have a List which contains Dates : List<string> StringDates; [0]: "04.03.2010" [1]: "09.03.2010" [2]: "11.03.2010" [3]: "12.03.2010" [4]: "16.03.2010" [5]: "18.03.2010" [6]: "19.03.2010" [7]: "23.03.2010" [8]: "25.03.2010" [9]: "26.03.2010" Using C# what is the best/shortest way to find out ...

How can I find the maximum or minimum of a multi-dimensional matrix in MATLAB?

I have a 4D array of measurements in MATLAB. Each dimension represents a different parameter for the measurement. I want to find the maximum and minimum value and the index (i.e. which parameter) of each. What's the best way to do it? I figure I can take the max of the max of the max in each dimension, but that seems like a kludge. ...

Android: Setting maxSDK version for Android 1.5 app

Hi, I've released an android app with the property <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/> now my app seems to crash on android 1.5 devices (i guess because i use drawable-mdpi/hdpi,...) so thought it would be good to release the same app just for 1.5 devices (not using the mdpi/hdpi-directories). but whe...

Is there an easy way to make a min heap in C++?

I'm very new to C++, and I was wondering if there was a way to make a min heap in C++ from the standard library. Thanks, ...

MySQL query puzzle - finding what WOULD have been the most recent date

I've looked all over and haven't yet found an intelligent way to handle this, though I feel sure one is possible: One table of historical data has quarterly information: CREATE TABLE Quarterly ( unique_ID INT UNSIGNED NOT NULL, date_posted DATE NOT NULL, datasource TINYINT UNSIGNED NOT NULL, data FLOAT NOT NULL, PRIMARY KEY (unique_ID)...

MIN and MAX in C

Where are MIN and MAX defined in C, if at all? What is the best way to implement these, as generically and type safe as possible (compiler extensions/builtins for mainstream compilers preferred). ...