Saturday, 8 October 2011

Geek Tours in Boulder/Denver

Last week I took a few days off and and decided to see a few local sites. There are a number of tours and such you can see in the greater Denver area. However, I took in a couple of the cooler science/tech related tours.






NCAR Tour

First, NCAR is the National Center for Atmospheric Research. They are a non-profit organization backed by the National Science foundation and a number of universities for study of the atmosphere. They do basic research and also develop tools for other scientists to use to study the atmosphere.


The NCAR Tour is offered daily at noon. Basically the tour focuses on some of the research that has been done by the organization and is currently being done. The tour mainly looks at some of the exhibits on the main floor, 2nd floor, and computer room. All open to the public. The tour hits the highlights and you have time for a deeper dive in any area of interest after the tour.


A few things stood out for me. First, the cafeteria is open to the public. It has one of the best views in the city. Grab a lunch, and sit inside or out to enjoy the amazing vistas available from the location. Second, near the cafeteria downstairs is an original Cray 1. One of the first real supercomputers. You can actually get up close and personal with a machine that sold for $5M to $8M. NCAR was Cray's first official customer and if you are a computer geek, this is a must see.


To get to NCAR, just take to the Boulder/Denver Turnpike (US 36) to Boulder. Take the Table Mesa exit and take Table Mesa Drive west. Just keep going west and eventually the road dead ends at NCAR.



NOAA Tour

The National Oceanic and Atmospheric Admininstration (NOAA) has one of its main research labs in Boulder. NOAA is probably most famous or its tracking of hurricanes on the east coast. In addition, they do things like monitor tsunamis, and of course do all sorts or research on all things oceanic and atmospheric. Tours are offered weekly on Tuesday at 1pm. A security search is required to get in. Also you have to have a driver's license or passport. Please see the tour page for directions and entrance requirements.


The first part of the tour features the some really cool control rooms. The first is the Space Weather Prediction Center. You get to look over the shoulder of the team that monitors solar activity for the US. Lots of monitors with cool pictures and flashy lights. The second control room is for the National Weather Service (NWS) for the Colorado region. They monitor and predict the weather for Colorado mainly. Lots of cool monitors and images again, although not quite as fancy as the space gang.


The third and coolest part of the tour is Science on a Sphere. This is a system developed by the folks at NOAA, to display global data on six foot sphere. A number of different types of data is shown. The world wide airline flight data is really cool. It shows all the airline flights in all the world over a 48 hour period. A data set that shows all the ocean currents and how they move around the globe is also very cool. This system is available at many museums around the world. I know the Denver Museum of Nature and Science has one. Definitely check it out if you get the chance.


Both tours are definitely worth the time. Check them out if you are in the Denver/Boulder area.


Friday, 7 October 2011

Example code to search Google Plus public posts

Search Google Plus public posts

package com.exercise.AndroidGooglePlus;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

public class AndroidGooglePlusActivity extends Activity {


TextView item_post;

final static String GeogleApisUrl = "https://www.googleapis.com/plus/v1/";
final static String API_KEY = "<Your API key>";

final static String GooglePlusPublicPosts_url
= GeogleApisUrl
+ "activities?query=cookie%20recipes&orderBy=best"
+ "&key=" + API_KEY;

String[] PublicPosts = null;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

item_post = (TextView)findViewById(R.id.item_post);

String googlePlusResult = QueryGooglePlus(GooglePlusPublicPosts_url);
ParseGooglePlusJSON_PublicPosts(googlePlusResult);

}

String QueryGooglePlus(String queryString){
String qResult = null;

HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(queryString);

try {
HttpEntity httpEntity = httpClient.execute(httpGet).getEntity();

if (httpEntity != null){
InputStream inputStream = httpEntity.getContent();
Reader in = new InputStreamReader(inputStream);
BufferedReader bufferedreader = new BufferedReader(in);
StringBuilder stringBuilder = new StringBuilder();

String stringReadLine = null;

while ((stringReadLine = bufferedreader.readLine()) != null) {
stringBuilder.append(stringReadLine + "\n");
}

qResult = stringBuilder.toString();
}
} catch (ClientProtocolException e) {
e.printStackTrace();
Toast.makeText(AndroidGooglePlusActivity.this,
e.toString(),
Toast.LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(AndroidGooglePlusActivity.this,
e.toString(),
Toast.LENGTH_LONG).show();
}
return qResult;
}

void ParseGooglePlusJSON_PublicPosts(String json){
if(json != null){

try {
JSONObject JsonObject = new JSONObject(json);

JSONArray JsonArray_items = JsonObject.getJSONArray("items");

PublicPosts = new String[JsonArray_items.length()];
for (int i = 0; i < JsonArray_items.length(); i++){
JSONObject post = JsonArray_items.getJSONObject(i);
PublicPosts[i] = post.getString("title");
}

String postList = "";
for (int i = 0; i < PublicPosts.length; i++){
postList += String.valueOf(i) + ": " + PublicPosts[i] + "\n"
+ "------------\n";
}
item_post.setText(postList);

Toast.makeText(AndroidGooglePlusActivity.this,
"finished",
Toast.LENGTH_LONG).show();
} catch (JSONException e) {
e.printStackTrace();
Toast.makeText(AndroidGooglePlusActivity.this,
e.toString(),
Toast.LENGTH_LONG).show();
}
}
}

}


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:id="@+id/item_post"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>


Note: Need permission of "android.permission.INTERNET" to access Google Plus online.

Download the files.

Ref:
- Google+ Platform Blog - Google+ APIs: Now With Search and More!

Related article:
- Query and Parse Google+ JSON

Warning... Nevermind.

UPDATE: Jay Freeman aka @saurik has purchased jailbreakme.com. As a result, disregard the warning I made about it earlier.

Thursday, 6 October 2011

PhoneGap: Beginner�s Guide


This is a step-by-step guide written in an informal, friendly style, for beginners to learn building cross-platform mobile applications with PhoneGap. You will find plenty of fully explained code and ample screenshots in the book to ease and speed up your understanding. This book is for developers, ideally with web development experience, who are interested in developing for the emerging mobile market, but do not want to learn a new SDK for every phone on the shelf. Readers should be comfortable with JavaScript, HTML, and CSS, and interested in learning the new advances in those technologies that allow for rich, native-style experiences.



Wednesday, 5 October 2011

Science, Space Wallpapers for your Computer

Internet IconOne of the things people ask me about is where do I get my wallpapers. So are are some links to science related sites that provde some really nice wallpapers.



NCAR Weather Photos

The sites has a number of weather related photos including some great lightning pictures.



NOAA Photo Library

A variety of photos from the ocean to space.



Nasa Image Library

Nasa's general image site. Space images along with astronauts and space vehicles.



Nasa JPL Space Images

Want some really cool hard core space images? This is the site for you.



Enjoy.



We have lost a great one

We have lost a truly great one. Steve Jobs has passed away at 56.

CNET: Steve Jobs



So much of the world today we owe to his vision. We will all miss him.



Steve Jobs: Innovator, Genius, Hero.

Today we lost a great man. My deepest condolences to the Jobs family. Thank you for sharing your husband, brother, father with this world.





Steve, if it weren't for you, I'd still be using my stupid blackberry.





<3