<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/tree</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 26 May 2013 10:29:55 GMT</pubDate>
<item>
<title>(Java) TreeMap search - alexedy</title>
<link>http://snipplr.com/view/70093/treemap-search/</link>
<description><![CDATA[ <p>Search objects from one map in another, as optimum as possible.</p> ]]></description>
<pubDate>Tue, 26 Feb 2013 06:30:54 GMT</pubDate>
<guid>http://snipplr.com/view/70093/treemap-search/</guid>
</item>
<item>
<title>(SQL) get all children under a tree - hairajeshk</title>
<link>http://snipplr.com/view/69601/get-all-children-under-a-tree/</link>
<description><![CDATA[ <p>to fetch all the children in a tree based on parentid</p> ]]></description>
<pubDate>Wed, 23 Jan 2013 23:53:23 GMT</pubDate>
<guid>http://snipplr.com/view/69601/get-all-children-under-a-tree/</guid>
</item>
<item>
<title>(JavaScript) JSON Tree(1 function 15 lines)Nested Ul from single or multidimensional json object - halk</title>
<link>http://snipplr.com/view/67767/json-tree1-function-15-linesnested-ul-from-single-or-multidimensional-json-object/</link>
<description><![CDATA[ <p>Any valid json object will be recursively traversed building a nested unordered list of its properties and their values.  This example parses the json entered in the text area into an object that is passed to the json_tree() function.  I use the twitter bootstrap to make collapsible trees.  That is the purpose of thee css and the random string i generate.  I left it in as an example of how you might style the returned list.  This is very much a work in progress so if you have any suggestions please post a comment.  I have posted the entire html for a working example page just create the file and open it in your browser.(make sure your json validates - http://jsonlint.com - only valid json will produce a tree)</p> ]]></description>
<pubDate>Wed, 17 Oct 2012 04:48:13 GMT</pubDate>
<guid>http://snipplr.com/view/67767/json-tree1-function-15-linesnested-ul-from-single-or-multidimensional-json-object/</guid>
</item>
<item>
<title>(Python) Script to print crawl tree of a spider run - scrapy</title>
<link>http://snipplr.com/view/66995/script-to-print-crawl-tree-of-a-spider-run/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 01 Sep 2012 07:15:20 GMT</pubDate>
<guid>http://snipplr.com/view/66995/script-to-print-crawl-tree-of-a-spider-run/</guid>
</item>
<item>
<title>(PHP) Adding is_tree functon to WordPress - klagraff</title>
<link>http://snipplr.com/view/66750/adding-istree-functon-to-wordpress/</link>
<description><![CDATA[ <p>Add this to functions.php to enable the page-child function is_tree</p> ]]></description>
<pubDate>Thu, 16 Aug 2012 03:35:01 GMT</pubDate>
<guid>http://snipplr.com/view/66750/adding-istree-functon-to-wordpress/</guid>
</item>
<item>
<title>(Clojure) k-d tree - weilawei</title>
<link>http://snipplr.com/view/64805/kd-tree/</link>
<description><![CDATA[ <p>make-kd-node [median left right]: Creates a node in a kd-tree.

make-kd-tree [k depth points]: Creates a kd-tree of kd-nodes. **TODO**: Not stack safe. Use loop/recur.

kd-nearest-neighbor [a-point kd-tree]: Returns the nearest neighboring point to a given point, using a kd-tree.</p> ]]></description>
<pubDate>Mon, 07 May 2012 00:51:46 GMT</pubDate>
<guid>http://snipplr.com/view/64805/kd-tree/</guid>
</item>
<item>
<title>(PHP) Create tree structure in PHP - putu</title>
<link>http://snipplr.com/view/63613/create-tree-structure-in-php/</link>
<description><![CDATA[ <p>This snippet demonstrates how to build tree structure with PHP.</p> ]]></description>
<pubDate>Tue, 28 Feb 2012 11:57:37 GMT</pubDate>
<guid>http://snipplr.com/view/63613/create-tree-structure-in-php/</guid>
</item>
<item>
<title>(PHP) How to get the family id's of a Wordpress page - jvandemerwe</title>
<link>http://snipplr.com/view/58718/how-to-get-the-family-ids-of-a-wordpress-page/</link>
<description><![CDATA[ <p>This small snippet can be used to get the children and grand children of a Wordpress page. See the comments for how it works</p> ]]></description>
<pubDate>Fri, 16 Sep 2011 00:45:34 GMT</pubDate>
<guid>http://snipplr.com/view/58718/how-to-get-the-family-ids-of-a-wordpress-page/</guid>
</item>
<item>
<title>(Perl) make a directory tree from the output of find - alfirth</title>
<link>http://snipplr.com/view/53097/make-a-directory-tree-from-the-output-of-find/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 05 May 2011 10:44:14 GMT</pubDate>
<guid>http://snipplr.com/view/53097/make-a-directory-tree-from-the-output-of-find/</guid>
</item>
<item>
<title>(Perl) traverse a hash - alfirth</title>
<link>http://snipplr.com/view/53096/traverse-a-hash/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 05 May 2011 10:42:17 GMT</pubDate>
<guid>http://snipplr.com/view/53096/traverse-a-hash/</guid>
</item>
<item>
<title>(PHP) Recursive Glob File Tree - danoph</title>
<link>http://snipplr.com/view/48610/recursive-glob-file-tree/</link>
<description><![CDATA[ <p>There are a lot of recursive glob functions out there but they don't build a tree, they build a 1 dimensional array...This function builds a directory tree.</p> ]]></description>
<pubDate>Tue, 08 Feb 2011 21:41:36 GMT</pubDate>
<guid>http://snipplr.com/view/48610/recursive-glob-file-tree/</guid>
</item>
<item>
<title>(C++) bstablo_pokazivac.h - dafilipaj</title>
<link>http://snipplr.com/view/46639/bstablopokazivach/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 07:50:32 GMT</pubDate>
<guid>http://snipplr.com/view/46639/bstablopokazivach/</guid>
</item>
<item>
<title>(C++) bstablo_polje.h - dafilipaj</title>
<link>http://snipplr.com/view/46638/bstablopoljeh/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 07:49:32 GMT</pubDate>
<guid>http://snipplr.com/view/46638/bstablopoljeh/</guid>
</item>
<item>
<title>(C++) ostablo.h - dafilipaj</title>
<link>http://snipplr.com/view/46637/ostabloh/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 07:48:35 GMT</pubDate>
<guid>http://snipplr.com/view/46637/ostabloh/</guid>
</item>
<item>
<title>(C++) Main program - dafilipaj</title>
<link>http://snipplr.com/view/46636/main-program/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 06 Jan 2011 07:46:54 GMT</pubDate>
<guid>http://snipplr.com/view/46636/main-program/</guid>
</item>
<item>
<title>(PHP) Simple category tree - graceman9</title>
<link>http://snipplr.com/view/44889/simple-category-tree/</link>
<description><![CDATA[ <p>Как сделать вывод из нескольких таблиц (php mysql)
 
Итак, имеем:
Три таблицы - articles, categories и sections. По иерархии - в sections включаются categories, а в categories включаются articles. По таблицам это выглядит так:

Articles(id, title, categoryID, sectionID)
Categories(id, title, sectionID)
Sections(id, title)

То есть ключевым является id в каждой таблице, и именно с помошью его надо определять какая категория относится к какому разделу и какая статья относится к какой категории.

Нужно:
Сделать запрос в базу данных, получить данные и создать из них, наверно, массив.
Затем вывести данные в формате:
Section1
Category1_of_Section1
Article1_of_Category1
Article2_of_Category1
Article3_of_Category1
...
ArticleN_of_Category1
Category2_of_Section1
Article1_of_Category2
Article2_of_Category2
...
ArticleN_of_Category2
Category3_of_Section1
...
CategoryN_of_Section1
Section2
...
SectionN

То есть чтобы выводились все разделы по очереди, и при этом каждый включал в себя категории, которые относятся к нему. А каждая категория, в свою очередь, включала в себя статьи, которые относятся к ней.

Как это можно сделать? php и mysql.</p> ]]></description>
<pubDate>Fri, 26 Nov 2010 06:04:15 GMT</pubDate>
<guid>http://snipplr.com/view/44889/simple-category-tree/</guid>
</item>
<item>
<title>(Python) From a list containing tree info, generare a tree in dict format - magicrebirth</title>
<link>http://snipplr.com/view/43903/from-a-list-containing-tree-info-generare-a-tree-in-dict-format/</link>
<description><![CDATA[ <p>The resulting tree is represented through a dict where each father gets a key (with all the children as args)</p> ]]></description>
<pubDate>Wed, 10 Nov 2010 22:35:08 GMT</pubDate>
<guid>http://snipplr.com/view/43903/from-a-list-containing-tree-info-generare-a-tree-in-dict-format/</guid>
</item>
<item>
<title>(PHP) Create Directory Path - iloveitaly</title>
<link>http://snipplr.com/view/40543/create-directory-path/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 16 Sep 2010 01:26:56 GMT</pubDate>
<guid>http://snipplr.com/view/40543/create-directory-path/</guid>
</item>
<item>
<title>(PHP) method to sort a tree node even with empty parents - sveggiani</title>
<link>http://snipplr.com/view/39559/method-to-sort-a-tree-node-even-with-empty-parents/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 26 Aug 2010 21:52:44 GMT</pubDate>
<guid>http://snipplr.com/view/39559/method-to-sort-a-tree-node-even-with-empty-parents/</guid>
</item>
<item>
<title>(Ruby) Print All Ruby Classes in Array - viatropos</title>
<link>http://snipplr.com/view/39091/print-all-ruby-classes-in-array/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sun, 15 Aug 2010 14:29:51 GMT</pubDate>
<guid>http://snipplr.com/view/39091/print-all-ruby-classes-in-array/</guid>
</item>
</channel>
</rss>