How to upgrade _setCustomVar to Universal Analytics - universal-analytics

I have look at the Universal Analytics without finding the correct answer to my problem.
How do I update this line from the old Analytics to the new Universal Analytics?
_gaq.push(["_setCustomVar", 1, "splittest", "control", 1]);

Custom variables have been replaced by custom dimensions in analytics.js and Universal Analytics:
ga('set', 'dimension1', 'control');
You can read more about replacing custom variables with custom dimension here

Related

How can I set tflite PoseNet "Single-Person Pose Estimation" on Flutter?

I'm on a project that uses tflite Posenet to run on a mobile with Flutter Framework. We wanted more precision score on our tests, but we realized that the repository which is given us by the original example on Dart API docs https://pub.dev/documentation/tflite/latest/ uses Multi-Person Pose Estimation by defalt. (Repository mentioned:https://github.com/shaqian/flutter_realtime_detection).
We know that the original tfjs repository talks about it and give examples https://github.com/tensorflow/tfjs-models/tree/master/posenet but we can't find it on Dart API for flutter.
How can I set Single-Person Pose Estimation?
There is another tflite_flutter plugin which is actively being developed: https://pub.dev/packages/tflite_flutter. Please take a look.
This plugin allows you to run any custom .tflite model, so you should be able to download the single person posenet model provided from the official TFLite site here: https://www.tensorflow.org/lite/models/pose_estimation/overview.
There aren't any official flutter examples, but you should be able to refer to the Android/iOS examples to see how to pre-process / post-process the data.
Hy guys, updating the issue:
We maneged it after some tests with the Tflite.runPoseNetOnImage function. This function has a property called numResults, wich we can set to "1". Tflite.runPoseNetOnFrame has the same property.
You can see it in this link (https://pub.dev/documentation/tflite/latest/)

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.

Plugins in ViewModel

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

Using charts in iPhone applications

I want to add charts feature in my application..
I have gone through with various links in OLD posts.Most of the links are not working.
And I am unable to checkout core plot API with below link
core plot api
getting error Server sent unexpected return value (405 Method Not Allowed)
So can any one suggest OR provide link for Any latest libraries or API which i can use ?
Thanks.
You can download latest Core Plot chart library release from this link:
https://code.google.com/p/core-plot/downloads/detail?name=CorePlot_1.1.zip&can=2&q=
You will get core clot library and an example using the above downloaded link.
Below is the link for instructions to integrate this in your application:
https://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications
Hope this would be helpful for you.

GWT visualization API Motion Chart language

I'm using the gwt visualization library to display motion charts in a gwt app. However, the language shown in the chart is random (different language every time it loads).
This:
http://code.google.com/apis/visualization/documentation/using_overview.html#localization
says I can set it, but only through the load method. But the GWT load method does not allow me to set anything other than the version and Packages.
As far as I can tell, there is no way of explicitly setting the language using the GWT API.
Any ideas?
You can set the locale of a GWT application in many ways: Locales in GWT. My guess would be that the Visualization API uses that value to set its own locale value.
You should be able to do a quick test of this by appending locale=fr (change to your desired locale) to the address:
http://www.example.com/MyGwtApp.html?locale=fr
This will force that locale to be used by GWT.
Update: the AjaxLoader does support setting the language via the AjaxLoader.AjaxLoaderOptions:
AjaxLoaderOptions options = AjaxLoaderOptions.newInstance();
options.setLanguage("fr");
AjaxLoader.loadApi("visualization", "1", null, options);
I'm not sure you can use null for the callback parameter, but you get the general idea.
I've discovered that this is a bug, which I've submitted here:
http://code.google.com/p/gwt-google-apis/issues/detail?id=358