
Introduction to CoffeeScript Welcome to the Introduction to CoffeeScript screencast. With the adoption of CoffeeScript by the Node.js community, the JavaScript community in general, and with CoffeeScript's inclusion in the upcoming Rails 3.1 release, it's probably a good idea to see what all the fuss is about. What is CoffeeScript? CoffeeScript is a language that compiles down to JavaScript. CoffeeScript can be written for all implementations of JavaScript, whether it's for Node.js or the browser. Why CoffeeScript? First of all, JavaScript got a bad wrap in the past for the copy-and-paste mentality of the 90's and early 2000's, where no one really knew what was going on. Saying that, you can get lost in the curly brackets and semi-colons - It can get messy, and sometimes a tad unreadable. CoffeeScript gets around these issues by adding "syntactic sugar", similar to what Ruby and Python have to offer, which helps us write less code faster, which is also easier to read. Installing CoffeeScript CoffeeScript Usage Strings
Explaining What Action<> And Func<> Are « Making the Complex Simple In C#, Action and Func are extremely useful tools for reducing duplication in code and decreasing coupling. It is a shame that many developers shy away from them because they don’t really understand them. Adding Action and Func to your toolbox is a very important step in improving your C# code. It’s not really that hard to understand what they do and how to use them, it just takes a little patience… A simple way of thinking about Action<> Most of us are pretty familiar with finding sections of repeated code, pulling that code out into a method and making that method take parameters to represent the differences. Here is a small example, which should look pretty familiar: Each one of these methods pretty much does the same thing. It is a simple and common refactor to refactor that code to: Much better, now we aren’t repeating the “actions” in 3 different methods. Now let’s imagine we want to do something more than steam. Probably we will have to add some new methods for doing that.
How to read and understand a scientific paper: a guide for non-scientists From vaccinations to climate change, getting science wrong has very real consequences. But journal articles, a primary way science is communicated in academia, are a different format to newspaper articles or blogs and require a level of skill and undoubtedly a greater amount of patience. Here Jennifer Raff has prepared a helpful guide for non-scientists on how to read a scientific paper. These steps and tips will be useful to anyone interested in the presentation of scientific findings and raise important points for scientists to consider with their own writing practice. My post, The truth about vaccinations: Your physician knows more than the University of Google sparked a very lively discussion, with comments from several people trying to persuade me (and the other readers) that their paper disproved everything that I’d been saying. It’s not just a fun academic problem. “Be skeptical. What constitutes enough proof? Before you begin: some general advice 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
Blog Archives | Kenneth Truyers I came across a tweet today about refactoring badly written code. I’m always interested in that, so I saw a few fellow devs had taken some badly written code and then applied refactoring to it, following good software design principles. It all started with this article on CodeProject from April last year: The author […] Git’s man-pages state that it’s a stupid content tracker. Most developers love open source software, and often we come across a piece of software that we’re writing and think “it would be great if that already existed as an open source package”, but then, it doesn’t. Creating development silos, is a practice I have seen in many different teams. I make no secret of the fact that I don’t like ORM’s. In statically compiled languages, we usually lean on the compiler to catch out common errors (or plain stupidities).
Ewal.net On the Importance of Purity The benefits of advanced programmings languages are sometimes difficult to grasp for everyday programmers. The features of such languages and how they relate to industrial software development are sometimes hard to understand, especially since the arguments are couched in terms such as "referential transparency", "totality", "side-effect-free", "monads", "non-determinism", "strong static typing", "algebraic data types", "higher-order functions", "laziness/call-by-need", and so on. Many of these features are attributed to "pure" languages, but purity is also a nebulous concept. I will explain the importance of a number of these features and how they impact the everyday programmer's life. The Benefits of Referential Transparency Referential transparency (RT) is a simple principle with profound consequences. This may not sound very significant, but permitting functions which are notRT is literally a nightmare for software developers. The Benefits of Determinism The Benefits of Totality
How Not to Encrypt a File — Courtesy of Microsoft – Robert Parks – Medium A client recently sent me a crypto spec which involved some, how do I say, suboptimal use of crypto primitives. They’re .Net users so I decided to search for a nice msdn crypto reference to set them straight. Instead I found the likely culprit behind their confusion. The article in question is this one: How to encrypt and decrypt a file by using Visual C#. If you’re in the mood for some forehead slapping I recommend reading it. Use of DES for encryption And no, I don’t mean 3DES, just plain DES. Suggestion to use the encryption key as the IV This was the first in a series of data points which suggest that the author has no idea what an IV is or how it’s supposed to be used. You can prompt the user for a password. Note that there is no mention of a using a key derivation function, just a suggestion to use the password directly. DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey);DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey); Advice against using the library’s key and IV generation functionality
Scott Hanselman According to the Microsoft Support website: "Core isolation is a security feature of Microsoft Windows that protects important core processes of Windows from malicious software by isolating them in memory. It does this by running those core processes in a virtualized environment. Cool. Be aware: Do be conscious of each driver and what it does and consider what functionality - if any - you'll be losing if you remove them. Ok, ready? Turns out this was added way back in 2017 in Windows 10 build 17093. I ran the Windows Security app on my system and noticed a few things. In order to be considered enhanced, your system needs to support: TPM 2.0 Secure boot DEP - Data Execution Prevention UEFI MAT - Unified Extensible Firmware Interface Memory Memory Attributes Table Some of these technologies are quite old and have been in Windows for a while. I started digging to understand what was interesting or unique about my system that was preventing me from turning these new features on. About Scott
Gérer les éléments input radio avec jQuery J’ai eu hier une question sur la manipulation des éléments radio en Javascript. La personne voulait vérifier que pour chacun de ses groupes de radio, au moins un radio était sélectionné. Plusieurs solutions en Javascript “pur” existent sur Internet mais aucune ne semblait simple à appliquer par cette personne. Nous partirons donc d’une page incluant la librairie jQuery et le code XHTML suivant : Accéder aux inputs de type radio en jQuery Il existe plusieurs façon d’accéder aux inputs de type radio en jQuery, j’ai réalisé quelques tests afin de définir quelles expressions étaient les plus rapides : Il en ressort que l’expression input[type=radio] est plus rapide que input:radio (mais est-elle autant générique ?) Le résultat sont très variable lorsque l’on précise un contexte (ici #monForm) et un grand nombre de radio. Récupérer tous les inputs radios appartenant à un même groupe $('input[type=radio][name=opt1]');//ici retourne 3 éléments input Connaître si un groupe de radio à une valeur