background preloader

To read?

Facebook Twitter

Functional Programming (in #scala) for the rest of us | Open Source Solutions for Software Development. Whoever tries to learn Scala immediately encounters talk about Functional Programming. The first step is having functions as first-class citizens. This opens up new ways of programming, and the Scala collection library if far superior to Java's because of it. There are many examples of how boilerplate loops of creating and populating new collections can be replaced by a succint one liner of using `map`.

In this post I'll try to explain the more advanced concepts of Functors, Applicatives and Monads. (Note: This paper was not easy to write and may still be confusing despite my best efforts. So what are these? What is a context? So what is the Future context? We might try an initial design like this: The get method blocks until the value is ready. Def findUser(name: String): Future[User] = ... .... val future = findUser(userName) val user = future.get println(user) So findUser does not immediately return a User value, but a Future instance. Obviously, the above code is not very good. Functor.

Apocalisp | The end of programming as you know it. Ruling my expectations with Junit. For once no Clojure, nor Scala in this post.There is no whining in saying that as a java developer by day, I too rarely have the opportunity to learn or teach something, because of the attitude of diletante people more concerned by "making a career" than committing into their developer's job. But last friday a nice thing happened. I went lucky playing with Junit rules. Let us settle the environment. I am working on the worst project I have ever been working on. By itself the project is very small (less than 70k lines of code). It does clearly break all the rules of decent architecture reasoning in any way, its internals being deeply rotten by terrible missuses of the already invasive and useless Spring framework, but also tons of other under used dependencies (typically Apache open sources).

As a TDD advocate, armed with Martin Fowler and Keriewsky books on refactoring, but also Michael Feathers and Meszaros writings, I patiently implement or fix the modules using Junit. Test green. Debasish Ghosh's answer to How can a programmer (who is not a professional mathematician) get a good intuitive understanding of category theory concepts. Lean Machine Square » Le lean est une bulle ? Accueil > Deploiment lean > Le lean est une bulle ? Aujourd’hui le lean est partout, dans les usines où les choses on commencé, mais également dans le management, dans la santé, dans le management de projets, dans l’engineering, dans l’immobilier, dans la banque, dans la finance, dans l’informatique… Et j’en passe. Cela a toutes les caractéristiques d’une bulle. L’histoire nous apprend que toutes les bulles finissent par exploser… L’histoire nous apprend aussi que l’on a vu pareil comportement concernant le fordisme avec des échecs cuisants sans un domaine comme celui de la construction des maisons.

Une autre chose que nous apprend l’histoire : il n’existe pas de panacée. Cela dit, il est possible que le lean tienne plus longtemps que ces ancêtres. Blog : From Pi to Puzzles. September 15, 2011 — Elizabeth Shack, Technical Communication and Strategy Neil Bickford calculated the first 458 million terms for the continued fraction of pi, breaking the previous record of 180 million. He used Mathematica to develop his code and verify his results—which he posted shortly after he turned 13. Neil Bickford meets Stephen Wolfram at Gathering 4 Gardner 9. Bickford, who broke the record last fall, said creating the early version of the pi continued-fraction generator was “the best thing I’ve ever used Mathematica for.” On his blog Random (Blog), he wrote about the history of calculations of pi and described his computation. A continued fraction is a way of expressing a number: It can be written more compactly as: Even irrational numbers might have regular continued fractions: Or: The continued fraction of pi, however, does not show a pattern; it is: On his blog, Bickford wrote: Bickford initially got into math via puzzle books by Ivan Moscovich.

Front Page. Learn You a Haskell for Great Good! 10 Productivity Enhancing CSS and CSS3 Tools and Generators. CSS tools can save a lot of a time and frustration when working on a layout, as they can automatically generate some of the tedious code for you, and help you improve your productivity. With the advent of CSS3, there are also now some CSS3 tools and also some CSS3 generators that can create gradients for you, as well as provide WYSIWYG visuals. Most of us are visual learners, and even though hand coding is preferred for work, it helps to be able to see and learn what various CSS properties do. In this post, you’ll find 10 productivity enhancing CSS tools and generators, as well as some CSS3 tools as well.

If you’re new to this field, you might like to see these web development resources: Enjoy! CSS3 Please CSS3, Please! Spritebox Spritebox is a WYSIWYG tool to help web designers quickly and easily create CSS classes and IDs from a single sprite image. Tiny Fluid Grid An easy way to build fluid grid based websites. Ultimate CSS3 Gradient Generator A powerful Photoshop-like CSS gradient editor. Real World Haskell. One Day, We Will All Be Programmers. I probably spend more time than I should thinking about the economy. When I do, I often think about what it is most residents of the West do for a living, which I like to call the “economic profile” of the West.

(Others call this employment by sector.) I think about how that profile has changed in the last hundred or so years, and about how it might change in my lifetime. The first revolution of automation, the industrial revolution, had a significant impact on the West’s economic profile. Societies of agricultural workers transformed into societies of manufacturing laborers. After an adjustment period, living conditions improved as manufactured goods became cheaper and machines replaced human labor in the home and the workplace: think cars, dishwashers, food processors, etc. A second revolution of automation, the computer revolution, has gone through its initial phases and is just entering a second era. We can try to speculate an answer based on current trends.

Robotics Now that’s fun! Revealing the Scala magician’s code: method vs function « Kent Tong's personal thoughts on information technology. Why I love Lisp | Pablo's blog. This post was extracted from a small talk I gave at Simplificator, where I work, titled “Why I love Smalltalk and Lisp”. There’s another post titled “Why I love Smalltalk” published before this one. Desert by Guilherme Jófili Lisp is an old language. Very old. Today there are many Lisps and no single language is called Lisp today. Clojure, like any other Lisp, has a REPL (Read Eval Print Loop) where we can write code and get it to run immediately.

Normally you get a prompt, like user>, but here I’m using the joyful Clojure example code convention. We can call a function like this: It printed “Hello World” and returned nil. Except that Clojure uses the parenthesis in that way for all operations: In Clojure we also have vectors: symbols: The reason for the quote is that symbols are treated as variables. And nested lists Here’s how defining a variable and using it looks like I’m going very fast, skipping lots of details and maybe some things are not totally correct. Let’s call that function: Jenkins-Le-guide-complet/jenkins-the-definitive-guide-book at master - GitHub. -= Perlis Languages =- Perlis Languages this is another entry in a series on programmer enrichment A language that doesn’t affect the way you think about programming is not worth knowing. — Alan Perlis inspired by a LtU thread and the great post Programming Achievements: How to Level Up as a Developer by Jason Rudolph1. most code samples from Rosetta Code.

The philosopher Friedrich Nietzsche believed that all interactions and interpretations of the external world occurred through the lens of individual perspective. Therefore, truth to Nietzsche was subject to interpretation. Programmers are especially prone to subjective views on their industry best-practices and valuations, often colored by their chosen2 programming languages.3 However, Nietzsche believed that in order to achieve a high-level of thinking, one should grant all perspectives equal opportunity and let them stand, or fall, on their own merits. Joy Joy is an example of a concatenative programming language or more simply put, a stack-based language. Qi. Scala Actors are Just Code - No Magic. Dear Junior First time I tried out actors in Scala I though: "OK, there is a fair amount of magic going on here". I have later realised that there is actually no magic at all involved, but I would like to share with you my misconception and how it cleared out.

I am talking about syntax like vlad ! Godot and like receive { case Godot => ... } The good part is that once I had my misconceptions cleared out, it was much easier to understand some weird parts of the Scala standard actors, and the path to understanding the design of Akka became much clearer. What I Mean with Magic Let me for a brief moment clarify what I mean with "magic" in this context. Take for example the thread model of Java (and the JVM) where objects can be "locked". Synchronized (objectToLock) { … } Here “synchronized” is a special construct to handle those locks. In language design these constructions are sometimes referred to as "special forms" because they often have special syntax. for(vlad <- vladimirs) { vlad.start() } Dan. How to fix your project collaboration model? « bertrand’s brain grep.

I’ve been studying the collaboration processes of the Apache Software Foundation (ASF) for a while [1], by observing and practicing the successful collaboration model that we use in ASF projects. Taking the opposite angle, I’ve been reflecting lately on how to fix a broken collaboration model. How do you help teams move from an “I have no idea what my colleagues are doing, and I get way too much email” model to the efficient self-service information flow that we see in ASF and other open source projects? As I see it, the success of the Apache collaboration model is based on six guiding principles: If it didn’t happen on the dev list, it didn’t happen.Code speaks louder than words.Whatever you’re working on, it must be backed by an issue in the tracker.If your file is not in subversion it doesn’t exist.Every important piece of information has a permanent URL.Email is where information goes to die.

If it didn’t happen on the dev list, it didn’t happen. Email is where information goes to die. Binary "when necessary" type hinting with Salat. Salat-core:master:0.0.8-SNAPSHOT> test:console [info] Starting scala interpreter... [info] Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). Type in expressions to have them evaluated. Type :help for more information. scala> import com.novus.salat. import com.novus.salat scala> import com.novus.salat.test.when_necessary_binary_type_hint_encoding import com.novus.salat.test.when_necessary_binary_type_hint_encoding scala> import com.novus.salat.test.model import com.novus.salat.test.model scala> val x: SomeTrait = SomeTraitImpl2(y = 3) x: com.novus.salat.test.model.SomeTrait = SomeTraitImpl2(3) scala> val dbo = grater[SomeTrait].asDBObject(x) 2 [run-main] INFO com.novus.salat.test.when_necessary_binary_type_hint_encoding.package$$anon$7 - accept: ctx='WhenNecessary-BinaryTypeHint' accepted grater[com.novus.salat.test.model.SomeTrait] scala> import com.mongodb.casbah.Imports import com.mongodb.casbah.Imports scala> val x_* = grater[SomeTrait].asObject(dbo)

Open Source: the Meritocracy vs the Circle of Trust. There has been this idea running around the back of my head for a while, and it's only now that it is starting to crystalize into something that I can express. When we look at Open Source projects, we see that there is a hierarchy of involvement. There are different levels at which you can be involved, and at each higher level, there will be less and less individuals. For now I am going to divide involvement up like this: Different Open Source projects but different barriers at different points. For example: (Note: I'm not going to even try and pretend that the above is a complete list of road-blocks) Different people view success of Open Source projects differently.

But I don't want to go down such an academic road today. So a lot of the measures of success can be raised by increasing the number of consumers, active contributors, and committers. So how do we increase that number, and thereby increase the probability that our Open Source project is a “success”? The future of CSS layouts.

Beginning sbt0.10.