This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement the code for a supermarket checkout that calculates the total price of a number of items. Products can be scanned and at the end a receipt be printed. | |
1. A product at a time can be scanned. Customer can see a subtotal which shows just the total of all scanned products. | |
2. Checkout can print a receipt which contains the Product and the price. | |
3. Multiple products of one type can be scanned, i.e two milks at once. | |
4. Products can have a price per weight i.e. apples with costs 2.50€/kg. | |
5. Discount: if a customer buys 2 bottles of milk they get the two for the price of one | |
6. Discount: if a customer buys 5 bars of chocolate they receive a discount of 10% for the total price of the chocolates | |
Example products: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.util.Arrays.asList; | |
import org.hamcrest.MatcherAssert; | |
import static org.hamcrest.core.Is.is; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.StringJoiner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import java.util.Collections; | |
import java.util.TreeMap; | |
import static org.hamcrest.CoreMatchers.is; | |
import static org.junit.Assert.assertThat; | |
public class FizzBuzzTest { | |
// doc: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GameOfLife{ | |
public static void main(String[] args){ | |
String[] dish= { | |
"_#_", | |
"_#_", | |
"_#_",}; | |
int gens= 3; | |
for(int i= 0;i < gens;i++){ | |
System.out.println("Generation " + i + ":"); | |
print(dish); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stefan Tilkov: Was ist mit Vollständigkeit? Ist es wichtig, dass ich alles dokumentiert habe? | |
Wie detailliert muss denn Architekturdokumentation sein? | |
Gernot Starke: Das ist total überbewertet. Ich bekomme die Krise, wenn mir jemand sagt: | |
„Ich will vollständige Dokumentation haben.” Das ist dieser 70er und 80er Jahre | |
Ansatz – „Ich kann die gesamten Daten eines Unternehmens alle genau modellieren” - welch ein Blödsinn. | |
Niemals kann ich das machen. Ich will keine vollständige Dokumentation, | |
sondern relevante, aktuelle und verständliche haben. Das ist mir viel wichtiger als vollständig. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13:02:57.142 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@697748ae, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@1644cd9a, org.gradle.logging.internal.JavaUtilLoggingConfigurer@7f1644e1] | |
13:02:57.783 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@697748ae, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@1644cd9a, org.gradle.logging.internal.JavaUtilLoggingConfigurer@7f1644e1] | |
13:02:57.785 [INFO] [org.gradle.BuildLogger] Starting Build | |
13:02:57.786 [DEBUG] [org.gradle.BuildLogger] Gradle user home: C:\Users\testuser\.gradle | |
13:02:57.786 [DEBUG] [org.gradle.BuildLogger] Current dir: C:\testproject\code\javafx-testlist | |
13:02:57.787 [DEBUG] [org.gradle.BuildLogger] Settings file: null | |
13:02:57.787 [DEBUG] [org.gradle.BuildLogger] Build file: null | |
13:0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sources | |
module Number | |
module Jira | |
def tickets_for_filter_id(filter_id) | |
uri = URI('http://jira.blau.de/rest/api/latest/search') | |
params = { :maxResults => "1000", :jql => "filter = #{filter_id}"} | |
uri.query = URI.encode_www_form(params) | |
req = Net::HTTP::Get.new(uri.request_uri) | |
req.basic_auth 'user_name', 'xxxxxx' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
how to organize a code retreat from alex boloaca | |
http://bit.ly/9nzhql | |
... and another page | |
http://bit.ly/bRTX5D | |
introduction about code retreats from the inventor | |
http://coderetreat.com | |
the role of the facilitator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec/core/formatters/progress_formatter' | |
require "net/http" | |
class FortuneFormatter < RSpec::Core::Formatters::ProgressFormatter | |
def stop | |
super | |
print_fortune if all_passed? | |
end | |
def all_passed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from: http://www.ietf.org/rfc/rfc1823.txt | |
/* step through each entry returned */ | |
for ( e = ldap_first_entry( ld, res ); e != NULL; | |
e = ldap_next_entry( ld, e ) ) { | |
/* print each attribute */ | |
for ( a = ldap_first_attribute( ld, e, &ptr ); | |
a != NULL; | |
a = ldap_next_attribute( ld, e, ptr ) ) { | |
printf( "attribute: %s0, a ); |