, , ,

Book Review: R Cookbook

The R Cookbook is written by Paul Teetor, a developer with degrees in statistics and computer science, specializing in finance. The programming language R is a specialized language designed for deep statistical research, although it has some support for other mathematical fields, such as matrix algebra and signal processing. True to the O’Reilly cookbook format, […]

ExtJS HtmlEditor Example

Problem You want to display a control that allows editing HTML. Solution Use the HtmlEditor xtype. <script> Ext.onReady(function() { Ext.tip.QuickTipManager.init(); // enable tooltips var panel = new Ext.panel.Panel({ title: ‘HTML Editor’, renderTo: "html", width: 473, height: 220, default: ”, frame: true, layout: ‘fit’, items: { xtype: ‘htmleditor’, enableColors: true, enableAlignments: true, enableLists: true, enableSourceEdit: true […]

ExtJS xtemplate Example

Problem You want to use an html template within client-side ExtJS code. Tested in ExtJS Version 4.1.1 Screenshot Solution Use ExtJS’s xtemplates. Ext.onReady(function() { var trackStore = new Ext.data.Store({ storeId: ‘soundCloudStore’, proxy: { type: ‘ajax’, url: ‘blues.json’, reader: { type: ‘json’, idProperty: ‘id’ } }, fields:[’duration’, ‘genre’, ‘created_at’, ‘kind’, ‘title’, ‘id’] }); trackStore.load( function(records, operations, […]

What I learned from a failed iPad app

About a year ago, I thought I’d build a small news app that played a series of videos from youtube- a news channel for people without cable. Fortunately, in the mean time, someone built this. There are several interesting possibilities from this – to see news that is not normally available in your country, and […]

ExtJS Tooltip Example

Problem You want to display a grid with a tooltip. Tested in ExtJS Version 4.1.1 Screenshot Solution Set the “tip” property on the GridPanel’s view (panel.getView().tip). view = this.getView(); view.tip = Ext.create(’Ext.tip.ToolTip’, { target: view.el, delegate: view.itemSelector, trackMouse: true, renderTo: Ext.getBody(), listeners: { beforeshow: function updateTipBody(tip) { tip.update("Tooltip!"); } } Discussion The example ExtJS provides […]

,

New tool explores Flippa seller history and facilitates due diligence

Clinton, owner of Experienced-People.net, released a new data analysis tool to explore Flippa auction history, available at http://stats.experienced-people.net/seller.php. Flippa is one of the largest marketplaces for websites for sale- this tool allows detailed research on sellers to facilitate due diligence and market research. One of the most fascinating part of browsing Flippa listings, for me, […]

ExtJS ListView Example

Problem You want to display a grid which lists a series of objects. Solution Use a GridPanel (aka ListView): Ext.require([ ‘Ext.grid.*’, ‘Ext.data.*’, ‘Ext.util.*’, ‘Ext.state.*’ ]);   Ext.onReady(function() { var trackStore = new Ext.data.Store({ storeId: ‘soundCloudStore’,   proxy: { type: ‘ajax’, url: ‘blues.json’, reader: { type: ‘json’, idProperty: ‘id’ } }, fields:[’duration’, ‘genre’, ‘created_at’, ‘kind’, ‘title’, […]

,

Detecting Pitches in music with R

In a previous post, I described a method to detect a chord using a Fourier transform in Java/Scala. I’ve re-implemented the same in R, detailed below. This will generate an audio file containing the C-Major chord: library(sound) c<-261.63 e<-164.81 g<-196 len<-1 cData<-Sine(c,len) eData<-Sine(e,len) gData<-Sine(g,len) audio<-normalize(cData+eData+gData) saveSample(audio, “out\\ceg.wav”, overwrite=TRUE) And a series of helper functions: magnitude<-function(x) […]

,

Installing CouchDB on a VirtualBox instance with Chef and Vagrant

This assumes you’ve already installed Virtualbox and configured a base VM. mkdir cookbooks cd cookbooks git clone https://github.com/opscode-cookbooks/apt git clone https://github.com/opscode-cookbooks/erlang.git git clone https://github.com/opscode-cookbooks/couchdb.git cd .. mkdir vm cd vm vagrant init vi Vagrantfile Insert the following lines before the last line “end”, like so: config.vm.provision :chef_solo do |chef| chef.cookbooks_path = “../cookbooks” chef.add_recipe(“apt”) chef.add_recipe(“couchdb”) end […]

Fixing error “apt-get… return 100 expected 0” (Chef/Vagrant)

When running Chef for the first time on a VM, you may see an error like the following: apt-get -q -y install couchdb=0.10.0-1ubuntu2 returned 100, expected 0 The problem is that your Vagrantfile script does not require Chef to do an “apt-get update” before running it’s scripts. This normally triggers updating the apt database, and […]