<commit_before>(ns com.datayumyum.helloDroid.main)

(require 'neko.notify)
(require 'com.rabbitmq.client.ConnectionFactory)
 (def main-layout [:linear-layout {:orientation :vertical}
                   [:edit-text {:hint "Event name3"}]
                   [:button {:text "i'm a button"
                             :on-click (fn [_] (neko.notify/toast "toast to me"))}]])



     (on-ui
     (set-content-view! a
      (make-ui main-layout) ))

(import '(com.rabbitmq.client ConnectionFactory Connection Channel MessageProperties QueueingConsumer))
(defn sendQueue [msg]
  (do
    (def factory (ConnectionFactory.))
    (.setHost factory "obi.kaicode.com")
    (def connection (.newConnection factory))
    (def channel (.createChannel connection))
    (def queue "han.printer")
    (.queueDeclare channel queue true false false nil)
    (.basicPublish channel "" queue MessageProperties/PERSISTENT_TEXT_PLAIN (.getBytes msg))    
    )
)

(defn readQeue []
    (def factory (ConnectionFactory.))
    (.setHost factory "obi.kaicode.com")
    (def connection (.newConnection factory))
    (def channel (.createChannel connection))
    (def queue "han.printer")
    (.queueDeclare channel queue true false false nil)
    (def consumer (QueueingConsumer. channel))
    (.basicConsume channel queue true consumer)
    (def delivery (.nextDelivery consumer))
    (def message (String. (.getBody delivery)))
    (println message)
)<commit_msg>dynamic ui<commit_after>(ns com.datayumyum.helloDroid.main)

(require 'neko.notify)
(require 'com.rabbitmq.client.ConnectionFactory)
 (def main-layout [:linear-layout {:orientation :vertical}
                   [:edit-text {:hint "Event name3"}]
                   [:button {:text "i'm a button"
                             :on-click (fn [_] (neko.notify/toast "toast to me"))}]])



     (on-ui
     (set-content-view! a
      (make-ui main-layout) ))

(import '(com.rabbitmq.client ConnectionFactory Connection Channel MessageProperties QueueingConsumer))
(defn send [msg]
  (do
    (def factory (ConnectionFactory.))
    (.setHost factory "obi.kaicode.com")
    (def connection (.newConnection factory))
    (def channel (.createChannel connection))
    (def queue "han.printer")
    (.queueDeclare channel queue true false false nil)
    (.basicPublish channel "" queue MessageProperties/PERSISTENT_TEXT_PLAIN (.getBytes msg))    
    (.close channel)
    (.close connection)
    )
)

(defn read []
    (def factory (ConnectionFactory.))
    (.setHost factory "obi.kaicode.com")
    (def connection (.newConnection factory))
    (def channel (.createChannel connection))
    (def queue "han.printer")
    (.queueDeclare channel queue true false false nil)
    (def consumer (QueueingConsumer. channel))
    (.basicConsume channel queue true consumer)
    (def delivery (.nextDelivery consumer))
    (def message (String. (.getBody delivery)))
    (.close channel)
    (.close connection)
    (println message)
    (render (eval (read-string message)))
)

(defn render [ui]
  (on-ui
   (set-content-view! a
                      (make-ui ui) ) )
)
   
{'fraction_non_alphanumeric': 0.12738441642418363, 'fraction_numerical': 0.0006466214031684449, 'mean_word_length': 3.039164490861619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '522412', 'n_tokens_mistral': 956, 'n_tokens_neox': 895, 'n_words': 257}