Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<extension xmlns="urn:newrelic-extension">
<instrumentation>
<!-- Define the method which triggers the creation of a transaction. -->
<tracerFactory name="NewRelic.Agent.Core.Tracer.Factories.BackgroundThreadTracerFactory" metricName="ProcessJobRuns">
<match assemblyName="Intelligize.FM.Jobs" className="Intelligize.FM.Jobs.JsonProcessingJob">
<exactMethodMatcher methodName="Run" />
</match>
</tracerFactory>
<!-- Instrument 0 or more methods called by the trigger method. These methods appear in the transaction breakdown table and in transaction traces. -->
# Context
A company rents bikes under following options:
1. Rental by hour, charging $5 per hour
2. Rental by day, charging $20 a day
3. Rental by week, changing $60 a week
4. Family Rental, is a promotion that can include from 3 to 5 Rentals (of any type) with a discount of 30% of the total price
# Assigment:
1. Implement a set of classes to model this domain and logic

Kata ISBN-10

ISBN-10 is made up of 9 digits plus a check digit (which may be 'X'). Spaces and hyphens may be included in a code, but are not significant. This means that 9780471486480 is equivalent to 978-0-471-48648-0 and 978 0 471 48648 0.

The check digit for ISBN-10 is calculated by multiplying each digit by its position (i.e., 1 x 1st digit, 2 x 2nd digit, etc.), summing these products together and taking modulo 11 of the result (with 'X' being used if the result is 10).

Valid examples: 0471958697, 0 471 95869 7, 0-471-95869-7, 155404295X Invalid examples:

  • 0471958697 (wrong verifier)
@nicopaez
nicopaez / state-machine-kata.md
Created August 7, 2016 00:50
state-machine-kata.md

State Machine Kata

A machine can take different 3 different states: off, on and working. The transitions between states are restricted in a sequencial way:

  • state-off > when-turn-on > state-on
  • state-on > when-start > state-working
  • state-working > when-work-done > state-on
@nicopaez
nicopaez / .gitignore
Created July 31, 2016 12:37
gitignore_for_cs
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)

Leap Year Kata

A year is leap when it is divisible by 4 and is not divisible by 100 except it is also divisable by 400. Some examples:

  • 1900 is divisible by 4 is divisible by 100 is NOT divisible by 400
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 8080, host: 8090
config.vm.network "forwarded_port", guest: 4567, host: 4567
@nicopaez
nicopaez / aeropuerto.java
Last active July 13, 2016 20:46
ejercicio-aeropuerto
public class TransporteAeropuerto {
private String tipoTransporte;
public TransporteAeropuerto(String tipoTransporte){
this.tipoTransporte = tipoTransporte;
}
public float cobrarPasaje(String origen, String destino, int cantidadPasajeros){
if(this.tipoTransporte == "Tren Interno")
{
return 0; //El tren internos es un servicio gratis del aeropuesro.
/*
a. Explique brevemente que es un application domain en el contexto de .Net Framework.
b. NUnit vs MSTest. Desarrolle brevemente: pros, contras de cada uno.
c. Mencione los servidores de integración continua con lo que ha trabajado.
d. El siguiente grupo de clases modela un dominio de alquiler de bicicletas.
1. Analice las clases
2. Identifique potenciales problemas con el diseño/código presentado e indique porque considera que son problemas
3. Proponga una solución para cada uno de los puntos identificados
4. Realice un diagrama de clases
5. Realice un diagrama de secuencia del método Customer.amountToPay()
/*
El siguiente grupo de clases modela un dominio de alquiler de bicicletas.
1. Analice las clases
2. Realice un diagrama de clases
3. Realice un diagrama de secuencia del método Customer.amountToPay()
4. Identifique potenciales problemas con el diseño/código presentado e indique porque considera que son problemas
5. Proponga una solución para cada uno de los puntos identificados
*/
public class Bike {