Holy on Dev
Connect Tunnelblick to VPN automatically after wake up
Need: Make sure that VPN is always running except when at work.
Partial solution: Make sure VPN is always running with "connect when computer starts" and using an AppleScript to connect after waking up from sleep. Disconnect manually when at work.
Future: Check the current location (wifi name? IP?) and do not connect when at work.
Book Review & Digest: Capital In The Twenty-First Century
My key takeaways and highlights from the book. This is not an objective and consistent review.
Capital in the Twenty-First Century by Thomas Piketty is together with Thinking, Fast and Slow, the most important book on society I've ever read. And together with Rawls' A Theory of Justice it has shaped my opinions on society and justice. All politicians and good people interested in politics and inequality should study it. It is unique in leveraging over 200 hundred years of data from different countries and using those as the base of the discussion of the evolution, laws, and future of capital and (in)justice in its distribution.
- Growth cannot be 4-5% forever. In the long term, 1-1.5% is more realstic (and still far more than in the past). Higher growth is typical of countries catching up to more advanced economies (such as Europe to US, UK after WW2, China to the West nowadays).
- Return on capital, typically 4-5% (before taxes), is thus far higher than the growth of economy and salaries. The result is that the rich get ever richer, taking ever more of the national income. (Consequently, the poorer half has ever less of it.)
- To keep democracy and have a stable society, this has to be adressed politically.
Tiny, Tiny Steps - Experience Report Developing A Feature In Minimal Value-Adding Increments
A post for those who want to see what an iterative, MVP-driven development of a feature looks like.
@lukew: Start with the simplest version you can. It's much easier to add complexity than to remove it.
Once upon time, there was a webshop portal with hundreds of partner webshops displayed on the front page. Potential users wanted to find out if their favorite webshops or a particular type of goods were available, existing users wanted to find a shop quickly. Therefore it was decided to implement search. But how to do that?
Notes From CodeMesh 2014
My consise highlights from CodeMesh 2014.
Most interesting links of July ''14
Recommended Readings Video: The Unreasonable Effectiveness of Dynamic Typing for Practical Programs - a static-typing zealot turned friend of dynamic typing under the experience of real-world projects and problems shares thoughts about the limits of type systems (f.ex. both energy and
Most interesting links of June ''14
Recommended Readings The emperor’s new clothes were built with Node.js - I know sadly little about Node.js but this goes against the hype and is thus interesting. So what does Node.js give us? Performance 1-5x slower than Java [like Clojure] according to the Benchmarks Game (contrary to other benchmarks with the opposite result as mentioned in the comments), use of a single CPU/core on our multi-cpu, multi-core machines, ca
Review: Clojure for Machine Learning (Ch 1-3)
Pack Publishing has asked me to review their new book, Clojure for Machine Learning (4/2014) by Akhil Wali. Interested both in Clojure and M.L., I have taken the challenge and want to share my impressions from the first chapters. Regarding my qualification, I am a medium-experienced Clojure developer and have briefly encountered some M.L. (regression etc. for quantitive sociological research and neural networks) at the university a decade ago, together with the related, now mostly forgotten, math such as matrices and derivation.
In short, the book provides a good bird-eye view of the intersection of Clojure and Machine Learning, useful for people coming from both sides. It introduces a number of important methods and shows how to implement/use them in Clojure but does not - and cannot - provide deep understanding. If you are new to M.L. and really like to understand things like me, you want to get a proper textbook(s) to learn more about the methods and the math behind them and read it in parallel. If you know M.L. but are relatively new to Clojure, you want to skip all the M.L. parts you know and study the code examples and the tools used in them. To read it, you need only elementary knowledge of Clojure and need to be comfortable with math (if you haven't worked with matrices, statistics, or derivation and equations scare you, you will have a hard time with some of the methods). You will learn how to implement some M.L. methods using Clojure - but without deep understanding and without knowledge of their limitations and issues and without a good overview of alternatives and the ability to pick the best one for a particular case.
Most interesting links of May ''14
Recommended Readings Monolith - from The Codeless Code - fables and koans for the SW engineer - the Monad monolth #Haskell #fun http2 explained (pdf, 27 pages) - cons of http 1 (huge spec / no full impl., wasteful use of TCP <=> latency [x spriting, inlining, concatenation, sharding]) => make it less latency sensitive, fix pipelining (issue a req before previous
Fixing clojurescript.test failing with "ReferenceError: Can''t find variable: cemerick"
cemerick.cljs.test) may fail with this confusing exception:
ReferenceError: Can't find variable: cemerick
due to couple of reasons:
- Your test namespaces do not require
cemerick.cljs.test(and thus it is missing from the compiled .js; requiring macros is not enough)
- cljsbuild has not included any of your test files (due to wrong setup etc.; this is essentially another form of #1)
- You are trying to test with the node runner but have built with
:whitespace(for node you need to concatenate everything into a single file, which only happens if you use
Example failures from all the runners:
- Your test namespaces do not require
Clojure/Java: Prevent Exceptions With "trace missing"
The other day I got this little helpful exception from Clojure:
ClojureScript/Om: Spurious "Minified exception occured" With Advanced Optimizations
After having upgraded to Om 0.6.3. and ClojureScript 2197, I suddenly got the following error in the browser when loading the .js compiled with
Uncaught Error: Minified exception occured; use the non-minified dev environment for the full error message and additional helpful warnings.In the dev mode, i.e. without any optimizations, the code worked just fine - the same thing that Frozenlock has experienced.
core.async: "Can''t recur here" in ClojureScript but OK in Clojure
With the latest core.async and ClojureScript (
clojurescript "0.0-2202"as well as the older
clojurescript "0.0-2173"), the following function compiles just fine in Clojure but fails in ClojureScript:
Graphite Shows Metrics But No Data - Troubleshooting
My Graphite has all the metrics I expect but shows no data for them. Communication between my app and Graphite clearly works otherwise the metrics would not have appeared in the list but why is there no data?
Update: Graphite data gotchas that got me(These gotchas explain why I did not see any data.)
- Graphite shows aggregated, not raw data if the selected query period (24h by default) is greater than the retention period of the highest precision. F.ex. with the schema "1s:30m,1m:1d,5m:2y" you will see data at the 1s precision only if you select period less than or equal to the past 30 minutes. With the default one, you will see the 1-minute aggregates. This applies both to the UI and whisper-fetch.py.
- Aggregation drops data unless by default at least 50% of available data slots have values (xFilesFactor=0.5). I.e. if your app sends data at a rate more than twice slower than Graphite expects them, they will never show up in aggregates. F.ex. with the schema "1s:30m,1m:1d,5m:2y" you must sends data at least 30 times within a minute for them to show in an aggregate.
Lesson learned: Always send data to Graphite in *exactly* same rate as its highest resolutionAs described above, if you send data less frequently than twice the highest precision (if 1s => send at least every 2s), aggregation will ignore the data, with the default xFilesFactor=0.5 (a.k.a. min 50% of values reqired factor). On the other hand, if you send data more frequently than the highest precision, only the last data point received in each of the highest precision periods is recorded, others ignored - that's why f.ex. statsD flush period must = Graphite period.
Most interesting links of April ''14
Recommended Readings The economics of reuse - developing code for reuse costs much more than for one need - it might cost 300% more to develop and save you 75% of work when (re)using it instead of developing from scratch (if one of the factors goes down, the other one typically goes down too). Summary: "That means that to get any value from your reused component, you better have five or
Clojure: How To Prevent "Expected Map, Got Vector" And Similar Errors
What my Clojure code is doing most of the time is transforming data. Yet I cannot see the shape of data being transformed - I have to know what the data looks like on the input and hold a mental model of how they change at each step. But I make mistakes. I make mistakes in my code so that the data does not correspond anymore to the model it should follow. And I make mistakes in my mental model of what the data currently looks like, leading likely to a code error later on. The end result is the same - a little helpful exception at some later step regarding wrong shape of data. There are two problems here: The error typically provides too little useful information and it usually manifests later than where the code/model mistake actually is. I therefore easily spend an hour or more troubleshooting these mistakes. In addition to that, it is also hard to read such code because a reader lacks the writer's mental model of the data and has to derive it herself - which is quite hard especially if the shape of the input data is not clear in the first place.
I should mention that I of course write tests and experiment in the REPL but I still hit these problems so it is not enough for me. Tests cannot protect me from having a wrong model of the input data (since I write the [unit] tests based on the same assumptions as the code and only discover the error when I integrate all the bits) and even if they help to discover an error, it is still time-consuming the root cause.
Can I do better? I believe I can.
- Previous (4)Next (20)