Being as the moderators don't have anything to do...

Quote:
Much easier, certainly, than putting state abbreviations in everyone's usernames.
wink.png
 
Hmmm...how could they punish Joe? Hey, I've got it! I was once on a forum where the mods could set an offending member's posts to "blabberize" - they would all suddenly appear as "blab blab blabber".

Maybe they can set all Joe's posts to "bawk bawk BAWK buk buk". That would be extremely cool.
tongue2.gif
 
I think that a very suitable punishment for Joe would be to make him listen to alternating songs by Justin Beiber and Lady Gaga for the rest of the day...or, if he LIKES Lady Gaga, by Miley Cyrus -- the earlier stuff, not the most recent album or two.
 
Botherment. Why make the mods do something that a simple program can do quite easily? My ruby skills are somewhat lacking, so I saw an opportunity to practice them. 30 mins of reading documentation and poking around in the FluxBB code, and ~10 mins of coding produced:
:

require 'mysql'

system "wget http://www.usps.com/ncsc/lookups/abbr_state.txt"

states = Array.new
abbr = Array.new

states_file = File.open 'abbr_state.txt'
counter = 0

states_file.each_line do |line|
begin
sl = line.split
if sl[2].nil?
unless sl[1].length > 2
states.push sl[0].downcase
abbr.push sl[1].downcase
end
else
if sl[3].nil?
unless sl[2].length > 2
states.push(sl[0].downcase + ' ' + sl[1].downcase)
abbr.push sl[2].downcase
end
else
unless sl[3].length > 2
states.push(sl[0].downcase + ' ' + sl[1].downcase + ' ' + sl[2].downcase)
abbr.push sl[3].downcase
end
end
end
rescue NoMethodError
end
end

states.length.times do |num|
puts "#{states[num]} : #{abbr[num]}"
end

conn = Mysql::new('localhost', 'username', 'password', 'databaseName')

res = conn.query("select username, location from users")

res.each_hash do |user|
old_username = user['username']
if not user['location'].nil?
state_abbr = nil
location = user['location'].downcase

states.length.times do |i|
if location.contains states
state_abbr = abbr
end
end

abbr.length.times do |i|
if location.contains abbr
state_abbr = abbr
end
end

if not state_abbr.nil?
new_username = old_username + state_abbr
cres = conn.query("select id from users where username='#{new_username}'")
conn.query("update users set username='#{new_username}' where username='#{old_username}'") if cres.num_rows == 0
end
end
end

conn.close
system "rm abbr_state.txt"

So many crude hacks! And the mindless code repetition... Isn't it grand?
wee.gif
 
Last edited:
Quote:
So many crude hacks! And the mindless code repetition... Isn't it grand?
wee.gif


I guess I'll know what happened if my username suddenly changes.
hide.gif
 
Quote:
Yep, along with your social security number, Visa number, and your mother's maiden name.

And, our place of birth, first pet's name, favorite pet's name, name of our maid of honor at our wedding...

yuckyuck.gif
 

New posts New threads Active threads

Back
Top Bottom