Search Results

Search found 5122 results on 205 pages for 'max'.

Page 141/205 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • Finding number of different paths

    - by peiska
    I have a game that one player X wants to pass a ball to player Y, but he can be playing with more than one player and the others players can pass the ball to Y. I want to know how many different paths can the ball take from X to Y? for example if he is playing with 3 players there are 5 different paths, 4 players 16 paths, if he is playing with 20 players there are 330665665962404000 paths, and 40 players 55447192200369381342665835466328897344361743780 that the ball can take. the number max. of players that he can play with is 500. I was thinking in using Catalan Numbers? do you think is a correct approach to solve this? Can you give me some tips.

    Read the article

  • Monitoring Log Shipped Databases

    - by Registered User
    I need a consistent way to monitor databases that are read-only log shipped copies of production databases. In the past I have relied on the following methods: Set the job that restores logs to the database kick off another job as its last step. Set the job that restores logs to the database to insert a record in a control table as its last step. Query the msdb database to check the status of the job that restores logs to the database. Query a control table inside the database itself that gets a value immediately before transaction logs are backed up. Query MAX values from tables inside the database to see if it has recent changes. Although the above methods work, they can't be implemented for every log shipped database that I query for various reasons. What is the best method for monitoring the "data as of" date for a log shipped database?

    Read the article

  • HTML img scaling

    - by rwallace
    I'm trying to display some large images with HTML img tags. At the moment they go off the edge of the screen; how can I scale them to stay within the browser window? Or in the likely event that this is not possible, is it possible to at least say "display this image at 50% of its normal width and height"? The width and height attributes distort the image -- as far as I can tell, this is because they refer to whatever attributes the container may end up with, which will be unrelated to the image. I can't specify pixels because I have to deal with a large collection of images each with a different pixel size. Max-width doesn't work.

    Read the article

  • Microphone input

    - by George
    I'm trying to build a gadget that detects pistol shots using Android. It's a part of a training aid for pistol shooters that tells how the shots are distributed in time and I use a HTC Tattoo for testing. I use the MediaRecorder and its getMaxAmplitude method to get the highest amplitude during the last 1/100 s but it does not work as expected; speech gives me values from getMaxAmplitude in the range from 0 to about 25000 while the pistol shots (or shouting!) only reaches about 15000. With a sampling frequency of 8kHz there should be some samples with considerably high level. Anyone who knows how these things work? Are there filters that are applied before registering the max amplitude. If so, is it hardware or software? Thanks, /George

    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

  • Display only latest three results from PHP and MySQL

    - by nogggin1
    <?php $result = @mysql_query('SELECT Article FROM news WHERE ID = (SELECT MAX(ID) FROM News)'); if (!$result) { die('<p>Error performing query: ' . mysql_error() . '</p>'); } while ( $row = mysql_fetch_array($result) ) { echo('<p>' . $row['Article'] . '</p>'); } ?> basically i need to tweak this so that it shows the latest 3 results instead of just the latest one, also i need the order to be: newest 2nd newest 3rd newest any help would be greatly appreciated!

    Read the article

  • facebook login button not rendering

    - by Neha
    Hi I am developing a widget that will be placed on an external website. The entire plugin has to be written in javascript. I haev searched here and there but am unable to make the facebook login button appear on the widget My code is the following var fbroot = document.createElement('div'); fbroot.id = "fb-root"; window.fbAsyncInit = function(){ FB.init('xxxxxxxxxxxxxxxxxx', '/xd_receiver.htm'); }; var contentRightDiv = document.createElement('div'); contentRightDiv.id = "contentrightdiv"; contentRightDiv.innerHTML = "<form><p><label>Sign in using <div id='socialmedialoginbtns'></div></label></p></form>"; var socialmedialoginbtns = document.getElementById('socialmedialoginbtns'); socialmedialoginbtns.innerHTML = '<fb:login-button show-faces="false" width="200" max-rows="1"></fb:login-button>';

    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

  • LIMIT amount of rows fetched by JOIN

    - by user892134
    How do i LIMIT the child rows fetched to only 5? Here is the SQLfiddle http://sqlfiddle.com/#!2/bd96a/2. Right now it fetches all rows with parentid='4' and parentid='14'. It should only fetch 5 of each parentid. Assuming i have hundreds of rows, it should only fetch a max of 5 for each parentid. "SELECT child.* FROM mytable as parent LEFT JOIN mytable as child on child.parentid=parent.id WHERE parent.pageid IN ( 1, 2) AND parent.submittype='1' ORDER BY child.id ASC"; How do i solve this?

    Read the article

  • How to set per-script upload_max_filesize limit?

    - by Ilya Muromets
    I have the following issue: How to set per-script upload_max_filesize limit? I want to set a larger upload max filesize limit for a particular script (action). I know I could use .htaccess, but the problem is that all actions are being dispatched via single index.php file, which likely means for all actions .htaccess rules are the same. So is it possible to set a per-script max_upload_size for a single php script (action)? Hope, you will be able to help me. Thanks in advance.

    Read the article

  • Java Web Server with Jetty - TCP Connections Taking Long

    - by daysleeper
    I have an application with fairly high traffic (20K req/min) running on the JVM with a Jetty servlet container on Ubuntu. Below is my Jetty configuration: 10 20 2000 2 When I analyze the network traffic, I realize that sometimes it is taking long to establish TCP connections on the port that Jetty is running. The long connections are varying between 3.0s and 9.0s. The port is configured to accept MAX number of TCP connections. Do you know what might be causing the delay in accepting connections? Thanks

    Read the article

  • What are good uses for Python3's "Function Annotations"

    - by agscala
    Function Annotations: PEP-3107 I ran across a snippet of code demonstrating Python3's function annotations. The concept is simple but I can't think of why these were implemented in Python3 or any good uses for them. Perhaps SO can enlighten me? How it works: def foo(a: 'x', b: 5 + 6, c: list) -> max(2, 9): ... function body ... Everything following the colon after an argument is an 'annotation', and the information following the -> is an annotation for the function's return value. foo.func_annotations would return a dictionary: {'a': 'x', 'b': 11, 'c': list, 'return': 9} What's the significance of having this available?

    Read the article

  • LINQ to SQL auto-generated type for stored procedure

    - by StuffHappens
    Hello. I have the following stored procedure ALTER PROCEDURE [dbo].Test AS BEGIN CREATE TABLE ##table ( ID1 int, ID2 int ) DECLARE @query varchar(MAX); INSERT INTO ##table VALUES(1, 1); SELECT * FROM ##table; END And I try to use it from C# code. I use LINQ to SQL as an O/RM. When I add the procedure to DataBaseContext it says that it can't figure out the return value of this procedure. How to modify the stored procedure so that I can use it with LINQ to SQL. Note: I need to have global template table!

    Read the article

  • Create a complex SQL query?

    - by mazzzzz
    Hey guys, I have a program that allows me to run queries against a large database. I have two tables that are important right now, Deposits and withdraws. Each contains a history of every user. I need to take each table, add up every deposit and withdraws (per user), then subtract the withdraws from the deposits. I then need to return every user whos result is negative (aka they withdrew more then they deposited). Is this possible in one query? Example: Deposit Table: |ID|UserName|Amount| |1 | Use1 |100.00| |2 | Use1 |50.00 | |3 | Use2 |25.00 | |4 | Use1 | 5.00 | WithDraw Table: |ID|UserName|Amount| |2 | Use2 | 5.00 | |1 | Use1 |100.00| |4 | Use1 | 5.00 | |3 | Use2 |25.00 | So then the result would output: |OverWithdrawers| | Use2 | Is this possible (I sure don't know how to do it)? Thanks for any help, Max

    Read the article

  • fixed background in IE -any resolution

    - by Krishna Priya
    Hi, In my website, I have to use the background image that is fixed in any resolution, and should not change when control+scroll. I have used the following css. /* CSS style / img.bg { / Set rules to fill background */ min-height: 100%; min-width: 1024px; /* Set up proportionate scaling */ width: 100%; height: auto; /* Set up positioning */ position: fixed; top: 0; left: 0; } @media screen and (max-width: 1024px){ img.bg { left: 50%; margin-left: -512px; } } This code working fine in Firefox, but background image is shrinking in IE browser. How to fix this issue.Anyone please help

    Read the article

  • reading partially from sockets

    - by nomad.alien
    I'm having a little test program that sends a lot of udp packets between client-server-client (ping/pong test). The packets are fixed size on each run(last run is max allowable size of udp packet) I'm filling the packets with random data except for the beginning of each packet that contains the packet number. So I'm only interested to see if I receive all the packets back at the client. I'm using sendto() and recvfrom() and I only read the sizeof(packet_number) (which in this case is an int). What happens to the rest of the data? Does it end up in fairyland (gets discarded)? or does the new packet that arrives gets appended to this "old" data? (using linux)

    Read the article

  • Changing size of a dynamically allocated matrix

    - by user1309174
    Trying to re-size the shape matrix dynamically. This is part of a drawing program where _capacity is the number of shapes drawn on a frame. Get the error in new Shape about _capacity saying expression needs to have a constant value. void ShapeStore::Grow(int minimumCapacity) { _capacity = max (minimumCapacity, 2 * _capacity); if (_capacity) { Shape ***newData = new Shape[_frames][_capacity]; //figure out this int i; for (int k = 0; k < _frames; k++) for (i=0;i<_count;i++) newData[k][i] = _data[k][i]; delete [] _data; _data = newData; } //*/ }

    Read the article

  • Learning to work with audio in C++

    - by Skilldrick
    My degree was in audio engineering, but I'm fairly new to programming. I'd like to learn how to work with audio in a programming environment, partly so I can learn C++ better through interesting projects. First off, is C++ the right language for this? Is there any reason I shouldn't be using it? I've heard of Soundfile and some other libraries - what would you recommend? Finally, does anyone know of any good tutorials in this subject? I've learnt the basics of DSP - I just want to program it! EDIT: I use Windows. I'd like to play about with real-time stuff, a bit like Max/MSP but with more control.

    Read the article

  • Tree data structure in php

    - by Piyush
    in my application user starts a new tree or get added under a child-user and keep on adding users in branches in such a way- >there are 10 level of tree type structure. >root node contain 1 user and each node(user) can have max 5 child-user in this way tree will be like level 0 = 1 user , level 1 = 5 user, level 2 = 25 user , level 3 = 125 user and so on. I created one MySQL table having columns like- User_id , level, super_id, child1_id, child2_id, child3_id, child4_id, child5_id my question is How can I get all child-user(child to child also) of a particular user at any level do I need to add some more columns in my table??

    Read the article

  • Response Time is different for mulitiple execution of the application with the same request Performa

    - by sivananda
    My java application functionality is to provide reference data (basically loads lots of data from xml files into hashmap) and hence we request for one such data from the hashmap based on a id and we have such multiple has map for different set of business data. The problem is that when i tried executing the java application for the same request multiple times, the response times are different like 31ms, 48ms, 72ms, 120ms, 63ms etc. hence there is a considerable gap between the min and max time taken for the execution to complete. Ideally, i would expect the response times to be like, 63ms, 65ms, 61ms, 70ms, 61ms, but in my case the variation of the response time for the same request is varying hugely. I had used a opensource profile to understand if there is any extra execution of the methods or memory leak, but as per my understanding there was no problem. Please let me know what could be the reasons and how can i address this problem.

    Read the article

  • C++ wrapper for C library

    - by Maximilien
    Hi, Recently I found a C library that I want to use in my C++ project. This code is configured with global variables and writes it's output to memory pointed by static pointers. When I execute my project I would like 2 instances of the C program to run: one with configuration A and one with configuration B. I can't afford to run my program twice, so I think there are 2 options: Make a C++ wrapper: The problem here is that the wrapper-class should contain all global/static variables the C library has. Since the functions in the C library use those variables I will have to create very big argument-lists for those functions. Copy-paste the C library: Here I'll have to adapt the name of every function and every variable inside the C library. Which one is the fastest solution? Are there other possibilities to run 2 instances of the same C source? Thanks, Max

    Read the article

  • Dynamically generate Triangle Lists for a Complex 3D Mesh

    - by Vulcan Eager
    In my application, I have the shape and dimensions of a complex 3D solid (say a Cylinder Block) taken from user input. I need to construct vertex and index buffers for it. Since the dimensions are taken from user input, I cannot user Blender or 3D Max to manually create my model. What is the textbook method to dynamically generate such a mesh? Edit: I am looking for something that will generate the triangles given the vertices, edges and holes. Something like TetGen. As for TetGen itself, I have no way of excluding the triangles which fall on the interior of the solid/mesh.

    Read the article

  • Simple logic in javascript

    - by Saurabh
    I have four variables of type integer - var tip_1, tip_2, tip_3, tip_4; The value of these variables are getting fill by some other logic which is always between 1 to 10. I need to maintain a hash with variable name as "key" and value as "value" by following these rules - The variable with MAX value should be the first element in the hash and so on. e.g. if tip_1 = 4, tip_2 = 1, tip_3 = 2, tip_4 = 10 then hash should be something like, Hash = {tip_4, 10} {tip_1, 4} {tip_3, 2} {tip_1, 1} In case of tie following order should be considered - tip_1 tip_2 tip_3 tip_4;

    Read the article

  • MySQL LEFT JOIN, GROUP BY and ORDER BY not working as required

    - by Simon
    I have a table 'products' => ('product_id', 'name', 'description') and a table 'product_price' => ('product_price_id', 'product_id', 'price', 'date_updated') I want to perform a query something like SELECT `p`.*, `pp`.`price` FROM `products` `p` LEFT JOIN `product_price` `pp` ON `pp`.`product_id` = `p`.`product_id` GROUP BY `p`.`product_id` ORDER BY `pp`.`date_updated` DESC As you can probably guess the price changes often and I need to pull out the latest one. The trouble is I cannot work out how to order the LEFT JOINed table. I tried using some of the GROUP BY functions like MAX() but that would only pull out the column not the row. Thanks.

    Read the article

  • Three boolean values saved in one tinyint

    - by Casper
    Hello, probably a simple question but I seem to be suffering from programmer's block. :) I have three boolean values: A, B, and C. I would like to save the state combination as an unsigned tinyint (max 255) into a database and be able to derive the states from the saved integer. Even though there are only a limited number of combinations, I would like to avoid hard-coding each state combination to a specific value (something like if A=true and B=true has the value 1). I tried to assign values to the variables so (A=1, B=2, C=3) and then adding, but I can't differentiate between A and B being true from i.e. only C being true. I am stumped but pretty sure that it is possible. Thanks

    Read the article

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >