The long way through Software Craftsmanship

Validating CSV data in clojure

Dec 15, 2015 - 2 minute read - Comments - clojurehofcsvvalidationyagniidea-for-another-postreplrepl-based-developmentselectorlambda

At a client, we have CSVs of data that can be simplified to this 1: (def data [ ["total" 6 8 13] ["0" 1 2 3] ["0" 2 0 4] ["0" 3 0 6] ]) In this case, some of the row named total is the sum of the rest of the rows, but only for some columns (second and fourth). We do not want to get rid of the columns, as they need to be printed at the end.

Clojure and the macro and

Dec 8, 2015 - 3 minute read - Comments - clojuremacroandreplfunctionmacro-vs-function

While on the REPL, I tried this: simple.core=> (reduce and true [true]) CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/and, compiling:(form-init7116694665186998245.clj:1:1) Reading the clojuredocs for and, you can find this: Note add is a macro, so you cannot apply it. For example, there is a vector of some Boolean values [true true false true], which you want to test to see if they are all true. The code below will not work:

Tip: automate the blog publishing

Dec 2, 2015 - 1 minute read - Comments - metaautomationblogtraviscioctopress

I’ve automated the generation of the blog using Travis CI. Using this new way, each commit generates a new version of the pages. These resources have been very useful: Prose.io + Octopress + Travis-CI + GitHub Pages = ♥. First post (in this set) that explains how this automation is possible Auto-deploying to My Octopress Blog With Travis-CI. Explains how to generate your key, encript it with travis Octopress + GitHub Pages + Travis: The most useful page, explains step by step what to do for mac and linux.

Self-Study in December 2015

Dec 2, 2015 - 17 minute read - Comments - self-study-aggregationDecember2015read10x-engineer2015abstract-syntax-treeacceptance-testactive-passiveactor-modeladviceaestheticsagilealain-helailialan-skorkinallison-kapturanalogyanarchyandrew-burgessangularanswerantipatternapplication-gatewayarchetypeastbankbarcelona-software-craftsmanshipbddbenchmarkbenjamin-hoffmanbidibinary-searchbonilistabookbook-reviewbozhidar-batsovbranch-mispredictionbruceSchneierbus-factorbusiness-metricbusiness-ruleccareercareer-changecareer-managementcarol-dweckchallengechangechaptercheatingcheatingsoftwarechris-fordclangclean-codeclear-codeclever-codeclientclojurecodecode-analysiscode-smellcode=datacodelycodely-tvcommentcomparisoncompilercompojurecomputer-sciencecrankshaftcredentialcristobal-garciacryptogramctocursivedaniel-higginbothamdata=codedatabasedavid-bonilladavid-farrelldefinitiondenotationdesign-patterndevoxxdomain-specific-languagedottydownsidedsldynamicedneffectivenessefficiencyelixiremacsequalityeric-evanseric-normanderlangessayevaluationevaluatoreventexampleexperience-reportfailoverfeaturefirebasefixed-deadlinefixed-mindsetfolkloreformingfred-georgefunction-inlinefunctional-compilerfunctional-programmingfunctional-testfunctorgiftgilles-harogithubglenn-smithgood-programmergppgreg-hurrellgrowth-mindsetguidehabithadi-haririhigh-availabilityhomoiconicityhow-tohttp-kitidealistaimportant-vs-urgentimpostor-syndromeinlineintellij-ideainvestmentiotisra-alcazarisrael-alcazarjaime-pererajames-reevesjason-gormanjavajavier-ferrerjavier-garzasjobjon-pitherjulien-crouzetjunior-developerjunitjuozas-kaziukenaskaran-goelkeela-robisonkellan-elliott-mccreakevin-dishmankhelllanguage-syntaxlatencylateral-thinkinglawleaklearninglearning-strategylevel-7-firewallliberationlistlone-wolfmacromanagementmanagement-stylemartin-fowlermartin-jeemartin-oderskymass-adoptionmathias-verraesmetaprogrammingmethodologymichael-loppmicrosecondmike-sherovmindsetmistakemodern-perlmoneymulti-linestringmvpneil-sloanenitor-creationsnodejsnormingo3objectoeisold-stuffopen-sourceoptimizationoptimizeroracleorganizationoversightpatternpechakuchaperformingperlpetri-kainulainenpieter-hintjenspluginpost-mortemposter-and-keypreventionprioritizationprofessional-careerprofileprogrammerprogrammer-analogyprogrammer-anarchyprojectproject-managementproject-thinkingpull-requestqualityquotingreaderreadingrecruitmentrecurse-centerreductionreeditionrefactorrefactoringreferencereflectionremoteremote-firstresearchreviewringroger-hughesroopesh-shenoyroy-osheroverspecrubyrulerule-enginerunnerryan-haaseryan-tomaykoscalacscbcnscbcn15screencastscrumscrum30sebastian-radicssenior-developersilver-bulletsimplicityslidesloanesoftware-creationsoftware-engineeringspecification-patternsplicingstack-overflowstartupsteve-cohenstmstormingstringstyle-guidesuccess-storysupportsymbolsyntaxtalktddteamteam-managementteam-thinkingtechniquetechnologytelescoping-constructortesttest-pyramidthomas-neumanntim-potetime-managementtiptitletooltransparencytuckmantutorialtypeunit-testunquotingvaluevideoville-tormalavolkswagenwolfworkxavi-gost

Ruby Equality And Object Comparison I’ve read this article, written by Alan Skorkin, that explains equality comparisons in ruby: equal? is reference equality == is value equality eql? is value and type equality Tags: ruby, comparison, equality, object, reference, alan-skorkin Software Folklore I’ve watched this PechaKucha by Chris Ford on what are laws and how they relate to creating software. Also talks on what could be an analogy to software creation (says not science, not engineering)

Functional Implementation Patterns

Nov 2, 2015 - 3 minute read - Comments -

Collection of HOFs Select Attribute class Array def select_attribute attr self.map { |unit| unit[attr] } end end usage: [71] pry(main)> [ {:element => 1, :even? => false}, {:element => 2, :even? => true}, {:element => 3, :even? => false}] .select_attribute :even? => [false, true, false] Collection of patterns Decorating a collection Introduction You want to materialize properties from a collection Alternative names Intermediary Functional decorator Collection Annotation (from Wallingford’s Roundabout, especially Interface procedure) Example [62] pry(main)> [1,2,3] .

Self-Study in November 2015

Nov 2, 2015 - 6 minute read - Comments - self-study-aggregationNovember2015read=====adrian-thurstonagileagile-methodologyanswerat-least-once-deliveryat-most-once-deliverybart-bakkerbbmbipolar-lisp-programmerblockblpbrillian-bipolar-mindbroken-windowccap-theoremcarlos-blecentralizationclojurecobolcode-generationcoman-hamiltoncomparisoncontextcounterexampledecentralizationdescribedifferencedistributed-systemdistributioneqequalessayfederationfinite-state-machinefortranfsmfunctional-programminghackinghaskellhindley-milnerhofideaintegrated-testintegration-testipfsj-rainsbergerjames-coglanjavajava-eejavier-garzasjbrainsjepsenjiri-knesljose-lopezjtbandeskanbanknossoskoankyle-drakekyle-kingsburylegacy-languagelessonlisplisp-programmerlispmlockmacromanagementmanagement-frameworkmark-tarvermethod-referencemutexnative-extensionno-free-lunchobsolescenceone-man-bandoraclepareto-principlepedagogypermanent-webplanned-obsolescenceprincipleprogrammerquestionquoterabbitmqragelreid-mckenzierelationshiprspecrubyrubymonkrudolf-winestockscalaschemescrumscrum-implementationslidestackoverflowstate-machinesymbolicstddteacherteachingteamtheorythreadtype-inferencetype-inference-algorithmvalueweb-archivewikipedia

Call me maybe: RabbitMQ I’ve read this article by Kyle Kingsbury on using RabbitMQ as a lock service. It investigates and gives a counterexample of using it for this purpose. Uses Knossos to do the testing and surfaces a problem with it. Explains specific problems on locking: at-most-once and at-least-once message delivery Note: References Jepsen (I guess an inside joke to the song “Call me maybe” by Carly Rae Jepsen) for at-most-once and at-least-once message delivery.