To start the elastisearch container (no persistance): docker run -d -p 9200:9200 -p 9300:9300 --name els dockerfile/elasticsearch
See if the daemon is up: docker ps
To start the elastisearch container (no persistance): docker run -d -p 9200:9200 -p 9300:9300 --name els dockerfile/elasticsearch
See if the daemon is up: docker ps
<!-- add at the end of the document, more info see https://highlightjs.org/ --> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/monokai_sublime.min.css"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script> | |
<script> | |
hljs.initHighlightingOnLoad(); | |
</script> |
hex_colors=["1f77b4", "ff7f0e", "2ca02c", "d62728", "9467bd", "8c564b", "e377c2", "7f7f7f", "bcbd22", "17becf", "1f77b4", "ff7f0e", "2ca02c"] | |
values = hex_colors.collect do |hex| | |
(0..2).collect do |cindex| # collect components (r,g,b) | |
chex = hex[(cindex*2)..(cindex*2+1)] | |
c = chex.to_i(16) # convert from hex | |
mix = c * 0.25 + 255 * 0.75 # mix original color with white (equivalent to 0.25 opacity) | |
mix.to_i.to_s(16) # convert to hex | |
end.join() | |
end | |
p values |
<style type="text/css"> | |
/* colors (e.g. for text)*/ | |
.c1 { fill-opacity: 1.00; fill: #1f77b4; } | |
.c2 { fill-opacity: 1.00; fill: #ff7f0e; } | |
.c3 { fill-opacity: 1.00; fill: #2ca02c; } | |
.c4 { fill-opacity: 1.00; fill: #d62728; } | |
.c5 { fill-opacity: 1.00; fill: #9467bd; } | |
.c6 { fill-opacity: 1.00; fill: #8c564b; } | |
.c7 { fill-opacity: 1.00; fill: #e377c2; } | |
.c8 { fill-opacity: 1.00; fill: #7f7f7f; } |
<style type="text/css"> | |
svg { | |
border: 1px #999 solid; | |
margin: auto; | |
} | |
foreignobject>div { | |
font-family: Avenir Next, Avenir, sans-serif; | |
font-size: 11pt; | |
} | |
</style> |
#include "sketchbook.h" | |
void setup() { | |
} | |
void draw() { | |
int result = 77; // this would be your solution | |
// use the following code to output the result | |
char buffer[100]; | |
sprintf(buffer, "%i", result); |
Overview:
Assuming Fedora 23.
# install: `dnf install python-matplotlib` under Fedora 23 | |
# example inspired by: http://matplotlib.org/users/screenshots.html | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
import numpy as np | |
t = np.arange(0.0, 2.0, 0.01) | |
s = np.sin(2*np.pi*t) | |
plt.plot(t, s) |
BASE_PATH = File.expand_path("~/Repositories/beauty") | |
LINE_LENGTH_THRESHOLD = 150 | |
above, total = 0, 0 | |
Dir[File.join(BASE_PATH, "**/*.rb")].each do |path| | |
contents = File.readlines(path) | |
above += contents.count { |line| line.length > LINE_LENGTH_THRESHOLD } | |
total += contents.size | |
end |
<template> | |
<div class="hello">Hello {{ name }}.</div> | |
</template> | |
<script> | |
export default { | |
data() { return { name: 'Manfred' } } | |
} | |
</script> |