= symptomes
- je le finirai plus tard
- j'ai ca dans les cartons depuis un moment
- je ne comprends pas pourquoi ca ne marche pas
- le marché n'est pas prêt
Techniques : Lean Startup
- Une startup cherche
- Une société exécute
(ns lein-script-test | |
(:require [ccw.util.eclipse :as e] | |
[ccw.util.e4.model :refer (merge! app])) | |
(defn greet [context] (e/info-dialog "Hello world" "This popup provided to you from a user script")) | |
(merge! @app | |
{:commands [{:element-id "lein-script-test/greeter" | |
:command-name "Hello from CCW"}] | |
:handlers [{:command "lein-script-test/greeter" |
(ns lein-script-test | |
(:require [ccw.util.eclipse :as e])) | |
(defn greet [context] | |
(e/info-dialog "Hello world" | |
"This popup provided to you from a user script")) | |
(defn handler-factory [context] (ccw.util.GenericHandler. #'greet)) | |
;; last form of the script is an application model fragment to be merged into the Application Model |
(require '[ccw.util.e4 :as e4]) | |
;; plumbing/kernel functions: no reflection, follows closely eclipse Application Model/Semantics, | |
;; no magic (no nice-to-have coercition, only the ones that make total sense) | |
;; , simple | |
;; porcelain/user functions: relax reflection constraint as appropriate, pay as you go (thus can depart from eclipse | |
;; semantics/Application Model), more fancy coercitions, etc. | |
;; , easy | |
(def cmd-id "hello-6") |
(require '[ccw.util.e4 :as e4]) | |
(def app (-> @e (e4/context-key :application))) | |
(def categories | |
{:window "org.eclipse.ui.category.window"}) | |
(def model-service (-> @e (e4/context-key :model-service))) | |
(def command-service (-> @e (e4/context-key :command-service))) | |
(def category-window (first (filter #(= "org.eclipse.ui.category.window" (e4/element-id %)) (.getCategories app)))) | |
(import '[org.eclipse.e4.ui.model.application.commands MCommand]) | |
(def command (-> model-service | |
(.createModelElement MCommand) |
(require '[clojure.string :as s]) | |
(defn camelize [s] | |
(let [parts (s/split s #"-") | |
capitalize #(str (.toUpperCase (subs % 0 1)) (subs % 1))] | |
(apply str (map capitalize parts)))) | |
(defn clj->setter [s] (str "set" (camelize s))) | |
(defn clj->getter [s & options] |
(defn split "cs is a vector" [cs idx] | |
(when cs | |
[(subvec cs 0 idx) (cs idx) (subvec cs (inc idx))])) | |
(defn new-down | |
"Returns the loc of the child at index idx of the node at this loc, or | |
nil if no children. It is assumed that z/children returns systematically a vector" | |
{:added "1.0"} | |
[loc idx] | |
(when (z/branch? loc) |
(defn make-parse-tree-node | |
[t children-vec] | |
(let [[combined count] (children-info children-vec)] | |
{:tag t | |
:content children-vec | |
:build-id *build-id* | |
:count count | |
:content-cumulative-count combined | |
:broken? (or (#{::unexpected :chimera} t) | |
(some #{::unexpected :chimera} (cons t (map :tag children-vec))) |
(def dirs #{[0 1] [0 -1] [-1 0] [1 0]}) | |
(defn subv [a b] (mapv - a b)) | |
(defn addv [a b] (mapv + a b)) | |
(defn are-neighbours? [a b] | |
(contains? dirs (subv a b))) | |
(defn valid-path | |
"returns a seq of all the next positions that are free |
= symptomes
Techniques : Lean Startup
;; API | |
;; Principe général: | |
;; - utiliser les appels de listes ( /api/members par ex., mais pas /api/members/78 ) | |
;; - la granularité du diff est l'entité. On renvoie une entité en entier, ou pas du tout. | |
;; - Déjà suffisamment intéressant pour les perfs (et simple à exploiter), ou faut-il descendre plus bas ? | |
;; la premiere fois, faire la requete comme à l'habitude (?details=true mis pour l'exemple, il peut aussi être omis): | |
;; GET / http://www.mix-it.fr/api/members?details=true | |
;; le retour contient tous les éléments nouveaux, et un sha1 qu'il faudra fournir |