max

Help analysing a process before it crashes and consumes all resources on a box

Hi guys, One of the servers I'm working on regularly crashes/freezes and consumes ALL resources on the box. It will continue doing this until the process is killed (difficult to run manually since the box has no resources to allow me even to enter a command) or the box is manually rebooted. I'm not very experienced in unix OSes - can y...

How can I find the index of the maximum value in a matrix column in MATLAB?

I'm trying to find the maximum value of a certain column in a matrix. I want to find both the maximum value and the index of the row in which it is. How can I do this? ...

Math.max seems to be returning the wrong answer

I have a list of double values that I don't know the range of and I want to find the maximum value. However, the Math.max function is giving a curious result for this sample code: double a = -100.0; double maxA = Double.MIN_VALUE; maxA = Math.max(maxA, a); System.out.println(maxA); And the output is: 4.9E-324 So for some reason, Do...

UPLOAD_ERR_EXTENSION (#8) in PHP?

I'm completely stuck on this one. Whenever I upload a large file, larger than 8MB (approx), I get this error code in the $_FILES array... I looked at the loaded extensions, but it didn't help... The max file upload is 50M and the max post is 55M. Has anyone else had this problem before, and know of an extension that may be causing it? ...

Fastest way to perform time average of multiple calculations in SQL?

I have a question about the fastest way to perform a SQL Server query on a table, TheTable, that has the following fields: TimeStamp, Col1, Col2, Col3, Col4 I don't maintain the database, I just can access it. I need to perform 10 calculations that are similar to: Col2*Col3 + 5 5*POWER(Col3,7) + 4*POWER(Col2,6) + 3*POWER(...

using MAX aggregate between two tables

I have two tables, employer and position: Employer eID eName Position eID salary I need to match my eID between the two tables, determine what the max salary is, and print only the eName. Any suggestions as to how I can do this? I have tried multiple ways, but nothing seems to work. I am not sure where to put in the max(salary) ...

How to find the largest and smallest number in an array in c

I have to find a way to display the Maximum and Minium number in an array, the size of the array is 100 and will not exceed that and there is not need for input validation. The program will keep asking for input until 0 is encountered and it too will get added to the array. I have everything figured out except how to keep track which is...

R: Revolution Analytics max-mem-size?

Hello I can specify the maximum amount of memory used by R or by an object in R with parameters such as --max-mem-size=1400M at command line. But how can I use it with Revolution Analytics? I've tried but it seems not no accept any parameter. I've also tried to look for configuration files, unsuccesfully. ...

Find time of a MAX value in SQL Server

I have a table, Table1, containing the fields TimeStamp and Humidity, which have the values: TimeStamp '2010-09-29 11:05:29.6' '2010-09-29 11:05:29.7' '2010-09-29 11:05:29.8' '2010-09-29 11:05:29.9' '2010-09-29 11:05:30.0' Humidity 15.291 17.379 16.857 16.335 15.813 I would lik...

develop c++ without Xcode IDE

I want to develop c++ programs on mac os and I have installed Xcode with a bunch of frameworks. However I would like to write code without Xcode IDE but just write my own makefile and directly compile/link with gcc (shipped with Xcode). Take a opengl program as example I tried to compile it with the command gcc -I/usr/include/ ...

one to many join - taking only the last one on the many part

I'm quite a newbie in EF, so I'm sorry if my question has been answered before.. I just can't figure out the syntax.. I have two entities, Category & Product, where one category has many products. I want to get all categories, with only their latest product (it has a date property named timestamp) I have no idea how to do that. :-/ I...

easier way to select row matching condition having maximum for a certain column

So I have a table that's basically a tree. Each row has a parent in the same table, and a lvl column that tells me the level in the tree, the root being lvl = 0. Now say I want to select all the rows that have a name starting with A, but only those that are on the highest level in this group. So the tree might have 9 levels, but the high...

MySQL Get latest record by date from mutiple tables with values from lookup tables

I want to get the latest MainNumber, Serial, BarType and Notes for a given MainNumber, if they exist. Note that BarType is stored in a lookup table and referenced with BarID. Unreason came up with this: SELECT @MainNumber, COALESCE(n.Notes, 'None') FROM numbers LEFT JOIN notes n ON numbers.MainNumber = n.MainNumber LEFT JO...

How can I get all local extrema in Perl without rolling my own?

It's not too difficult to implement, but I'd prefer code reuse if possible. my @arr = (2,3,4,5,5,5,4,4,3,1,1,2,3,0,2,4); my $ret = {MAXIMA=>[{INDEX=>3, VAL=>5},{INDEX=>4, VAL=>5},{INDEX=>5, VAL=>5}], MINIMA=>[{INDEX=>9, VAL=>1},{INDEX=>10, VAL=>1},{INDEX=>13, VAL=>0}]} So, do you know of any module that implements something...

C++ std::getline size limit on Mac OSX

I'm having problems with std::getline on Mac OSX Snow Leopard. For some reason it limit the size of the input, while on Debian/Ubuntu it's unlimited size? std::getline(std::cin, input) Any clues about the limit? ...

Select max value rows from table column

my table look like this.. id name count -- ---- ----- 1 Mike 0 2 Duke 2 3 Smith 1 4 Dave 6 5 Rich 3 6 Rozie 8 7 Romeo 0 8 Khan 1 ---------------------- I want to select rows with max(count) limit 5 (TOP 5 Names with maximum count) that would look sumthing like... id name count -- ---- ----- 6 Rozie 8 4 Dave 6 5 Rich 3 2 Duke 2 3 Smi...

sqlite2: Joining max values per column from another table (subquery reference)?

Hi all, I'm using the following database: CREATE TABLE datas (d_id INTEGER PRIMARY KEY, name_id numeric, countdata numeric); INSERT INTO datas VALUES(1,1,20); //(NULL,1,20); INSERT INTO datas VALUES(2,1,47); //(NULL,1,47); INSERT INTO datas VALUES(3,2,36); //(NULL,2,36); INSERT INTO datas VALUES(4,2,58); //(NULL,2,58); INSERT INTO...

MySQL - working out the AVG for a subset of MAX values

Hi all, I have a table with columns 'Date, Name, Score'. I wish to get the MAX(Score) for rows which share a common value (for e.g. the same date or even name), before averaging them to give me a figure, for example: ---- Date -----| -- Name -- | Score 2010-10-10 | John Smith | 86 2010-06-05 | Tedi Jones | 71 2010-10-10 | John Smith |...

How to use german umlaute in Mac os x X11 xterm

Hi, I have a macbook pro with german keyboard layout. In the X11 xterm application, when I type umlaute like ä,ö,ü,ß, then they don't show up. And ß shows the history like the up-arrow. On the other hand if I start emacs in x11 (not in the xterm) then everything works fine. How can I configure X11 xterm to type all characters? And yes,...

why doesn't this compile when using std::max and c++/CLI?

Can anyone please explain why the following will compile int a = aAssignments[i]->Count; int b = fInstanceData->NumRequiredEmpsPerJob[i]; fInstanceData->NumSlotsPerJob[i] = max(a,b); but fInstanceData->NumSlotsPerJob[i] = max((int)(aAssignments[i]->Count), (int)(fInstanceData->NumRequiredEmpsPerJob[i])); //why on earth does this not ...