News for hackers. Stuff that matters.
Re:Generating domain names using Markov Chains by kanny96 on Monday October 20, 2008 @08:16AM (#337800)
The new Web 2.0-esqe (or dare i say Web 3.0-esqe) nomenclature is dominated by "double-vowels" (Wii, xumii, mobee) or "vowel-combos" (cuil) not often found in normal english. So this approach will not succeed in giving you a really innovative name. Probably you need to perturb the Markov-chain to achieve that or waste a lot of free time digging your cognitive faculty!
Re:Generating domain names using Markov Chains by opal on Monday October 20, 2008 @01:10PM (#338059)
But those names suck.
Re:Generating domain names using Markov Chains by rudyfink on Monday October 20, 2008 @04:14PM (#338267)
Yeah, but you have to remember that those names will affect the perception of similar names. The Wii, for example, being a monster hit is going to affect the way people perceive names.
Re:Generating domain names using Markov Chains by ntoshev on Monday October 20, 2008 @12:06PM (#337981)
You could train the Markov chain specifically on all registered domains. And weight by recency, if you want to be trendy.
Re:Generating domain names using Markov Chains by eru on Tuesday October 21, 2008 @05:04AM (#338783)
This approach won't give you a name like anyone else is using, so it's not an innovative name?
Re:Generating domain names using Markov Chains by jbyers on Sunday October 19, 2008 @10:52PM (#337525)
"Chattly.com Beat you to it"

Registered 10/19. Nice. :)

Re:Generating domain names using Markov Chains by jwilliams on Sunday October 19, 2008 @08:21PM (#337424)
As an aside - Markov Chains are a key tool in Bioinformatics (Hidden Markov Models).
Re:Generating domain names using Markov Chains by callmeed on Monday October 20, 2008 @01:20PM (#338070)
Very cool ... but I don't want the code, I just want a web app to generate names for me (and check that the domain is available, of course).

C'mon, where's markovr.com?

Re:Generating domain names using Markov Chains by mseebach on Monday October 20, 2008 @07:33PM (#338443)
I used the tool to make the name markovable, got the domain and made this: http://www.markovable.net
Re:Generating domain names using Markov Chains by marketer on Tuesday October 21, 2008 @12:46AM (#338668)
Keep that site up :) It's a great tool.
Re:Generating domain names using Markov Chains by wmf on Monday October 20, 2008 @06:31PM (#338398)
I think you mean a web app to generate names and squat them. :-)
Re:Generating domain names using Markov Chains by jbyers on Sunday October 19, 2008 @10:48PM (#337520)
All this script needs is the bulk-whois gateway on the other end. But seriously, anyone know of a whois service who allows free high-volume lookups?
Re:Generating domain names using Markov Chains by there on Monday October 20, 2008 @11:17AM (#337935)
don't bother with whois; query the root/gtld nameservers for a valid NS record for the domain to see if it's registered. dns is much quicker and nobody's going to shut you down for using it.
Re:Generating domain names using Markov Chains by ntoshev on Monday October 20, 2008 @05:18AM (#337716)
You can subscribe to receive daily a list of all registered .com/.net/.org domains, from the registrar.
Re:Generating domain names using Markov Chains by codeismightier on Sunday October 19, 2008 @11:03PM (#337532)
You guys killed my server! (256 slice) I can't even ssh into it now!
Re:Generating domain names using Markov Chains by henning on Sunday October 19, 2008 @11:07PM (#337544)
I bet it was the downloading of that dictionary file.
Re:Generating domain names using Markov Chains by gduffy on Monday October 20, 2008 @12:58AM (#337611)
Does the web console (at manage.slicehost.com) still work?
Re:Generating domain names using Markov Chains by codeismightier on Monday October 20, 2008 @01:56AM (#337648)
Yep. Thanks for the suggestion. After I logged in I realized that Apache was basically in an infinite loop where it kept trying to create new child processes but those where instantly being killed because of a lack of memory. After a hard reset it seems to be working now.
Re:Generating domain names using Markov Chains by vaksel on Sunday October 19, 2008 @10:10PM (#337486)
someone should make this a web app.
Re:Generating domain names using Markov Chains by kingkongrevenge on Sunday October 19, 2008 @10:27PM (#337499)
Silly python people always writing lots of code. This should be, like, 15 lines.

http://search.cpan.org/~rclamp/Algorithm-MarkovChain-0.06/li...

Re:Generating domain names using Markov Chains by ntoshev on Monday October 20, 2008 @05:04AM (#337712)
Funny I did a similar thing recently, specifically for domain names. The code to train a Markov chain (without using any libraries outside standard Python) is this:

  import re, collections
  from itertools import *
  
  def words(text):
      return (w.group() for w in re.finditer(r"\w+", text.lower()) if w.group().isalpha())
  
  F=collections.defaultdict(lambda:collections.defaultdict(lambda:1))
  
  M = 5
  
  def add_spaces(word):
      return ' ' * M  + word.strip() + ' ' * M
  
  N = 0
  
  from operator import add
  def train(words):
      for word in words:
          w = add_spaces(word)
          for i in range(len(w)-M):
              F[w[i:i+M]][w[i+M]] += 1
      global N
      N = reduce(add,(n for d in F.itervalues() for n in d.itervalues()))
  
  train(words(file('big.txt').read()))
Then, I tried to measure how "good" a particular word is (experimenting with different measures):

  from math import log
  def goodness(word):
      w = add_spaces(word)
      res = 0
      for i in range(len(w)-M):
          res += F[w[i:i+M]][w[i+M]]
  #        res += log(F[w[i:i+M]][w[i+M]])
      global N
      return float(res) / ((len(w)-M)*N)
  
  print 'test score:', reduce(add, (goodness(w) for w in words(file('test.txt').read())))
Then, tried to find the top N words at less than 2 edits distance:

  alphabet = 'abcdefghijklmnopqrstuvwxyz'
  
  import types
  def edits1(word):
      if type(word)==types.StringType:
          n = len(word)
          return set(chain((word[0:i]+word[i+1:] for i in range(n)),                     # deletion
                     (word[0:i]+word[i+1]+word[i]+word[i+2:] for i in range(n-1)), # transposition
                     (word[0:i]+c+word[i+1:] for i in range(n) for c in alphabet), # alteration
                     (word[0:i]+c+word[i:] for i in range(n+1) for c in alphabet)))  # insertion
      else: #Assume word is actualy an iterable of words
          return set(reduce(chain,(edits1(e) for e in word)))
  
  def edits2(word):
      return edits1(edits1(word))

  def topn(n, word):
      words = [(x, goodness(x)) for x in edits2(word)]
      words.sort(cmp = lambda x,y: -cmp(x[1],y[1]))
      return words[:n]

I have borrowed some code from Peter Norvig's spelling checker, and the style is very much influenced by it.
Re:Generating domain names using Markov Chains by ashleyw on Sunday October 19, 2008 @10:38PM (#337509)
It'd be nice to include the actual library:

http://search.cpan.org/src/RCLAMP/Algorithm-MarkovChain-0.06...

…so, 165+15 = 180 lines total?

Re:Generating domain names using Markov Chains by kingkongrevenge on Sunday October 19, 2008 @11:14PM (#337551)
Try closer to something like 800 lines in the library. It comes with demos, a test suite, etc. And I think you're skipping the base class in your naive count.

I'm not really sure how the line count of a library is relevant to anything?

Re:Generating domain names using Markov Chains by schtog on Sunday October 19, 2008 @11:38PM (#337565)
For pretty obvious reasons?

  import generating-domain-names as gds

  print gds.genName()
2 lines of code to do Markov-chain-generating doaminnames!
Re:Generating domain names using Markov Chains by codeismightier on Monday October 20, 2008 @02:05AM (#337652)
I just deleted some dead code left from debugging and now it's a few lines shorter.