Fork me on GitHub
#hoplon
<
2016-10-05
>
vigilancetech02:10:42

can anyone tell me how to turn down the volume on speak?

alandipert03:10:27

there isn't a way, but you could do (speak :theme "woodblock") which uses softer sounds

vigilancetech03:10:14

Its the voice that's blowing out my speakers, and if I turn them down some other way, I can't hear the rest very well

vigilancetech03:10:45

Its a nice feature to have and I'd like to keep it on if I can

alandipert03:10:26

definitely try the woodblock sound theme. much softer

alandipert03:10:48

ooh i think i understand now, it's the warning/error voice?

vigilancetech03:10:30

the sounds were pretty loud too before. Right now I'm only getting the voice so I can't tell how much softer that is

alandipert04:10:52

are you on a mac or on linux?

lightbulb06:10:40

In linux if you have pulse audio setup you could turn it down in pavucontrol.

vigilancetech06:10:57

how come when I'm trying to use ui elem image, it only works with a :url attribute but won't take it locally out of my assets with a :src attribute (yes, assets is set in build.boot)? When I do that, the whole elem won't render at all, including siblings). Isn't "image" supposed to be roughly the equivalent to the "img" html element?

vigilancetech06:10:38

lightbulb, well, I could turn the whole system's volume down with alsamixer too, but then other things are way too soft. IMO speak needs a :volume attribute

lightbulb07:10:28

Fair enough. Also on a Mac there is no way that I know of to control the volume of individual applications from a mixer like pavuvontrol. Every app has its own volume control.

vigilancetech07:10:24

does pavuvontrol do individual apps, or is it systemwide?

lightbulb07:10:38

@vigilancetech pavucontrol will do individual apps. If your distro doesn't use pulseaudio it by defualt it can be a bit of a pain to get setup though.

lightbulb07:10:38

the mixer will only show when speak makes a sound. You will need to modify a file so boot runs, switch to pavucontol then adjust it when speak makes the sound. It will be fidderly!

vigilancetech07:10:11

hmm... well, my package manager says its installed, so I'll have to give it a try, thanks.

lightbulb07:10:53

If you can make it say warning its easier, you have a little more time to adjust it. Just tested it and the volume level does persist between each time it makes a sound.

vigilancetech07:10:19

I could probably use that on facebook too. They're notorious for always starting every vid at full volume and blowing out one's speakers

lightbulb08:10:37

Yeah. It works right down to individual tabs in chrome. Although it will probably make all your tabs afterwards muted as it can't tell the difference between sites. My screenshot was youtube and deezer.

adamfrey15:10:46

I don’t know how Javelin works under the hood but this really suprised me:

(defc x 1)

(defc= computed
  (let [inner-binding "huh"]
    (when (and x inner-binding)
      (prn inner-binding))))

;; prints “huh"

adamfrey15:10:57

and then the broken version:

adamfrey15:10:11

(defc x 1)

(defc= computed
  (let [inner-binding "huh"]
    (when (and inner-binding x) ;; swapped arguments in and
      (prn inner-binding))))

Use of undeclared Var biz.cells/inner-binding at line 154...

alandipert15:10:41

@adamfrey are you saying you were surprised by the first one? because that's how it's supposed to work, curious how you might have thought it would otherwise work. the 2nd example looks like a bug of some kind, i try to repro

adamfrey15:10:11

no sorry, I’m surprised by the second. I wasn’t sure if it was a bug or not

adamfrey15:10:24

I’m having trouble getting macro expand to work in cljs to see what’s actually happening

alandipert15:10:41

hm, wasn't able to reproduce with javelin 3.8.4

alandipert15:10:57

^^ macro you can use to debug

alandipert15:10:13

if you have time to put together a minimal failing thing i can experiment

alandipert15:10:48

my guess would be you're using a version of cljs newer than the cell= macro can cope with

alandipert15:10:04

it depends on aspects of cljs that break every year or two

alandipert15:10:10

it works for me with [org.clojure/clojurescript "1.7.228"]

adamfrey15:10:16

ah, I’m using 1.9.229

alandipert15:10:46

yeah it's hard keeping up with cljs

alandipert15:10:51

any inroad you can make to debug, much appreciated

alandipert15:10:58

definitely something we'll need to figure out

alandipert15:10:20

what does (println (let* [x 1] (let* [y x] y))) print out in your setup?

alandipert15:10:37

or rather, (println ((fn* ([a] (let* [x a] (let* [y x] y)))) 1))

alandipert15:10:40

if that also breaks i'd say it's a cljs regression

alandipert16:10:28

hm i made a rhino repl in cljs master and don't see it

lightbulb16:10:45

I just tried to reproduce this in a project i've got going. I could reproduce it but downgrading my clojurescript didn't fix it.

vigilancetech16:10:49

ok, let me rephrase: is ui image supposed to be able to use :src instead of :url? If so then I'll have to look to my paths (which I currently don't see any problem with)

greenhorse16:10:02

Hi! I want to draw charts using a 3rd party charting library with hoplon. There are charts.js and chartist.js avialable via cljsjs. I found couple of examples how they can be used with reframe: https://gist.github.com/edwthomas When I tried porting those examples to hoplon all I managed to do is bar chart from chart.js example kind-a working sometimes 🙂. Can somebody show how those examples should be done properly in hoplon ?

alandipert16:10:54

@greenhorse is "rev-chartjs" in the first example the id of a canvas element?

alandipert16:10:52

@greenhorse i see you don't call any function from cljsjs.chartjs. does it apply itself automatically to canvases somehow?

alandipert16:10:22

oh nvm - had to click to expand

alandipert16:10:47

looks like you put the "chartjs-component" class on canvases to make them render?

greenhorse16:10:11

@alandipert that code isn't mine. I am trying to port it to hoplon. Basicaly I want just to draw a chart using hoplon and one of those libraries..

alandipert16:10:22

got it. i'll have an example for you shortly

alandipert16:10:05

(page "index.html"
  (:require [cljsjs.chartist]))

(defn chart
  [chart-data]
  (with-let [self (canvas)]
    (let [ctx (.getContext self "2d")]
      (with-init
        (cell= (js/Chart. ctx (clj->js chart-data)))))))

(def chart-data
  (cell
   {:type "bar"
    :data {:labels ["2012" "2013" "2014" "2015" "2016"]
           :datasets [{:data [5 10 15 20 25]
                       :label "Rev in MM"
                       :backgroundColor "#90EE90"}
                      {:data [3 6 9 12 15]
                       :label "Cost in MM"
                       :backgroundColor "#F08080"}]}}))

(defn add-random-data
  [data]
  (-> data
      (update :labels conj (gensym))
      (update :datasets #(mapv (fn [m] (update m :data conj (rand-int 30))) %))))

(html
  (head
    (title "Chart Example"))
  (body
    (chart chart-data)
    (button :click #(swap! chart-data add-random-data))))

alandipert16:10:15

@greenhorse ^^ totally untested... but i hope it conveys the basic idea

alandipert16:10:43

the idea is to encapsulate the charting function in a defn or defelem that takes its data as a cell argument

greenhorse16:10:49

@alandipert ok. I will give it a try. Thanks !

alandipert16:10:03

no prob. it's kind of the general hoplon recipe for working with 3rd party libs, really. make a custom element with cell arguments, and that applies data in a cell to an element via the 3rd party lib after the page is loaded, and then after that, whenever the cell changes

greenhorse17:10:02

@alandipert I have it working. Thanks! I will see if I can port the chartist.js example as well.

adamfrey17:10:37

@alandipert I have a workaround for now, but if I get time later I’ll try to make up a minimal repro case

alandipert17:10:42

@greenhorse great! yeah you might be able to identify some patterns in there and come up with a pretty sweet and general chart component. lemme know if you do 😄

adamfrey17:10:18

that println expr you sent me works, so 🤷