This is a great article on how to construct plant like images from simple rules in d3:
Generating artificial plants using stochastic Lindenmayer systems with d3.js
This could be the basis of a tamogotchi game.
Random outpourings of a software developer
This is a great article on how to construct plant like images from simple rules in d3:
Generating artificial plants using stochastic Lindenmayer systems with d3.js
This could be the basis of a tamogotchi game.
@Grab(‘org.codehaus.groovy.modules.http-builder:http-builder:0.7.2’)
import groovyx.net.http.RESTClient
import groovy.json.JsonSlurper
def authToken = ‘neo4j:password’.bytes.encodeBase64().toString()
def auth = “Basic: $authToken”.toString()
// send Cypher statement to Neo4j Server
def client = new RESTClient( ‘http://localhost:7474’, ‘application/json’ )
client.defaultRequestHeaders.’Authorization’ = auth
def body = “””{
“statements” : [ {
“statement” : “CREATE (wordsworth:Author {firstname:’William’, lastname: ‘Wordsworth’})”
} ]
}”””
def resp = client.post( path : ‘/db/data/transaction/commit’, body : body )
println resp.data.toString()
I have recently moved a project from using Thymeleaf to using Handlebars.
Handlebars is a templating library (think mail merge for code if you are a non-developer).
Handlebars uses the {{ }} tags to surround items to be replaced.
{{{ }}} will not escape content provided.
{{ > path/to/file }} Renders a template. You can supply named blocks that get substituted into that template.
By default the template uses whatever data that the template was bound to. Typically we bind nested Maps.
One of the principles of handlebars is that the templates should be logic free. This means that you are limited to {{#if }}, {{#unless }} and {{#each }} blocks.
#If will check the truthiness of a value. The intent is to include a block of template only if a certain item is present, say an optional middle name.
#unless is the inverse, it will only show the block if the condition is false. This is ideal for providing defaults for missing data.
Any logic above this must be handled by an extension method.
This is not as difficult as it sounds. With a little effort extension methods can be written to:
By keeping the logic isolated it becomes independently testable and simplifies the templates.
https://jknack.github.io/handlebars.java/helpers.html
The trick would be to replicate the mustache versions.
This article shows how to reset the admin password:
http://www.cnet.com/uk/how-to/reset-bypass-password-mac-macbook/
This means that if you have physical access to a mac then security is a joke.
Convert epub to mobi then send to Kindle.
I have been working in Groovy for about a month now.
It’s definitely a step up from Java in terms of dialing down the ceremony.
However the scripting nature can be nasty on occasions where the compiler just does not protect you from obvious mistakes.
Could not load FFI Provider: (NotImplementedError) FFI not available
Here is this documentation for the Groovy equivalent to Nuget.
This is a small sample:
@Grab(group=‘org.springframework’, module=‘spring-orm’, version=‘3.2.5.RELEASE’) import org.springframework.jdbc.core.JdbcTemplate
Grape does not seem to go as far as Nuget’s allowing upgrades, but it does do the configuration in the source code.
I have spent the last few years working in the .Net ecosystem.
This has generally involved working in C#, PoweShell, Nuget and Chocolatey.
I am now exploring the JVM world.
In order to get the RatPack library installed (which is the Groovy version of Ruby’s Sinatra or the .Net clone Nancy) I have needed to install the JRE, Gradle and Groovy.
Getting Java installed on a corporate dev machine was a little tricky.
The installer was placing files in a folder that I don’t have execute permissions on.
The specific error message that I was getting led to a link that suggested downloading a java based tool to fix. There is a hole in my bucket…
Copying the deployed installer to another location eventually worked.
Several of the Groovy libraries suggest using gvm to install things so I have opted to use posh-gvm:
(new-object Net.WebClient).DownloadString(‘https://raw.githubusercontent.com/flofreud/posh-gvm/master/GetPoshGvm.ps1’) | iex
gvm appears to be the equivalent of chocolatey for the Groovy world.
gradle is the equivalent of msbuild or more specifically Psake.
I now have a list of projects to investigate: