Sharing of Project Nimbus in National University of Singapore NUS

Hi there,

Thank you folks for attending the Project Nimbus sharing held on 7th October 2010 at Engineering Auditorium. You folks were a great crowd. As promised, below are some of the links and resources that you would find useful.

Creativity starts from a BELIEF

NUS CS3240 Course on Silverlight, with Source Code and Video Resources

Sebastian’s showcase of project nimbus datasets in table format, on his personal website

Sebastian’s Twitter Search on Web

Windows Phone 7 application creator in 3 minutes

Silverlight showcase of project nimbus datasets in map format

Anytime we missed out? Drop us a comment, and we’ll get back to you!

Posted in Uncategorized | 1 Comment

Datasets – User Contributed Content (USR)

User Contributed Datasets is part of the community driven efforts to provide interesting datasets.

Sim Wei Sung Lincoln and Shahila Syed Ali Shah are students from Temasek Polytechnic who came up with an idea titled “After 12″.
The purpose of this dataset is to offer information about the amenities such as Restaurants, Clinics, Convenient Stores, etc that are opened 24 hours.

Their motivation  came from the understanding that it was troublesome to think about the nearest place to have late supper with friends or the nearest clinic to head for past midnight.

Thus, they came up with the idea of collecting those datasets and build an application that could show the nearest selected amenities within a chosen distance from where they currently are.

Kudos to Lincoln and Shahila from Temasek Polytechnic!

Datasets Available

Dataset Description URL Metadata
AXSSet List of AXS available after 12am in Singapore http://api.projectnimbus.org/coodataservice.svc/AXSSet Click Here
ClinicSet List of Clinics opened after 12am in Singapore http://api.projectnimbus.org/usrodataservice.svc/ClinicSet Click Here
ClubSet List of Clubs operating after 12am in Singapore http://api.projectnimbus.org/usrodataservice.svc/ClubSet Click Here
ConvenienceStoreSet List of Convenience Store operating after 12am in Singapore http://api.projectnimbus.org/usrodataservice.svc/ConvenienceStoreSet Click Here
FastFoodSet List of fast food operators available after 12am in Singapore http://api.projectnimbus.org/usrodataservice.svc/FastFoodSet Click Here
RestaurantSet List of Restaurants operating after 12am in Singapore http://api.projectnimbus.org/usrodataservice.svc/RestaurantSet Click Here
SAMSet List of SAM operational after 12am in Singapore http://api.projectnimbus.org/coodataservice.svc/SAMSet Click Here
SuperMarketSet List of supermaket opened after 12am in Singapore http://api.projectnimbus.org/usrodataservice.svc/SuperMarketSet Click Here

Code Snippet

.NET – How do I access a complete list of AXS

public List<AXSEntry> GetAXSSetFromNimbusUSR(string AccountKey,string UniqueUserID)
    {
        System.Net.WebRequest wr=
          HttpWebRequest.Create(
            "http://api.projectnimbus.org/usrodataservice.svc/AXSSet?");
        wr.Headers.Add("AccountKey",AccountKey);
        wr.Headers.Add("UniqueUserID",UniqueUserID);
        wr.Method = "GET";
        WebResponse res = wr.GetResponse();
        string resStr
         = new System.IO.StreamReader(res.GetResponseStream()).ReadToEnd();

        XNamespace atomNS
          = "http://www.w3.org/2005/Atom";
        XNamespace dNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices";
        XNamespace mNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";

        List<AXSEntry> results
          = (from item in XElement.Parse(resStr).Descendants(atomNS + "entry")
            let axs = item.Element(atomNS + "content").Element(mNS +"properties")
                select new AXSEntry() {
                Name = axs.Element(dNS +"Name").Value,
                OperatingHours = axs.Element(dNS + "OperatingHours").Value,
                Address = axs.Element(dNS + "Address").Value
            }).ToList();

        return results;
    }

Java – How do I access a complete list of movies

public ArrayList<AXS> getAXSs(String accountKey, String uniqueId) {
  axsList = new ArrayList<AXS>();
  try {
    URL _url = new URL("http://api.projectnimbus.org/usrodataservice.svc/AXSSet?");
    URLConnection _urlConn = _url.openConnection();
    _urlConn.setRequestProperty("accept", "*/*");
    _urlConn.addRequestProperty("AccountKey", accountKey);
    _urlConn.addRequestProperty("UniqueUserID", uniqueId);
    BufferedReader br = new BufferedReader(new InputStreamReader(_urlConn.getInputStream()));
    String line = null;
    StringBuilder strBuilder = new StringBuilder();
    while ((line = br.readLine()) != null) {
      strBuilder.append(line);
      System.out.println(line);
    }
}

String[] IProperties = strBuilder.toString().split("<m:properties>");
    for (String str : IProperties) {
      AXS axs = new AXS();
      axs.setName(Utils.getStringBetween(str, "<d:Name>", "</d:Name>"));
      axs.setOperatingHours(Utils.getStringBetween(str, "<d:OperatingHours>", "</d:OperatingHours>"));
      axs.setAddress(Utils.getStringBetween(str, "<d:Address>", "</d:Address>"));
      axsList.add(axs);
      }
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    } catch (IOException ex) {
        ex.printStackTrace();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return axsList;
}

Helpers Available

.NET – C# Proxy Classes: click here | Read this blog post for more information to use these proxy classes.

JAVA – Read this blog post for more information to use JAVA to connect to the data service.

PHP & AJAX – Read this blog post for more information to use PHP/AJAX to connect to the data service.

obj C / xcode – coming soon

Terms of Use

The datasets:

  • Are here as a community technology preview for a period of time (TBD).
  • Cannot be used in any public offering.
  • Are offered as-is with no official support.

Support

None at this time.

Posted in Uncategorized | 1 Comment

New Datasets for Project Nimbus, coming to you on Monday

Hi fellow developers and innovators!

We have been constantly working hard on getting new and interesting datasets for the community from government agencies and businesses in Singapore.

In the spirit of sharing, a fellow student developer from Temasek Polytechnic has approached us around a month ago to request us to share her datasets.
Do come back on Monday, and you would find out what the student community has to offer!

Posted in Uncategorized | Leave a comment

Using LINQ in Nimbus

For those who are using LINQ to call the data services from Project Nimbus, for your information, there is an issue with the .Net Framework client as well as the ADO.NET Data Services.

In the previous post, we showed you how you can use ADO.NET Data Services using LINQ which can fasten your coding process. This scenario will work if ONLY you are using Visual Studio 2008 and have downloaded the ADO.NET Data Services v1.5 CTP 2.

However, if you are using Visual Studio 2010, ADO.NET Data Services is already in built in Visual Studio 2010. Hence, you will not need to download the installer in this case. If you are using Visual Studio 2010 with LINQ, you got to use .NET Framework 4.0 instead. Using a .NET Framework 3.5 will result in a “NotSupportedException” error. This is likely due to the different ADO.NET Data Services version used in Visual Studio 2008, .Net Framework 3.5 and Visual Studio 2010, .Net Framework 4.0.

Kenneth Ham

Posted in Uncategorized | 2 Comments

Datasets – Chlkboard (CHKB)

ChlkBoard
Chlkboard is Singapore Company which offers to information and promotion of local businesses, ranging from F&B to retail shops.

Datasets Available

Dataset Description URL Metadata
BusinessInfoSet Information of Businesses in Singapore http://api.projectnimbus.org/chlkboardodataservice.svc/BusinessInfoSet
Click Here

Code Snippet

.NET – How do I access a complete list of Businesses

public List<BusinessInfoEntry> GetBusinessFromNimbusCHKB(string AccountKey, string UniqueUserID)
    {

        System.Net.WebRequest wr=
          HttpWebRequest.Create(
            "http://api.projectnimbus.org/chlkboardodataservice.svc/BusinessInfoSet?");
        wr.Headers.Add("AccountKey",AccountKey);
        wr.Headers.Add("UniqueUserID",UniqueUserID);
        wr.Method = "GET";
        WebResponse res = wr.GetResponse();
        string resStr
         = new System.IO.StreamReader(res.GetResponseStream()).ReadToEnd();

        XNamespace atomNS
          = "http://www.w3.org/2005/Atom";
        XNamespace dNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices";
        XNamespace mNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";

        List<BusinessInfoEntry> results
          = (from item in XElement.Parse(resStr).Descendants(atomNS + "entry")
            let business = item.Element(atomNS + "content").Element(mNS +"properties")
                select new BusinessInfoEntry() {
                BusinessInfoID = business.Element(dNS +"BusinessInfoID").Value,
                Name = business.Element(dNS +"Name").Value,
                Address = business.Element(dNS + "Address").Value,
                Operating_Hours = business.Element(dNS + "Operating_Hours").Value

            }).ToList();

        return results;
    }

Java – How do I access a complete list of Businesses
public ArrayList<Business> getBusinesses(String accountKey, String uniqueId) {
  businessList = new ArrayList<Business>();
  try {
    URL _url = new URL("http://api.projectnimbus.org/chlkboardodataservice.svc/BusinessInfoSet?");
    URLConnection _urlConn = _url.openConnection();
    _urlConn.setRequestProperty("accept", "*/*");
    _urlConn.addRequestProperty("AccountKey", accountKey);
    _urlConn.addRequestProperty("UniqueUserID", uniqueId);
    BufferedReader br = new BufferedReader(new InputStreamReader(_urlConn.getInputStream()));
    String line = null;
    StringBuilder strBuilder = new StringBuilder();
    while ((line = br.readLine()) != null) {
      strBuilder.append(line);
      System.out.println(line);
    }
}

String[] IProperties = strBuilder.toString().split("<m:properties>");
    for (String str : IProperties) {
      Business business = new Business();
      business.setBusinessID(Utils.getStringBetween(str,"<d:BusinessID m:type="Edm.Int32">","</d:BusinessID>"));
      business.setName(Utils.getStringBetween(str, "<d:Name>", "</d:Name>"));
      business.setAddress(Utils.getStringBetween(str, "<d:Address>", "</d:Address>"));
      business.setOperating_Hours(Utils.getStringBetween(str, "<d:Operating_Hours>", "</d:Operating_Hours>"));
      businessList.add(business);
      }
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    } catch (IOException ex) {
        ex.printStackTrace();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return movieList;
}

Helpers Available

.NET – C# Proxy Classes: here| Read this blog post for more information to use these proxy classes.

JAVA – Read this blog post for more information to use JAVA to connect to the data service.

PHP & AJAX – Read this blog post for more information to use PHP/AJAX to connect to the data service.

obj C / xcode – coming soon

Terms of Use

The datasets:

  • Are here as a community technology preview for a period of time (TBD).
  • Cannot be used in any public offering.
  • Are offered as-is with no official support.

Support

None at this time.

Posted in Uncategorized | Leave a comment

Datasets – Chlkboard

ChlkBoard
Chlkboard is Singapore Company which offers to information and promotion of local businesses, ranging from F&B to retail shops.

Datasets Available

Dataset Description URL Metadata
BusinessInfoSet Information of Businesses in Singapore http://api.projectnimbus.org/
chlkboardodataservice.svc/
BusinessInfoSet
Click Here

Code Snippet

.NET – How do I access a complete list of Businesses

public List<BusinessInfoEntry> GetBusinessFromNimbusCHKB(string AccountKey, string UniqueUserID)
    {

        System.Net.WebRequest wr=
          HttpWebRequest.Create(
            "http://api.projectnimbus.org/chlkboardodataservice.svc/BusinessInfoSet?");
        wr.Headers.Add("AccountKey",AccountKey);
        wr.Headers.Add("UniqueUserID",UniqueUserID);
        wr.Method = "GET";
        WebResponse res = wr.GetResponse();
        string resStr
         = new System.IO.StreamReader(res.GetResponseStream()).ReadToEnd();

        XNamespace atomNS
          = "http://www.w3.org/2005/Atom";
        XNamespace dNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices";
        XNamespace mNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";

        List<BusinessInfoEntry> results
          = (from item in XElement.Parse(resStr).Descendants(atomNS + "entry")
            let business = item.Element(atomNS + "content").Element(mNS +"properties")
                select new BusinessInfoEntry() {
                BusinessInfoID = business.Element(dNS +"BusinessInfoID").Value,
                Name = business.Element(dNS +"Name").Value,
                Address = business.Element(dNS + "Address").Value,
                Operating_Hours = business.Element(dNS + "Operating_Hours").Value

            }).ToList();

        return results;
    }

Java – How do I access a complete list of Businesses
public ArrayList<Business> getBusinesses(String accountKey, String uniqueId) {
  businessList = new ArrayList<Business>();
  try {
    URL _url = new URL("http://api.projectnimbus.org/chlkboardodataservice.svc/BusinessInfoSet?");
    URLConnection _urlConn = _url.openConnection();
    _urlConn.setRequestProperty("accept", "*/*");
    _urlConn.addRequestProperty("AccountKey", accountKey);
    _urlConn.addRequestProperty("UniqueUserID", uniqueId);
    BufferedReader br = new BufferedReader(new InputStreamReader(_urlConn.getInputStream()));
    String line = null;
    StringBuilder strBuilder = new StringBuilder();
    while ((line = br.readLine()) != null) {
      strBuilder.append(line);
      System.out.println(line);
    }
}

String[] IProperties = strBuilder.toString().split("<m:properties>");
    for (String str : IProperties) {
      Business business = new Business();
      business.setBusinessID(Utils.getStringBetween(str,"<d:BusinessID m:type="Edm.Int32">","</d:BusinessID>"));
      business.setName(Utils.getStringBetween(str, "<d:Name>", "</d:Name>"));
      business.setAddress(Utils.getStringBetween(str, "<d:Address>", "</d:Address>"));
      business.setOperating_Hours(Utils.getStringBetween(str, "<d:Operating_Hours>", "</d:Operating_Hours>"));
      businessList.add(business);
      }
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    } catch (IOException ex) {
        ex.printStackTrace();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return movieList;
}

Helpers Available

.NET – C# Proxy Classes: here| Read this blog post for more information to use these proxy classes.

JAVA – Read this blog post for more information to use JAVA to connect to the data service.

PHP & AJAX – Read this blog post for more information to use PHP/AJAX to connect to the data service.

obj C / xcode – coming soon

Terms of Use

The datasets:

  • Are here as a community technology preview for a period of time (TBD).
  • Cannot be used in any public offering.
  • Are offered as-is with no official support.

Support

None at this time.

Posted in Uncategorized | Leave a comment

Sample codes for training workshop of Code::XtremeApps::

Accessing data sets from Project Nimbus via .NET by Yap Neng Giin:
Sample Codes
Demo 01 -  Accessing data services with a web client connection and ‘manual’ deserialization with LINQ-to-XML features.
Demo 02 – Accessing data services with proxy class(es) and easy deserialization.

Accessing data sets from Project Nimbus via PHP by Michael Cheng:
Sample Codes
Slides

Accessing data sets from Project Nimbus via Java by Tan Chun Siong:
Sample Codes – Accessing data services using restlet framework.

Posted in Uncategorized | Leave a comment