duration

calculate time taken to cover a journey in Apple Maps

*爱你&永不变心* 提交于 2019-12-02 05:05:48
I am working on MKMapView to get the direction between 2 locations.Is there any way i can get the time it may take in completing this journey?Is there any inbuilt property of MKRoute or MKDirection Class that can provide me time to cover this journey ? Any help would be appreciated. Thanks Vikas Yes. The MKDirections method named calculateETAWithCompletionHandler: can just be a bit easy to overlook, though. An implementation could look as follows: MKDirections *yourDirections = ...; [yourDirections calculateETAWithCompletionHandler:^(MKETAResponse *response, NSError *error) { NSTimeInterval

How to dynamically adjust the duration/speed of a Tween Animation in Android

℡╲_俬逩灬. 提交于 2019-12-02 04:57:46
Let's say I have an android app, and in that app I want to animate a graphic of a ball in an "L" shape. This would require me to define a Tween Animation where I create an animation xml file (written below) and apply it to a View which has the ball graphic in it. <translate> Ydelta = 20; offset = 0; duration = 100; </translate> <translate> Xdelta = 20; offset = 100; duration = 100; </translate> Now lets say I want to control the speed of this animation dynamically so that over time, the L animation goes faster and faster and faster. How can I dynamically control the speed of this whole

Wrong DURATION in MediaStore.Video.Media.DURATION

扶醉桌前 提交于 2019-12-02 03:59:11
I'm trying to record video in my application and I've noticed that displaying their duration , I see wrong minutes \ seconds. This happens only with the video recorded trough the following code. With the video recorded through other apps, the duration is displayed right: public void recordStream() { //Release Camera before MediaRecorder start releaseCamera(); if(!prepareMediaRecorder()){ Toast.makeText(MainActivity.this, "Fail in prepareMediaRecorder()!\n - Ended -", Toast.LENGTH_LONG).show(); } mediaRecorder.start(); } } private boolean prepareMediaRecorder(){ myCamera = getCameraInstance();

What is the value of the ISO 8601 duration `P1M` (in seconds)?

▼魔方 西西 提交于 2019-12-01 22:16:37
Suppose I have an ISO 8601 duration, expressed as "P1M" . Phrased colloquially, this means "one month." Is there a standard rule for converting this into a number of seconds, assuming the start date is not known? For 30-day months, it might be 2,592,000. For 31-day months, it might be 2,678,400. In February, it might be 2,419,200 or it might be 2,505,600. My gut says there's no way to resolve "one month" to an exact number of seconds without knowing context, and where those seconds are laid out on the calendar. But are there standard rules/conventions to calculate these durations in an

Converting Timestamp string “HH:mm:ss” to Duration

橙三吉。 提交于 2019-12-01 20:14:13
Just like the title says, I've been able to isolate from a text file a string containing a duration in the format of "HH:mm:ss." How would I go about converting it to a duration? I need to convert it to a double that expresses this timestamp in terms of 1 hour, so if it's "08:30:00" I need the double to have a value of 8.5. Not sure exactly how to go about converting it, seems that time is a tricky subject in Java. Any help would be greatly appreciated, even if it's just you saying "use this class" so I can look it up and figure it out. Thanks! You can split the expression into parts then

Converting Timestamp string “HH:mm:ss” to Duration

╄→гoц情女王★ 提交于 2019-12-01 19:31:10
问题 Just like the title says, I've been able to isolate from a text file a string containing a duration in the format of "HH:mm:ss." How would I go about converting it to a duration? I need to convert it to a double that expresses this timestamp in terms of 1 hour, so if it's "08:30:00" I need the double to have a value of 8.5. Not sure exactly how to go about converting it, seems that time is a tricky subject in Java. Any help would be greatly appreciated, even if it's just you saying "use this

Groovy: Get duration in years

為{幸葍}努か 提交于 2019-12-01 18:15:13
On running the following code in groovy - import groovy.time.* import org.codehaus.groovy.runtime.TimeCategory def today = new Date() use(TimeCategory) { def modifiedToday = today.plus(10.minutes) modifiedToday = modifiedToday.plus(10.months) modifiedToday = modifiedToday.plus(10.years) def duration = modifiedToday - today println duration.years println duration.months println duration.days println duration.minutes } I am getting the following output - 0 0 3956 10 Please suggest, why am I getting years and months as 0 and all the value in days. How do I get the value in years and months? How

Getting MP4 File Duration with DirectShow

自作多情 提交于 2019-12-01 14:15:07
I need to get the duration of an mp4 file, preferably as a double in seconds. I was using DirectShow (see code below), but it keeps throwing a particularly unhelpful error. I'm wondering if someone has an easy solution to this. (Seriously, who knew that getting that information would be so difficult) public static void getDuration(string moviePath) { FilgraphManager m_objFilterGraph = null; m_objFilterGraph = new FilgraphManager(); m_objFilterGraph.RenderFile(moviePath); IMediaPosition m_objMediaPosition = null; m_objMediaPosition = m_objFilterGraph as IMediaPosition; Console.WriteLine(m

Getting MP4 File Duration with DirectShow

左心房为你撑大大i 提交于 2019-12-01 12:34:56
问题 I need to get the duration of an mp4 file, preferably as a double in seconds. I was using DirectShow (see code below), but it keeps throwing a particularly unhelpful error. I'm wondering if someone has an easy solution to this. (Seriously, who knew that getting that information would be so difficult) public static void getDuration(string moviePath) { FilgraphManager m_objFilterGraph = null; m_objFilterGraph = new FilgraphManager(); m_objFilterGraph.RenderFile(moviePath); IMediaPosition m

Add multiple DateTime Duration strings together using JavaScript to get total duration

本小妞迷上赌 提交于 2019-12-01 09:56:59
问题 I have an HTML Table used to generate a Calendar which shows TimeClock entries for each day a user has worked and clocked in and out of the system. Each day also shows the total time duration for each clock in/out entry. (multiple "timecard punches" can be within the same day) Simply put I have DateTime style strings which hold a Duration value and I need to add them all together to get a combined duration value. In a loop this JavaScript variable totalTimeValue will be assigned a duration