Plugins in ViewModel - plugins

I'm new on MvvmCross and I want to use my plugin in my Model/ViewMode. I use the v3.
In some example I see IMvxServiceConsumer and GetService, but I guess that is the annotation for vNext but it seems to be different in the v3.
So, how can I do that?
Thanks

IMvxServiceConsumer<T> and GetService<T> were replaced with Mvx.Resolve<T> in v3.
Further, v3 provides constructor injection of dependencies - see http://slodge.blogspot.co.uk/2013/03/v3-new-viewmodel-lifecycle.html for information about how this decision was reached.
For plugins, N=8 in the tutorial series gives a quick and easy introduction to using the Location plugin. For more info see:
blog - http://slodge.blogspot.co.uk/2013/05/n8-location-location-location-n1-days.html
youtube - https://www.youtube.com/watch?v=AomjbED9AzM&list=PLR6WI6W1JdeYSXLbm58jwAKYT7RQR31-W&index=10
If you want to write a new plugin, then :
the up-to-date sample is https://github.com/slodge/MvvmCross-Tutorials/tree/master/GoodVibrations
there are some notes on this sample in https://speakerdeck.com/cirrious/plugins-in-mvvmcross

Related

OpenAPI (aka Swagger) in Azure Functions V2

I'm creating a V2 Function App and want to use Swagger/Open API for docs, however it is not yet supported in the Azure Portal for V2 Functions.
Any suggestions on how I can use Swagger with V2 Functions in VSTS to create the docs on each build?
TL;DR - Use the NuGet package to render Open API document and Swagger UI through Azure Functions.
UPDATE (2021-06-04)
Microsoft recently announced the OpenAPI support on Azure Functions during the //Build event.
The Aliencube extension has now been archived and no longer supported. Please use this official extension.
As of today, it's in preview. Although it's in preview, it has more features than the Aliencube one.
Acknowledgement 2: I am still maintaining the official one.
Microsoft hasn’t officially started supporting Open API (or Swagger) yet. But there is a community-driven NuGet package currently available:
Nuget > Aliencube.AzureFunctions.Extensions.OpenApi
And here’s the blog post for it:
Introducing Swagger UI on Azure Functions
Basically its usage is similar to Swashbuckle — using decorators. And it supports both Azure Functions V1 and V2.
Acknowledgement 1: I am the owner of the NuGet package.
For anyone looking into this, Microsoft still hasn't added Open API support for Azure Functions +v2 and there hasn't been any major movement toward it.
I faced this same issue recently and I found a pretty good solution.
If you aren't aware yet, check this out: https://github.com/RicoSuter/NSwag
NSwag is a toolchain that integrates with .NET to produce the Open API documentation and UI, but also generates the respective API clients for you.
I've used this tool for the past 2 years when working with Angular and .NET apps, it saves a lot of time and seamlessly integrates with my whole development workflow.
For Azure Functions +v2, a contributor created a generator that in less than 10 lines of code, allow us to expose the Swagger endpoint for an Azure Function class:
https://github.com/Jusas/NSwag.AzureFunctionsV2
Now, if you design HTTP-Triggered Functions using DI, grouping related operations under the same class and leveraging model binding, you might not even need to apply any custom decorator, it just works!
Here's an example of how one real API would look like:
(ignore the base class. It is part of a personal pattern I follow, unrelated to Swagger)
And this is how it looks like using a swagger UI:
There is official library Azure Functions OpenAPI Extension. It is still in preview, but looks great.
Can you drop your V2 Function to run on v1 of the runtime by starting over with a blank function app first?
The MSDN documents for Create an OpenAPI definition for a function (with a date of 11/2018 interestingly enough) example states:
By default, the function app you create uses version 2.x of the
runtime. You must set the runtime version back to 1.x before you
create your function.
But one can't just move the setting to 1:
To pin your function app to the version 1.x runtime, choose ~1 under
Runtime version. This switch is disabled when you have functions in
your app.
Which implies one must create the Function app, publish/create it, set it to V1 and then put in a function before adding a function app.

Which is The best datepicker for jHipster?

I want to use datepicker in jHipster v4.8.2 project with Angular 4. I tried this answer
but it didn't work. I would be thankful if you have an idea.
As mentioned here you can use NgbTimepicker on "Instant" (= a java.time.Instant object), which jhipster.tech recommends to be most probably used instead of a "ZonedDateTime" (see Field types), or use the PrimeNG support - here you can see a code example in detail.
You can also find my PrimeNG calendar-module implementation here - trying to get the example app from Full Stack Development with JHipster done.

What is the 'transaction' command in Firebase-Unity Plugin?

I'm trying to use Firebase-Unity plugin. (https://www.firebase.com/blog/2015-12-18-firebase-unity.html)
Does anybody know what is the transaction command in this plugin?
Is it implemented in the plugin? If yes, can I see the sample code?
The Firebase-Unity plugin does not expose the complete underlying SDK functionality. The transaction() method of the Firebase SDK is one of the methods that is not exposed.
The author of the plugin recently commented somewhere on how to add such methods yourself. I'll see if I can find that link for you.
The tutorial that you've linked, https://www.firebase.com/blog/2015-12-18-firebase-unity.html is a good tutorial if not missing some steps.
Try this library out while following the tutorial above from Firebase: https://github.com/firebase/Firebase-Unity
Does that help?

RichTextToolbar in GWT 2.3

I'm trying to create a RichTextArea (following the GWT Showcase : link )
When I do a code completion of RichTextToolbar, I'm not able to find it. Is this an external library?
And then I googled and found this : google code link. Is this the same library in the Google Showcase? Or is the RichTextToolbar is an old implementation that not being brought to version 2.3?
Update:I tested this and what I feel is although the implementation the same, the UI looks different though.
It seems that they created their own version of RichTextToolbar.
This class is part of the GWT Showcase.
Here is a decent explanation to get the RichTextToolbar working. You take the source code from showcase basicaly.
http://www.jeanhsu.com/2010/06/10/how-to-use-richtexttoolbar-in-gwt/

TeamCity - how to get currently running builds via REST API?

Does anyone know how to use the TeamCity REST API to find out which builds are currently running, and how far through they are (elapsed time vs estimated time)?
The URL returns what you are asking for, including percentage complete.
http://teamcityserver/httpAuth/app/rest/builds?locator=running:true
<builds count="1">
<build id="10" number="8" running="true" percentageComplete="24" status="SUCCESS" buildTypeId="bt3" startDate="20110714T210916+1200" href="/httpAuth/app/rest/builds/id:10" webUrl="http://phillipn02:29000/viewLog.html?buildId=10&buildTypeId=bt3"/>
</builds>
Source: http://devnet.jetbrains.net/message/5291132#5291132.
The relevant line on the REST API documentation is the one that reads "http://teamcity:8111/httpAuth/app/rest/builds/?locator= - to get builds by "build locator"." in the "Usage" section.
This works with TeamCity version 6.5; I haven't tried it on earlier versions, but I suspect it will work back to version 5.
You can use "running:true/false/any" as one of the build dimensions for the build locator. (EDIT: added in TeamCity 6.0)
http://confluence.jetbrains.net/display/TW/REST+API+Plugin
The TeamCity REST API documentation will give you some examples of some of the ways you can construct the URL. The Build Locator section on that page will list the different options you have for refining your results (one of which is running).
However, I don't know of a way to get information about the running builds elapsed/estimated time using the REST API. I'm not sure if this would be possible. If you did find a way to do this, I would be be very interested to read how!
Good luck!
I realise your question is more than five years old, but you wanted
to find out which builds are currently running, and how far through they are (elapsed time vs estimated time)
The method as suggested in the accepted answer only gives the percentageComplete attribute, which is not as useful without having to make another call to the API.
It can be achieved by supplying the fields request parameter to the url, e.g.:
serverUrl/httpAuth/app/rest/builds/?locator=running:true&fields=count,build({buildFields})
where {buildFields} are properties of the builds object. For this, I am using:
id,buildTypeId,number,status,branchName,startDate,queuedDate,href,running-info
The full url is then
serverUrl/httpAuth/app/rest/builds/?locator=running:true&fields=count,build(id,buildTypeId,number,status,branchName,startDate,queuedDate,href,running-info)
which returns something like
<builds count="1">
<build id="128990" buildTypeId="{build type ID}" number="256" status="SUCCESS" branchName="{branch name}" href="/httpAuth/app/rest/builds/id:128990">
<running-info percentageComplete="6" elapsedSeconds="52" estimatedTotalSeconds="924" currentStageText="{status}" outdated="false" probablyHanging="false"/>
<queuedDate>20160421T102558+0100</queuedDate>
<startDate>20160421T105709+0100</startDate>
</build>
</builds>
which will give you the percentage complete and elapsed/estimated total times in the running-info element.
Note: I am using TeamCity 9; the fields request parameter appears to be present in the documentation for TeamCity 5.x-7.x but the output may not be quite the same.
I did a little digging and a post on JetBrain's site stating that support for the running:true was actually added for TC6. TeamCity 5.X REST documentation just links to a different page which doesn't specify what was supported in TC5 and what is new to TC6.
EDIT: Hey Matt, I posted a question inquiring about REST documentation specific to TC 5.X. I know it would be very handy for me to know what exactly what I can do with REST for the version of TeamCity I am using and thought it may interest you as well!
You have a variant use not api -
[http://teamcity/ajax.html?getRunningBuilds=1]
So it's not good variant, but for me it's very good!