Fork me on GitHub
#beginners
<
2016-12-04
>
chris01:12:25

cider-refresh?

agigao02:12:02

refresh? how?

gary06:12:10

@chokheli M-x cider-refresh is probably what he meant

gary06:12:00

@justinlee I'm having a difficult time understanding the issue, could you possibly share the code in a gist?

vjunloc08:12:56

The repl section of quick start guide doesn't work for me - https://github.com/clojure/clojurescript/wiki/Quick-Start

vjunloc08:12:22

requiring the module always fails

vjunloc08:12:51

i copy pasted everything still didn't work

roelofw09:12:12

Hello, I need to have first everything on the keyword "makers". From that one I need to have the first item and from that the keyword "name"

roelofw09:12:42

Can I do this : (:name (first(:makers))) ?

roelofw09:12:24

@vjunloc Which part do not work and which error message do you see then ?

val_waeselynck10:12:02

@roelofw no, (:makers) will throw

val_waeselynck10:12:23

would be easier to help if you showed us example input and output data

roelofw10:12:03

I have this json response which will be converted to a clojure object by clj-http :

roelofw10:12:10

{
  "elapsedMilliseconds": 27,
  "artObject": {
    "links": {
      "search": ""
    },
    "id": "nl-SK-C-5",
    "priref": "5216",
    "objectNumber": "SK-C-5",
    "language": "nl",
    "title": "Schutters van wijk II onder leiding van kapitein Frans Banninck Cocq, bekend als de ‘Nachtwacht’",
    "tags": [
      {
        "userId": 3530,
        "name": "margaret barrett my first collection",
        "lang": "en",
        "objectNumber": "SK-C-5"
      },
      // more results...
    ],
    "copyrightHolder": null,
    "webImage": {
      "guid": "92253da1-794d-49f4-9e3c-e4c160715f53",
      "offsetPercentageX": 50,
      "offsetPercentageY": 100,
      "width": 2500,
      "height": 2034,
      "url": ""
    },
    "colors": [
      "#261808",
      // more results...
    ],
    "colorsWithNormalization": [
      {
        "originalHex": "#261808",
        "normalizedHex": "#000000"
      },
      // more results...
    ],
    "normalizedColors": [
      "#000000",
      // more results...
    ],
    "normalized32Colors": [
      "#000000",
      // more results...
    ],
    "titles": [
      "Officieren en andere schutters van wijk II in Amsterdam onder leiding van kapitein Frans Banninck Cocq en luitenant Willem van Ruytenburch, bekend als de ‘Nachtwacht’",
      "Het korporaalschap van kapitein Frans Banninck Cocq en luitenant Willem van Ruytenburch, bekend als de 'Nachtwacht'"
    ],
    "description": "Het korporaalschap van kapitein Frans Banninck Cocq en luitenant Willem van Ruytenburch, bekend als de 'Nachtwacht'. Schutters van de kloveniersdoelen uit een poort naar buiten tredend. Op een schild aangebracht naast de poort staan de namen van de afgebeelde personen: Frans Banninck Cocq, heer van purmerlant en Ilpendam, Capiteijn Willem van Ruijtenburch van Vlaerdingen, heer van Vlaerdingen, Lu[ij]tenant, Jan Visscher Cornelisen Vaendrich, Rombout Kemp Sergeant, Reijnier Engelen Sergeant, Barent Harmansen, Jan Adriaensen Keyser, Elbert Willemsen, Jan Clasen Leydeckers, Jan Ockersen, Jan Pietersen bronchorst, Harman Iacobsen wormskerck, Jacob Dircksen de Roy, Jan vander heede, Walich Schellingwou, Jan brugman, Claes van Cruysbergen, Paulus Schoonhoven. De schutters zijn gewapend met lansen, musketten en hellebaarden. Rechts de tamboer met een grote trommel. Tussen de soldaten links staat een meisje met een dode kip om haar middel, rechts een blaffende hond. Linksboven de vaandrig met de uitgestoken vaandel.",
    "labelText": null,
    "objectTypes": [
      "schilderij"
    ],
    "objectCollection": [
      "schilderijen"
    ],
    "makers": [
      {
        "name": "Rembrandt Harmensz. van Rijn",
        "unFixedName": "Rembrandt Harmensz. van Rijn",
        "placeOfBirth": "Leiden",
        "dateOfBirth": "1606-07-15",
        "dateOfBirthPrecision": null,
        "dateOfDeath": "1669-10-08",
        "dateOfDeathPrecision": null,
        "placeOfDeath": "Amsterdam",
        "occupation": [
          "prentmaker",
          "tekenaar",
          "schilder"
        ], 

roelofw10:12:37

of this i need to have the name of the makers "keyword"

roelofw10:12:00

so here " "Rembrandt Harmensz. van Rijn"

roelofw10:12:07

so I can display it

val_waeselynck10:12:23

ok so something like (->> data :makers (map :name)) maybe ?

roelofw10:12:11

@val_waeselynck I can try that , thanks

drewverlee17:12:41

Its straight forward enough with reduce, but is there a better way to concat separate vectors by their index? input: [[0 1] [2 3]] output: [[0 2] [1 3]]

drewverlee17:12:42

probably group by...

curlyfry17:12:14

@drewverlee I think you could use apply map to do it: (apply map (fn [& xs] xs) [[0 1] [2 3]]) or something similar

drewverlee17:12:58

i have done this like 20 times! why canit i seem to remember it 🙂