Saturday 31 December 2016

SceneKit Sample - Globe surrounded by clouds

Recently I have been learning SceneKit framework provided by Apple on iOS and macOS platform. I have created a Swift playground sample using Xcode 8 and Swift 3.0 to display globle surrounded by clouds.

Note: The code and resources have been taken from the sample provided in WWDC 2013 - SceneKit session.

The output of the playground is as shown below:


The sample can be found in the github repository: SceneKitSample. You can get more explanation about the code here.

Besides playground sample, I have created an Application sample which could be run on the device. This allows you to switch on/off features to see how those impact the output. Also scenekit output quality on the device is much better than the simulator so I would recommend you to run this sample on the actual device.

The output will look like as shown below:


Wednesday 20 January 2016

iOS Swift- Sending Photos peer-to-peer using NSNetServices and NSStream

Recently I have been exploring NSNetServices and NSStream to send data between two iOS devices. The easiest way to do it is using Apple Multipeer Connectivity. However, I wanted to explore NSNetService and NSStream. There are few reasons why I used those APIs. First this has helped me to understand the complexity and issues while implementing networking Apps at a lower level. Second the concepts are useful while connecting the iOS devices with low Bluetooth energy devices.

In the sample App two iOS devices can send photos to each other. You can download my sample App from here.  Please click on the video to see the demo of the App.



I have used NSNetService to publish and browse photo sharing service. NSNetService can be used to publish the service and NSNetServiceBrowser can be used to browse published services. Once service is found and resolved then NSOutputStream is used to send photos and NSInputStream is used to receive photos.

I have used following resources to implement the sample App:
NSNetServices and CFNetworking programming guide
WiTap Sample
Stream Programming Guide

I plan to write more about the topic and update my code as I get a better understanding of the topic. Please let me know if you find any problems in the code.


Monday 20 January 2014

Cassandra Data Modelling - Primary Keys

In the previous blog we discussed how data is stored in Cassandra by creating a keyspace and a table. We also inserted rows into the table. The rows in Cassandra are stored in the form of variable key/value pairs or columns. We also observed that each row in a table is referenced by a primary key or a row key. In this post we are going to discuss more about primary keys. Primary key concept in Cassandra is different from Relational databases. Therefore it is worth spending time to understand this concept.


In our last post we created a person table which had a person_id as a primary key column.
create table person (person_id int primary key, fname text, lname text, dateofbirth timestamp, email text, phone text );
We saw that the person_id was used as a row key to refer to person data.

Thursday 14 November 2013

Cassandra Data Modelling - Tables


In this series of posts I will discuss the basic concepts of data modelling in Apache Cassandra. It is important to understand those concepts as it will help us to design an efficient system using Cassandra. In this post I will discuss basic concept called tables in Cassandra.

I am assuming that you have installed Cassandra 1.2 or above with CQL3. You can download Cassandra from Apache Cassandra website. CQL 3.0 is the language which helps to work with Cassandra object same as SQL language helps to works with SQL objects.

Thursday 12 April 2012

d-touch Mobile- Part 3

In our last two posts we discussed about d-touch markers and how d-touch mobile library can be configured and used in an Android application. In this post we are going to discuss the architecture of the d-touch mobile library.

There are three main entities or classes of the d-touch mobile library.
  1. HIPreference
  2. DetectMarker
  3. MarkerConstraint
The sequence diagram of these entities is shown in figure 1:

Figure 1: Sequence diagram of d-touch mobile library

Wednesday 11 April 2012

d-touch Mobile - Part 2

In our last post we discussed a brief introduction of  d-touch markers.In this post we will see how to use d-touch mobile library in an Android project. The output of our sample project would look like as shown in picture 1. You can find the library in DtouchMobile folder and the sample code in DtouchSample1 folder on the github.
Picture 1: Sample camera preview with marker detection window.

Thursday 5 April 2012

d-touch Mobile - Part 1

d-touch markers are visual markers which are easy to design and easy to communicate to humans. Enrico Costanza has introduced these markers and has launched a dedicated d-touch website for this project. d-touch markers can be used in mixed reality application. As part of the research project for Horizon Digital Economy Research Institute, University of Nottingham , I have developed a d-touch library for Android system. In this post I will give an introduction of the d-touch markers. In our next post I will show how to create a sample application using d-touch mobile library. The library and sample source code is available on the github. Please feel free to use this for building cool projects! Here are few example outputs of the sample code in DtouchSample folder on the github.

Youtube marker
Youtube dtouch marker