Tuesday, October 23, 2012

Simple x y dojo chart example

This is a very simple x, y, chart using Dojo and sourcing the js and css from Google.  Copy the next part and save as a html file.


<!DOCTYPE html>
<html >
<head>
<script 
type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js" 
dojoConfig = "{parseOnLoad: true}"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.8/dijit/themes/claro/claro.css"/>

<script type="text/javascript" >
dojo.require( "dojox.charting.Chart" );
dojo.require( "dojox.charting.axis2d.Default" );
dojo.require( "dojox.charting.plot2d.Lines" );

  dojo.ready(function(){
    var chart1 = new dojox.charting.Chart("simplechart",{title: "Basic XY chart" });
    chart1.addPlot("default", {type: dojox.charting.plot2d.Lines});
    chart1.addAxis("x", {title: "X axis", titleOrientation: "away"});
    chart1.addAxis("y", {vertical: true, title: "Y axis"});
    chart1.addSeries("Series 1", [1, 2, 2, 3, 4, 5, 5, 7]);
    chart1.render();
  });
</script>
</head>
<body class="claro">
    <div id="simplechart" style="float:left; width: 350px; height: 350px; margin: 5px auto 0px auto;"></div>
</body>
</html>












   




   



Tuesday, August 7, 2012

Issues in Beginning RhoMobile


Here I'm listing a few mistakes/typos in the book Rhomobile Beginner's Guide.


Chapter 4


Code for cancel button on the filter_employee_form.erb, chapter 4, incorrectly takes you to the index of employees, when It should take you back to the home page. Replace :

<a class="cancel" href="<%= url_for :action => :index %>">Cancel</a>

With

<a class="cancel" href="<%= Rho::RhoConfig.start_path %>">Cancel</a>

Also latest ruby practice is to use link_to instead of <a href style.

Creating a RhoSync application.


Should say where to run the rhosync application. Also rhosync is now replaced by rhoconnect. So starting rhosync with rake is now starting rhoconnect with rake.

Installing the Rhodes translator gem


You must run gem install from the ruby folder or it won't work.

using oci8 with rhoConnect

require 'rubygems'
require 'oci8'

Must remember to use 32 bit oracle client.

Manual install the ruby gem buy using

http://help.rubygems.org/kb/rubygems/installing-gems-with-no-network

I'm using a Windows 2010 64 bit server.

I got my technical staff to install the Oracle Client.  But that was the 64 bit client and is not compatible with the oci8 package.  So had to install the 32bit client.  Make sure is on the path.

Start irb

irb: require 'rubygems'
irb: require 'oci8'

then run:

OCI8.new( 'username', 'password','database-name').exec( 'select * from user_tables' ) {|r| puts r.join }

to test it.  Setting the environment variable oracle_sid is not required.   Database-name will be found using the oracle tnsnames.ora file ( I think).

That works in the irb.  Rhoconenct requires a few more steps.

To get it to work in RhoConnect


  1. open your Gemfile in your application root.
  2. Just under the top line add: gem 'ruby-oci8'
  3. goto to a cmd prompt in your application root.
  4. run bundle install
  5. oracle will now connect!

Thursday, April 19, 2012

Fixing RhoMobile build problems to android device.

Android SDK location.

Make sure you don't install it with any spaces.

Version of Android SDK

I had to install 2.3 before it would compile without complaining about missing getNumberOfCameras()

And delete xlargeScreen

Wednesday, April 18, 2012

Connectify connecting problems using android phone

I changed my laptop and installed Connectify onto it. Then I tried to connect with my Atrix to the WiFi. It saw the hotspot but whenever I tried to connect the phone would say 'obtaining ip address' for about 2 minutes, then abort the connection. Another laptop could connect to the Connectify hotspot so the issue was on the phone.

Solved the issue by going into the WiFi settings on android, pressing the menu button, choosing 'Advanced' and selecting 'Enable Auto IP'. Then it connected! Hooray!