News:

OLD MEMBERS LOOKING TO RETURN, JOIN US ON DISCORD!

https://discord.gg/m8PKv7jytq

Main Menu

Avaia's App

Started by Avaia, Sun, 2008-12-21 : 21:02

Previous topic - Next topic

Avaia

Character name(s), class(s), and level(s)
Avaia, Level 80 Death Knight

Player name (We operate on a first name basis in HDL)
David

Player age - [HDL] guild and Ventrilo chatter is for mature audiences only.
27

Where did you hear about [HDL]?
Ran Heroic VH with them on 12/21

Why do you want to join [HDL]?
Because you guys seem like a fun and cool crowd.

Will you dedicate 5 days a week to raiding?
no

If you answered ""Yes" to the question above, are you aware that [HDL] is not a hard core raiding guild?

Will you dedicate 2 nights a week to raiding?
yes

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 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?
1

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.
1 and 2

Does .Net suck?
no, i use it at work

Whiskey or whisky?
whiskey

Rank in importance to you: Raiding, Fun, PVP, Loot, Camaraderie, Wine, Women/Men, Music, Altaholism, Crafting.
Fun, camaraderie, raiding, PvP

Please provide a perl script that will sort a CSV file by first column, then second, and then insert into a mysql database.
My SQL knowledge is slightly limited

Can you follow kill order?
yes, most definatly

We do require Omen and Deadly Boss Mods. Do you have these installed?
yes, and many more mods

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]
For the reason stated above :)

Ethics

ran HVH partly with us, we screwed the pooch and rick quit the group to go jerk of with teriyaki sauce. he deffinatly seemed like someone who could fit in with us.



P.S. RICKROLL!!!!

rhaenyn

lol well if he went thru a fail pug and still wanted to join that is a plus :) Teriyaki and horse lol ...

Avaia

#3
after tinkering around with perl for a bit, I have come up with a solution to yer really odd question.   :)

use strict;

open( CSV, "part_info.csv") ¦¦ die "Open file failed!\n";
my @lines_in_csv = <CSV>;
close( CSV);

my $parts;
foreach( @lines_in_csv) {
    my ( $part, $categories) = split( /,/);
    $parts -> {$part} = [ split( /\s/, $categories)];
}

foreach my $partno ( sort keys( %$parts)) {
    foreach my $category ( sort @{ $parts -> {$partno}}) {

    ## Now you can do something with $partno and $category
    ## $partno is your original part number
    ## $category will change each time singularly while $partno stays the same

        print "$partno - $category\n";
    }
}

I've added a bit at the top that reads the CSV file called part_info.csv.

I have added a sorting command, so the output is in logical order, instead of Perl's 'how I feel like it' way.
Also added a print line so you can see the output.

My test CSV contained:
part1,cat1 cat2 cat3
part2,cat4
part3,cat2 cat4 cat5

And the output is:
part1 - cat1
part1 - cat2
part1 - cat3
part2 - cat4
part3 - cat2
part3 - cat4
part3 - cat5

Please tell me I got it the right way around this time!

If you run it from a command prompt you'll see that it works.


Ethics

he      researched      an       app         question






invite him now.

Avaia

i tried my research, and perl became quite messed up(characters not looking right, stuff out of place.) so i tinkered around myself and tried the above script and it worked.  I editted my previous response to reflect the better script.  ;)

Vitandus

Your choice of whiskey over whisky edges out the incorrect response on .Net. Look for a member in-game for an invite.

Carmencita

i love him already  ;D




flambe

WTF... another David!

Not like it's a common name!

Dave!

Avaia

that shows its the best name ever!

flambe