MVVMCross View blocked by sqlite call - mvvmcross

I am trying to build a fairly simple sqlite database based mobile app using mvvmcross and Portable class libraries. The database I have running is fairly large so querying it takes enough time where I don't want the UI to get blocked while running queries.
The way I currently have it set up is in a few classes based on the mvvmcross n+1 tutorials n=10 tutorial. I have two services that manage the look-ups for the two entities.
How can I perform these database calls on a separate thread and have the view be updated when completed. I assume that this capability exists within mvvmcross I just haven't been able to track down the documentation or any tutorials on it specifically.
Any help pointing me to the right direction would be much appreciated.
Thanks,
JH

Portable class libraries do give you access to the ThreadPool - so you could use that to marshall the work onto a background thread? http://msdn.microsoft.com/en-us/library/system.threading.threadpool.queueuserworkitem.aspx
Alternatively, if you have a setup/configuration which allows the TPL to be used in your library, then you could use the TaskFactory or async and await to provide some background threading - this is probably the better long-term route, but getting this setup and working initially may take longer as Xamarin's async support is very new and it's PCL support is changing.

Related

What are the different ways to write a widget in SonarQube?

SonarSource has said that they would be dropping support for Ruby on Rails. So assuming that we would need to use Web APIs from here onwards, what are alternate ways of writing your widgets? Has anyone tried any alternate ways of writing one? And how do you link said widget to the UI?
Short answer:
In upcoming versions of SonarQube, widgets and customizable dashboards will be progressively be removed. You will still be able to use the Web APIs to get all the data you want but you won't be able to contribute changes to the "dashboards" of the product.
Long answer:
SonarQube was initially designed to be able to inject and display any kind of information, mostly thanks to the customizable dashboards and widgets (that are indeed written in Ruby). While this helped getting widespread, the downside is that people started using it as a multi-purpose aggregator and reporting tool. One would add information coming from a bug tracker system, another one would add documentation information about projects, ...etc. The consequence is that soon, the global and project dashboards ended up being full of useless and useful information, everything mixed up together in a big mess.
So something had to be done to get back to what SonarQube is meant for: managing source code quality. Every information that can't be precisely linked to a source file should not end in SonarQube. Having said this, it becomes obvious that having a mechanism to define custom dashboards and widgets is just too generic. The web application must provide features that answer precise needs for a precise audience. This is why customizable global and project dashboards are progressively replaced by "hard-coded" pages which answer those use cases. This started with the new project home page introduced in the 5.x series of SonarQube and available in the latest 5.6 LTS. And we'll do the same with global dashboards in the 6.x series.

Creating hash value according to the HMAC-SHA512 method using PCL/MvvmCross

I'm trying to create a cross platform application using MVVMCross and portable class libraries, which interacts with an api and displays some data asynchronously.
Currently I am trying to generate a SHA512 hash value for a sign key that will be sent along to the api.
I am not exactly sure how I can implement the cryptology portion. I have tried using the SHA512 class, however it appears to be unavailable. I tried manually adding a reference to System.Security.Cryptology which didn't help.
I also tried additional packages on nuget such as SharpCrypt to see if they would help generate a hash value, however I see the error "the type or namespace name 'CryptSharp' could not be found" after adding the package from nuget.
I am targeting:
.Net Framework 4.5+
Windows Store apps
Silver light 5
Windows Phone 8
I'm quite a beginner so maybe I am missing something extremely obvious, any help or examples would be much appreciated.
Thanks!
I believe some of the crypto classes may also be available portably using the PCLContrib project - http://pclcontrib.codeplex.com - but I don't think this is yet available beyond Windows.
Where functionality isn't available portably, you can inject implementations into portable class libraries via an interface from each UI platform:
there's an example of this in the first part of N=31 in http://mvvmcross.blogspot.co.uk
there's a full introduction to MvvmCross dependency injection in https://github.com/MvvmCross/MvvmCross/wiki/Service-Location-and-Inversion-of-Control

Best portable method to implement an algorithm on Website

I came across this problem,I have got an algorithm that I need to implement on websites.
The server side scripts may differ and it can be PHP,ASP.NET etc.
All I need to do to is to deliver the binary(I need it as I dont want this security algorithm to be open and viewable) that can comply by every type.As per me solution can be (Please correct me if I am wrong):-
Implementing binary according to OS.
Implementing Algo as per every type of script.(Tough and less portable)
Please suggest if there is other way round or please close this question and redirect me to any earlier question asked for this situation.I am new for this.
Thanks
I would suggest you to use Java Server-side technologies to implement your algorithm. You can write your algorithm as a java class, which can be called from a Servlet or a JSP or even any other technologies over http protocol. The main reason why I suggest using java is:
1) it is platform independent, so your 1st point:
Implementing binary according to OS.
You dont have to worry which OS the client would use.and it can be ported to other OS very easily.
and
2) it will be very secure, once you compile, a class file will be generated, which can be delivered. it cant be opened and viewable.

Best Practice for Developing Core Functions in Symfony2?

I am an experienced Symfony user and have started using Symfony2 and absolutely love it. A big thank you to Fabien and the guys over at Sensio.
I am pretty much there now in terms of developing in Symfony2 thanks to the documentation available, but there is one area in particular that I am still not 100% sure on.
I have a number of core functions that I want to use in different areas of the application and just want to know what the best practice for this is?
I am currently creating a bundle that has a number of functions in that handles the processing of images.
Is this the best way to do this and if so how do I then use or include these functions across other bundles?
You could just import the classes you want to use from your image handler bundle, but the way I would go about it is to register one or more services (like an image manager or thumbnail generator or whatnot) from your bundle so that the functionality you are creating will be available through the DIC for the entire application to use.

Is there a working Cocoa MySQL Xcode project?

Or has this been abandoned? I can't seem to find a modern sample project. I haven't been able to make any the old code I find work. I just want to write a simple Mac app that accesses an external MySQL database that's also involved in a PHP website.
The old CocoaMySQL project has been abandoned, but the project has been resurrected as Sequel Pro.
It's open source and you can get the source code here.
If you want a straight library that allows you to access MySQL, you might try the commercial MacSQL framework.
You can also just use the MySQL C API directly, however be careful because if you want to use this in a commercial app the licensing fees are high.
You might find it easier to write some PHP code on the server to deliver the results to your client using JSON or some other lightweight data interchange format. PHP has direct support for JSON and there is a great Cocoa framework that makes it easy to parse and generate JSON code.
This method allows you to completely abstract the database connection from your client, so it is relatively trivial to change the database if necessary in future.
Thanks, Rob, I have actually seen the links to Sequel Pro but I was confused when I got there. Part of my problem is that I am really bad at adding things to an Xcode project. Once I have a project in hand with the correct libraries and whatever all linked up, I can make use of the various methods or functions.
That's why I was asking if someone had a super simple project using MySQL that would hopefully compile for me right out of the box. I can then add all my objects and coding.
Can't seem to find anyone out there willing to hold the hand of us project-challenged. The project settings dialog box and codes that go in various boxes therein are very confusing to me.