GitHub Pages is a free hosting service that can effectively be used for static
content. For example this site is entirelty made up of HTML files in the master
branch of the repository raffaelesgarro.github.io
. Only two things are needed:
- a
CNAME
record in the DNS
- a
CNAME
file to instruct the Pages virtual host
I just bootstrapped a droplet on DigitalOcean and deployed a Java app developed
with Spring boot. I quickly tested it by logging into and clicking here and there,
and then moved on configuring Nginx.
And suddenly my app disappeared!
$ curl -I localhost:8080
Connection refused
See this JSFiddle
<div>
<div>cell lorem ipsum</div>
</div>
<div>
<div>cell lorem ipsum</div>
<div>cell lorem ipsum</div>
</div>
<div>
<div>cell lorem ipsum</div>
<div>cell</div>
<div>cell lorem ipsum</div>
</div>
<div>
<div>cell lorem ipsum</div>
<div>cell</div>
<div>cell</div>
<div>c</div>
</div>
<div>
<div>cell lorem ipsum</div>
<div>cell</div>
<div>c</div>
<div>cell</div>
<div>c</div>
</div>
<div>
<div>cell lorem ipsum</div>
<div>c</div>
<div>c</div>
<div>cell</div>
<div>cell</div>
<div>c</div>
</div>
Take this load of questions:
- Why can I put an
Integer
in a List<Number>
but can’t assign a List<Integer>
to a List<Number>
?
- Why can I put any
Number
in a List<? super Number>
but can’t do the same with a List<? extends Number>
?
- Why doesn’t
List<? extends Number>
extends List<? super Number>
?
Derby doesn’t support the MS proprietary UPDATE FROM SELECT
, nor does it support the SQL standard MERGE
so I had to write the following script to update a table from values retrieved from a select.
It uses a temporary table and a subquery in the SET clause. I had to add an index to the temporary table to speed up things:
The method createTemplate()
inside SimpleTemplateEngine
builds a template from a String
, and then make(bindings)
replaces placeholders with values from the hash.
As advertised in the documentation, placeholders are given in JSP or GString style, so the problem is: how do we escape JSP and GString delimiters? That is, how can we insert a plain $foo
or a literal <%=bar%>
without the engine complaining about missing keys when binding?
Explain the following snippet found in a Rails controller:
def index
@posts = Post.all
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @posts }
end
end
Useful link to Ruby procs, blocks and lambdas
In Scala you can write
trait ConstrainedTrait { self: ParentType =>
// code here
}
Mail thread here
Explain the following Groovy code:
[ compileJava, compileTestJava ]*.options*.encoding = 'UTF-8'
Explanation here
I had to write a method which, given an Enum
class, returned the set of values. First signature attempt:
public Set<Enum<?>> getValuesForEnum(Class<Enum<?>> klass);
Unfortunately this doesn’t work. When you try to invoke this method you got the error:
getValuesForEnum() can't be applied to "name.of.the.Enum"