Holy on Dev
Do You Know Why You Are Testing?! (On The Principles Underlying TDD)
Kent Beck in his recent post Functional TDD: A Clash of Cultures summarizes well the key principles and benefits that underlie test-driven development. I think it is really worthwhile becoming aware of and thinking over these foundation stones of TDD (and testing in general). Knowing them enables you to apply TDD in the most effective way with respect to a particular context to gain the maximum of these benefits. People that do not really understand the value of their tests and TDD tend to write hard to maintain tests of limited (and occasionally even negative) value. Are you one of them?
Tip: Import Leiningen Project to IntelliJ (With Dependencies)
To import a Leiningen-based project into IntelliJ with the Clojure plugin, the best way seems to be:
lein pomto generate a Maven
- Import the project as a Maven project (File - New Project... - Import project from external model - Maven - browse to the directory - ...)
Puppet Troubleshooting: Compiling Catalog, Locating a Cached Catalog
Few troubleshooting tips for Puppet.
Where to Find the Cached Catalog On ClientPuppet Agent caches its compiled (text/Ruby) catalog under its $vardir, for example Puppet 0.25.x stores it into
/var/lib/puppet/client_yaml/catalog/<hostname>.yaml. It might be useful when troubleshooting.
Compiling Catalog ManuallyYou can compile the catalog for a particular node manually on the Puppet Master. Ex.:
Tool Tip: Byob - Screen With Text UI
Screen (man) is very useful for running terminal sessions on remote computers that enable the user to disconnect and re-connect. Byobu (man), formerly also called screen-profiles, is a wrapper script for screen that adds status lines with useful info to screen and provides text UI for configuring it (byobu-config).
My Scala vs. Clojure Impression In Pictures
(By kristobalite)Clojure: Clean Structured Focused
(By agiamba)Scala: Adorned Overflowing Magnificent
Note: Loading Tab-Separated Data In Cascalog
To load all fields from a tab-separated text file in Cascalog we need to use the generic hfs-tap and specify the "scheme" (notice that loading all fields and expecting tab as the separator is the default behavior of TextDelimited):
Most interesting links of September ''12
Recommended Readings Johannes Brodwall: This dependency injection madness must end! - it's very valuable to hear well-founded arguments against any popular belief and Dependency Injection is one of these. "I have started disliking the consequence of this strategy very much: All coupling in my system becomes implicit and harder to understand. I have instead reverted to using desi
Using Java as Native Linux Apps - Calling C, Daemonization, Packaging, CLI (Brian McCallister)
This is a summary of the excellent JavaZone 2012 talk Going Native (vimeo) by Brian McCallister. Content: Using native libraries in Java and packaging them with Java apps, daemonization, trully executable JARs, powerful CLI, creating manpages, packaging natively as deb/rpm.
1. Using Native Libs in Java
Calling Native LibsCalling native libraries such as C ones was hard and ugly with JNI but is very simple and nice with JNA (GPL) and JNR (Apache/LGPL)
Infographic: Why Should All Learn Little Code
VisualVM: Monitoring Remote JVM Over SSH (JMX Or Not)
(Disclaimer: Based on personal experience and little research, the information might be incomplete.)
VisualVM is a great tool for monitoring JVM (5.0+) regarding memory usage, threads, GC, MBeans etc. Let's see how to use it over SSH to monitor (or even profile, using its sampler) a remote JVM either with JMX or without it.
This post is based on Sun JVM 1.6 running on Ubuntu 10 and VisualVM 1.3.3.
Enabling JMX Monitoring for Hadoop And Hive
Hadoop's NameNode and JobTracker expose interesting metrics and statistics over the JMX. Hive seems not to expose anything intersting but it still might be useful to monitor its JVM or do simpler profiling/sampling on it. Let's see how to enable JMX and how to access it securely, over SSH.
The Best Code I Have Ever Written Is The Code I Never Wrote
The best code I have ever written is the code I never wrote. It works exactly as intended. There are no bugs, ever. It doesn't increase complexity of the application. Other people don't need to struggle to understand it. It gets never outdated.
Programming Like Kent Beck
Republished from blog.iterate.no with the permission of my co-authors Stig Bergestad and Krzysztof Grodzicki.
Three of us, namely Stig, Krzysztof, and Jakub, have had the pleasure of spending a week with Kent Beck during Iterate Code Camp 2012, working together on a project and learning programming best practices. We would like to share the valuable lessons that we have learnt and that made us better programmers (or so we would like to think at least).
(Unit) Testing Swiss Knife: All the Tools You Wanted to Know
I love testing. And I like productivity. There are many tools and libraries that make writing tests easier, more convenient, more fun. I would like to introduce here those that I found the most useful during the years, from selected advanced features of JUnit to assertion libraries, powerful behavior/fault injection, testing of database-related code, and finally to boosting your testing productivity hundredfold with Groovy.
This post accompanies my JavaZone 2012 lightning talk and goes more in depth and introduces additional tools and tips.
Help, My Code Isn''t Testable! Do I Need to Fix the Design?
Our code is often untestable because there is no easy way to "sense1" the results in a good way and because the code depends on external data/functionality without making it possible to replace or modify these during a test (it's missing a seam2, i.e. a place where the behavior of the code can be changed without modifying the code itself). In such cases the best thing to do is to fix the design to make the code testable instead of trying to write a brittle and slow integration test. Let's see an example of such code and how to fix it.
- Previous (10)Next (14)