Skip to content

Software Development Blogs: Programming, Software Testing, Agile Project Management

Methods & Tools

Subscribe to Methods & Tools
if you are not afraid to read more than one page to be a smarter software developer, software tester or project manager!

Programming

3 Ways to Accelerate Business Value

I was talking with a colleague recently about the following question:

“How do you accelerate business value?”

One of the key challenges in today’s world is accelerating business value.   If you’re implementing solutions, the value doesn’t start to get realized until users actually start to use the solution.

THAT’s actually the key insight to help you accelerate business value.

It’s adoption.

When you are planning, if you want to accelerate business value, then you need to think in terms of pushing costs out, and pulling benefits in.  How can you start throwing off benefits earlier, and build momentum?

With that in mind, you have three ways to accelerate business value:

  1. Accelerate adoption
  2. Re-sequence the scenarios
  3. Identify higher value scenarios

Before you roll out a solution, you should know the set of user scenarios that would deliver the most business benefits.

Keep in mind benefits will be in the eyes of the stakeholders.

If the sequence is a long cycle, and the adoption curve is way out there, and benefits don’t start showing up until way downstream, that’s a tough sell.   And, it puts you at risk.   These days, people need to see benefits showing up within the quarter, or you have a lot of explaining to do.

1.  Accelerate Business Adoption

So one of the ways to accelerate business value is to accelerate adoption.    There are many change frameworks, change patterns, strategies and tactics for driving change.    Remember though that it all comes down to behavior change and changing behaviors.  If you want to succeed in driving change in today’s world, then work on your change leadership skills.

This approach is about doing the right things, faster.

2.  Re-Sequence the Scenarios

Another way to accelerate business value is to re-sequence the scenarios.   If your big bang is way at the end (way, way at the end), no good.  Sprinkle some of your bangs up front.   In fact, a great way to design for change is to build rolling thunder.   Put some of the scenarios up front that will get people excited about the change and directly experiencing the benefits.  Make it real.

The approach is about putting first things first.

3.  Identify Higher Value Scenarios

The third way to accelerate business value is to identify higher-value scenarios.   One of the things that happens along the way, is you start to uncover potential scenarios that you may not have seen before, and these scenarios represent orders of magnitude more value.   This is the space of serendipity.   As you learn more about users and what they value, and stakeholders and what they value, you start to connect more dots between the scenarios you can deliver and the value that can be realized (and therefore, accelerated.)

This approach is about trading up for higher value and more impact.

If you need to really show business impact, and you want to be the cool kid that has a way of showing and flowing value no matter what the circumstances, keep these strategies and tactics in mind.

The landscape will only get tougher, so the key for you is to get smarter and put proven practices on your side.

People that know how to accelerate business value will float to the top of the stack, time and again.

You Might Also Like

10 Big Ideas from Getting Results the Agile Way

10 Ways to Make Agile Design More Effective

Agile Methodology in Microsoft patterns & practices

Change Quotes

How We Adhered to the Agile Manifesto on the patterns & practices team

Categories: Architecture, Programming

Getting Started With Google’s Dart Language

2013-06-16_11-12-28_thumb.png

I was a little skeptical of the Dart language when Google first announced it.

When I looked at the syntax of the language I thought that it didn’t really seem to offer anything new.

Why create another language that is not very different than what we already have?

How is this actually much better than JavaScript?

But after having worked with Dart now for quite awhile and producing a Pluralsight course on Dart, I’ve completely changed my mind.

The Dart language is awesome!

What makes the Dart language so awesome is all the little subtleties the language designers added to the language, not any major new concepts or ideas.

When I started writing Dart code it felt exactly right.  It felt like all the little annoyances that I had with languages like C#, Java and JavaScript were removed by the Dart language.

In fact, the real beauty of Dart is that if you already know C# or Java and JavaScript, you’ll probably be able to learn enough about the Dart language to be productive in Dart in less than an hour.

Before I show you just how easy it is to get started, let me briefly tell you what the Dart language is:

  • Object oriented.  Everything is an object including primitives and nulls
  • Optionally typed.  You can add type annotations which static checking tools can use to help you find errors in your code, but you don’t have to use them.
  • Interpreted.  Dart is run in a VM, but it is not compiled first.  Round-trip time for making changes is very short.
  • Compatible with JavaScript.  You can compile your Dart code to JavaScript and run Dart applications in any modern browser.
  • FAST!  Dart is very fast, much faster than JavaScript in just about every test.

Some cool language features that I like about the Dart language:

  • Mixins.  Instead of using inheritance, you can use a mixin to add functionality to a class without directly inheriting from another class.
  • Isolates.  Instead of threads, the Dart language uses isolates for concurrency.  Isolates can’t actually share any memory, they pass information though messages.  It is very hard to shoot yourself in the foot.
  • Simplified built-in types.  Numbers can be either int or double, and you can just use num, if you don’t care.  Lists and maps can be declared as literals.  An array is just a special case of a list.
  • Functions are first-class objects.  You can pass them around just like any other object.  There is even a lambda-like short-hand for creating a one-liner function.
  • Top level functions and variables.  Don’t want to put a function or variable in a class?  Good, you don’t have to.  In the Dart language, you can declare them anywhere you want.
  • Simplified classes.  There is short-hand for declaring constructors that assign parameters to class members.  Class members don’t have protected, private, public.  Member variables are automatically properties.
  • String interpolation.  No more string format methods, just use the $variableName in a string to have its value expanded.
Getting setup with the Dart language

Ready to get running in 5 minutes?

Ok, read on.

Step 1: Go to http://dartlang.org and click “Get started.”

Dart Language Homepage

Step 2: Download Dart (64-bit or 32-bit.)  Unzip the file and copy the “dart” folder to where you want Dart installed.

This folder will contain the Dart Editor, the Dart SDK and the Chromium web browser which has a built-in Dart VM.

Step 3: Run DartEditor.exe

Dart_Editor_2013-06-16_11-18-01

That is it, now you are ready to rock some Dart code!

Creating your first Dart language App

The Dart language can actually be used outside of a browser, just like you can use JavaScript with Node.js.  But, most developers will probably want to use Dart the same way we use JavaScript in a web application today.

I’m going to walk you through a real simple example that will show you how to create a basic Dart application that is able to respond to a button click and manipulate some DOM data.  For more advanced examples, you can check out my recently released Pluralsight course on Creating Web Applications with Dart. (I will plug this one more time before this post is over
 wait for it
)

Step 1:

Go to File –> New Application.

Fill in your application name.  I’ll call mine HelloWorldDartWeb.

Leave “Generate sample content” checked.

Select “Web application.”

2013-06-16_11-24-03

Step 2:

Open the helloworlddartweb.html file and clear out everything in the body element except for the two script tags at the bottom.

The first script tag imports our actual Dart file, just like you would use to add JavaScript to a page.

The second script adds Dart support to the browser.

Step 3:

Add the following HTML to the body tag in the helloworlddartweb.html file:

 <button id="theButton" >Press Me!</button>
 <div id="resultDiv"></div>

This will just create a button and a div.  We are going to add some Dart code to respond to a button click and populate the div with some text.

Step 4:

Open the helloworlddartweb.dart file and clear out everything in main() and delete the reverseText function.

Notice that there are only two things we really will need in our .dart file.  Just an import ‘dart:html’, to import that html library for Dart, and the main function, which executes as soon the DOM content is loaded on the page.

Step 5:

Edit the helloworldweb.dart file to make it look like this:

import 'dart:html';

void main() {
  var button = query("#theButton");
  button.onClick.listen(addResult);
}

void addResult(Event e) {
  var resultDiv = query("#resultDiv");
  resultDiv.text = "You clicked the button";
}

This code simply gets the button using a CSS selector.  It uses the query function to do this.

Then we register the addResult function as an event handler for the onClick event for the button.

In the addResult function, we simply query for the resultDiv and change its text.

After you run this example, you should see a result like this:

HelloWorldDartWeb_-_Chromium_2013-06-16_11-47-56

Step 6:

Now change the Dart code to look like this:

import 'dart:html';

void main() {
  query("#theButton")
    .onClick.listen(
        (e) => query("#resultDiv").text = "You clicked the button!"
    );
}

Try running the code again and you should see it works exactly as before.  Here we just shortened the code to a single line by using the short-hand function syntax.

Going further with the Dart language

So, that is just the basics of Dart.  I wanted to show you how to get started really quickly, but I am sure there is more you will want to learn about Dart.

We can of course do much more with Dart, especially when building web applications.  There is a Dart Web UI library which can be used to do templating and data binding so we can simplify our Dart code even further.

The language itself is pretty simple.  Most C# and Java developers, as well as JavaScript developers, should be able to read and understand Dart code without any assistance.  But here is a link to an overview of the language.

If you are looking for a more in-depth coverage of the Dart language and want to see how to build a real application with Dart, check out my Introduction To Building Web Applications With Dart course on Pluralsight, where I go over the entire language and guide you through building a real application, as well as cover some of the more advanced features like mixins and isolates.

Also, I could only find two books on the Dart Language.

I don’t know if Dart will end up replacing JavaScript, but I do think Dart has the potential.  It really is an awesome language that is fun to develop in.

That is strong praise coming from me, since I really tend to dislike dynamic languages.  The creators of Dart have really done a good job of creating a language that is succinct, fast, easy to work with and has the best advantages of strongly typed languages with all the flexibility of dynamic languages like JavaScript.

Get Up and CODE and YouTube Videos

For those of you who frequent my blog and are looking for my latest Get Up and CODE podcast episode and YouTube video for the week, I have a bit of an announcement.

I am going to start posting these blog posts every Monday.

The YouTube videos will be going up every Wednesday.

The Get Up and CODE podcast will be coming on every Friday.

When my new website design is done, you’ll be able to find the latest episodes of each on the side bar, so I’ll stop including them in each weekly post.

But here is last week Get Up and CODE, where Iris and I talk about basic weight training.

Get Up And Code 006: Basic Weight Training

jQuery(document).ready(function($) { $('#wp_mep_1').mediaelementplayer({ m:1 ,features: ['playpause','current','progress','duration','volume','tracks','fullscreen'] ,audioWidth:400,audioHeight:30 }); });

!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');

The post Getting Started With Google’s Dart Language appeared first on Simple Programmer.

Categories: Programming

3 Personal Development Programs that Give You an Edge in Work and Life

“We must become the change we want to see.” – Mahatma Gandhi

I’m a fan of continuous learning and skills development.   The challenge, though, aside from figuring out which training is worth it, is to first and foremost build a foundation that makes all the rest of your training actually worth it.

The key is to first build a rapid learning foundation that helps you absorb all the other training in a more effective way.

I’ve wasted a lot of money over the years testing and trying out various programs that made great promises.   But, during my trials, I’ve also found programs that really do produce outstanding results.   Of course, like anything, you get what you put into it, but some personal development programs are clearly based on better principles, patterns, and practices.  

That’s the gold, and we have to dig deep to find it among the sea of mediocre personal development programs.

Just last night, I was sharing with a friend, how to read 10,000 words a minute (I’m not there, yet.)   I was explaining the process of training to read without subvocalizing (which slows us down, big time 
 after all, you don’t want the voice in your head to sound like a chip monk, but you don’t actually have to internally vocalize words for your mind to absorb the content.)   Another key is developing high speed imaging skills, where you glance at information and absorb it.  Again, this doesn’t come naturally to most people so you need to train for it.

I realized this personal development program alone has paid me back so many times in so many ways and saved me so much time over the years, whether it’s processing email or devouring books.  I shared with my friend that I don’t have a lot of time to read books, but I’ll use a few hours to read 3-5 books a week, as well as often write up in-depth reviews.  He was amazed, and commented that he’s got a large book pile that he’d like to chomp through.

That’s just one of my secrets that has helped me leap frog in terms of rapid learning and saving massive amounts of time on a daily basis, and being to use my brain for other things than getting mired in walls of text.

But there are more.  

In fact, today I decided to share 3 personal development programs that give you an edge in work and life.    I’ll bottom line it for you here, that the three personal development programs are 1)  Personal Power, by Tony Robbins, 2) The Personal Mastery Program, by Srikumar S. Rao, and 3) Lead the Field, by Earl Nightingale.

In my write up, I shared quick stories on how each of them has helped me gain specific advantages in work and life.  In fact, some almost seem like unfair advantages because of the results they produced.

If you are looking to find the difference that makes the difference, or get an extreme advantage in our ultra-competitive world, then these 3 personal development programs should really help you out.

BTW – here is a tip that I often share when it comes to competition.   While you can draw inspiration from your “competition,” the best way to compete is to actually compete with yourself.   Whether that means pursuit a path of relentless excellence, or simply pushing yourself to higher ground, that’s where your breakthroughs happen.

Here’s to you and your ability to be awesome at life.

Categories: Architecture, Programming

neo4j/cypher: Finding single hop paths

Mark Needham - Sat, 06/15/2013 - 14:04

The neo4j docs have a few examples explaining how to to write cypher queries dealing with path ranges but an interesting variation that I came across recently is where we want to find the individual hops in a path.

I thought the managers that Chelsea have had since Roman Abramovich took over would serve as a useful data set to show how this works.

So we create all the managers and a ‘SUCCEEDED_BY’ relationship between them as follows:

CREATE (ranieri {name: "Claudio Ranieri"})
CREATE (mourinho {name: "Jose Mourinho"})
CREATE (grant {name: "Avram Grant"})
CREATE (scolari {name: "Luiz Felipe Scolari"})
CREATE (wilkins {name: "Ray Wilkins"})
CREATE (hiddink {name: "Guus Hiddink"})
CREATE (ancelotti {name: "Carlo Ancelotti"})
CREATE (villasBoas {name: "Andre Villas Boas"})
CREATE (diMatteo {name: "Roberto Di Matteo"})
CREATE (benitez {name: "Rafael Benitez"})
 
CREATE (ranieri)-[:SUCCEEDED_BY]->(mourinho)
CREATE (mourinho)-[:SUCCEEDED_BY]->(grant)
CREATE (grant)-[:SUCCEEDED_BY]->(scolari)
CREATE (scolari)-[:SUCCEEDED_BY]->(wilkins)
CREATE (wilkins)-[:SUCCEEDED_BY]->(hiddink)
CREATE (hiddink)-[:SUCCEEDED_BY]->(ancelotti)
CREATE (ancelotti)-[:SUCCEEDED_BY]->(villasBoas)
CREATE (villasBoas)-[:SUCCEEDED_BY]->(diMatteo)
CREATE (diMatteo)-[:SUCCEEDED_BY]->(benitez)
CREATE (benitez)-[:SUCCEEDED_BY]->(mourinho)

We want to write a query which will return the ‘SUCCEEDED_BY’ pairs starting from Claudio Ranieri and working down.

We might start out with this query which starts from Ranieri and goes all the way down the tree finding the next successor:

START m = node:node_auto_index(name="Claudio Ranieri") 
MATCH path = (m)-[rel:SUCCEEDED_BY*]->(successor) 
RETURN EXTRACT(n IN NODES(path): n.name)
==> +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> | EXTRACT(n IN NODES(path): n.name)                                                                                                                                                               |
==> +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> | ["Claudio Ranieri","Jose Mourinho"]                                                                                                                                                             |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant"]                                                                                                                                               |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari"]                                                                                                                         |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins"]                                                                                                           |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins","Guus Hiddink"]                                                                                            |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins","Guus Hiddink","Carlo Ancelotti"]                                                                          |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins","Guus Hiddink","Carlo Ancelotti","Andre Villas Boas"]                                                      |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins","Guus Hiddink","Carlo Ancelotti","Andre Villas Boas","Roberto Di Matteo"]                                  |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins","Guus Hiddink","Carlo Ancelotti","Andre Villas Boas","Roberto Di Matteo","Rafael Benitez"]                 |
==> | ["Claudio Ranieri","Jose Mourinho","Avram Grant","Luiz Felipe Scolari","Ray Wilkins","Guus Hiddink","Carlo Ancelotti","Andre Villas Boas","Roberto Di Matteo","Rafael Benitez","Jose Mourinho"] |
==> +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
==> 10 rows

That gives us all the combinations but unfortunately it includes all the previous successors as well so it’s not quite what we want.

We need to manipulate the query such that we have a list of all the managers and can then follow a single ‘SUCCEEDED_BY’ relationship to find their successor.

We could easily get that list of managers by following the ‘SUCCEEDED_BY’ relationship and getting the nodes on the other side but that would lead to Claudio Ranieri being excluded since he doesn’t have an incoming relationship.

To keep Ranieri we can make use of the 0 length path like so:

START m = node:node_auto_index(name="Claudio Ranieri") 
MATCH path = (m)-[rel:SUCCEEDED_BY*0..]->(mm) 
RETURN mm
==> +--------------------------------------+
==> | mm                                   |
==> +--------------------------------------+
==> | Node[8]{name:"Claudio Ranieri"}      |
==> | Node[9]{name:"Jose Mourinho"}        |
==> | Node[10]{name:"Avram Grant"}         |
==> | Node[11]{name:"Luiz Felipe Scolari"} |
==> | Node[12]{name:"Ray Wilkins"}         |
==> | Node[13]{name:"Guus Hiddink"}        |
==> | Node[14]{name:"Carlo Ancelotti"}     |
==> | Node[15]{name:"Andre Villas Boas"}   |
==> | Node[16]{name:"Roberto Di Matteo"}   |
==> | Node[17]{name:"Rafael Benitez"}      |
==> | Node[9]{name:"Jose Mourinho"}        |
==> +--------------------------------------+
==> 11 rows

If we now follow the ‘SUCCEEDED_BY’ relationship from our list of managers we end up with pairs of managers:

START m = node:node_auto_index(name="Claudio Ranieri")  
MATCH path = (m)-[rel:SUCCEEDED_BY*0..]->(mm)-[:SUCCEEDED_BY]->(successor)
RETURN DISTINCT mm.name, successor.name
==> +-----------------------------------------------+
==> | mm.name               | successor.name        |
==> +-----------------------------------------------+
==> | "Claudio Ranieri"     | "Jose Mourinho"       |
==> | "Jose Mourinho"       | "Avram Grant"         |
==> | "Avram Grant"         | "Luiz Felipe Scolari" |
==> | "Luiz Felipe Scolari" | "Ray Wilkins"         |
==> | "Ray Wilkins"         | "Guus Hiddink"        |
==> | "Guus Hiddink"        | "Carlo Ancelotti"     |
==> | "Carlo Ancelotti"     | "Andre Villas Boas"   |
==> | "Andre Villas Boas"   | "Roberto Di Matteo"   |
==> | "Roberto Di Matteo"   | "Rafael Benitez"      |
==> | "Rafael Benitez"      | "Jose Mourinho"       |
==> +-----------------------------------------------+
==> 10 rows

The code for this is available on the neo4j console if you’re interested in playing with it further.

Categories: Programming

Maven-user starting with package-management in Javascript

Xebia Blog - Sat, 06/15/2013 - 13:47

I wanted to get started with Javascript and AngularJS, a framework for creating frontend for apps – e.g. human user interfaces. Reason:  software is eating the world, but Javascript is eating all software.

I don’t like the messy javascript approach of downloading js files storing them manually in your project-dir, or worse, copy&pasting snippets. I’m used to programming Java, with using Maven to manage my Java-dependencies, and using brew (Mac) or apt-get (Ubuntu) to manage platform-specific dependencies. In this posting all write down my experiences on starting with Javascript-development, with practical use of package managers.

Package management in Javascript

AngularJS as well as lots of other Javascript-frameworks, including well-known ones as jquery, can be installed via a package manager, bower. Bower is a simple and light-weight package manager for the web .

The first challenge I had, how do I install bower? The website of bower mentions npm, a package manager combined with NodeJS.
NodeJS is a Javascript-engine, the same engine as that is used in Chrome. npm is the package manager that’s installed with it. Npm and bower have overlapping functionality but they’re different enough to use both: npm main purpose is installing server-side javascript-components, to be used with NodeJS. Bower’s purpose is installing client-side javascript-components to be used in a web-browser (more information at Stackoverflow).

First the platform specific package management

Then, how do I install node? Of course I want to use a package manager, but since node is compiled per platform (it can’t be turtles all the way down) we have to use the package manager per platform. If you’re using Linux you most likely will be familier with Yum  (Redhat, CentOS) or the apt-get (Debian, Ubuntu) . Typing:

sudo yum install node

or

sudo apt-get install node

is enough to install node.
Note: I’ve added sudo to every command because you’ll need root/admin rights to install the application.
I’m currently using a mac, and then the best package manager to use is Homebrew. It’s not installed by default, but if you go the Homebrew website you’ll have the tool up and running quickly.
After that I can install node via:

brew install node

I don’t use sudo: brew only stores files in /usr/local and I’ve set that directory to be writeable for admin-users. If you think that’s a security risk, you shouldn’t use brew at all.
If you’re a Windows use, you can use nu-get to install nodejs, but I don’t have experience with that tool yet.
If you don’t want to use any package-manager, then install node the more traditional way by downloading the installation package from the Node.js website.

Package management with Bower

Now node is installed I can use npm to install bower:

npm install bower

With have bower installed, I can fetch angularjs.

First I’ll create a directory where my application can reside, then I’ll use bower to add angular to my application.

mkdir workspace/MyNewapp
bower init
bower install angular

The angular library is now available in the directory I’ve just created. The angular.js file can be included just as you’d normally include js files.

<head>
 <script src="components/angular/angular.js"></script>
 </head>

The components contains all the js files used by the applications. If you delete the directory, executing bower install will reconstruct the whole directory based on the bower.json file, so that’s the only file that we need to check to get our libraries.
Instead of including the js-files by manually adding the script src statements, you can also frameworks such as require to require.js to dynamically load javascript files, but that’s beyond the scope of this article.

Part of the build

Javascript will not have eaten all my software yet. Quite a few applications will have backend written as a Java webaplication (.war), build using Maven, with the frontend being Javascript. Here bower can bower help to keep the project maintainable: rather then checking in the javascript-libraries into the src/main/webapp directory, the bower build file bower.json could be checked into source control. Using the exec-maven-plugin you can easily execute bower as part of your regular Maven-build. This way there’s no need to check Javascript-files in subversion, git or any other version-control-system!

...
<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <executions>
 <execution>
 <phase>generate-sources</phase>
 <goals>
 <goal>exec</goal>
 </goals>
 </execution>
 </executions>
 <configuration>
 <executable>bower</executable>
 <arguments>
 <argument>install</argument>
 </arguments>
 <workingDirectory>${basedir}/src/main/webapp</workingDirectory>
 </configuration>
 </plugin>
...
A Javascript build framework: Yeoman

No code is complete, without automatic tests and/or validation. In Maven that’s just a step in the build-process. Furthermore, although Javascript is an interpreted language and therefor now compile-step is needed, you still might want to do some post-processing of your javascript application. This could be possible in Maven, but using a Javascript-build-framework (which you could trigger from Maven just as well) might be more versatile. Yeoman seems a good start. Given the feature-set, Yeoman and Javascript-build-tools in general are worth a whole new post so I won’t dive into that further.

An IDE

Now I want to code in a IDE as good as Eclipse. I’d certainly want code-completion, and automatic checks of my source-code on types, synax and similar errors. Based on experience and hear-say, IntelliJ is very good Javascript support. Also Sublime is a good editor. Eclipse can be used to even, using various plugins. I have not enough experience with any of those IDEs to be able to recommend anything yet.

Conclusion

As a Java-developer and Maven-user I’m used to using package managers to automatically download libraries. With the current state of Javascript, this way of working is still possible when developing Javascript-web-application. So the increasing popularity of Javascript is not as bad as it seems.

The complete project I’ve created while writing this posting is available at my public github-account.

Java: Finding/Setting JDK/$JAVA_HOME on Mac OS X

Mark Needham - Sat, 06/15/2013 - 11:28

As long as I’ve been using a Mac I always understood that if you needed to set $JAVA_HOME for any program, it should be set to /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK.

On my machine this points to the 1.6 JDK:

$ ls -alh /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

This was a bit surprising to me since I’ve actually got Java 7 installed on the machine as well so I’d assumed the symlink would have been changed:

$ java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

Andres and I were looking at something around this yesterday and wanted to set $JAVA_HOME to the location of the 1.7 JDK on the system if it had been installed.

We eventually came across the following article which explains that you can use the /usr/libexec/java_home command line tool to do this.

For example, if we want to find where the 1.7 JDK is we could run the following:

$ /usr/libexec/java_home -v 1.7
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home

And if we want 1.6 the following does the trick:

$ /usr/libexec/java_home -v 1.6
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

We can also list all the JVMs installed on the machine:

$ /usr/libexec/java_home  -V
Matching Java Virtual Machines (3):
    1.7.0_09, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
    1.6.0_45-b06-451, x86_64:	"Java SE 6"	/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    1.6.0_45-b06-451, i386:	"Java SE 6"	/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
 
/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home

I’m not sure how I’ve never come across this command before but it seems pretty neat.

Categories: Programming

neo4j/cypher/Lucene: Dealing with special characters

Mark Needham - Sat, 06/15/2013 - 10:53

neo4j uses Lucene to handle indexing of nodes and relationships in the graph but something that can be a bit confusing at first is how to handle special characters in Lucene queries.

For example let’s say we set up a database with the following data:

CREATE ({name: "-one"})
CREATE ({name: "-two"})
CREATE ({name: "-three"})
CREATE ({name: "four"})

And for whatever reason we only wanted to return the nodes that begin with a hyphen.

A hyphen is a special character in Lucene so if we forget to escape it we’ll end up with an impressive stack trace:

START p = node:node_auto_index("name:-*") RETURN p;
==> RuntimeException: org.apache.lucene.queryParser.ParseException: Cannot parse 'name:-*': Encountered " "-" "- "" at line 1, column 5.
==> Was expecting one of:
==>     <BAREOPER> ...
==>     "(" ...
==>     "*" ...
==>     <QUOTED> ...
==>     <TERM> ...
==>     <PREFIXTERM> ...
==>     <WILDTERM> ...
==>     "[" ...
==>     "{" ...
==>     <NUMBER> ...
==>

So we change our query to escape the hyphen:

START p = node:node_auto_index("name:\-*") RETURN p;

which results in the following exception:

==> SyntaxException: invalid escape sequence
==> 
==> Think we should have better error message here? Help us by sending this query to cypher@neo4j.org.
==> 
==> Thank you, the Neo4j Team.
==> 
==> "START p = node:node_auto_index("name:\-*") RETURN p"
==>

The problem is that the cypher parser also treats ‘\’ as an escape character so we need to use two of them to make our query do what we want:

START p = node:node_auto_index("name:\\-*") RETURN p;
==> +------------------------+
==> | p                      |
==> +------------------------+
==> | Node[4]{name:"-one"}   |
==> | Node[5]{name:"-two"}   |
==> | Node[6]{name:"-three"} |
==> +------------------------+
==> 3 rows

Alternatively, as Chris pointed out, we could make use of parameters in which case we don’t need to worry about how the cypher parser handles escaping:

require 'neography'
 
neo = Neography::Rest.new
query = "START p = node:node_auto_index({query}) RETURN p"
result = neo.execute_query(query, { :query => 'name:\-*'})
 
p result["data"].map { |x| x[0]["data"] }
$ bundle exec ruby params.rb
[{"name"=>"-one"}, {"name"=>"-two"}, {"name"=>"-three"}]
Categories: Programming

June 14, 2013: This Week at Engine Yard

Engine Yard Blog - Fri, 06/14/2013 - 17:17

This is the week a big chunk of the San Francisco development team went on a roadtrip to our Portland office to do some intense cross-office feature pollination. Things may have started out with some office rivalry, but developers quickly overcame any differences to work together to build, drink copious amounts of amazing coffee, and figure out the location of some of the awesome restaurants Portland has to offer. Pro-Tip: check out Blue Star donuts #amazing.

--Tasha Drew, Product Manager

Engineering Updates

Customer feedback is important to us and is an important part of how we prioritize work within our product management process. We received a few comments from customers who were frustrated because they couldn’t figure out why they were being charged money when they didn’t have any running instances. The answer was that they still had IP addresses that were detached from instances when the instances were terminated, but not deleted.

Customers can always see IP addresses and manage them in the dashboard by going to Tools -> IP addresses, but we decided to add more messaging to call this out to people.

Going forward, you will see a dashboard notice if you delete an instance and don’t delete the IP address - and you will also receive an email. We will also be sending out emails to any customer who has an account where the only items they’re being billed for are IP addresses and snapshots to let them know.

Hope this helps going forward! Big thanks to one of our newest platform developers, the amazing Daniela, for turning this request around so quickly.

We’re also wrapping up some cool new features around snapshot management which you should be reading about in this space next week!

Data Data Data

Our lead data engineer, Ines, has been busy working on the underlying code for exciting new features that we’ll be rolling out in the next few months. She also handed off a new feature that allows for database version locking to alleviate upgrade pains. The DBA team is actively testing and improving it and we should make it available soon. Watch out for her blogpost next week.

Ines and I were delighted to get to meet up with local Postgres ladies while we were in Portland. Selena Deckelmann has some great thoughts on the intersection of developers and Operations on her blog for those of you who need some fun weekend reading.  Kris Pennella gave me a valuable reminder to take a deep breath when facing stressful situations in her blog, “3 Tips Channeling a Negative into a Positive.”

We also had the pleasure of seeing Basho’s Eric Redmond (author of 7 Databases in 7 weeks and the Little Riak Book). We got a chance to hear some of the features that will come in Riak 1.4 and we are very excited!

Social Calendar (Come say hi!)

Friday June 14 - Saturday June 15: DevOps Days Amsterdam!: Meet the always charming Slava and the ridiculously knowledgable Richard as they hang out and participate in this awesome DevOps conference where we are not only a PaaS -- we are also a cake.

Tuesday June 18, 19:00: Ruby Ireland Meetup at Engine Yard Dublin. We are Going off The Rails this month at Ruby Ireland as we go through some of the options for extending your web apps with mobile apps or through a Javascript framework. Kevin Fagan, Fergal Condron, Simon Rand, Gavin Joyce and Paul Watson will be speaking.

Thursday June 20 - Friday June 21st: Lyon, France, Ruby Lugdunum: Crowd favorite Engine Yard engineer PJ Hagerty will be presenting at Ruby Lugdunum in exotic Lyon, France, on how to grow and nurture your local Ruby group.

Thursday June 20, 18:30: Open Data Ireland #8 at Engine Yard Dublin. General theme for ODI Meetup #8 is 'Open Government Partnership'. This meetup will be facilitated by Denis Parfenov, Tom Stewart and Nuala Haughey. We'll be hosting a brief presentation from OGP representative. The rest of the evening will be dedicated to building topic- specific, multi-stakeholder/multi-disciplinary working groups with a view to taking an active part in co-drafting/crowdsourcing Ireland’s first national Action Plan around OGP principles.

Thursday June 20, 19:00: Engine Yard’s Buffalo Offices: Riak is bustin’ out all over in June, a meetup led by renouned Riakifier Dave Parfitt.

Articles of Interest

Drink coffee: avoid death! The New York Times tells us exactly what we’ve been hoping to hear.

Nobody Understands the GIL: Jesse Storimer explores MRI and analyzes functions for thread safety.

And for our distributed systems fans (that’s everyone, right?) a deep dive into non-blocking transactional atomicity by Peter Bailis.

Call me maybe: Kyle Kingsbury’s summary post on Jepsen looking at how various databases handle network partitions.

The post June 14, 2013: This Week at Engine Yard appeared first on Engine Yard Developer Blog.

Categories: Programming

Windows Azure: Major Updates for Mobile Backend Development

ScottGu's Blog - Scott Guthrie - Fri, 06/14/2013 - 10:32

This week we released some great updates to Windows Azure that make it significantly easier to develop mobile applications that use the cloud. These new capabilities include:

  • Mobile Services: Custom API support
  • Mobile Services: Git Source Control support
  • Mobile Services: Node.js NPM Module support
  • Mobile Services: A .NET API via NuGet
  • Mobile Services and Web Sites: Free 20MB SQL Database Option for Mobile Services and Web Sites
  • Mobile Notification Hubs: Android Broadcast Push Notification Support

All of these improvements are now available to use immediately (note: some are still in preview).  Below are more details about them.

Mobile Services: Custom APIs, Git Source Control, and NuGet

Windows Azure Mobile Services provides the ability to easily stand up a mobile backend that can be used to support your Windows 8, Windows Phone, iOS, Android and HTML5 client applications.  Starting with the first preview we supported the ability to easily extend your data backend logic with server side scripting that executes as part of client-side CRUD operations against your cloud back data tables.

With today’s update we are extending this support even further and introducing the ability for you to also create and expose Custom APIs from your Mobile Service backend, and easily publish them to your Mobile clients without having to associate them with a data table. This capability enables a whole set of new scenarios – including the ability to work with data sources other than SQL Databases (for example: Table Services or MongoDB), broker calls to 3rd party APIs, integrate with Windows Azure Queues or Service Bus, work with custom non-JSON payloads (e.g. Windows Periodic Notifications), route client requests to services back on-premises (e.g. with the new Windows Azure BizTalk Services), or simply implement functionality that doesn’t correspond to a database operation.  The custom APIs can be written in server-side JavaScript (using Node.js) and can use Node’s NPM packages.  We will also be adding support for custom APIs written using .NET in the future as well.

Creating a Custom API

Adding a custom API to an existing Mobile Service is super easy.  Using the Windows Azure Management Portal you can now simply click the new “API” tab with your Mobile Service, and then click the “Create a Custom API” button to create a new Custom API within it:

image

Give the API whatever name you want to expose, and then choose the security permissions you’d like to apply to the HTTP methods you expose within it.  You can easily lock down the HTTP verbs to your Custom API to be available to anyone, only those who have a valid application key, only authenticated users, or administrators.  Mobile Services will then enforce these permissions without you having to write any code:

image

When you click the ok button you’ll see the new API show up in the API list.  Selecting it will enable you to edit the default script that contains some placeholder functionality:

image

Today’s release enables Custom APIs to be written using Node.js (we will support writing Custom APIs in .NET as well in a future release), and the Custom API programming model follows the Node.js convention for modules, which is to export functions to handle HTTP requests.

The default script above exposes functionality for an HTTP POST request. To support a GET, simply change the export statement accordingly.  Below is an example of some code for reading and returning data from Windows Azure Table Storage using the Azure Node API:

image

After saving the changes, you can now call this API from any Mobile Service client application (including Windows 8, Windows Phone, iOS, Android or HTML5 with CORS).

Below is the code for how you could invoke the API asynchronously from a Windows Store application using .NET and the new InvokeApiAsync method, and data-bind the results to control within your XAML:

    private async void RefreshTodoItems() {

        var results = await App.MobileService.InvokeApiAsync<List<TodoItem>>("todos", HttpMethod.Get, parameters: null);

        ListItems.ItemsSource = new ObservableCollection<TodoItem>(results);

    }   

Integrating authentication and authorization with Custom APIs is really easy with Mobile Services. Just like with data requests, custom API requests enjoy the same built-in authentication and authorization support of Mobile Services (including integration with Microsoft ID, Google, Facebook and Twitter authentication providers), and it also enables you to easily integrate your Custom API code with other Mobile Service capabilities like push notifications, logging, SQL, etc.

Check out our new tutorials to learn more about to use new Custom API support, and starting adding them to your app today.

Mobile Services: Git Source Control Support

Today’s Mobile Services update also enables source control integration with Git.  The new source control support provides a Git repository as part your Mobile Service, and it includes all of your existing Mobile Service scripts and permissions. You can clone that git repository on your local machine, make changes to any of your scripts, and then easily deploy the mobile service to production using Git. This enables a really great developer workflow that works on any developer machine (Windows, Mac and Linux).

To use the new support, navigate to the dashboard for your mobile service and select the Set up source control link:

image

If this is your first time enabling Git within Windows Azure, you will be prompted to enter the credentials you want to use to access the repository:

image

Once you configure this, you can switch to the configure tab of your Mobile Service and you will see a Git URL you can use to use your repository:

image

You can use this URL to clone the repository locally from your favorite command line:

> git clone https://scottgutodo.scm.azure-mobile.net/ScottGuToDo.git

image

Below is the directory structure of the repository:

image

As you can see, the repository contains a service folder with several subfolders. Custom API scripts and associated permissions appear under the api folder as .js and .json files respectively (the .json files persist a JSON representation of the security settings for your endpoints). Similarly, table scripts and table permissions appear as .js and .json files, but since table scripts are separate per CRUD operation, they follow the naming convention of <tablename>.<operationname>.js. Finally, scheduled job scripts appear in the scheduler folder, and the shared folder is provided as a convenient location for you to store code shared by multiple scripts and a few miscellaneous things such as the APNS feedback script.

Lets modify the table script todos.js file so that we have slightly better error handling when an exception occurs when we query our Table service:

todos.js

tableService.queryEntities(query, function(error, todoItems){
    if (error) {
        console.error("Error querying table: " + error);
        response.send(500);
    } else {
        response.send(200, todoItems);
    }       
});

Save these changes, and now back in the command line prompt commit the changes and push them to the Mobile Services:

> git add .

> git commit –m "better error handling in todos.js"

> git push

image

Once deployment of the changes is complete, they will take effect immediately, and you will also see the changes be reflected in the portal:

image

With the new Source Control feature, we’re making it really easy for you to edit your mobile service locally and push changes in an atomic fashion without sacrificing ease of use in the Windows Azure Portal.

Mobile Services: NPM Module Support

The new Mobile Services source control support also allows you to add any Node.js module you need in the scripts beyond the fixed set provided by Mobile Services. For example, you can easily switch to use Mongo instead of Windows Azure table in our example above. Set up Mongo DB by either purchasing a MongoLab subscription (which provides MongoDB as a Service) via the Windows Azure Store or set it up yourself on a Virtual Machine (either Windows or Linux). Then go the service folder of your local git repository and run the following command:

> npm install mongoose

This will add the Mongoose module to your Mobile Service scripts.  After that you can use and reference the Mongoose module in your custom API scripts to access your Mongo database:

var mongoose = require('mongoose');

var schema = mongoose.Schema({ text: String, completed: Boolean });

 

exports.get = function (request, response) {

    mongoose.connect('<your Mongo connection string> ');

    TodoItemModel = mongoose.model('todoitem', schema);

    TodoItemModel.find(function (err, items) {

        if (err) {

            console.log('error:' + err);

            return response.send(500);

        }

        response.send(200, items);

    });

};

Don’t forget to push your changes to your mobile service once you are done

> git add .

> git commit –m "Switched to use Mongo Labs"

> git push

Now our Mobile Service app is using Mongo DB!

Note, with today’s update usage of custom Node.js modules is limited to Custom API scripts only. We will enable it in all scripts (including data and custom CRON tasks) shortly.

New Mobile Services NuGet package, including .NET 4.5 support

A few months ago we announced a new pre-release version of the Mobile Services client SDK based on portable class libraries (PCL).

Today, we are excited to announce that this new library is now a stable .NET client SDK for mobile services and is no longer a pre-release package. Today’s update includes full support for Windows Store, Windows Phone 7.x, and .NET 4.5, which allows developers to use Mobile Services from ASP.NET or WPF applications.

You can install and use this package today via NuGet.

Mobile Services and Web Sites: Free 20MB Database for Mobile Services and Web Sites

Starting today, every customer of Windows Azure gets one Free 20MB database to use for 12 months free (for both dev/test and production) with Web Sites and Mobile Services.

When creating a Mobile Service or a Web Site, simply chose the new “Create a new Free 20MB database” option to take advantage of it:

image

You can use this free SQL Database together with the 10 free Web Sites and 10 free Mobile Services you get with your Windows Azure subscription, or from any other Windows Azure VM or Cloud Service.

Notification Hubs: Android Broadcast Push Notification Support

Earlier this year, we introduced a new capability in Windows Azure for sending broadcast push notifications at high scale: Notification Hubs.

In the initial preview of Notification Hubs you could use this support with both iOS and Windows devices.  Today we’re excited to announce new Notification Hubs support for sending push notifications to Android devices as well.

Push notifications are a vital component of mobile applications.  They are critical not only in consumer apps, where they are used to increase app engagement and usage, but also in enterprise apps where up-to-date information increases employee responsiveness to business events.  You can use Notification Hubs to send push notifications to devices from any type of app (a Mobile Service, Web Site, Cloud Service or Virtual Machine).

Notification Hubs provide you with the following capabilities:

  • Cross-platform Push Notifications Support. Notification Hubs provide a common API to send push notifications to iOS, Android, or Windows Store at once.  Your app can send notifications in platform specific formats or in a platform-independent way. 
  • Efficient Multicast. Notification Hubs are optimized to enable push notification broadcast to thousands or millions of devices with low latency.  Your server back-end can fire one message into a Notification Hub, and millions of push notifications can automatically be delivered to your users.  Devices and apps can specify a number of per-user tags when registering with a Notification Hub. These tags do not need to be pre-provisioned or disposed, and provide a very easy way to send filtered notifications to an infinite number of users/devices with a single API call.  
  • Extreme Scale. Notification Hubs enable you to reach millions of devices without you having to re-architect or shard your application.  The pub/sub routing mechanism allows you to broadcast notifications in a super-efficient way.  This makes it incredibly easy to route and deliver notification messages to millions of users without having to build your own routing infrastructure.
  • Usable from any Backend App. Notification Hubs can be easily integrated into any back-end server app, whether it is a Mobile Service, a Web Site, a Cloud Service or an IAAS VM.

It is easy to configure Notification Hubs to send push notifications to Android. Create a new Notification Hub within the Windows Azure Management Portal (New->App Services->Service Bus->Notification Hub):

image

Then register for Google Cloud Messaging using https://code.google.com/apis/console and obtain your API key, then simply paste that key on the Configure tab of your Notification Hub management page under the Google Cloud Messaging Settings:

image

Then just add code to the OnCreate method of your Android app’s MainActivity class to register the device with Notification Hubs:

gcm = GoogleCloudMessaging.getInstance(this);

String connectionString = "<your listen access connection string>";

hub = new NotificationHub("<your notification hub name>", connectionString, this);

String regid = gcm.register(SENDER_ID);

hub.register(regid, "myTag");

Now you can broadcast notification from your .NET backend (or Node, Java, or PHP) to any Windows Store, Android, or iOS device registered for “myTag” tag via a single API call (you can literally broadcast messages to millions of clients you have registered with just one API call):

var hubClient = NotificationHubClient.CreateClientFromConnectionString(
                  “<your connection string with full access>”,
                  "<your notification hub name>");

hubClient.SendGcmNativeNotification("{ 'data' : {'msg' : 'Hello from Windows Azure!' } }", "myTag”);

Notification Hubs provide an extremely scalable, cross-platform, push notification infrastructure that enables you to efficiently route push notification messages to millions of mobile users and devices.  It will make enabling your push notification logic significantly simpler and more scalable, and allow you to build even better apps with it.

Learn more about Notification Hubs here on MSDN .

Summary

The above features are now live and available to start using immediately (note: some of the services are still in preview).  If you don’t already have a Windows Azure account, you can sign-up for a free trial and start using them today.  Visit the Windows Azure Developer Center to learn more about how to build apps with it.

Hope this helps,

Scott

P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

Categories: Architecture, Programming

TickSpec dependency graph

Phil Trelford's Array - Fri, 06/14/2013 - 09:58

Scott Wlaschin has just posted a really interesting series on Dependency cycles over on the F# for fun and profit site. The last post shows cycles and modularity in the wild comparing open source C# and F# projects including SpecFlow and TickSpec which have almost identical functionality,.

Here’s the dependency diagram for SpecFlow (C#):

 specFlow

and for TickSpec (F#):

tickSpec

They both have very similar functionality and in fact TickSpec implements it’s own parser too. Read Scott’s article to better understand why such large differences exist between C# and F# projects.

Categories: Programming

Conference Report: Plot Visits XebiCon 2013

Xebia Blog - Fri, 06/14/2013 - 09:06

Tuesday June 4th, Xebia organized the XebiCon event in Fort Voordorp in The Netherlands.  One of our visitors, Dirk Louwers, wrote a conference report which nicely summarizes the day. Dirk Louwers works as CTO for a company called Plot. XebiCon consisted of two keynotes and 15 sessions divided over five parallel tracks. Dirk Louwers reports on both keynotes and three of the parallel sessions.

You can read Dirk Louwer’s report at Plot Visits XebiCon

Thanks to Dirk Louwers for publishing this article!

Machine Learning Hands On Session

Phil Trelford's Array - Fri, 06/14/2013 - 07:43

Last night the F#unctional Londoners Meetup put on a Hands On Machine Learning session at Skills Matter in London. It was a really well attended event, so much so that we had to put a cap on the number of attendees when we reached 70 registrations. The material was recycled from a well received session by Mathias Brandewinder at the San Francisco Bay Area F# User Group in May.

I find F# a very good fit for Machine Learning, in fact my first use of F# was for the player matchmaking on Halo 3.

The goal of the session was to create a digit recognizer using Kaggle’s competition data set.


The first part of the session was to parse and transform the provided CSV files:

let path = @"c:\Digits\digitssample.csv"
let lines = File.ReadAllLines(path)
lines |> Array.map (fun line -> line.Split(','))

Then to implement the K-nearest neighbours algorithm to classify digits. KNN is the first algorithm explained in Manning’s Machine Learning in Action book.

pharrington_cover150

We used a guided script in the session that takes you through the problem in small manageable tasks, each one introducing the necessary F# language contructs required, which you could work through at home too.

Thanks for all the kind feedback:

  1. Finn NeuikFinn Neuik ‏@finnneuik

    great evening at #fsharp UG courtesy of #kaggle, @skillsmatter and @ptrelford : I do like a bit of machine learning!

  2. James CrowleyJames Crowley ‏@JamesCrowley

    Great evening learning some F# and machine learning with the help of @ptrelford @skillsmatter - thanks Phil!

  3. Andy BrackleyAndy Brackley ‏@andybrackley

    Thanks @ptrelford for a great session on machine learning in f#. Excellent content and presentation

  4. Chris AustinChris Austin ‏@cja117

    @ptrelford thanks for a great #fsharp workshop at #SkillsMatter in London.


If you’re interested in learning more check out:the Machine Learning with F# page on the F# Software Foundation site which includes plenty more tutorials.

Categories: Programming

git: Having a branch/tag with the same name (error: dst refspec matches more than one.)

Mark Needham - Thu, 06/13/2013 - 23:18

Andres and I recently found ourselves wanting to delete a remote branch which had the same name as a tag and therefore the normal way of doing that wasn’t worked out as well as we’d hoped.

I created a dummy repository to recreate the state we’d got ourselves into:

$ echo "mark" > README
$ git commit -am "readme"
$ echo "for the branch" >> README 
$ git commit -am "for the branch"
 
$ git checkout -b same
Switched to a new branch 'same'
 
$ git push origin same
Counting objects: 5, done.
Writing objects: 100% (3/3), 263 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://git@bitbucket.org/markhneedham/branch-tag-test.git
 * [new branch]      same -> same
 
$ git checkout master
$ echo "for the tag" >> README
$ git commit -am "for the tag"
$ git tag same
$ git push origin refs/tags/same
Counting objects: 5, done.
Writing objects: 100% (3/3), 266 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://git@bitbucket.org/markhneedham/branch-tag-test.git
 * [new tag]         same -> same

We wanted to delete the remote ‘same’ branch and the following command would work if we hadn’t created a tag with the same name. Instead it throws an error:

$ git push origin :same
error: dst refspec same matches more than one.
error: failed to push some refs to 'ssh://git@bitbucket.org/markhneedham/branch-tag-test.git'

We learnt that what we needed to do was refer to the full path for the branch when trying to delete it remotely:

$ git push origin :refs/heads/same
To ssh://git@bitbucket.org/markhneedham/branch-tag-test.git
 - [deleted]         same

To delete the tag we could do the same thing:

$ git push origin :refs/tags/same
remote: warning: Deleting a non-existent ref.
To ssh://git@bitbucket.org/markhneedham/branch-tag-test.git
 - [deleted]         same

Of course the tag and branch still exist locally:

$ ls -alh .git/refs/heads/
total 16
drwxr-xr-x  4 markhneedham  wheel   136B 13 Jun 23:09 .
drwxr-xr-x  5 markhneedham  wheel   170B 13 Jun 22:39 ..
-rw-r--r--  1 markhneedham  wheel    41B 13 Jun 23:08 master
-rw-r--r--  1 markhneedham  wheel    41B 13 Jun 23:08 same
 
$ ls -alh .git/refs/tags/
total 8
drwxr-xr-x  3 markhneedham  wheel   102B 13 Jun 23:08 .
drwxr-xr-x  5 markhneedham  wheel   170B 13 Jun 22:39 ..
-rw-r--r--  1 markhneedham  wheel    41B 13 Jun 23:08 same

So we got rid of them as well:

$ git checkout master
Switched to branch 'master'
$ git branch -d same
Deleted branch same (was 08ad88c).
$ git tag -d same
Deleted tag 'same' (was 1187891)

And now they are gone:

$ ls -alh .git/refs/heads/
total 8
drwxr-xr-x  3 markhneedham  wheel   102B 13 Jun 23:16 .
drwxr-xr-x  5 markhneedham  wheel   170B 13 Jun 22:39 ..
-rw-r--r--  1 markhneedham  wheel    41B 13 Jun 23:08 master
$ ls -alh .git/refs/tags/
total 0
drwxr-xr-x  2 markhneedham  wheel    68B 13 Jun 23:16 .
drwxr-xr-x  5 markhneedham  wheel   170B 13 Jun 22:39 ..

Out of interest we’d ended up with this situation by mistake rather than by design but it was still fun to do a little bit of git digging to figure out how to solve the problem we’d created for ourselves.

Categories: Programming

You Cannot Win Engineering

Engine Yard Blog - Thu, 06/13/2013 - 20:51

For as long as I can remember, I’ve been a fan of Saturday Night Live and improvisational theater. Improv looks chaotic and uncontrolled, but the best practitioners operate under strict rules that govern interactions between players. Some of the most successful entertainers today, people like Stephen Colbert and Tina Fey, directly credit what they have learned in improv with making them better at what they do both on and off screen.

Unlike workplace policies that you are probably used to, the rules of improv aren’t meant to constrain you, but to open you up to the ideas of others. Let’s take a look at some of the rules the Mr. Colbert and Ms. Fey live by and see how they can improve team collaboration.

Agree and Say “Yes”.

Here’s Tina, from her book Bossypants, talking about the rules of engagement:

The first rule of improvisation is AGREE. Always agree and SAY YES. When you’re improvising, this means you are required to agree with whatever your partner has created. So if we’re improvising and I say, “Freeze, I have a gun,” and you say, “That’s not a gun. It’s your finger. You’re pointing your finger at me,” our improvised scene has ground to a halt. But if I say, “Freeze, I have a gun!” and you say, “Yes! The gun I gave you for Christmas! You bastard!” then we have started a scene because we have AGREED that my finger is in fact a Christmas gun.

The same is true of engineering teams. When one of your teammates has an idea, your first response needs to be affirmative. Take any and all ideas from your teammates as positive contributions and you start from a place of being open-minded and welcoming. Nothing kills team morale faster than someone who says “No, that won’t work” in response to any idea that they didn’t come up with.

It’s Not Just “Yes”, it’s “Yes, and
”

Everyone loves games and games are more fun when everyone  plays nicely. Make positive contributions and you will foster a spirit of openness, collaboration and — dare I say — fun.  Make it your habit to answer your teammate’s ideas with “Yes, and
” instead of “No, because”. Always offer your ideas, you just are as entitled to be silly and wrong as everyone else. Ideas seldom spring fully-formed from the head of Zeus and the part you’re holding back out of fear might be the thing that makes it work. “Yes, and
” makes you part of the solution; “No, because” makes you part of the problem.

Your Team is the Most Important Person on Your Team

 Stephen Colbert went back to his alma mater, Northwestern University, to give the commencement address in 2011. He may play a know-it-all blowhard on The Colbert Report, but that’s clearly not the case in real life. Here’s an excerpt from his speech:


One of the things I was taught early on is that you are not the most important person in the scene. Everybody else is. And if they are the most important people in the scene, you will naturally pay attention to them and serve them. But the good news is you're in the scene too. So hopefully to them you're the most important person, and they will serve you. No one is leading, you're all following the follower, serving the servant.

You cannot win improv.

And life is an improvisation. You have no idea what's going to happen next and you are mostly just making things up as you go along.

And like improv, you cannot win your life.

The software corollary to this is: “You cannot win engineering”.

Think about the implications of this for a moment. If everyone on your team acts as if their teammates are more important than they are, you create an environment of support, giving, and progress that is mutually enriching and productive. You’ll know you have succeeded when no one on your team remembers where a great idea came from. More importantly, no one will care.

When one of your teammates asks you a question, don’t tell them to Google it (which is a bit of a jerk response in any case). Act as if their problems are more important than yours, serve the team by serving them. When you are stuck on a problem, they will treat you the same way.

None of these rules for improvisation will make you funnier or get you a slot on Weekend Update, but applying them to your co-workers will almost certainly make your team awesome. Everyone wins.

The post You Cannot Win Engineering appeared first on Engine Yard Developer Blog.

Categories: Programming

Constructing Your Parachute On The Way Down, Overcoming Organizational Gravity For Smarties

Xebia Blog - Thu, 06/13/2013 - 20:31

Jumping out of a perfectly good airplane, while in flight, without a parachute is generally not recommended. Strangely, it’s exactly what happens in a lot of corporate lean/agile transformations. People jump enthusiastically, enjoying the rush of sudden speed and the exhilaration of getting things done as a team, only to discover organizational gravity when they hit rock bottom.

If only we knew how to fly. In his acclaimed survival manual “The Hitchhiker’s Guide To The Galaxy,” Douglas Adams points out that there is an art, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss.

To be able to do that, you need power. And for that, you need to know a little bit about how to get it. You need to know about politics.

The political economy of lean transformations

Talking about the political economy of lean/agile transformations always brings a smile to my face. As a political economist turned computer programmer, turned delivery manager, turned project manager, and ultimately turned management consultant, I can talk for hours about this and not get bored.

Don’t worry though, I’ll give you the short summary. The very short summary in fact: All politics is a struggle for power. The political economy of lean/agile transformations then, looks at the effects of the redistribution of power in an organization.

Now, there’s something special about power. To speak with Rosabeth Moss Kanter: “Power is a dirty word. It is easier to talk about money and much easier to talk about sex than it is to talk about power. People who have it deny it; People who want it do not want to appear to hunger for it; And people who engage in its machinations do so secretly.”

Let’s open up about power for a bit. And while we’re at it, let’s lighten up about power as well.

And let’s begin with the end in mind: To learn what you need to know about power to become a more effective change agent, you don’t have to read Machiavelli. You just have to read this book: “Power, Why Some People Have It – And Others Don’t,” by Jeffrey Pfeffer. In that book, the Stanford Professor of Organizational Behavior provides ten tips to help you wield power like a Jedi with a light saber:

  • Mete out resources.
  • Shape behavior through rewards and punishments.
  • Advance on multiple fronts.
  • Make the first move.
  • Co-opt antagonists.
  • Remove rivals–nicely, if possible.
  • Don’t draw unnecessary fire.
  • Use the personal touch.
  • Make important relationships work–no matter what.
  • Make the vision compelling.

Why should you learn about power? You should learn about power for three reasons:

  • First, power is a tool. A sharpened saw in stead of a dull one. By knowing about power, you can help organizations change faster, with less risk of organizational gravity wreaking havoc on your hard work. All tools can be used for evil as well as good. It’s the same with power. Most of us that “don’t like to play games” are just afraid we’ll lose. That’s not principled. That’s chickening out. Wielding power purposefully allows you to be more effective as a change agent. Don’t fight the power, grab it!
  • The second reason you should learn about power is that your opponents have learnt how to wield it to create and protect the status quo. Rest assured that as you enter an organization, it will be structured in such as way as to conserve the status quo. It’s a natural state for organizations. Well, sort of. In reality, all systems are in a state of continuous flux. Which is why all the politicking occurs. It is needed to maintain the status quo. It’s also needed to topple it.
  • The third reason you should learn about power is because of what happens to power in a successful corporate lean/agile transformation. Transforming organizations from a traditional to an lean/agile structure entails a democratization of power in the organization. From management to teams, from IT to business, from top to bottom. Power gets redistributed from the elite to the masses. It’s a radical democratization of decision making power. Such redistributions are generally met with a combination of enthousiasm and resistance. Both are understandable.

But there is another reason companies are remarkably resistant to change. This has to do with organizational gravity.

The concept of organizational gravity

The concept of organizational gravity comes from Mike Cohn. In his book “Succeeding With Agile,” Cohn describes the tendency of an organization to slowly, but surely, veer back to it’s original state. Old habits die hard.

Organizations are structured to maintain the status quo. To escape that, you have to exert a lot of power. The larger the organization, the more power you’ll have to exert. If you don’t exert enough power, whatever you launched will either come crashing down or at best achieve orbit.

Some real life examples

Let’s talk about some real life examples for a minute.

Way back when I was still a Project Manager struggling to convince management that an agile way of working would yield better results, I got called into the office of the head of Project Management. He showed me a letter from one of our most important clients. The letter said we would loose the contract if we did not improve within three months. “That’s your assignment,” the head of Project Management told me, “do whatever it takes to make it right so we don’t loose the client.” And I did. What it took, was some remedial team building and the introduction of an agile way of working. Within six months, the client sent us another letter. This time, it was a signed reference for marketing purposes. A dramatic reversal of customer satisfaction! All thanks to adopting an agile way of working. They kept improving on that way of working after I left and today have a rock solid reputation for delivering high quality software to millions of users. This then, is an example of an organization truly overcoming organizational gravity.

More recently, I consulted with a company that wanted to deliver faster, more relevant software to production with higher quality at lower cost. They’d done a lean transformation already, and asked us to do an agile one as well. So we did. And it was a success! We helped the client create multiple agile teams simultaneously working on the same technology stack and worked with management to introduce a governance structure feeding those teams with a single corporate backlog. And then, the financial crisis hit home. The company had to cut costs fast. So they did the now obvious thing: They asked their agile teams for help. And the teams told management to fire half of them. So they did! How about that? You ask the turkey what to have for dinner for Christmas and his advice is to have turkey! That was the level of understanding the teams had gained from adopting an agile way of working. But, there’s a sad end to this story. The shift from continuous improvement to cost-cutting, that is from Eastern lean to Western lean, destroyed employee loyalty to the company. The first to go off to greener pastures were the managers and team members instrumental in the initial change. Then, organizational gravity hit hard. Last I heard, the teams are being told what to do by management and have stopped thinking for themselves. Apparently, overcoming organizational gravity is not enough, you have to keep at it to avoid falling back down.

Overcoming organizational gravity

So, how do you overcome organizational gravity? And how can you make sure you keep at it to avoid falling back down?

Speed is essential. The faster you go, the faster you’ll show results. The more results you show, the easier it is to maintain momentum and push for a real and lasting change. Also, speed sharpens your focus and facilitates flow. It hightens your senses and prevents you from cruising along without paying close attention to what you’re doing. Just like driving a supercar on a racetrack.

Trouble is, you’re not actually on a racetrack in a corporate lean/agile transformation. For starters, there usually a lot more cars on the road. And they’re not all supercars. They drive at different speeds. Worse, they follow different rules. Worse still, they might not be going in the same direction.

So a corporate lean/agile transformation is more like driving a supercar through heavy cross-town traffic. If you want to do that at speed, it’s hard to keep going without accidents. It’s impossible to do that without breaking the rules.

Breaking the rules is essential. Or rather, using and bending the rules so they work in your favor. To cut through cross-town traffic in a supercar at speed, all you need is flashing lights, a siren, and a badge. In a corporate setting, that’s a sense of urgency, vocal executive support, and power. However, if you’re using and bending the rules in your favor, you’d better have a good reason and a great sense of direction. If not, you’ll lose popular support really quickly.

Navigation is essential. If you don’t know where you’re going, any road’ll take you there. So you have to know where you’re going. Or rather, where you currently want to go. And then get everyone to go along. A great and proven way to do just that on all levels in a corporate setting is applying Toyota Kata:

  • What is the target condition?
  • What is the actual condition?
  • What obstacles are preventing you from reaching the target condition? Which one are you addressing now?
  • What’s your next step?
  • When can we go and see what we have learned from taking the next step?

What we call lean/agile today, resulted in large part from answering those five questions consistently over time. As Mike Rother points out in his book “Toyota Kata,” the roots of Toyota’s success lie not in its organizational structures, but in developing capability and habits in its people. The competitive advantage of an organization lies not so much in the solutions themselves, but in the ability to understand conditions and create fitting smart solutions.

This points to an important, and in my opinion sorely missed, addition to the Agile Manifesto:

Experimentation over implementation.

Do something. See if it works. If it does, do more of that. If it doesn’t, do something else. As opposed to think of something. Talk about it. Talk about it some more. Then talk about something else.

If you don’t go fast, break the rules, and navigate like a pro, you’re likely to go SPLAT! Avoiding a Surprisingly Painful Lean/Agile Transformation (SPLAT), is hard work.

It’s hard work to keep up the pace. In a truly lean/agile organization, you’re not just sprinting, you’re doing back-to-back sprints without stopping. It’s more like a marathon. Actually it’s more like an ultra. To be able to do that, you must want it badly. And you must train. A lot.

It’s hard to break the rules. Sometimes, this may get you fired. Like in the story Brian Marick likes to tell about a certain Scrum Master:

  • An agile team was made to work in cubicles, like the rest of the company.
  • Agile methods aside, cubicles are the “single worst arrangement of humans and objects in space for the purpose of developing software.”
  • The team proposed changing their workspace to an open one.
  • Furniture Police turned them down.
  • In response, the Scrum Master went to the office over the weekend. She disassembled the cubicles and changed the office layout to an open one. On Monday, she declared to the Furniture Police that “If the cubicles come back, you will have to fire me.”
  • They gave in.

But they could have just as well taken her up on her offer and fired her.

Hard work, hard work, hard work. Are there really no shortcuts? Well, no, not really. But you can speed things up a bit. Quite a bit in fact. Let’s have a look at some of these “wormholes.”

Wormholes to the rescue

A wormhole, or Einstein-Rosen bridge, is a shortcut through spacetime, much like a tunnel with two ends each in separate points in spacetime.

Start your lean/agile transformation small, but make sure to select a really important project. Preferably one with lots of risk and high pressure. This will allow you to start fracking the organization releasing the hidden energy reserves encased within.

Propose a ship-it day to show everyone the power of self-organization. Ship-it days are a fun way to foster creativity, allow people to scratch itches and get radical. They’re also a wake-up call to management showing them what happens if they stop holding people back.

No one in their right minds should be against the disciplined application of common sense. And that’s exactly what lean/agile is. In other words: Just do it. So if you can’t get anyone to approve your lean/agile transformation effort, remember it’s more blessed to ask forgiveness than permission. Get going, kickstart a never-ending cycle of continuous improvement, and merrily deal with whatever impediments you encounter to getting things done. Results don’t lie!

So, now for constructing your parachute on they way down to overcome organizational gravity. You jump in without a parachute. How do you avoid hitting rock bottom? I have seven tips for you to help you do that.

7 powertips for smarties
  1. Be honest with yourself. See things as they are, not as you want them to be. Acknowledge your feelings, then use the scientific method to check their validity.
  2. Use social network analysis to map the distribution of power in an organization. Visualizing the flow of power makes it easy to tap into it.
  3. Use heat maps to identify the points of maximum leverage in an organization. Visualizing the distribution of power makes it easy to know where to start drilling for oil.
  4. Create a power matrix to determine who to influence.
  5. Show genuine interest in everyone you meet. You never know where they’ll end up later. Make eye contact, let them talk first, ask open-ended questions, listen.
  6. Tap into the awesome power of the secretary or personal assistant. Get to know them. Treat them as you would their bosses.
  7. If all else fails: Run!
Summary

Do your cause and yourself a favor, and learn about power. Be mindful of organizational gravity and use any means possible to overcome it, be it the smart use of power, plain-old hard work, or a shortcut. If you can’t beat them, or join ‘em and then beat them from within, run! Apply for a job at Semco, Google, or Toyota, to name just a few truly lean companies. Or start your own. Don’t settle for less! You deserve to work at an awesome company!

Agile Crisis Management Explained – part 2

Xebia Blog - Thu, 06/13/2013 - 19:09

This blogpost completes the model that I use to build up a mental image of a new crisis situation when I encounter one. I use it to structure and prioritize the thousands of pieces of new information that I need to process in order to get a good picture of what I’m dealing with. In fact it is a tool to get a fast and useful insight in the current crisis situation that will help me to consolidate all the different inputs into a combined and useful image of what’s going on. This image helps me to communicate with the stakeholders and to define the actions needed.

In my previous post the fundamentals of the model have been explained.
In this post the rest of the mental image usage is described.

agile crisismodel
figure: Burms temple

Remember the essence of the first blogpost:
A strong temple is built upon solid ground and a strong foundation; likewise a successful project is built upon engaged project members and clear responsibility.
When you want to assess a project, start with investigating engagement and responsibility. To do this, look at two things

  • Are ‘change’ and ‘structure’ well balanced? So people have the opportunity to express their engagement.
  • Is leadership and responsibility effectively implemented? So people operate in their strength and feel free to do what seems right?

Use the questions above to assess the fundamentals of a solution to any crisis.

Haha! Fundamentals are great, but not everything; So let’s move on!

PART III: THE TEMPLE FLOOR – A working value chain
Have you ever been in a real temple? The first thing that strikes you is the awesomeness of the beautiful floor. It’s that awesome floor that takes your breath away and makes you fall in love with this ancient piece of art The beauty of a successful project lies in the elegant effectiveness of a working valuechain, in two dimensions: the functional product dimension and the dimension of virtual ownership.

Looking at a value chain from a Functional point of view means, you have to get the minimal product working end-2-end. Once this is done, things can only get better.
Creating your mental picture of this area can take some effort. Domain knowledge is helpful, so talk to people who have it and look at the project history together. The product owner is a good place to start. Have a look at the storymap and if there is none, make one. You could also draw out end-2-end user interaction scenarios with the product owner. Start with the “happy flow” and once finished look at the features in it already built and what has to be added. Find out what’s holding the project back from completing an end-2-end value chain.
Example questions that can give you a head start:

  • Can you explain to me what the minimal end-2-end functionality looks like?
  • What’s the value of this functionality for the customer?
  • What is needed to complete the first end-2-end functionality set?

Ownership wise, you have to take charge of the valuechain and what happens to it during the course of the project. If your program runs on shared environments, like sharing test or acceptance environments with other projects, find out what is the priority for your program. From there on implement some form of flight control mechanism. On shared environments the case is often that operations is expecting the supplying party to coordinate, and the supplying party is expecting the operations to coordinate. Result is a big mess you need to clean up.
To get an image of what’s going on, talk to Operations. See how often ops has issues when deploying and were they originate from. Of course it goes without saying that this point in your model gets more important and complex the more third party vendors are in acting in your value chain.
Questions I like to use to get my head around this part of the model:

  • Who’s managing the timeslots and priorities on the different environments?
  • How long does it take to execute a deployment? What kind of recurring issues occur?
  • Which colleagues operate right before and right after you in the value chain?
  • What’s to be considered the starting point of the value chain? What the end?

PART IV: Four majestic pillars that support the roof
There are four pillars that support the roof of our temple:

1. Create a single managed backlog:

It is imperative to have a single managed backlog. Derailed projects often show a myriad of specs and priorities across the entire program and strange constructs to manage these. Get the whole thing back to a single product owner and concrete priorities. Work out the backlog in rapid design workshops for at least the next release and estimate this with the entire team. To find out if productowners are aligned and focused, check if there is a single backlog or storymap in place together with a sort of chief product owner. Also check if the chief has a clear vision on the product (especially the bare minimal viable product) and the mandate to make decisions accordingly. A good second indicator is to see whether or not productowners are discussing central release goals instead of their own. How often do they jointly check if these central goals are going to be met? Even when there is a clear central backlog and goals, productowners could still work separately in practice mainly cleaning their own alleys.

2. Know your velocity:

In multi-team programs, it’s often hard to work with velocity across teams if you want to relate this to a centralized release- and/or product backlog. But in a program under pressure, it is imperative that you obtain this information to see what scope you will be able to finish given the circumstances and current delivery speeds. To check what’s happening based on velocity ask how teams do their estimation and who estimates what with regards to the final product. Next to this you can ask what reference point is being used and if this is the same for all teams. In the latter case, you usually see. You may need to adjust- and act on a number of things to make any sense of a common velocity, depending on the answer to the above questions.

3. Work end-2-end:

Planning wise you do not want any loose ends to be lying around. This is a great project risk. Velocity in relation to planning-information is only worth anything, when based on end-2-end results from the teams. So from requirement to production (ready) products. To check if the teams and the program as a whole is working end-2-end each sprint, look at program planning phases and talk to program and project managers. They might reveal that they want to do other test types after “development” work is “done”
 My rule of thumb is the thinner the definition of done, the more risk is shifted to the end of the program, the harder it will be to mitigate this risk and tame the crisis.

4. Start continuous improvement on the program level in a PTC (Program Transition Community).

I am sure you have all heard of enterprise transition communities or ETC’s. Just like with an agile adoption, taming a project crisis is also not a one-time effort, but a continuous one. Solving all problems in just one go is an illusion. In derailed programs, continuous improvement on program level is often non-existing, and you can’t rely on the self-improvement of individual delivery teams alone. Simple look-ups can improve your mental image. See if there is a program level standup and if issues and impediments are made explicit. See if there is some record available of improvements etc. To see indications of the base to start improving on this level, look at the solve time for impediments not solved within the teams.

PART V: THE ROOF – Prioritized goals and the eternal bliss of: transparent, reliable program results
The pillars hold the roof. The main part of the temple, pointing towards the eternal bliss of transparent, reliable program results. The roof therefor represents the priority in program goals. In many programs in crisis we see, there are multiple program goals trying to be completed at the same time. The goals set by the steering committee have to be streamlined by prioritization. Just like the temple roof is pointy, everything done in the program at any given time should lead to the top priority goal. One goal at a time will keep the focus in the program optimal and guarantee the quickest results. People can still have their own sub-goals, but they should at all time have a direct contribution to the central goal with the highest priority. To get a view on this area, ask the same question to various people in different layers of the program hierarchy; what is our main priority/ goal right now? If your getting different answers there might be a problem (try to ask why to see if the answers lead the same destination), if people are unable to answer, you also have a problem. Also look if you see the goals being properly communicated and repeated. In group sessions, in written meeting minutes and most importantly in peoples workspace.

Conclusion
The first important step to resolve a crisis is to understand its context and situations. Easily said, but not always a simple thing to do. In complex situations, a model that offers a structure for prioritizing information and building up a mental image is of great help. Burms temple is such a model.

Next steps
The next step is to determine what actions need to be done to mitigate the current situation you have modeled using Burms temple. From here you and your client can share and form this common vision into an actionable plan, which will raise you from crisis-mode towards transparent, reliable program results

..

PS thanks again Geert!

Tremolo

Phil Trelford's Array - Thu, 06/13/2013 - 07:46

This week I added a simple tremolo effect to my mini-keyboard project Monokeys. Tremolo is a trembling effect, and sometimes seen in Low Frequency Oscillators.

Get Microsoft Silverlight

I found an example of Coding some Tremolo and wrote the formula as an F# function:

let tremolo freq depth i = (1.0 - depth) + depth * (sineWave freq i) ** 2.0


Then I added sliders for the frequency and depth to compose the shape of a sound:

let tremolo i = tremolo tremoloFreq.Value tremoloDepth.Value i
let shape i = sineWave freq i * fadeOut i * tremolo i

Full source code is available on BitBucket: https://bitbucket.org/ptrelford/monokeys

Categories: Programming

Play Cube Slam, a real-time WebRTC video game

Google Code Blog - Wed, 06/12/2013 - 18:04
Author Picture By Justin Uberti, Chromium team

Cross-posted with the Chromium Blog

Cube Slam is a Chrome Experiment built with WebRTC, an open web technology that lets you communicate in real-time in the browser (and in this case, play an old-school arcade game with your friends) without downloading and installing any plug-ins. In this post, we wanted to explain a bit about how Cube Slam works.

Cube Slam uses getUserMedia to access your webcam and microphone (with your permission, of course), RTCPeerConnection to stream your video to a friend, and RTCDataChannel to transfer the bits that keep the gameplay in sync. If you and your friend are behind firewalls, RTCPeerConnection uses a TURN relay server (hosted on Google Compute Engine) to make the connection. When there are no firewalls in the way, however, the entire game happens directly peer-to-peer, reducing latency for players and server costs for developers.


CubeSlame Game Over screen

Cube Slam is the first large-scale application to use RTCDataChannel, which provides an API similar to WebSocket, but sends the data over the RTCPeerConnection peer-to-peer link. RTCDataChannel sends data securely, and supports an "unreliable" mode for cases where you want high performance but don't care about every single packet making it across the network. In cases like games where low delay often matters more than perfect delivery, this ensures that a single stray packet doesn't slow down the whole app.

RTCDataChannel only supports unreliable mode in desktop Chrome today. We're working on implementing the latest WebRTC spec, where we'll use the standard SCTP protocol to support reliable mode. WebRTC will also be available on Chrome for Android later this year, and you can try it now by flipping “Enable WebRTC Android” in chrome://flags. Several browsers are currently working on implementing WebRTC, and we’re looking forward to the day when you can have a Cube Slam face-off against your friends on any browser and any device.

To learn more about the tech in Cube Slam, you can check out our technology page and source code. Disable the shields! Destroy the screen! Have fun!

Justin Uberti is one of the co-creators of the WebRTC initiative, and leads the WebRTC engineering team at Google. Previously, Justin helped create Google+ Hangouts.

Posted by Ashleigh Rentz, Editor Emerita

Categories: Programming

Next Generation Video Gaming

Phil Trelford's Array - Wed, 06/12/2013 - 07:32

There’s a fair amount of excitement with the recent announcements of the new XBox One and PS4 consoles with exciting new harder specs and TV features. There has never been a better time to own an PS3 or XBox 360. On the “old” consoles there’s a massive back catalogue of quality games to choose from, many at knock down prices or available pre-owned. If you want a console for TV the PS3 has a blu-ray player, an optional remote control and supports services like NetFlix and LoveFilm, it’s also quite quiet. If you’re interested in gaming, developers really know these “old” consoles now and there’s a healthy indie games scene too.

If you’re a game developer on royalties you may want to think twice about jumping straight onto the latest and greatest consoles. Sure they’re new and shiny, but they’ll have a much smaller user base for quite some time yet, likely require a much larger team and longer to develop. This winter holiday season XBox 360 and PS3 will be at their peak. I remember being on a royalty share at Ocean on Jurrassic Park, I worked on the PC and Amiga versions, which were a huge success. But the big royalties came from the GameBoy version which had a team of 2. I guess this might be one of the reasons you see so many band members pursuing solo careers.

Categories: Programming

Race across screens and platforms, powered by the mobile web

Google Code Blog - Tue, 06/11/2013 - 17:01
Author Picture By Pete LePage, Chromium team

Cross-posted with the Chromium Blog

You may have seen our recent demo of Racer at Google I/O, and wondered how it was made. So today we wanted to share some of the web technologies that made this Chrome Experiment “street-legal” in a couple of months. Racer was built to show what’s possible on today’s mobile devices using an entirely in-browser experience. The goal was to create a touch-enabled experience that plays out across multiple screens (and speakers). Because it was built for the web, it doesn’t matter if you have a phone or a tablet running Android or iOS, everyone can jump right in and play.
    Racer required two things: speedy pings and a consistent experience across screens. We delivered our minimal 2D vector drawings to each device’s HTML5 Canvas using the Paper.js vector library. Paper.js can handle the path math for our custom race track shapes without getting lapped. To eke out all the frame rate possible on such a large array of devices we rendered the cars as image sprites on a DOM layer above the Canvas, while positioning and rotating them using CSS3’s transform: matrix().

Racer’s sound experience is shared across multiple devices using the Web Audio API (available in latest iOS and Android M28 beta). Each device plays one slice of Giorgio Moroder’s symphony of sound—requiring five devices at once to hear his full composition. A constant ping from the server helps synchronize all device speakers allowing them to bump to one solid beat. Not only is the soundtrack divided across devices, it also reacts to each driver’s movements in real time—the accelerating, coasting, careening, and colliding rebalances the presence of every instrument.

To sync your phones or tablets, we use WebSockets, which enables rapid two-way communication between devices via a central server. WebSocket technology is just the start of what multi-device apps of the future might use. We’re looking forward to when WebRTC data channels—the next generation of speedy Web communication—is supported in the stable channel of Chrome for mobile. Then we’ll be able to deliver experiences like Racer with even lower ping times and without bouncing messages via a central server. Racer’s backend was built on the Google Cloud Platform using the same structure and web tools as another recent Chrome Experiment, Roll It.

To get an even more detailed peek under the hood, we just published two new case studies on our HTML5 Rocks site. Our friends at Plan8 wrote one about the sound engineering and Active Theory wrote one about the front-end build. You can also join the team at Active Theory for a Google Developers Live event this Thursday, June 13, 2013 at 3pm GMT for an in depth discussion.

Pete LePage is a Developer Advocate on the Google Chrome team and helps developers create great web applications and mobile web experiences.

Posted by Ashleigh Rentz, Editor Emerita
Categories: Programming