Search Results

Search found 3240 results on 130 pages for 'groupwise maximum'.

Page 83/130 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • grouping objects to achieve a similar mean property for all groups

    - by cytochrome
    I have a collection of objects, each of which has a numerical 'weight'. I would like to create groups of these objects such that each group has approximately the same arithmetic mean of object weights. The groups won't necessarily have the same number of members, but the size of groups will be within one of each other. In terms of numbers, there will be between 50 and 100 objects and the maximum group size will be about 5. Is this a well-known type of problem? It seems a bit like a knapsack or partition problem. Are efficient algorithms known to solve it? As a first step, I created a python script that achieves very crude equivalence of mean weights by sorting the objects by weight, subgrouping these objects, and then distributing a member of each subgroup to one of the final groups. I am comfortable programming in python, so if existing packages or modules exist to achieve part of this functionality, I'd appreciate hearing about them. Thank you for your help and suggestions.

    Read the article

  • progressbar to be updated on selected index changed of a combo box

    - by joy
    hi, i am developing a windows application using C#.net and i am having a combobox with some list items .on selected index changed event of the combo box i need to have the progess bar to be visible and should disappear after retrieving some data. i am trying inthe way: for (int i = progressBar1.Minimum; i <= progressBar1.Maximum; i++) { progressBar1.PerformStep(); } panel1.Visible = false; where my progress bar is placed in panel1. but i am getting the progess bar when i first run my application after that when ever combobox item is changed the progress abr is not visible. i need the solution asap... Thanks in advance!

    Read the article

  • join codition in sqlserver

    - by Pallavi
    after applying join condition on two tables i want records which is maximum among records of left table my query SELECT a1.*, t.*, ( a1.trnratefrom - t.trnratefrom )AS minrate, ( a1.trnrateto - t.trnrateto ) AS maxrate FROM (SELECT a.srno, trndate, b.trnsrno, Upper(Rtrim(Ltrim(b.trnstate))) AS trnstate, Upper(Rtrim(Ltrim(b.trnarea))) AS trnarea, Upper(Rtrim(Ltrim(b.trnquality))) AS trnquality, Upper(Rtrim(Ltrim(b.trnlength))) AS trnlength, Upper(Rtrim(Ltrim(b.trnunit))) AS trnunit, b.trnratefrom, b.trnrateto, a.remark, entdate FROM mstprodrates a INNER JOIN trnprodrates b ON a.srno = b.srno)a1 INNER JOIN (SELECT c.srno, trndate, d.trnsrno, Upper(Rtrim(Ltrim(d.trnstate))) AS trnstate, Upper(Rtrim(Ltrim(d.trnarea))) AS trnarea, Upper(Rtrim(Ltrim(d.trnquality))) AS trnquality, Upper(Rtrim(Ltrim(d.trnlength))) AS trnlength, Upper(Rtrim(Ltrim(d.trnunit))) AS trnunit, d.trnratefrom, d.trnrateto, c.remark, entdate FROM mstprodrates c INNER JOIN trnprodrates d ON c.srno = d.srno) AS t ON a1.trnstate = t.trnstate AND a1.trnquality = t.trnquality AND a1.trnunit = t.trnunit AND a1.trnlength = t.trnlength AND a1.trnarea = t.trnarea AND a1.remark = t.remark WHERE t.srno = (SELECT MAX(srno) FROM a1 WHERE srno < a1.srno)

    Read the article

  • How to check if aspect ratio auto adjustment is enabled in monitor

    - by kFk
    Game application is written in C++ and uses DirectX 8. I am getting a maximum monitor resolution to calculate it's aspect ratio. Then I use this value to fix game rendering (scale and set clipping to receive normal 4:3 image with black borders on wide screen monitors). How can I check if monitor is using aspect ratio auto adjustment now? Because my scaling plus monitor scaling makes resulting image overscaled. Thanks EDIT: I saw correct different monitor resolution handling with or without aspect ratio auto adjustment in "Royal Envoy" casual game. But don't know how do they do this.

    Read the article

  • Pitfalls when converting C++/CLI to C++

    - by directedition
    I have a library written in C++/CLI and I want to open it up. I want it to be as cross-platform as possible and be able to write bindings to it for other languages to use (Java, Python, etc, etc). To do this, the library needs to be in plain C++ for maximum flexibility. I figure that the logical structures are already there, I just need to replace the .NET libraries it uses with the standard C++ ones. Is this a misguided notion? What should I watch out for when making this transition?

    Read the article

  • Compile Flex application without debug? Optimisation options for flex compiler?

    - by maoanz
    I have created a simple test application with the following code var i : int; for (i=0; i<3000000; i++){ trace(i); } When I run the application, it's very slow to load, which means the "trace" is running. I check the flash player by right-clicking, the debugger option is not enable. So I wonder if there is an option to put in compiler to exclude the trace. Otherwise, I have to remove manually all the trace in the program. Are there any other options of compiler to optimize the flex application in a maximum way? Thanks

    Read the article

  • too many threads due to synch communication

    - by MasoudIzzy
    I'm using threads and xmlrpclib in python at the same time. Periodically, I create a bunch of thread to complete a service on a remote server via xmlrpclib. The problem is that, there are times that the remote server doesn't answer. This causes the thread to wait forever for a response which it never gets. Over time, number of threads in this state increases and will reach the maximum number of allowed threads on the system (I'm using fedora). I tried to use socket.setdefaulttimeout(10); but the exception that is created by that will cause the server to defunct. I used it at server side but it seems that it doesn't work :/ Any idea how can I handle this issue?

    Read the article

  • Is AppFapric mature for production.

    - by Incognito
    Hi, We have a lot of WCF services using as a host windows services. And as we are upgrading our servers to windows server 2008 R2 we are planning to migrate some of services under WAS. Also having already the release of AppFabric it is interesting does AppFabric is mature to be used, so may be we can use it instead of WAS. Is there already someone using in on production. And what are your impressions of course maximum objectively :). Thank you.

    Read the article

  • Data format for content heavy iPhone app - Plist or XML?

    - by Toby
    Hello, I'm building an iPhone app that is essentially a book, it will be bundled with a lot of text-heavy content. I considered bundling the data as XML and load it when the application starts but the XML would contain a lot of nested structures and be a bit of a pain to parse. Would it be better to use a plist? I'm concerned about memory usage and plists are loaded entirely into memory - can they be parsed in chunks? Is there a maximum size to a plist and how efficient are they? I'm not sure how big the bundled content is going to be yet but I should imagine it could be anywhere from 500k to 4MB. Thanks in advance.

    Read the article

  • Can I extends a sub class of Proxy class?

    - by KCBérenger
    I want to create a complete (and real) 2-dimensional array. In order to use a maximum of Adobe code, I want to use ListCollectionView which can manage sort and filters. But to use a second dimension, I need to override getProperty method, like following code. package { import flash.utils.flash_proxy; import mx.collections.ListCollectionView; public class SubClass extends ListCollectionView /* extends Proxy */ { override flash_proxy function getProperty(name : *) : * { ... } override flash_proxy function setProperty(name : *, value : *) : void { ... } } } This code doesn't work. Flash Builder 4 said to me: 1004 Namespace was not found or is not a compile-time constant. If anyone has a solution or a clue...

    Read the article

  • dynimically using pointer

    - by gcc
    Input: 3 1 2 n 4 5 d 1 21 30 x Output: 2: 4 5 21 30 Input: 3 j 3 34 6 22 10 51 n 1 2 j 1 3 4 5 n 6 7 x Output: 1: 1 2 3 4 5 2: 6 7 3: 34 6 22 10 51 'j': (Jump to array# command) 'd': (Delete array# command) 'n': (Next array command) 'x': (Exit command) #: (Integer number) int num_arrays; /* maximum number of arrays */ int **arrays; /* array of array pointers */ int *l_arrays; /* actual lengths of arrays */ int *c_arrays; /* actual capacities of arrays */ how can we write that code

    Read the article

  • JSF validateLength question

    - by user337515
    I have a input field with validation to validate the max and min length <h:inputText id="LABEL_ID" styleClass="textboxsmall" value="#{sampleDatatableBean.accessionLabelId}" maxlength="5"> <f:validateLength minimum="4" maximum="5" /> </h:inputText> <br/><h:message id="LABEL_ID_MSG" styleClass="errorMessage" for="LABEL_ID" /> It validates but I get the below message: "Value is less than allowable minimum of {0}" Shouldn't {0} be replaced by value from minimum? Not sure why its not picking up the value. Any ideas? Version info: <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> <tlib-version>1.0</tlib-version> <jsp-version>1.2</jsp-version>

    Read the article

  • Question About id and Delegate Usage in Obj-C

    - by Stunner
    Ey guys, I am wondering what the following line of code is doing: @property (assign, nonatomic) id <CoursePlannerDelegate> delegate; Namely I am wondering about this portion of the line: id <CoursePlannerDelegate> delegate; It also shows up in other places: @interface CategoryAddViewController : UIViewController { UITextField *nameField, *weightField; double maxWeight; //The maximum weight that can be allocated to this Category (max value of 100) id <CategoryAddDelegate> delegate; //A Course Planner TVC } Any help appreciated, thanks in advance!

    Read the article

  • Representing a very large array of bits in little memory

    - by user614624
    Hello, I would like to represent a structure containing 250 M states(1 bit each) somehow into as less memory as possible (100 k maximum). The operations on it are set/get. I cold not say that it's dense or sparse, it may vary. The language I want to use is C. I looked at other threads here to find something suitable also. A probabilistic structure like Bloom filter for example would not fit because of the possible false answers. Any suggestions please?

    Read the article

  • C++ Boost ASIO: how to read/write with a timeout?

    - by Stéphane
    From reading other Stackoverflow entries and the boost::asio documentation, I've confirmed that there is no synchronous asio read/write calls that also provide an easy-to-use timeout as a parameter to the call. I'm in the middle of converting an old-school linux socket app with select(2) calls that employs timeouts, and I need to do more-or-less the same. So what is the best way to do this in boost::asio? Looking at the asio documentation, there are many confusing examples of various things to do with timers, but I'm quite confused. I'd love to see a simple-to-read example of this: Read from a socket, but wait for a maximum of X seconds after which the function either returns with nothing, or returns with whatever it was able to read from the socket before the timeout expired.

    Read the article

  • New thread per client connection in socket server?

    - by Olaseni
    I am trying to optimize multiple connections per time to a TCP socket server. Is it considered good practice, or even rational to initiate a new thread in the listening server every time I receive a connection request? At what time should I begin to worry about a server based on this infrastructure? What is the maximum no of background threads I can work, until it doesn't make any sense anymore? Platform is C#, framework is Mono, target OS is CentOS, RAM is 2.4G, server is on the clouds, and I'm expecting about 200 connection requests per second.

    Read the article

  • scoket connection issue+php

    - by Abhimanyu
    Hi, I am using PHP socket programming and able to write data to open socket but i have to wait for a long time(or stuck it)for the response or some time getting error like "Maximum execution time of 30 seconds exceeded line number where this code is placed fgets($fp, 128), i have check the server it seems it has sent the response as expected but i am not getting why i m unable to get response.following the code using for socket connection and reading data. functon scoket_connection() { $fp = fsockopen(CLIENT_HOST,CLIENT_PORT, $errno, $errstr); fwrite($fp,$packet); $msg = fgets($fp, 128); fclose($fp) return $msg; } any idea???

    Read the article

  • Interpolation on Cubism graphs

    - by Abe Stanway
    Cubism was designed, by mbostock's own words, for maximum information density - which means it generally wants to display one datapoint per pixel. While this is useful in many cases, it doesn't help when your data itself is not that dense. In these cases, you get ugly, staccato-style graphs like so: Is there a way to interpolate my data/graph within Cubism to show a nice, smoothed graph? EDIT: After adding keepLastValue to the metric, I get this: Here is the same data as shown in Graphite: I would like to smooth the Cubism view to look more like Graphite (with the added awesomeness of the horizon overplotting)

    Read the article

  • Why aren't my JQuery .ajax requests being made in parallel?

    - by Ryan Olson
    I am trying to make two ajax requests in parallel using jQuery like this: var sources = ["source1", "source2"]; $(sources).each(function() { var source = this; $.ajax({ async: true, type: "POST", data: {post: "data", in: "here"}, url: "/my/url/" + source, success: function(data) { process_result(data); } }); }); I got the basic structure from this question, but my requests still aren't being made in parallel. "source1" takes a while to complete, and I can see on the server that the second request isn't made until the first is completed. As far as I can tell, I don't have any other active requests, so I don't think it's a problem with the maximum number of parallel requests for the browser. Am I missing something else here?

    Read the article

  • Fastest way for inserting very large number of records into a Table in SQL

    - by Irchi
    The problem is, we have a huge number of records (more than a million) to be inserted into a single table from a Java application. The records are created by the Java code, it's not a move from another table, so INSERT/SELECT won't help. Currently, my bottleneck is the INSERT statements. I'm using PreparedStatement to speed-up the process, but I can't get more than 50 recods per second on a normal server. The table is not complicated at all, and there are no indexes defined on it. The process takes too long, and the time it takes will make problems. What can I do to get the maximum speed (INSERT per second) possible? Database: MS SQL 2008. Application: Java-based, using Microsoft JDBC driver.

    Read the article

  • PHP+MYSQL Server Config

    - by Matias
    Hi guys, I am parsing an XML file with PHP and inserting the rows in a MYSQL database. I am using PHP simplexml_load_files to load the XML and a foreach to loop through the array and insert the rows into my database. It works perfectly fine with small files i am testing, but it comes to reality I need to parse a large 500mb XML file and nothing happens. I was wondering what was the right Php.ini config for this case ? I have a VPS Linux Cent OS, with 256 mb of dedicated Memory and MYSQL 5.0.5. I have also set php memory_limit = 256M (maximum of my server) Any suggestions, similar experiences will be greatly appreciated Thanks

    Read the article

  • Is it possible to get collection of some ejb`s instances from container?

    - by kislo_metal
    Hi! Scenario: I have some @Statefull bean for user session (not an http session, it is web services session). And I need to manage user`s session per user. Goal: I need to have possibility to get collection of @Statefull UserSession`s instances and control maximum number of session`s per user, and session`s life time. Q: Is it possible to get Collection of ejb`s instances from ejb container, instead of storing them in some collection, map etc. ? I am using glassfish v3 , ejb 3.1, jax-ws. Thank You!

    Read the article

  • MySQL query problem

    - by FinalDestiny
    I have 2 mysql tables 1. questions: with the following columns: id, title, answer1, answer2, answer3, answer4, answer5, nranswers. and 2. answers with the following columns: id, questionid, userid, answer Every question has maximum 5 answers( it can have between 2 and 5 answers). My problem is that I want to select from my database, for a given question, how many times was every option selected. For example, let's suppose I have the question with the id 46, with 4 answers, and 48 users voted for the option #2, 37 users for the option #1 and 39 for the option #4. I want a query that selects that and write these things: 1 37 2 48 3 0 4 39 P.S. VERY IMPORTANT! IT MUST COUNT ONLY NRANSWERS ANSWERS, AND IT MUST ECHO THE ONES THAT WEREN'T VOTED BEFORE.

    Read the article

  • Bean validation VS JSF validation

    - by henloke
    When facing the problem of validating a property in a JSF2 application there are two main approaches. Defining the validation on the ManagedBean using an Annotation @ManagedBean public class MyBean { @Size(max=8) private String s; // Getters setters and other stuff. } or declaring it on the jsf page: <h:inputText value="#{myBean.s}"> <f:validateLength maximum="8"/> </h:inputText> It happens that I can't decide for none of them. The first one is nice because it removes some code from the jsf pages (which is always good since those pages are not eye friendly by definition) but makes harder to see 'at a glance' what's going on with the page when checking the jsf file. Which one do you think is clearer? Nicer? Better?

    Read the article

  • How Can I Implement This In Java?

    - by davit-datuashvili
    first of all i am doing programs in java language this code is merely taken from web site i have not question about divide and conqurer algorithms but about function and it's argument here is code of ternary search def ternarySearch(f, left, right, absolutePrecision): #left and right are the current bounds; the maximum is between them if (right - left) < absolutePrecision: return (left + right)/2 leftThird = (2*left + right)/3 rightThird = (left + 2*right)/3 if f(leftThird) < f(rightThird): return ternarySearch(f, leftThird, right, absolutePrecision) return ternarySearch(f, left, rightThird, absolutePrecision) i am not asking once again how implement it in java i am asking for example how define function?for example let y=x^+3 yes we can determine it as public static int y(int x){ return x*x+3; } but here return ternarySearch(f, leftThird, right, absolutePrecision) function f does not have argument and how do such?please help me

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >