The OFFICIAL Unofficial Achewood Message Board
Trivial Pursuits => Science & Nature => Topic started by: AugustWest 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?
-
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?
-
No, just for my personal use. Generic text would be fine.
-
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).
-
(I'd do it in PHP, though, since Perl is pretty much a dead language).
You take that back.
-
(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.)
-
Well, people are still hired to teach Latin, too.
-
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.
-
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!
-
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.
-
You, sir, are a genius. You must be one hell of a dad.
Shhhh! They'll catch on...
-
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.
-
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.
-
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?
-
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.
-
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.
I have ACDSee 7.0 it will do this. It can compare just file names (fast) or actual contents regardless of file name (slower).
If you only need to do this once you could probably just install the 30-day trial, run the comparison and uninstall it. Or there's always eMule. I don't know about 8.0
-
Microsoft has a PowerToy called SyncTool which looks at two directories and can copy or delete files in either or both directions. It's awesome for keeping travelling copies of stuff on a USB drive or something and then reconsiling the differences when you get home.
You can also use it to just make a list of the files that would be changed/added/deleted without actually performing the action, and you can even write that list to a log.