Forum Settings
       
Reply To Thread

702 ftw!Follow

#1 Jan 18 2006 at 3:52 PM Rating: Decent
I'm BOMA (Bored Off My ***) at work and just curious how many on the server from my area... sooo... how many from the 702? 213? 310? 562? 714? 818? 909?
#2 Jan 18 2006 at 4:06 PM Rating: Decent
Scholar
****
6,631 posts
Help me with my Fortran code if you are bored :O! Or teach me how to write csh scripts instead of me recycling and cut and paste parts of other's script XD
____________________________
Amanada (Cerberus-Retired) (aka MaiNoKen/Steven)
-- Thank you for the fun times in Vana'diel

Art for the sake of art itself is an idle sentence.
Art for the sake of truth, for the sake of what is
beautiful and good — that is the creed I seek.
- George Sand

A designer knows he has achieved perfection,
not when there is nothing left to add,
but when there is nothing left to take away.
- Antoine de Saint-Exupéry
#3 Jan 18 2006 at 4:10 PM Rating: Decent
Fortran (You can have this.)
.csh (I don't understand.)

PHP (Yes, please.)
PERL (Thank You.)
mySQL (excitement)

(fun)
#4 Jan 18 2006 at 4:15 PM Rating: Decent
Scholar
****
6,631 posts
Real world IT is so different with academia. Try to speak Perl or Java to my boss, he won't understand. Heh even I do not understand if you speak me that way hahahah.

Too bad I am stuck with Fortan 90 and 77. Lucky you! Nebz!

/em goes back to read Fortran code.
____________________________
Amanada (Cerberus-Retired) (aka MaiNoKen/Steven)
-- Thank you for the fun times in Vana'diel

Art for the sake of art itself is an idle sentence.
Art for the sake of truth, for the sake of what is
beautiful and good — that is the creed I seek.
- George Sand

A designer knows he has achieved perfection,
not when there is nothing left to add,
but when there is nothing left to take away.
- Antoine de Saint-Exupéry
#5 Jan 18 2006 at 4:48 PM Rating: Decent
acamedia? I take offense to that good sir whm!

I've never gone to school for my programming... unless you count my Comp Sci II elective in my senior year of high school... but even that was more of a job if anything since I would sell coded programs to other students who'd put their name on the work. >:P

I use php, perl and mySQL at my current job... try speaking Fortran in this office and you'll find youself back on the street before you can finish saying 90 or 77. :p

print ("Please specify which code you'd like me to write: ");
my @code = qw/php perl mySQL/;
my $language = <STDIN>;
my $a = 0;

while ($a < 3) {
   if (@code[$a] != $language) {
      print ("I'm sorry, I don't understand $language.");
   } else {
      print ("I'd be delighted to write some $language for you.");
   }
   $a++;
}

Edited, Wed Jan 18 16:53:38 2006 by ElvaanKrem
#6 Jan 18 2006 at 4:59 PM Rating: Decent
Scholar
****
6,631 posts
Quote:
acamedia? I take offense to that good sir whm!


I am Black Mage now >:O BLM is so fun. I am gonna Thunderga III up Fortran ***.

Quote:
I've never gone to school for my programming... unless you count my Comp Sci II elective in my senior year of high school... but even that was more of a job if anything since I would sell coded programs to other students who'd put their name on the work. >:P


I have never taken a computer course since I left high school too. The curse of Fortran to me begins on my last year in my undergraduate program (like 7 years ago) and continue today... Fortran is one good stalker.
____________________________
Amanada (Cerberus-Retired) (aka MaiNoKen/Steven)
-- Thank you for the fun times in Vana'diel

Art for the sake of art itself is an idle sentence.
Art for the sake of truth, for the sake of what is
beautiful and good — that is the creed I seek.
- George Sand

A designer knows he has achieved perfection,
not when there is nothing left to add,
but when there is nothing left to take away.
- Antoine de Saint-Exupéry
#7 Jan 19 2006 at 12:58 AM Rating: Good
Krem, I couldn't help but be a stickler and correct your Perl code for you. I hope you can forgive me, but s/w dev is what I do for a living, and Perl is a language we use extensively at our company. Please take this in the jest in which it is offered.

use strict; 
use warnings; 
print "Please specify which code you'd like me to write: "; 
my $lang = <>; chomp($lang); 
my $hit = 0; 
foreach (qw{php perl mysql}) 
{ 
    $hit = 1 if $lang eq $_; 
} 
print $hit 
    ? "I'd be delighted to write $lang for you." 
    : "I'm sorry, I don't understand $lang." 
    , "\n"; 


You forgot to include the strict and warnings pragmas. Perl code can't be considered "tested" until it has run correctly with those pragmas turned on.

"@code[$a]" is incorrect. By using an index, you're implying a scalar context. While @ is used to denote an array variable, you're not actually requesting the array, you're requesting a scalar from that array, thus you need to refer to it as a scalar: $code[$a]. The only instances where you would keep the @ identifier would be if you are extracting (and expanding) an array reference which happens to be stored in the @code array at index $a, but then your notation would need to be @{$code[$a]} (or optionally without the braces as @$code[$a], but I'm not personally fond of that style).

By doing your print() inside the loop, you would end up with 3 lines of output. In the case where they input a language in your approved list, then the user would see one line saying you're delighted to use that language, and two lines saying you don't understand other languages they didn't even type. If they input a language not present in your approved list, then they see three lines of output each stating you don't understand a language, none of which may even be close to what they typed.

When you read from stdin, you also read in the newline character. Without chomp/chop()ing it first, it won't matter what they type, you won't match any of your languages against it. Also, specifying the stdin filehandle explicitly is often optional. "<>" will default to stdin until you change your active filehandle. It doesn't hurt to be explicit about it, though, especially if you have code dealing directly with a lot of files.

!= is a numeric "not" comparison. While Perl can internally treat strings as numbers (and this comes in handy when you want to do really weird things), it would be much clearer and safer to use the string comparion operators: eq (equivalent), ne (not equivalent).

Worst of all, you forgot to print a newline after your output. This is a terrible, unforgivable thing, as it leaves the user's shell prompt on the same line as your output! Tsk tsk.

I will commend you on at least explicitly defining and scoping all your variables. Gold star for that.

And if I made any typo or mistake in my revision of your code, you have every reason to tear me a new one. :)

Edited, Thu Jan 19 01:04:03 2006 by galkagoby

Edited, Thu Jan 19 01:43:02 2006 by galkagoby
#8 Jan 19 2006 at 10:58 AM Rating: Decent
Scholar
****
6,631 posts
Owned

;)

Add: Too bad I do not understand what you two talking about anyway XDDDD

Going back to my small world of Fortran.

Amanada readies Hexa Strike on Fortran.
Amanada begin casting Thunderga III on Fortran.


Edited, Thu Jan 19 11:04:28 2006 by scchan
____________________________
Amanada (Cerberus-Retired) (aka MaiNoKen/Steven)
-- Thank you for the fun times in Vana'diel

Art for the sake of art itself is an idle sentence.
Art for the sake of truth, for the sake of what is
beautiful and good — that is the creed I seek.
- George Sand

A designer knows he has achieved perfection,
not when there is nothing left to add,
but when there is nothing left to take away.
- Antoine de Saint-Exupéry
#9 Jan 19 2006 at 1:09 PM Rating: Decent
damn... knew I shoulda stuck with PHP... but I need to learn PERL still anywho... as for the warnings and strict, ya... I know they're supposed to be there... which is why I left them out of my script excerpt. I can't believe I put the print statement inside the while loop tho... omg what was I on?!?
#10 Jan 19 2006 at 4:11 PM Rating: Decent
*
80 posts
Erm....back to the original topic....


*waves hi from the 818 (work), and 626 (home)*

You going to the Fan Festival thing?
#11 Jan 19 2006 at 4:48 PM Rating: Decent
Wish I could... but I am in 702 now...

Used to live back in the so cal area codes long ago... still go back from time to time to say hi to old friends.
#12 Jan 19 2006 at 4:53 PM Rating: Decent
Scholar
****
6,631 posts
I did not understand what those numbers mean until now... I was thinking server population @_@;;; I live in 301, even with a private jet it will take 4 hours to get to those area codes Nebz are in ;)
____________________________
Amanada (Cerberus-Retired) (aka MaiNoKen/Steven)
-- Thank you for the fun times in Vana'diel

Art for the sake of art itself is an idle sentence.
Art for the sake of truth, for the sake of what is
beautiful and good — that is the creed I seek.
- George Sand

A designer knows he has achieved perfection,
not when there is nothing left to add,
but when there is nothing left to take away.
- Antoine de Saint-Exupéry
#13 Jan 19 2006 at 6:35 PM Rating: Decent
*
80 posts
Quote:
Wish I could... but I am in 702 now...


Oh, Puh-leeese. It's not a long drive, and an even shorter flight. And you *know* your friends will let you crash on their sofages.

Come *on*!!!!!!! You know you want to....
#14 Jan 22 2006 at 11:39 PM Rating: Decent
****
4,475 posts
Don't make me whip out my CSS knowledge.

And I'm 912.

Edited, Sun Jan 22 23:40:05 2006 by Zaleshea
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 4 All times are in CST
Anonymous Guests (4)