Search Results

Search found 17788 results on 712 pages for 'last'.

Page 52/712 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • jQuery's blur() and selector problem

    - by matthewayinde
    I'm trying to create a new div each time a text field contained in the last div loses focus, but a new div is added only when the text field in the first div loses focus (instead of the last)... Please I need help urgently. Thanks a lot. Here's my code: $(function() { $(':text:last').blur(function() { $('<div class="line"><span>data: </span><input type="text"/></div>') .appendTo($('#lineStack')); }); }); HTML: <div id="lineStack"> <div class="line"> <span>data: </span><input type="text" /> </div> </div>

    Read the article

  • Animation in quartz 2D

    - by coure06
    I want to create an app which after each 1 second will show 4-5 words on screen but the last word will zoom out/in. I can easily create static words and for the last animating word i need to draw the static again n again. How can i create 2 separate layers so the static text is on one layer ( i will fill it after each second) and the last word (animated one) will be on other layer. How to create 2 separate layers? Attached on same screen but handling their drawRect method separately?

    Read the article

  • css, jquery issue

    - by wadada
    I was playing with Infogrid on my site. I added a header, a footer and added some text on the last block of iron man. As you can see the footer doesn't show up and the text of the last block is cut off. Now if you remove overflow:hidden; on the body, html the footer shows up but the text is still cut off. Any idea on how this the footer could show up without the scrollbar (so overflow:hidden; has to stay) and how to get the text of the last block to show up entirely? Thanks in advance and have fun :) wadada

    Read the article

  • How to initialize an Object?

    - by John
    I have a class like this, public class person { name Name {set; get;} string Address {set; get;} } public class name { string First {set; get;} string Last {set; get;} } Now when I create the object an try to set the first or last name I get an error. "Object reference not set to an instance of an object." person Person = new person(); Person.Name.First = "John"; Person.Name.Last ="Smith"; What am I doing wrong?

    Read the article

  • How to show unread subforums?

    - by bilygates
    I have written a simple forum in PHP using PostgreSQL. The forum consists of a number of subforums (or categories, if you like) that contain topics. I have a table that stores when was the last time a user visited a topic. It's something like this: user_id, topic_id, timestamp. I can easily determine what topics should be marked as unread by comparing the timestamp of the last topic reply with the timestamp of the last user visit. My question is: how do I efficiently determine what subforums (categories) should be marked as unread? All I've come up with is this: every time a user visits a topic, update the visit timestamp and check if all the topics from the current subforum are read or unread. If they are all read, mark the subforum as read for the user. Else, mark it as unread. But I think there must be another way. Thank you in advance.

    Read the article

  • Handling "Big" Integers in C#

    - by priyanka.sarkar
    How do I handle big integers in C#? I have a function that will give me the product of divisors: private static int GetDivisorProduct(int N, int product) { for (int i = 1; i < N; i++) { if (N % i == 0) { Console.WriteLine(i.ToString()); product *= i; } } return product; } The calling function is GetDivisorProduct(N, 1) If the result is bigger than 4 digits , I should obtain only the last 4 digits. ( E.g. If I give an input of 957, the output is 7493 after trimming out only the last four values. The actual result is 876467493.). Other sample inputs: If I give 10000, the output is 0. The BigInteger class has been removed from the C# library! How can I get the last four digits?

    Read the article

  • How to return focus from GridView or DataGrid to other control on the page

    - by Senthilkumar
    I Want to know how to focus to control after completing tab navigation for the grid view. I have certain controls in my page and GridView/DataGrid as last control, when I navigate (Tab key navigation) on my page. I can navigate from first control to GridView but when I finish all editable items in grid the tab control goes to browser address bar. I need this should focus to again first control on the page. My question is how can I do this? If it is an ordinary controls then I can use (on key down) attribute of the same.. here how can I get access to the last row's last column on the grid view.

    Read the article

  • Find subset with K elements that are closest to eachother

    - by Nima
    Given an array of integers size N, how can you efficiently find a subset of size K with elements that are closest to each other? Let the closeness for a subset (x1,x2,x3,..xk) be defined as: 2 <= N <= 10^5 2 <= K <= N constraints: Array may contain duplicates and is not guaranteed to be sorted. My brute force solution is very slow for large N, and it doesn't check if there's more than 1 solution: N = input() K = input() assert 2 <= N <= 10**5 assert 2 <= K <= N a = [] for i in xrange(0, N): a.append(input()) a.sort() minimum = sys.maxint startindex = 0 for i in xrange(0,N-K+1): last = i + K tmp = 0 for j in xrange(i, last): for l in xrange(j+1, last): tmp += abs(a[j]-a[l]) if(tmp > minimum): break if(tmp < minimum): minimum = tmp startindex = i #end index = startindex + K? Examples: N = 7 K = 3 array = [10,100,300,200,1000,20,30] result = [10,20,30] N = 10 K = 4 array = [1,2,3,4,10,20,30,40,100,200] result = [1,2,3,4]

    Read the article

  • time difference on heroku server

    - by railsnew
    There seems to be a time difference on heroku server. >> Customer.last.id => 584 >> Customer.last.created_at => Thu, 06 May 2010 01:43:20 UTC +00:00 >> Time.zone => #<ActiveSupport::TimeZone:0x2b1dec47e5c0 @utc_offset=0, @tzinfo=#<TZInfo::DataTimezone: Etc/UTC>, @name="UTC"> >> Time.now => Wed May 05 19:05:15 -0700 2010 >> Time.now.zone => "PDT" Notice that current time is May 05 19...however, created_at date for last record is May 06 01:43. This does not make any sense. What can be causing this and how would I go about fixing this?

    Read the article

  • Drupal and Login Toboggan -- infinite redirect loop

    - by Ian Silber
    I'm getting a redirect loop when using Login Toboggan. It doesn't happen all of the time and I think I've narrowed it down to something with the session, specifically the active-tabs[last-active-href] value. Since it's intermittent, I was able to print out a session of a working copy and a non-working copy. Here are both: WORKS -- Array ( [active-tabs] = Array ( [last-active-href] = index ) ) toboggan/denied DOESN'T WORK -- Array ( [active-tabs] = Array ( [last-active-href] = user/register [user] = user/register ) [wantsEvents] = [wantsResources] = [wantsSupport] = ) toboggan/denied I've also noticed that if I comment out the following line the redirection loop stops (although no page loads): $return = menu_execute_active_handler('user/register'); Any ideas? I'm at my wits end.

    Read the article

  • Communicating from website to desktop application (not vice-versa)

    - by chakrit
    I am designing an application such that it will have to react to certain actions required by the website, mostly the same way Last.FM client does (if you have used one) The way Last.FM client works is that, it will register a custom protocol in Windows (lastfm://) and on their website, they use that protocol to trigger certain action on the player, e.g.: lastfm://artist//similarartists will actually direct any Last.FM client running to load up similar artists. I would like to do the same thing for my application. Is this a good idea? Is there any good alternatives to send a message from a website to a desktop client in this manner?

    Read the article

  • How to compare if string has a enter key in the end using jquery/javascript?

    - by user144842
    I have a string value from a user input box. I have to figure out if last char is a enter key (line feed). Thats the code. Here I am checking if last char has a whitespace. Now I also have to check if last char is enter key (carriage return or line feed). How can i do this? var txt = $get("<%= txtUserText.ClientID %>"); if (txt.value.substring(txt.value.length -1) !== ' ' || <checkifLastCharIsEnterKey>) //my code to take action **I don't think i need a keypress or keyup event because this above piece of code is not invoked at the time of user input.

    Read the article

  • How and when to log account access login with PHP?

    - by Nazgulled
    I want to implement a basic login system in some PHP app where no cookies will be involved. I mean, the user closes the browser and the login expires, it will remain active during the browser session (or if the user explicitly logs out) otherwise. I want to log all this activity and I'm thinking that every time the user refreshes the page, opens a different link or logs out, I record that time as the last access made by that user, overwriting the previous access log. But my problem is when and how should I insert another record into the database instead of overwriting the last one? Should I just define a timeout and if the last access was made above that timeout, another log should be inserted into the database? Should the session expire too after that timeout? Or is there a better way? Ideally, I would like to log the "log out action" when the browser was closed, but I don't think there's a way to detect that is there? Suggestions?

    Read the article

  • DOM class injection in PHP

    - by Adam Kiss
    idea Via jQuery, I was able to mark all :first-child and :last-child elements in document (well, almost all :)) with class first which could I later style (i.e. first li in ul#navigation would be easily adressable as ul#navigation .first). I used following code: var $f = $('*:first-child') $f.addClass('first'); var $l = $('body *:last-child') $l.addClass('last'); question Now, my question is if it's possible to do the same via php, so non-JS users/gadgets could have the same effects and additional styling and also it would be less overkill on browser. So, is it possible to capture output, parse it as html and inject this class easily in php?

    Read the article

  • mysql LAST_INSERT_ID() used with multiple records INSERT statement

    - by bogdan
    Hello, If i insert multiple records with a loop that executes a single record insert, the last insert id returned is, as expected, the last one... but if i do a multiple records insert statement: INSERT INTO people (name,age) VALUES('William',25),('Bart',15),('Mary',12); let's say the three above are the first records inserted in the table...after the insert statement i expected last insert id to return 3, but it returned 1...the first insert id for the statement in question... So can someone please confirm if this is the normal behavior of LAST_INSERT_ID() in the context of multiple records INSERT statements...so i can base my code on it thanks :)

    Read the article

  • Shell Script- each unique user

    - by Dinis Monteiro
    Hi guys I need "for each unique user, report which group they are a member of and when they last logged in" so i have: #!/bin/sh echo "Your initial login:" who | cut -d' ' -f1 | sort | uniq echo "Now is logged:" whoami echo "Group ID:" id -G $whoami case $1 in "-l") last -Fn 10 | tr -s " " ;; *) last -Fn 10 | tr -s " " | egrep -v '(^reboot)|(^$)|(^wtmp a)|(^ftp)' | cut -d" " -f1,5,7 | sort -uM | uniq -c esac My question is: how i can show the each unique user? the script above only show the more recent user logged in the system, but i need all unique users. anyone can help? thanks

    Read the article

  • Taking out a subpart from Enumerable

    - by sawa
    I often want to take out a subpart from an Enumerable. The subpart is sometimes at the beginning and sometimes the end of the original Enumerable instance, and the length used to specify the subpart is sometimes that of the subpart and sometimes its complement. That gives four possibilities, but I only know how to do three of them. Is there a way to do the fourth one? Getting the first n elements: [1, 2, 3, 4, 5].first(3) #= [1, 2, 3] or [1, 2, 3, 4, 5].take(3) #= [1, 2, 3] Dropping the first n elements: [1, 2, 3, 4, 5].drop(3) #= [4, 5] Getting the last n elements: [1, 2, 3, 4, 5].last(3) #= [3, 4, 5] Dropping the last n elements: [1, 2, 3, 4, 5].some_method(3) #= [1, 2]

    Read the article

  • How do I *really* justify a horizontal menu in HTML+CSS?

    - by flight
    You find plenty of tutorials on menu bars in HTML, but for this specific (though IMHO generic) case, I haven't found any decent solution: # THE MENU ITEMS SHOULD BE JUSTIFIED JUST AS PLAIN TEXT WOULD BE # # ^ ^ # # There's an varying number of text-only menu items and the page layout is fluid. # # The first menu item should be left-aligned, the last menu item should be right- # # aligned. The remaining items should be spread optimal on the menu bar. # # # # The number is varying,so there's no chance to pre-calculate the optimal widths. # # # # Note that a TABLE won't work here as well: # # - If you center all TDs, the first and the last item aren't aligned correctly. # # - If you left-align and right-align the first resp. the last items, the spacing # # will be sub-optimal. # Isn't it strange that there is no obvious way to implement this in a clean way by using HTML+CSS?

    Read the article

  • MySQL, return only rows where there are duplicates among two columns.

    - by Richard Waite
    I have a table in MySQL of contact information ; first name, last name, address, etc. I would like to run a query on this table that will return only rows with first and last name combinations which appear in the table more than once. I do not want to group the "duplicates" (which may only be duplicates of the first and last name, but not other information like address or birthdate) - I want to return all the "duplicate" rows so I can look over the results and determine if they are dupes or not. This seemed like it would be a simple thing to do, but it has not been. Every solution I can find either groups the dupes and gives me a count only (which is not useful for what I need to do with the results) or doesn't work at all. Is this kind of logic even possible in a query ? Should I try and do this in Python or something?

    Read the article

  • Navigation Bar color doesn't change back? iOS7

    - by TKP
    I have several tableviews with navigation controller. The navigation bar is white for all the views except the last one, which is red. I have [[[self navigationController] navigationBar] setTintColor:[UIColor redColor]; in the viewDidLoad of the last tableview and [[[self navigationController] navigationBar] setTintColor:[UIColor whiteColor]; in the viewDidLoad of other table views. It works fine until I get to the last view and the color of the navigation bar changes to red. When I go back to the previous views, all the previous views' navigation bar has changed to red. Where should I put those codes so the color will remain unchanged? Thanks,

    Read the article

  • pagination using php with mysql data

    - by pradeep
    i am trying to create a pagination in which there are 5 items at a time depending on the number of items in DB. i wrote this code . but i dono how to go further .its buggy..any better pagination or alteration for this <?php $myresult .= "<div class='pagination' >"; if ($pagenum == 1) { } else { $pagenum = 1; $myresult .= "<a href='javascript:newPage(\"".$pagenum."\")'>&nbsp;first&nbsp;</a>"; $myresult .= " "; $previous = $pagenum-1; $myresult .= "<a href='javascript:newPage(\"".$previous."\")'> &nbsp;Prev&nbsp;</a>"; if ($pagenum == $last) { $previous3 = $pagenum-4; $myresult .= "<a href='javascript:newPage(\"".$previous3."\")'> &nbsp; $previous3 &nbsp;</a>"; $previous2 = $pagenum-3; $myresult .= "<a href='javascript:newPage(\"".$previous2."\")'> &nbsp; $previous2 &nbsp;</a>"; } if ($pagenum > 2) { $previous1 = $pagenum-2; $myresult .= "<a href='javascript:newPage(\"".$previous1."\")'> &nbsp; $previous1 &nbsp;</a>"; } if ($pagenum > 1) { $previous2 = $pagenum-1; $myresult .= "<a href='javascript:newPage(\"".$previous2."\")'> &nbsp; $previous2 &nbsp;</a>"; $myresult .= " "; } } $myresult .= "<span class=\"disabled\"> $pagenum </span>"; if ($pagenum == $last) { } else { if($pagenum < $last - 1) { $next = $pagenum+1; $myresult .= "<a href='javascript:newPage(\"".$next."\")'>&nbsp; $next &nbsp;</a>"; } if($pagenum < $last - 2) { $next1 = $pagenum+2; $myresult .= "<a href='javascript:newPage(\"".$next1."\")'> &nbsp; $next1 &nbsp;</a>"; } if($pagenum == 1 ) { $next2 = $pagenum+3; $myresult .= "<a href='javascript:newPage(\"".$next2."\")'> &nbsp; $next2 &nbsp;</a>"; $next3 = $pagenum+4; $myresult .= "<a href='javascript:newPage(\"".$next3."\")'> &nbsp; $next3 &nbsp;</a>"; } if($pagenum == 2 ) { $next2 = $pagenum+3; $myresult .= "<a href='javascript:newPage(\"".$next2."\")'> &nbsp; $next2 &nbsp;</a>"; } $next = $pagenum+1; $myresult .= "<a href='javascript:newPage(\"".$next."\")'>&nbsp;Next&nbsp;</a>"; $myresult .= "<a href='javascript:newPage(\"".$last."\")'>&nbsp;Last</a>"; } $myresult .= "</div>"; $myresult .= "</br>"; ?>

    Read the article

  • How to check whether iterators form a contiguous memory zone?

    - by Vincent
    I currently have the following function to read an array or a vector of raw data (_readStream is a std::ifstream) : template<typename IteratorType> inline bool MyClass::readRawData( const IteratorType& first, const IteratorType& last, typename std::iterator_traits<IteratorType>::iterator_category* = nullptr ) { _readStream.read(reinterpret_cast<char*>(&*first), (last-first)*sizeof(*first)); return _readStream.good(); } First question : does this function seem ok for you ? As we read directly a block of memory, it will only work if the memory block from first to last is contiguous in memory. How to check that ?

    Read the article

  • Importing data from a text file using python

    - by Will
    I have a text file containing data in rows and columns (~17000 rows in total). Each column is a uniform number of characters long, with the 'unused' characters filled in by spaces. For example, the first column is 11 characters long, but the last four characters in that column are always spaces (so that it appears to be a nice column when viewed with a text editor). Sometimes it's more than four if the entry is less than 7 characters. The columns are not otherwise separated by commas, tabs, or spaces. They are also not all the same number of characters (the first two are 11, the next two are 8 and the last one is 5 - but again, some are spaces). What I want to do is import the entires (which are numbers) in the last two columns if the second column contains the string 'OW' somewhere in it. Any help would be greatly appreciated.

    Read the article

  • HABTM checking for match of latest 3

    - by user333614
    Here's an interesting one for you folks... I have a HABTM (has_and_belongs_to_many) relationship between "Dogs" and "Trips". My goal is to find two result sets: 1) Dogs that have been on at least 1 of the last 3 trips and call that @dogs_current 2) Dogs that have NOT been on any of the last 3 trips and call that @dogs_old I found that I can find what the last 3 trips are by doing this in the Trip model: named_scope :last3, :order => 'date DESC', :limit => 3 But not sure how to use that list get 1 and 2. This hack works, but it seems ugly. There must be a better way! :) @dogs_current = [] @dogs_old = [] @dogs.each do |dog| if (Trip.last3 - dog.trips).size < 3 then @dogs_current << dog else @dogs_old << dog end end Any ideas? Thanks! -Cam

    Read the article

  • deleting unaccessed files using python

    - by damon
    My django app parses some files uploaded by the user.It is possible that the file uploaded by the user may remain in the server for a long time ,without it being parsed by the app.This can increase in size if a lot of users upload a lot of files. I need to delete those files not recently parsed by the app -say not accessed for last 24 hours.I tried like this import os import time dirname = MEDIA_ROOT+my_folder filenames = os.listdir(dirname) filenames = [os.path.join(dirname,filename) for filename in filenames] for filename in filenames: last_access = os.stat(filename).st_atime #secs since epoch rtime = time.asctime(time.localtime(last_access)) print filename+'----'+rtime This shows the last accessed times for each file..But I am not sure how I can test if the file access time was within the last 24 hours..Can somebody help me out?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >