php-windows Digest 27 Jan 2001 16:26:49 -0000 Issue 417 Topics (messages 5219 through 5230): Re: Random Code 5219 by: Svensson, B.A.T. 5223 by: Larry Forrister 5224 by: Larry Forrister 5225 by: Asendorf, John Re: Is it possible to CONVERT file formats? 5220 by: Angus Mann Sent field showing wrong date and time!! 5221 by: Clark Morgan You can have a visa card .. no deposit 5222 by: garey 5228 by: Thor M. Steindorsson Re: PHP Messages 5226 by: Pablo Vera 5227 by: Ryan Grove Hello 5229 by: Graduate Jabber and PHP 5230 by: James Duncan Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
>-----Original Message----- >From: phobo [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, January 23, 2001 9:48 PM >To: [EMAIL PROTECTED] >Subject: Re: [PHP-WIN] Random Code > > >Oops, 36^8 :) > >This value would only have to generated perhaps a few times an hour, but >should't take more than a second to compute. These values ARE being stored >in a database; however, once this database gets to a million or so rows, it >would take a very long time to check it doesn't overlap, wont it? I don't belive it will take seconds to look up the result (that would be very bad performance of the RDBMS then...) If you just index the data properly, then most time probably will be spent transferring the answer over the network (that is if you use a network:). If your time constraints is within a second, and you do not need to generate the numbers more often than a few times in a hour, then why not do it? I have a table (among others) with 3.368.713 rows in my database. This is an execute example of an look up onto an attribute with an index in the database: I executed this query: select getdate() select count(*) from luAccNr where AccNr = 'X02612' select getdate() The result: -------------------------- 2001-01-26 12:14:24.717 (1 row(s) affected) pkAccNr AccNr Speice ----------- ---------------- ------ 629888 X02612 1 (1 row(s) affected) --------------------------- 2001-01-26 12:14:24.763 (1 row(s) affected) As you can see, the execution time for the query is not even a question of tenth of second, but down to about 50ms. And this includes to execute the getdate() functions too. Best regards, Anders
I hope you aren't serious... You ain't gonna get 36^8 possible code values in no website database, no how... even as a bit map string, over 300GB is required just for the data. ~~LF "Asendorf, John" wrote: > "These values ARE being stored > in a database; however, once this database gets to a million or so rows, it > would take a very long time to check it doesn't overlap, wont it?" > > Well, you **could** make a database of ALL possibilities and delete each > possibility as it is used :) Then the program would run faster and faster > and you could tell people you've been tweaking the code while it's actually > running faster all on its own :) > > --------------------- > John Asendorf - [EMAIL PROTECTED] > Web Applications Developer > http://www.lcounty.com - NEW FEATURES ADDED DAILY! > Licking County, Ohio, USA > 740-349-3631 > > The benefit to the government of replacing all $1 Federal Reserve notes with > $1 coins would be $522.2 million per year, according to estimates of the > General Accouting Office released on April 7, 2000. > > > -----Original Message----- > > From: phobo [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, January 23, 2001 3:48 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-WIN] Random Code > > > > > > Oops, 36^8 :) > > > > This value would only have to generated perhaps a few times > > an hour, but > > should't take more than a second to compute. These values ARE > > being stored > > in a database; however, once this database gets to a million > > or so rows, it > > would take a very long time to check it doesn't overlap, wont it? > > > > I also thought about getting the current date/time stamp and > > representing it > > as this value. This code is an online-order reference number, > > so it could be > > something like seconds since midnight: > > > > 36^4 = 1,679,616 > > Seconds in a day (60.60.24) = 86400 > > > > A really effective way would be to get a subsecond count for > > the day; so > > that 0000 is midnight, and ZZZZ is the end of the that day. > > This means there > > are about 19 increments a second, which rules out any possibility of > > duplicates, because: > > > > 1. two other characters could be the id of the user (a > > numeric value). 36.36 > > is 33696, which is much higher than the intended number of > > users on the > > system (we invisage no more than a few hundred - by the time > > the userbase > > gets to 33000, I'll be a millionairre and this can be someone > > else's job > > hehe) > > > > 2. the two remaining characters could be a day/year thing. > > perhaps the days > > since the start of the year 2000. 33696/365 is 92; this > > system will not be > > used for 92 years! > > > > Does that sound like quite a good algorythm, or do you have a > > much easier, > > simpler way? > > > > Siggy > > > > > > > > ----- Original Message ----- > > From: "Larry Forrister" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Wednesday, January 24, 2001 7:26 AM > > Subject: Re: [PHP-WIN] Random Code > > > > > > > Do you mean W3E4-22ER would be valid? If so there would be 36^8 > > > (2,821,109,907,456) possible values. > > > > > > A truly random generator algorithm cannot guarantee uniqueness. I'm > > > guessing what you want is to generate each possible value once in a > > > pseudo-random order. Would just apparent randomness suffice? > > > > > > With what frequency do the values need to be generated? > > Once every few > > > seconds/minutes or multiple times per second? > > > ~~LF > > > > > > > > > Sigurd Magnusson wrote: > > > > > > > Whats the best way to make a completely random, unique code in the > > > > format "ABCD-1234" where each of the 8 characters can be > > alphanumerc; > > > > 0-9,A-Z... I thought about generating a 36^4 number, > > converting to to > > > > base '36', and repeating the process. What's a good way > > to ensure the > > > > code is not repeated, though? > > > > > > > > Siggy > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
Why does randomness even enter into the picture? Why not... user_id char(2) year int <-- use all four digits, don't create another Y2K thing... day int <-- or week serial int <-- would be reset every day/week or whatever ~~LF phobo wrote: > Nah the values are being stored in a transaction log type thing ... > > Siggy > > ----- Original Message ----- > From: "Asendorf, John" <[EMAIL PROTECTED]> > To: "phobo" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 24, 2001 10:00 AM > Subject: RE: [PHP-WIN] Random Code > > > "These values ARE being stored > > in a database; however, once this database gets to a million or so rows, > it > > would take a very long time to check it doesn't overlap, wont it?" > > > > Well, you **could** make a database of ALL possibilities and delete each > > possibility as it is used :) Then the program would run faster and > faster > > and you could tell people you've been tweaking the code while it's > actually > > running faster all on its own :) > > > > --------------------- > > John Asendorf - [EMAIL PROTECTED] > > Web Applications Developer > > http://www.lcounty.com - NEW FEATURES ADDED DAILY! > > Licking County, Ohio, USA > > 740-349-3631 > > > > The benefit to the government of replacing all $1 Federal Reserve notes > with > > $1 coins would be $522.2 million per year, according to estimates of the > > General Accouting Office released on April 7, 2000. > > > > > > > -----Original Message----- > > > From: phobo [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, January 23, 2001 3:48 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP-WIN] Random Code > > > > > > > > > Oops, 36^8 :) > > > > > > This value would only have to generated perhaps a few times > > > an hour, but > > > should't take more than a second to compute. These values ARE > > > being stored > > > in a database; however, once this database gets to a million > > > or so rows, it > > > would take a very long time to check it doesn't overlap, wont it? > > > > > > I also thought about getting the current date/time stamp and > > > representing it > > > as this value. This code is an online-order reference number, > > > so it could be > > > something like seconds since midnight: > > > > > > 36^4 = 1,679,616 > > > Seconds in a day (60.60.24) = 86400 > > > > > > A really effective way would be to get a subsecond count for > > > the day; so > > > that 0000 is midnight, and ZZZZ is the end of the that day. > > > This means there > > > are about 19 increments a second, which rules out any possibility of > > > duplicates, because: > > > > > > 1. two other characters could be the id of the user (a > > > numeric value). 36.36 > > > is 33696, which is much higher than the intended number of > > > users on the > > > system (we invisage no more than a few hundred - by the time > > > the userbase > > > gets to 33000, I'll be a millionairre and this can be someone > > > else's job > > > hehe) > > > > > > 2. the two remaining characters could be a day/year thing. > > > perhaps the days > > > since the start of the year 2000. 33696/365 is 92; this > > > system will not be > > > used for 92 years! > > > > > > Does that sound like quite a good algorythm, or do you have a > > > much easier, > > > simpler way? > > > > > > Siggy > > > > > > > > > > > > ----- Original Message ----- > > > From: "Larry Forrister" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Wednesday, January 24, 2001 7:26 AM > > > Subject: Re: [PHP-WIN] Random Code > > > > > > > > > > Do you mean W3E4-22ER would be valid? If so there would be 36^8 > > > > (2,821,109,907,456) possible values. > > > > > > > > A truly random generator algorithm cannot guarantee uniqueness. I'm > > > > guessing what you want is to generate each possible value once in a > > > > pseudo-random order. Would just apparent randomness suffice? > > > > > > > > With what frequency do the values need to be generated? > > > Once every few > > > > seconds/minutes or multiple times per second? > > > > ~~LF > > > > > > > > > > > > Sigurd Magnusson wrote: > > > > > > > > > Whats the best way to make a completely random, unique code in the > > > > > format "ABCD-1234" where each of the 8 characters can be > > > alphanumerc; > > > > > 0-9,A-Z... I thought about generating a 36^4 number, > > > converting to to > > > > > base '36', and repeating the process. What's a good way > > > to ensure the > > > > > code is not repeated, though? > > > > > > > > > > Siggy > > > > > > > > -- > > > > PHP Windows Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > > > [EMAIL PROTECTED] > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
For all of you asking me... It was most certainly a joke... that's what the :) smiley faces were for... --------------------- John Asendorf - [EMAIL PROTECTED] Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 The benefit to the government of replacing all $1 Federal Reserve notes with $1 coins would be $522.2 million per year, according to estimates of the General Accouting Office released on April 7, 2000. > -----Original Message----- > From: Larry Forrister [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 26, 2001 3:03 PM > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-WIN] Random Code > > > I hope you aren't serious... You ain't gonna get 36^8 > possible code values in no > > website database, no how... even as a bit map string, over > 300GB is required > just for the data. > ~~LF > > "Asendorf, John" wrote: > > > "These values ARE being stored > > in a database; however, once this database gets to a > million or so rows, it > > would take a very long time to check it doesn't overlap, wont it?" > > > > Well, you **could** make a database of ALL possibilities > and delete each > > possibility as it is used :) Then the program would run > faster and faster > > and you could tell people you've been tweaking the code > while it's actually > > running faster all on its own :) > > > > --------------------- > > John Asendorf - [EMAIL PROTECTED] > > Web Applications Developer > > http://www.lcounty.com - NEW FEATURES ADDED DAILY! > > Licking County, Ohio, USA > > 740-349-3631 > > > > The benefit to the government of replacing all $1 Federal > Reserve notes with > > $1 coins would be $522.2 million per year, according to > estimates of the > > General Accouting Office released on April 7, 2000. > > > > > -----Original Message----- > > > From: phobo [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, January 23, 2001 3:48 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP-WIN] Random Code > > > > > > > > > Oops, 36^8 :) > > > > > > This value would only have to generated perhaps a few times > > > an hour, but > > > should't take more than a second to compute. These values ARE > > > being stored > > > in a database; however, once this database gets to a million > > > or so rows, it > > > would take a very long time to check it doesn't overlap, wont it? > > > > > > I also thought about getting the current date/time stamp and > > > representing it > > > as this value. This code is an online-order reference number, > > > so it could be > > > something like seconds since midnight: > > > > > > 36^4 = 1,679,616 > > > Seconds in a day (60.60.24) = 86400 > > > > > > A really effective way would be to get a subsecond count for > > > the day; so > > > that 0000 is midnight, and ZZZZ is the end of the that day. > > > This means there > > > are about 19 increments a second, which rules out any > possibility of > > > duplicates, because: > > > > > > 1. two other characters could be the id of the user (a > > > numeric value). 36.36 > > > is 33696, which is much higher than the intended number of > > > users on the > > > system (we invisage no more than a few hundred - by the time > > > the userbase > > > gets to 33000, I'll be a millionairre and this can be someone > > > else's job > > > hehe) > > > > > > 2. the two remaining characters could be a day/year thing. > > > perhaps the days > > > since the start of the year 2000. 33696/365 is 92; this > > > system will not be > > > used for 92 years! > > > > > > Does that sound like quite a good algorythm, or do you have a > > > much easier, > > > simpler way? > > > > > > Siggy > > > > > > > > > > > > ----- Original Message ----- > > > From: "Larry Forrister" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Wednesday, January 24, 2001 7:26 AM > > > Subject: Re: [PHP-WIN] Random Code > > > > > > > > > > Do you mean W3E4-22ER would be valid? If so there > would be 36^8 > > > > (2,821,109,907,456) possible values. > > > > > > > > A truly random generator algorithm cannot guarantee > uniqueness. I'm > > > > guessing what you want is to generate each possible > value once in a > > > > pseudo-random order. Would just apparent randomness suffice? > > > > > > > > With what frequency do the values need to be generated? > > > Once every few > > > > seconds/minutes or multiple times per second? > > > > ~~LF > > > > > > > > > > > > Sigurd Magnusson wrote: > > > > > > > > > Whats the best way to make a completely random, > unique code in the > > > > > format "ABCD-1234" where each of the 8 characters can be > > > alphanumerc; > > > > > 0-9,A-Z... I thought about generating a 36^4 number, > > > converting to to > > > > > base '36', and repeating the process. What's a good way > > > to ensure the > > > > > code is not repeated, though? > > > > > > > > > > Siggy > > > > > > > > -- > > > > PHP Windows Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > > > [EMAIL PROTECTED] > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
At 10:29 25/01/01 +0000, Tom Mathews wrote: >This issue cropped up with us a little while ago, but in a slightly different >context. >We have documents that are created using Word (PC users) and FrameMaker (die >hard Unix users that do not want anyone else to be able to edit their work >without first taking a degree in pontlessness). All of these documents need to >be accessed by everyone over the intranet using a variety of O/S's and >browsers. >The solution - a 'pdf printer' function. You can either buy acrobat / >distiller >or some such, or if you're feeling energetic you can write your own, but don't >try this lightly (I wrote a PostScript printer driver from scratch in a former >life and spent about a year writing 20,000 lines of C code). Whatever you >choose, just run this whenever a document is uploaded and then create a >link to >the pdf file (and if you don't want to edit it again, you can also delete the >original at this point). I've not yet found a browser or OS that you can't get >a decent pdf reader working with, as opposed to the word reader that NetScape >kindly crashes everytime that you try and use it (and don't think that you >will >get away with telling people to download the minute either - NetScape has a >nasty habbit of changing all the carriage returns into line feeds when you >donwload from a Unix hosted site to a PC, which means that you can't use the >doc when you get it onto your PC) > >Minutes are one of the applications that we use this technique for - the group >all write them in Word and then throw them at the upload filter which >automatically creates the pdf and a link to this. Hi Tom, I was wondering what sort of solution you (and other list members) use for the Word to PDF conversion? I've been looking at adding this as an extra feature for our clients (clubs) to upload their monthly newsletters for members to download/read. There's no way I'm going to allow them to post Word documents (problems with fonts, and more importantly if anyone spreads a Doc with a macro virus in it, I'll be the one who personally gets blamed), and unfortunately getting people to save as a different format from Word isn't much of an option either (they use graphics for headlines, and in some cases it's too hard to explain to them how to save as a different file format). Obviously Acrobat Distiller seems to be the way to go, although all the pages on the Adobe site mention using some form of GUI-based conversion (usually for dragging and dropping files, or using it from within Word), plus then I could run into expensive issues with licensing (not really something I'd look forward to since this wouldn't create a single cent in revenue for us). Any suggestions or examples of how people in here are doing such conversions would be greatly appreciated :) Thanks, Angus.
Hi Guys I am using php4 in windows NT. We are using an Microsoft Exchange server for handling mails. When I used mail function in my code, it is sending the mail correctly, but the receipient's mail box (Microsoft Outlook) shows the sent field as incorrect date and time. It is showing the other fields (From, Subject,..) O.K. Can any body tell me how how to show the correct sent date/time in the receipient's sent field. My Code: $to = [EMAIL PROTECTED]; $headers = "From: " . [EMAIL PROTECTED] . "\n"; $subject = "Exam Results"; $body = "BlahBlah" ; mail($to, $subject, $body, $headers); Thanks Yours Clark
This company is offering a visa card with no annual fee, no deposit and will pay you for the people you refer.Just request the web address by replying to : [EMAIL PROTECTED] Insert "request " in the subject line Thank you
Dear moron. Please try to refrain from spamming mailing lists. Thor M. Steindorsson - [EMAIL PROTECTED] http://www.netwood.net - Find Out Why We're Better. -----Original Message----- From: garey [mailto:[EMAIL PROTECTED]] Sent: Friday, January 26, 2001 1:05 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] You can have a visa card .. no deposit This company is offering a visa card with no annual fee, no deposit and will pay you for the people you refer.Just request the web address by replying to : [EMAIL PROTECTED] Insert "request " in the subject line Thank you -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Tom: I'm having the same problem using the CGI version of PHP, but if you install it as an Apache Module, the problem goes away. Saludos, Pablo _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Friday, January 26, 2001, 9:00:46 AM, Tom wrote: TM> I've just installed PHP 4-04pl1 on a new NT/Apache box and can't TM> remember how to turn off the very irritating TM> "X-Powered-By: PHP/4.0.4pl1 Content-type: text/html " TM> message that appears at the top of any script generated page. TM> Can anyone please remind me how to get rid of this. TM> Cheers TM> Tom
Comment out line 113 (or thereabouts) of your php.ini file. That should do the trick. -- Ryan Grove [EMAIL PROTECTED] http://wonko.com/ --------------------------------------------------------------------- Every 10 seconds, somewhere on this earth, there is a woman giving birth to a child. She must be found and stopped. [Pablo] > Tom: > I'm having the same problem using the CGI version of PHP, but if you > install it as an Apache Module, the problem goes away. > Saludos, > Pablo > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > Friday, January 26, 2001, 9:00:46 AM, Tom wrote: TM>> I've just installed PHP 4-04pl1 on a new NT/Apache box and can't TM>> remember how to turn off the very irritating TM>> "X-Powered-By: PHP/4.0.4pl1 Content-type: text/html " TM>> message that appears at the top of any script generated page. TM>> Can anyone please remind me how to get rid of this. TM>> Cheers TM>> Tom
UNIVERSITY DIPLOMA Obtain a prosperous future, money earning power, and the admiration of all. Diplomas from prestigious non-accredited universities based on your present knowledgeand life experience. No required tests, classes, books, or interviews. Bachelors, masters, MBA, and doctorate (PhD) diplomas available in the field of your choice.No one is turned down. Confidentiality assured. CALL NOW to receive your diploma within days!!! 713-866-8869 Call 24 hours a day, 7 days a week, including Sundays and holidays. 7
Is there a Jabber module available for PHP that performs the same functions as the module Net::Jabber does for Perl? Thanks James