HDL

Town Square => Applications => Topic started by: Sedrin on Tue, 2009-07-28 : 03:02

Title: Mamaries application
Post by: Sedrin on Tue, 2009-07-28 : 03:02
Mamaries, DK, Dual Spec 12/0/59 (unholy) and 17/51/3 (frost), 80

Player name: Kristian Jackson

Player age: 32

Where did you hear about [HDL]? My friend IRL, Palyth, and his guild merged up with you guys.

Why do you want to join [HDL]? I am stalking Palyth.

If you are in a guild, why are you leaving? Since I spend all my time stalking Palyth I have not invested myself in a guild yet.

Will you dedicate 5 days a week to raiding? No, I need time outside of WoW to stalk Palyth IRL.

Will you dedicate 2 nights a week to raiding? I can dedicate a couple of nights to running stuff. I work overnights so I will need to be finished by 9:45pm EST. Other than that I can be around on Friday nights.

You are headed to run an instance with non-guildies when you spot a flagged gnome. What is the proper course of action: 1) Ignore the gnome and head to the instance, 2) Send a message to the guild of your find. flag immediately, and kill the gnome, leaving the PUG to wait, or 3) neither. If you selected 3, what course of action would you take? 1, you have already made a commitment to the PUG to make the run and bailing on that looks bad.

You are headed to an instance with the guild when you spot a flagged gnome. What is the proper course of action: 1) Ignore the gnome and head to the instance, 2) Send a message to the guild of your find, flag immediately, and kill the gnome, leaving the group to wait, or 3) neither. If you selected 3, what course of action would you take? 2, the guild should have your back when you engage in PvP.

A tea bag is 1) a small porous bag containing tea leaves or powdered tea, onto which boiling water is poured in order to make a drink of tea, or 2) a verb. 2, clearly.

Does .Net suck? It is good for noobs, then they learn PHP.

Whiskey or whisky? Whiskey, though who can actually read when the bottle is gone anyway?

Rank in importance to you: Raiding, Fun, PVP, Loot, Camaraderie, Wine, Women/Men, Music, Altaholism, Crafting. Women, cheesy poofs, fun, camaraderie, beer, rock band

Please provide a perl script that will sort a CSV file by first column, then second, and then insert into a mysql database.

From Perl Monks:
foreach my $this_record (sort byname @record_set) {
  # do something
}

sub byname {
  $a->{'NAME'} cmp $b->{'NAME'}

And from hotscripts:

<?php

/********************************/
/* Code at http://legend.ws/blog/tips-tricks/csv-php-mysql-import/
/* Edit the entries below to reflect the appropriate values
/********************************/
$databasehost = "localhost";
$databasename = "test";
$databasetable = "sample";
$databaseusername ="test";
$databasepassword = "";
$fieldseparator = ",";
$lineseparator = "\n";
$csvfile = "filename.csv";
/********************************/
/* Would you like to add an ampty field at the beginning of these records?
/* This is useful if you have a table with the first field being an auto_increment integer
/* and the csv file does not have such as empty field before the records.
/* Set 1 for yes and 0 for no. ATTENTION: don't set to 1 if you are not sure.
/* This can dump data in the wrong fields if this extra field does not exist in the table
/********************************/
$addauto = 0;
/********************************/
/* Would you like to save the mysql queries in a file? If yes set $save to 1.
/* Permission on the file should be set to 777. Either upload a sample file through ftp and
/* change the permissions, or execute at the prompt: touch output.sql && chmod 777 output.sql
/********************************/
$save = 1;
$outputfile = "output.sql";
/********************************/


if(!file_exists($csvfile)) {
   echo "File not found. Make sure you specified the correct path.\n";
   exit;
}

$file = fopen($csvfile,"r");

if(!$file) {
   echo "Error opening data file.\n";
   exit;
}

$size = filesize($csvfile);

if(!$size) {
   echo "File is empty.\n";
   exit;
}

$csvcontent = fread($file,$size);

fclose($file);

$con = @mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
@mysql_select_db($databasename) or die(mysql_error());

$lines = 0;
$queries = "";
$linearray = array();

foreach(split($lineseparator,$csvcontent) as $line) {

   $lines++;

   $line = trim($line," \t");
   
   $line = str_replace("\r","",$line);
   
   /************************************
   This line escapes the special character. remove it if entries are already escaped in the csv file
   ************************************/
   $line = str_replace("'","\'",$line);
   /*************************************/
   
   $linearray = explode($fieldseparator,$line);
   
   $linemysql = implode("','",$linearray);
   
   if($addauto)
      $query = "insert into $databasetable values('','$linemysql');";
   else
      $query = "insert into $databasetable values('$linemysql');";
   
   $queries .= $query . "\n";

   @mysql_query($query);
}

@mysql_close($con);

if($save) {
   
   if(!is_writable($outputfile)) {
      echo "File is not writable, check permissions.\n";
   }
   
   else {
      $file2 = fopen($outputfile,"w");
      
      if(!$file2) {
         echo "Error writing to the output file.\n";
      }
      else {
         fwrite($file2,$queries);
         fclose($file2);
      }
   }
   
}

echo "Found a total of $lines records in this csv file.\n";


?>

Can you follow kill order? Kill order? I am a DK, we just drop everything all at once.

We do require Omen and Deadly Boss Mods. Do you have these installed? I have DBM installed and can grab Omen, when I remember to do so.

Are you aware the [HDL] is largely a collection of angry and cynical players and under-geared toons? Yes.

Really? Why do you still want to join [HDL] Well basically I have taken the time to play my DK a bit and I understand that you aren't exactly looking for melee DPS which works since I am not exactly looking to have people run me through stuff. I am ok only having a spot occasionally as long as you are ok with me only being around occasionally.
Title: Re: Mamaries application
Post by: flambe on Tue, 2009-07-28 : 07:33
This is full of win.

Find an officer in game.
Vitandus
Nemhain
Kellanon
Flambe
Aarrgh
Hpv
Tessekai
Tesselyth
Capuloclavo
Title: Re: Mamaries application
Post by: Capuloclavo on Tue, 2009-07-28 : 18:04
Awesome! It's about time we got another casual player. 
Title: Re: Mamaries application
Post by: flambe on Tue, 2009-07-28 : 22:19
Invited 7/28/09