lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Asko Kauppi wrote:
Well, not quite. :)
My current Perl work may have a bright ending, after all. :)
In short, Lua Saves Electricity! :)
It jumps around. :)

If Lua is nothing else, it is a friendly community -- it has the highest number of emoticons of any group I think I've seen. This lead me to wonder who are the emoticon leaders. From the Lua mailing list archive:

  Name                               Posts  Total :)    ;)   :(  ;(
  Asko Kauppi <asko.kauppi@sci.fi>   528    317   240   72   5   0
  PA <petite.abeille@gmail.com>      435    213   208   2    3   0
  Rici Lake <lua@ricilake.net>       469    155   145   4    5   1
  Asko Kauppi <askok@dna...tnet.net> 162    128   102   24   2   0
  Roberto Ierusalimschy <rob...o.br> 1338   127   78    32   17  0
  "Adam D. Moss" <adam@gimp.org>     334    92    84    6    2   0
  Diego Nehab <diego@tecg...rio.br>  404    88    87    1    0   0
  RLake@oxfam.org.pe                 199    61    49    5    4   3
  skaller <skaller@users...rge.net>  128    50    45    0    5   0
  Romulo Bahiense <rom...ler.com.br> 88     46    34    8    4   0
  RLake@oxfam.org.uk                 190    42    41    1    0   0
  Edgar Toernig <froese@gmx.de>      410    39    3     36   0   0
  roberto@inf.puc-rio.br (Ro...mschy)144    35    26    7    2   0
  jdarling@eonclash.com              50     33    27    0    6   0
  lua-bounces@ba...onectiva.com.br   417    32    19    10   3   0
  Asko Kauppi <Asko.Kauppi@fi....om> 47     31    23    8    0   0
  Daniel Silverstone <dsilve...org>  225    31    27    0    4   0
  Ariel Manzur <listas@anime.com.ar> 62     26    17    5    4   0
  Lisa Parratt <lisa@theco...org.uk> 127    26    13    10   2   1
  askok@dnainternet.net              24     25    23    2    0   0

Impressive that Asko makes the top 20 four times.

------
local smiles={}
local f = io.open("lua-l-archive", "r")
local l, user, s, curr

while true do
	l = f:read("*line")
	if not l then break end

	user = string.match( l, "^From:%s+(.+)")
	if user then
		curr = smiles[user] or {['posts']=0, ['totals']=0}
		curr['posts'] = curr['posts'] + 1
		smiles[user] = curr
	end
	
	s = string.match( l, "([:;][%)%(])")
	if s and not string.match(l, ">") then
		curr[s] = (curr[s] or 0) + 1
		curr['totals'] = curr['totals'] + 1
	end
end

function pairsBy(t, f)
	local a, i = {}, 0
	for n in pairs(t) do a[#a + 1] = n end
	table.sort(a, f)
	return function()
		i = i + 1
		return a[i], t[a[i]]
	end
end

function byTotals(na,nb)
	local a, b = smiles[na], smiles[nb]
	return a['totals'] > b['totals']
end

for k,v in pairsBy(smiles, byTotals) do
	local a,b,c,d = v[':)'] or 0, v[';)'] or 0, v[':('] or 0, v[';('] or 0
	local p, t = v['posts'], v['totals']
	if t > 0 then
		print( k, p, t, a,b,c,d )
	end
end