<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>fandaal</title>
  <link>https://fandaal.dreamwidth.org/</link>
  <description>fandaal - Dreamwidth Studios</description>
  <lastBuildDate>Thu, 28 Jul 2011 17:26:08 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>fandaal</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/791853/763339</url>
    <title>fandaal</title>
    <link>https://fandaal.dreamwidth.org/</link>
    <width>100</width>
    <height>96</height>
  </image>

<item>
  <guid isPermaLink='true'>https://fandaal.dreamwidth.org/2461422.html</guid>
  <pubDate>Thu, 28 Jul 2011 17:26:08 GMT</pubDate>
  <link>https://fandaal.dreamwidth.org/2461422.html</link>
  <description>ну вот и пригождается этот блог.&lt;br /&gt;жж висит с переменным успехом уже долго..&lt;br /&gt;&lt;pre&gt;
#classification
import math
class Predmet:
    def __init__():
        return
class Category(Predmet):
    pass
def Proto():#cathegory prototype calculation
    return
def Exemplar(m,n):#n is number of attributes, m is a range of attribute
    import random
    a=[]
    for i in range(n):
        a.append(random.randint(0,m))
    return a
def Distance(d,f):#calculates the distance between 2 exemplars
    dis=0
    for i in range(len(d)-1):
        dlin=(d[i]-f[i])*(d[i]-f[i])
        dis=dis+dlin
    return math.sqrt(dis)
def AverageDis(vid):
    aw=0
    for i in range(len(vid)-1):
        aw=aw+Distance(vid[i],vid[i+1])
    return aw/(len(vid))
        
c=3
cat=[]
klas=[]
while c&amp;gt;0:
    b=Exemplar(5,10)
    print(b)
    c=input()
    c=int(c)
    if c==1:
        cat.append(b)
    if c==2:
            klas.append(b)
print(&apos;first category&apos;)
print(cat)
print(&apos;second category&apos;)
print(klas)
print(&apos;distances between first category first two objects&apos;)
print(Distance(cat[0],cat[1]))
print(&apos;Average distances between 1 cat objects&apos;)

    
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=fandaal&amp;ditemid=2461422&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://fandaal.dreamwidth.org/2461422.html</comments>
  <category>python</category>
  <category>code</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
