Publications by Gregory Kanevsky
Java Anti-Pattern: Constructors and Template Method Pattern
My love for template method pattern hit the wall. The wall of Java constructors that is. Do not mix them together ever or at least without double checking. Again, I am all for template method pattern when it operates on fully initialized objects. But, by definition, Java constructors do not operate on such objects: they are exactly in...
2492 sym R (1013 sym/4 pcs)
Groovy. Batch. Prepared statement. Nice!
Scripting with Groovy is exciting thing. You get a feeling that the language was inspired by an Oracle who read your mind and then made it 10 times better. So imagine how I felt after finding out that Groovy can NOT batch prepared statements.Batching sql updates, inserts or deletes is one of the top features that database scripts wou...
1615 sym R (473 sym/2 pcs)
AutoComplete Using Google App Engine and YUI in two parts (part 1)
Part 1: Embedded Relation Index EntityI continue series of posts about keyword-based searches on Google App Engine (GAE) using Relation Index Entity (see RIE with Java and REI with Python posts in this order). Having implemented efficient search on GAE let’s switch the focus to usability. When user searches for a word which is not one of the in...
3471 sym R (1470 sym/7 pcs) 2 img
AutoComplete Using Google App Engine and YUI in two parts (part 2)
Part 2: Autocomplete with YUI3 and GAE RPC HandlersThis is second and final part of 2-part series on implementing AutoComplete with GAE. Recall that in part 1 we built a foundation for keyword autocomplete lookup service for our document search application. Both the service itself and its HTML/JavaScript client will materialize below.Let’s for ...
4824 sym R (3587 sym/6 pcs) 4 img
Gentle Intro to Octave or Matlab
I began using Octave for homework assignments from the online Machine Learning class. Having worked with languages like Python, Groovy and JavaScript I never expected a system designed for numerical computations to include such a complete and unique programming language. But it does and I can’t resist sharing some examples.There are...
5585 sym
Quick R tip: ggplot in functions needs some extra care
When building visualizations with ggplot2 in R I decided to create specialized functions that encapsulate plotting logic for some of my creations. In this case instead of commonly used aes function I had to use its alternative – aes_string – for aesthetic mapping from a string.And now goes this handy tip:while original aesthet...
1922 sym R (236 sym/4 pcs)
How to expand color palette with ggplot and RColorBrewer
Histograms are almost always a part of data analysis presentation. If it is made with R ggplot package then it may look like this:data(mtcars) ggplot(mtcars) + geom_histogram(aes(factor(cyl), fill=factor(cyl)))The elegance of ggplot functions is in simple yet compact expression of visualization formula while hiding many options assumed by def...
3142 sym R (1157 sym/8 pcs) 18 img
VW Big Data Play
Volkswagen made headlines lately for cheating U.S. EPA regulators. But let’s pay some respect to their engineers.Apparently, there is no button or switch that tells car it’s being tested – indeed – that would be obvious flaw in the emission test protocol. So VW engineers designed and deployed sophisticated algorithm that detec...
1401 sym
R Graph Objects: igraph vs. network
While working on new graph functions for my package toaster I had to pick from the R packages that represent graphs. The choice was between network and graph objects from the network and igraph correspondingly – the two most prominent packages for creating and manipulating graphs and networks in R.Interchangeability of network and graph...
2985 sym R (2398 sym/5 pcs) 10 img 1 tbl
Creating and Tweaking Bubble Chart with ggplot2
This article will take us step-by-step over incremental changes to produce a bubble chart using ggplot2 that looks like this:We’ll encounter the plot above once again at the very end after explaining each step with code changes and observing intermediate plots. Without getting into details what it means (curios reader can find out here) the d...
2747 sym 14 img