Skip to content

Apigility and Pair Programming - PHPUGHH

PHPUGHH

Apigility by Ralf Eggert

Whats the problem?

  • new api in two hours
  • do rapid prototyping

In a nutshell

  • create a RESTful web services quick
  • create a rpc web service
  • supports versioning per url or negotiation (content type)
  • returns JSON and HAL JSON out of the box
  • authentication (database, code based, other)
  • api documentation
  • data validation (zend filtering)
  • supports deployment
  • modular based

Example

  • databased rest service
  • see slides for steps
  • good for easy stuff or complex stuff
  • good for rapid prototyping of see how the modules are working

To pair or not to pair by Sebastian Schürmann

About Sebastian

  • freelancer developer, coach, trainer
  • first contact to xp in 2005
  • scrum since 2008
  • loves open source
  • blog
  • mail

@s0enke

  • reduce bus factor
  • improve teamwork
  • improve learning

Pair Programming

Prefrace

  • pair programming illuminated (book)
  • specification by examples (book)
  • workshop

Critics

  • two programmers doing the work of one

Thesis

  • working alone, undistrubed is good
  • talking is disturbance which is bad

Theory

  • two persons (comes from rally driver)
    • driver (with the keyboard, focused to the current problem)
    • navigator (looking more at the whole concept)
  • switching roles regulary

Why

  • less bugs
  • faster in development (problem solving)
  • continous knowledge exchange
  • tightest feedback loop you can get in programming (even unit tests take longer)
  • P (plan), D (do), C (check), A (act) - loop
  • communication
  • simplicity (doing simple things, because two people have to understand)
  • feedback
  • respect
  • courage
  • bring back fun into work

Principles

  • feedback
  • embracing change (also the guy which code is change would became less grumpy)
  • assuming simplicity
  • seven synergies
  • pair pressure (chance they get interrupted is become lower)
  • pair negotiation
  • pair courage
  • pair review
  • pair debugging
  • pair learning
  • pair t(h)rust

Seven Habits of Effective Pair Programmers

  • take breaks (five minute breaks after 30 minutes)
    • take a look at "pomodoros" (5 up to 7 pomodoros is a full day work)
  • practice humility
  • be confident
  • communicate
  • listen
  • be a teamplayer
  • compromise vs standing firm
  • introverts vs extraverts / introversion vs extraversion
  • skill
    • shu-beginner (repeat presented action)
    • ha-intermediate (start break the rules/make innovations)
    • ri-expert (do not care about the rules)
    • do "shu" and "shu" - easy up starting into things
    • do "shu" and "ha" - create another master
    • do "shu" and "ri" - kickstart the shu
    • do "ha" and "ha" - biggest bang for the buck
    • do "ha" and "ri" - create another expert
    • do "ri" and "ri" - solve big problems

Type of Pairs

  • everybody pairs with everybody once in a time - good for knowledge sharing
  • pair hinging - do a user story together
  • test first pairing - implement, make the test red, switch and replay
  • stakeholder pairing - explain the stakeholder your code or the flow
  • newbie pairing - pair a newbie to a experienced one and finish a user story
  • pair bugfixing
  • pair release
  • write userstories/requirements as pairs
  • coding dojos - navigator and driver, audience can give feedback

To The Critics

  • knowledge iceberg (small explicit, tacit is the big part)
  • bug fixing cost (small: requirements, design, code, test, productiom :big)
  • flow state is established easily
  • groupflow
  • teamwork

Translate to de es fr it pt ja

Introduction Into Docker and Continous Delivery with Docker - Docker Usergroup Hamburg 09.06.2014

Docker UserGroup Hamburg

Introduction Docker

General

By Johannes Ziemke from docker

What is Docker

  • version 1.0 released a few hours ago - api stable (a bit)
  • written in go
  • build, packs and ships applications as lightweight containers
  • build once an run almost everywhere (since kernel 3.8.*)
  • rewrite of docCloud PaaS code

Benefits

  • start always from clean slate
  • spawn up complete test infrastructures in seconds
  • run your code against multiple versions easily
  • easy up setup of software environment
  • distribute complex setups as self-contained containers
  • build own infrastructure
  • easy ups deployment per day
  • scaling and mantaining of infrastructure (state convergence, manage everything)
  • helps you to solve managing complexity
    • similar problems
      • modules, classes, plugins
      • human communication: named concepts like car, cat or container
      • shipping goods: intermodal containers
    • solution: create an abstraction
      • does not matter what is in the container nor where it runs
      • clear separation of concerns (reduce communication between developers and ops)
      • developer can take care about used libraries, packagemanager, ...
      • op can take care about the system (alos resource planning and monitoring)
  • running commandos on top of:
    • immutable, shipable, layered images (defined by dockerfile, built by builder and pushed/pulled to registry)
    • copy-on-write storage on top (provides writeable layer on top of read only images to persists changes done by running container)
      • aufs
      • btrfs
      • devicemapper
    • isolated environment
      • using kernal features
        • namespaces (isolation by scoping, available: pid, mnt, net, uts, jpc, user)
        • cgroups (limit, accound and isolated general devices, cou, memory, ...)
        • future (solaris zones ...)
    • via RESTish API
    • missing pieces
      • docker can not address service discovery or dynamic scheduling
      • projects to close the gap
        • openstack
        • coreOs
        • mesos + marathon
        • flynn.io

Demotime

  • --privileged - can break out of container but control host
  • images are read only and creating a container on each start
  • docker commit - creates new image out of running container
  • use boot2docker

Continous Delivery with Docker

By Tobias Schwab from Dynport GmbH

Philosophie

  • continous delivery
  • canarien releases
  • "never touch running system", create a new one when something has to change
  • immutable releases (once created, never change it)

Why They used Docker

  • privacy concerns, aws not an option
  • hoster they could not pick
  • unreliable hoster API
  • flash based structure management
  • limited capacity
  • they are the biggest customer

Learnings

  • image based deployments -> use dockerfiles (do not add dockerfile generators on top)
  • use syslog and rsyslog to log out of the container
  • >>CMD ["/sbin/init"]<< to start debian based image
  • caching
  • configuration management
    • store configuration in environment
    • dependency injected with start of container (use same container for testing, stageing, testing ...)
    • logfiles and data outside of the container
  • do not
    • full blown vm (best case, one service per container)
    • ssh deamon inside containers
    • syslog deamon inside containters (sometimes needed)
    • user management (everything can run as root)
    • chef/puppet makes caching useles
    • rely on external services (github, gem page)
  • build management tools
    • bundler, pip, carton, composer, ...
    • problem is, they are slow on "clean slate"
    • ways to solve
      • add mainifest (like composer.lock) before code and use cached build files
      • pre-bundles base images
  • multi host
    • image distribution via docker registry
    • weighted load balancing via HAProxy
    • SSL termination via HAProxy (container exists by Johannes Ziemke)
  • load balancing
    • HAProxy
    • pool configuration stored in redis/etcd
    • configuration update
      • created
      • uploaded via ssh to host
      • verify configuration
      • replace configuration (old with new)
      • reload configuration
  • logging
    • putting container id, revision of image (host, code, request) via rsyslog out of the container
  • metrics
    • openTSDB
      • distributed, scalable time series database
      • hbase
      • tags/diminsions
      • from syslog via udp
      • rickshaw.js for graphs
      • compare status cudes, counts and times between actions of two revisions
  • benefits (reduces)
    • external dependencies
    • "did work on my machine"
    • unused cpu cycles
    • number of hosts
    • feedback times (number of deploys per day)
    • time to get new host online
    • hosts are more flexible
    • controlled revision change (controlled on each host)
    • faster build

Translate to de es fr it pt ja

AwareInterface, Graylog2 with Logstash and Contributing to the new PHPUGHH website - PHP UserGroup

link to meetup event.

Where

Jimdo
Stresemannstraße 375
Hamburg

AwareInterface By Stev Leibelt

  • reminder of dependency injection
  • increases the readability of a class structure
  • defined way of inject object/typ
  • interface injection could lead to a project based rule to distinguish between mandatory and optional dependencies
  • slides available hear.

Logstash and Graylog2 by Alexander Bernhardt

Simple log all.

questions to the log

  • what happens on the other server?
  • what happens when and on what circumstance?
  • what are you logging?

how to solve this?

By using Logstash, Redis and ElasicSearch, aggregate all and push all to a graylog2.

  • graylog can do some kind of monitoring, known as streams.
  • you can add a alert method to each stream.
  • nagios can listen to a graylog stream.
  • could not replace statsd or graphite

Talk And Call For PHPUGHH Website By Stephan Vock And Ole Michaelis

  • two Pages for one user group, which one to choose?
  • the usergroup decides to use the new page.
  • you need to have installed jekyll, rake or use the vagrant box
  • directory structure
    • each speaker should pull his own talk below "talks"

How To Contribute

  • fork repository
  • git checkout -b feature/foo
  • do the changes
  • git commit
  • pull request to the main repository
  • github.io builds new page on its own
  • git remote add upstream [email protected]:phpughh/phpughh.github.com
  • git fetch upstream
  • git merge upstream/master
  • git push
  • issues are available
  • enhancement issues is the roadmap
  • open issues if needed
  • links available as ticket
  • take a look to the bephpug (github)
Translate to de es fr it pt ja

Next Level DevOps And Softwarearchitecture Of A Modern Onlinegame - PHPUserGroup Meetup

Mindworks
Jarrestraße 42A
Hamburg

Next Level DevOps By Ole Michaelis

Preliminary Consideration

  • infrastructure is created by feature (but without clean up or cleaning things up)
  • did a practical training round in admin team for half a year

What Is DevOps?

  • you build it, you run it (until it goes offline)
  • monitor it, automate it, measure/metering it
  • build small tools and services to form an api

How Became A DevOp?

  • extend your development skills
  • learn and do refactoring
  • learn the shell
  • learn the operation system
  • pull deployment with deployment hooks

Softwarearchitecture Of A Modern Onlinegame By Tobias Rojahn

Preliminary Consideration/Requirements

  • crossplattform (mobile and web)
  • realtime game (fast information about status changes)
  • multiplayer (user can influence each other)

Architecture

  • user (request websocket from web server)
  • NodeJS (handles websocket connection to redis and global redis)
  • redis (message queue with push and pull)
  • php worker (long living php process, asks webservices or database, are forkable by using php forking mechanism)
  • if something is calculated by the php worker, the message is pushed in the global redis

The PHP Worker

  • long living workers
  • worker is observing the queue (and event handling) and is pushing the message to the dispatcher
  • each message has a type to push to the right controller
  • dispatcher is using the right controller (with a bunch of internal to external mapping and nearly zero logic)
  • controller is pushing the message to the right domain service (using the right domain objects and/or repositories)
  • controller is working with multiple db views
  • domain service can also call the event dispatcher to trigger other systems (not core systems)

Deamon

  • only creates messages
  • just time controlled game events

Cronjob

  • only creates messages

NodeJS

  • socket (via socket io) replaces session
  • add additional data (with indexes to gain speed) to the socket (via message queues from php)
  • node to php: send all data
  • php to node: a combination of data to all connected sockets
  • forwarding of fitting messages (with removing of internal datas)

Testing

  • API-Tests
    • description
    • ingoing message (test data)
    • outgoing message (expectations)
  • based on fitrues
  • only php layer
  • rollback on each test

Translate to de es fr it pt ja

Reusability Of Symfony Component - Mindworks

By Oliver
Mindworks
Jarrestraße 42A
Take a look to knpbundles.

Hurdles

  • problem is solved in other language
  • problem is solved in other licence
  • can be solved by design patterns (abstract solution)
  • write a good bundle/component that is general enough takes much more time

Anti-Pattern

Reuseage by copy and paste.

  • decreases maintainability
  • decreases testability
  • violates dry principle

Scenario

  • community web application
  • users seek other users by interests
  • how to input data to easy up matching?

What Do We Need?

  • form widget (js and css based)
  • data transformer (converts format from storage to human readable presentation and back)
  • form type (provides name for form widget, called in FormTypes, gets TagManager injected and defines DataTransformer)
  • Entity Trait (avoid copy and paste)
  • Taggable Subscriber
  • Make it reusable (dedicated bundle, created composer project)
  • Use JavaScript and CSS via "composer component" (see web/bundles, RobLoach/component-installer)

Live Demo

Available on github

Translate to de es fr it pt ja

High-Performance Websites - PHPUG and WebPerformanceUG

Arne Blankerts, Stefan Priebsch - High-Performance Websites

This talk contains information about architecture.

Classical Architecture

When have done this for quite a while.

Browser->WebServer->PHP-Database

This works best in the past. General solution was to add more hardware and that leads to more errors.

  • monolithic architecture
  • normalized data (in database)
  • pull-principle (browser is build per request)
  • full page cache is bad
  • edge site include (for varnish/ESI) is also not the best solution

We are fast when:

  • no real workload per request
  • everything from memory
  • denomalized data
  • snippets

How Often Does Data Change (From Rare To Often)?

Based on the example of a shop system.

  • catalog
  • product information
  • price
  • availability

Who Changes Data?

  • editor
  • product manager
  • receipt of goods / outgoing goods

New Architecture (CQRS-Architecture)

  • images and static content is deliverd by static content webserver
  • only dynamic part is done by php
  • snippets are deliverd, not full pages

PHP->Key-Value-Store->Backend-Process->Database
or
PHP->Web-Service->Database

Benefit of key-value-store (for example redis) is, that the database itself can die and the only thing that happens is, that the entries are becoming obsolete.

But What About Filternavigation?

Use a searchengine that returns simple a collection of product keys. Use this product keys and ask the key value store to fetch product data.

But What About Personalization?

  • use snippets with variables and default values
  • fetch this snippet in the key value store
  • thanks to "time to death" feature provided by many key-value-stores, you can easily define "special offers" per day and so on

Nice meetup, incredible how many people are attending already.

Translate to de es fr it pt ja

Define The Unspeakable - PHPUG and WebPerformanceUG

2013-09-10 Hamburg, Otto, Loft 06

Judith Andresen - Make Mistakes The Right Way

Define The Unspeakable

Result

  • establishment
  • project
  • uniform

moral concepts (negotiable)

  • hanseatic
  • freaked out / nerdic
  • cutting edge

basic assumption

They are teached/ already at school level (errors are bad, don't do something wrong).

  • what can i do
  • who am i able to add critic to
  • natur
  • fellow men
  • industry

From the school already, we get trained to:

  • it is bad to say "that was my fault"
  • shift the know error to others
  • there is one majority out there who decides if this is a bad error
  • be perfect
  • always have a fallback (not to lose the face)

Define A Good Error Culture

This goals can be achived by exemplify the following steps (best by upper management but important for all).

  • "good" is enough
  • no fear of mistakes
  • many/fast update cycles (don't try to do big jumps, doing small steps results in small mistakes)
  • straightforwardness
  • to take the blame is not important
  • do not repeat your mistakes
  • do small and usefull steps (validate if your change contains a "only if")
  • use and understand the Twelve Principles of Agile Software
  • celebrate reached goals

Slides are available on judiths page. Again a nice talk and incredible what kind of easy mistakes we are doing in our regular live.

Translate to de es fr it pt ja

usergroup - meetup - webPerformance - hamburg 130220

Attraktor e.v. mexikoring 21, hamburg

Soundcloud - Arbo Von Monkiewitsch

html5 audio playback widget - measuring for velocity

measure first

how to?

  • synthetic user monitoring (by phantom.js)
    • repeaable
    • doesn't show real user experience
    • good for benchmarking
  • real user monitoring (google analytics)
    • shows real user experience
    • change of user behavior impacts repeateability (e.g. side slow in asia but fast in euro)
    • impact of embedding site

what?

  • http ping
  • fully page load
  • include all transactions
  • follow K.I.S.S., just render the page

define your goals

  • what is fast
  • don't define random goals on yourself
  • public benchmarks are good as orientation (for e.g. set up a benchmark for youtube or similar)
  • response time
  • don't simple trust your metrics

best practices

  • httparchive, pagespeed, yslow (100 - 200 ms as full page loading speed is good enough)
  • compress each connection (use varnishs or something similar for uncompressable content)
  • availability fallback -> dc
  • performance - put api in cdn (also for http or https handshake)
  • consitency - load balanced cdns

rap it up

  • measure first
  • keep it simple
  • team autonomy

phantomJs - Raj Dudi

http://rajdudi.com

what it is - created by ariya hidayat

  • can be integrated into jenkins
  • automation and headless testing
  • can be used for metrics measurement
  • render and dump client side html
  • current version is 1.8
  • headless (Qt)Webkit/Browser
  • javascript driven
  • ideal for
    • headless website testing -> but it is not a test framework
    • screen capture
    • page automation
    • network monitoring
  • projects
    • casperjs
    • ghostbusters
    • poltergeist

code evaluation

  • evaluate(function, arg1, arg2, ...) {object}
  • returns simple objects but no functions and closures
  • execution is sandboxed
  • dom scripting and css selector works
  • use onConsoleMessage callback to receive the console messages

get it from

  • phantomjs.org
  • github.com/ariya/phantomjs
  • https://aur.archlinux.org/packages/phantomjs/

examples

https://github.com/ariya/phantomjs/tree/master/examples

hello world

console.log("Hello world"); phantom.exit();

screen capture

  • Page.render to render a screenshot
  • supports ong, jpeg, gif and pdf
  • options
    • page.clipRect = { top: 14, left: 3, width: 400, height: 300 };
    • page.paperSize = { width: '200px', height: '300px' } //for pdf output e.g., also supports borders and much more
    • page.zoomFactor = 0.25 // 1 is default
  • projects based on phantomjs
    • screenr
    • mediaqueri
    • chromanope
  • webpage api
    • var page = require('webpage').create();
    • page.open(url, callback) {void}
    • page.close() {void}
    • goBack(), goForward(), title, url
    • settings{object} //enable javascript, load images, username or password, websecurity
    • page.includeJs(url, callback) {void}
    • page.injectJs(filename) {boolean}
  • webpage callbacks
    • onLoadStarted
    • onLoadFinished
    • onAlert
    • onCallback //experimental
    • onClosing
    • onConfirm
    • onConsoleMessage
    • onError
  • system API
    • var system = require('system');
    • ...
  • filesstem api
    • var fs = require('fs);
    • separator {string}
    • workingDirectory
    • ...

troubleshooting

  • allows network sniffing
    • onResourceRequested
    • onResoureceReceived
    • TLS and SSL required for encrypted data - are they enabled?
  • error handling

cons

  • uses qtWebKit (not used by chrome, safari and so one)
  • asynchronous api - difficult to handle for many
  • not supported
    • plugins
    • webGL
    • video and audio
    • css 3-D
    • xpath

What could i add? Thanks to the talks, yes very much. Also thanks to the attraktor, you are doing it right!

Translate to de es fr it pt ja

magento meetup - 121211

date: 11.12.2012 place: Agenturwerft - Mattentwiete 8, Hamburg link: xing.de

introduction

There where more then 98 magento meeting this year.

Newsletter marketing with magento and inxmail by Katharina

who we are

cvh-design.de - based in ahrensburg/hamburg - webdesign, online-marketing, logo-design, mailings, flyer ... - implemented 10 magento shops in last three years - since 2005 inxmail solution and hosting partner - 10 employes - started implementing of open source interface in 2010 - http://cvh-design.net/aktuelles/inxmail-erweiterung-fuer-magento.html

email marketing and all about

You can track clickareas in emails like hotspots on webpages. Registration export with all, by law, needed informations. Double opt in ... (sorry an important call received me)

magento and inxmail

magento - contains and manages user data - process ordering - "user cockpit" - product informations

inxmail - contains and manages subscriptions - documents the process of subscription - mailing quality - bounce management - reports of mailings

mag2inx and inx2mag

mag2inx - open source - interface to transfere data from magento to inxmail

example: - user registers to or via newsletter (single-opt-in or confirmed opt-in) - user changes data

inx2mag - closed source - interface to transfere data from inxmail to magento

example: - user deletes his newsletter subscriptions

double opt-in

Double opt-in currently not needed by law.

process

  • user registeres to newsletter
  • magento adds user to subscriptionlist
  • sends user in status "unapproved" to inxmail
  • inxmail sends mail to user
    • user subscrips
    • inxmail status switched to "approved"
    • inxmail transferes status "approved" to magento
    • user doesn't subcrips
    • nothing happens

future planing

  • configureable fields available in magento (currently prename and suffname, emailaddress and title)
  • selection of magento products via xml template

    generate product informations with excel and import them into magento by mash2 who we are mash2.com

  • specialized to import/export mechanism to and from magento
  • company exists since 2012

export available product informations

  • since 1.5.x -> use new export but doesn't export data in a well way
  • thats why mash2 still uses the dataflow
  • in excel you choose "data->from text" and select utf8-unicode and comma separated
  • excel remembers the import process based on filename, so future import is easy and faster than first one

polish product informations in excel

  • excel is well known in management, merchant and consultant area
  • use excel based concate to auto generate data (description/seo words) to fill up the excelsheet

import informations in magento

  • save as unicode file
  • use import, choose file and thats it

    Translate to de es fr it pt ja

php usergroup meetup - 121009

Date: 09.10.2012 Place: Mindsworks - Jarrestraße 42a, Hamburg Link: Meetup

new php usergroup page by Ole Michaelis

Uses "github pages" and "jykil", Take a look on github.

how to defeat stage fright by Heiko Harthun

Introduction www.heikoharthun.de www.arge-zeiten.de

Heiko provides courses for developers to presentate themself as also the product on conventions/trade shows/exhibitions. He helps if the communication between developers and management (e.g. in the scrum retrospective) is not working anymore.

general Only thing that helps against stage fright is moving around. It is also the only thing that helps effective. You should eat enough before you are going to present something. Try to eat energy rich things like nuts, bread, less sugar, things that contains L-Tyrosin and L-Tryptophan.

body hack Autogenic training or meditation can help but they are helping after you have practised them for a long time (six months or more). Also going to sport (more the once per month ;-)) is helping to keep the level of adrenalin low.

brain hack Try to create a solution/fallback for each problem that can occur. Things that can occur are "Questions inbetween", "fear for own existence", "nemesis in the crowd", "lose of the face", "blind spot", "blackout", "lose the thread" or "uninteded lauchter". The major answer is "what do i fear" and "why do i care to come into this situation". Try to have a fallback also for general problems (hardware is missing, hardware breaks down etc.). A solution can be, to listen on favorite music right before you start your presentation.

source/books stryer - biochemie daniel pink was sie wirklich motiviert pruefungsangst - fortschritte in der psychotherapie

Compare notes about PHP UnitTest Workshop by Agata Raap and Frank Sons

general Introduce unittesting in already existing and complicate to test source code is hard. Try to do a workshop by using already existing code to introduce into the topic "unittest". First write a unittest that covers know behaviors and after that, refactor the code.

How can we test old code (with dependencies, strong coupling)? Keep current methods and exclude them into new methods. This new methods are testable by dependency injections or something similar.

Always start and demonstrate unittest with simple examples.

best practice (ask round) Getter setter testing? Code coverage - what does is tell? Is static code untestable? Should you test controllers?

This notes are a little bit late (yes i know ;-)) but free time is something that it is currently a kind of unreachable wish.

Translate to de es fr it pt ja

php usergroup meetup - 121113

Date: 13.11.2012 Place: Bigpoint - Drehbahn 48, 20354 Hamburg Link: Meetup

new website by Ole Michaelis

Contribute if you find bugs or want to improve work. Slides are available as soon as possible. Howtos available. Old site still available. It is currently planed to move/integrate the old mailinglist.

video conference by Seemant Kulleen about "Emotional Decisions"

Emotions are most binary today (like or not). We prefer products with higher ratings and vice versa. Code can create emotions also (good/great code or software) -> as developer, you are creating realities. Why not make this reality an experiences instead? When you create a high enough experience, you create a loyal user (loyalty like stickiness). Users reacting emotional by adding a thump, a comment etc. The more the developer is passionated, the more passionated the users can be -> try to do what you love :-). -> create things you belive -> create things you belive in

You have to understand how and why you react to things, you are getting closer to your passion. If you know why you are liking and doing things, you should focus on doing things thinks.

And like in general, you have to share your passion and get shared passion,

how to build up a datacenter by Rene Sasse (iphh.net)

Take a look to the "webmontag" (xing group, twitter).

More current -> bigger air condition -> more climate cabinets -> less free space.

Looks like the guys from iphh.net are pro's. If you are not believe in, watch the linked video.

Translate to de es fr it pt ja