News:

OLD MEMBERS LOOKING TO RETURN, JOIN US ON DISCORD!

https://discord.gg/m8PKv7jytq

Main Menu

Recent posts

#91
Hunter / Re: Tames
Last post by Iridisia - Fri, 2011-05-27 : 00:41
Stole this from a dwarf hunter just now. He was so pissed. :D
#92
Applications / Re: Doncalmeray's application
Last post by obemathortai - Thu, 2011-05-26 : 22:06
You must have meant "does your keyboard turn?," and the answer is yes, it does, if I manually move it (unlike many of you, I did not get a motorized keyboard)

While it requires manual effort, my keyboard features a 360 degree turning radius on flat surfaces, and just this year I modded it so that I can also rotate it through the Z axis, which is really handy when it needs cleaning!
#93
Tavern / So Far I've run into 4 Whale S...
Last post by Iridisia - Thu, 2011-05-26 : 19:46
I have the best luck.
#94
Applications / Re: Mejah (Erin)
Last post by Winchcombe - Wed, 2011-05-25 : 05:58
I actually just read your "application" for the first time because your membership vote came up.  Shame on you.
#95
Applications / Re: Doncalmeray's application
Last post by Tessekai - Tue, 2011-05-24 : 18:03
Do you keyboard turn?
#96
Web Site and Ventrilo help / Re: Mumble/Murmur
Last post by Skippy - Tue, 2011-05-17 : 23:29
Mumble is great, we've been using it for arena for...probably over a year now.  Lately have had some server issues, not totally sure what that's about.  I find that the quality is a bit lower (nothing to write home about,) but the response time seems much better.
#97
Web Site and Ventrilo help / Re: Mumble/Murmur
Last post by Vitandus - Tue, 2011-05-17 : 22:12
Interesting. I am unsure I could get guildies to deal with FOSS packages, though. Ventrilo is not too bad.
#98
Web Site and Ventrilo help / Mumble/Murmur
Last post by Fleas - Tue, 2011-05-17 : 22:05
Just a suggestion Pat, if you'd rather not pay for Vent slots.

http://mumble.sourceforge.net/

Open source, low bandwidth. Up to 500 slots.

My favorite CS ZombieMod server is running this and it sounds just as good or better than Vent.
#99
Applications / Re: Doncalmeray's application
Last post by obemathortai - Tue, 2011-05-17 : 20:06
Thsnk you, thank you - for my next stupid coding trick I shall perform 'Hello World!' In the key of C and return void to show I am a hawt coder - return codes are for whimps.
#100
Applications / Re: Doncalmeray's application
Last post by Ian - Tue, 2011-05-17 : 01:12
Quote from: obemathortai on Sun, 2011-05-15 : 21:32
Please provide a perl script that will sort a CSV file by first column, then second, and then insert into a mysql database.

Sample data:


f1,f2,f3
I,am,writing a script
I,be,using perl for it
That,should,sort first by column one
That,will,sort second by column two
Finally,will,insert into the database
All,data,that it finds


Script:


#!/usr/bin/perl

use strict;
use warnings;
use DBI;
use Tie::Handle::CSV;

my $CSV_FILE = $ARGV[0] || die "$0 csv-file";

my $DSN = q{DBI:mysql:database=test;host=localhost};
my $DBH = DBI->connect($DSN, 'test', 'test', { 'RaiseError' => 1 });

my $FH = Tie::Handle::CSV->new($CSV_FILE, header => 1);

my $HASH = {};

while (my $csv = <$FH>) {

  if (! defined($HASH->{$csv->{'f1'}}->{$csv->{'f2'}})) {
    $HASH->{$csv->{'f1'}}->{$csv->{'f2'}} = [];
  }

  push(@{ $HASH->{$csv->{'f1'}}->{$csv->{'f2'}} }, $csv);

}

my $STH = $DBH->prepare( q{ INSERT INTO t1 VALUES(?, ?, ?) } )
            || die "Prepare failed: $!";

for my $f1_key (sort keys %{$HASH}) {
  for my $f2_key (sort keys %{$HASH->{$f1_key}}) {
    my @array = @{ $HASH->{$f1_key}->{$f2_key} };
    for my $line (@array) {
      $STH->execute($f1_key, $f2_key, $line);
    }
  }
}

END {
  close($FH) if defined $FH;
  $DBH->disconnect if defined $DBH;
}


MySQL output:


+---------+--------+-----------------------------------------+
| f1      | f2     | f3                                      |
+---------+--------+-----------------------------------------+
| All     | data   | All,data,"that it finds"                |
| Finally | will   | Finally,will,"insert into the database" |
| I       | am     | I,am,"writing a script"                 |
| I       | be     | I,be,"using perl for it"                |
| That    | should | That,should,"sort first by column one"  |
| That    | will   | That,will,"sort second by column two"   |
+---------+--------+-----------------------------------------+


*golf clap*