Logo

Who is talking?

Archive

Concurrent Ruby on MRI / JRuby

about 3 years ago | Rocky Jaiswal: Still Learning

Truth be told I am a big fan of Ruby, it is a clean, easy to pick and productive language. Rails is also by far the most feature rich web application framework available. However, Ruby misses a few (modern) language features, most of them involving "Concurrency". JRuby solves some of those problem ...

The impact of SqlDataReader.GetOrdinal on performance

about 3 years ago | Kristof Mattei: Kristof's blog

I recently had a discussion about the impact of SqlDataReader.GetOrdinal on execution of a SqlClient.SqlCommand. I then decided to run some code to measure the difference, because I think that’s the only way to get a decent opinion. This is the code that I’ve used to run a certain query 1000 times: private void InvokeQuery(Action mapObject) … Continue reading "The impact of SqlDataReader.GetOrdinal on performance" The post The impact of SqlDataReader.GetOrdinal on performance appeared first on Kristof's blog.

The impact of SqlDataReader.GetOrdinal on performance

about 3 years ago | Kristof Mattei: Kristof's blog

I recently had a discussion about the impact of SqlDataReader.GetOrdinal on execution of a SqlClient.SqlCommand. I then decided to run some code to measure the difference, because I think that’s the only way to get a decent opinion. This is the code that I’ve used to run a certain query 1000 times: private void InvokeQuery(Action mapObject) … Continue reading "The impact of SqlDataReader.GetOrdinal on performance" The post The impact of SqlDataReader.GetOrdinal on performance appeared first on Kristof's blog.

Github cherry picking

about 3 years ago | Sumit Bajaj: Sumit Bajaj's Blogs

What is cherry picking ?Cherry picking is plucking selective code to push to another branch. Sometime team is working on several modules and there is urgency to fix some production issue and deploy it.We can have two ways of doing it1. Create a separate branch from master (production branch) , for example name it as "branch1" and fix the bug and merge that branch into master back.2. Fix the bug in existing branch and cherry pick it in master branch. This way only selective changes would be pushed to master and not all code.Whenever we push some code in git, it creates a unique commit id.For example:Unique commit id looks like shown in green boxCopy that commit id which you want to cherry pick.Git checkout to master branch (where you want to cherry pick)$ command: git checkout masterCherry pick the selected commit by passing commit id.$ git cherry-pick b38adf46f21c963b6e85a804ef3942ad8d0b4e4dSelected commit will be merged into masterNow you can check the status and push the code respectively.Note: Cherry pick should be incremental and sequence wise. First commit should be cherry picked first followed by second and so on. Have a great day ahead !!

Benefits of SOA in complex Rails applications

about 3 years ago | Gourav Tiwari: easy_software = Agile.find(ruby_on_rails)

Often I saw that initial POC(Proof of concept) rails apps are sleek, sweet and beautiful from code perspective. But as requirements grow, it gets complex and starts falling apart. There could be several reasons:I was using twitter-bootstrap-rails gem but now I need foundation or may be my own custom look and feelI need to do lot of customization/monkey-patching as one feature needs gem 'X' which doesn't work on Oracle and my whole app is on Oracle/MySQL/etcEvery time I change something, it breaks application (including views).Sometimes we accommodate changes and integrate another DB/technology, but it leaves code smells.What if tomorrow client requires new NoSQL database? Can I integrate it without breaking lot of features?Answer is SOARecently on a project I, along with colleagues, implemented SOA (Service Oriented Architecture) in Rails application and I am fascinated by Rails contributors again!Rails provide a gem called: 'rails-api', a nice extraction from Rails library to provide exactly what is needed for SOA.WIth Rails API:BAD: You will miss rails views/form-helpers/view-helpers while using rails-api gem. Good news is, you will get a chance to implement it in HTML/JS with your favorite JS framework, e.g. AngularJS etc.GOOD: You only need to care about REST-ful APIs and expect JSON objects in response.BEAUTIFUL: Backend and frontend will communicate via REST-ful APIs, so anytime you make a change in backend/change database, view will not bother. You can even change whole backend and implement backend in a different language/framework! Same goes with frontend, if you don't like AngularJS someday, you can use SailsJS etc.SummaryImplementing your application on SOA doesn't require an overhaul, if your application has legacy code. You can change one unit at a time and replace it with one service. Although it is not silver bullet, but this architecture-design, allows flexibility on picking technology, at the same time, you application can be still manageable. Implementing a new feature means just adding/modifying a single service :)

Benefits of SOA in complex Rails applications

about 3 years ago | Gourav Tiwari: easy_software = Agile.find(ruby_on_rails)

Often I saw that initial POC(Proof of concept) rails apps are sleek, sweet and beautiful from code perspective. But as requirements grow, it gets complex and starts falling apart. There could be several reasons:I was using twitter-bootstrap-rails gem but now I need foundation or may be my own custom look and feelI need to do lot of customization/monkey-patching as one feature needs gem 'X' which doesn't work on Oracle and my whole app is on Oracle/MySQL/etcEvery time I change something, it breaks application (including views).Sometimes we accommodate changes and integrate another DB/technology, but it leaves code smells.What if tomorrow client requires new NoSQL database? Can I integrate it without breaking lot of features?Answer is SOARecently on a project I, along with colleagues, implemented SOA (Service Oriented Architecture) in Rails application and I am fascinated by Rails contributors again!Rails provide a gem called: 'rails-api', a nice extraction from Rails library to provide exactly what is needed for SOA.WIth Rails API:BAD: You will miss rails views/form-helpers/view-helpers while using rails-api gem. Good news is, you will get a chance to implement it in HTML/JS with your favorite JS framework, e.g. AngularJS etc.GOOD: You only need to care about REST-ful APIs and expect JSON objects in response.BEAUTIFUL: Backend and frontend will communicate via REST-ful APIs, so anytime you make a change in backend/change database, view will not bother. You can even change whole backend and implement backend in a different language/framework! Same goes with frontend, if you don't like AngularJS someday, you can use SailsJS etc.SummaryImplementing your application on SOA doesn't require an overhaul, if your application has legacy code. You can change one unit at a time and replace it with one service. Although it is not silver bullet, but this architecture-design, allows flexibility on picking technology, at the same time, you application can be still manageable. Implementing a new feature means just adding/modifying a single service :)

Inefficiencies in Indian telecom sector - A case for change in regulations

over 3 years ago | Lalatendu Das: Interpretations of technorealism

While telecom operators world over are embracing digitization to deliver improved customer experience and make operations more efficient, their counter-parts in India are seriously handicapped by a set of stifling regulations.Sample this (Source - Regulation on Verification of new mobile subscribers )3 (i) - Physical Customer Acquisition form (CAF). "A passport sized photograph of the subscriber should be pasted ....The person at PoS shall get the CAF duly tiled and singed..."3 (iv) - Manual Verification as a pre-requisite to activation - "The mobile connections shall be activated only after the requirement of filling up of customer acquisition form and copies of documentary proof as per requirement have been fulfilled by the customer and the subscriber details have been updated in the subscriber database of the licenser for this purpose, the licensee (the employee of Licensee) shall verify and record on the CAF under his name, designation and Signature that all the documentary requirement has been completed and subscriber details are updated in the database of licensee"3 (vii) - Pre-activated SIM Card is not to be sold.3 (xi) - Pre-paid to Post-paid change (& vice versa) - "incase of change of existing mobile connection from pre-paid to postpaid and vice versa also, the above instructions from 3(i) to .3(viii) shall apply"Here is an estimate of inefficiencies (in Indian telecom industry) resulting from these regulationsAbsence of a Digital CAF - In 2013, approximately 9.1 million new subscribers available mobile connections. Assuming Rs 10 goes for handling of physical CAF/ subscriber and Rs 2 / subscriber goes for storage, retrieval, the Industry spent approx Rs 11 Crores (9.1 mil * Rs 12) on processing physical CAFs in 2013 alone. Imagine the level of efficiency, if the govt allows Digital CAFs for a certain segment of people with strong POI e.g. As of last count nearly 50% of our population has Aadhaar cards)Need for Manual Verification? - On paper, this clause places a nominal accountability on the licensee to detect and prevent fraud. But at what cost. A national player has to keep approximately 1000 to 1200 employees at various hubs to manually verify and sign the CAFs. Considering top 5 national players we are looking at 6000 full time employees dedicated to serve this regulation alone. Assuming bare minimum Rs 4 lakhs CTC, we are looking at Rs 240 Crores salary spend on this non value adding activityWould DoT wake up from it's deep slumber and take a objective view on such archaic regulations?

Menu on the wrong side with a touch screen?

over 3 years ago | Kristof Mattei: Kristof's blog

When you’re reading this you probably have a touch screen. So, I never use my touch screen. Almost never. But I did notice that by default my menus in Windows (from a menu bar, not a ribbon) appear (when possible) on the right side of the clicked menu item. Like this: Goosebumps. Something is off. … Continue reading "Menu on the wrong side with a touch screen?" The post Menu on the wrong side with a touch screen? appeared first on Kristof's blog.

Menu on the wrong side with a touch screen?

over 3 years ago | Kristof Mattei: Kristof's blog

When you’re reading this you probably have a touch screen. So, I never use my touch screen. Almost never. But I did notice that by default my menus in Windows (from a menu bar, not a ribbon) appear (when possible) on the right side of the clicked menu item. Like this: Goosebumps. Something is off. … Continue reading "Menu on the wrong side with a touch screen?" The post Menu on the wrong side with a touch screen? appeared first on Kristof's blog.

AngularJS Promises - The Definitive Guide

over 3 years ago | Dave Kerr: dwmkerr.com

Promises are a core feature of AngularJS - whether you understand them or not, if you use AngularJS you've almost certainly been using them for a while. In this post I'm going to explain what promises are, how they work, where they're used and finally how to use them effectively.

Including another berksfile in your berksfile

over 3 years ago | Steve Jansen: /* steve jansen */

As part of my cooking with Chef’s new workflow, I wanted Berkshelf to dynamically import the secondary dependencies of my site-cookbook’s dependencies. Thanks Vasily Mikhayliche’s Coderwall post and Seth Vargo’s post on Berks magic, I was able to hack something that worked for me with Berkshelf v2.0. (We don’t have time to migrate to Berks 3.0 for another couple of weeks, and this feature doesn’t seem to be part of Berks 3.0). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 # vi:ft=ruby: site :opscode # Extension method to import secondary dependencies in a referenced site-cookbook # using the constraints in the site-cookbook's Berkshelf file, rather than just # the name of the dependencies in the site-cookbook's metadata.rb file # # credit: https://sethvargo.com/berksfile-magic/ # https://coderwall.com/p/j72egw def site_cookbook(path) berksfile = "../#{path}/Berksfile" if File.exists?(berksfile) contents = File.read(berksfile) # comment out lines like `site :opscode`, which cannot be imported multiple times contents = contents.gsub(/(^\s*site\s)/, '#\1') # comment out lines like `metadata`, which cannot be imported multiple times contents = contents.gsub(/(^\s*metadata\s)/, '#\1') instance_eval(contents) end end cookbook 'nginx', '~> 2.4.4' site_cookbook 'my-site-cookbook' Happy cooking!

Better Specifications

over 3 years ago | Dave Kerr: dwmkerr.com

Specifications are absolutely key to the success of a project. Unless you have a good definition of what your project is supposed to be, there's no way you can deliver it. A specification is the contract between you and the client, the basis for technical designs, quality assurance test plans,

Adding Chef encrypted data bags to source control

over 3 years ago | Steve Jansen: /* steve jansen */

I’ve been using Chef for a bit now and generally a huge fan of the new Chef workflow. We are working hard to attain true continuous delivery and test driven development with Chef. The devil is in the details now. One small wrinkle in our effort has been marrying encrypted data_bags with our chef-repo in GitHub. I don’t want to type the optional argument --secret-file ~/.chef/encrypted_data_bag_secret everytime I interact with a data bag. So, I added this option to my ~/.chef/knife.rb file. 1 knife[:secret_file] = "#{current_dir}/encrypted_data_bag_secret" However, this precludes me from easily exporting the edited file to disk. The export will always be my secret plaintext, not the encrypted ciphertext. Not exactly what you want to commit to GitHub. 1 2 3 knife data_bag create users jenkins # DON'T COMMIT THIS... the exported file will be unencrypted knife data_bag users jenkins --format=json > data_bags/users/jenkins.json So, I decided to create a bash alias to temporarily disable the knife.rb setting and export the data bag to a file: My ~/.bash_profile file contains this alias: 1 2 3 4 5 6 function knife-ciphertext () { sed -e "s/knife\[\:secret_file\]/\#knife\[\:secret_file\]/" -i .bak ~/.chef/knife.rb knife $@ --format=json mv ~/.chef/knife.rb.bak ~/.chef/knife.rb } alias knife-ciphertext=knife-ciphertext This bash function comments out the secret file option in knife.rb using sed’s in-place editing. Now I can commit the data bag in its encrypted format: 1 2 3 knife-ciphertext data_bag show users jenkins > data_bags/users/jenkins.json git add data_bags/users/jenkins.json git commit -m 'adding the latest jenkins data bag' Happing cooking!

Blogging with Ghost

over 3 years ago | Dave Kerr: dwmkerr.com

tl;dr Ghost is a blogging platform well worth considering if your blog is all about development. I've been having some gripes with WordPress as a platform for blogging lately. For development focused blogs like this one, there are some things about it that make writing posts just a little