mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-05 23:20:19 +00:00
1 line
4.3 KiB
JSON
1 line
4.3 KiB
JSON
[{"user_id": 3580, "stars": [], "topic_id": 12368, "date_created": 1299861385.1396649, "message": "I end up dir()ing django models that have loads of fields, and then visually pouring over the list for items that contain some string I'm looking for.", "group_id": 292, "id": 324102}, {"user_id": 13501, "stars": [], "topic_id": 12368, "date_created": 1299862550.5812161, "message": "list comprehension sometimes look weird", "group_id": 292, "id": 324332}, {"user_id": 3580, "stars": [], "topic_id": 12368, "date_created": 1299862389.001307, "message": "thanks.. yeah, something exactly like that would be the body of the function I wanted. just wanted to make sure there wasn't an even shorter, easier to type solution that I wouldn't bother wrapping up :P", "group_id": 292, "id": 324282}, {"user_id": 3580, "stars": [], "topic_id": 12368, "date_created": 1299861351.402838, "message": "anyone got a clever super-quick way to grep results of dir()", "group_id": 292, "id": 324095}, {"user_id": 3025, "stars": [{"date_created": 1299862003.3955801, "user_id": 1243}, {"date_created": 1299862392.8644409, "user_id": 3580}, {"date_created": 1299923514.6142559, "user_id": 141}], "topic_id": 12368, "date_created": 1299861930.479038, "message": "[word for word in dir(x) if 'potatoes' in word] ?", "group_id": 292, "id": 324177}, {"user_id": 3580, "stars": [], "topic_id": 12368, "date_created": 1299861422.7819791, "message": "before I right a silly dirgrep(x, 'potatoes') function, I figured I'd ask if I've overlooked something handy.", "group_id": 292, "id": 324105}, {"user_id": 5778, "stars": [], "topic_id": 12368, "date_created": 1299868517.826586, "message": "pretty much the same thing as the list comprehension", "group_id": 292, "id": 325424}, {"user_id": 1822, "stars": [], "topic_id": 12368, "date_created": 1299867151.7357211, "message": "pprint(dir(x))", "group_id": 292, "id": 325295}, {"user_id": 1822, "stars": [], "topic_id": 12368, "date_created": 1299867171.7975819, "message": "assumes you already have pprint imported into your interactive shell - and that you know the alphabet well...", "group_id": 292, "id": 325297}, {"user_id": 1822, "stars": [], "topic_id": 12368, "date_created": 1299867243.8110509, "message": "(I guess that doesn't solve the issue if you are looking for a substring...)", "group_id": 292, "id": 325298}, {"user_id": 5778, "stars": [], "topic_id": 12368, "date_created": 1299868468.8271849, "message": "I've used filter for this sort of thing before...", "group_id": 292, "id": 325414}, {"user_id": 5778, "stars": [], "topic_id": 12368, "date_created": 1299868496.523591, "message": "filter(lambda i: i in 'potatoes', dir(x))", "group_id": 292, "id": 325420}, {"user_id": 141, "stars": [], "topic_id": 12368, "date_created": 1299923613.0353539, "message": "if the thing you're grepping is a simple data structure, you can even use repr() with generator/comprehension syntax to keep from walking the structure.", "group_id": 292, "id": 331003}, {"user_id": 141, "stars": [], "topic_id": 12368, "date_created": 1299923708.702265, "message": "came in handy yesterday when i was looking for which elements in a facebook graph API json response had \"youtube\" in them.", "group_id": 292, "id": 331004}, {"user_id": 10454, "stars": [{"date_created": 1300291334.2128849, "user_id": 3580}, {"date_created": 1300425341.1092811, "user_id": 214}, {"date_created": 1300486131.9807429, "user_id": 18773}], "topic_id": 12368, "date_created": 1299994345.9181449, "message": "Use IPython:\n[~]\n|1> import numpy\n\n[~]\n|2> numpy.*array*?\nnumpy.array\nnumpy.array2string\nnumpy.array_equal\nnumpy.array_equiv\nnumpy.array_repr\nnumpy.array_split\nnumpy.array_str\nnumpy.asanyarray\nnumpy.asarray\nnumpy.asarray_chkfinite\nnumpy.ascontiguousarray\nnumpy.asfarray\nnumpy.asfortranarray\nnumpy.broadcast_arrays\nnumpy.chararray\nnumpy.compare_chararrays\nnumpy.get_array_wrap\nnumpy.get_numarray_include\nnumpy.ndarray\nnumpy.recarray", "group_id": 292, "id": 339074}, {"user_id": 8558, "stars": [], "topic_id": 12368, "date_created": 1299994853.9177289, "message": "If you need regexps, you could even (I'm assuming the re module is already imported):\n[ elm for elm in dir(x) if re.match(pat, elm) is not None ]", "group_id": 292, "id": 339098}, {"user_id": 3580, "stars": [], "topic_id": 12368, "date_created": 1300291347.0695961, "message": "@RobertKem really great tip. Thanks!", "group_id": 292, "id": 367183}] |