Clojurians
#hoplon
<
2016-03-04
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

levitanong06:03:53

jQuery 3 has fixed svg class manipulation https://github.com/jquery/jquery/commit/94bf113471905c1c4f84a1f7d21c9b65f3ba61dc Maybe you guys would like to use jQuery 3 for hoplon? Currently I’m unable to set the class of an svg element in hoplon. (I’m guessing the workaround is :attr?

dm307:03:33

what did jquery3 sacrifice? old IE compatibility?

levitanong08:03:10

@dm3: I don’t know enough about how jquery3 works to answer that question, but here is their blogpost with a changelog https://blog.jquery.com/2015/07/13/jquery-3-0-and-jquery-compat-3-0-alpha-versions-released/

dm308:03:02

I'd say it's worth upgrading

dm308:03:47

we could do with a point release of Hoplon though :simple_smile:

dm308:03:15

aplha13 doesn't give much confidence for people to try

micha13:03:50

if jq3 is in cljsjs you can use :exclusions in your hoplon dependency

micha13:03:03

and add in your own jquery dependnecy to override the one hoplon brings

micha13:03:37

actually you don't even need the :exclusions, adding your own explicit jquery dependency will be enough to override it

dm315:03:13

@micha, your jt tool is awesome! :simple_smile:

dm315:03:59

I see the -o file option, but it doesn't seem to offer rewriting capability

dm315:03:20

can you use it to change json too?

alandipert15:03:59

@dm3: not yet, the query DSL is lossy

alandipert15:03:07

and would probably need to change to support that

alandipert15:03:19

or maybe there is a way to do it, i'm sure micha is open to ideas

alandipert15:03:10

lossy in the sense that, for a given argument pattern, it could be valid for multiple different json shapes, so what it should output isn't disambiguous

micha15:03:51

yeah it's not really designed for emitting json

micha15:03:04

because it's optimized for extraction

micha15:03:19

to emit json would mean adding a lot of things that would affect performance

dm315:03:32

yeah, what does -o option do then?

micha15:03:44

that just writes the tabular data to a file instead of stdout

dm315:03:07

anyway helps to make sense of the data

micha15:03:32

i use it for extracting info from json apis

micha15:03:42

and for processing large amounts of json data in log files for instance

micha15:03:52

it can do ~250MB of json per sec

micha15:03:06

in bounded memory

dm315:03:09

did you try jq, how far did that go?

micha15:03:23

jq does too much, so it's very slow

micha15:03:30

maybe 100x or more times slower than jt

micha15:03:46

also it emits json, so it's not useful for what i need

micha15:03:08

like you have to implement all the things the shell already has in the weird little language it uses

micha15:03:29

i just want to extract the json tree data into a tabular format that is the standard for unix tools

micha15:03:45

then coreutils can be applied to the problem to get the final result i need

micha15:03:55

since i'll be piping that to some other unix tools anyway

micha15:03:14

so any tool that emits json output is pretty kmuch useless to me

micha15:03:31

since no unix tools or command line programs understand json arguments

micha15:03:49

jshon is what i was using before

dm315:03:52

do you ever need to pipe it back into json?

micha15:03:01

but it doesn't produce tabular output

micha15:03:16

i use jshon to create json from tabular data

micha15:03:39

i don't hardly ever need to create json though

micha15:03:49

the times i do a simple template suffices

micha15:03:18

usually it goes like API -> table -> coreutils -> unix command line program

micha15:03:36

where the command line program or script will create the json

micha15:03:41

based on cli args

micha15:03:01

the aws command line program is an example of that

dm315:03:07

makes sense

micha15:03:40

aws ec2 describe-instances | jt ... | while read a b c; do aws ec2 do-something --arg1 $a ...; done

micha15:03:47

things like that

alandipert15:03:09

we should make an aws wrapper script that accepts jt args

alandipert15:03:30

i guess it would only shave a few chars

micha15:03:39

usually you need to do some join, awk, paste etc in the middle though

micha15:03:50

oh you mean to process the output

micha15:03:05

there is a weird --query argument you can use

micha15:03:14

which is like a query langiuage over json

micha15:03:34

it's a json->json transformation

micha15:03:46

but you can use it to prune the results

micha15:03:57

i can't really figure it out though

micha15:03:11

using jt plus unix coreutils is way easier

alandipert15:03:13

looks like trash

micha15:03:35

i was pooping in there