Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| /*================================================================================================== | |
| Application: Utility Function | |
| Author: John Gardner | |
| Website: http://www.braemoor.co.uk/software/vat.shtml | |
| Version: V1.0 | |
| Date: 30th July 2005 | |
| Description: Used to check the validity of an EU country VAT number |
| #!/bin/sh | |
| function usage { | |
| programName=$0 | |
| echo "description: A simple shell script to send PushBullet notices" | |
| echo "usage: $programName [-t \"type\"] [-s \"subject\"] [-m \"messagel\"]" | |
| echo " -t The type (note, file or link) this script only supports 'note'" | |
| echo " -s The subject" | |
| echo " -m The message" | |
| exit 1 |
| // These lines go in ~/.sbt/0.13/global.sbt | |
| watchSources ++= ( | |
| (baseDirectory.value * "*.sbt").get | |
| ++ (baseDirectory.value / "project" * "*.scala").get | |
| ++ (baseDirectory.value / "project" * "*.sbt").get | |
| ) | |
| addCommandAlias("rtu", "; reload ; test:update") | |
| addCommandAlias("rtc", "; reload ; test:compile") | |
| addCommandAlias("ru", "; reload ; update") |
| Welcome to the Ammonite Repl 0.8.0 | |
| (Scala 2.11.8 Java 1.8.0_91) | |
| @ import scala.util.Try | |
| import scala.util.Try | |
| @ val listOfTries: List[Try[String]] = List(Try("a"), Try("b"), Try("c")) | |
| listOfTries: List[Try[String]] = List(Success("a"), Success("b"), Success("c")) | |
| // I have a List[Try[String]] but I actually want a Try[List[String]]. |
Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'
Example: To get json record having _id equal 611
cat my.json | jq -c '.[] | select( ._id | contains(611))'Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)
Miles Sabin recently opened a pull request fixing the infamous SI-2712. First off, this is remarkable and, if merged, will make everyone's life enormously easier. This is a bug that a lot of people hit often without even realizing it, and they just assume that either they did something wrong or the compiler is broken in some weird way. It is especially common for users of scalaz or cats.
But that's not what I wanted to write about. What I want to write about is the exact semantics of Miles's fix, because it does impose some very specific assumptions about the way that type constructors work, and understanding those assumptions is the key to getting the most of it his fix.
For starters, here is the sort of thing that SI-2712 affects:
def foo[F[_], A](fa: F[A]): String = fa.toStringControlling your nodebot using a USB cable is great and all, and obviously you could shell out and grab a sparkcore or some other dedicated controller but what if you've got a standard arduino and you want to take an existing nodebot wireless?
Bluetooth is an option and there's this excellent JohnnyFive wiki entry that will help you there. Bluetooth can be a bit flaky though and it's range is pretty lousy. You can also look at things like XBees and what not using point to point serial, but these are expensive and very fiddly to get working.
Really, what we want is a method of transferring data over a nice, simple, standard method, requiring little configuration, low cost and we can utilise a whole stack of the code we've already produced.
Enter the WiFi232 module. These little beauties are [available from AliExpress for $12 each](http://www.aliexpress.com/item/USR-WIFI232-T-wifi-to-uart-tt
| import sbt._ | |
| import Keys._ | |
| import java.net._ | |
| import java.io.File | |
| import play.PlayRunHook | |
| /* | |
| Grunt runner should be in project directory to be picked up by sbt | |
| */ | |
| object Grunt { |