Andrey Hihlovskiy
Professional blog on groovy, gradle, Java, Javascript and other stuff.
Monthly Archives: February 2014
Deploying Spring Boot Groovy scripts as a Jar file in Cloud Foundry
February 28, 2014
Posted by on Tomás Lin's Programming Brain Dump
This post is a step by step guide on deploying a Spring Boot application on Cloud Foundry using the spring jar feature introduced in 1.0.0.RC2.
If you read the Cloud Foundry documentation, they would claim that the proper way to deploy Spring Boot Groovy scripts is via:
spring grab *.groovy cf push
Unfortunately, this approach is almost as effective as Sex Panther Cologne.
It fails badly when you try to include other starter packs, such as the websocket starter pack.
Using the jar approach outlined here allows us to overcome the errors that you might encounter in Cloud Foundry otherwise.
View original post 354 more words
Gretty version 0.0.12 is out!
February 24, 2014
Posted by on Gretty is a feature-rich gradle plugin for running web-applications under jetty.
New in version 0.0.12: support of integration tests.
Full sources, documentation and examples: https://github.com/akhikhl/gretty
Gretty 0.0.12 is also available on maven central under group “org.akhikhl.gretty”.
Gretty version 0.0.11 is out!
February 24, 2014
Posted by on Gretty is a feature-rich gradle plugin for running web-applications under jetty.
New in version 0.0.11: now it’s possible to specify logback configuration file (.groovy or .xml) via plugin extension property “logbackConfigFile”.
Full sources, documentation and examples: https://github.com/akhikhl/gretty
Gretty 0.0.11 is also available on maven central under group “org.akhikhl.gretty”.
How to teach your kids to draw fractals
February 10, 2014
Posted by on It’s probably one of the best things that computer-geek dad/mom can teach their kid – to draw fractals with LOGO. Here is how you do it:
- Install Kturtle or similar LOGO software
- Refresh your knowledge on fractals (for example, at the excellent website of Jeffrey Ventrella)
- Look at the examples of turtle graphics and fractals on the Internet
- Repeat (together with your kid) very basic stuff from geometry: how to add/subtract angles, triangle postulate, etc.
Then fun begins:
- 30 minutes exercise implementing Koch Curve
- 1 hour exercise implementing Sierpinsky Triangle
- 1.5 hour exercise implementing various fractal trees
- 1 hour implementing Dragon Curve
- etc. etc.
Some very important things to remember:
- don’t overload your kid with knowledge. It’s important to get to exercises ASAP, otherwise motivation is lost.
- at first do every exercise yourself, without the kid. This way you make sure that you understand the goals and methods of implementation and can deliver that understanding to a kid.
- be clear at formulating goals and algorithms, show on paper how stuff works.
- don’t try to be overly supportive, give a kid space to think and experiment with implementation.
- ask kid questions and stimulate thinking: “what about changing this parameter here, how will it affect our fractal”?
- don’t try to do all exercises at once – this would not be effective, since the brain needs time to digest new concepts.
This could be the beginning of your kids’ big love – love to mathematics and science.
Illustration: Sierpinsky Triangle, created by my daughter with Kturtle:
The source code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
learn triangle $x { | |
fw $x | |
tr 120 | |
fw $x | |
tr 120 | |
fw $x | |
tr 120 | |
} | |
learn serpinsky $x, $level { | |
triangle $x | |
pu | |
fw $x/2 | |
tr 60 | |
pd | |
serpinsky1 $x/2, $level | |
} | |
learn serpinsky1 $x, $level { | |
if $level == 0 { | |
return | |
} | |
triangle $x | |
pu | |
tl 60 | |
fw $x/2 | |
tr 60 | |
pd | |
serpinsky1 $x/2, $level – 1 | |
pu | |
tr 60 | |
fw $x | |
tl 60 | |
pd | |
serpinsky1 $x/2, $level – 1 | |
pu | |
tr 180 | |
fw $x | |
tl 180 | |
pd | |
serpinsky1 $x/2, $level – 1 | |
pu | |
tl 60 | |
fw $x/2 | |
tr 60 | |
pd | |
} | |
$level = 7 | |
reset | |
go 120, 0 | |
print "Serpinsky carpet level " + $level | |
pu | |
go 0, 400 | |
pd | |
dir 30 | |
serpinsky 400, $level |
AngularJS + JSTree = awesome!
February 8, 2014
Posted by on I created an example of ajax-driven jstree wrapped as angularjs directive, backed by ratpack:
https://github.com/akhikhl/angularjs-jstree
Enjoy 🙂
Serving jokes locally with Ratpack and MongoDB
February 5, 2014
Posted by on Very entertaining way to learn Ratpack and MongoDB!
Stuff I've learned recently...
In twoprevious posts, I discussed applications I created that were simple client-side front ends for the Internet Chuck Norris Database (ICNDB), located at http://icndb.com. This post gives the details of the local server I created, using Groovy, MongoDB, and the cool Ratpack project (note new URL). The earlier posts contained parts of that app, but since then I’ve updated it to the latest version of Ratpack, revised the gradle build file accordingly, added a couple of integration tests, and checked the whole thing into GitHub.
I often use ICNDB in my Groovy presentations, because it’s easy to access, returns a simple JSON object, and is rather amusing.
(This, by the way, is in direct contrast to Mr. Norris himself, whose politics are somewhat to the right of Attila the Hun. Still, I only care about the jokes themselves, which are pretty funny.)
Accessing the site is…
View original post 1,376 more words
Recent Comments