I want to create a Chrome browser extension which would be using Face Recognition algorithms to customize personal bookmarks, passwords and themes.
Is there any possibility to use different technologies then JavaScript in this case?
You can use Native Client (NaCl) to compile C/C++ code into a form that will run safely inside Chrome. This is feasible as long as the NaCl runtime (provided by the Pepper API) meets your needs. You will communicate with your NaCl module with Javascript in your application.
I created a Javascript face recognition tutorial here - http://jsfiddle.net/ismaelc/fgq7L/ .(Disclaimer: I work for Mashape). It's using photobooth.js to capture images, and using Lambda's Face recognition API (https://www.mashape.com/lambda/face-recognition). I am calling the API like this:
$.ajax({
url: "https://lambda-face-recognition.p.mashape.com/recognize",
type: "POST",
data: fd,
processData: false,
contentType: false,
beforeSend: function (xhr) {
xhr.setRequestHeader("X-Mashape-Authorization", $("#mashapeKey").val());
}
}).done(function (result) {
alert("Received response..");
var resultObject = JSON.stringify(result);
alert(resultObject);
});
You might also want to check this demo that uses the Skybiometry API (https://www.mashape.com/skybiometry-1/skybiometry-face-detection-and-recognition#!documentation) with webRTC - http://fadomire.futureauth.jit.su/
You can also check out this list of 40+ face recognition APIs, libraries, software - http://blog.mashape.com/post/53379410412/list-of-40-face-detection-recognition-apis
No, extensions have to be created using HTML and JavaScript.
Related
How can I create a javascript function to put in Cloud Code of parse.com, which downloads the content of the class in a json file?
I've read through the Cloud Code Documentation at parse.com https://www.parse.com/docs/cloud_code_guide but I haven't found any examples similar to what I need to do.
You can use this for example (there a few ways). Remove // to limit the number of objects (2 or whatever). "english" being my class.
Then you need to read this function from your platform (mobile desktop etc) which you also need to know how to do. What platform do you use? I only know Corona SDK.
Parse.Cloud.define("getall", function(request, response) {
var query = new Parse.Query("english");
//query.limit(2)
query.find({
success: function(results) {
response.success(results);
},
I want to build a PhoneGap HTML5 app with a StackMob backend. There seems to be a shortage of books, videos, and tutorials on the topic.
Specifically, how can I build a Phonegap + StackMob app without using Require.js and Backbone.js?
I think stackmob developer website: https://developer.stackmob.com/ is the best resource.
Using phoneGap with StackMob is independent of using Backbone.js and Require.js. The StackMob SDK is built using Backbone.js for managing models and collections.
So, if you want to build an app without Backbone.js, you can make bare AJAX calls to StackMob. Here is a JSFiddle showing how.
http://jsfiddle.net/ericktai/mr925/
/*
We want to prepare the Request headers we're going to send to StackMob. It should look like:
{
'Accept': application/vnd.stackmob+json; version=0',
'X-StackMob-API-Key-dc0e228a-ccd3-4799-acd5-819f6c074ace': 1,
'Range': 'objects=0-9' //this is optional, but I did it here to show pagination and extra header fields
}
You can actually have the public key in the header as:
'X-StackMob-API-Key': dc0e228a-ccd3-4799-acd5-819f6c074ace
OR
'X-StackMob-API-Key-dc0e228a-ccd3-4799-acd5-819f6c074ace': 1
The first is our original format. The reason why I chose the latter is because of this specific example. I'm making cross domain requests jsfiddle.net to api.stackmob.com, which the browser doesn't allow UNLESS we use CORS (cross origin resource sharing). StackMob servers support CORS, but it needs the latter header format to do so. (it was introduced later). iOS and Android SDKs use the first format.
Node.js should be able to use the first format because it doesn't restrict cross domain calls.
The "1" value in the latter format is arbitrary. IE just doesn't allow the value of a header to be empty, so we filled it with "1".
*/
var publicKeyHeader = 'X-StackMob-API-Key-dc0e228a-ccd3-4799-acd5-819f6c074ace';
var requestHeaders = {};
requestHeaders['Accept'] = 'application/vnd.stackmob+json; version=0';
requestHeaders[publicKeyHeader] = 1;
requestHeaders['Range'] = 'objects=0-9'; //set pagination to first 10
$.ajax({
url: 'https://api.stackmob.com/item',
headers: requestHeaders, //set the headers
type: 'GET',
success: function(data, textStatus, xhr) {
console.debug(data);
},
error: function(xhr, textStatus, error) {
console.debug(error);
}
});
Regarding phoneGap, you'll want to look at the following docs.
https://developer.stackmob.com/js-sdk/using-the-js-sdk-with-phonegap-guide
I've used Adobe phoneGap build successfully.
Btw- I am the Platform Evangelist at StackMob
I've been working on a site that implements Twitter's API using jQuery's $.ajax function. It works when I run it on my machine, but when I upload it to my server and run it, it returns at 403: forbidden every time. I definitely haven't exceeded their rate limit, so I don't think I've been blacklisted. A few of my colleagues have developed similar problems in their pages since around midnight last night. Does anyone know if Twitter is changing their API? Have they depreciated the json requests?
Here is my code for those interested:
$(document).ready(function() {
$.ajax({
type: "GET",
url: "http://search.twitter.com/search.json?q=not+art&rpp=100&callback=?",
dataType: "json",
success: function(data) {
d = data.results;
for(i=0;i<d.length;i++){
var idStr = d[i].id_str;
console.log(i+" = "+idStr);
}
}
});
});
I'm fairly certain it's not a code issue since it still works running offline, but there isn't any word from twitter on recent changes that I can find. Any help or info would be greatly appreciated. Are we all going to have to learn a new API?
EDIT 3/29/13
The problem appears to be connected to using a shared IP address to access the search.twitter.com API. The Twitter Developer forums didn't have any more information than that, unfortunately, but if you are having similar problems, look into that.
I am building a semi dynamic app in html5 w/jquerymobile, target atm. is iOS to begin with.
But the problem is that i need to contact a webservice with a (request)header paramater, and this is not doable.
My question might be very elementary, but since i'm developing in netbeans i ran into the problem of not being able to get data from crossdomain.
(Getting to the point). In phonegap/{non native "offline" apps}. How do i set the domain/is there a workaround for making http get/post requests with headerparams?
If you are using Phonegap the web application will run off of the file:// protocol and is not bound by cross domain restrictions.
EDIT:
If you are using jQuery Mobile and Phonegap you will need to set $.support.cors and $.mobile.allowCrossDomainPages to true.
From the jQueryMobile docs:
Since jQuery Mobile relies on jQuery core's $.ajax() functionality, $.support.cors must be set to true to tell $.ajax to load cross-domain pages. We've heard reports that webviews on some platforms, like BlackBerry, support cross-domain loading, but that jQuery core incorrectly sets $.support.cors value to false which disables cross-domain $.ajax() requests and will cause the page or assets to fail to load.
$(document).bind( "mobileinit", function(){
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
});
I have encountered a problem with Internet Explorer and JSON Web Services and was wondering if anyone else has as well. Using jQuery, I tried to access a specific URL on the same domain that returns JSON data. This works perfectly on Firefox and Chrome. However, the first Ajax request always fails in Internet Explorer. What's more interesting is that subsequent Ajax requests DO work, even though the request emanates from the same function!
At first, I thought that I might have done something wrong with jQuery but ... when I tried accessing my JSON Web service URL using Internet Explorer (directly into the address bar on a new tab), it also fails the first time, and succeeds afterwards. So I thought that it might be a problem with my Web service, but then I have the same issue with Web services available freely on the Internet. Every time I open a new tab and try to access a JSON Web service, the first call always fails.
Did anyone experience the same problem with Internet Explorer and JSON Web Service? I am focusing on the wrong problem: is the issue with IE not capable of accessing the Web service irrelevant, and the problem with jQuery is somewhere else?
My AJAX call is written as follows:
$.ajax({
async: true,
type: 'GET',
url: '<JSON Web service URL>',
dataType: 'json',
cache: false, // Doesn't help
success: function(data, textStatus, xhr) {
alert('success');
},
error: function(xhr, textStatus, error) {
alert('failure');
}
});
I've tried this on several configurations, but the problem is always there:
Windows XP / Seven
Internet Explorer 7 (Real and IE 8 Emulated mode) / 8
Chrome 11
Firefox 4
jQuery 1.5.1 / 1.5.2
Thanks in advance,
I was facing same issue, updating jQuery to 1.6.4 solved the issue :)