Archive
Confirm18.com – Credit card verification, without taking payment
- A user visits your website – say, http://www.yourwebsite.com/welcome.html
- The user clicks on a link saying “I am over 18” on your website, and it takes the user to the page http://www.confirm18.com/verify.aspx?merchant=xxx
- If the user passes our credit-card check, then they will be returned to your website, say http://www.yourwebsite.com/page1.html
To set this up, you must have at least three webpages on your website.
- A welcome page, where you ask the user to click a link saying “I am 18”
- A success page, where the user will be taken if they pass our credit-card check
- A failure page, where the user will be taken if they fail our credit-card check
When you register on this website, you will set up your success and failure urls, and you will be given a merchant id. This is then used in the link from your welcome page to our website, in the form http://www.confirm18.com/verify.aspx?merchant=xxx where xxx is your merchant id.
More advanced uses: Passing a consumer idIf you need to make sure that the user that you send to our verification process is the same user that comes back in to your success page, then you should use the consumerid parameter to ensure that you do not loose track of a user’s session, shopping cart, or preferences.
To pass a consumerid, simply add it as a parameter to the link to our verification page, i.e. http://www.confirm18.com/verify.aspx?merchant=xx&consumer=yy where xx is your merchant id, and yy can be any value that identifies the user on your website.
The consumer id will be passed back in the querystring to either the success or failure page. i.e. http://www.yourwebsite.com/success.html?consumer=yy
Additionally, if the user fails the credit check, then the reason will be passed back in the querystring to the failure page on your website. You can choose whether to display the reason for failure to the user or not.
i.e. http://www.yourwebsite.com/fail.html?consumer=yy&reason=Bank_Invalid
Reasons can be as followsCard_type_invalid = The card issuing network does not match that suppled by the user Bank_Invalid = The bank entered by the user did not match that of the card issuing bank IP_Invalid = The card is issued by a bank in another country than the user’s current location
You can optionally opt to allow certain failures, for example, IP_Invalid could happen under legitimate circumstances, if the user is abroad on holiday.
Premium Only: Branding the verification pageBy default, our verification page will show our adverts, and our branding. If you wish to remove these, you can upgrade to a premium account.
Once you have upgraded to a premium account, then you can embed the verification page as an iFrame in your website, so the user will not be aware that they are using Confirm18.com
To use this verification iframe, use code such as the following
Where “xxx” is your merchant id.
Your success and failure urls may need to use iFrame killer script to ensure the correct user experience, i.e.
<script type=”text/javascript”> if (top != self) top.location.replace(location); </script>
Premium Only: API useageIf you want to have full control over the branding of the Confirm18.com experience, then premium users can avail of our API. This API is designed for developers, and requires programming experience. It is based on industry standard XML SOAP.
You can find the API at the following URL: http://www.confirm18.com/api.asmx, where you will find two methods:
Method 1:
VerifyCreditCard(int merchantid, string consumerId, string firstSixDigits, string clientIP, string cardType, string bankName)
– Performs the same check as Verify.aspx, returns a class containing pass/fail , and a reason, and the data returned from both the BIN lookup and IP lookup
* The merchant must have a premium account
Method 2:
VerifyPastCheck(string consumerid, int merchantid)
– Used to get information on a past verification check, either to double check that the user has arrived on the success url via legitimate means, or to get extra information about your customers.
* The merchant must have a premium account
Nokia X Try & Buy Pilot

Unveiled at the MWC in Barcelona was the Nokia X, the first Nokia phone to run Android.
Keen to get started, I submitted an app on the day, to the Nokia Publish site, although, it wasn’t until afterwards that I realised I never set a price point for the app. Believe it or not, There is no simple pay-to-download option for Nokia X apps. – Gasp –
So, after research, I see that Nokia are piloting a Try & Buy scheme using in-app payments. Here is the technical details I’ve found about it:
Nokia Try&Buy Pilot – Developer Guide
- Select your apps for T&B
- Create the app metadata in Publish, if new app.
- Create the Product ID (and related metadata) in Publish
- Remember to include: Display name, short and long description and Global Price Point (recommended 3 to 5)
- Choose the type of trial
- Time based (180 seconds) or usage based (3 plays)
- You can change the duration of the trial, 180 seconds is the default setting.
- Fill the T&B configurations in the table below with the following information: Content ID, Product ID, Display Name, Price Point, Trial Type (time vs plays) and Trial Duration
- Send your APKs and T&B configurations to the partner manager
- Use the cloud storage information provided to you by your partner manager
- Package your files in a single zip file with a meaningful name (eg PacMan_T&B.zip)
- Upload your package in the storage provided
- Nokia T&B team will wrap your APKs and upload a new package in the same folder
- Sign your APKs and upload to Publish
- If premium, convert your app to free (App must be published as free)
- Change the content file name (not the display name) to end with _TRYBUYNOK (Eg. PacMan becomes PacMan_TRYBUYNOK)
- Add the following sentence to the Content Description: This content has a time-based free trial which provides the user with free access to the content for a limited time period.
- Modify your application icon in order to include the wording “Free trial”. Example
- Make sure to sign each APK with your signature, upload them Publish and submit your app.
- Notify your PM once these steps have been completed
| Title | Title 1 | Title 2 | Title 3 | Title 4 |
| Content ID | ||||
| Product ID | ||||
| Display Name | ||||
| Price Point | ||||
| Trial Type | ||||
| Trial Duration |
Find duplicate name values in resx files
A Resx file is used to define localized text in a .NET application. It is an XML file, which is primarily in the form:
var datanodes = document.getElementsByTagName(“data”);var strNames = [];for(i=0;i<datanodes.length;i++){strNames.push(datanodes[i].getAttribute(“name”));};strNames = strNames.sort();var results = []; for (var i = 0; i < strNames.length – 1; i++) { if (strNames[i + 1] == strNames[i]) { results.push(strNames[i]); }}; console.log(results);
It will then list any duplicate name vales.
Broadcast data to all viewers of your webpage using Firebase
Firebase is a cloud-hosted JSON based database, which can be used to replace the back-end of web applications.
It excells in certain cases, using websockets to communicate seamlessless between client and server, it removes the need for postbacks or Ajax polling.
Here is a simple example using Firebase to broadcast a message to all viewers of a particular web-page. I have removed the security settings for this particular instance, so no username or password is required.
The callback is event-orientated, so whenever the value held in the database changes, the event is fired on all clients, with the snapshot object containing the updated value.
<html>
<head>
<script type='text/javascript' src='https://cdn.firebase.com/js/client/1.0.6/firebase.js'></script>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script language="javascript">
var myRootRef = new Firebase('https://vivid-fire-7206.firebaseio.com/');
function setData()
{
myRootRef.set($("#message").val());
}
myRootRef.on('value', function(snapshot) {
$("#lastMessage").html(snapshot.val());
});
</script>
Say something to all users viewing this page:<br>
<input name="text" id="message" onkeyup="setData()">
<br>
<br>
<h2 id="lastMessage"></h2>
</head>
<body>
</body>
</html>
Flu Trends App
Flu Trends App
Tracking flu epidemics in real-time
Overview:
People report their daily lives through social media, and it’s only natural when someone has a cold or flu, they mention this on social media sites, such as Twitter. – Sample tweets like the one below indicate, not only when people are ill, but where they are also.
This project seeks to trawl social media sites in a systematic manor looking for tweets relating to “flu”, “cough”, “sneeze”, “ill” etc., and using sentiment analysis on the messages to ensure that the message is genuinely referring to an ailment, and not taken out of context.
The objective of the project is to present this data as an App, that people can use to see if flu epidemics are developing in their area, or at their child’s school.
Innovation:
Projects such as Google Flu trends (http://www.google.org/flutrends/) have existed for some time, and they draw on data from public health institutions to provide a global picture of Flu patterns over time. This is certainly useful, but fails to provide a real-time, up to the minute picture of Flu outbreaks in the local area of the user.
Social media is an excellent source of real-time information, and feeding this into a mobile App, provides excellent coverage of those who mention they are ill via Twitter, or other similar social media sites.
Implementation:
A server-side application will constantly gather data on tweets sent using certain key phrases relating to flu, this will then analyse the tweet data for context, and then store them in a database, along with any geo-tagging information associated with the tweet.
An app, which will be made available for iOS and Android, – based on the PhoneGap framework, which will appear, similar to the prototype below, will display data that is relevant to the user, by using the user’s current physical location
Extra historical data will be taken in from other sources, such as Google Flu Trends, to allow users see past flu trends in their area.
Commercial applications:
Although the app will be designed primarily for the general health benefit of its users, and will be offered free. The data collected will be available for sale to other organisations via an API (Application programming Interface), chargeable per request, and advertised via ProgrammableWeb and Mashape.
It is expected that healthcare institutions may be interested in using this data in order to better allocate resources, and spot emerging epidemics before they become a serious public health threat.
Install free SSL certificate on IIS (startssl, not self-signed)
Create (or reauthenticate) your account
go to https://www.startssl.com/ and authenticate (or sign-up or use the express lane button).
This process involves entering a authentication code send to your e-mail address.
Follow the procedure, everything is pretty straightforward. Don’t forget to backup your certificate which is installed in your browser. If you reinstall your pc, you will need this certificate to gain access to your account.
Do e-mail validations first
The first catch. If you want to create a certificate for another domain.
First do a “email address validation” in the validations wizard for the domain you will be creating a certificate for. If you want to create a certificate for domainxyz.com, then first do an email validation for postmaster, hostmaster or webmaster@domainxyz.com. For the .com TLD you might have other possibilities also.
If you did not validated this e-mail address, you won’t receive any verification codes on this e-mail address.
Create a certificate
If you follow all instructions on the “certificates wizard”. If you let startssl generate your private key, you should have a at least the following files at hand
ssl.key (the encrypted private key)
ssl.crt (the certificate or public key)
The SSL.crt could be used on a windows server, but that would be only the public key. For HTTPS you also need the private key, because you need to decrypt the encrypted data. So you will need to link the private key and the certificate together as we will describe in the next steps.
Decrypt private key
First go to the toolbox and click the “decrypt private key”.
Paste in the content of the ssl.key file, enter your password which you provided in the previous step.
You now have a DECRYPTED private key. Copy this decrypted key.
Create Certificate for IIS
Now go to “Create PKCS#12” in the toolbox. Paste the decrypted key in the first box (private key). And paste the content of the ssl.crt file in the second box. Provide a new password to protect the file you will be creating.
Click continue.
Now download the PFX and use this file to install the certificate on your IIS 7.0/7.5 or higher.
Install the certificate
Open Inetmgr (Internet Information Services – IIS Manager) and open the “server certificates” on server level.
Click the “IMPORT” button and supply the PFX you just created (and uploaded?). You might not have the right file extension, but that is no problem. Just choose *.* as file type, select the file. Finish off with your password, before hitting return.
Redefine bindings of website
If you have only one HTTPS site running Go to your HTTPS site,
click “Bindings”
“Edit” the https (port 443) line
choose the right SSL certificate
hit “OK”,
and click the “Close” button
Bindings when hosting multiple sites
If you have multiple sites running on your website, you might want to set the binding headers for HTTPS. This can be done using the command prompt (as administrator) using these two commands:
C:\Windows\system32>cd \windows\system32\inetsrv
C:\Windows\System32\inetsrv>appcmd set site /site.name:”” /+bindings.[protocol=’https’,bindingInformation=’:443:’]
change the “”, “”, “” to approprate value’s.
Email a Crash report from a BlackBerry App

Too often, I get a email from a user who downloaded an app saying, “my app crashed, help”, and it’s very hard to diagnose the problem if you can’t re-create the problem on your own device. So, I thought of adding a crash report screen to my BlackBerry Webworks app.
Since I use “Console.log” statements all over my apps when developing the app, then the diagnostic information is already there.
All I needed to do is declare a global variable, and then replace all my console.log’s with log(string), and then have log(string) add to this global variable. Have this visible in a <pre> tag within a page to display a crash report, like shown opposite.
The clever bit, is then to have this send an email:
function email(to, subject, body) {
var message = to + ‘?subject=’ + subject + ‘&body=’ + body;
blackberry.invoke.invoke({
target: ‘sys.pim.uib.email.hybridcomposer’,
action: ‘bb.action.OPEN, bb.action.SENDMAIL’,
type: ‘message/rfc822’,
uri: ‘mailto:’ + message
});
}Which is taken from the BuiltForBlackBerry Bootstrap on Github.
Switching language on Windows 8 Store App (WinJS)
Using the Multilingual App Toolkit for Visual Studio is a great way to quickly make your app available across many different languages, and make it much more attractive to foreign users.
But, you do get tempted, as I did, to click every box, and upload every language from Arabic to Zimbabwean, but then, my app got rejected because my screenshots were in English.
Sure you can go into control panel, switch your language, and restart the app, in the simulator, but for 20-30 languages, it takes aaaages… So I came up with a bit of javascript that switches the app language every 3 seconds, so that you get time to take a screenshot of each language.
var iLangPointer = 0;
function CycleLanguages() {
var supportedLangs = [“ar”, “cs-CZ”, “da-DK”, “de”, “el-GR”, “es”, “et-EE”, “fi-FI”, “fr”, “hu-HU”,
“it”, “ja-JP”, “ko-KR”, “lt-LT”, “lv-LV”, “nb-NO”, “nl”, “pl-PL”, “pt”,
“ru-RU”, “sv”, “zh-Hans”];
Windows.Globalization.ApplicationLanguages.primaryLanguageOverride = supportedLangs[iLangPointer];
WinJS.Resources.processAll();
WinJS.Resources.processAll();
iLangPointer++;
if (iLangPointer >= supportedLangs.length) iLangPointer = 0;
}
Then, this is called from WinJS.UI.Pages.define {ready: … with
setInterval(CycleLanguages, 3000);
And it saves hours of work!
The App is a free download (for now), you can download it here:
http://apps.microsoft.com/windows/en-gb/app/wine-search/65894548-5b19-47a6-b262-641540e5bb5f
Movember ; the time to learn about Mustache.js
Mustache.js is a tempting engine for Javascript, and I thought since it was “Movember”, it was time to learn how to use it.
All Mustache.js does is tidy up spaghetti code that can result from rendering json objects as HTML
i.e. strHtml += “<div …..>” + obj.name + “</div><div …><span …>’ + obj.value ‘</span></td>’;
and all that yuckiness.
So here is a simple Hello World – type example, with an externalised template for extra neatness.
<html>
<head>
<script src=”http://code.jquery.com/jquery-1.10.1.min.js”></script>
<script src=”http://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.js”></script>
</head>
<body>
<script language=”javascript”>
var person = {
firstName: “Christophe”,
lastName: “Coenraets”,
blogURL: “http://coenraets.org”
};
$(init);
function init()
{
var template = $(‘#personTpl’).html();
var html = Mustache.to_html(template, person);
$(‘#sampleArea’).html(html);
}
</script>
<div id=”sampleArea”></div>
<script id=”personTpl” type=”text/template”>
<h1>{{firstName}} {{lastName}}</h1>
<p>Blog URL: <a href=”{{blogURL}}”>{{blogURL}}</a></p>
</script>
</body>
</html>
Text to Speech in Javascript
Just a short post about an undocumented Google API, Text-To-Speech.
function sayWord(word,lang)
{
var url = “http://translate.google.com/translate_tts?ie=UTF-8&q=” + word.toLowerCase() + “&tl=” + lang;
console.log(url);
var snd = new Audio(url);
snd.play();
}
Where “Word” is the phrase to say, and lang is the accent of the speaker. For example “Chat” in french is pronounced “Shaa’.
An important “Gotya” is that in iOS, this function must only be called in response to a click event. You cannot autoplay audio.


