background preloader

Elegant Code

Elegant Code

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

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 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

What is Cryptocurrency: Everything You Need To Know [Ultimate Guide] Join over 115,115 Members Angel Investors, Startups & Blockchain developers... No Thanks! What is cryptocurrency: 21st-century unicorn – or the money of the future? This introduction explains the most important thing about cryptocurrencies. Today cryptocurrencies have become a global phenomenon known to most people. In 2016, you‘ll have a hard time finding a major bank, a big accounting firm, a prominent software company or a government that did not research cryptocurrencies, publish a paper about it or start a so-called blockchain-project. “Virtual currencies, perhaps most notably Bitcoin, have captured the imagination of some, struck fear among others, and confused the heck out of the rest of us.” – Thomas Carper, US-Senator But beyond the noise and the press releases the overwhelming majority of people – even bankers, consultants, scientists, and developers – have a very limited knowledge about cryptocurrencies. So let‘s walk through the whole story. Where did cryptocurrency originate?

OdeToCode by K. Scott Allen

Related: