|
started on Friday 21:00 and stopped Saturday 16:30, so 19,5 hours.
|
|
|
|
|
Not bad!
|
|
|
|
|
A question comes to mind, though : why ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
V. wrote: I reached the 85 km mark, but then the knees stopped bending.
Impressive but I question your sensibility, as you can really create some serious and permanent injury from repetitive stress.
Marc
|
|
|
|
|
yeah still limping today...
|
|
|
|
|
And people say I'm crazy (I'm a runner, and I've done four marathons) ...
Software Zen: delete this;
|
|
|
|
|
Basically I take in a standard URI starting with /me/... like /me/skydrive/folder1/folder2/file and then return the file.
The way it is suppose to work.
All written in visual basic - just to be different.
Programmed using Unidex so feel free to ask what this or that does.
This is a working example that does not need to be debugged
The only thing Unidex does in this example is parses the words from the URI, once you create your own code to put each word in a list you should be able to use this same logic.
'Take in any string, parse the information and returns the file from the users OneDrive
Public Async Function RetrieveFile(FullPath As String) As Task(Of Windows.Storage.IStorageFile)
Dim CurrentFolderInfo As Microsoft.Live.LiveOperationResult
Dim CurrentlyFoundFolders As Microsoft.Live.LiveOperationResult
Dim CurrentlyFoundFiles As Microsoft.Live.LiveOperationResult
Dim FileName = ""
Dim Result As Unidex.Reference.OldStructures.Strings = FullPath
If Result.Items(0).ToLower <> "me" Then Throw New Exception("First word of path must be me!")
Select Case Result.Items(1).ToLower
Case "skydrive" : CurrentFolderInfo = Await Me.GetRootFolder
Case "calendars" : CurrentFolderInfo = Await Me.GetCalendars
Case "contacts" : CurrentFolderInfo = Await Me.GetContacts
Case "events" : CurrentFolderInfo = Await Me.GetEvents
Case Else : Throw New Exception("Second word of path is invalid!")
End Select
CurrentlyFoundFolders = Await Me.GetFolders(CurrentFolderInfo)
For Each Current In Result.Separators
Try
Select Case Current.Separator
Case "/", "\"
Select Case Current.WordBefore
Case "", "me", "skydrive", "calendars", "contacts", "events"
Case Else
CurrentFolderInfo = Await Me.GetFolder(Current.WordBefore, CurrentlyFoundFolders)
CurrentlyFoundFolders = Await Me.GetFolders(CurrentFolderInfo)
End Select
Case "."
CurrentlyFoundFiles = Await Me.GetFiles(CurrentFolderInfo)
FileName = Current.WordBefore & "." & Current.WordAfter
Return Await Me.GetFile(CurrentFolderInfo, FileName)
End Select
Catch
End Try
Next
Throw New Exception("Sequence completed without locating a filename.")
End Function
'Get a Directory
Public Async Function GetFolder(FolderName As String, FolderInfo As ResultsStructure) As Task(Of Microsoft.Live.LiveOperationResult)
Dim SubFolder As ResultsStructure = FolderInfo.Results.FirstOrDefault(Function(f) f.Key = FolderName)
Return Await LiveConnectClient.GetAsync(SubFolder.ID)
End Function
'Get the folders of a directory of any given name
Public Async Function GetFolders(FolderInfo As ResultsStructure) As Task(Of Microsoft.Live.LiveOperationResult)
Return Await LiveConnectClient.GetAsync(FolderInfo.ID & "/files?filter=folders")
End Function
'Get the files of a directory of any given name
Public Async Function GetFiles(FolderInfo As ResultsStructure) As Task(Of Microsoft.Live.LiveOperationResult)
Return Await LiveConnectClient.GetAsync(FolderInfo.ID & "/files")
End Function
'Get the URI of any given file name
Public Async Function GetFile(FolderInfo As ResultsStructure, FileName As String) As Task(Of Microsoft.Live.LiveOperationResult)
Dim File As ResultsStructure = FolderInfo.Results.FirstOrDefault(Function(f) f.Key = FileName)
Return Await LiveConnectClient.GetAsync(File.DownloadPath)
End Function
'Create local target of the file in a temporary folder
Public Async Function TemporaryStorageFile(FileName As String) As Task(Of Windows.Storage.StorageFile)
Return Await Windows.Storage.ApplicationData.Current.TemporaryFolder.CreateFileAsync(FileName, Windows.Storage.CreationCollisionOption.ReplaceExisting)
End Function
'Set as background task for the OS the continue the process
Public Async Function SetBackgroundTask(DownLoadPath As String, OutputFile As Windows.Storage.StorageFile) As Task(Of Microsoft.Live.LiveDownloadOperationResult)
Return Await LiveConnectClient.BackgroundDownloadAsync(DownLoadPath, OutputFile)
End Function
modified 12-Aug-14 2:53am.
|
|
|
|
|
Probably better posted as a Tip/Trick rather than in the lounge!!
|
|
|
|
|
|
Lounge postings disappear rapidly. After 3 months, it'll be hard to find it here and people won't come upon it. A Tip has longevity.
|
|
|
|
|
Where do I find these tips?
|
|
|
|
|
On the front page, or under articles. A tip/trick is a short article. Click the articles menu option and choose "Submit an article or tip" from the dropdown to create your own tip. Just make sure you select Tip/Trick in the appropriate combo on the right hand side.
|
|
|
|
|
|
|
Pete O'Hanlon wrote: On the front page, or under articles. A tip/trick is a short article. Click the articles menu option and choose "Submit an article or tip" from the dropdown to create your own tip. Just make sure you select Tip/Trick in the appropriate combo on the right hand side. Hey, that's useful information.
You should put it on the Tips/Tricks forum.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
ohhh Christan Graus is your man - i'm sure he was talking about pretty much this exact stuff the other day
Drop him a message - hes very helpful
Bryce
MCAD
---
|
|
|
|
|
The Microsoft documentation is horrifying to get this job done, this here is a working example for people in how to achieve something that Microsoft Virtual Academy said had to be done using URI relative to a single file and you couldn't navigate through the OneDrive like any other folder.
|
|
|
|
|
|
Again? He died earlier today too!!
|
|
|
|
|
Oops didn't see the post
We can’t stop here, this is bat country - Hunter S Thompson RIP
|
|
|
|
|
|
pkfox wrote: Very funny crazy man
For killing himself
|
|
|
|
|
I used 7 Zip because, when I upload as Zip it says :"one or more file cannot upload". When I upload the zip file it doesn't give the link to download the source link up side of the article. Do I want to give the link manually or any other methods to do that ?
Gihan Liyanage
http://gihansampathliyanage.wordpress.com
|
|
|
|
|
Why are you using 7Zip, I have found that to be flaky in past with some systems.
If you are on Windows box, simply select all the files in a folder you want to include in the zip and use the right click Send To compressed folder. upload that file.
|
|
|
|