This blog post series has moved here.
You might also be interested in the 2016 version.
This blog post series has moved here.
You might also be interested in the 2016 version.
| // Pretend that cookies work | |
| (function (document) { | |
| var cookies = {}; | |
| document.__defineGetter__('cookie', function () { | |
| var output = []; | |
| for (var cookieName in cookies) { | |
| output.push(cookieName + "=" + cookies[cookieName]); | |
| } | |
| return output.join(";"); | |
| }); |
| #!/bin/bash -e | |
| name=$(sed -n -e 's/^[nN]ame:\s\+\(.\+\)/\1/p' *.cabal) | |
| old_ver=$(sed -n -e 's/^[vV]ersion:\s\+\(.\+\)/\1/p' *.cabal) | |
| has_docs=1 | |
| grep -i '^Library' *.cabal || has_docs=0 | |
| echo "Package name: $name" | |
| echo "Current version: $old_ver" | |
| echo "Has documentation: $has_docs" |
| module Main where | |
| import Data.Function | |
| import Debug.Trace | |
| import Control.Monad.Trans | |
| import Control.Monad.Cont.Trans | |
| import Control.Monad.Eff | |
| foreign import data Timeout :: ! | |
| type Milliseconds = Number |
| module Reflection = | |
| open Microsoft.FSharp.Quotations | |
| open Microsoft.FSharp.Quotations.Patterns | |
| open System.Reflection | |
| let private (|Name|) (info: MemberInfo) = info.Name | |
| let private (|PropertyName|_|) = function | |
| | PropertyGet (_, Name name, _) -> Some name | |
| | _ -> None |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParentThese use separate document structures instead of HTML, some are more modular libraries than full editors
Ten years ago, increasing the performance of a website usually meant tweaking the server side code to spit out responses faster. Web Performance engineering has come a long way since then. We have discovered patterns and practices that make the (perceived) performance of websites faster for users just by changing the way the front end code is structured, or tweaking the order of elements on a HTML page. Majority of the experiments and knowledge has been around delivering content to the user as fast as possible.
Today, web sites have grown to become complex applications that offer the same fidelity as applications installed on computers. Thus, consumers have also started to compare the user experience of native apps to the web applications. Providing a rich and fluid experience as users navigate web applications has started to play a major role in the success of the web.
Most modern browsers have excellent tools that help measure the runtime performa
| // Minimalistic Parser Combinator in F# | |
| // Neither Performance nor Error Reporting has been considered | |
| // For production code you are better off using http://www.quanttec.com/fparsec/ | |
| // Inspired by the classic: http://www.cs.nott.ac.uk/~pszgmh/monparsing.pdf | |
| [<Measure>] | |
| type ParserPos | |
| type ParserResult<'T> = 'T option*int<ParserPos> | |
| type Parser<'T> = string*int<ParserPos> -> ParserResult<'T> | |
| module Parser = |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x