Logo

Who is talking?

Archive

Premature optimization is the root of all evil

about 6 years ago | Prasoon Sharma: Enterprise Software Doesn't Have to Suck

Premature optimization is the root of all evilDonald Knuth

Cricket fever again

about 6 years ago | Prasoon Sharma: Enterprise Software Doesn't Have to Suck

England take on Sri Lanka in a test series starting today. After watching Cricket world cup 2011 and witnessing India play in quarter final, semi final and the finale in stadiums all over India, I had little appetite for any of the IPL 2011 matches. But now, I'm excited again. This test series will be a thrilling contest considering the two teams are more or less equal:England is at #3 and Sri Lanka are at #4 in ICC test rankingEngland plays well against Sri Lanka at home, and Sri Lanka has an edge in their home conditions. And the overall record is well balancedSri Lanka has won 2 of the last 3 test series against England with 1 draw. Clearly, they have a better track record. However, it is difficult to predict the winner as England has the home advantage and the momentum (Ashes tour and other tests in last 18 months). Sri Lanka has a new captain in Dilshan who will be under pressure. England will be under pressure too with the recent emergence of English cricket and the desire to prove their test cricket status. Let the games begin!

The Grand

about 6 years ago | Suman Thareja: Spice it up!..

Kochi has probably some of the best food I have tasted.  Fresh, spicy, tangy and made with passion!!  Happen to be taken to The Grand Hotel by our driver and turned out to be one of the best meals of the trip. Appam this good is not hard to find in Kerela, though does get […]

Cool solution for Cross domain

about 6 years ago | Subodh Gupta: Subodh's Blog

Just follow these steps to make it work:Compose your response as an JSON let say responseObject variable represent this JSON string/object Wrap the JSON response as an argument to a method call e.g. helloMethod(responseObject); where helloMethod is the method name Define this method(helloMethod) which handles this response in the client sideLets take complete working sample:assume JSON Object as str = {"user":{"fname":"subodh","lname":"gupta","type":"blog","category":"tech"}}handleUser(str);function handleUser(str){ alert(str.user.fname);}just to complete the solution look at call below:jQuery.getJSON("http://subodh.blog.com/servlet?user=subodh&responseType=JSON", function(str) {    alert(str.user.fname);});Look at this link for details jQuery.getJSON. http://subodh.blog.com/servlet?user=subodh&responseType=JSON this could be replaced by your service returning JSON response.That's it you are done. :)

Customer: “Although I asked for it….. that’s not what I desired!!”

over 6 years ago | Karan Nangru: Karan Nangru

If you feel the statement above(in any grammatical form) was your plight during your past waterfall projects, then its time you switched your project methodology from waterfall to Agile!!

10 reasons why you should learn R

over 6 years ago | Prasoon Sharma: Enterprise Software Doesn't Have to Suck

10. Can't crack that hard Sudoku problem?? Use R!9. Want to pick a skill that will give you an early adopter advantage?? Learn R! It is the leading open source statistical and data analysis programming language, and is heating up! 8. Need to run statistical calculations in your software application?? Deploy R! It integrates with many programming languages like Java, Ruby, C++, Python7. Looking for reusable libraries to solve a complex problem?? Get R! It has 2000+ free libraries to use in areas of finance, natural language processing, cluster analysis, optimization, prediction, high performance computing etc. 6. No Windows, No Doors - R runs on all the platforms. Just name it and you got it!! Windows PC, Mac, Linux to name a few5. Did you know how much fun stats can be- Try R!!4. Are you updated with the current trends?? Leading firms like NY Times, Google, Facebook, Bank of America, Pfizer, Merck are all using R, where are you??3. Need to run your own analysis?? Need to solve an optimization problem?? Struggling with Excel or SQL in your model??..... just few statements away - Try R!! 2. Want to create a compelling chart?? Try R! 1. Want the coolest job in 2014?? Learn Statistics. It is the future. Data Scientists will be the sexy job in 2018

Vehicle Routing Problem

over 6 years ago | Prasoon Sharma: Enterprise Software Doesn't Have to Suck

This is a follow-up to a previous question on VRP. I investigated R libraries and several other options to solve VRP and decided to build a custom desktop application using open source libraries from COIN-OR. Screenshots attached below.Leave a comment if you're interested. I will contact you directly.Team: Prasoon, Khaled, James

Pavillion

over 6 years ago | Suman Thareja: Spice it up!..

Pavillion at ITC Maurya in Delhi has some great dining options.  Even though its in Maurya (5-star hotel) its not too formal or too casual. If everyone dining with you is in the mood for a different cuisine, its possible to satisfy all their cravings here. I recommend a tasting platter to begin with.. What […]

My first 'R' plot

over 6 years ago | Lalatendu Das: Interpretations of technorealism

Started learning 'R'.My first attempt was to plot data from Forbes 1000 list (refer to the exercise posted by Prasoon sharma)Here is a bubble chart showing Forbes top 25 companies by Market CapitalizationSource code:## read the csv fileFORBES.DF <- read.csv("forbes2000list_for_2011.csv")## assign titlesnames(FORBES.DF)<- c("Rank", "Company", "Country", "Industry", "Sales", "Profits", "Assets", "MarketCap")## create a smaller vectorForbes100ByMC <- FORBES.DF[order(-FORBES.DF$MarketCap),][1:100,]Forbes25 <- Forbes100ByMC[1:25, ]## plot the bubble chart using 'symbols'radius <- sqrt(Forbes25$MarketCap/pi)sales <- as.numeric(as.character(Forbes25$Sales))profits <- as.numeric(as.character(Forbes25$Profits))symbols(sales, profits, circles=radius, inches=0.9, fg="white", bg="light blue", xlab="Sales($'Billions)", ylab="Profits($'Billions)", main="Forbes 25 By Market Capitalization", xlim=c(min(range(sales))-50, max(range(sales))+50), ylim=c(min(range(profits))-2, max(range(profits))+2))## print the names of companiestext(sales, profits, Forbes25$Company, cex=0.6, col="dark red")   Any feedback toward writting better 'R' code is welcome.

Stacked waterfall charts in highcharts

over 6 years ago | Amit Kumar: RubyizednRailified

Check out how to generate stacked waterfall charts using highchart js library.

Stacked waterfall charts in highcharts

over 6 years ago | Amit Kumar: toamitkumar's Code Blog

Check out how to generate stacked waterfall charts using highchart js library.

Waterfall chart with Line Connectors

over 6 years ago | Amit Kumar: RubyizednRailified

Update: the chart extension has evolved to produce waterfall charts with bubbles superimposed:Just committed JS extension to create Waterfall chartsLook at here for details

Waterfall chart with Line Connectors

over 6 years ago | Amit Kumar: toamitkumar's Code Blog

Update: the chart extension has evolved to produce waterfall charts with bubbles superimposed:Just committed JS extension to create Waterfall chartsLook at here for details Comments Anonymous I just downloaded your extension fromhttps://github.com/toamitkumar/waterfall-charts/downloads and the example returns an errorMyLib.js:33 TypeError: 'undefined' is not a function (evaluating '$.lineConnector([[i+0.38, data[i].y], [i+0.62, data[i].y]])')I'm using safari 5.1.2. Thought I'd let you know.

Install rubygems without rdoc/ri

over 6 years ago | Amit Kumar: RubyizednRailified

If you ever want to disable generating rdoc and ri when you install a ruby gem:Add this to your ~/.gemrc:install: --no-rdoc --no-riupdate: --no-rdoc --no-ri

Install rubygems without rdoc/ri

over 6 years ago | Amit Kumar: toamitkumar's Code Blog

If you ever want to disable generating rdoc and ri when you install a ruby gem:Add this to your ~/.gemrc:install: –no-rdoc –no-riupdate: –no-rdoc –no-ri

Problem/Limitation in using flXHR

over 6 years ago | Subodh Gupta: Subodh's Blog

I had a cross domain issue and after browsing for a while i came across flXHR which seemed to be promising solution and hence i went ahead with it. It's a flash based cross domain solution which is based on a crossdomain.xml config file (which lists the list of sites from where you can access the services). For more details on flXHR click here.I thought I have the great solution in hand and work with it before I encountered thee major of limitation of flXHR: The location of crossdomain.xml can be specified in configuration of flproxy via loadPolicyURL attribute. Which is supposedly the path flXHR will take to resolve the permission of your domain to access service hosted at that domain.However this is where the problem comes it will not only consider the crossdomain.xml at given location but it will also make a query at the root of the site and hunt gain for crossdomain.xml to see the permission for the client domain to access the service e.g. if you specify loadPolicyURL=www.abc.com/a/crossdomain.xml flXHR lib will still hunt for crossdomain.xml at www.abc.com/crossdomain.xml if your crossdomain is not hosted at this place your call won't be successful.Although this scenario is rare but in case you couldn't host your crossdomain.xml @root or your root redirects somewhere else flXHR won't be of your use.

Testing Extended Devise Controllers

over 6 years ago | Amit Kumar: RubyizednRailified

Devise has become the de-facto library if you ever need Authentication. Tonnes of pluggable components which you can easily enable/disable.For our application we had to reset session and easiest and cleanest way to do was to extend the devise - SessionsController:For testing this piece:With smiling face I ran the spec buuuuuuttttttttttttttttt arrrrggghhhh:AbstractController::ActionNotFoundChecking the devise filters helped with some direction:Have fun !!

Adding routes to rails3 - rspec2 (controller tests)

over 6 years ago | Amit Kumar: RubyizednRailified

I was working on migrating an existing Rails 2 app to Rails 3. And I came across a weird issue. All my controller specs started to fail with error - route not found even though all my routes were in place.After some more reading in the rails routing module - found it overwrites the routes if you open the block and pass on extra routesHope this will save few hours of your development :))

Learning

over 6 years ago | Lalatendu Das: Interpretations of technorealism

How do you approach the most critical objective of your organization? Probably you would start by qualifying this objective and start a project to accomplish it. Break it down to smaller goals, milestones and put some planning around it? May be you would further break down the goals into small actionable items and schedule some activities. Some of you would setup a rhythm to periodically accomplish the smaller tasks in order to realize your grand objective.No matter whatever process or methodology you follow, you would certainly NOT leave your most critical objective to chance..certainly NOT by adopting an ad-hoc approach.My moment of epiphany arrived when I realized "Continuous Self Learning" is the most critical aspect of my career. Probably the same applies to most of the readers of this blog.So, how to you approach your personal 'Learning'? Is there a method? Or is it left to chance?

Testing Extended Devise Controllers

over 6 years ago | Amit Kumar: toamitkumar's Code Blog

Devise has become the de-facto library if you ever need Authentication. Tonnes of pluggable components which you can easily enable/disable.For our application we had to reset session and easiest and cleanest way to do was to extend the devise - SessionsController:For testing this piece:With smiling face I ran the spec buuuuuuttttttttttttttttt arrrrggghhhh:AbstractController::ActionNotFoundChecking the devise filters helped with some direction:Have fun !! Comments Amit Kumar Glad this helped you.. !! Shlomo Brilliant. Thanks.

Introducing R in the Enterprise

over 6 years ago | Prasoon Sharma: Enterprise Software Doesn't Have to Suck

We've introduced R in the organization!It is running along with the heavy weights of statistical analysis like SAS, SPSS, Matlab. Here's what we did and how we did it...HOW DID IT START?I started learning R last year and loved its simplicity and power. After using it primarily for personal projects, I came across a business problem in which R can be considered a good fit.BUSINESS PROBLEMThe business need was to build a web-based tool for marketing budget optimization  - Marketing RoI (Return on Investments) i.e. how should a company that has multiple advertisement channels allocate its marketing budget across multiple channels to maximize profit or customer loyalty or customer life time value (LTV).1) Input: The input to the analysis is the company's historical marketing budget allocation, profit, customer loyalty and LTV. 2) Analysis: This analysis is done in 2 steps.- Step 1) Our experts create a formula that relates the inputs given with RoI and LTV etc. It involves econometric techniques etc.- Step 2) Optimization of the formula when the user conducts what-if analysis by varying total budget and/or spend across individual channels to see its effect on RoI and LTV. The desktop optimization model written in Excel using a commercial Excel plugin.3) Output: Optimized spend across advertising channels and ability to evaluate multiple scenarios to determine optimum marketing mixThe initial version of the tool runs as an Excel model using a commercial Excel plugin. The business objective was to transform this Excel-based single-user application into multi-user web-based application.TECHNICAL SOLUTIONA) Web application: The web forms needed to allow users to input data and run scenarios were simple. We develop web applications using Ruby on Rails on LAMP internally. Ruby on Rails gives us an agile environment to develop software by taking care of routine web application tasks like database connectivity. B) Optimization: Since, the Excel model uses a commercial plugin for step 2, the stakeholders started with the hypothesis of using the same commercial plugin's server version for optimization in the web application too.For this we had to prove a couple of things:1) Optimization of formula from step 12) Integration with web applicationOption 1: Commercial optimization engineWe did a quick spike to test optimization with the commercial optimization plugin's server version and also its integration with Ruby on Rails web application and it was successful. We had to use JRuby to integrate Ruby with plugin's server edition as it provides only Java and .NET API.Option 2: R (Open source)In parallel, we checked if R can be used. R is a leading open source statistical environment.- To solve the optimization problem in R we found a lot of R optimization packages and started testing packages like BB as the formula (from step 1) was non-linear, and had constraints and conditions. We tested BB's SPG function and also tried other generic algorithms. We got good optimization results from R (similar or better compared to commercial optimization engine).- Now we had to check how to integrate R with our web application written in Ruby. We found a number of options like integrating R with Apache (rApache) or integrating R directly with Ruby (rsruby). We decided to use rsruby.We ran a number of proof of concepts with R and shared results with stakeholders. The results were positive in terms of performance as well as the optimized results... So we got better results and that too for free! LESSONS LEARNEDTechnicalYou need to be careful in running it in a shared environment, where it can use all your CPU and memory if it runs for longDon't forget to write unit tests using RUnit for your R codeCapturing exceptions from R and dealing with them properly (appropriate message to users)rsruby installation documentation is good but needs a few tries depending on your Linux distributionrsruby does not run on Windows (wasn't a problem for us as we run our web applications on LAMP)ProcessUser acceptance testing: If you are transforming an Excel-based model into web-version, it is critical to have a fully working example of the Excel model to replicate it in R/other statistical packagesOvercoming the challenges of using new open source software in enterprise: Like most enterprise IT shops, we are used to commercial software as well and the idea of using open source software to do serious work is limited to the most popular open source frameworks like Drupal, Ruby on Rails, Linux. We positioned R as an add-on to our LAMP environment and got a separate virtual server dedicated to it as it is memory hungry.

Rails 3 and Controller Callbacks - demystified

over 6 years ago | Amit Kumar: RubyizednRailified

I wanted to quickly check the callbacks that my controller has in my new Rails 3 application. With more abstraction in Rails 3 (AbstractController) - the easiest way I found was:Other ways to do ?