Sur le disque, je stocke mes photos / videos comme ceci :
media
: répertoire racine
masters
: répertoire contenant les fichiers bruts, copiés des cartes SD des appareilsphotos
: répertoire contenant les photos JPG converties à partir des RAW dans masters
videos
: répertoire contenant les vidéos copiées de masters
Dans les sous répertoires masters
, photos
et videos
, les fichiers sont organisés par date de
prise de vue : <annee>/<mois>/<annee>-<mois>-<jour>
.
Les étapes principales de mon workflow sont :
media/masters
photos
en utilisant RawTherapee en mode ligne de commandevideo
J’utilise les outils suivants :
rsync
Et un outil maison pour automatiser la plupart des tâches…
]]>I’ve faced the following issues:
During bundle install
: An error occured while installing RedCloth (4.2.9)
Solved by this answer http://stackoverflow.com/a/14353864
Then problem with pygments_code like in http://stackoverflow.com/questions/16517144/why-the-pygments-code-rb-plugin-is-breaking
Solved by deleting .pygments_cache
folder: https://github.com/imathis/octopress/issues/1427
Then gist redirect by github
Solved by updating plugins/gist_tab.rb
The site generation is rather slow but it works!
Last problem during rake deploy
!
Solved by http://stackoverflow.com/a/18037705
It was similar to the following example: the template Foo
which needs to be override for each class in that class hierarchy (colors correspond to different Eclipse plug-ins)
With Xtend, a classical approach is to use the multiple dispatch feature:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
It works fine but all template specializations have to be declared in the same Xtend class. And it might not be possible. For instance, in the example, we would have created an additional Eclipse plug-in containing all templates.
As I want to group template specializations per Eclipse plug-in, I looked at the extension point / extensions mechanism.
For the example, I would have declared:
a
b
declared in plug-in b
c
declared in plug-in c
It would work but it is quite tedious: tons of XML and lots of plumbing code; not manageable if you have several templates to override.
Since the previous attempts have some drawbacks, I’ve defined the following technique which combines lambda expressions and multiple dispatch with the help of two small classes.
Transformer
First, I have declare the class Transformer
that transforms an object instance into another one:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
It contains the following members:
transfomers
: a map of lambda expressions to which a Transformer
instance delegates the transformationfallback
: a fallback lambda expression if no transformer is found; doFallback
could also be override insteadregister
an helper method used to register a transformer lambda expression;
the first parameter of that method corresponds to the root class that the lambda expression is able to transformtransform
: the method that does the transformationTemplate
The second helper class is the class Template
which specializes the class Transformer
by trasforming into a CharSequence
.
1 2 3 4 5 6 7 8 9 |
|
Finally, when I need a template, I
Template
doFallback
methods for each class in the root package<template-name>_<root-class-name>
For instance, the template Foo
would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Then, if I need to override the default templates in another Eclipse plug-in, I
register
method that registers to the root templatetransform
methodFor instance, the extension of Foo
in Eclipse plug-in b
would be:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
With that technique, overriding templates is quite easy.
The only constraint is to respect the signature of the lambda expression required by the Transformer
class.
Furthermore, you are free to organize your template extensions the way you want.
For instance, for the current post, 2014-01-09-how-i-organize-post-resources
, resources
would be in the directory resources/2014-01-09-how-i-organize-post-resources
.
In order to industrialize the creation of the resource directory, I’ve changed
the new_post
task in the Rakefile
in order to
resources
in the front-matter of the new postAt the end, in a post, I just have to use the variables site_url
and page.resources
to
reference a resource.
For instance, a link to the file test.pdf
would be written {{ root_url }}/{{ page.resources }}/test.pdf
.
And would be rendered /resources/2014-01-09-how-i-organize-post-resources/test.pdf
.
The following buttons allow you to switch from a music scale to the other and to rotate the notes.
The javascript is mainly inspired by the Donut Chart example.
The graphics is composed of 12 SVG groups; one per note. Each SVG group is composed of an arc and a text.
Ordinals are used to store data:
1
|
|
1
|
|
When the reset button is clicked, an offset is incremented and the color and the text of each SVG group are changed:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
When one of the scale button is clicked, the opacity of each SVG group is changed based on the ordinal of the selected scale.
1 2 3 4 5 6 7 |
|
A pdf version is available here.
]]>As shown in the code below, we just have to import classes from the UML meta-model and declare new classes that extend them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Even though the UML Profiles technique is qualified as lightweight in this article, UML Profiles has some major drawbacks:
We don’t have these drawbacks with the XCore technique. But it introduces other issues / limitations:
Often, when we start modeling a DSL, we don’t think that you need UML; it is rather the opposite: we want to get rid of UML. But on the long run, when the DSL evolves, we realize that we need common features / concepts such as
Namespace
/ NamedElement
for naming elementsPackage
/ PackageableElement
for categorizing elements1 2 3 4 |
|
Where
class
: the class of the deviceid
: the unique id of the devicedirection
indicates the direction of the message
'in'
: the message goes to the device'out'
: the message goes from the devicecommand
: the command to execute
'get'
: get the value of the feature'set'
: set the value of the feature'unset'
: unset the value of the feature'val'
: send the value of the feature'op'
: execute an operation on the devicedeclaringClass
: the class in which the feature is declaredfeature
: the feature (property or operation)qualifiedName
: the fully qualified name of the deviceMachine
has a property freeMemory
JavaVirtualMachine
is a Machine
JavaVirtualMachine
has an operation called gc
which runs the garbage collecorThere is an instance of a JavaVirtualMachine
with
myhost
mywebapp
/myhost/mywebapp
The JavaVirtualMachine
42 would publish its free memory on topic
/JavaVirtualMachine/42/out/val/Machine/freeMemory/myhost/mywebapp
JavaVirtualMachine
42 would subscibe to topics
/JavaVirtualMachine/42/in/op/#
; if id
is kind of UUID, it could only subscribe to /+/42/in/#
/+/+/in/op/+/+/myhost/mywebapp
/+/+/out/val/Machine/freeMemory/#
to receive freeMemory
values from any instance of Machine
/JavaVirtualMachine/+/out/val/Machine/freeMemory/#
to receive freeMemory
values from any instance of JavaVirtualMachine
/+/+/out/val/Machine/freeMemory/myhost/#
to receive freeMemory
values from any instance deployed on myhost
/JavaVirtualMachine/42/in/op/JavaVirtualMachine/gc
to run the gc on JVM 42Not tested but it should work …
]]>