Skip to content

Instantly share code, notes, and snippets.

View ajmurmann's full-sized avatar

Alexander Murmann ajmurmann

  • Pivotal
  • Beaverton, OR
View GitHub Profile
My first full-time Software Engineer role was at Pivotal Labs. We were probably still fewer than 50 people and of course followed all the Extreme Programming practices. Pair programming is one of the core practices and it stayed with me for much of my following jobs. I want to share how my views of it have changed and when it's most valuable.
I used to believe that it's most valuable to make pairing the default. This solves a lot of problems. You get collective code ownership, can probably eliminate code reviews, quickly have the team to gel around standard practices, knowledge sharing, more focus, higher code quality etc. (https://martinfowler.com/articles/on-pair-programming.html has a much better list of all the potential benefits).
I still believe that pair programming brings many of these benefits. However, it's a tool like everything else. How much value you realize depends on the context in which you use it which includes the problems your team is solving, what other tools and processes you are usin
# for f in PRI04*.mp4; do
# `ffmpeg -i $f -f webm -vcodec libvpx -acodec libvorbis -ab 160000 -b 2400k -threads 2 -an $f.webm`
# done
# for f in *.webm *.mp4; do
# `ffmpeg -i $f -vcodec copy -an silent_$f`
# done
# ffmpeg -i PRI04_Rough03_Vid2_loop_1080p.mp4 -f webm -vcodec libvpx -acodec libvorbis -threads 2 -an -s 603x346 PRI04_Rough03_Vid2_loop_1080p.webm
# ffmpeg -i PRI04_Rough03_Vid2_loop_1080p.mp4 -threads 2 -acodec copy -b 4000k -s 604x346 PRI04_Rough03_Vid2_loop_603p.flv
@ajmurmann
ajmurmann / java_concurrency_chapter5.md
Created September 19, 2017 04:19
java_concurrency_chapter5.md

Chapter 5

Synchronized Collections

  • Process everything serially -> bad scalability
  • Iterating not safe, since not atomic -> need to block during iteration or copy
  • Compounded by hidden iterators like toString

Concurrent Collections

  • Allow concurrent access -> much faster

Chapter 4: Composing Objects

  1. Identify variables that form state
  2. Identify invariants
  3. Policy for concurrent access to state (synchronization policy)
  • Synchronization Policy preserves invariants and post-conditions
  • Final allows to reduce state space
  • Illegal states need to be prevented by synchronizing involved variables
@ajmurmann
ajmurmann / advent8.rb
Last active December 8, 2016 06:03
advent8
text=File.open('8.txt').read
m = [
Array.new(50,0),
Array.new(50,0),
Array.new(50,0),
Array.new(50,0),
Array.new(50,0),
Array.new(50,0),
@ajmurmann
ajmurmann / merge_with_block
Created February 16, 2012 17:53
merge with block
{:a => 2, :b => 10}.merge(:a =>3) {|key, x, y| x + y}
=> {:a=>5, :b=>10}
@ajmurmann
ajmurmann / ternary_alternative
Created February 8, 2012 04:12
ternary alternative
(x > y) ? x : y == (x > y) && x || y
@ajmurmann
ajmurmann / syslog
Created November 7, 2010 21:04
syslog
Nov 7 20:35:10 ip-10-162-54-208 kernel: imklog 4.2.0, log source = /proc/kmsg started.
Nov 7 20:35:10 ip-10-162-54-208 rsyslogd: [origin software="rsyslogd" swVersion="4.2.0" x-pid="369" x-info="http://www.rsyslog.com"] (re)start
Nov 7 20:35:10 ip-10-162-54-208 rsyslogd: rsyslogd's groupid changed to 103
Nov 7 20:35:10 ip-10-162-54-208 rsyslogd: rsyslogd's userid changed to 101
Nov 7 20:35:10 ip-10-162-54-208 rsyslogd-2039: Could no open output file '/dev/xconsole' [try http://www.rsyslog.com/e/2039 ]
Nov 7 20:35:10 ip-10-162-54-208 kernel: [ 0.000000] Reserving virtual address space above 0xf5800000
Nov 7 20:35:10 ip-10-162-54-208 kernel: [ 0.000000] Initializing cgroup subsys cpuset
Nov 7 20:35:10 ip-10-162-54-208 kernel: [ 0.000000] Initializing cgroup subsys cpu
Nov 7 20:35:10 ip-10-162-54-208 kernel: [ 0.000000] Linux version 2.6.32-309-ec2 (buildd@palmer) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #18-Ubuntu SMP Mon Oct 18 21:00:20 UTC 2010 (Ubuntu 2.6.32-309.18-ec2 2.6.32.21+drm3