DM FIX: Add new translations

DM FIX: Add new translations

--- src/objective8/translation.clj
+++ src/objective8/translation.clj
@@ -4,370 +4,375 @@

 ;;TODO move translations to external files

-(def english-translations
-  {:base {:header-logo-text "Objective[8]"
-          :header-logo-title "Go to home page"
-          :project-status! "ALPHA: We are still testing, find out more"
-          :browsehappy! "You are using an outdated browser. Please upgrade your browser to improve your experience."}
-   :navigation-global {:sign-in-text "Sign in"
-                       :sign-in-title "Go to sign in"
-                       :sign-out-text "Sign out"
-                       :sign-out-title "Go to sign out"
-                       :profile-text "Profile"
-                       :profile-title "Go to user profile"}
-   :share-widget {:title "Share this page:"
-                  :facebook-title "Share on Facebook..."
-                  :facebook-text "Share on Facebook"
-                  :google-plus-title "Plus one this page on Google"
-                  :google-plus-text "Google +1"
-                  :twitter-title "Share this page on Twitter"
-                  :twitter-text "Tweet"
-                  :linkedin-title "Share this page on LinkedIn"
-                  :linkedin-text "Share on LinkedIn"
-                  :reddit-title "Submit this page to Reddit"
-                  :reddit-text "Submit to Reddit"
-                  :url-label "URL to share"
-                  :url-title "The link to this page"}
-   :error-404 {:doc-title "Error 404 | Objective[8]"
-               :doc-description "Sorry the page you requested can't be found."
-               :page-title "Sorry the page you requested can't be found."
-               :page-intro "The page you were trying to reach at this address doesn't seem to exist. This is usually the result of a bad or outdated link. We apologise for any inconvenience."
-               :page-content! "
What can I do now?

Please return to the home page.

To report an issue visit our github issues page.

" }
-   :notifications {:drafting-has-started "Drafting has started on this objective!"
-                   :drafting-started-helper-text "This means that you can no longer ask or answer questions, comment, or invite new writers.  However, you can follow and contribute to the drafting progress "
-                   :go-to-drafting "here."}
-   :index {:doc-title "Objective[8]"
-           :doc-description ""
-           :index-welcome "Collaborative policy making for democratic organisations."
-           :index-intro "Gather community opinion, generate ideas, share, discuss, vote and collaborate with experts to draft new policy."
-           :index-get-started "Objectives"
-           :index-get-started-title "Objectives"
-           :index-learn-more "Learn more"
-           :index-learn-more-title "Learn more"}
-   :sign-in {:doc-title "Sign in or Sign up | Objective[8]"
-             :doc-description "Sign in or Sign up to Objective [8]"
-             :page-title "Sign in or Sign up"
-             :twitter-sign-in-btn "Sign in with twitter"
-             :twitter-sign-in-title "Sign in with twitter"
-             :reassurance "We will never post to Twitter without your permission."}
-   :project-status {:doc-title "Project status | Objective[8]"
-                    :doc-description ""
-                    :page-title "Alpha phase"
-                    :page-intro "We are developing and designing Objective[8] in the open. This allows the tool evolve as you use it, as you give feedback, and as the developers update and add content."
-                    :page-content! "
It is important to note that during this time data may be removed or destroyed as part of our process. Any of the views and data expressed here is to be used for example purposes only and does not accurately represent the real views of users.

How to get involved

This project is open source and we are inviting people to collaborate with us to build a better tool. For developers and you can find the code on github at https://github.com/ThoughtWorksInc/objective8. We will also be adding details for upcoming usability sessions shortly.

Have you got an idea?

We are really interested in user feedback and are currently inviting people to leave comments our github issues page.
" }
-   :learn-more {:doc-title "Learn more | Objective[8]"
-                :doc-description ""
-                :page-title "Objective[8] 101"
-                :sub-title "What are the basics?"
-                :page-intro "Objective8 is a platform to enable collaborative policy making for democratic organisations."
-                :page-content! "
+(def translation-config
+  {:dictionary {:en { :base {:header-logo-text "Objective[8]"
+                             :header-logo-title "Go to home page"
+                             :project-status! "ALPHA: We are still testing, find out more"
+                             :browsehappy! "You are using an outdated browser. Please upgrade your browser to improve your experience."}
+                     :navigation-global {:sign-in-text "Sign in"
+                                         :sign-in-title "Go to sign in"
+                                         :sign-out-text "Sign out"
+                                         :sign-out-title "Go to sign out"
+                                         :profile-text "Profile"
+                                         :profile-title "Go to user profile"}
+                     :share-widget {:title "Share this page:"
+                                    :facebook-title "Share on Facebook..."
+                                    :facebook-text "Share on Facebook"
+                                    :google-plus-title "Plus one this page on Google"
+                                    :google-plus-text "Google +1"
+                                    :twitter-title "Share this page on Twitter"
+                                    :twitter-text "Tweet"
+                                    :linkedin-title "Share this page on LinkedIn"
+                                    :linkedin-text "Share on LinkedIn"
+                                    :reddit-title "Submit this page to Reddit"
+                                    :reddit-text "Submit to Reddit"
+                                    :url-label "URL to share"
+                                    :url-title "The link to this page"}
+                     :error-404 {:doc-title "Error 404 | Objective[8]"
+                                 :doc-description "Sorry the page you requested can't be found."
+                                 :page-title "Sorry the page you requested can't be found."
+                                 :page-intro "The page you were trying to reach at this address doesn't seem to exist. This is usually the result of a bad or outdated link. We apologise for any inconvenience."
+                                 :page-content! "
What can I do now?

Please return to the home page.

To report an issue visit our github issues page.

" }
+                     :notifications {:drafting-has-started "Drafting has started on this objective!"
+                                     :drafting-started-helper-text "This means that you can no longer ask or answer questions, comment, or invite new writers.  However, you can follow and contribute to the drafting progress "
+                                     :go-to-drafting "here."}
+                     :index {:doc-title "Objective[8]"
+                             :doc-description ""
+                             :index-welcome "Collaborative policy making for democratic organisations."
+                             :index-intro "Gather community opinion, generate ideas, share, discuss, vote and collaborate with experts to draft new policy."
+                             :index-get-started "Objectives"
+                             :index-get-started-title "Objectives"
+                             :index-learn-more "Learn more"
+                             :index-learn-more-title "Learn more"}
+                     :sign-in {:doc-title "Sign in or Sign up | Objective[8]"
+                               :doc-description "Sign in or Sign up to Objective [8]"
+                               :page-title "Sign in or Sign up"
+                               :twitter-sign-in-btn "Sign in with twitter"
+                               :twitter-sign-in-title "Sign in with twitter"
+                               :reassurance "We will never post to Twitter without your permission."}
+                     :project-status {:doc-title "Project status | Objective[8]"
+                                      :doc-description ""
+                                      :page-title "Alpha phase"
+                                      :page-intro "We are developing and designing Objective[8] in the open. This allows the tool evolve as you use it, as you give feedback, and as the developers update and add content."
+                                      :page-content! "
It is important to note that during this time data may be removed or destroyed as part of our process. Any of the views and data expressed here is to be used for example purposes only and does not accurately represent the real views of users.

How to get involved

This project is open source and we are inviting people to collaborate with us to build a better tool. For developers and you can find the code on github at https://github.com/ThoughtWorksInc/objective8. We will also be adding details for upcoming usability sessions shortly.

Have you got an idea?

We are really interested in user feedback and are currently inviting people to leave comments our github issues page.
" }
+                     :learn-more {:doc-title "Learn more | Objective[8]"
+                                  :doc-description ""
+                                  :page-title "Objective[8] 101"
+                                  :sub-title "What are the basics?"
+                                  :page-intro "Objective8 is a platform to enable collaborative policy making for democratic organisations."
+                                  :page-content! "

Policy is used by governments and organisations to make consistent and fair decisions in order to achieve desired outcomes.

An objective is a change that could be achieved by introducing new policy.  For example: improving access to public housing, or increasing the safety of our roads.

Writers work with each other and the community to draft policy.  They use the crowdsourced questions, answers and comments to produce policy drafts*.  These are further refined through cycles of feedback and redrafting.

-

You can get involved and have your say by creating and sharing objectives, offering your opinion through comments, asking and answering questions, suggesting policy writers, or even providing feedback on the policy drafts themselves.  The whole process is open and transparent.

 *As the site is still under development, these features have not yet been implemented. Check back soon!
 "
-                :get-started-button-title "Get started"
-                :get-started-button-text "Get started"}
-   :objective-nav {:title "Navigation for"
-                   :details "Details"
-                   :questions "Questions"
-                   :writers "Writers"}
-   :objective-list {:doc-title "Objectives | Objective[8]"
-                    :doc-description ""
-                    :page-title "Objectives"
-                    :create-button-title "Create an objective"
-                    :create-button-text "Create an objective"
-                    :please "Please"
-                    :sign-in "sign in"
-                    :to "to create an objective."
-                    :subtitle "Recently created objectives"
-                    :drafting-begins "Drafting begins on"
-                    :objectives-intro-text "Objective[8] centers its policy drafting process around objectives. An objective is a change that could be achieved by introducing new policy." }
-   :objective-create {:doc-title "Create an Objective | Objective[8]"
-                      :doc-description "Create an Objective ..."
-                      :page-title "Create an objective"
-                      :page-intro "An objective is a change that could be achieved by introducing new policy. For example: improving access to public housing, or increasing the safety of our roads."
-                      :headline-label "Headline"
-                      :headline-title "3 characters minimum, 120 characters maximum"
-                      :headline-prompt "A headline should encourage contribution or discussion"
-                      :goals-label "Goals"
-                      :goals-prompt "A goal is what you’d like your change to achieve"
-                      :goals-title "50 characters minimum, 200 characters maximum"
-                      :background-label "Background"
-                      :background-prompt "Provide further information on why achieving this objective is important or necessary"
-                      :background-title "Enter optional background text up to 1000 characters"
-                      :end-date-label "Drafting start date"
-                      :end-date-prompt "On this date, the drafting phase begins. You should give participants enough time to generate useful information, and to recruit and vote for potential policy writers."
-                      :drafting-not-yet-implemented "(Please note: since this site is still under development, the drafting phase has not yet been implemented)"
-                      :end-date-title "Please enter an end date"
-                      :end-date-placeholder"yyyy-mm-dd"
-                      :submit "Create"}
-   :objective-view {:doc-title "Objective | Objective[8]"
-                    :doc-description "Objective  ..."
-                    :background-label "Background"
-                    :goals-label "Goals"
-                    :end-date-label "Drafting begins: "
-                    :created-message "Your objective has been created!"}
-   :comment-view {:created-message "Your comment has been added!"
-                  :comment-title "Comments"
-                  :no-comments "There are no comments yet."}
-   :comment-create {:comment-label "Your comment"
-                    :comment-title "Comments are a maximum length of 500 characters"
-                    :post-button "Add comment"}
-   :comment-sign-in {:please "Please"
-                     :sign-in "sign in"
-                     :to "to start commenting."}
-   :question-list {:questions-about "Questions about"
-                   :page-intro "Gather background information such as opinions and experiences by asking a question.  Your question should be focussed and specific, as the answers will influence the policy drafting process."
-                   :question-list-heading "Recently asked questions"
-                   :no-questions "There are no questions yet."}
-   :question-create {:add-a-question "Add a question to this objective"
-                     :question-label "Question"
-                     :question-title "Questions are a maximum length of 500 characters"
-                     :post-button "Add"}
-   :question-view {:added-message "Your question has been added!"
-                   :added-answer-message "Your answer has been added!"}
-   :question-sign-in {:please "Please"
-                      :sign-in "sign in"
-                      :to "to add a question." }
-   :answer-view   {:created-message "Your answer has been posted!"
-                   :answer-title "Answers"
-                   :no-answers "No one has answered this question yet."}
-   :answer-create {:answer-label "Your answer"
-                   :answer-title "Answers are a maximum length of 500 characters"
-                   :post-button "Post your answer"}
-   :answer-sign-in {:please "Please"
-                    :sign-in "sign in"
-                    :to "to answer this question."}
-   :invitation {:doc-title "Candidate policy writers | Objective[8]"
-                :doc-description "Candidate policy writers..."
-                :page-title "Invite a policy writer"
-                :page-intro "Do you know someone with the enthusiasm and expertise to help draft this policy?"
-                :writer-name-label "Writer name: "
-                :writer-name-title "Writer names are a maximum length of 50 characters"
-                :reason-label "They should help draft this policy, because: "
-                :reason-title "Reasons are a maximum length of 1000 characters"
-                :submit "Create an invite"}
-   :invitation-sign-in {:please "Please"
-                        :sign-in "sign in"
-                        :to "to invite a policy writer."}
-   :invitation-response {:doc-title "Invitation to draft | Objective[8]"
-                         :doc-description "Invitation to help draft policy"
-                         :page-title "Can you help us to draft some policy?"
-                         :page-intro "You've been invited to help draft some policy!"
-                         :for-objective-text "Help write policy to achieve this objective: "
-                         :rsvp-text "If you're interested, you can sign in and accept the invitation below."
-                         :sign-in-to-accept "Sign in to accept"
-                         :accept "Accept"
-                         :decline "Decline"}
-   :invitation-banner {:message "Respond to your invitation to help draft policy"}
-   :candidate-list {:doc-title "Candidate policy writers | Objective[8]"
-                    :doc-description "Candidate policy writers..."
-                    :page-intro "Writers work with each other and the community to draft policy."
-                    :candidate-list-heading "Recently added candidate writers"
-                    :no-candidates "No candidate writers have been invited yet."}
-   :current-draft {:page-intro "Current draft"
-                   :no-drafts "There are currently no drafts for this objective"}
-   :draft-detail {:doc-title "Policy draft | Objective[8]"
-                  :doc-description "Draft policy for objective ... "}
-   :edit-draft {:doc-title "Edit draft | Objective[8]"
-                :doc-description "Draft policy"
-                :preview "Preview"
-                :submit "Submit"}
-   :sign-up {:doc-title "Sign up almost there | Objective[8]"
-             :doc-description ""
-             :page-title "Almost there"
-             :welcome "Adding your email address will let us notify you when you receive responses to comments, objectives and votes."
-             :username-label "Username"
-             :username-title "Create your username"
-             :not-unique "Username already exists"
-             :not-well-formed "Username must be 1-16 characters in length, containing only letters and numbers"
-             :email-label "Email"
-             :email-title "Add your email title"
-             :button "Create account"}})
-
-(def spanish-translations
-  {:base {:header-logo-text "Objective[8]"
-          :header-logo-title "Inicio"
-          #_:project-status! #_"Spanish(ALPHA: We are still in development and testing, find out more)"
-          :browsehappy! "Por favor actualiza tu navegador para que tengas una mejor experiencia."}
-   :navigation-global {:sign-in-text "Entrar"
-                       :sign-in-title "Iniciar sesión"
-                       :sign-out-text "Salir"
-                       :sign-out-title "Cerrar sesión"
-                       :profile-text "Perfil"
-                       :profile-title "Perfil"}
-   :share-widget {:title "Compartir"
-                  :facebook-title "Compartir en Facebook"
-                  :facebook-text "Compartir en Facebook"
-                  :google-plus-title "Compartir en Google+"
-                  :google-plus-text "Compartir en Google+"
-                  :twitter-title "Compartir en Twitter"
-                  :twitter-text "Compartir en Twitter"
-                  :linkedin-title "Compartir en LinkedIn"
-                  :linkedin-text "Compartir en LinkedIn"
-                  :reddit-title "Compartir en Reddit"
-                  :reddit-text "Compartir en Reddit"
-                  :url-label "Comparte el link"
-                  :url-title "Comparte el link"}
-   :error-404 {#_:doc-title #_"Spanish(Error 404 | Objective[8])"
-               #_:doc-description #_"Spanish(Sorry the page you requested can't be found.)"
-               #_:page-title #_"Spanish(Sorry the page you requested can't be found.)"
-               #_:page-intro #_"Spanish(The page you were trying to reach at this address doesn't seem to exist. This is usually the result of a bad or outdated link. We apologise for any inconvenience.)"
-               :page-content! "
What can I do now?

Please return to the home page.

To report an issue visit our github issues page.

" }
-   :notifications {#_:drafting-has-started #_"Spanish(...)"
-                   #_:drafting-started-helper-text #_"Spanish(...)"
-                   #_:go-to-drafting #_"Spanish(...)"}
-   :index {:doc-title "Objective[8]"
-           #_:doc-description #_""
-           :index-welcome "Politicos colaborando con organizaciones democráticas"
-           :index-intro "Recolectar la opinion de la comunidad, generar ideas, compartir, discutir, votar y colaborar con expertos para redactar nuevas politicas."
-           :index-get-started "Objetivo"
-           :index-get-started-title "Objetivo"
-           :index-learn-more "Más información"
-           :index-learn-more-title "Más información"}
-   :sign-in {:doc-title "Entrar | Objective[8]"
-             :doc-description "Entrar"
-             #_:page-title #_"Spanish(Sign in or Sign up)"
-             :twitter-sign-in-btn "Entra con Twitter"
-             :twitter-sign-in-title "Entra con Twitter"
-             #_:reassurance #_"Spanish(We will never post to Twitter without your permission.)"}
-   :project-status {#_:doc-title #_"Spanish(Project status | Objective [8])"
-                    #_:doc-description #_""
-                    #_:page-title #_"Spanish(Alpha phase)"
-                    #_:page-intro #_"Spanish(We are developing and designing Objective[8] in the open. This allows the tool evolve as you use it, as you give feedback, and as the developers update and add content.)"
-                    #_:page-content! #_"Spanish(
It is important to note that during this time data may be removed or destroyed as part of our process. Any of the views and data expressed here is to be used for example purposes only and does not accurately represent the real views of users.

How to get involved

This project is open source and we are inviting people to collaborate with us to build a better tool. For developers and you can find the code on github at https://github.com/ThoughtWorksInc/objective8. We will also be adding details for upcoming usability sessions shortly.

Have you got an idea?

We are really interested in user feedback and are currently inviting people to leave comments our github issues page.
)" }
-   :learn-more {#_:doc-title #_"Spanish(Learn more) | Objective[8]"
-                #_:doc-description #_""
-                #_:page-title #_"Spanish(...)"
-                #_:sub-title #_"Spanish(...)"
-                #_:page-intro #_"Spanish(...)"
-                #_:get-started-button-title #_"Spanish(...)"
-                #_:get-started-button-text #_"Spanish(...)"
-                #_:page-content! #_"Spanish(...)"}
-   :objective-nav {#_:title #_"Spanish(Navigation for)"
-                   #_:details #_"Spanish(Details)"
-                   #_:questions #_"Spanish(Questions)"
-                   #_:writers #_"Spanish(Writers)"}
-   :objective-list {#_:doc-title #_"Spanish(Objectives | Objective[8])"
-                    #_:doc-description #_""
-                    #_:page-title #_"Spanish(Objectives)"
-                    #_:create-button-title #_"Spanish(Create an objective)"
-                    #_:create-button-text #_"Spanish(Create an objective)"
-                    #_:please #_"Spanish(Please)"
-                    #_:sign-in #_"Spanish(sign in)"
-                    #_:to #_"Spanish(to create an objective.)"
-                    #_:subtitle #_"Spanish(Recently created objectives)"
-                    #_:drafting-begins #_"Spanish(Drafting begins on)"
-                    #_:objectives-intro-text #_"Spanish(...)"}
-   :objective-create {:doc-title "Crea un objetivo | Objective[8]"
-                      :doc-description "Crea un objetivo"
-                      :page-title "Crea un objetivo"
-                      #_:page-intro #_"Spanish(...)"
-                      #_:headline-label #_"Spanish(...)"
-                      :headline-title "3 carateres mínimo, 120 carateres máximo"
-                      #_:headline-prompt #_"Spanish(...)"
-                      #_:headline-placeholder #_"Spanish(...)"
-                      :goals-label "Meta"
-                      #_:goals-prompt #_"Spanish(...)"
-                      :goals-title "50 carateres mínimo, 200 carateres máximo"
-                      #_:goals-placeholder #_"Spanish(...)"
-                      #_:background-label #_"Spanish(...)"
-                      #_:background-prompt #_"Spanish(...)"
-                      :background-title "Escribe una descripcion máximo de 1000 caracteres."
-                      #_:end-date-label #_"Spanish(...)"
-                      #_:end-date-prompt #_"Spanish(...)"
-                      #_:drafting-not-yet-implemented #_"Spanish(...)"
-                      :end-date-title "Por favor escribe la fecha de vencimiento"
-                      :end-date-placeholder "yyyy-mm-dd"
-                      :submit "Crear"}
-   :objective-view {:doc-title "Objetivo | Objective[8]"
-                    #_:doc-description #_""
-                    #_:background-label #_"Spanish(Background)"
-                    :goals-label "Meta"
-                    :end-date-label "Fecha de vencimiento"
-                    :created-message "Tu objetivo ha sido creado"}
-   :comment-view {:created-message "Tu comentario ha sido creado"
-                  :comment-title "Comentarios"
-                  #_:no-comments #_"Spanish(There are no comments yet.)"}
-   :comment-create {#_:comment-label #_"Spanish(Your comment)"
-                    :comment-title "Los comentarios son máximo de 500 caracteres."
-                    #_:post-button #_"Spanish(Add comment)"}
-   :comment-sign-in {#_:please #_"Spanish(Please)"
-                     #_:sign-in #_"Spanish(sign in)"
-                     #_:to #_"Spanish(to start commenting.)"}
-   :question-list {#_:questions-about #_"Spanish(Questions about)"
-                   #_:page-intro #_"Spanish(...)"
-                   #_:question-list-heading #_"Spanish(...)"
-                   #_:no-questions #_"Spanish(There are no questions yet.)" }
-   :question-create {#_:question-label #_"Spanish(Question)"
-                     #_:question-title #_"Spanish(Questions are a maximum length of 500 characters)"
-                     #_:post-button #_"Spanish(Add)"}
-   :question-view {#_:added-message #_"Spanish(Your question has been added!)"
-                   #_:added-answer-message #_"Spanish(Your answer has been added!)"}
-   :question-sign-in {#_:please #_"Spanish(Please)"
-                      #_:sign-in #_"Spanish(sign in)"
-                      #_:to #_"Spanish(to ask a question.)" }
-   :answer-view   {#_:created-message #_"Spanish(Your answer has been posted!)"
-                   #_:answer-title #_"Spanish(Answers)"
-                   #_:no-answers #_"Spanish(No one has answered this question yet.)"}
-   :answer-create {#_:answer-label #_"Spanish(Your answer)"
-                   #_:answer-title #_"Spanish(Answers are a maximum length of 500 characters)"
-                   #_:post-button #_"Spanish(Post your answer)"}
-   :answer-sign-in {#_:please #_"Spanish(Please)"
-                    #_:sign-in #_"Spanish(sign in)"
-                    #_:to #_"Spanish(to answer this question.)"}
-   :invitation {#_:doc-title #_"Spanish(...)"
-                #_:doc-description #_"Spanish(...)"
-                #_:page-title #_"Spanish(...)"
-                #_:page-intro #_"Spanish(...)"
-                #_:writer-name-label #_"Spanish(...)"
-                #_:writer-name-title #_"Spanish(...)"
-                #_:reason-label #_"Spanish(...)"
-                #_:reason-title #_"Spanish(...)"
-                #_:submit #_"Spanish(...)"}
-   :invitation-response {#_:doc-title #_"Spanish(...)"
-                         #_:doc-description #_"Spanish(...)"
-                         #_:page-title #_"Spanish(...)"
-                         #_:page-intro #_"Spanish(...)"
-                         #_:for-objective-text #_"Spanish(...)"
-                         #_:rsvp-text #_"Spanish(...)"
-                         #_:sign-in-to-accept #_"Spanish(...)"
-                         #_:accept #_"Spanish(...)"
-                         #_:decline #_"Spanish(...)"}
-   :invitation-sign-in {#_:please #_"Spanish(...)"
-                        #_:sign-in #_"Spanish(...)"
-                        #_:to #_"Spanish(...)"}
-   :invitation-banner {#_:message #_"Spanish(...)"}
-   :candidate-list {#_:page-intro #_"Spanish(...)"
-                    #_:candidate-list-heading #_"Spanish(...)"
-                    #_:no-candidates #_"Spanish(...)"}
-   :current-draft {#_:page-intro #_"Spanish(...)"
-                   #_:no-drafts #_"Spanish(...)"}
-   :edit-draft {#_:doc-title #_"Spanish(...)"
-                #_:doc-description #_"Spanish(...)"
-                #_:preview #_"Spanish(...)"
-                #_:submit #_"Spanish(...)"}
-   :sign-up {:doc-title "Perfil | Objective[8]"
-             #_:doc-description #_""
-             #_:page-title #_""
-             :welcome  "Tu correo electrónico nos permitira informarte cuando recivas respuestas a tus comentarios, objetivos y votos."
-             #_:username-label #_""
-             #_:username-title #_""
-             #_:not-unique #_""
-             #_:not-well-formed #_""
-             :email-label  "Correo electrónico"
-             :email-title  "Escribe tu cuenta de correo electrónico"
-             #_:button #_""}})
-
-(def translation-config
-  {:dictionary {:en english-translations
-                :es spanish-translations}
-
+                                  :get-started-button-title "Get started"
+                                  :get-started-button-text "Get started"}
+                     :objective-nav {:title "Navigation for"
+                                     :details "Details"
+                                     :questions "Questions"
+                                     :writers "Writers"}
+                     :objective-list {:doc-title "Objectives | Objective[8]"
+                                      :doc-description ""
+                                      :page-title "Objectives"
+                                      :create-button-title "Create an objective"
+                                      :create-button-text "Create an objective"
+                                      :please "Please"
+                                      :sign-in "sign in"
+                                      :to "to create an objective."
+                                      :subtitle "Recently created objectives"
+                                      :drafting-begins "Drafting begins on"
+                                      :objectives-intro-text "Objective[8] centers its policy drafting process around objectives. An objective is a change that could be achieved by introducing new policy." }
+                     :objective-create {:doc-title "Create an Objective | Objective[8]"
+                                        :doc-description "Create an Objective ..."
+                                        :page-title "Create an objective"
+                                        :page-intro "An objective is a change that could be achieved by introducing new policy. For example: improving access to public housing, or increasing the safety of our roads."
+                                        :headline-label "Headline"
+                                        :headline-title "3 characters minimum, 120 characters maximum"
+                                        :headline-prompt "A headline should encourage contribution or discussion"
+                                        :goals-label "Goals"
+                                        :goals-prompt "A goal is what you’d like your change to achieve"
+                                        :goals-title "50 characters minimum, 200 characters maximum"
+                                        :background-label "Background"
+                                        :background-prompt "Provide further information on why achieving this objective is important or necessary"
+                                        :background-title "Enter optional background text up to 1000 characters"
+                                        :end-date-label "Drafting start date"
+                                        :end-date-prompt "On this date, the drafting phase begins. You should give participants enough time to generate useful information, and to recruit and vote for potential policy writers."
+                                        :drafting-not-yet-implemented "(Please note: since this site is still under development, the drafting phase has not yet been implemented)"
+                                        :end-date-title "Please enter an end date"
+                                        :end-date-placeholder"yyyy-mm-dd"
+                                        :submit "Create"}
+                     :objective-view {:doc-title "Objective | Objective[8]"
+                                      :doc-description "Objective  ..."
+                                      :background-label "Background"
+                                      :goals-label "Goals"
+                                      :end-date-label "Drafting begins: "
+                                      :created-message "Your objective has been created!"}
+                     :comment-view {:created-message "Your comment has been added!"
+                                    :comment-title "Comments"
+                                    :no-comments "There are no comments yet."}
+                     :comment-create {:comment-label "Your comment"
+                                      :comment-title "Comments are a maximum length of 500 characters"
+                                      :post-button "Add comment"}
+                     :comment-sign-in {:please "Please"
+                                       :sign-in "sign in"
+                                       :to "to start commenting."}
+                     :question-list {:questions-about "Questions about"
+                                     :page-intro "Gather background information such as opinions and experiences by asking a question.  Your question should be focussed and specific, as the answers will influence the policy drafting process."
+                                     :question-list-heading "Recently asked questions"
+                                     :no-questions "There are no questions yet."}
+                     :question-create {:add-a-question "Add a question to this objective"
+                                       :question-label "Question"
+                                       :question-title "Questions are a maximum length of 500 characters"
+                                       :post-button "Add"}
+                     :question-view {:added-message "Your question has been added!"
+                                     :added-answer-message "Your answer has been added!"}
+                     :question-sign-in {:please "Please"
+                                        :sign-in "sign in"
+                                        :to "to add a question." }
+                     :answer-view   {:created-message "Your answer has been posted!"
+                                     :answer-title "Answers"
+                                     :no-answers "No one has answered this question yet."}
+                     :answer-create {:answer-label "Your answer"
+                                     :answer-title "Answers are a maximum length of 500 characters"
+                                     :post-button "Post your answer"}
+                     :answer-sign-in {:please "Please"
+                                      :sign-in "sign in"
+                                      :to "to answer this question."}
+                     :invitation {:doc-title "Candidate policy writers | Objective[8]"
+                                  :doc-description "Candidate policy writers..."
+                                  :page-title "Invite a policy writer"
+                                  :page-intro "Do you know someone with the enthusiasm and expertise to help draft this policy?"
+                                  :writer-name-label "Writer name: "
+                                  :writer-name-title "Writer names are a maximum length of 50 characters"
+                                  :reason-label "They should help draft this policy, because: "
+                                  :reason-title "Reasons are a maximum length of 1000 characters"
+                                  :submit "Create an invite"}
+                     :invitation-sign-in {:please "Please"
+                                          :sign-in "sign in"
+                                          :to "to invite a policy writer."}
+                     :invitation-response {:doc-title "Invitation to draft | Objective[8]"
+                                           :doc-description "Invitation to help draft policy"
+                                           :page-title "Can you help us to draft some policy?"
+                                           :page-intro "You've been invited to help draft some policy!"
+                                           :for-objective-text "Help write policy to achieve this objective: "
+                                           :rsvp-text "If you're interested, you can sign in and accept the invitation below."
+                                           :sign-in-to-accept "Sign in to accept"
+                                           :accept "Accept"
+                                           :decline "Decline"}
+                     :invitation-banner {:message "Respond to your invitation to help draft policy"}
+                     :candidate-list {:doc-title "Candidate policy writers | Objective[8]"
+                                      :doc-description "Candidate policy writers..."
+                                      :page-intro "Writers work with each other and the community to draft policy."
+                                      :candidate-list-heading "Recently added candidate writers"
+                                      :no-candidates "No candidate writers have been invited yet."}
+                     :current-draft {:page-intro "Current draft"
+                                     :no-drafts "There are currently no drafts for this objective"}
+                     :draft-detail {:doc-title "Policy draft | Objective[8]"
+                                    :doc-description "Draft policy for objective ... "}
+                     :edit-draft {:doc-title "Edit draft | Objective[8]"
+                                  :doc-description "Draft policy"
+                                  :preview "Preview"
+                                  :submit "Submit"}
+                     :sign-up {:doc-title "Sign up almost there | Objective[8]"
+                               :doc-description ""
+                               :page-title "Almost there"
+                               :welcome "Adding your email address will let us notify you when you receive responses to comments, objectives and votes."
+                               :username-label "Username"
+                               :username-title "Create your username"
+                               :not-unique "Username already exists"
+                               :not-well-formed "Username must be 1-16 characters in length, containing only letters and numbers"
+                               :email-label "Email"
+                               :email-title "Add your email title"
+                               :button "Create account"}}
+
+                :es {:base {:header-logo-text "Objective[8]"
+                            :header-logo-title "Inicio"
+                            :project-status! "Spanish(ALPHA: We are still in development and testing, find out more)"
+                            :browsehappy! "Por favor actualiza tu navegador para que tengas una mejor experiencia."}
+                     :navigation-global {:sign-in-text "Entrar"
+                                         :sign-in-title "Iniciar sesión"
+                                         :sign-out-text "Salir"
+                                         :sign-out-title "Cerrar sesión"
+                                         :profile-text "Perfil"
+                                         :profile-title "Ir al perfil de usuario"}
+                     :share-widget {:title "Compartir"
+                                    :facebook-title "Compartir en Facebook"
+                                    :facebook-text "Compartir en Facebook"
+                                    :google-plus-title "Compartir en Google+"
+                                    :google-plus-text "Compartir en Google+"
+                                    :twitter-title "Compartir en Twitter"
+                                    :twitter-text "Compartir en Twitter"
+                                    :linkedin-title "Compartir en LinkedIn"
+                                    :linkedin-text "Compartir en LinkedIn"
+                                    :reddit-title "Compartir en Reddit"
+                                    :reddit-text "Compartir en Reddit"
+                                    :url-label "Comparte el link"
+                                    :url-title "Comparte el link"}
+                     :error-404 {:doc-title "Spanish(Error 404 | Objective[8])"
+                                 :doc-description "Lo sentimos, la página que solicitas no se encuentra"
+                                 :page-title "Lo sentimos, la página que solicitas no se encuentra"
+                                 :page-intro "Parece que la página a la que intentas acceder no existe. Esto puede deberse a un enlace incorrecto o desactualizado"
+                                 :page-content! "
What can I do now?

Please return to the home page.

To report an issue visit our github issues page.

" }
+                     :notifications {:drafting-has-started "la redacción ha comenzado"
+                                     :drafting-started-helper-text "texto de ayuda para comenzar a redactar"
+                                     :go-to-drafting "ir al borrador"}
+                     :index {:doc-title "Objective[8]"
+                             :doc-description ""
+                             :index-welcome "Creación de politica colaborativa para organizaciones democráticas"
+                             :index-intro "Recolectar la opinion de la comunidad, generar ideas, compartir, discutir, votar y colaborar con expertos para redactar nuevas politicas."
+                             :index-get-started "Objetivos"
+                             :index-get-started-title "Objetivos"
+                             :index-learn-more "Más información"
+                             :index-learn-more-title "Más información"}
+                     :sign-in {:doc-title "Entrar o registrarte| Objective[8]"
+                               :doc-description "Entra o regístrate a Objective[8]"
+                               :page-title "Entrar o registrarte"
+                               :twitter-sign-in-btn "Entra con Twitter"
+                               :twitter-sign-in-title "Entra con Twitter"
+                               :reassurance "No compartiremos nunca un contenido en Twitter sin tu permiso"}
+                     :project-status {:doc-title "Estado del proyecto | Objective [8]"
+                                      :doc-description ""
+                                      :page-title "Fase alfa"
+                                      :page-intro "Estamos diseñando y desarrollando Objetive[8] en abierto. Esto permite que la herramienta evolucione según la uses, nos des feedback, y los desarrolladores vayan actualizando y subiendo el nuevo contenido."
+                                      :page-content! "
 Es importante que tengas en cuenta que durante este tiempo algunos contenidos pueden ser borrados como parte del proceso. Todas las vistas y los datos que se visualizan aquí son ejemplos prácticos y no represent de forma precisa la vista real del usuario final.

 Como involucrarse

Este proyecto es Software Libre y estamos invitando a la gente a colaborar para mejorar la herramienta. Si eres desarrollador podrás encontrar el código en github enhttps://github.com/ThoughtWorksInc/objective8. También estaremos añadiendo nuevos detalles provenientes de las pruebas de usabilidad próximamente.

 ¿Tienes una idea que aportar?

 Estamos muy interesados en recoger todo el feedback posible que los usuarios puedan darnos así que os invitamos a dejar comentarios aquípágina de comentarios de github .
)" }
+                     :learn-more {:doc-title "Saber más sobre Objetive[8]"
+                                  :doc-description ""
+                                  :page-title "Objective[8] 101"
+                                  :sub-title "Información básica"
+                                  :page-intro "Objective8 es una plataforma para facilitar la creación de política colectiva en organizaciones democráticas"
+                                  :get-started-button-title "Comienza"
+                                  :get-started-button-text "Comienza"
+                                  :page-content! "
+
Policy is used by governments and organisations to make consistent and fair decisions in order to achieve desired outcomes.

+
+
An objective is a change that could be achieved by introducing new policy.  For example: improving access to public housing, or increasing the safety of our roads.

+
+
Writers work with each other and the community to draft policy.  They use the crowdsourced questions, answers and comments to produce policy drafts*.  These are further refined through cycles of feedback and redrafting.

+
You can get involved and have your say by creating and sharing objectives, offering your opinion through comments, asking and answering questions, suggesting policy writers, or even providing feedback on the policy drafts themselves.  The whole process is open and transparent.

+
+
 *As the site is still under development, these features have not yet been implemented. Check back soon!
"}
+                     :objective-nav {:title "Navegar por"
+                                     :details "Detalles"
+                                     :questions "Preguntas"
+                                     :writers "Redactores"}
+                     :objective-list {:doc-title "Objetivos | Objective[8]"
+                                      :doc-description ""
+                                      :page-title "Objetivos"
+                                      :create-button-title "Crear un objetivo"
+                                      :create-button-text "Crear un objetivo"
+                                      :please "Por favor"
+                                      :sign-in "Entrar"
+                                      :to "para crear un objetivo"
+                                      :subtitle "Objetivos recientes"
+                                      :drafting-begins "La redacción empieza en"
+                                      :objectives-intro-text "Objective[8] centra su proceso de escritura de borradores políticos en los objetivos. Un objetivo es un cambio que puede ser conseguido a partir de una propuesta política"}
+                     :objective-create {:doc-title "Crea un objetivo | Objective[8]"
+                                        :doc-description "Crea un objetivo"
+                                        :page-title "Crea un objetivo"
+                                        :page-intro "Un objetivo es un cambio que puede ser conseguido a partir de una propuesta política. Por ejemplo: mejorar el acceso a la vivienda pública, o incrementar la seguridad de nuestras carreteras"
+                                        :headline-label "Título"
+                                        :headline-title "3 caracteres mínimo, 120 caracteres máximo"
+                                        :headline-prompt "El título debe invitar a la contribución o a la discusión"
+                                        :headline-placeholder "Spanish(...)"
+                                        :goals-label "Meta"
+                                        :goals-prompt "Una meta es lo que te gustaría que tu cambio consiguierea"
+                                        :goals-title "50 caracteres mínimo, 200 caracteres máximo"
+                                        :goals-placeholder "Spanish(...)"
+                                        :background-label "Contexto"
+                                        :background-prompt "Añade más información de por qué alcanzar este objetivo es necesario o importante"
+                                        :background-title "Escribe una descripcion de máximo 1000 caracteres."
+                                        :end-date-label "Fecha de comienzo de la escritura del borrador"
+                                        :end-date-prompt "En esta fecha empieza la fase de creación del borrador. Debes dar a los participantes suficiente tiempo para generar información útil, y para proponer y votar potenciales escritores del texto"
+                                        :drafting-not-yet-implemented "Aviso importante: dado que esta herramienta todavía está en desarrollo, la fase de creación del borrador todavía no ha sido implementada"
+                                        :end-date-title "Por favor escribe la fecha de finalización del proceso"
+                                        :end-date-placeholder "yyyy-mm-dd"
+                                        :submit "Crear"}
+                     :objective-view {:doc-title "Objetivo | Objective[8]"
+                                      :doc-description "Objetivo ..."
+                                      :background-label "Contexto"
+                                      :goals-label "Metas"
+                                      :end-date-label "Fecha de  finalización del proceso"
+                                      :created-message "Tu objetivo ha sido creado"}
+                     :comment-view {:created-message "Tu comentario ha sido creado"
+                                    :comment-title "Comentarios"
+                                    :no-comments "Todavía no hay comentarios"}
+                     :comment-create {:comment-label "Tu comentario"
+                                      :comment-title "Los comentarios tienen un máximo de 500 caracteres."
+                                      :post-button "Añade un comentario"}
+                     :comment-sign-in {:please "Por favor"
+                                       :sign-in "entra"
+                                       :to "para empezar a comentar."}
+                     :question-list {:questions-about "Preguntas sobre"
+                                     :page-intro "Obtén información de contexto como opiniones y experiencias preguntando algo. Tu pregunta debe ser concreta y específica, ya que las respuestas influirán en el proceso de creación del borrador"
+                                     :question-list-heading "Preguntas recientemente añadidas"
+                                     :no-questions "Todavía no hay preguntas" }
+                     :question-create {:question-label "Pregunta"
+                                       :question-title "Las preguntas tienen una longitud máxima de 500 caracteres"
+                                       :post-button "Añadir"}
+                     :question-view {:added-message "Tu pregunta ha sido añadida"
+                                     :added-answer-message "Tu respuesta ha sido añadida!"}
+                     :question-sign-in {:please "Por favor"
+                                        :sign-in "Entrar"
+                                        :to "añadir una pregunta" }
+                     :answer-view   {:created-message "Tu respuesta ha sido enviada"
+                                     :answer-title "Respuestas"
+                                     :no-answers "Nadie ha respondido a esta pregunta aún"}
+                     :answer-create {:answer-label "Tu respuesta"
+                                     :answer-title "Las respuestas pueden tener un máximo de 500 caracteres"
+                                     :post-button "Manda tu respuesta"}
+                     :answer-sign-in {:please "Por favor"
+                                      :sign-in "Entra"
+                                      :to "para responder a la pregunta"}
+
+                     :invitation {:doc-title "Candidatos a redactores del borrador"
+                                  :doc-description "Candidatos a redactores del borrador)"
+                                  :page-title "Invita a un redactor"
+                                  :page-intro "¿Conoces a alguien con el entusiasmo y la experiencia necesaria para ayudar a redactar este borrador"
+                                  :writer-name-label "Nombre del redactor"
+                                  :writer-name-title "El nombre del redactor puede tener una longitud máxima de 50 caracteres"
+                                  :reason-label "Debería ayudar a redactar este borrador porque:"
+                                  :reason-title "La razón por la que invitas puede tener un máximo de 1000 caracteres"
+                                  :submit "Crear una invitación"}
+
+                     :invitation-response {:doc-title "Invitación para redactar I Objective[8]"
+                                           :doc-description "Invitación para ayudar a redactar el borrador"
+                                           :page-title "¿Puedes ayudarnos a redactar este borrador?"
+                                           :page-intro "Has sido invitado a redactar un borrador de documento"
+                                           :for-objective-text "Ayuda a redactar este borrador para conseguir este objetivo"
+                                           :rsvp-text "Si estas interesados puedes entrar y aceptar la invitación siguiente"
+                                           :sign-in-to-accept "Entrar para aceptar"
+                                           :accept "Aceptar"
+                                           :decline "Declinar el ofrecimiento)"}
+                     :invitation-sign-in {:please "Por favor"
+                                          :sign-in "entra"
+                                          :to "para invitar a un nuevo redactor"}
+                     :invitation-banner {:message "Responde a la invitación para ayudar a redactar el documento"}
+
+                     :candidate-list {:page-intro "Los redactores trabajan entre sí y con la comunidad para redactar el borrador"
+                                      :candidate-list-heading "Redactores incorporados recientemente"
+                                      :no-candidates "Ningún redactor ha sido invitado por ahora"}
+                     :current-draft {:page-intro "Borrador actual"
+                                     :no-drafts "No hay borradores para este objetivo"}
+                     :edit-draft {:doc-title "Editar borrador I Objetive[8]"
+                                  :doc-description "Borrador"
+                                  :preview "Vista previa"
+                                  :submit "Enviar"}
+
+                     :sign-up {:doc-title "Perfil | Objective[8]"
+                               :doc-description ""
+                               :page-title "Casi hemos acabado"
+                               :welcome  "Tu correo electrónico nos permitirá informarte cuando recibas respuestas a tus comentarios, objetivos y votos."
+                               :username-label "Nombre de usuario"
+                               :username-title "Crea tu nombre de usuario"
+                               :not-unique "El nombre de usuario ya está en uso"
+                               :not-well-formed "El nombre de usuario debe tener de 1 a 16 caracteres, conteniendo solo letras y númenos"
+                               :email-label  "Correo electrónico"
+                               :email-title  "Escribe tu cuenta de correo electrónico"
+                               :button ""}}}
    :dev-mode? false
    :fallback-locale :en
    :log-missing-translations-function (fn [{:keys [locale ks scope]}]


Fix typo.

Fix typo.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -150,7 +150,7 @@
          :self? self?
          :follow-ups (api-common/rep follow-ups)}
         [false, {:follow-ups (api-common/rep follow-ups)}]) ; invalid share request
-      true))) ;; wil fail existence later
+      true))) ;; will fail existence later

 (defn- entry-list-for-board
   "Retrieve an entry list for the board, or false if the org or board doesn't exist."


remove video info if video id is changed.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -164,15 +164,19 @@
             user (:user ctx)
             entry (:existing-entry ctx)
             updated-entry (:updated-entry ctx)
-            updated-result (entry-res/update-entry! conn (:uuid updated-entry) updated-entry user)]
+            updated-video (if (not= (:video-id updated-entry) (:video-id entry))
+                            (-> updated-entry
+                                (dissoc :video-processed)
+                                (dissoc :video-transcript))
+                            updated-entry)
+            updated-result (entry-res/update-entry! conn (:uuid updated-video) updated-video user)]
     (let [old-board (:moving-board ctx)]
       ;; If we are moving the entry from a draft board, check if we need to remove the board itself.
       (when old-board
         (let [remaining-entries (entry-res/list-all-entries-by-board conn (:uuid old-board))]
           (board-res/maybe-delete-draft-board conn org old-board remaining-entries user)))
       (timbre/info "Updated entry for:" entry-for)
-      (when (not= (:video-id updated-entry) (:video-id entry))
-        (handle-video-data conn updated-result))
+      (handle-video-data conn updated-result)
       (notification/send-trigger! (notification/->trigger :update org board {:old entry :new updated-result} user nil))
       {:updated-entry (assoc updated-result :board-name (:name board))})


[fix] Error messages.

[fix] Error messages.

--- src/ombs/handler/eventacts.clj
+++ src/ombs/handler/eventacts.clj
@@ -5,6 +5,7 @@
     [ombs.db.payment :as dbpay]
     [ombs.validate :as isvalid]
     [ombs.funcs :refer [parse-int]]
+    [ombs.handler.pages :as pages]
     [noir.session :as sess]
     [noir.response :refer [redirect] ]
     ))
@@ -16,7 +17,6 @@
 (defn pay [{ename :event-name date :date :as params}]
   "Add participation of current user and selected event(given as param from
   post). Parts in params is count of parts, that user want to pay"
-  (println "call pay with: " ename " " date)
   (let [uname (sess/get :username)
         uid (db/get-uid uname)
         eid (db/get-eid ename date)]
@@ -24,12 +24,11 @@
       (dbpay/debit-payment uid eid (dbpay/get-debt uname ename date))
       (if (db/can-finish? ename date)
         (finish ename date))))
-  (redirect "/user")) ; go to user page in any case
+  (pages/user)) ; go to user page in any case

 (defn pay-part [{ename :event-name date :date parts :parts :as params}]
   "Add participation of current user and selected event(given as param from
   post). Parts in params is count of parts, that user want to pay"
-  (println "call pay-parts with: " ename " " date " '" parts "'")
   (let [uname (sess/get :username)
         uid (db/get-uid uname)
         eid (db/get-eid ename date)
@@ -40,16 +39,14 @@
         (dbpay/debit-payment uid eid (dbpay/get-debt uname ename date)))
       (when (= 0 (db/get-rest-parts ename date))
         (finish ename date) )))
-  (redirect "/user")) ; go to user page in any case
+  (pages/user)) ; go to user page in any case

 (defn process-it [ename date parts uname]
-  (println "processing " ename " " date " " parts " " uname)
   (if (isvalid/parts? ename date parts) ; its check if parts >= than free parts
     (do
       (dbpay/debit-payment (db/get-uid uname) (db/get-eid ename date) (core/parts-price ename date parts))
       (db/shrink-goods ename date parts))
-    (redirect "/user")
-    ))
+    (pages/user)))

 (defn participate [{ename :event-name date :date}]
   "Add participation of current user and selected event(given as param from
@@ -57,9 +54,9 @@
   (let [uname (sess/get :username)]
     (when (isvalid/participation? ename date uname)
       (core/add-participant ename date uname)))
-  (redirect "/user")); go to user page in any case
+  (pages/user)); go to user page in any case

 (defn start [{ename :event-name date :date}]
   ;isvalid: not started, exists.
   (core/start-event ename date)
-  (redirect "/user")); go to user page in any case
+  (pages/user)); go to user page in any case


Refactor the way no-recover reads occur. Fixes #2

Ledger handle must re-opened in no-recover mode in order to get updated
last confirmed value

--- src/onyx/plugin/bookkeeper.clj
+++ src/onyx/plugin/bookkeeper.clj
@@ -97,11 +97,11 @@
     (throw (Exception. "Restarted task, however it was already completed for this job.
                        This is currently unhandled."))))

-(defn read-ledger-chunk! [ledger-handle deserializer-fn ledger-id read-ch start end]
+(defn read-ledger-chunk! [ledger-handle deserializer-fn read-ch start end]
   (loop [entries (.readEntries ledger-handle start end)
          ledger-entry (.nextElement entries)]
     (let [segment {:entry-id (.getEntryId ^LedgerEntry ledger-entry)
-                   :ledger-id ledger-id
+                   :ledger-id (.getId ledger-handle)
                    :value (deserializer-fn (.getEntry ^LedgerEntry ledger-entry))}]
       (>!! read-ch (t/input (random-uuid) segment))
       (if (.hasMoreElements entries)
@@ -110,35 +110,38 @@

 (def read-chunk-size 100)

-(defn read-ledger-entries! [client ^LedgerHandle ledger-handle read-ch deserializer-fn last-acked max-id no-recovery? backoff-period]
-  (let [ledger-id (.getId ledger-handle)]
-    (info "Starting BookKeeper input ledger:" ledger-id "reader at:" (inc last-acked))
-    (loop [last-confirmed (.getLastAddConfirmed ledger-handle)
-           start (inc last-acked)
-           end (min last-confirmed max-id (+ start read-chunk-size))]
-      (let [not-fully-read? (and (not (neg? last-confirmed))
-                                 (< last-acked last-confirmed)
-                                 (< start last-confirmed))]
-        (if not-fully-read?
-          (read-ledger-chunk! ledger-handle deserializer-fn ledger-id read-ch start end)
-          (Thread/sleep backoff-period))
-        (when (or not-fully-read?
-                  (not (.isClosed client ledger-id)))
-          (let [new-last-confirmed (if no-recovery?
-                                     ;; new confirmations may occur in recover mode
-                                     (.getLastAddConfirmed ledger-handle)
-                                     last-confirmed)]
-            (recur new-last-confirmed
-                   (inc end)
-                   (min last-confirmed max-id (+ (inc end) read-chunk-size)))))))))
+(defn read-ledger-entries!
+  [client ledger-id digest password read-ch deserializer-fn backoff-period start end]
+  (let [ledger-handle (obk/open-ledger client ledger-id digest password)
+        last-confirmed (.getLastAddConfirmed ledger-handle)
+        bounded-end (min end last-confirmed)
+        chunks (partition-all 2 1 (range (dec start) bounded-end read-chunk-size))
+        _ (info "Starting final read: " start end last-confirmed bounded-end (vec chunks))]
+    (run! (fn [[s e]]
+              (read-ledger-chunk! ledger-handle deserializer-fn read-ch (inc s) (or e bounded-end)))
+            chunks)))
+
+(defn no-recovery-read-ledger-entries!
+  [client ledger-id digest password read-ch deserializer-fn backoff-period start end]
+  (let [ledger-handle (obk/open-ledger-no-recovery client ledger-id digest password)
+        last-confirmed (.getLastAddConfirmed ledger-handle)
+        bounded-end (min end last-confirmed)
+        chunks (partition-all 2 1 (range (dec start) bounded-end read-chunk-size))]
+    (run! (fn [[s e]]
+              (read-ledger-chunk! ledger-handle deserializer-fn read-ch (inc s) (or e bounded-end)))
+            chunks)
+    (if (.isClosed client ledger-id)
+      (read-ledger-entries! client ledger-id digest password read-ch deserializer-fn backoff-period (inc bounded-end) end)
+      (do
+        (Thread/sleep 1000)
+        (recur client ledger-id digest password read-ch deserializer-fn backoff-period (inc bounded-end) end)))))

 (defn inject-read-ledgers-resources
   [{:keys [onyx.core/task-map onyx.core/log onyx.core/task-id onyx.core/pipeline onyx.core/peer-opts] :as event} lifecycle]
   (when-not (= 1 (:onyx/max-peers task-map))
     (throw (ex-info "Read log tasks must set :onyx/max-peers 1" task-map)))
-  (let [start-id (if-let [start (:bookkeeper/ledger-start-id task-map)]
-                   (dec start)
-                   -1)
+  (let [; decrement because we are going to store this as a checkpoint and then recover
+        start-id (dec (or (:bookkeeper/ledger-start-id task-map) 0))
         max-id (or (:bookkeeper/ledger-end-id task-map) Double/POSITIVE_INFINITY)
         {:keys [read-ch shutdown-ch commit-ch]} pipeline
         checkpoint-key (or (:checkpoint/key task-map) task-id)
@@ -151,23 +154,23 @@
         backoff-period 10
         commit-loop-ch (start-commit-loop! commit-ch log checkpoint-key)
         ledgers-root-path (or (:bookkeeper/zookeeper-ledgers-root-path task-map)
-                               (log-zk/ledgers-path (:onyx/id peer-opts)))
+                              (log-zk/ledgers-path (:onyx/id peer-opts)))
         zookeeper-addr (:bookkeeper/zookeeper-addr task-map)
         zookeeper-timeout 60000
         bookkeeper-throttle 30000
         client (obk/bookkeeper zookeeper-addr ledgers-root-path zookeeper-timeout bookkeeper-throttle)
         ledger-id (:bookkeeper/ledger-id task-map)
-        password (or (:bookkeeper/password-bytes task-map) (throw (Exception. ":bookkeeper/password-bytes must be supplied")))
-        no-recovery? (:bookkeeper/no-recovery? task-map)
+        password (or (:bookkeeper/password-bytes task-map)
+                     (throw (Exception. ":bookkeeper/password-bytes must be supplied")))
         deserializer-fn (kw->fn (:bookkeeper/deserializer-fn task-map))
         digest (digest-type (:bookkeeper/digest-type task-map))
-        ledger-handle (if no-recovery?
-                        (obk/open-ledger-no-recovery client ledger-id digest password)
-                        (obk/open-ledger client ledger-id digest password) )
+        read-fn (if (:bookkeeper/no-recovery? task-map)
+                  no-recovery-read-ledger-entries!
+                  read-ledger-entries!)
         producer-ch (thread
                       (try
-                        (let [exit (loop [last-acked (:largest checkpointed)]
-                                     (read-ledger-entries! client ledger-handle read-ch deserializer-fn last-acked max-id no-recovery? backoff-period)
+                        (let [exit (loop [last-acked (inc (:largest checkpointed))]
+                                     (read-fn client ledger-id digest password read-ch deserializer-fn backoff-period last-acked max-id)
                                      :finished)]
                           (if-not (= exit :shutdown)
                             (>!! read-ch (t/input (random-uuid) :done))))


fix missing require

fix missing require

--- src/pc/models/access_grant.clj
+++ src/pc/models/access_grant.clj
@@ -1,5 +1,6 @@
 (ns pc.models.access-grant
   (:require [pc.datomic :as pcd]
+            [pc.datomic.web-peer :as web-peer]
             [clj-time.core :as time]
             [clj-time.coerce]
             [crypto.random]


DB has no external deps, so no need for rpath

--- config/software/db.clj
+++ config/software/db.clj
@@ -17,23 +17,8 @@
 ;; limitations under the License.
 ;;

-(let [env
-      (cond
-       (and (is-os? "darwin") (is-machine? "x86_64"))
-       { "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
-         "LDFLAGS" "-R/opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
-       (is-os? "linux")
-       { "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
-         "LDFLAGS" "-Wl,-rpath /opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
-       (is-os? "solaris2")
-       { "CFLAGS" "-L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"
-         "LDFLAGS" "-Wl,-rpath /opt/opscode/embedded/lib -L/opt/opscode/embedded/lib -I/opt/opscode/embedded/include"}
-       )
-      ]
-
-  (software "db" :source "db-5.0.26.NC"
-                 :build-subdir "build_unix"
-                 :steps [{:env env
-                          :command "../dist/configure" :args ["--prefix=/opt/opscode/embedded"]}
-                         {:command "make"}
-                         {:command "make" :args ["install"]}]))
+(software "db" :source "db-5.0.26.NC"
+               :build-subdir "build_unix"
+               :steps [{:command "../dist/configure" :args ["--prefix=/opt/opscode/embedded"]}
+                       {:command "make"}
+                       {:command "make" :args ["install"]}])


cassandra: forward correct credentials.

cassandra: forward correct credentials.

--- src/io/cyanite/index/cassandra.clj
+++ src/io/cyanite/index/cassandra.clj
@@ -42,7 +42,7 @@
           cluster (if (sequential? cluster) cluster [cluster])
           session (-> {:contact-points cluster}
                       (cond-> (and username password)
-                        (assoc :credentials {:username username
+                        (assoc :credentials {:user username
                                              :password password}))
                       (alia/cluster)
                       (alia/connect (or (:keyspace opts) "metric")))


Add bus-monitor convenience function

Add bus-monitor convenience function

Simply dispatches to either audio-bus-monitor or control-bus-monitor
depending on the rate of bus supplied as an argument.

Only accepts busses. If you wish to use numerical indexes to refer to
busses, you need to use either audio-bus-monitor or control-bus-monitor
directly.

--- src/overtone/sc/bus.clj
+++ src/overtone/sc/bus.clj
@@ -224,3 +224,24 @@
                         :desc (str "control-bus-monitor [" bus-idx "]"))
            (swap! control-bus-monitors* assoc bus-idx monitor)
            monitor)))))
+
+(defn bus-monitor
+  "Returns either a control or audio bus monitor depending on the rate
+   of bus supplied. Returns an atom containing the current value of the
+   control bus. Note that this isn't the peak amplitude, rather the
+   direct value of the control bus.
+
+   For multi-channel buses, an offset may be specified. Current
+   amplitude is updated within the returned atom every 50 ms.
+
+   Note - only creates one monitor per bus - subsequent calls for the
+   same bus will return a cached monitor.
+
+   See audio-bus-monitor and control-bus-monitor for specific details."
+  ([bus] (bus-monitor bus 0))
+  ([bus chan-offset]
+     (assert (bus? bus))
+     (cond
+      (audio-bus? bus) (audio-bus-monitor bus chan-offset)
+      (control-bus? bus) (control-bus-monitor bus chan-offset)
+      :else (throw (Exception. (str "Unknown bus type: " bus))))))


When in repl, log message and do not throw exception.

--- src/plan_schema/cli.clj
+++ src/plan_schema/cli.clj
@@ -109,10 +109,10 @@
       (println (string/join \newline msgs))
       (pschema/log-error \newline (string/join \newline msgs))))
   (flush) ;; ensure all pending output has been flushed
-  (when (repl?)
-    (throw (Exception. (str "DEV MODE exit(" status ")"))))
-  (shutdown-agents)
-  (System/exit status)
+  (if (repl?)
+    (pschema/log-warn "exit" status "In DEV MODE. Not exiting")
+    (do (shutdown-agents)
+        (System/exit status)))
   true)

 (defn plan-schema


Improve connect trident

Improve connect trident

--- src/gigrig/geometry/line.cljs
+++ src/gigrig/geometry/line.cljs
@@ -17,16 +17,13 @@
   "Returns an array of lines that would connect one box to multiple
   subboxes in a 'trident' fashion"
   [root children]
-  (let [left-box (apply min-key :x children)
-        right-box (apply max-key :x children)
+  (let [offsets (map #(:x (box/center %)) (conj children root))
         y-height (+ (box/bottom root) (/ (- (:y (first children)) (box/bottom root)) 2))
-        left-x (:x (box/center left-box))
-        right-x (:x (box/center right-box))]
+        left-x (apply min offsets)
+        right-x (apply max offsets)]
     (concat
      [;; The horizontal line from leftest to rightest child
-      (if (= left-x right-x)
-        (line {:x left-x :y y-height} {:x (:x (box/center root)) :y y-height})
-        (line {:x left-x :y y-height} {:x right-x :y y-height}))
+      (line {:x left-x :y y-height} {:x right-x :y y-height})
       ;; The vertical line from root
       (line {:x (:x (box/center root)) :y y-height} {:x (:x (box/center root)) :y (box/bottom root)})]
      ;; The vertical lines for all children


* document how to log to stdout

* document how to log to stdout

--- src/riemann/logging.clj
+++ src/riemann/logging.clj
@@ -25,7 +25,7 @@
 (defn init
   "Initialize log4j. You will probably call this from the config file. Options:

-  :file   The file to log to."
+  :file   The file to log to. Use \"/dev/null\" to log to stdout only."
   [& { :keys [file] }]
   (let [filename (or file "riemann.log")
         rolling-policy (doto (TimeBasedRollingPolicy.)


Add additional TLS versions

Add additional TLS versions

--- src/robinson/update.clj
+++ src/robinson/update.clj
@@ -2610,6 +2610,7 @@
                                                                         v))
                                                                world)
                                        (json/write-str world))]
+                     (System/setProperty "https.protocols" "TLSv1,TLSv1.1,TLSv1.2")
                      (http/post url
                        {:body body
                         :content-type :json})))


store strings

store strings

--- src/syncserver/core.clj
+++ src/syncserver/core.clj
@@ -20,8 +20,8 @@
   (swap! current-state
     (fn [cs]
       (let [nk (inc (:current cs))]
-      (.put cache! nk state)
-      (println "just stored" (.getIfPresent cache! nk))
+      (.put cache! (str nk) state)
+      (println "just stored" (.getIfPresent cache! (str nk)))
       (assoc cs :state state :current nk)))))

 (defn arg-count [f]


Worse error descriptions

Worse error descriptions

--- src/atom_finder/util/cdt_util.clj
+++ src/atom_finder/util/cdt_util.clj
@@ -171,7 +171,8 @@
   "Return the only child of a unary node"
   [node]
   (let [[x1 x2] (children node)]
-    (assert (nil? x2) (str "node '" (safe-write-ast node) "' at " (tree-path node) " should only have one child '" (safe-write-ast x1) "', but instead also had a second '" (safe-write-ast x2) "'"))
+    ;(assert (nil? x2) (str "node '" (safe-write-ast node) "' at " (tree-path node) " should only have one child '" (safe-write-ast x1) "', but instead also had a second '" (safe-write-ast x2) "'"))
+    (assert (nil? x2) (str "node " (tree-path node) " should only have one child, but instead also had a second"))
     x1))

 (defn parse-source


add more patterns

add more patterns

--- src/babel/francais/morphology.clj
+++ src/babel/francais/morphology.clj
@@ -3,6 +3,7 @@
 (require '[babel.stringutils :refer :all])
 (require '[babel.francais.morphology.nouns :as nouns])
 (require '[babel.francais.morphology.verbs :as verbs])
+(require '[babel.parse :refer [toks]])
 (require '[clojure.core :as core])
 (require '[clojure.string :as string])
 (require '[clojure.string :refer (trim)])
@@ -519,32 +520,43 @@
 ;; used for parsing: TODO: unify with generation
 (def pattern-to-structure
   {
-   #"^(\S+)ée$" [{:replace-with "er"
+   #"^(j)$" [{:replace-with "e" ;; j' -> je
+              :structure :top}]
+   #"^(\S+)ée$" [{:replace-with "er" ;; allée -> aller
                   :structure {:synsem {:infl :past-p
                                        :subcat {:1 {:agr {:number :sing
                                                           :gender :fem}}}}}}]
-   #"^(\S+)ées$" [{:replace-with "er"
+   #"^(\S+)ées$" [{:replace-with "er" ;; allées -> aller
                    :structure {:synsem {:infl :past-p
                                         :subcat {:1 {:agr {:number :plur
                                                            :gender :fem}}}}}}]
-   #"^(\S+)é$" [{:replace-with "er"
+   #"^(\S+)é$" [{:replace-with "er" ;; allé -> aller
                  :structure {:synsem {:infl :past-p
                                       :subcat {:1 {:agr {:number :sing
                                                          :gender :masc}}}}}}]
-   #"^(\S+)és$" [{:replace-with "er"
+   #"^(\S+)és$" [{:replace-with "er" ;; allés -> aller
                   :structure {:synsem {:infl :past-p
                                        :subcat {:1 {:agr {:number :plur
                                                           :gender :masc}}}}}}]
-
    ;; -er and -ir type verbs
-   #"^(\S+)e$" [{:replace-with "er"
+   #"^(\S+)e$" [{:replace-with "er" ;; parle -> parler
                  :structure {:synsem {:subcat {:1 {:agr {:number :sing
                                                          :person :1st}}}
                                       :infl :present}}}
-                {:replace-with "ir"
+                {:replace-with "ir" ;; dorme -> dormir
                  :structure {:synsem {:subcat {:1 {:agr {:number :sing
                                                          :person :1st}}}
-                                      :infl :present}}}]
+                                      :infl :present}}}
+
+                {:replace-with "er" ;; parle -> parler
+                 :structure {:synsem {:subcat {:1 {:agr {:number :sing
+                                                         :person :3rd}}}
+                                      :infl :present}}}
+                {:replace-with "ir" ;; dorme -> dormir
+                 :structure {:synsem {:subcat {:1 {:agr {:number :sing
+                                                         :person :3rd}}}
+                                      :infl :present}}}
+                ]
    }
   )

@@ -574,7 +586,8 @@
                      (get lexicon (str (string/replace surface-form (:pattern match) "$1") (:replace-with match)))))
               matches)
       (get lexicon surface-form))
-
+
      true
      (get lexicon surface-form))))

+


Fix formatting

Fix formatting

--- src/braid/quests/client/list.cljs
+++ src/braid/quests/client/list.cljs
@@ -169,132 +169,132 @@
     :quest/listener (fn [state [event args]]
                       false)}

-{:quest/id :quest/search-tag
- :quest/name "Search for an old conversation by tag"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; profile
-
-{:quest/id :quest/set-avatar
- :quest/name "Set your avatar"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/set-profile
- :quest/name "Set your profile"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/update-nickname
- :quest/name "Update your nickname"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/verify-email
- :quest/name "Verify your email"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; invite
-
-{:quest/id :quest/invite
- :quest/name "Invite a user to your group"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; tags
-
-{:quest/id :quest/tags-review
- :quest/name "Review your subscriptions"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/tag-subscribe
- :quest/name "Subscribe to a tag"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)
- }
-{:quest/id :quest/tag-unsubscribe
- :quest/name "Unsubscribe from a tag"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/tag-create
- :quest/name "Create a tag"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/tag-create-autocomplete
- :quest/name "Create a tag using the autocomplete"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-{:quest/id :quest/archives
- :quest/name "Look into a tag's archives"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; settings
-
-{:quest/id :review-digest-options
- :quest/name "Review your email preferences"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; bots
-
-{:quest/id :quest/bot-add
- :quest/name "Add a bot to your group"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; clients
-
-{:quest/id :quest/desktop-client
- :quest/name "Try the Braid desktop app"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-{:quest/id :quest/mobile-client
- :quest/name "Try the Braid mobile app"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-{:quest/id :quest/web-client
- :quest/name "Try the Braid web app"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-
-; groups
-
-{:quest/id :quest/groups-create
- :quest/name "Create another group"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-{:quest/id :quest/groups-explore
- :quest/name "Explore the available public groups"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}
-{:quest/id :quest/groups-join-public
- :quest/name "Join a public group"
- :quest/goal 3
- :quest/listener (fn [state [event args]]
-                   false)}])
+   {:quest/id :quest/search-tag
+    :quest/name "Search for an old conversation by tag"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; profile
+
+   {:quest/id :quest/set-avatar
+    :quest/name "Set your avatar"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/set-profile
+    :quest/name "Set your profile"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/update-nickname
+    :quest/name "Update your nickname"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/verify-email
+    :quest/name "Verify your email"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; invite
+
+   {:quest/id :quest/invite
+    :quest/name "Invite a user to your group"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; tags
+
+   {:quest/id :quest/tags-review
+    :quest/name "Review your subscriptions"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/tag-subscribe
+    :quest/name "Subscribe to a tag"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/tag-unsubscribe
+    :quest/name "Unsubscribe from a tag"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/tag-create
+    :quest/name "Create a tag"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/tag-create-autocomplete
+    :quest/name "Create a tag using the autocomplete"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   {:quest/id :quest/archives
+    :quest/name "Look into a tag's archives"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; settings
+
+   {:quest/id :review-digest-options
+    :quest/name "Review your email preferences"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; bots
+
+   {:quest/id :quest/bot-add
+    :quest/name "Add a bot to your group"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; clients
+
+   {:quest/id :quest/desktop-client
+    :quest/name "Try the Braid desktop app"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+   {:quest/id :quest/mobile-client
+    :quest/name "Try the Braid mobile app"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+   {:quest/id :quest/web-client
+    :quest/name "Try the Braid web app"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+
+   ; groups
+
+   {:quest/id :quest/groups-create
+    :quest/name "Create another group"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+   {:quest/id :quest/groups-explore
+    :quest/name "Explore the available public groups"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}
+   {:quest/id :quest/groups-join-public
+    :quest/name "Join a public group"
+    :quest/goal 3
+    :quest/listener (fn [state [event args]]
+                      false)}])


log the host and port of Nimbus when using storm client

--- src/clj/backtype/storm/thrift.clj
+++ src/clj/backtype/storm/thrift.clj
@@ -10,7 +10,7 @@
   (:import [backtype.storm.clojure RichShellBolt RichShellSpout])
   (:import [org.apache.thrift7.protocol TBinaryProtocol TProtocol])
   (:import [org.apache.thrift7.transport TTransport TFramedTransport TSocket])
-  (:use [backtype.storm util config])
+  (:use [backtype.storm util config log])
   )

 (defn instantiate-java-object [^JavaObject obj]
@@ -49,6 +49,7 @@
     ))

 (defn nimbus-client-and-conn [host port]
+  (log-message "Connecting to Nimbus at " host ":" port)
   (let [transport (TFramedTransport. (TSocket. host port))
         prot (TBinaryProtocol. transport)
         client (Nimbus$Client. prot)]


Test for Shipment from SanSan.

Test for Shipment from SanSan.

--- src/clj/test/cards-operations.clj
+++ src/clj/test/cards-operations.clj
@@ -74,3 +74,16 @@
     (is (= 0 (count (:hand (get-runner)))) "Runner has 0 cards in hand")
     (is (= :corp (:winner @state)) "Corp wins")
     (is (= "Flatline" (:reason @state)) "Win condition reports flatline")))
+
+(deftest shipment-from-sansan
+  "Shipment from SanSan - placing advancements"
+  (do-game
+    (new-game (default-corp [(qty "Shipment from SanSan" 3) (qty "Ice Wall" 3)])
+              (default-runner))
+    (play-from-hand state :corp "Ice Wall" "HQ")
+    (let [iwall (get-in @state [:corp :servers :hq :ices 0])]
+      (play-from-hand state :corp "Shipment from SanSan")
+      (prompt-choice :corp "2")
+      (prompt-select :corp iwall)
+      (is (= 5 (:credit (get-corp))))
+      (is (= 2 (:advance-counter (refresh iwall)))))))


Inline zigzag functions

Inline zigzag functions

--- src/cljc/mikron/runtime/math.cljc
+++ src/cljc/mikron/runtime/math.cljc
@@ -156,15 +156,15 @@

 (defn zigzag-encode
   "Zigzag encodes a long `x`."
+  #?(:clj {:inline (fn [x] `(xor (shift-right ~x 63) (shift-left ~x 1)))})
   ^long [^long x]
-  (xor (shift-right x 63)
-       (shift-left x 1)))
+  (xor (shift-right x 63) (shift-left x 1)))

 (defn zigzag-decode
   "Zigzag decodes a long `x`."
+  #?(:clj {:inline (fn [x] `(xor (unsigned-bit-shift-right ~x 1) (negate (and ~x c1))))})
   ^long [^long x]
-  (xor (unsigned-shift-right x 1)
-       (negate (and x c1))))
+  (xor (unsigned-shift-right x 1) (negate (and x c1))))

 (defn lower-bound
   "Returns the lower bound for an integer type"


fixed styling bug

fixed styling bug

--- src/cljs/apollo/client/pages.cljs
+++ src/cljs/apollo/client/pages.cljs
@@ -65,7 +65,7 @@
       (html [:div.browse
              (om/build nav/main-nav data)
              (om/build left-column data)
-             [:div.middle-columns.pure-g
+             [:div.middle-column.pure-g
               [:div.pure-u-1
                [:div.content
                 (albums/album-list-partial nil (:albums data))]]]]))))


Simplification of the rendering code.

Simplification of the rendering code.

--- src/cljs/post_to_screen/core.cljs
+++ src/cljs/post_to_screen/core.cljs
@@ -8,8 +8,9 @@

 (enable-console-print!)

-(defonce app-state (atom {:seleced nil
-                          :posts []}))
+(defonce app-state (atom {:selected-tab  "Post"
+                          :selected-post 0
+                          :posts         []}))

 ; WebSockets

@@ -43,7 +44,7 @@

 ; UI

-(defn code-view [{:keys [selected posts] :as cursor} owner]
+(defn code-view [{:keys [selected-post posts] :as cursor} owner]
   (reify
     om/IRender
     (render [_]
@@ -53,62 +54,66 @@
           [:ul.list-unstyled
            (map (fn [i]
                   [:li
-                   {:on-click (fn [_] (om/update! cursor [:selected] i))}
-                   ((if (= i selected) (fn [text] [:strong text]) identity) (str "Code " i))])
-                (range (count posts) 0 -1))]]
-         (when selected
+                   {:on-click (fn [_] (om/update! cursor [:selected-post] i))}
+                   ((if (= i selected-post) (fn [text] [:strong text]) identity) (str "Code " (inc i)))])
+                (reverse (range (count posts))))]]
+         (when (seq posts)
            [:div.col-xs-10
             [:pre#codeview
-             [:code (get posts (dec selected))]]])]))))
+             [:code (get posts selected-post)]]])]))
+    om/IDidUpdate
+    (did-update [_ _ _]
+      (let [codeview (-> js/document
+                         (.getElementById "codeview"))]
+        (.highlightBlock js/hljs codeview)))))

-(defn submit-code [owner e]
+(defn submit-code [cursor e]
   (let [code (-> js/document
                  (.getElementById "code"))]
     #_(print "Sent: " [:post-to-screen/code code])
     (chsk-send! [:post-to-screen/code (.-value code)])
     (set! (.-value code) "")
-    (om/set-state! owner [:selected] 1)
+    (om/update! cursor [:selected-tab] "Show")
     (.preventDefault e)))

-(defn post-form [owner]
-  (html
-    [:form.form-horizontal {:role "form"
-                            :on-submit (partial submit-code owner)}
-     [:div.form-group
-      [:label.control-label.col-xs-1 {:for "code"} "Code:"]
-      [:div.col-xs-10
-       [:textarea#code.form-control {:rows "15"}]]]
-     [:div.form-group
-      [:div.col-xs-offset-1.col-xs-10
-       [:button.btn {:type "submit"} "Post code"]]]]))
+(defn post-form [cursor owner]
+  (reify
+    om/IRender
+    (render [_]
+      (html
+        [:form.form-horizontal {:role      "form"
+                                :on-submit (partial submit-code cursor)}
+         [:div.form-group
+          [:label.control-label.col-xs-1 {:for "code"} "Code:"]
+          [:div.col-xs-10
+           [:textarea#code.form-control {:rows "15"}]]]
+         [:div.form-group
+          [:div.col-xs-offset-1.col-xs-10
+           [:button.btn {:type "submit"} "Post code"]]]]))
+    om/IDidMount
+    (did-mount [_]
+      (-> js/document
+          (.getElementById "code")
+          .focus))))

-(defn tab-view [cursor owner]
+(defn tab-view [{:keys [selected-tab] :as cursor} owner]
   (reify
-    om/IInitState
-    (init-state [_]
-      {:tabs ["Post" "Show"]
-       :selected 0})
-    om/IRenderState
-    (render-state [_ {:keys [tabs selected]}]
-      (html
-        [:div
-         [:div.btn-group {:role "toolbar"}
-          (map-indexed (fn [i tab]
-                         [(str "button.btn.btn-default" (if (= i selected) ".active" ""))
-                          {:type "button"
-                           :on-click (fn [_] (om/set-state! owner [:selected] i))}
-                          tab])
-                       tabs)]
-         [:hr]
-         (case (get tabs selected)
-           "Post" (post-form owner)
-           "Show" (om/build code-view cursor))]))
-    om/IDidUpdate
-    (did-update [_ _ _]
-      (let [code (-> js/document
-                     (.getElementById "codeview"))]
-        (when code
-          (.highlightBlock js/hljs code))))))
+    om/IRender
+    (render [_]
+      (let [tabs ["Post" "Show"]]
+        (html
+          [:div
+           [:div.btn-group {:role "toolbar"}
+            (map-indexed (fn [i tab]
+                           [(str "button.btn.btn-default" (if (= tab selected-tab) ".active" ""))
+                            {:type     "button"
+                             :on-click (fn [_] (om/update! cursor [:selected-tab] tab))}
+                            tab])
+                         tabs)]
+           [:hr]
+           (case selected-tab
+             "Post" (om/build post-form cursor)
+             "Show" (om/build code-view cursor))])))))

 (defn application [cursor owner]
   (reify


renaming

renaming

--- src/cljs/triboard/view/frame.cljs
+++ src/cljs/triboard/view/frame.cljs
@@ -4,18 +4,17 @@
     [triboard.logic.turn :as turn]
     [triboard.view.board :as board]
     [triboard.view.callbacks :as cb]
-    [triboard.view.panel :as panel]
-    ))
+    [triboard.view.panel :as panel]))

 #_(s/fdef main-frame
   :args (s/cat
           :turn ::turn/turn
-          :suggestion fn?
-          :callback #(satisfies? cb/CallBacks %)))
+          :suggestions fn?
+          :callbacks #(satisfies? cb/CallBacks %)))

 (defn main-frame
-  [turn suggestions interactions]
+  [turn suggestions callbacks]
   [:div.game-panel
-   [panel/show-top-panel (:scores turn) (:player turn) interactions]
-   [board/render-board (:board turn) suggestions interactions]
+   [panel/show-top-panel (:scores turn) (:player turn) callbacks]
+   [board/render-board (:board turn) suggestions callbacks]
    ])


CMR-3228: Adding a more specific test to make sure functionality of combined limit_to_granules and include_granule_counts works correctly.

--- system-int-test/test/cmr/system_int_test/search/granule_counts_search_test.clj
+++ system-int-test/test/cmr/system_int_test/search/granule_counts_search_test.clj
@@ -73,7 +73,7 @@
         ;; western hemisphere
         coll2 (make-coll 2 (m/mbr -180 90 0 -90) (temporal-range 1 3))
         ;; eastern hemisphere
-        coll3 (make-coll 3 (m/mbr 0 90 180 -90) (temporal-range 2 4))
+        coll3 (make-coll 3 (m/mbr 0 90 180 -90) (temporal-range 2 5))
         ;; northern hemisphere
         coll4 (make-coll 4 (m/mbr -180 90 180 0) (temporal-range 3 5))
         ;; southern hemisphere
@@ -188,6 +188,10 @@
                                                     :temporal (temporal-search-range start stop)})]
             (gran-counts/granule-counts-match? :xml expected-counts refs))
           1 6 {coll2 0 coll3 3 coll4 3 coll5 3 coll6 3}
+
+          ;; coll3 is returned because it covers the time range but it has no granules that cover it.
+          5 6 {coll3 0 coll4 1 coll5 2 coll6 1}
+
           2 3 {coll2 0 coll3 2 coll4 1 coll6 1}))

       (testing "granule counts for temporal queries with limit_to_granules"
@@ -197,6 +201,11 @@
                                                     :temporal (temporal-search-range start stop)})]
             (gran-counts/granule-counts-match? :xml expected-counts refs))
           1 6 {coll2 0 coll3 3 coll4 3 coll5 3 coll6 3}
+
+          ;; coll3 not returned here because it has no granules that cover the time range even though
+          ;; it's temporal matches the range.
+          5 6 {coll4 1 coll5 2 coll6 1}
+
           2 3 {coll2 0 coll3 2 coll4 1 coll6 1}))

       (testing "granule counts for both spatial and temporal queries"


Fix bug in r-i -- now fully working

Fix bug in r-i -- now fully working

--- src/angelic/search/implicit/dash_astar_opt_simple.clj
+++ src/angelic/search/implicit/dash_astar_opt_simple.clj
@@ -156,7 +156,7 @@

 (defn refine-input    [s ni]
-  (when-let [ret ((:ri-fn s) s ni)]
+  (when-let [ret ((:refine-input-fn s) s ni)]
     (util/assert-is (= (:name s) (:name ret)))
     (when (canonical? s) (add-subsuming-sp! ret s))
     ret))