Agile Zone is brought to you in partnership with:
DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
  • submit to reddit
Ian Mitchell03/08/14
2962 views
0 replies

Pull in Practice

Pull is the driving force behind smooth and efficient agile practice. What is its nature though, and how can we harness it? In this article we explore where pull comes from and how it propagates. Can the strange magic behind it be explained in terms of scientific management?

#!/usr/bin/env ruby
require 'digest/md5'
require "addressable/uri"

# this is based on gravatar image API
# https://en.gravatar.com/site/implement/images/
# options :
# size : <integer> size of image
# default: <string> url of image if email not found or:
#  * 404
#  * mm
#  * identicon
#  * monsterid
#  * wavatar
#  * retro
#  * blank
# forcedefault: "y" force default image to load
# rating: <string> one of the values : g, pg, r, x
def gravatar email, *options
	email_md5 = Digest::MD5.hexdigest email
	unless options.empty?
		params = Addressable::URI.new
		params.query_values = options.first
		params_query = "?#{params.query}"
	end
	"http://www.gravatar.com/avatar/#{email_md5}#{params_query}"
end


puts gravatar('blazeeboy@gmail.com')
puts gravatar(
	'blazeeboy@gmail.com', 
	size: 200, 
	default: 'https://pbs.twimg.com/media/BheUcQMIAAA0Gns.jpg:large'
	)
George Dinwiddie03/07/14
5640 views
0 replies

What does it mean for an estimate to be right?

If we choose conformance to actuals as the definition for the “rightness” or “goodness” of an estimate, we’re certainly encouraging overestimation. It’s easier to overestimate and then waste effort as needed to be “accurate” than to underestimate and try to hit a possibly impossible target. Those who ask for estimates using this definition know this, so they are likely to arbitrarily cut the estimate in order to put pressure on development and prevent padding.

Chris Haddad03/07/14
6802 views
0 replies

DevOps = DevOps Principles + DevOps Practices

Successful, long-lasting movement have a clear manifesto outlining goals and principles. Many DevOps adopters may not be aware of the DevOps Manifesto (created by Jez Humble @jezhumble) nor how successful DevOps requires keeping a clear focus on principles, practices, and value (instead of infrastructure tooling).

David Green03/07/14
11395 views
11 replies

Why shouldn't I test private methods?

Why shouldn’t you test private methods? Because the fact you’re asking the question means the method shouldn’t be private – it’s a piece of independent behaviour that warrants testing. The hard choice, the design decision, is where you stick it.

#!/usr/bin/env ruby
require 'mail' # gem install mail --no-document

# Credit to : 
# http://stackoverflow.com/questions/12884711/how-to-send-email-via-smtp-with-rubys-mail-gem

def ask question
  print "#{question} ? : "
  $stdin.gets.chomp!
end

# get it from : 
# https://www.tumblr.com/settings/blog/yourBlogName
# in the Post by Email section
tumblr_email = 'xxxxxxx@tumblr.com'

email = ask('what is your gmail address')

$options = { 
	:address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => email,
  :user_name            => email,
  :password             => ask('what is your password'),
  :authentication       => 'plain',
  :enable_starttls_auto => true  
}

Mail.defaults do
  delivery_method :smtp, $options
end


Mail.deliver do
  from     $options[:user_name]
  to       tumblr_email
  body     ask('write any message associated with the image')
  ARGV.each do |file|
    add_file file
  end
end

puts 'Posting to tumblr succeeded :)'
Avishek Sen Gupta03/06/14
5497 views
0 replies

Advice for the New Tech Lead: The Realities of Distributed Development

Let’s face it; not everyone has been there and done that, when it has come to Distributed Development. And if you have, there is a high probability that you were probably in a distributed team, you mostly worked with one group or the other, but not both. These words I will probably keep repeating in the future, but I’m not apologising for them: Never be Complacent.

#!/usr/bin/env ruby

# Credits to :
# http://stackoverflow.com/questions/16365553/creating-gist-from-a-ruby-script
# i modified the script alittle bit to read files from params
require 'net/http'
require 'json'


uri = URI("https://api.github.com/gists")

files = {}
ARGV.each do |f|
	files[f] = {
		content: File.read(f)
	}
end

payload = {
  'public' => true,
  'files' => files
}

req = Net::HTTP::Post.new(uri.path)
req.body = payload.to_json

puts req.inspect
puts req.body.inspect

# GitHub API is strictly via HTTPS, so SSL is mandatory
res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) do |http|
  http.request(req)
end

response = JSON.parse res.body
puts response['html_url']
Alec Noller03/05/14
9028 views
0 replies

Dev of the Week: Matt Butcher

Every week here and in our newsletter, we feature a new developer/blogger from the DZone community to catch up and find out what he or she is working on now and what's coming next. This week we're talking to Matt Butcher, Lead Cloud Engineer at Revolv, Inc, author, and teacher at Loyola University Chicago.

Benjamin Ball03/05/14
10698 views
0 replies

DZone Weekly Link Roundup (March 5)

This week in the link roundup: Intel joins the smartwatch arms race with a $100M purchase, Facebook looks to go into low-orbit, Flexcoin shuts its doors, PHP gets a renaissance, a programmer finally admits his limitations, we learn that God created the universe on Rails, and Jurassic Park comes to your browser.

Mike Cottmeyer03/05/14
6734 views
0 replies

Don’t sell me agile, solve my problem

A wise, retired CIO told me, “Don’t sell me your solution, solve my problem.” That statement further solidified my belief that I am not “implementing agile” (hang with me), but rather I am solving a problem or a set of problems that commonly occur in enterprise environments.

Nikita Salnikov...03/05/14
5869 views
0 replies

How (Not) to Create a Permgen Leak

The code snippet is rather straightforward, iterating over a loop and generating classes at the runtime. When facing an Error, the code above is well prepared to catch it and print out the stacktrace. Apparently, the situation is a bit more complex than this - half an hour later I found myself still staring at a somewhat different error message. I

Paul Duvall03/05/14
5546 views
0 replies

Creating a Secure Deployment Pipeline in Amazon Web Services

Many organizations require a secure infrastructure. I’ve yet to meet a customer that says that security isn’t a concern. But, the decision on “how secure?” should be closely associated with a risk analysis for your organization.

George Dinwiddie03/05/14
4561 views
0 replies

Tracking Agile Velocity

It’s very common for organizations to track the velocity of the Agile teams over time. This is quite a reasonable datapoint to plot. Combined with other data, it might give you some insights when you look back, and insights based on data are typically more useful than insights based on opinion. Remember, though, to keep in mind what the data is, and what it is not.

Nathan Slippen03/05/14
2266 views
0 replies

Scaling Agile for Enterprise: Biggest Mistakes and How to Avoid Them

Applying Agile methods to an organization on an enterprise level can be difficult. In order to ensure product quality, minimal time-to-market and increased value, avoid these mistakes when embarking on this transformation.

#!/usr/bin/env ruby
require 'mail'

mysql_username = 'root'
mysql_password = '123456'
mysql_database = 'test'
system("mysqldump --user=#{mysql_username} --password=#{mysql_password} #{mysql_database} > backup.sql")


# Credit to : 
# http://stackoverflow.com/questions/12884711/how-to-send-email-via-smtp-with-rubys-mail-gem
options = { 
	:address              => "smtp.gmail.com",
    :port                 => 587,
    :domain               => 'xxxxxxxxx@gmail.com',
    :user_name            => 'xxxxxxxxx@gmail.com',
    :password             => 'xxxxxxxxx',
    :authentication       => 'plain',
    :enable_starttls_auto => true  
}

Mail.defaults do
  delivery_method :smtp, options
end


Mail.deliver do
  from     options[:user_name]
  to       options[:user_name]
  subject  "Database #{mysql_database} backup #{Time.new}"
  body     "Database #{mysql_database} backup #{Time.new}"
  add_file 'backup.sql'
end

File.delete 'backup.sql'
Richard Warburton03/04/14
5737 views
0 replies

An open source JVM Sampling Profiler

It's a well known deficiency of most existing sampling Java profilers that their collection of stack traces has to happen at a safe point. A while back Jeremy Manson open sourced some proof of concept code where calls are made to the AsyncGetCallTrace JVMPI method which avoids the need for threads to reach a safe point in order to read their call trace. I've taken this code dump and started converting it into a usable open source project.

Ayende Rahien03/04/14
2433 views
0 replies

Tweaking xUnit

In particular, we current have over three thousands tests, and they take hours to run. We are doing a lot of stuff there “let us insert million docs, write a map/reduce index, query on that, then do a mass update, see what happens”, etc.

Mike Cottmeyer03/04/14
7158 views
0 replies

Compensation Strategies for Agile Teams

The key challenges around compensation, at least for me, center around figuring out how to reward individual performance without encouraging internal competition, local optimization, or one person feeling rewarded while another feels punished. You want compensation to motivate people, not to have a negative impact on performance.

Mike Hadlow03/04/14
4915 views
0 replies

Git Tips: Revert with a new commit

Sometimes you want to set the state of your project back to a previous commit, but keep the history of all the preceding changes. You want to make a commit that reverses all the changes between your previous commit and the current HEAD.