duration

Qt seconds to DD HH SS

孤人 提交于 2019-12-06 07:27:51
using Qt 4.8 how can I print the time in the format DD HH SS? I have the seconds and I want to get back a string in that format. cor3ntin QDateTime::fromTime_t(seconds).toString("ss hh DD"); see http://qt-project.org/doc/qt-5.0/qdatetime.html#toString If you want a duration ( your question was really unclear) try something like : QString seconds_to_DHMS(quint32 duration) { QString res; int seconds = (int) (duration % 60); duration /= 60; int minutes = (int) (duration % 60); duration /= 60; int hours = (int) (duration % 24); int days = (int) (duration / 24); if((hours == 0)&&(days == 0)) return

Javascript returns NaN for audio duration depending on request sequence

北城以北 提交于 2019-12-06 06:50:13
问题 I'm very new to Javascript. I haven't had much success finding an answer to my query. Here's a description of the problem. I create an audio element and set the source to an .m4a file. The .m4a file is able to both load and play successfully. I get strange results, however, when requesting the source audio duration. The following javascript produces 'NaN' in Chrome: //Create audio element based on HTML audio id and modify controls accordingly var aud = document.getElementById("storyTime");

How do you calculate an end time based on start time and duration?

邮差的信 提交于 2019-12-06 02:53:31
I'm building a event calendar and pass a start time to PHP, in the format of 2009-09-25 15:00:00. A duration gets passed as well, that might be in the format of 60 minutes or 3 hours. Converting from hours to minutes isn't the problem. How do you add a length of time to an established starting point to correctly format the end time? Using strtotime() you can convert the current time (2009-09-25 15:00:00) to a timestamp and then add (60 * 60 * 3 = 3hrs) to the timestamp. Finally just convert it back to whatever time you want. //Start date $date = '2009-09-25 15:00:00'; //plus time $plus = 60 *

Change jQuery's animation duration during animating

我怕爱的太早我们不能终老 提交于 2019-12-06 00:38:03
问题 Is it possible to change the duration of a currently running jQuery animation between two different values? I've tried to change the duration via direct assignment, but no success: var timing = { duration: 4000 }; $(document).click(function (e) { timing.duration = 1000; }); $('#foo').animate({top:200, left:200}, timing); ...and even, changing the fx.options.duration in step -method does not affect the running animation: var state = false, $(document).click(function (e) { state = true; }); $('

GraphViz Dot very long duration of generation

被刻印的时光 ゝ 提交于 2019-12-05 22:49:32
问题 I have a tree structure I want to be generated by Dot. Each node has 4 edges to another 4 nodes. In sum there are about 1,000 nodes. If I try to generate it with Dot it takes a very long time (once I let it work like for a hour - CPU usage was 100% all the time but it didn't finish). Is there a way to accelerate this? Maybe by setting down the quality? Or using another (faster?) vizualization software? I've attached my Dot file for you to test it on your own machine. Thank you. Dot File: http

Time span calculation for hours and minutes in C#

六眼飞鱼酱① 提交于 2019-12-05 21:58:04
The final result should display the user the time span between the start hour and the end hour.(e.g. start work at 06:30 AM and finished at 18:30 PM, the result to display should be 12 hours). Now, I have to DateTime parameters; fromTime and toTime Each DateTime parameter have an hour in 24 hour format, and also might have a minutes value of 30 min. What I willing to do is to get the time span between those DateTime parameters. For the hours I used this method: Public TimeSpan GetHourSpan(DateTime fromTime, DateTime toTime) { TimeSpan fromH = TimeSpan.FromHours(fromTime.Hour); TimeSpan toH =

iOS- how to get the duration of .mp4 file by using AVAsset or AVURLAsset

左心房为你撑大大i 提交于 2019-12-05 10:49:53
i know duration of video type questions have been answered before but i am facing real trouble in getting duration of an .mp4 file by using AVAsset and by AVURLAsset . i am using Following code NSString *itemPathString = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0] stringByAppendingPathComponent:obmodel.actualname]; NSURL *itemPathURL = [NSURL URLWithString:itemPathString]; if([[NSFileManager defaultManager] fileExistsAtPath:itemPathString]){ NSLog(@"File Exists"); } AVAsset *videoAsset = (AVAsset *)[AVAsset assetWithURL:itemPathURL];

How exactly do Firebase Analytics handle session duration / timeouts?

人盡茶涼 提交于 2019-12-05 06:34:12
I'm implementing some basic usage statistics for the first time in an Android/iOS app using Firebase Analytics, but the docs seem a little ambiguous to me on how exactly session durations are calculated and how sessions are timed out, and the 24-hour cycle for seeing results does not help in understanding by trial-and-error. I'm only interested in a very simple statistic for now - the time users spend in the app. What exactly happens when the app is "minimised"/"in the background" - does that count as active usage or the same as the app being closed - is not so important right now, but if you

Determining the length of a user's visit based on SQL timestamps

本秂侑毒 提交于 2019-12-05 05:02:41
问题 I am divided between using a C# implementation and a pure SQL 2005/2008 implementation. I need to determine the length of usage based on timestamps of their last actions. My table contains "friendID" (uniqueIdentifier) and "lastAction" datetime. Here is an example: Bob, 1:00 PM Bob, 1:01 PM Bob, 1:20 PM Bob, 1:25 PM Jack, 5:00 PM Bob, 11:20 PM I want to "time out" a user if they had 60 minutes of inactivity. If your suggestion works correctly, there should be 3 separate sessions from the data

How do you get an iphone MPMoviePlayer video's total time?

我怕爱的太早我们不能终老 提交于 2019-12-05 01:41:55
问题 I just want to figure out how to get a video's total time in seconds. Is there video metadata that loads or something? 回答1: MPMoviePlayerController has a property duration (iOS 3.2+): The duration of the movie, measured in seconds. (read-only) @property (nonatomic, readonly) NSTimeInterval duration If the duration of the movie is not known, the value in this property is 0.0. If the duration is subsequently determined, this property is updated and a MPMovieDurationAvailableNotification