Search Results

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

Page 79/130 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Command Line arguments - PHP

    - by Chaitanya
    Am trying the following php script which finds out the maximum between 2 numbers, it accepts the arguments through command line. I check whether the input is provided right, based on the number of command line arguments. <?php function larger($arg1,$arg2) { return max($arg1,$arg2); } if($argc > 3 || $argc < 3) print 'Invalid Arguments'; exit(1); if($argc==3) { print larger($argv[1],$argv[2]); } ?> Am executing the program in a windows system, and the file resides in xampp/php directory. While executing I don't get any output neither any error report. How do i check whether am right or wrong?

    Read the article

  • HSM - cryptoki - opening sessions overhead

    - by Raj
    I am having a query regarding sessions with HSM. I am aware that there is an overhead if you initialise and finalise the cryptoki api for every file you want to encrypt/decrypt. My queries are, Is there an overhead in opening and closing individual sessions for every file, you want to encrypt/decrypt.(C_Initialize/C_Finalize) How many maximum number of sessions can i have for a HSM simultaneously, with out affecting the performance? Is opening and closing the session for processing individual files the best approach or opening a session and processing multiple files and then closing the session the best approach? Thanks

    Read the article

  • Memory Warning but Small Live Bytes

    - by Kamchatka
    Hi everyone, In my application, I get a memory warning of level 1 and then 2 after repeating some action (choosing a picture + processing) several times and then a crash. The leak tool doesn't show any leak. I'm also following the Allocations tool in Instruments and my Live Bytes are roughly 4 MB, overall I allocate 113 MB. At maximum I have maybe 20 MB in memory when the picture is loaded. Since I have to repeat an action to get to the crash, it is very likely to be a memory leak. However, I don't know how to locate it since my live bytes are 4 MB and things supposed to be allocated (apart a small leak of ~100 KB in the UIImagePickerController). How much can I trust the memory leak/allocation tools? Would you have an advice to help me locate the reason of the problem?

    Read the article

  • Regular expression quantifier questions

    - by Josemalive
    Hello, Im trying to find a regular expression that matches this kind of URL: http://sub.domain.com/selector/F/13/K/100546/sampletext/654654/K/sampletext_sampletext.html and dont match this: http://sub.domain.com/selector/F/13/K/10546/sampletext/5987/K/sample/K/101/sample_text.html only if the number of /K/ is minimum 1 and maximum 2 (something with a quantifier like {1,2}) Until this moment i have the following regexp: http://sub\.domain\.com/selector/F/[0-9]{1,2}/[a-z0-9_-]+/ Now i would need a hand to add any kind of condition like: Match this if in the text appears the /K/ from 1 to 2 times at most. Thanks in advance. Best Regards. Josema

    Read the article

  • Database Design: A proper table design for large number of column values.

    - by Jake
    I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...? Option 1 Have a table with 1000 columns. Seems like a bad idea. What if the number of statistics one day exceeds the maximum number of columns? Option 2 Have a table with three columns. Let's say, ID, StatisticType, and StatisticValue. That way, you can have as many statistics as you want. However, reading a single experiments statistics becomes more complicated. Moreover, what if different statistics are different data types?? Any suggestions?

    Read the article

  • Graph - strongly connected components

    - by HardCoder1986
    Hello! Is there any fast way to determine the size of the largest strongly connected component in a graph? I mean, like, the obvious approach would mean determining every SCC (could be done using two DFS calls, I suppose) and then looping through them and taking the maximum. I'm pretty sure there has to be some better approach if I only need to have the size of that component and only the largest one, but I can't think of a good solution. Any ideas? Thanks.

    Read the article

  • How can I handle maxRequestLength exceptions elegantly?

    - by JMP
    In my ASP.NET MVC (v2 if it matters) app, I have a page that allows the user to upload a file. I've configured the maxRequestLength for my app to allow files up to 25MB. As a test, I send it a 500MB file which throws the exception: Maximum request length exceeded. (I only know this because ELMAH catches the error and logs it.) In my web.config, I've set customErrors mode="On" with a defaultRedirect, but the user isn't redirected at all, they don't even get a yellow-screen-of-death. In Chrome, for example, you'll see the error: Error 101 (net::ERR_CONNECTION_RESET): Unknown error. Is it possible to provide a more elegant user experience for this situation?

    Read the article

  • Haskell IO Passes to Another Function

    - by peterwkc
    This question here is related to http://stackoverflow.com/questions/3066956/haskell-input-return-tuple I wonder how we can passes the input from monad IO to another function in order to do some computation. Actually what i want is something like -- First Example test = savefile investinput -- Second Example maxinvest :: a maxinvest = liftM maximuminvest maxinvestinput maxinvestinput :: IO() maxinvestinput = do str <- readFile "C:\\Invest.txt" let cont = words str let mytuple = converttuple cont let myint = getint mytuple putStrLn "" -- Convert to Tuple converttuple :: [String] -> [(String, Integer)] converttuple [] = [] converttuple (x:y:z) = (x, read y):converttuple z -- Get Integer getint :: [(String, Integer)] -> [Integer] getint [] = [] getint (x:xs) = snd (x) : getint xs -- Search Maximum Invest maximuminvest :: (Ord a) => [a] -> a maximuminvest [] = error "Empty Invest Amount List" maximuminvest [x] = x maximuminvest (x:xs) | x > maxTail = x | otherwise = maxTail where maxTail = maximuminvest xs In the second example, the maxinvestinput is read from file and convert the data to the type maximuminvest expected. Please help. Thanks.

    Read the article

  • Can Goldberg algorithm in ocamlgraph be used to find Minimum Cost Flow graph?

    - by Tautrimas
    I'm looking for an implementation to the Minimum Cost Flow graph problem in OCaml. OCaml library ocamlgraph has Goldberg algorithm implementation. The paper called Efficient implementation of the Goldberg-Tarjan minimum-cost flow algorithm is noting that Goldberg-Tarjan algorithm can find minimum cost graph. Question is, does ocamlgraph algorithm also find the minimum cost? Library documentation only states, that it's suitable at least for the maximum flow problem. If not, does anybody have a good link to a nice any minimum cost optimization algorithm code? I will manually translate it into OCaml then. Forgive me, if I missed it on Wikipedia: there are too many algos on flow networks for the first day!

    Read the article

  • HLSL How can one pass data between shaders / read existing colour value?

    - by RJFalconer
    Hello all, I have 2 HLSL ps2.0 shaders. Simplified, they are: Shader 1 Reads texture Outputs colour value based on this texture Shader 2 Needs to read in existing colour (or have it passed in/read from a register) Outputs the final colour which is a function of the previous colour (They need to be different shaders as I've reached the maximum vertex-shader outputs for 1 shader) My problem is I cannot work out how Shader 2 can access the existing fragment/pixel colour. Is the only way for shaders to interact really just the alpha blending options? These aren't sufficient if I want to use the colour as input to my function.

    Read the article

  • Swing: what to do when a GUI update takes too long and freezes other GUI elements?

    - by java.is.for.desktop
    Hello, everyone! I know that GUI code in Java Swing must be put inside SwingUtilities.invokeAndWait or SwingUtilities.invokeLater. This way threading works fine. Sadly, in my situation, the GUI update it that thing which takes much longer than background thread(s). More specific: I update a JTree with about just 400 entries, nesting depth is maximum 4, so should be nothing scary, right? But it takes sometimes one second! I need to ensure that the user is able to type in a JTextPane without delays. Well, guess what, the slow JTree updates do cause delays for JTextPane during input. It refreshes only as soon as the tree gets updated. I am using Netbeans and know empirically that a Java app can update lots of information without freezing the rest of the UI. How can it be done? NOTE 1: All those DefaultMutableTreeNodes are prepared outside the invokeAndWait. NOTE 2: When I replace invokeAndWait with invokeLater the tree doesn't get updated.

    Read the article

  • C# Socket Server

    - by Snoopy
    In .NET 3.5 a new socket classes was released: http://msdn.microsoft.com/en-us/library/bb968780.aspx i found a sample but some questions regarding best practicses are remaining: http://code.msdn.microsoft.com/nclsamples/Wiki/View.aspx?title=Socket%20Performance m_numConnections (the maximum number of connections the sample is designed to handle simultaneously) is probably equal to the amount of cpu cores i have. m_receiveBufferSize is the size for one packet? like 8kb? how should i handle a length byte? opsToPreAlloc i dont understand. is this if i code a transparent proxy? Regarding the multithreading, what should be used? The reactive extension seem to be a good choice. Has anyone tried this in a real world project? Are there better options? I had bad experiences with the .NET thread pool in the past.

    Read the article

  • ImageMagick - how to enforce min/max heights/widths?

    - by Henryh
    Using ImageMagick, how can I resize an image to have a minimum: height of 150px width of 200px and also have a maximum: height of 225px width of 275px UPDATE: In case it helps, here's a further explanation of what I'm experiencing. I have a buch of images with all different ratio dimensions. Some images have 1:5 height/width ratios. Some have 5:1 height/width ratios. So that I want to do is set that a minimum height/width size for the image but also don't want the image size to be larger than a particular size. If I need to apply white padding to an image to make it fit within my constraint so that I don't have to distort the image, I'd like to do so.

    Read the article

  • Do you know of a bleeding-edge HTML5 leveraging, legacy-ignoring JavaScript framework?

    - by Ivan
    What's the best framework (sort of jquery, extjs, etc like) to use if I'd like to intensively use all the freshest technologies of the HTML5 stack provided by modern browsers (Firefox 3.6+ (Minefield especially), Safari 4+, Chrome 4+) and have absolutely no need to support any legacy browsers (incl. no need in IE support at all, no need in Firefox prior to 3.5, etc.)? I'd like to get all the newest available goodness without having (even abstracted by a library layer) a line of code meant just fore legacy compatibility and keeping no legacy-induced things in mind. To soften the filter, taking very humble hope of such an ideally fresh framework to exist, the least (the maximum level of legacy support) I'd like to agree is not supporting IE versions older than IE8, or better just not supporting IE at all.

    Read the article

  • How to recive more than 65000 bytes in C++ socket using recv()

    - by Mr.Cool
    I am developing a client server application (TCP) in Linux using C++. I want to send more than 65,000 bytes at the same time. In TCP, the maximum packet size is 65,635 bytes only. How can I send the entire bytes without loss? Following is my code at server side. //Receive the message from client socket if((iByteCount = recv(GetSocketId(), buffer, MAXRECV, MSG_WAITALL)) > 0) { printf("\n Received bytes %d\n", iByteCount); SetReceivedMessage(buffer); return LS_RESULT_OK; } If I use MSG_WAITALL it takes a long time to receive the bytes so how can I set the flag to receive more than 10 lakhs bytes at time.

    Read the article

  • How can you tell the source of the data when using the Stream.BeginRead Method?

    - by xarzu
    When using the Stream.BeginRead Method, and you are reading from a stream into a memory, how is it determined where you are reading the data from? See: http://msdn.microsoft.com/en-us/library/system.io.stream.beginread.aspx In the list of parameters, I do not see one that tells where the data is being read from: Parameters buffer Type: System.Byte[] The buffer to read the data into. offset Type: System.Int32 The byte offset in buffer at which to begin writing data read from the stream. count Type: System.Int32 The maximum number of bytes to read. callback Type: System.AsyncCallback An optional asynchronous callback, to be called when the read is complete. state Type: System.Object A user-provided object that distinguishes this particular asynchronous read request from other requests.

    Read the article

  • How do I use Some/None Options in this F# example?

    - by Phobis
    I am new to F# and I have this code: if s.Contains("-") then let x,y = match s.Split [|'-'|] with | [|a;b|] -> int a, int b | _ -> 0,0 Notice that we validate that there is a '-' in the string before we split the string, so the match is really unnecessary. Can I rewrite this with Options? I changed this code, it was originally this (but I was getting a warning): if s.Contains("-") then let [|a;b|] = s.Split [|'-'|] let x,y = int a, int b NOTE: I am splitting a range of numbers (range is expressed in a string) and then creating the integer values that represent the range's minimum and maximum.

    Read the article

  • Building html tables from query data... faster?

    - by Andrew Heath
    With my limited experience/knowledge I am using the following structure to generate HTML tables on the fly from MySQL queries: $c = 0; $t = count($results); $table = '<table>'; while ($c < $t) { $table .= "<tr><td>$results[0]</td><td>$results[1]</td> (etc etc) </tr>"; ++$c; } $table .= '</table>'; this works, obviously. But for tables with 300+ rows there is a noticeable delay in pageload while the script builds the table. Currently the maximum results list is only about 1,100 rows, and the wait isn't long, but there's clearly a wait. Are there other methods for outputting an HTML table that are faster than my WHILE loop? (PHP only please...)

    Read the article

  • [C#] foreach loop corrent index

    - by Eyla
    Is there anyway to know the current run of a foreach without have to: Int32 i; foreach i++; or is that the best option i got?? Also, how can i know the maximum number of items on that loop?? What i am trying to do is update a progressbar during a foreach loop on my form Thanks This is what i got foreach (FileInfo file in DirectoryFiles) { if ((file.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden || (file.Attributes & FileAttributes.System) == FileAttributes.System) continue; backgroundWorkerLoadDir.ReportProgress(i, file.Name); System.Threading.Thread.Sleep(10); }

    Read the article

  • jQuery Validation using the class instead of the name value

    - by Matt
    Hi, I'd like to validate a form using the jquery validate plugin, but I'm unable to use the 'name' value within the html - as this is a field also used by the server app. Specifically, I need to limit the number of checkboxes checked from a group. (Maximum of 3.) All of the examples I have seen, use the name attribute of each element. What I'd like to do is use the class instead, and then declare a rule for that. html This works: <input class="checkBox" type="checkbox" id="i0000zxthy" name="salutation" value="1" /> This doesn't work, but is what I'm aiming for: <input class="checkBox" type="checkbox" id="i0000zxthy" name="i0000zxthy" value="1" /> javascript: var validator = $(".formToValidate").validate({ rules:{ "salutation":{ required:true, }, "checkBox":{ required:true, minlength:3 } } }); Is it possible to do this - is there a way of targeting the class instead of the name within the rules options? Or do I have to add a custom method? Cheers, Matt

    Read the article

  • Express any number as the sum of 4 prime numbers [Doubts]

    - by WarDoGG
    I was give a problem to express any number as sum of 4 prime numbers. Conditions: Not allowed to use any kind of database. Maximum execution time : 3 seconds Numbers only till 100,000 If the splitting is NOT possible, then return -1 What i did : using the sieve of eratosthenes, i calculated all prime numbers till the specified number. looked up a concept called goldbach conjecture which expresses an even number as the summation of 2 primes. However, i am stuck beyond that. Can anyone help me on this one as to what approach u might take ? The sieve of eratosthenes is taking 2 seconds to count primes till 100,000 :(((

    Read the article

  • Enum value in C++

    - by Sunil
    enum AccessSource { AccessSourceNull = 0x00000001, AccessSourceSec = 0x00000002, AccessSourceIpo = 0x00000004, AccessSourceSSA = 0x00000008, AccessSourceUpgrade = 0x00000010, AccessSourceDelta = 0x00000020, AccessSourcePhoneM = 0x00000040, AccessSourceSoft = 0x00000080, AccessSourceCR = 0x00000100, AccessSourceA = 0x00000200, AccessSourceE = 0x00000400, AccessSourceAll = 0xFFFFFFFF }; What is the value of AccessSourceAll ?? is it -1? or is it maximum value? I have a parameter ULONG x , whose default value is AccessSourceAll(that means access to all). How do i remove the access right of AccessSourceE only? How to add the access right of AccessSourceE again? If i have a particular value in x, then how do i know whether AccessSourceE is set or not?

    Read the article

  • Motherboard memory question

    - by JERiv
    I am currently drawing up specs on a new workstation for my office. I am considering the Asus P6X58D for a motherboard. This board's specs list it as supporting 24 gigs of memory. Suppose I were to use six four gig memory cards and then two video cards with 1 gig of memory apiece. Is the maximum supported memory similar to how 32 bit operating systems only have enough address space for 4 gigs of memory? Simply: Will the board post? If so, will the system be able to address all the memory, both the 24 gigs on the ddr3 bus and the 3 gigs on the graphics card?

    Read the article

  • how to initialize spring bean from database

    - by wavelet
    hi,i use spring security and my config is in database: <sec:http auto-config="true" entry-point-ref="casProcessingFilterEntryPoint"> <sec:remember-me /> <sec:session-management> <sec:concurrency-control max-sessions="1" error-if-maximum-exceeded="true" /> </sec:session-management> <sec:logout logout-success-url="${host.url}/logout/" /> <sec:custom-filter ref="casAuthenticationFilter" after="CAS_FILTER" /> <sec:custom-filter ref="filterInvocationInterceptor" before="FILTER_SECURITY_INTERCEPTOR" /> </sec:http> like ${host.url} is in database how can i initialize ?

    Read the article

  • Dojo slider: update value dynamically

    - by xApple
    I am building an application where the user browses certain objects by scrolling and zooming. To change the zoom level I have successfully implemented a "dijit.form.HorizontalSlider" object. Every time the user changes the position of the silder, I can catch the "onChange" call and do something with that. However, the user can also zoom-in by double clicking inside the view zone, at which point the slider should change position automatically to reflect the new zoom level. My question is the following: what function or method should I call in my javascript to update the position of a dojo silder ? Here is the code that creates the silder object: var zoomSlider = new dijit.form.HorizontalSlider({ name: "zoom_slider", id: "zoom_slider", value: 0, minimum: 0, maximum: 19, discreteValues: 20, intermediateChanges: false, style: "width: 160px;", onChange: function(value) { brwsr.view.zoomTo(value); } }, "zoom_slider"); navbox_silder.appendChild(zoomSlider.domNode);

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >