|
Joined: Feb 2000
Posts: 4,625
Member
|
Member
Joined: Feb 2000
Posts: 4,625 |
sub KillServer { #used for the announcements my $StartDate = shift; my $EndDate = shift;
#convert dates to Julian dates my $StartMonth = substr($StartDate, 0, 2); my $StartDay = substr($StartDate, 2, 2); my $StartYear = substr($StartDate, 4, 4); my $EndMonth = substr($EndDate, 0, 2); my $EndDay = substr($EndDate, 2, 2); my $EndYear = substr($EndDate, 4, 4);
------------------ UBBDEV Moderator OCCUPATION: Programmer, webmaster.
Hack Developer of the Ultimate Bulletin Board. I am not an employee of Infopop
Due to time limitation, I do not offer support Via. E-mail. Please post on the forums.
Sincerely, MasterMind
|
|
|
|
Joined: May 2000
Posts: 243
Member
|
Member
Joined: May 2000
Posts: 243 |
Actually, I think that is as small as it will get. Maybe Mark can work something up, but if so it's something I haven't learned yet. ------------------ Powered by ZCom Bulletin Boards
|
|
|
|
Joined: Oct 2000
Posts: 38
Member
|
Member
Joined: Oct 2000
Posts: 38 |
You can replace this: my $StartDate = shift; my $EndDate = shift; With this: my ($StartDate, $EndDate) = @_; I don't know about the rest. ------------------ Wartortle
I'm supposed to put somthin here?
Wartortle I'm supposed to put somthin here?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Whoops! How'd I miss this thread?? How's this for smaller? Time the original vs the smaller version: Benchmark: timing 10000 iterations of Original, Smaller... Original: 2 wallclock secs ( 2.66 usr + 0.00 sys = 2.66 CPU) @ 3753.75/s (n=10000) Smaller: 1 wallclock secs ( 0.88 usr + 0.00 sys = 0.88 CPU) @ 11350.74/s (n=10000) Remember, the CPU time is the important stat, not the wallclock seconds --mark This message has been edited by Mark Badolato on November 19, 2000 at 01:34 AM
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Aw hell, it can be dropped to about 0.55 CPU by changing to: See, always something to tweak! New benchmark: Benchmark: timing 10000 iterations of Original, Smaller... Original: 3 wallclock secs ( 2.61 usr + 0.00 sys = 2.61 CPU) @ 3827.02/s (n=10000) Smaller: 1 wallclock secs ( 0.54 usr + 0.00 sys = 0.54 CPU) @ 18552.88/s (n=10000) --mark This message has been edited by Mark Badolato on November 19, 2000 at 01:14 PM
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Sep 2000
Posts: 1,304
Addict
|
Addict
Joined: Sep 2000
Posts: 1,304 |
Where do you even edit this?
------------------ The Fusion of Goku & Trunks...GoTorankusuKu
|
|
|
|
Joined: May 2000
Posts: 243
Member
|
Member
Joined: May 2000
Posts: 243 |
damn, they weren't kidding when they said you learn something new everyday
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Heh yup. Hell I still learn new perl stuff all the time too. The trick though is to keep on searching, and researching, and learning. Read everything you can, experiment, watch what the knowledgable people do etc.
It takes practice! The above code change I did compared to the original is like 89% less code, and runs 400% faster then the original. I didn't learn how to that kind of stuff in a day. It took lots of dedication to the craft, and lots of watching what the real Perl gurus. But who knows, some of the gurus could come along and shrink that even further...
I recommend that anyone who wants to get serious, get a newsreader, connect to Usenet and follow along at comp.lang.perl.misc (warning, do a LOT of lurking there before even thinking about posting. The group has no tolerence for newbies asking FAQ's or not doing basic research on their own). I can't tell you how much I've learned from reading that group daily.
--mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: May 2000
Posts: 243
Member
|
Member
Joined: May 2000
Posts: 243 |
So Mark. Where can I get some of your scripts eh? ------------------ Powered by ZCom Bulletin Boards
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
Ya can't. I don't have any that are publicly released, save for a stupid clock script that i put on hotscripts and cgi-resources once just to see what kind of traffic the sites generate Someday when I actually have some of that free time thing I've heard so much about, I'd like to finish the UGB 2.0, which we was started back in april and hasn't been touched since July But, all of my other stuff has been private contract work, or my job. --mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
damn jobs ------------------ Da Wannabe Cannuck:: Who is Andy?
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
yeah i know huh? having to work to pay bills --mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 449
Joined: February 2008
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|