Search Results

Search found 3021 results on 121 pages for 'min hong tan'.

Page 2/121 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Min/Max across an array of objects

    - by graham.reeds
    It has been done to death pretty much, here on SO and around the 'Net. However I was wondering if there was a way to leverage the standard min/max functions of: Array.max = function(array) { return Math.max.apply(Math, array); }; Array.min = function(array) { return Math.min.apply(Math, array); }; So I can search across an array of objects of say: function Vector(x, y, z) { this.x = x; this.y = y; this.z = z; } var ArrayVector = [ /* lots of data */ ]; var min_x = ArrayVector.x.min(); // or var max_y = ArrayVector["y"].max(); Currently I have to loop through the array and compare the object values manually and craft each one to the particular need of the loop. A more general purpose way would be nice (if slightly slower).

    Read the article

  • calculating min and max of 2-D array in c

    - by m2010
    This program to calculate sum,min and max of array elements Max value is the problem, it is always not true. void main(void) { int degree[3][2]; int min_max[][]; int Max=min_max[0][0]; int Min=min_max[0][0]; int i,j; int sum=0; clrscr(); for(i=0;i<3;i++) { for(j=0;j<2;j++) { printf("\n enter degree of student no. %d in subject %d:",i+1,j+1); scanf("%d",&degree[i][j]); } } for(i=0;i<3;i++) { for(j=0;j<2;j++) { printf("\n Student no. %d degree in subject no. %d is %d",i+1,j+1,degree[i][j]); } } for(i=0;i<3;i++) { sum=0; for(j=0;j<2;j++) { sum+=degree[i][j]; } printf("\n sum of degrees of student no. %d is %d",i+1,sum); min_max[i][j]=sum; if(min_max[i][j] <Min) { Min=min_max[i][j]; } else if(min_max[i][j]>Max) { Max=min_max[i][j]; } } printf("\nThe minimum sum of degrees of student no. %d is %d",i,Min); printf("\nThe maximum sum of degrees of student no. %d is %d",i,Max); getch(); }

    Read the article

  • SQL SERVER - Understanding how MIN(text) works.

    - by tmercer
    I'm doing a little digging and looking for a explanation on how SQL server evaluates MIN(Varchar). I found this remark in BOL: MIN finds the lowest value in the collating sequence defined in the underlying database So if I have a table that has one row with the following values: Data AA AB AC Doing a SELECT MIN(DATA) would return back AA. I just want to understand the why behind this and understand the BOL a little better. Thanks!

    Read the article

  • Vlookup / Match max min number on different worksheet

    - by Dan
    I have 2 worksheets, one with company data and the other with a min max and answer column. What i need to do is find out if value in column D in the company data is between the min/max in worksheet 2 output answer in worksheet 2. Please can someone help. This is clearly a vlookup question but i haven't got a clue how to do the min/max. Any help will be greatly appreciated. worksheet 1 NAME TYPE NUMBEROFEMPLOYEES Output Wetland Plants Ltd Client 4 Capital Management LLP Clients 3 College ltd Clients 156 Worksheet 2 max min output 100000000 60000 big 59999 15000 medium 14999 0 small Cheers guys

    Read the article

  • sensors reporting weird temperatures

    - by Felix
    lm-sensors is reporting weird temps for me: $ sensors coretemp-isa-0000 Adapter: ISA adapter Core 0: +38.0°C (high = +72.0°C, crit = +100.0°C) coretemp-isa-0001 Adapter: ISA adapter Core 1: +35.0°C (high = +72.0°C, crit = +100.0°C) coretemp-isa-0002 Adapter: ISA adapter Core 2: +32.0°C (high = +72.0°C, crit = +100.0°C) coretemp-isa-0003 Adapter: ISA adapter Core 3: +42.0°C (high = +72.0°C, crit = +100.0°C) w83627dhg-isa-0290 Adapter: ISA adapter Vcore: +1.10 V (min = +0.00 V, max = +1.74 V) in1: +1.62 V (min = +0.06 V, max = +0.17 V) ALARM AVCC: +3.34 V (min = +2.98 V, max = +3.63 V) VCC: +3.34 V (min = +2.98 V, max = +3.63 V) in4: +1.83 V (min = +1.30 V, max = +1.15 V) ALARM in5: +1.26 V (min = +0.83 V, max = +1.03 V) ALARM in6: +0.11 V (min = +1.22 V, max = +0.56 V) ALARM 3VSB: +3.30 V (min = +2.98 V, max = +3.63 V) Vbat: +3.18 V (min = +2.70 V, max = +3.30 V) fan1: 0 RPM (min = 0 RPM, div = 128) ALARM fan2: 1117 RPM (min = 860 RPM, div = 8) fan3: 0 RPM (min = 10546 RPM, div = 128) ALARM fan4: 0 RPM (min = 10546 RPM, div = 128) ALARM fan5: 0 RPM (min = 10546 RPM, div = 128) ALARM temp1: +88.0°C (high = +20.0°C, hyst = +4.0°C) ALARM sensor = diode temp2: +25.0°C (high = +80.0°C, hyst = +75.0°C) sensor = diode temp3: +121.5°C (high = +80.0°C, hyst = +75.0°C) ALARM sensor = thermistor cpu0_vid: +2.050 V Please note temp3. How can I know what temp3 is, and why it is so high? The system is really stable (which I guess it wouldn't be at those temps). Also, note the really decent core temps, which suggest a healthy system as well. My guess is that the readout is wrong. On another computer it reported temperatures below 0 degrees centigrade, which was not possible, considering the environment temperature of ~22-24. Is this some known bug/issue? Should I try some Windows programs (like CPU-Z) and see they give similar results?

    Read the article

  • Kubuntu - Can't move/max/min windows

    - by GregH
    All of a sudden it seems when ever I open a window on my Kubuntu (9.10) system, the windows dock in the upper left corner and can't be moved. There is nor border on the windows, no min/max/close buttons in the upper right corner of the windows. I tried opening a term window but it seems I can't type in the window. Any ideas what might be causing this?

    Read the article

  • Create jQuery Slider Range With One Handle Not Using Min/Max

    - by David Savage
    Hey all, Is there any possible way to create a slider that will create a range similar to what is done with one handle using min/max, only instead of min/max, starting the range from say 50 (on a scale from 1-100)? I realize this will most likely require modification of the slider or creating a plugin, just wondering if anyone has done this already or knows how to go about it. I.e. something like this: http://jqueryui.com/demos/slider/rangemin.html Only, instead of the range going from the min, going off of where the handle is, and allowing the user to slide either left or right of that fixed starting point to create the range. Any help is appreciated, and I'd be glad to clarify what I need if that doesn't make sense! :)

    Read the article

  • USing Min/Max with conditional operator

    - by user638501
    Hello All, I am trying to run a query to find max and min values, and then use a conditional operator. however when I try to run the following query, it gives me error - "misuse of aggregate: min()". My query is: SELECT a.prim_id, min(b.new_len*36) as min_new_len, max(b.new_len*36) as max_new_len FROM tb_first a, tb_second b WHERE a.sec_id = b.sec_id AND min_new_len > 1900 AND max_new_len < 75000 GROUP BY a.prim_id ORDER BY avg(b.new_len*36); Any suggestions ?

    Read the article

  • Math Looping Between Min and Max Using Mod?

    - by TheDarkIn1978
    i'm attempting to build a tiny (or perhaps not so tiny) formula that will contain numbers between a set min and max, but also loop these numbers so they are not clipped if they are outside of the range. so far, this is what i have. min1 = 10 max1 = 90 val1 = 92 //will make 12, which is what i want since it loops formula: min(max(min1,min(val1,max1)),mod(val1,max1)+min1) however, i'd like it to loop the other direction also, so that if val1 is 5, which is -5 outside of min1, it will become 85. another problem i'm running into is that max1 % max1 != max1 as i want it to, since the max is part of the range trying to be clear, here are some examples of desired output based on a range with looping min1 = 10 max1 = 90 ---------------------------------------------- val1 = 30 //within range: stays as 30 val1 = 90 //within range: stays as 90 val1 = -6 //below range: loops to becomes 84 val1 = 98 //above range: loops to becomes 18 i'd like not to resort to using a series of if/else statements, but one would be fine if it's absolutely required. is that even possible?

    Read the article

  • Optimizing PHP code (trying to determine min/max/between case)

    - by Swizzh
    I know this code-bit does not conform very much to best coding practices, and was looking to improve it, any ideas? if ($query['date_min'] != _get_date_today()) $mode_min = true; if ($query['date_max'] != _get_date_today()) $mode_max = true; if ($mode_max && $mode_min) $mode = "between"; elseif ($mode_max && !$mode_min) $mode = "max"; elseif (!$mode_max && $mode_min) $mode = "min"; else return; if ($mode == "min" || $mode == "between") { $command_min = "A"; } if ($mode == "max" || $mode == "between") { $command_max = "B"; } if ($mode == "between") { $command = $command_min . " AND " . $command_max; } else { if ($mode == "min") $command = $command_min; if ($mode == "max") $command = $command_max; } echo $command;

    Read the article

  • Problem using Min(field)

    - by Todd
    have these two queries: SELECT classroomid AS crid, startdate AS msd FROM unitTemplates where classroomid = 6 GROUP BY classroomid and: SELECT classroomid AS crid, Min(startdate) AS msd FROM unitTemplates where classroomid = 6 GROUP BY classroomid The second query uses the minimum function. There is only one record in my table with a classroomid of 6. The first query returns msd = 20100505, the second query returns msd = 0 (instead of the expected 20100505). If I change the "Min" to "Max" it returns the highest (and only) startdate (20100505). Why doesn't MySQL like the Min function I'm using?

    Read the article

  • Bridging the gap between developers and testers with VS 2010

    - by Etienne Tremblay
    Hey everyone, I know it’s been an eternity since I blogged but I have so much to do that I unfortunately need to prioritize.  Vincent Grondin and I did a 7h presentation on the new developer and tester tools available in the VS 2010 suite.  It was a blast.  We did it in front of an audience (around 120) and it was taped.  We did it as a play and really didn’t look at the crowd at all we were training each other on the technology. It is now available for anyone that would like to watch it at this location: http://www.devteach.com/ALM-TFS2010-Bridgingthegap.aspx What we covered in the full day event was Migration to TFS 2010 (10h00) 1-Migration of VSS to TFS (20 min.) 2-Automating the Build (Something you can't do with VSS) ( 20 Min.) 3-User story (Real application context for this presentation) (20 min.) 10h00 Pause Manuel Tests by Dev ( 11h30) 4-Adding a tester to the team (Into to MTM) (20 min.) 5-Define tests (what is a white bug) (20 min.) 6-Fix the bug and show Intellitrace and Play back the test (20 min.) 12h15 Lunch Manuel testing for maintenance (13h30) 7- Implement new Feature (web service) and Identify bug with MTM and branch for a production fix and also add a new Build script (20 min.) 8- Fix bug in production branch, Playback tests, merge the change in main branch (20 min.) Manuel testing with the lab manager (14h30) 9- Intro to Lab manager and environment (20 min.) 10- Change build script to deploy to lab and test with web service in lab environment. (20 min.) 15h15 Pause Automate UI test with CodeUI (15h30) 11- Reducing the effort of testing the UI (20 min.) 12- Repeating testing to make sure the application is working properly (20 min.) 13- Automate Coded UI with the Lab environment (20 min.) 16h30 Conclusions As you can see lots of stuff!! Enjoy the show and let us know how you like it Cheers, ET Technorati Tags: VS 2010,Testing Tools,ALM,Training

    Read the article

  • lm-sensor and cpu temperatures

    - by nalsanj
    i am on ubuntu Precise Pangolin. The processor is Intel i3. a desktop. i installed lm-sensors and below is the report "sensors" gave coretemp-isa-0000 Adapter: ISA adapter Core 0: +30.0°C (high = +89.0°C, crit = +105.0°C) Core 2: +33.0°C (high = +89.0°C, crit = +105.0°C) w83627dhg-isa-0a10 Adapter: ISA adapter Vcore: +0.93 V (min = +0.00 V, max = +1.74 V) in1: +0.75 V (min = +1.99 V, max = +1.99 V) ALARM AVCC: +3.36 V (min = +2.98 V, max = +3.63 V) +3.3V: +3.36 V (min = +2.98 V, max = +3.63 V) in4: +1.30 V (min = +0.90 V, max = +1.77 V) in5: +0.76 V (min = +1.15 V, max = +0.90 V) ALARM in6: +1.06 V (min = +0.94 V, max = +2.03 V) 3VSB: +3.36 V (min = +2.98 V, max = +3.63 V) Vbat: +3.36 V (min = +2.70 V, max = +3.30 V) ALARM fan1: 0 RPM (min = 3515 RPM, div = 128) ALARM fan2: 0 RPM (min = 10546 RPM, div = 128) ALARM fan3: 0 RPM (min = 10546 RPM, div = 128) ALARM fan5: 0 RPM (min = 10546 RPM, div = 128) ALARM temp1: +39.0°C (high = -121.0°C, hyst = +9.0°C) ALARM sensor = diode temp2: +39.0°C (high = +80.0°C, hyst = +75.0°C) sensor = diode temp3: +127.0°C (high = +80.0°C, hyst = +75.0°C) ALARM sensor = thermistor cpu0_vid: +2.050 V intrusion0: OK radeon-pci-0100 Adapter: PCI adapter temp1: +70.5°C The fans sensors are detecting 0 RPM and some temperatures are out of range - the ALARMs above but i dont understand it very well. Can someone help out?

    Read the article

  • LINQ to SQL get grouped MIN with JOIN

    - by Ira Rainey
    I'm having trouble with a LINQ to SQL query getting the min value using Visual Basic. Here's the SQL: SELECT RC.AssetID, MIN(RC.RecCode) AS RecCode, JA.EngineerNote from JobAssetRecCode RC JOIN JobAssets JA ON JA.AssetID = RC.AssetID AND JA.JobID = RC.JobID WHERE RC.InspState = 2 AND RC.RecCode > 0 AND RC.JobID = @JobID GROUP BY RC.AssetID, JA.EngineerNote; I seem to be going around in circles here with grouping etc not managing to get it working. Any help would be greatly appreciated.

    Read the article

  • MIN() and MAX() in Swift and converting Int to CGFloat

    - by gotnull
    I'm getting some errors with the following methods: 1) How do I return screenHeight / cellCount as a CGFLoat for the first method? 2) How do I use the equivalent of ObjC's MIN() and MAX() in the second method? func tableView(tableView: UITableView!, heightForRowAtIndexPath indexPath: NSIndexPath!) -> CGFloat { var cellCount = Int(self.tableView.numberOfRowsInSection(indexPath.section)) return screenHeight / cellCount as CGFloat } // #pragma mark - UIScrollViewDelegate func scrollViewDidScroll(scrollView: UIScrollView) { let height = CGFloat(scrollView.bounds.size.height) let position = CGFloat(MAX(scrollView.contentOffset.y, 0.0)) let percent = CGFloat(MIN(position / height, 1.0)) blurredImageView.alpha = percent }

    Read the article

  • Can I disable min, max in STL?

    - by P-P
    Hi, I use one library which is very important and untouchable. The problem is that library declare min, max function, so when I include STL header in project, they conflict. I want to disable min, max function in STL (like #define NOMNMAX) if I could. If I can't, what would be solution? Thanks, in advance.

    Read the article

  • min or gzip, which is better?

    - by Nimbuz
    jquery-1.4.2.min.js is 71.8KB Same file compressed through this tool, with gzip enabled, becomes 32.9 KB Which is better? If latter, why doesn't jQuery provide a packed file too instead of just uncompressed and min versions? Thanks

    Read the article

  • Math.min.apply(0, x) - why?

    - by Trevor Burnham
    I was just digging through some JavaScript code (Raphaël.js) and came across the following line (translated slightly): Math.min.apply(0, x) where x is an array. Why on earth would you do this? The behavior seems to be "take the min from the array x."

    Read the article

  • MIN array function non zeros only

    - by user1717622
    I have been trying to get this array function to output (non-zero) minimum values in the 'FINAL DATA' AE column. Can you see a structural error in this formula? =IF($C$4="All EMEA", MIN(IF('FINAL DATA'!$2:$AE$250000<>0, ('FINAL DATA'!$J$2:$J$250000=$C$4)*('FINAL DATA'!$E$2:$E$250000=$E$4)*( 'FINAL DATA'!$AE$2:$AE$250000))), MIN(IF('FINAL DATA'!$AE$2:$AE$250000<>0, ('FINAL DATA'!$K$2:$K$250000=$C$4)*('FINAL DATA'!$E$2:$E$250000=$E$4)*( 'FINAL DATA'!$AE$2:$AE$250000))) )

    Read the article

  • jQuery - Set min-height of div

    - by Kenny Bones
    This is probably really easy for most of you. But I'm in need of a small snippet that looks up the current height of a div (the div has a dynamic height based on the content inside it) and then set that value in the css class's min-height value. Basically what this means is that I want this container to have it's min-height to be the exact same value as it's current height. This is probably a quick one :)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >