General

Starting MLflow with FastAI (v2)

This is not meant as a comprehensive guide, rather just a place to start and get things up and running. Read further below for a background and explanation. Create a custom callback   ## Tracking Classfrom mlflow.tracking import MlflowClientfrom mlflow.entities.run import Runfrom typing import Listclass MLFlowTracking(Callback): “A `LearnerCallback` that tracks the loss and other metrics into MLFlow” def __init__(self,...

Data Pipeline Visualization – Making it Interesting

Data pipelines are generally hard to explain and aren’t as interesting to those not directly involved in data analytics. How to make this more interesting and engaging? Simple. Make it in 3D. Animated. Interactive. Click & Drag. Middle mouse to zoom. Press 1 through 9 for animations. The above is a data pipeline animation for one of my recent...

Blog revived

It has been a while since I added contents to the website. I started out this blog in 2004, back when blogging was the social media of the day. Inspired by professionals who I admired, I tried to track my own professional and personal journey. However, in 2016 I failed to renew my hosting plan which took down all...

RubyMotion – PullToRefresh

To add Sam Vermette’s SVPullToRefresh to your RubyMotion project: Add the SVPullToRefresh pod Add the Quartz Framework # RakefileMotion::Project::App.setup do |app| # … app.frameworks += [‘QuartzCore’] app.pods do pod ‘SVPullToRefresh’ # … endend # Then in your controller def viewDidLoad # …. tableView.addPullToRefreshWithActionHandler Proc.new { loadMagicalData(tableView) # do some other magic # then don’t forget to: tableView.pullToRefreshView.stopAnimating }# …

Consultancy Masterclass

Last weekend, I sat through the two-day Consultancy Masterlcass by Brennan Dunn & Obie Fernandez. Both Brennan and Obie have extensive experience building their own successful consultancy firms. The class was insightful and full of those ‘from the trenches’ experiences. What was of significant value is the knowledge transparently shared by students and alumni. All of whom are of...

Using NUI with RubyMotion

NUI is an open-source library that allows you to style your iOS applications using CSS-like files and syntax. In my opinion, NUI carries few benefits over its commercial, KickStart backed, competitor Pixate. First; NUI allows you to style your application on the fly while it’s running in the simulator. And Second; NUI styled-elements are not masked/wrapped in their special...

JRuby – can’t convert Hash into String

I’ve recently upgraded a JRuby/Rails application from JRuby 1.6.3 (1.8 compatibility mode) to 1.6.8 (1.9 mode). Everything was working out fine except for actions relying on internal CSV library (FasterCSV in 1.8 mode). The error “ was thrown as CSV tries to generate the csv string. This had the hallmarks that the application was still under the 1.8 mode...

Rails and inner query choices

Consider that we have two models; Well and SurveryPoints . A Well represent an oil/gas/water well, each with multiple SurveyPoints. A SurveyPoint represent the well’s coordinate at a certain depth. class Well < ActiveRecord::Base has_many :survey_pointsendclass SurveyPoint < ActiveRecord::Base belongs_to :wellend Say, we’d like to implement a filtration mechanism that allows us to query the wells – and for...

newrelic – undefined method `-’ for nil:NilClass

Using JRuby with trinidad (developer mode) – I was intermittently getting this error. Apparently thrown as estimated_time for the transaction was returning nil. I was also having all sorts of other issues (undefined method `metric_name’ for nil:NilClass) with all newrelics action summaries. To resolve (following suggestions on the trinidad google group): {% highlight ruby %} config/initializers/newrelic.rb if defined?(JRUBY_VERSION) &&...

JRuby/Rails Streaming in development environment (and beyond)

Rails streaming is a great feature that allows you to optimize on server resources when dealing with large generated content. However – it might be a bit tricky to validate and test in local development. First off – a local server that supports streaming is required. The only one I could find was trinidad which is moving to the...