Please login or register.

Login with username, password and session length
Advanced search  

News:

Hydroponic seltzer clams.

Pages: [1] 2   Go Down

Author Topic: I need a simple program  (Read 5300 times)

0 Members and 1 Guest are viewing this topic.

AugustWest

  • Over Easy
  • Philosopher King
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 774
  • Offline Offline
  • Gender: Male
  • Posts: 10549
  • Bulbous, also tapered.
    • View Profile
I need a simple program
« on: April 23, 2006, 02:39:11 am »

To do something simple.

I'd like to create a text file, or csv file, or whatever, that consists of a list of phrases or sentences.  The program would then select and display a random one from the list when I asked it to.

Anybody know a simple way to do this?
Logged
Infinitely vast, infinitely detailed.

acoxcae

  • Todd
  • Tiny cans of Dr Pepper: 1
  • Offline Offline
  • Gender: Male
  • Posts: 314
  • Because I don't have one. Never have.
    • View Profile
    • My Blog
Re: I need a simple program
« Reply #1 on: April 23, 2006, 03:59:14 am »

Sure.  Like, for a web page, or what?  Any particular language?

I could do something like this in Perl in about 1.5 seconds.  It'd take almost a minute if it had to be web-enabled.

Any particular format for the input file?
Logged
this new board has a shitload of buttons.

why are there no zippers?
-thanks ark

AugustWest

  • Over Easy
  • Philosopher King
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 774
  • Offline Offline
  • Gender: Male
  • Posts: 10549
  • Bulbous, also tapered.
    • View Profile
Re: I need a simple program
« Reply #2 on: April 23, 2006, 04:16:34 am »

No, just for my personal use.  Generic text would be fine.
Logged
Infinitely vast, infinitely detailed.

jough

  • God's Own Dick
  • Administrator
  • Philippe is standing on it.
  • Tiny cans of Dr Pepper: 948
  • Offline Offline
  • Gender: Male
  • Posts: 6871
  • If you've got the time, we've got El Guapo.
    • View Profile
    • poetry archives
Re: I need a simple program
« Reply #3 on: April 23, 2006, 05:00:43 am »

I have a random quote come up on Jough.com, but I use a mySQL database since I use a mySQL database to keep track of everything (like whether I need eggs or milk, etc.) but yeah, let us know whether you want this on a web page or just on your PC, which of course would require you install Perl or something on your computer in order to run the script (I'd do it in PHP, though, since Perl is pretty much a dead language).

acoxcae

  • Todd
  • Tiny cans of Dr Pepper: 1
  • Offline Offline
  • Gender: Male
  • Posts: 314
  • Because I don't have one. Never have.
    • View Profile
    • My Blog
Re: I need a simple program
« Reply #4 on: April 23, 2006, 03:29:02 pm »

(I'd do it in PHP, though, since Perl is pretty much a dead language).

You take that back.
Logged
this new board has a shitload of buttons.

why are there no zippers?
-thanks ark

Gimpson

  • King of the Make-Outs
  • Tiny cans of Dr Pepper: 16
  • Offline Offline
  • Gender: Male
  • Posts: 592
    • View Profile
    • http://www.gimpysoft.com
Re: I need a simple program
« Reply #5 on: April 24, 2006, 10:39:51 am »

(I'd do it in PHP, though, since Perl is pretty much a dead language).

Tell it to the Large Kansas Based Telecommunications Company that just hired me to maintain their perl based RF Engineering data warehouse.  (I do agree, though... Perl jobs are few and far between these days, but I've been lucky enough not to spend any time unemployed since 1997 or so.)
Logged

wombat

  • English-Speaking Pizza
  • Mod Squad
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 644
  • Offline Offline
  • Posts: 12493
  • Yeah man, these are pugs, not some fuck*ng lolcat.
    • View Profile
Re: I need a simple program
« Reply #6 on: April 24, 2006, 12:46:32 pm »

Well, people are still hired to teach Latin, too.
Logged
What is this, the fuckin' Algonquin Round Table or some shit?  - Nabu

If you're going to change your life then you have to change it every day, not just the days the world isn't taking a shit on you. -Doc

jough

  • God's Own Dick
  • Administrator
  • Philippe is standing on it.
  • Tiny cans of Dr Pepper: 948
  • Offline Offline
  • Gender: Male
  • Posts: 6871
  • If you've got the time, we've got El Guapo.
    • View Profile
    • poetry archives
Re: I need a simple program
« Reply #7 on: April 24, 2006, 03:09:46 pm »

Oh, I'm sure there are still large amounts of Cobol running throughout the country too, or banks whose systems are still written in Fortran, but they're not the exciting programming languages of the present, let alone the future.

I've chosen to "standardize" on PHP for numerous reasons: with version 5 it's finally up to the enterprise software task, object-orientation is no longer an afterthought, it has a HUGE installed base, it is fast and scalable, and it's still under near constant development and will continue to mature with each version.

Most of those things are also true of Perl, of course - except for the last part.  Also, there is really nothing that Perl has that PHP doesn't, but PHP has those other advantages.  Also, procedural PHP and Perl are so much alike in dignity that it is embarrassing (for PHP).  You can refactor Perl code into PHP as fast as you can read it.  The differences in the core functionality are largely ceremonial.

AugustWest

  • Over Easy
  • Philosopher King
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 774
  • Offline Offline
  • Gender: Male
  • Posts: 10549
  • Bulbous, also tapered.
    • View Profile
Re: I need a simple program
« Reply #8 on: April 24, 2006, 03:20:19 pm »

I have an idea.  Why don't we have a race!  PERL vs. PHP!

Let's see who can write the program I need and post it to the board fastest.

Ready? GO!
Logged
Infinitely vast, infinitely detailed.

Mite

  • Motel 6 Kind of Girl
  • King of the Make-Outs
  • Tiny cans of Dr Pepper: 6
  • Offline Offline
  • Gender: Female
  • Posts: 584
    • View Profile
Re: I need a simple program
« Reply #9 on: April 24, 2006, 05:01:48 pm »

I have an idea.  Why don't we have a race!  PERL vs. PHP!

Let's see who can write the program I need and post it to the board fastest.

Ready? GO!
You, sir, are a genius. You must be one hell of a dad.
Logged
I'm no longer a Bankhead teacher, but I'll still take your cookies.

AugustWest

  • Over Easy
  • Philosopher King
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 774
  • Offline Offline
  • Gender: Male
  • Posts: 10549
  • Bulbous, also tapered.
    • View Profile
Re: I need a simple program
« Reply #10 on: April 24, 2006, 05:53:05 pm »

You, sir, are a genius. You must be one hell of a dad.

Shhhh!  They'll catch on...
Logged
Infinitely vast, infinitely detailed.

AlohaDawg

  • Mod Squad
  • LAZARUS, Tasseled Loafer of the Powerful
  • Tiny cans of Dr Pepper: 79
  • Offline Offline
  • Gender: Male
  • Posts: 4184
  • Crawlin' back to prosperity
    • View Profile
Re: I need a simple program
« Reply #11 on: April 24, 2006, 05:59:07 pm »

As long as we are begging for free software....

Is there a script I can run that returns the Filenames only (no paths) of everything on a network drive? There are about 47,000 files on this drive and I want to check for duplicate files.

 
Logged

acoxcae

  • Todd
  • Tiny cans of Dr Pepper: 1
  • Offline Offline
  • Gender: Male
  • Posts: 314
  • Because I don't have one. Never have.
    • View Profile
    • My Blog
Re: I need a simple program
« Reply #12 on: April 24, 2006, 07:54:24 pm »

Aug -

I took the middle road and made your app in C# - because I have a free version of Visual Studio and it's the one most likely to work well for you without an interpreter or anything.

Download it at http://edgecom.homelinux.com/Randomizer.exe, and then put a file called input.txt in the same directory - it picks a line at random and prints it.

Dawg -

Your problem is more complex - certainly possible, but definitely more in-depth.  On the plus side, I'm sure someone's solved that problem before.  In fact, I use to use a program like that when I worked at the National Archives - I'll see if I can find it, or at least find its name.
Logged
this new board has a shitload of buttons.

why are there no zippers?
-thanks ark

theinevitable

  • Writer's Workshoppers
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 486
  • Offline Offline
  • Gender: Male
  • Posts: 12139
    • View Profile
    • tweet tweet fun fun
Re: I need a simple program
« Reply #13 on: April 24, 2006, 08:25:41 pm »

wow.

I was about this (indicates roughly 1/4 of an inch) close to saying "oh, Dawg, I think there's a C program in "Cryptonomicon" that can do that for you, if you want."

isn't' there?
Logged
Social pressures exist
And if you think about them all of the time
You're gonna find that your head's been kicked in
You're gonna do it all for the grind

AugustWest

  • Over Easy
  • Philosopher King
  • Dude since Knucklehead times
  • *
  • Tiny cans of Dr Pepper: 774
  • Offline Offline
  • Gender: Male
  • Posts: 10549
  • Bulbous, also tapered.
    • View Profile
Re: I need a simple program
« Reply #14 on: April 24, 2006, 08:39:34 pm »

Aug -

I took the middle road and made your app in C# - because I have a free version of Visual Studio and it's the one most likely to work well for you without an interpreter or anything.

Download it at http://edgecom.homelinux.com/Randomizer.exe, and then put a file called input.txt in the same directory - it picks a line at random and prints it.


YOU WIN!  That's just what I wanted.  A tiny can to you sir.  More when I remember.
Logged
Infinitely vast, infinitely detailed.
Pages: [1] 2   Go Up