Search Results

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

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

  • Dynamic validation in jquery

    - by mansoor
    $(document).ready(function(){ $('a[rel=addhint]').click(function(){ var html='<div><label>Hint</label>'; html+='<span class="input"><input type="text" size="30" class="text" name="hint"/><a href="#" rel="delhint">delete</a></span><br class="clear" /></div>'; $('div#hintTextContainer').append(html); bindDelHintAll(); return false; }); I want when a new text area include vadition of required field and max length will also apply on it.

    Read the article

  • Passing 2D array with variable dimensions as function argument

    - by TheCrazyProgrammer
    I just saw the following code among the successful submissions at codechef. http://www.codechef.com/viewplaintext/1595846 I used to think that float max(int n,int arr[n][n]) {....} is not allowed in C++ (as 'n' is a variable). My CodeBlocks (on windows) with MinGW [gcc 4.4] gives compile time error. that "error: array bound is not an integer constant. Then how can be such a solution be accepted by CodeChef's judge. Is there any special flag that allows us to do that in C++??? EDIT: A link showing status as AC (accepted) : http://www.codechef.com/viewsolution/1595846

    Read the article

  • Why I can't use template table in dynamic query SQL SERVER 2005

    - by StuffHappens
    Hello! I have the following t-sql code which generates an error Declare @table TABLE ( ID1 int, ID2 int ) INSERT INTO @table values(1, 1); INSERT INTO @table values(2, 2); INSERT INTO @table values(3, 3); DECLARE @field varchar(50); SET @field = 'ID1' DECLARE @query varchar(MAX); SET @query = 'SELECT * FROM @table WHERE ' + @field + ' = 1' EXEC (@query) The error is Must declare the table variable "@table". What's wrong with the query. How to fix it?

    Read the article

  • sql insert statement with a lot of same where clause and one different where cluase

    - by william
    I m sry if the title is not clear. Here's my proble. I created a new table which will show total, average and maximum values. I have to insert the results into that table. That table will have only 4 rows. No Appointment, Appointment Early, Appointment Late and Appointment Punctual. So.. I have sth like.. insert into newTable select 'No Appointment' as 'Col1', avg statement, total statement, max statement from orgTable where (general conditions) and (unique condition to check NO APPOINTMENT); I have to do that same thing for another 3 rows.. where only the unique condition is different to check early, punctual or late.. So..the statement is super long. I wanna reduce the size.. How can I achieve that?

    Read the article

  • How to convert from integer to unsigned char in C, given integers larger than 256?

    - by Alf_InPogform
    As part of my CS course I've been given some functions to use. One of these functions takes a pointer to unsigned chars to write some data to a file (I have to use this function, so I can't just make my own purpose built function that works differently BTW). I need to write an array of integers whose values can be up to 4095 using this function (that only takes unsigned chars). However am I right in thinking that an unsigned char can only have a max value of 256 because it is 1 byte long? I therefore need to use 4 unsigned chars for every integer? But casting doesn't seem to work with larger values for the integer. Does anyone have any idea how best to convert an array of integers to unsigned chars?

    Read the article

  • format.js response doesn't execute

    - by Denis
    Hi, I use Rails 3.0.0 Beta following an action, my rjs view returns a javascript, but the code is not executed In firebug I see in my response $('polaroids').insert("<li>\n <a title=\"4204497503_a0c43c561d.jpg\" href=\"#\">\n <img alt=\"4204497503_a0c43c561d.jpg\" src=\"/system/photos/279/original/4204497503_a0c43c561d.jpg?1268857318\" />\n <\/a>\n<\/li>") Here is the response header Response Headers Etag "7343b21b2f062fb74b7d5f32e3a83c2c" Connection Keep-Alive Content-Type text/javascript; charset=utf-8 Date Wed, 17 Mar 2010 20:21:58 GMT Server WEBrick/1.3.1 (Ruby/1.8.7/2008-08-11) X-Runtime 0.060497 Content-Length 220 Cache-Control max-age=0, private, must-revalidate Set-Cookie _photos_session=BAh7ByIQX2NzcmZfdG9rZW4iMS9OWnpOZUR6UGQ2UDhvbGt5YWpTWXhJcFR2YjRHOEhzZHlIbmdMblRlMWs9Ig9zZXNzaW9uX2lkIiUxNjlhOWYzNjQxODE2N2NjN2FiNmYzY2VkYmU3OTgwYQ%3D%3D--022d7202178b2cc7bf968e558c2ae67ecef1fb74; path=/; HttpOnly

    Read the article

  • Find recipes that can be cooked from provided ingridients

    - by skaurus
    Sorry for bad English :( Suppose i can preliminary organize recipes and ingredients data in any way. How can i effectively conduct search of recipes by user-provided ingredients, preferably sorted by max match - so, first going recipes that use maximum of provided ingridients and do not contain any other ingrs, after them recipes that uses less of provided set and still not any other ingrs, after them recipes with minimum additional requirements and so on? All i can think about is represent recipe ingridients like bitmasks, and compare required bitmask with all recipes, but it is obviously a bad way to go. And related things like Levenstein distance i don't see how to use here. I believe it should be quite common task...

    Read the article

  • converting date data type into varchar

    - by Sheetal Inani
    I have some dates fields in table. These columns contain dates in the following format: mmddyy For example: 31/12/2010 00:00:00:0000 I need to import these values into a table which is set to varchar and numeric and formats dates like this: monthName varchar Year numeric(4,0) currently I'm using INSERT INTO [School].[dbo].[TeacherAttendenceDet] ([TeacherCode], [MonthName], [Year]) (SELECT MAX(employeecode), Datename(MONTH, dateofjoining) AS MONTH, Datepart(YEAR, dateofjoining) AS DATE FROM employeedet GROUP BY dateofjoining) but datename() gives result in date format.. I have to save it in varchar format How can I do this? this is employeemast table: EmployeeCode numeric(5, 0) PayScaleCode numeric(7, 0) DesignationCode varchar(50) CityCode numeric(5, 0) EmployeeName varchar(50) FatherName varchar(50) BirthDate varchar(50) DateOfJoining varchar(50) Address varchar(150) this is TeacherAttendenceDet table TeacherCode numeric(5, 0) Unchecked Year numeric(4, 0) Unchecked MonthName varchar(12) Unchecked i have to insert in teacherattendencedet table the monthname and year from employeemast

    Read the article

  • mysql varchar innodb page size limit 8100 bytes

    - by David19801
    Hi, Regarding innodb, someone recently told me: "the varchar content beyond 768 bytes is stored in supplemental 16K pages" This is very interesting. If each varchar will be latin1, which I believe stores as 1byte per letter, would a single varchar(500) (<768 bytes) require an extra i/o as a varchar(1000) (768 bytes) would?? (this question is to find out if all varchars or just big varchars are split into a separate page) Is the 768 limit per varchar or for all varchars in the row added together? (for example, does this get optimized - varchar(300), varchar(300), varchar(300): [where each individual varchar column is below 768 but together they are above 768 characters]? I am confused about if the 768 limit relates to each individual varchar or all varchars in the row totaled (as in the question). Any clarification? EDIT: Removed part about CHARS due to finding out about their limit of 255 max.

    Read the article

  • Best way to handle enable/disable of UIButtons on iPhone

    - by Anonymous
    I have an increase button and a decrease button, both of which affect a variable. The variable has a minimum and the decrease button will be disabled once that minimum is reached. Likewise for the maximum value of the variable. In my controller, I have two IBActions for both the increase and decrease actions, and two IBOutlets, in order to disable the buttons accordingly. At the bottom of my KVO statement to handle the value change, I have: increaseButton.enabled = value != MAX; decreaseButton.enabled = value != MIN; While this code is functional, I can't help but feel that feel this is a naive approach to the problem, especially since this requires 4 connections. Is there a better solution to this, one that uses fewer connections?

    Read the article

  • mod_rewrite and relative urls

    - by Davide Gualano
    I'm setting up some simple url rewriting rules using mod_rewrite and a .htacces file, but I've got some problems. If I set up the .htacces this way: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html /index.php [L] when I call from the browser this url: http://localhost/~dave/mySite/index.html I got a 404 error. Using this .htacces instead Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html http://localhost/~dave/mySite/index.php [L] everything works fine and I get the index.php page I'm expecting. Am I forced to user absolute urls as the target of a rewrite? Is this a Apache configuration problem? I'm using Max OS X 10.6.2 with its standard Apache installation.

    Read the article

  • Getting percentages.

    - by user287798
    Hi, i have got a standing answer in this thread. http://stackoverflow.com/questions/2396203/get-the-count-of-elements-where-candidate-has-won But i am failing to get the percentage, what am i doing wrong. I have the code below. var s4 = from can in allCandidates let noDists= ((from d in root.Elements("Provinces") select d.Attribute("Province").Value).Distinct()).Count() let count = (from winner in (from p in root.Descendants("Province_Data") let maxVotes = (from c in p.Elements("Candidate") select c) .Max(x => ((int)x.Element("votes"))) select (from c in p.Elements("Candidate") select c).Where(x => ((int)x.Element("votes")) == maxVotes) .First().Element("name").Value ) where winner == can select winner).Count() orderby count descending select new { Candidate = can, NumberOfProvincesWon = count,Percentage= (count/noDists)*100}; foreach (var d in s4) Console.WriteLine(" {0}", d.ToString());

    Read the article

  • How can I specify a dynamic height for an ImageView?

    - by kefs
    I have an ImageView at the top of my display that looks like the following: +----------------------------------------------+ ¦ ImageView +--------------+ ¦ ¦ ¦ ¦ ¦ ¦ ¦ Actual image ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ +--------------+ ¦ +----------------------------------------------+ Below this, I have a series of Buttons and TextViews.. I would like the ImageView's height to dynamically increase depending on the max height of the screen. I'm aligning the layout containing the buttons along the bottom of edge of the screen, and I would like the rest of the screen taken up by the above ImageView. Also, since the ImageView contains a centered image, I would also like to set min height, and a scrollbar if the screen is too small to display the imageview and the buttons below. Thanks! Is this possible?

    Read the article

  • Nested loop with dependent bounds trip count

    - by aaa
    hello. just out of curiosity I tried to do the following, which turned out to be not so obvious to me; Suppose I have nested loops with runtime bounds, for example: t = 0 // trip count for l in 0:N for k in 0:N for j in max(l,k):N for i in k:j+1 t += 1 t is loop trip count is there a general algorithm/way (better than N^4 obviously) to calculate loop trip count? I am working on the assumption that the iteration bounds depend only on constant or previous loop variables.

    Read the article

  • group by with 3 diffrent

    - by NN
    I have 2 table and I wanna a query with 3 column result in on of them 2 column with view count and title name and in the other 1 column with type_ and i wanna to grouping type_ with max(view count) and show the them title but i didn't have any idea about grouping expression. i think we can solve in by using sub query but i don't know which column use in group by. 2 table join with this expression class pk=resource key i exam this query: SELECT t.title,j.type_ FROM tags asset t,journal article j where type_ in (select type_ from journal article,tags asset where class pk=resource key group by type_) but the answer was wrong

    Read the article

  • Postgresql sequences

    - by Dylan
    When I delete all records from a Postgresql table and then try to reset the sequence to start a new record with number 1 when it is inserted, i get different results : SELECT setval('tblname_id_seq', (SELECT COALESCE(MAX(id),1) FROM tblname)); This sets the current value of the sequence to 1, but the NEXT record (actually the first because there are no records yet) gets number 2! And I can't set it to 0, because the minimum value in the sequence is 1! When I use : ALTER SEQUENCE tblname_id_seq RESTART WITH 1; the first record that is inserted actually gets number 1 ! But the above code doesn't accept a SELECT as a value instead of 1. I wish to reset the sequence to number 1 when there are no records, and the first record then should start with 1. But when there ARE already records in the table, I want to reset the sequence so that the next record that is inserted will get {highest}+1 Does anyone have a clear solution for this?

    Read the article

  • jquery autosuggest not firing (webform)

    - by Abu Hamzah
    is that something wrong in the below code? its not firing at all $(document).ready(function() { $("#<%=txtHost.ClientID%>").autocomplete("HostService.asmx/GetHosts",{ dataType: 'json' ,contentType: "application/json; charset=utf-8" ,parse: function(data){ var rows = Array(); debugger for(var i = 0; i<data.length; i++){ rows[i] = {data:data[i], value:data[i].LName, result:data[i].LName}; } return rows; } ,formatItem: function(row, i, max){ return data.LName + ", " + data.FName; } }); }); <script src="Scripts/jquery.autocomplete.js" type="text/javascript"></script> <asp:TextBox ID="txtHost" runat='server'></asp:TextBox>

    Read the article

  • Duplicate / Copy records in the same MySQL table

    - by Digits
    Hello, I have been looking for a while now but I can not find an easy solution for my problem. I would like to duplicate a record in a table, but of course, the unique primary key needs to be updated. I have this query: INSERT INTO invoices SELECT * FROM invoices AS iv WHERE iv.ID=XXXXX ON DUPLICATE KEY UPDATE ID = (SELECT MAX(ID)+1 FROM invoices) the proble mis that this just changes the ID of the row instead of copying the row. Does anybody know how to fix this ? Thank you verrry much, Digits //edit: I would like to do this without typing all the field names because the field names can change over time.

    Read the article

  • Large Video Uploads via a website

    - by Andrew
    Some of the problems that can happen are timeouts, disconnections, and not being able to resume a file and having to start from the beginning. Assuming these files are up to around 5gigs in size, what is the best solution for dealing with this problem? I'm using a Drupal 6 install for the website. Some of my constraints due to the server setup I have to deal with: Shared hosting with max 200 connections at a time (unlimited disk space) Shared hosting. Unable to create users through an API (so can't automatically generate ftp accounts) I do have the ability to run cron-type scripts via a Drupal module. My initial thought was to create ftp users based off of Drupal accounts and requiring them to download an ftp client for their OS of choice. But the lack of API to auto-create ftp accounts and the inability to do it from command line kind of hinder that solution. If there's a workaround someone can think of, let me know! Thanks

    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

  • Asking browsers to cache as aggressively as possible

    - by balpha
    This is about a web app that serves images. Since the same request will always return the same image, I want the accessing browsers to cache the images as aggressively as possible. I pretty much want to tell the browser Here's your image. Go ahead and keep it; it's really not going to change for the next couple of days. No need to come back. Really. I promise. I do, so far, set Cache-Control: public, max-age=86400 Last-Modified: (some time ago) Expires: (two days from now) and of course return a 304 not modified if the request has the appropriate If-Modified-Since header. Is there anything else I can do (or anything I should do differently) to get my message across to the browsers? The app is hosted on the Google App Engine, in case that matters.

    Read the article

  • How to remove $ from associate array using Json_decode in php?

    - by Chase
    I am trying to use the youtube API to pulldown some videos for my site. Currently am running this code here: //Youtube Videos Pull Down $youtubeURL = "http://gdata.youtube.com/feeds/api/videos?alt=json&q=cats+cradle+chapel+hill&orderby=published&max-results=10&v=2"; $youtubeSearch = file_get_contents($youtubeURL, true); $youtubeArray = json_decode($youtubeSearch, true); Not having any problems accessing certain elements of the associative array however youtube's api is putting $ in many of its array elements .. such as [media$group] Anytime I try to access an array with one of the $ elements in it, it doesn't work. Suggestions? I have tried preg_replace but can't seem to get my expression right.

    Read the article

  • boost timer usage question

    - by stefita
    I have a really simple question, yet I can't find an answer for it. I guess I am missing something in the usage of the boost timer.hpp. Here is my code, that unfortunately gives me an error message: include <boost/timer.hpp> int main() { boost::timer t; } And the error messages are as follows: /usr/include/boost/timer.hpp: In member function ‘double boost::timer::elapsed_max() const’: /usr/include/boost/timer.hpp:59: error: ‘numeric_limits’ is not a member of ‘std’ /usr/include/boost/timer.hpp:59: error: ‘::max’ has not been declared /usr/include/boost/timer.hpp:59: error: expected primary-expression before ‘double’ /usr/include/boost/timer.hpp:59: error: expected `)' before ‘double’ The used library is boost 1.36 (SUSE 11.1). Thanks in advance!

    Read the article

  • AJAX XMLHttpRequest POST X-Domain

    - by Tom
    Hi Guys, I am sending an AJAX request using POST over X-Domain for a widget we are producing for our website. The problem we are facing is that this is getting blocked. My question is - for "modern browsers" [Chrome, Safari, FF, IE8] - it is my understanding that setting "Access-Control" headers Access-Control-Allow-Origin: http://www.test.com Access-Control-Allow-Methods: POST, GET, OPTIONS Access-Control-Allow-Headers: * Access-Control-Max-Age: 1728000 Will allow these "POST" requests to work ? But for IE7 we need to implement some "custom" JSONP solution? Am I correct in this ?

    Read the article

  • Can't establish a DB connection. (Maybe threads related)

    - by JobGovernor
    Hello, I am getting this exception on the Rufus::Scheduler ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5 seconds. The max pool size is currently 30; consider increasing it. I've increased the pool from 10 to 30. And I also monkey patched the method which raises the exception to also call ActiveRecord::Base.verify_active_connections! before doing its job. And I also restarted the service which executes the script so that the new code is run. Any ideas would be greatly appreciated. Let me know if you need any other info about environment or whatnot. Thank you.

    Read the article

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