tag:blogger.com,1999:blog-7583720.post6635855855750337823..comments2024-03-05T03:17:02.289-08:00Comments on Salmon Run: Building a Tag Cloud with PythonSujit Palhttp://www.blogger.com/profile/06835223352394332155noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-7583720.post-69841149805956952372010-01-21T15:13:14.026-08:002010-01-21T15:13:14.026-08:00Thanks Uday, and you are welcome.Thanks Uday, and you are welcome.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-87823102945944166042010-01-12T16:24:02.064-08:002010-01-12T16:24:02.064-08:00Thanks Sujit, your code was very helpful.Thanks Sujit, your code was very helpful.Udaynoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-12455489047762259792009-10-17T16:37:22.746-07:002009-10-17T16:37:22.746-07:00Yes, I will, as soon as I have some time...Yes, I will, as soon as I have some time...Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-70650007384155516032009-10-03T21:59:25.971-07:002009-10-03T21:59:25.971-07:00Can you post the final code with the above mention...Can you post the final code with the above mentioned changes? ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-19111173423928046852009-09-18T23:39:32.952-07:002009-09-18T23:39:32.952-07:00Thanks AJ...I don't have a need for this right...Thanks AJ...I don't have a need for this right now, but this is good to know if I rebuild the code.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-24338229689181342592009-09-18T00:23:50.705-07:002009-09-18T00:23:50.705-07:00An improvement (I think) to KC Leong's fix for...An improvement (I think) to KC Leong's fix for filling in blank ranges; it handles situations where you may want more/less than 5 ranges.<br /><br />if len(ranges) < parts:<br /> missing = parts - len(ranges)<br /> front = int(round(missing / 2.0))<br /> end = int(missing - front)<br /> for i in range(0,front):<br /> ranges.insert(0,(-1,-1))<br /> if end > 0:<br /> for i in Jumandhttps://www.blogger.com/profile/14218160558414517204noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-12200959540375322672009-05-16T10:20:00.000-07:002009-05-16T10:20:00.000-07:00@KC Leong: Thank you for the fix...my initial setu...@KC Leong: Thank you for the fix...my initial setup was to break them up into 5 discrete sets and size them accordingly, that design decision must have leaked through here :-).<br /><br />@Anonymous: Yes, the tags.txt is a pipe separated tuple of (tagname|count). You should incorporate Derick's and KC Leong's changes too.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-20841446784565343112009-05-10T10:17:00.000-07:002009-05-10T10:17:00.000-07:00This looks really cool but I cannot get it going, ...This looks really cool but I cannot get it going, could you please let me know, what kind of format the tags.txt should be?<br />Like is it a list of tuples etc.?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-12501649105572486932009-05-09T16:30:00.000-07:002009-05-09T16:30:00.000-07:00This tagcloud algorithm works great but the ranges...This tagcloud algorithm works great but the ranges get messed up with some min - max tags. Example; if you got min=1, max=7 the ranges list is 7 (too large).<br /><br />Each ranges list must not have a biggger len than 5 or the writeCloud goes wrong. I've added the following adjustments so the ranges are correct.<br /><br />distrib = (maxcount - mincount) / float(parts-1);<br />distrib = int(KC Leonghttp://www.leong.nlnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-17715754437136062342007-05-13T09:40:00.000-07:002007-05-13T09:40:00.000-07:00Hi Derick,Thanks very much for the fix. BTW, I lik...Hi Derick,<BR/><BR/>Thanks very much for the fix. BTW, I liked the comment in your blog about a "real python programmer" :-).<BR/><BR/>-sujitSujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-31762980616678720192007-05-12T09:55:00.000-07:002007-05-12T09:55:00.000-07:00This is a great script, but if the difference betw...This is a great script, but if the difference between maxcount and mincount (line 30) is less than 4, it ends up in an infinite loop since distrib rounds to 0.<BR/><BR/>I added line 31+32:<BR/><BR/> if (distrib == 0):<BR/> distrib = 1<BR/><BR/>which fixes the problem.Anonymousnoreply@blogger.com