Posts

Showing posts from March, 2010

Interactive Chart from Google Apps Engine datastore

Create a simple python file chart.py which should have been already mapped to a particular URL pattern in app.yamx- url: /chart/.*
  script: chart.py 1: import cgi


2:


3: from google.appengine.ext import db


4: import hist


5:


6: import os


7: from google.appengine.ext.webapp import template


8:


9: quotes = db.GqlQuery("SELECT * FROM HistoricalPrices")


10:


11: template_values = {'quotes': quotes,}


12:


13: path = os.path.join(os.path.dirname(__file__), 'index.html')


14: print template.render(path, template_values)



index.html should look like following



1:<html>


2:<head>


3:<scripttype="text/javascript"src="http://www.google.com/jsapi"></script> 1: 2: <script type="text/javascript"> 3: google.load("visualization", "1", {packages:["linechart"]}); 4: google.setOnLoadCallback(drawChart); 5:function drawChart() { 6:var data …

Interactive Chart from Google Apps Engine datastore

Create a simple python file chart.py which should have been already mapped to a particular URL pattern in app.yamx- url: /chart/.*
  script: chart.py 1: import cgi


2:


3: from google.appengine.ext import db


4: import hist


5:


6: import os


7: from google.appengine.ext.webapp import template


8:


9: quotes = db.GqlQuery("SELECT * FROM HistoricalPrices")


10:


11: template_values = {'quotes': quotes,}


12:


13: path = os.path.join(os.path.dirname(__file__), 'index.html')


14: print template.render(path, template_values)



index.html should look like following



1:<html>


2:<head>


3:<scripttype="text/javascript"src="http://www.google.com/jsapi"></script> 1: 2: <script type="text/javascript"> 3: google.load("visualization", "1", {packages:["linechart"]}); 4: google.setOnLoadCallback(drawChart); 5:function drawChart() { 6:var data …

Loading CSV data in Google Apps Engine datastore

Edit your app.yaml, and add the following lines to the handlers: section:- url: /remote_api
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
login: admin

1.Create hist.py similar to the type of data in CSV file.





1: from google.appengine.ext import db


2:


3: class HistoricalPrices(db.Model):


4: SYMBOL = db.StringProperty()


5: SERIES = db.StringProperty()


6: OPEN = db.FloatProperty()


7: HIGH = db.FloatProperty()


8: LOW = db.FloatProperty()


9: CLOSE = db.FloatProperty()


10: LAST = db.FloatProperty()


11: PREVCLOSE = db.FloatProperty()


12: TOTTRDQTY = db.FloatProperty()


13: TOTTRDVAL = db.FloatProperty()


14: TIMESTAMP = db.DateProperty()


15: DUMMY1 = db.StringProperty()


16:





2.Now Create the loader code StockLoader.py



1: import datetime


2: from google.appengine.ext import db


3: from google.appengine.tools import bulkloader


4: import hist


5:


6: class HistoryLoader(bulkloader.Loader):


7: d…

Loading CSV data in Google Apps Engine datastore

Edit your app.yaml, and add the following lines to the handlers: section:- url: /remote_api
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
login: admin

1.Create hist.py similar to the type of data in CSV file.





1: from google.appengine.ext import db


2:


3: class HistoricalPrices(db.Model):


4: SYMBOL = db.StringProperty()


5: SERIES = db.StringProperty()


6: OPEN = db.FloatProperty()


7: HIGH = db.FloatProperty()


8: LOW = db.FloatProperty()


9: CLOSE = db.FloatProperty()


10: LAST = db.FloatProperty()


11: PREVCLOSE = db.FloatProperty()


12: TOTTRDQTY = db.FloatProperty()


13: TOTTRDVAL = db.FloatProperty()


14: TIMESTAMP = db.DateProperty()


15: DUMMY1 = db.StringProperty()


16:





2.Now Create the loader code StockLoader.py



1: import datetime


2: from google.appengine.ext import db


3: from google.appengine.tools import bulkloader


4: import hist


5:


6: class HistoryLoader(bulkloader.Loader):


7: d…

Tech Days 2010

Image
Tech Days 2010 is an annual event from Oracle that have raised the bar on technology. With exclusive previews of “what's next,” the conferences have provided insights, information, and expertise to developers around the world.



At Tech Days 2010, we heard hear from the brightest minds as they share cutting-edge technologies and ideas that can boost your career beyond the ordinary. With multiple tracks, 50+ sessions, hands-on labs, in-depth technology coverage, and exciting keepsakes, Tech Days 2010 is not just another conference to attend. It's THE conference to attend.

It was incredible to meet James Gosling (http://blogs.sun.com/jag/) , He was the keynote speaker on the day 1 (24th march) at Tech days by Oracle.  Major highlight was JavaFx which he not only demonstrated but also his entire slide turned out to be a JavaFx program by him which was only 400 odd lines of code. That was productivity at its best.



The sessions started with a wonderful talk by Arun Gupta and followed by…

Tech Days 2010

Image
It was incredible to see James Gosling (http://blogs.sun.com/jag/)live as a keynote speaker on the day 1 (24th march) at Tech days by Oracle.

The sessions started with a wonderful talk by Arun Gupta.

Most of the notes can be found at http://varunkumar-n.blogspot.com/2010/03/james-goslings-talk-tech-days-2010.html

View Full Album

Arun’s blog for Day 2 is as follows

http://blogs.sun.com/arungupta/entry/day_2_tech_days_2010

Some more photos …

View Full Album

Simple Free Web Proxy Server

http://proxy.neilghosh.com/ is a new addition to the set of tools in this site.This uses Python scripts in Google apps engine.
Thanks to the article in labnol.org. You can see the difference between visiting a site with and without proxy.It does not work for all the websites which are restricted in your region (specially the once with rich contents ) but you explore others.

Simple Free Web Proxy Server

http://proxy.neilghosh.com/ is a new addition to the set of tools in this site.This uses Python scripts in Google apps engine.
Thanks to the article in labnol.org. You can see the difference between visiting a site with and without proxy.It does not work for all the websites which are restricted in your region (specially the once with rich contents ) but you explore others.

How to change the default Google Desktop Data index folder

Google desktop search uses a folder in which it stores its index files. This folder called “Google Desktop Data” is by default place in the “My Documents” folder of your pc. To me that’s not a logical place though as I only want to have files I actively use to be in the “Mt Documents” folders. Music, Video, Word-files and spreadsheets are fine, index files from a search tool are not.
Unfortunately Google Desktop does not offer the ability to change the location of its index files. This is what you have to do if you want another location for the Google Desktop Data folder:1. Stop Google Desktop (Right-click the tray icon->Exit) 2. Move Google Desktop Data directory to the desired location. 3. Run regedit (go to start -> Run… -> regedit) 4. Locate HKEY_CURRENT_USERSoftwareGoogleGoogle Desktopdata_dir 5. Change its value to the location, chosen in step 2 6. Start Google Desktop again

How to change the default Google Desktop Data index folder

Google desktop search uses a folder in which it stores its index files. This folder called “Google Desktop Data” is by default place in the “My Documents” folder of your pc. To me that’s not a logical place though as I only want to have files I actively use to be in the “Mt Documents” folders. Music, Video, Word-files and spreadsheets are fine, index files from a search tool are not.
Unfortunately Google Desktop does not offer the ability to change the location of its index files. This is what you have to do if you want another location for the Google Desktop Data folder:1. Stop Google Desktop (Right-click the tray icon->Exit) 2. Move Google Desktop Data directory to the desired location. 3. Run regedit (go to start -> Run… -> regedit) 4. Locate HKEY_CURRENT_USER\Software\Google\Google Desktop\data_dir 5. Change its value to the location, chosen in step 2 6. Start Google Desktop again