php-general Digest 27 Apr 2009 18:20:09 -0000 Issue 6090
mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4036 (20090427) __ The message was checked by ESET Smart Security. http://www.eset.com ---End Message--- ---BeginMessage--- At 9:40 AM +0100 4/27/09, Richard Heyes wrote: Hi, I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. (I'm teasing you CamelCase people. But I really would like to change this code around, because it doesn't happen to be my preference.) I'd say, if you must, then change as you go. If you do it all in a oner you'll likely introduce a shed load of problems. -- Richard Heyes Not only that. but it you leave each function alone until you work on it, then you'll have at least some indication of where/when an error has been introduced. Many time when I'm using a piece of code that isn't formatted as I like, I first get it to work as I want changing only the functions that I must change. After everything is working, I then step through the code, reformat, and change in small steps. HTH's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com ---End Message--- ---BeginMessage--- tedd wrote: At 9:40 AM +0100 4/27/09, Richard Heyes wrote: Hi, I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. (I'm teasing you CamelCase people. But I really would like to change this code around, because it doesn't happen to be my preference.) I'd say, if you must, then change as you go. If you do it all in a oner you'll likely introduce a shed load of problems. -- Richard Heyes Not only that. but it you leave each function alone until you work on it, then you'll have at least some indication of where/when an error has been introduced. Many time when I'm using a piece of code that isn't formatted as I like, I first get it to work as I want changing only the functions that I must change. After everything is working, I then step through the code, reformat, and change in small steps. HTH's tedd whereas I'd say it shouldn't be a problem to do automatically (but will be); just only use a tokenizer and not any form of regex or str_replace etc, that way you can be sure you are ONLY changing classes, methods, functions, function calls, variables etc you still may have some problems with any call_user_func or string references though! ---End Message--- ---BeginMessage--- On Mon, Apr 27, 2009 at 01:25, Paul M Foster pa...@quillandmouse.com wrote: I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. The other suggestions are more appropriate, of course, but in direct response to your question, something like this would work (though I'm typing it in here and it hasn't been tested): #!/bin/bash if(test `which vim` == ); then vi=`which vi`; else vi=`which vim`; fi; $vi `grep -lRi \$[a-z0-9] *` '+%s/\$\([a-zA-Z0-9_]\)\+/\L\E/g' '+wn' '+q' -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 ---End Message--- ---BeginMessage--- 2009/4/26 Nathan Rixham nrix...@gmail.com: Deivys Delgado Hernandez wrote: Hi, I'm having problems when i try to use the function scandir() in a Novell Netware Volumen or a Windows Shared Folder they both are mapped as a windows network drive, so i suppose i could access them as local drive, but i can't. instead i receive this message: Warning: scandir(R:\) [function.scandir]: failed to open dir: Invalid argument in C:\WebServ\wwwroot\htdocs\index.php on line 3 Warning: scandir() [function.scandir]: (errno 22): Invalid argument in C:\WebServ\wwwroot\htdocs\index.php on line 3 try using the network path instead :) you have to do this for samba drives on windows
RE: RES: [PHP] inexplicable behaviour SOLVED
On 26 April 2009 22:59, PJ advised: kranthi wrote: if $Count1 is never referenced after this, then certainly this assignment operation is redundent. but assignment is not the ONLY operation of this statement. if u hav not noticed a post increment operator has been used which will affect the value of $Count as well, and this operation is required for the script to work. the script should work even if u replace $Count1 = $Count++; with $Count++; Kranthi. Not quite, since that would change the $Count variable and that is used leater in the code. Um -- I must be missing something here, because those two statements have exactly the same effect on $Count, incrementing it by one (and you said the first statement fixed your problem, so logically the second one must too). In fact, because you've used a post-increment, the statement $Count1 = $Count++; ends up with $Count == $Count1+1, and $Count1 being the original value of $Count!! This whole scenario smacks to me of a classic off-by-one error -- either $Count actually *needs* to be one greater than the value you first thought of, or some other value you are comparing it to should be one smaller than it actually is. Cheers! Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CamelCase conversion to proper_c_style
Hi, I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. (I'm teasing you CamelCase people. But I really would like to change this code around, because it doesn't happen to be my preference.) I'd say, if you must, then change as you go. If you do it all in a oner you'll likely introduce a shed load of problems. -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help with scandir()
2009/4/26 Nathan Rixham nrix...@gmail.com: Deivys Delgado Hernandez wrote: Hi, I'm having problems when i try to use the function scandir() in a Novell Netware Volumen or a Windows Shared Folder they both are mapped as a windows network drive, so i suppose i could access them as local drive, but i can't. instead i receive this message: Warning: scandir(R:\) [function.scandir]: failed to open dir: Invalid argument in C:\WebServ\wwwroot\htdocs\index.php on line 3 Warning: scandir() [function.scandir]: (errno 22): Invalid argument in C:\WebServ\wwwroot\htdocs\index.php on line 3 try using the network path instead :) you have to do this for samba drives on windows too. $dir = '//machine.local/share/path'; regards, nathan ps: many people just don't answer if they do not know That's quite likely. Another aproach I thought about when reading your first post was using subst to remap the share as another virtual drive. But I'm unsure if this would change anything. subst comes with windows and you can map new drives like that: subst g: c:\somewhere\else subst h: b:\ Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help with scandir()
I lack experience with windows, but my experience in linux tells me this *might* be related to the permissions the PHP or webserver has to access that remote drive? Ie. like the drives might be mapped just for your user? Not sure, but you might want to check this, permissions are common problems with using scandir... Simon On Mon, Apr 27, 2009 at 4:55 AM, Jan G.B. ro0ot.w...@googlemail.com wrote: 2009/4/26 Nathan Rixham nrix...@gmail.com: Deivys Delgado Hernandez wrote: Hi, I'm having problems when i try to use the function scandir() in a Novell Netware Volumen or a Windows Shared Folder they both are mapped as a windows network drive, so i suppose i could access them as local drive, but i can't. instead i receive this message: Warning: scandir(R:\) [function.scandir]: failed to open dir: Invalid argument in C:\WebServ\wwwroot\htdocs\index.php on line 3 Warning: scandir() [function.scandir]: (errno 22): Invalid argument in C:\WebServ\wwwroot\htdocs\index.php on line 3 try using the network path instead :) you have to do this for samba drives on windows too. $dir = '//machine.local/share/path'; regards, nathan ps: many people just don't answer if they do not know That's quite likely. Another aproach I thought about when reading your first post was using subst to remap the share as another virtual drive. But I'm unsure if this would change anything. subst comes with windows and you can map new drives like that: subst g: c:\somewhere\else subst h: b:\ Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- When Earth was the only inhabited planet in the Galaxy, it was a primitive place, militarily speaking. The only weapon they had ever invented worth mentioning was a crude and inefficient nuclear-reaction bomb for which they had not even developed the logical defense. - Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] inexplicable behaviour
If you want to increment $Count by one, you can use any one of the 3 following lines to do this: $Count = $Count + 1; $Count += 1; $Count++; The 3 lines are equivalent, but have varying degrees of elegance (suit yourself). However, make sure that your mysql function returned a number (and not an error message or whatever else). It's also possible the 'next' redirection isnt working because the value in $Count is invalid somehow? doesnt point to any page or something like that? Simon On Fri, Apr 24, 2009 at 8:14 PM, PJ af.gour...@videotron.ca wrote: Frankly, I don't know what to look for or why something so weird would happen: I have pagination set up and the number for pages next has a link but the next does not. I have experimented with all sorts of configurations of the code but the only thing that works (and this is totally off the wall) is to do this $Count = mysql_num_rows($results); $Count1=$Count++; // without this, the next does not do the link--- but there is no other $Count1 in the code either in the original page or the include page. And this phenomenon was apparent in a similar page. I'd be curious to understand how this could happen. I could post the whole code, but that would be some 300 lines... -- unheralded genius: A clean desk is the sign of a dull mind. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CamelCase conversion to proper_c_style
My suggestion is to use the Find and Replace feature of your code editing software. Sorry to disagree with Mr. Hayes, however, if you do as he says and replace as you go you will be creating errors as these variables, functions, etc will most likely be CaSe SenSItiVe. Change one then you need to change all. As always, do not forget the first three rules of code writing; backup, backup, backup. Marc Hall The difference between genius and stupidity is that genius has its limits. * Hi, I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. (I'm teasing you CamelCase people. But I really would like to change this code around, because it doesn't happen to be my preference.) I'd say, if you must, then change as you go. If you do it all in a oner you'll likely introduce a shed load of problems. -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4036 (20090427) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] inexplicable behaviour SOLVED
Ford, Mike wrote: On 26 April 2009 22:59, PJ advised: kranthi wrote: if $Count1 is never referenced after this, then certainly this assignment operation is redundent. but assignment is not the ONLY operation of this statement. if u hav not noticed a post increment operator has been used which will affect the value of $Count as well, and this operation is required for the script to work. the script should work even if u replace $Count1 = $Count++; with $Count++; Kranthi. Not quite, since that would change the $Count variable and that is used leater in the code. Um -- I must be missing something here, because those two statements have exactly the same effect on $Count, incrementing it by one (and you said the first statement fixed your problem, so logically the second one must too). In fact, because you've used a post-increment, the statement $Count1 = $Count++; ends up with $Count == $Count1+1, and $Count1 being the original value of $Count!! This whole scenario smacks to me of a classic off-by-one error -- either $Count actually *needs* to be one greater than the value you first thought of, or some other value you are comparing it to should be one smaller than it actually is. Cheers! Thanks for the clarification, Mike. In my ignorance, I was under the impression that the right side of the equation was only for the use of the left part. How stupid of me. So what I should have been doing was $Count1 = $Count + 1; right? Anyway, I don't need that statement anymore as I found the error of my ways and have corrected it. And behold, the light came forth and it worked. :-) Mike -- Mike Ford, Electronic Information Developer, C507, Leeds Metropolitan University, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CamelCase conversion to proper_c_style
At 9:40 AM +0100 4/27/09, Richard Heyes wrote: Hi, I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. (I'm teasing you CamelCase people. But I really would like to change this code around, because it doesn't happen to be my preference.) I'd say, if you must, then change as you go. If you do it all in a oner you'll likely introduce a shed load of problems. -- Richard Heyes Not only that. but it you leave each function alone until you work on it, then you'll have at least some indication of where/when an error has been introduced. Many time when I'm using a piece of code that isn't formatted as I like, I first get it to work as I want changing only the functions that I must change. After everything is working, I then step through the code, reformat, and change in small steps. HTH's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] utf-8 ?
Since I have to use a number of Western languages that have those annoying accents on many characters, I am already finding some annoyances in my code results; like having to enter the aacute; type of stuff in inputs for searches queries. MySql db is set up for InnoDB with latin1_swedish_ci for Collation; I believe this is default. Utf-8 seems to be one way to overcome the problems, but is it the only way - seems a little cumbersome as I have no need for oriental other extra-terrestrial cyphers. (I'm incorrigibly lazy.) If it is the only way, what difficulties could I expect from an ISP hosting a virtual site? -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CamelCase conversion to proper_c_style
tedd wrote: At 9:40 AM +0100 4/27/09, Richard Heyes wrote: Hi, I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. (I'm teasing you CamelCase people. But I really would like to change this code around, because it doesn't happen to be my preference.) I'd say, if you must, then change as you go. If you do it all in a oner you'll likely introduce a shed load of problems. -- Richard Heyes Not only that. but it you leave each function alone until you work on it, then you'll have at least some indication of where/when an error has been introduced. Many time when I'm using a piece of code that isn't formatted as I like, I first get it to work as I want changing only the functions that I must change. After everything is working, I then step through the code, reformat, and change in small steps. HTH's tedd whereas I'd say it shouldn't be a problem to do automatically (but will be); just only use a tokenizer and not any form of regex or str_replace etc, that way you can be sure you are ONLY changing classes, methods, functions, function calls, variables etc you still may have some problems with any call_user_func or string references though! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: utf-8 ?
PJ wrote: Since I have to use a number of Western languages that have those annoying accents on many characters, I am already finding some annoyances in my code results; like having to enter the aacute; type of stuff in inputs for searches queries. MySql db is set up for InnoDB with latin1_swedish_ci for Collation; I believe this is default. in that case you'd have to convert all your databases to utf8 / utf_general_ci Utf-8 seems to be one way to overcome the problems, but is it the only way - seems a little cumbersome as I have no need for oriental other extra-terrestrial cyphers. (I'm incorrigibly lazy.) can't think of any good reason why you shouldn't be using utf-8.. If it is the only way, what difficulties could I expect from an ISP hosting a virtual site? none really AFAIK - but converting all your latin1 to utf-8 will be a very fun job indeed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] utf-8 ?
I think you should switch to utf8-general-ci all the way.
Re: [PHP] CamelCase conversion to proper_c_style
On Mon, Apr 27, 2009 at 01:25, Paul M Foster pa...@quillandmouse.com wrote: I know it's probably heresy for a lot of coders, but does anyone know a function or class or regexp or somesuch which will scan through a PHP file and convert all the CamelCase code into proper C-type code? That is, CamelCase gets converted to camel_case. I snagged a bunch of someone else's PHP code I'd like to modify, but it's coded the wrong way, so I'd like to fix it. The other suggestions are more appropriate, of course, but in direct response to your question, something like this would work (though I'm typing it in here and it hasn't been tested): #!/bin/bash if(test `which vim` == ); then vi=`which vi`; else vi=`which vim`; fi; $vi `grep -lRi \$[a-z0-9] *` '+%s/\$\([a-zA-Z0-9_]\)\+/\L\E/g' '+wn' '+q' -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable Scope with require_once
Hello, all. I have a working app that runs in PHP 4.4.9 on the server. I develop the app on my local environment, which runs PHP 5.2.6. The setup is thus: From my index, I have require_once('config.php'); require_once('dbstuff.php'); config.php looks like this: ?php $db_host = 'localhost'; $db_user = 'someuser'; $db_password = 'somepassword'; $ ...snipped... ? dbstuff.php looks like this: ?php if( !$dbh ) { $dbh = mysql_connect($db_host, $db_user, $db_password) or die('Could not connect: ' . mysql_error()); } ...snipped... ? For some reason, the $db_host, $db_user, and so on defined in config.php are not accessible from dbstuff.php on my development environment. I wlll get [timestamp] [error] [client 127.0.0.1] PHP Notice: Undefined variable: db_host in somepath\db_stuff.php on line whatever which causes 'Could not connect: some MySQL error message that is obtained when attempting to login with a nonexistent user' This works on the production environment (the one with PHP version 4.4.9). register_globals is Off in both environments. What is going on, here? Regards, A. Wilson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: utf-8 ?
Nathan Rixham wrote: PJ wrote: Since I have to use a number of Western languages that have those annoying accents on many characters, I am already finding some annoyances in my code results; like having to enter the aacute; type of stuff in inputs for searches queries. MySql db is set up for InnoDB with latin1_swedish_ci for Collation; I believe this is default. in that case you'd have to convert all your databases to utf8 / utf_general_ci Utf-8 seems to be one way to overcome the problems, but is it the only way - seems a little cumbersome as I have no need for oriental other extra-terrestrial cyphers. (I'm incorrigibly lazy.) can't think of any good reason why you shouldn't be using utf-8.. If it is the only way, what difficulties could I expect from an ISP hosting a virtual site? none really AFAIK - but converting all your latin1 to utf-8 will be a very fun job indeed! I looked at http://developer.loftdigital.com/blog/php-utf-8-cheatsheet which suggests this: ALTER DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; ALTER TABLE tbl_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; or I could do it with phpMyAdmin, right? and the only difficulties would appear to be fixing any accent stuff (don't know yet just what) and that would only be time consuming. I guess I'm just looking for reassurance that I don't muck up anything and then have to do tortured acrobatics to redress things again. :-) -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: utf-8 ?
I looked at http://developer.loftdigital.com/blog/php-utf-8-cheatsheet which suggests this: ALTER DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; ALTER TABLE tbl_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; or I could do it with phpMyAdmin, right? and the only difficulties would appear to be fixing any accent stuff (don't know yet just what) and that would only be time consuming. I guess I'm just looking for reassurance that I don't muck up anything and then have to do tortured acrobatics to redress things again. :-) Changing to UTF8 is time consuming but if programming can be used it would ease the effort. I have seen a WP plugin for that as well. And in phpmyAdmin you'll have to set the collation for all fields and tables one by one. :) Regards Lenin www.twitter.com/nine_L
Re: [PHP] Re: utf-8 ?
On Mon, 2009-04-27 at 20:56 +0600, 9el wrote: I looked at http://developer.loftdigital.com/blog/php-utf-8-cheatsheet which suggests this: ALTER DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; ALTER TABLE tbl_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; or I could do it with phpMyAdmin, right? and the only difficulties would appear to be fixing any accent stuff (don't know yet just what) and that would only be time consuming. I guess I'm just looking for reassurance that I don't muck up anything and then have to do tortured acrobatics to redress things again. :-) Changing to UTF8 is time consuming but if programming can be used it would ease the effort. I have seen a WP plugin for that as well. And in phpmyAdmin you'll have to set the collation for all fields and tables one by one. :) I think some time ago I used combination of mysqldump and iconv, some minor editing, and then pumped it back into the database. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] inexplicable behaviour SOLVED
Thanks for the clarification, Mike. In my ignorance, I was under the impression that the right side of the equation was only for the use of the left part. How stupid of me. So what I should have been doing was $Count1 = $Count + 1; right? $Count = $Count + 1; is exactly(?) same as $Count++; or ++$Count But not exactly same. PostFix notation adds the value after assigning. PreFix notation adds the value right away. But optimized programming argues about how machine is coded nowadays. Anyway, I don't need that statement anymore as I found the error of my ways and have corrected it. And behold, the light came forth and it worked. :-) Regards Lenin www.twitter.com/nine_L www.lenin9l.wordpress.com
Re: [PHP] Re: utf-8 ?
I think some time ago I used combination of mysqldump and iconv, some minor editing, and then pumped it back into the database. I think if the dump is not too big your trick will yield good results. What do you do for really large DB cases? Regards Lenin www.twitter.com/nine_L www.lenin9l.wordpress.com
Re: [PHP] Re: utf-8 ?
Robert Cummings wrote: On Mon, 2009-04-27 at 20:56 +0600, 9el wrote: I looked at http://developer.loftdigital.com/blog/php-utf-8-cheatsheet which suggests this: ALTER DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; ALTER TABLE tbl_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; or I could do it with phpMyAdmin, right? and the only difficulties would appear to be fixing any accent stuff (don't know yet just what) and that would only be time consuming. I guess I'm just looking for reassurance that I don't muck up anything and then have to do tortured acrobatics to redress things again. :-) Changing to UTF8 is time consuming but if programming can be used it would ease the effort. I have seen a WP plugin for that as well. And in phpmyAdmin you'll have to set the collation for all fields and tables one by one. :) I think some time ago I used combination of mysqldump and iconv, some minor editing, and then pumped it back into the database. Cheers, Rob. snap; also utf8_decode and utf8_encode I'm also sure there's a way to do it using by setting the client connection char set and server char set to do an auto conversion.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: utf-8 ?
On Mon, 2009-04-27 at 21:06 +0600, 9el wrote: I think some time ago I used combination of mysqldump and iconv, some minor editing, and then pumped it back into the database. I think if the dump is not too big your trick will yield good results. What do you do for really large DB cases? I haven't had the displeasure :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: utf-8 ?
9el wrote: I looked at http://developer.loftdigital.com/blog/php-utf-8-cheatsheet which suggests this: ALTER DATABASE db_name CHARACTER SET utf8 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT COLLATE utf8_general_ci ; ALTER TABLE tbl_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; or I could do it with phpMyAdmin, right? and the only difficulties would appear to be fixing any accent stuff (don't know yet just what) and that would only be time consuming. I guess I'm just looking for reassurance that I don't muck up anything and then have to do tortured acrobatics to redress things again. :-) Changing to UTF8 is time consuming but if programming can be used it would ease the effort. I have seen a WP plugin for that as well. And in phpmyAdmin you'll have to set the collation for all fields and tables one by one. :) Regards Lenin www.twitter.com/nine_L http://www.twitter.com/nine_L I just converted all, or thought I did. phpMyAdmin: in the structure view of the db show Collation as latin_swedish_ci ??? in the individual table structure views the fields show utf-8 general ??? I don't see any difference on Firefox running on FreeBSD but it show correctly on Wimpy XP ??. In the web page the accent for French shows as a ? within a white diamond on FBSD. In the database the entry is the French chatacter with the accent. I'm now trying to figure out how to enter the accents on FBSD in Firefox. Nuts! This is torcher. How does one become truly international? -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: utf-8 ?
I just converted all, or thought I did. phpMyAdmin: in the structure view of the db show Collation as latin_swedish_ci ??? in the individual table structure views the fields show utf-8 general ??? I don't see any difference on Firefox running on FreeBSD but it show correctly on Wimpy XP ??. In the web page the accent for French shows as a ? within a white diamond on FBSD. In the database the entry is the French chatacter with the accent. I'm now trying to figure out how to enter the accents on FBSD in Firefox. Nuts! This is torcher. How does one become truly international? Without much argument you should just follow What Robert has told Just dump your db and you can replace the collate to desired one and then put back in DB server et voila!
[PHP] Unit Testing
Hi. I did some searching in the archives, but didn't quite find what I was looking for. Maybe a few of you can assist me... We have an application that's currently in production, but we're constantly modifying/upgrading it. We did not do unit testing early on because of the lack of time. Now that some time has opened up, we're considering unit testing. My question is. is it reasonable to start unit testing at this point in time with the application mostly built? Besides being really time-consuming, what are the pitfalls of starting unit testing at this stage? Thanks in advance, ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Formating Numbers
On Sun, Apr 26, 2009 at 18:15, Gary gwp...@ptd.net wrote: Sorry for the delay in response. I was able to figure the number_format() function out. Thanks for all your responses. Since you're working specifically with money as described in your example, Gary, you could also check out money_format()[1] and should have a brief overview of the optional locale settings such as setlocale()[2] for working with code created by others. Now get outside. You're somewhere down the road from me, and it's 87F and sunny out here right now. ;-P KEY: ^1:http://php.net/money_format ^2:http://php.net/setlocale -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Unit Testing
Philip Thompson wrote: Hi. I did some searching in the archives, but didn't quite find what I was looking for. Maybe a few of you can assist me... We have an application that's currently in production, but we're constantly modifying/upgrading it. We did not do unit testing early on because of the lack of time. Now that some time has opened up, we're considering unit testing. My question is. is it reasonable to start unit testing at this point in time with the application mostly built? Besides being really time-consuming, what are the pitfalls of starting unit testing at this stage? Thanks in advance, ~Philip maybe a useless answer, but, no pitfalls - just do it - I'm always surprised by my unit test results, its invaluable and it's never too late to start. just think about the next years worth of bugs found by the client not being there! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Unit Testing
As a programmer, i always test what I'm coding as i code it (mostly to make sure i dont include typos), but i feel it is best to make proper testing once the component is ready and working fine. If your project is large, it might be a good idea to break it in several 'modules' or section if possible and treat each of them as separate projects (testing would be done on a module once this one is ready). You may be interested in looking for information on the net on 'IT project management' which usually describe when is the best time to test according to a certain structure... Simon On Mon, Apr 27, 2009 at 12:16 PM, Nathan Rixham nrix...@gmail.com wrote: Philip Thompson wrote: Hi. I did some searching in the archives, but didn't quite find what I was looking for. Maybe a few of you can assist me... We have an application that's currently in production, but we're constantly modifying/upgrading it. We did not do unit testing early on because of the lack of time. Now that some time has opened up, we're considering unit testing. My question is. is it reasonable to start unit testing at this point in time with the application mostly built? Besides being really time-consuming, what are the pitfalls of starting unit testing at this stage? Thanks in advance, ~Philip maybe a useless answer, but, no pitfalls - just do it - I'm always surprised by my unit test results, its invaluable and it's never too late to start. just think about the next years worth of bugs found by the client not being there! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- When Earth was the only inhabited planet in the Galaxy, it was a primitive place, militarily speaking. The only weapon they had ever invented worth mentioning was a crude and inefficient nuclear-reaction bomb for which they had not even developed the logical defense. - Asimov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Unit Testing
On Apr 27, 2009, at 11:38 AM, Simon wrote: As a programmer, i always test what I'm coding as i code it (mostly to make sure i dont include typos), but i feel it is best to make proper testing once the component is ready and working fine. If your project is large, it might be a good idea to break it in several 'modules' or section if possible and treat each of them as separate projects (testing would be done on a module once this one is ready). You may be interested in looking for information on the net on 'IT project management' which usually describe when is the best time to test according to a certain structure... Simon On Mon, Apr 27, 2009 at 12:16 PM, Nathan Rixham nrix...@gmail.com wrote: Philip Thompson wrote: Hi. I did some searching in the archives, but didn't quite find what I was looking for. Maybe a few of you can assist me... We have an application that's currently in production, but we're constantly modifying/upgrading it. We did not do unit testing early on because of the lack of time. Now that some time has opened up, we're considering unit testing. My question is. is it reasonable to start unit testing at this point in time with the application mostly built? Besides being really time-consuming, what are the pitfalls of starting unit testing at this stage? Thanks in advance, ~Philip maybe a useless answer, but, no pitfalls - just do it - I'm always surprised by my unit test results, its invaluable and it's never too late to start. just think about the next years worth of bugs found by the client not being there! A question I have about unit testing. The point is to test individual units... correct? So, let's say I have this core class which creates instances of other classes. Well, if I only want test the core class, I don't want to instantiate the other classes... correct? Example: ?php // Core.php require ('Class1.php'); require ('Class2.php'); class Core { public function __construct () { $this-class1 = new Class1 ($this); $this-class2 = new Class2 ($this); } } // CoreTest.php require ('../PHPUnit/Framework.php'); require ('../includes/Core.php'); class CoreTest extends PHPUnit_Framework_TestCase { protected function setUp () { $this-core = new Core(); } } ? So, here, Class1 and Class2 will be instantiated. However, I don't really care for them to be so that I can test all the methods in the core class. Is this a perfect example of how the original design of the core class is not conducive to implementing unit tests? Without rewriting the core class, is there a way to test this? Thanks, ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] error in printer_open function
hi, i am using local server to print a simple text i config the php.ini file as ;extension=php_printer.dll added in the extension list and add [printer] printer.default_printer = Send To OneNote 2007 in this file and write a sim ple page as- Prabal Cable Network
Re: [PHP] utf-8 ?
On 4/27/09 9:55 AM, PJ af.gour...@videotron.ca wrote: Since I have to use a number of Western languages that have those annoying accents on many characters, I am already finding some annoyances in my code results; like having to enter the aacute; type of stuff in inputs for searches queries. the sooner you quit this bad habit the better. utf-8 is the solution. MySql db is set up for InnoDB with latin1_swedish_ci for Collation; I believe this is default. Utf-8 seems to be one way to overcome the problems, but is it the only way - seems a little cumbersome as I have no need for oriental other extra-terrestrial cyphers. (I'm incorrigibly lazy.) i know no reasonable alternative. in mysql, converting your tables is easy. If it is the only way, what difficulties could I expect from an ISP hosting a virtual site? the difficulties are most likely to arise with non-mbstring-safe functions your php code may be using. when i converted my site to utf-8 after 5 years of running latin-1, i spent a few days combing through each string function to determine if it was mbsafe or not (many are not) and if not, what to use instead. if the host has the mbstring extension then you're job may be a lot easier (assuming you're willing to recode your app to depend on an extension that isn't present in all runtime environments). if not, then you'll work harder to find work-arounds. i made a list of notes as i was working on the conversion, including a list of my notes on about 90 string functions. i could post them here if that would be of interest. here, at least, are the web pages i referred to: http://www.phpwact.org/php/i18n/utf-8 http://www.phpwact.org/php/i18n/charsets http://www.phpwact.org/php/i18n/utf-8/mysql http://devlog.info/2008/08/24/php-and-unicode-utf-8/ http://www.sitepoint.com/blogs/2006/08/09/scripters-utf-8-survival-guide-sli des/ http://www.nicknettleton.com/zine/php/php-utf-8-cheatsheet http://www.cs.tut.fi/~jkorpela/chars.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: utf-8 ?
On 4/27/09 11:17 AM, PJ af.gour...@videotron.ca wrote: phpMyAdmin: in the structure view of the db show Collation as latin_swedish_ci ??? maybe a phpmyadmin feature? check it with the mysql client. when i did the conversion* it came out looking just right in phpmyadmin. *i followed instrunctions here: http://dev.mysql.com/doc/refman/5.0/en/alter-table.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: utf-8 ?
On Tue, Apr 28, 2009 at 1:50 AM, Tom Worster f...@thefsb.org wrote: On 4/27/09 11:17 AM, PJ af.gour...@videotron.ca wrote: phpMyAdmin: in the structure view of the db show Collation as latin_swedish_ci ??? maybe a phpmyadmin feature? check it with the mysql client. when i did the conversion* it came out looking just right in phpmyadmin. *i followed instrunctions here: http://dev.mysql.com/doc/refman/5.0/en/alter-table.html Hey Tom Also share your findings plz :) regards Lenin www.twitter.com/nine_L
Re: [PHP] utf-8 ?
Tom Worster wrote: On 4/27/09 9:55 AM, PJ af.gour...@videotron.ca wrote: Since I have to use a number of Western languages that have those annoying accents on many characters, I am already finding some annoyances in my code results; like having to enter the aacute; type of stuff in inputs for searches queries. the sooner you quit this bad habit the better. utf-8 is the solution. MySql db is set up for InnoDB with latin1_swedish_ci for Collation; I believe this is default. Utf-8 seems to be one way to overcome the problems, but is it the only way - seems a little cumbersome as I have no need for oriental other extra-terrestrial cyphers. (I'm incorrigibly lazy.) i know no reasonable alternative. in mysql, converting your tables is easy. If it is the only way, what difficulties could I expect from an ISP hosting a virtual site? the difficulties are most likely to arise with non-mbstring-safe functions your php code may be using. when i converted my site to utf-8 after 5 years of running latin-1, i spent a few days combing through each string function to determine if it was mbsafe or not (many are not) and if not, what to use instead. if the host has the mbstring extension then you're job may be a lot easier (assuming you're willing to recode your app to depend on an extension that isn't present in all runtime environments). if not, then you'll work harder to find work-arounds. i made a list of notes as i was working on the conversion, including a list of my notes on about 90 string functions. i could post them here if that would be of interest. here, at least, are the web pages i referred to: http://www.phpwact.org/php/i18n/utf-8 http://www.phpwact.org/php/i18n/charsets http://www.phpwact.org/php/i18n/utf-8/mysql http://devlog.info/2008/08/24/php-and-unicode-utf-8/ http://www.sitepoint.com/blogs/2006/08/09/scripters-utf-8-survival-guide-sli des/ http://www.nicknettleton.com/zine/php/php-utf-8-cheatsheet http://www.cs.tut.fi/~jkorpela/chars.html Exactly what are the advantages of using utf-8? How will it solve my problem? Right now I'm going nuts trying to set up FreeBSD and xorg to be able to switch between en_US and fr_CA keyboards but it sure is frustrating if nothing else. This is a most elegant way of using the french and english keyboards siinc the fr_CA keyboard is bilingual - almost all the characters are the same except for a few that have been relocated; and it is easy to adapt to. I would settle for just 1 keyboard - the fr_CA, but I can't find any intelligible or functional ways to set it up. I got one version set up with keyboard mapping but that was a complete disaster as I had to find a an ASCII code to enter for my password since that particular key was not available on the keyboard. Sometimes I wonder about the guys who set this stuff up. :o -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code
I'd love a good time log/billing app. I currently use http://www.getharvest.com/ but it is too expensive for such a small operation as me. But I LOVE the features. BTW, what are you all (especially you who are one-man contractors like me) using to keep track of your time.. billing clients, etc.? Doesn't have to be free, but maybe there already is some great stuff out there that is? -Govinda On Apr 24, 2009, at 5:00 PM, Andrew Hucks wrote: I've been coding PHP for about a year, and I'm running out of things to code that force me to learn new things. If you have any suggestions, I'd greatly appreciate it.
Re: [PHP] utf-8 ?
On 4/27/09 4:25 PM, PJ af.gour...@videotron.ca wrote: Exactly what are the advantages of using utf-8? How will it solve my problem? actually, i have no idea because i have no idea what problem you are trying to solve and i apologize for presumptuous. i presumed that you have a php app with a bunch of data in mysql and you needed to handle international characters in the db beyond latin-1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code
IMO all you need is a cellphone with some normal calendar features. I do also tend to use Google Calendar from time to time to text me whenever something shows up on the board. Google Apps is also very useful for email managing, etc. HTH, Nitsan On Mon, Apr 27, 2009 at 10:29 PM, Govinda govinda.webdnat...@gmail.comwrote: I'd love a good time log/billing app. I currently use http://www.getharvest.com/ but it is too expensive for such a small operation as me. But I LOVE the features. BTW, what are you all (especially you who are one-man contractors like me) using to keep track of your time.. billing clients, etc.? Doesn't have to be free, but maybe there already is some great stuff out there that is? -Govinda On Apr 24, 2009, at 5:00 PM, Andrew Hucks wrote: I've been coding PHP for about a year, and I'm running out of things to code that force me to learn new things. If you have any suggestions, I'd greatly appreciate it.
Re: [PHP] utf-8 ?
Tom Worster wrote: On 4/27/09 4:25 PM, PJ af.gour...@videotron.ca wrote: Exactly what are the advantages of using utf-8? How will it solve my problem? actually, i have no idea because i have no idea what problem you are trying to solve and i apologize for presumptuous. i presumed that you have a php app with a bunch of data in mysql and you needed to handle international characters in the db beyond latin-1. I think you hit the nail on the head, except I dont need any of those weird foreign pictograms and scribbles ;-) I'm only using English ( the most difficult, of course), French(a bit twisted), Italian(a bit slanted, German(lots of options), Swedish(cold, cold), Portugese(oh, boy) and maybe some other Western European variety. We do try to be civilized, don't we? So, in the end, utf-8 may not be so important for me after all. All seems to be working just fine. I think I'll upload the stuff to the real site and we can all have a bash at it. 8-) -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I need ideas for things to code -- Roach vs Bugzilla
-Original Message- Sent: Friday, April 24, 2009 4:31 PM Subject: Re: [PHP] I need ideas for things to code how about: a better bugzilla replacement in php I got that one done for you: http://www.daevid.com/content/examples/roach.php p.s. the PHP code is absolute crap by the way. I inherited the start of this and just had to keep building on top of it, so i never got time to re-write it properly, only fix as I went. It's a dead project at this point, so someone is free to pick up where I left off as Lockdown is no more. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code
Govinda wrote: I'd love a good time log/billing app. I currently use http://www.getharvest.com/ but it is too expensive for such a small operation as me. But I LOVE the features. BTW, what are you all (especially you who are one-man contractors like me) using to keep track of your time.. billing clients, etc.? Doesn't have to be free, but maybe there already is some great stuff out there that is? -Govinda Govinda!, what are you doing on a PHP forum! ;-) I wrote my billing app about 4 years ago in WebDNA. It contains: 1.) Customer db 2.) quoting The quoting system replaces emails that are sent back and forth between you and your client, as managing emails really, really is not fun. (Client visits the website to interact with the quoting system) 3.) invoicing 4.) a full proposal system that links to the quoting features (it's like a glorified quoting system that looks pretty to the client.. so instead of seeing numbers, they see numbers and moch-ups/designs. 5.) Job clock that links to the invoicing system. (invoices know if a job has 'job clock' records. 6.) Budgeting system. 7.) Reports (for dreaded tax days) 8.) Client Payment system 9.) hmmm what else, emailing, searching all db's, etc. My sanity is already a sensitive issue when it comes to client billing etc.. and I'm pretty sure I'd be living in a padded room by now if I didn't have this app. ;-) hmmm... since this is the PHP forum, I have to say something that will steer this back to politically correctness... I'm sure you could build these features in PHP... just allow yourself a bit more time. ;-) To the O.P., I agree with someone who said; much of the time, client work will drive creativity and new projects (and keep you eating). However, I guess if you are starting out, it wouldn't hurt to zap something out that will show people what you can do. I would suggest that, whatever you do, maybe integrate some client-side stuff as well.. like Flash,CSS,or JS. 'Pretty' brings them in, then function makes the sale. my ¢.02 Donovan -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o D. BROOKE EUCA Design Center WebDNA Software Corp. WEB: http://www.euca.us | http://www.webdna.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o WebDNA: [** Square Bracket Utopia **] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla
On Mon, Apr 27, 2009 at 2:47 PM, Daevid Vincent dae...@daevid.com wrote: I got that one done for you: http://www.daevid.com/content/examples/roach.php p.s. the PHP code is absolute crap by the way. I inherited the start of this and just had to keep building on top of it, so i never got time to re-write it properly, only fix as I went. It's a dead project at this point, so someone is free to pick up where I left off as Lockdown is no more. Well, thanks for that; it seems like it's got a lot of features. A big one to examine would be looking at its integration with svn. But I like the triage assignment by default. It's a little disappointing though if you're selling it with the note of the code is crap ... :) I'll toss it over to my boss who is the one messing around with trac/redmine/etc and see what he has to say. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I need ideas for things to code - webbytedd examples
This is tripping me out! i feel so duped! :) http://webbytedd.com/b1/photo-retouch/ this didn't work, maybe due to some JS errors. tried in FF3 and IE6. http://webbytedd.com/b/watermark/ I like your arrow captch idea: http://webbytedd.com/aa/assorted-captcha/ also the date and clock are nice: http://webbytedd.com/b/kewl-date/ http://webbytedd.com/b/binary-clock/ the transparent bg is green in FF3/XP and IE6/XP http://webbytedd.com/ccc/dragdrop/ http://webbytedd.com/b/color-rows/ you know you can do this too: tr class=?= (($r = !$r) ? 'row0' : 'row1' ) ? How come you don't have a way to see/download the source code for all these examples? cheers, http://daevid.com Some people, when confronted with a problem, think 'I know, I'll use XML.' Now they have two problems. -Original Message- From: Charles Harvey [mailto:linux...@gmail.com] Sent: Saturday, April 25, 2009 11:56 AM To: php-general@lists.php.net Subject: Re: [PHP] I need ideas for things to code This was a surprisingly good idea that works for me, as I haven't coded in about 3 years and need to get my hand back in. Trying to make use of one idea led to several others. Thanks, tedd! Charles On Sat, Apr 25, 2009 at 4:54 AM, tedd tedd.sperl...@gmail.com wrote: At 7:00 PM -0400 4/24/09, Andrew Hucks wrote: I've been coding PHP for about a year, and I'm running out of things to code that force me to learn new things. If you have any suggestions, I'd greatly appreciate it. Andrew: Here's an idea. Go through the php manuals and make small examples of everything you find. That way not only do you learn, but you have examples to fall back on when the need rises. Here's a small (believe me) portion of the demo's I've written over the years: http://webbytedd.com/a.php These cover different languages, but it will give you the idea. Just make a inventory of examples and post them with code. Not only will it help you, but might help others when you answer questions on this list showing the solution. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I need ideas for things to code -- Roach vs Bugzilla
-Original Message- From: Michael Shadle [mailto:mike...@gmail.com] Sent: Monday, April 27, 2009 2:59 PM To: Daevid Vincent Cc: php-general@lists.php.net Subject: Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla On Mon, Apr 27, 2009 at 2:47 PM, Daevid Vincent dae...@daevid.com wrote: I got that one done for you: http://www.daevid.com/content/examples/roach.php p.s. the PHP code is absolute crap by the way. I inherited the start of this and just had to keep building on top of it, so i never got time to re-write it properly, only fix as I went. It's a dead project at this point, so someone is free to pick up where I left off as Lockdown is no more. Well, thanks for that; it seems like it's got a lot of features. A big one to examine would be looking at its integration with svn. But I like the triage assignment by default. It's a little disappointing though if you're selling it with the note of the code is crap ... :) I'll toss it over to my boss who is the one messing around with trac/redmine/etc and see what he has to say. I just didn't want someone to think this was the caliber of code I wrote! ;-) I cleaned up what I could, when I could, but we're not in the business of writing a CR tracker -- so it got a small percentage of my time. I am using Trac personally, but I'm not a fan of Trac's ticket system. Roach is way more powerful in that respect, but the overall Wiki/SVN/Ticket/Plugin integration outweighs the lacking Ticket system. Roach is the best ticket system I've ever used -- and I say that honestly. I'm stuck with FogBugz here at work and really don't like it. I hated Bugzilla. I've tried a few others as well and didn't like them either. For sure Roach isn't as polished or pretty or fancy-pants web 2.0 ajaxy. But it is solid. it works well and shows the info you want when/where you want it. It's fast. It's flexible. And IMHO it works the way developers work. Like I said, 6 years of daily use by 25 developers really helped to refine what mattered and what didn't. The hooks with SVN are also great. For example someone couldn't commit to SVN without the corresponding CR in Roach in the commit message. I thought I had the SVN pre-commit and post-commit hooks in the tarball, but apparently not. They were written in Ruby, so maybe not so useful to you anyways. I'm sure i have them somewhere if you really wanted them. d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code - webbytedd examples
The watermark worked in FF3...(for me, at least.) On Mon, Apr 27, 2009 at 6:16 PM, Daevid Vincent dae...@daevid.com wrote: This is tripping me out! i feel so duped! :) http://webbytedd.com/b1/photo-retouch/ this didn't work, maybe due to some JS errors. tried in FF3 and IE6. http://webbytedd.com/b/watermark/ I like your arrow captch idea: http://webbytedd.com/aa/assorted-captcha/ also the date and clock are nice: http://webbytedd.com/b/kewl-date/ http://webbytedd.com/b/binary-clock/ the transparent bg is green in FF3/XP and IE6/XP http://webbytedd.com/ccc/dragdrop/ http://webbytedd.com/b/color-rows/ you know you can do this too: tr class=?= (($r = !$r) ? 'row0' : 'row1' ) ? How come you don't have a way to see/download the source code for all these examples? cheers, http://daevid.com Some people, when confronted with a problem, think 'I know, I'll use XML.' Now they have two problems. -Original Message- From: Charles Harvey [mailto:linux...@gmail.com] Sent: Saturday, April 25, 2009 11:56 AM To: php-general@lists.php.net Subject: Re: [PHP] I need ideas for things to code This was a surprisingly good idea that works for me, as I haven't coded in about 3 years and need to get my hand back in. Trying to make use of one idea led to several others. Thanks, tedd! Charles On Sat, Apr 25, 2009 at 4:54 AM, tedd tedd.sperl...@gmail.com wrote: At 7:00 PM -0400 4/24/09, Andrew Hucks wrote: I've been coding PHP for about a year, and I'm running out of things to code that force me to learn new things. If you have any suggestions, I'd greatly appreciate it. Andrew: Here's an idea. Go through the php manuals and make small examples of everything you find. That way not only do you learn, but you have examples to fall back on when the need rises. Here's a small (believe me) portion of the demo's I've written over the years: http://webbytedd.com/a.php These cover different languages, but it will give you the idea. Just make a inventory of examples and post them with code. Not only will it help you, but might help others when you answer questions on this list showing the solution. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: utf-8 ?
On 4/27/09 3:57 PM, 9el le...@phpxperts.net wrote: Hey Tom Also share your findings plz :) to deal with the formatting i put it on wordpress: http://thefsb.wordpress.com/2009/04/27/converting-phpmysqlapache-app-from-la tin-1-to-utf-8/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla
On Mon, Apr 27, 2009 at 3:27 PM, Daevid Vincent dae...@daevid.com wrote: I just didn't want someone to think this was the caliber of code I wrote! ;-) totally understood. i don't like people getting the wrong idea of my code too :) I am using Trac personally, but I'm not a fan of Trac's ticket system. Roach is way more powerful in that respect, but the overall Wiki/SVN/Ticket/Plugin integration outweighs the lacking Ticket system. Me too. The whole wiki style is a bit funky for ticketing. I think bugzilla is nasty and I hate supporting old CGI programs. It just seems like they never change design-wise, definately UI but also conceptually for the most part. The hooks with SVN are also great. For example someone couldn't commit to SVN without the corresponding CR in Roach in the commit message. I thought I had the SVN pre-commit and post-commit hooks in the tarball, but apparently not. They were written in Ruby, so maybe not so useful to you anyways. I'm sure i have them somewhere if you really wanted them. Sure, you should include them in the package. Worst case if we wind up doing something with hooks I can use them as a cue on how to reject without including a ticket ID for example, etc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla
Michael Shadle wrote: On Mon, Apr 27, 2009 at 5:46 PM, Shawn McKenzie nos...@mckenzies.net wrote: #1 Which one are we talking about? Tickets/trackers (Bugzilla, Mantis, Roach, you name it) and SCM integration tools (Redmine, Trac) OK, so geared towards software bugs I assume (I haven't used any)? #2 Having rarely used either, what are the main (must have) features? For general purpose ticketing engine, it would need custom field support. For specifically designed solutions it depends. For us we only need a few fields, really. I've hacked together bits and pieces in only a few minutes, we're using a custom one right now, but one with active development would be nice - APIs and plugins for extensibility, XML/RSS feeds, etc. Those aren't required but should come standard nowadays... OK, so I am not familiar with the bug tracking software or anything that it needs to do, but I find it hard to believe that at the top of the list would be APIs, plugins, RSS. These don't sound like main features of a bug tracking app. #3 What are the needed features that other OSS solutions don't offer? Clean interface, easy reporting, integration with SCM (i.e. svn) - various apps do various combinations of these. If it was done in PHP it would be perfect as we could bolt on our custom authentication into it. Trac is written in Python and Redmine in Ruby; we'd have to re-code our authentication integration into one of those languages for it. Oh, and multiple project support. Trac does not support this. Redmine claims to. (as in, multiple svn repositories as well) I can dig it... #4 What are the great features missing from free and commercial apps? I am not sure I've seen a commercial PHP app that does this. Doesn't matter PHP or other. What is not available in any other product that would be awesome to have (wish list)? -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code - webbytedd examples
On Mon, Apr 27, 2009 at 03:16:10PM -0700, Daevid Vincent wrote: This is tripping me out! i feel so duped! :) http://webbytedd.com/b1/photo-retouch/ this didn't work, maybe due to some JS errors. tried in FF3 and IE6. http://webbytedd.com/b/watermark/ I like your arrow captch idea: http://webbytedd.com/aa/assorted-captcha/ also the date and clock are nice: http://webbytedd.com/b/kewl-date/ http://webbytedd.com/b/binary-clock/ the transparent bg is green in FF3/XP and IE6/XP http://webbytedd.com/ccc/dragdrop/ http://webbytedd.com/b/color-rows/ you know you can do this too: tr class=?= (($r = !$r) ? 'row0' : 'row1' ) ? How come you don't have a way to see/download the source code for all these examples? I noticed that, too. But I have to say, this is one of the coolest sites I've ever seen. If you wanted to convince someone (a prospect) you could do something, this site would do it. Next time I talk to a prospect, I'm gonna call myself Tedd and refer them to this site. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla
Michael Shadle wrote: On Mon, Apr 27, 2009 at 3:27 PM, Daevid Vincent dae...@daevid.com wrote: I just didn't want someone to think this was the caliber of code I wrote! ;-) totally understood. i don't like people getting the wrong idea of my code too :) I am using Trac personally, but I'm not a fan of Trac's ticket system. Roach is way more powerful in that respect, but the overall Wiki/SVN/Ticket/Plugin integration outweighs the lacking Ticket system. Me too. The whole wiki style is a bit funky for ticketing. I think bugzilla is nasty and I hate supporting old CGI programs. It just seems like they never change design-wise, definately UI but also conceptually for the most part. The hooks with SVN are also great. For example someone couldn't commit to SVN without the corresponding CR in Roach in the commit message. I thought I had the SVN pre-commit and post-commit hooks in the tarball, but apparently not. They were written in Ruby, so maybe not so useful to you anyways. I'm sure i have them somewhere if you really wanted them. Sure, you should include them in the package. Worst case if we wind up doing something with hooks I can use them as a cue on how to reject without including a ticket ID for example, etc. OK, so I'm just now jumping into the conversation, not because I use or need a ticketing system, quite the opposite. I have rarely used a ticketing system and wonder whether this discussion is more about a ticketing system (I have a problem with this service/widget and need help) or bug tracking (software has bug, from user or dev)? #1 Which one are we talking about? #2 Having rarely used either, what are the main (must have) features? #3 What are the needed features that other OSS solutions don't offer? #4 What are the great features missing from free and commercial apps? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla
On Mon, Apr 27, 2009 at 5:46 PM, Shawn McKenzie nos...@mckenzies.net wrote: #1 Which one are we talking about? Tickets/trackers (Bugzilla, Mantis, Roach, you name it) and SCM integration tools (Redmine, Trac) #2 Having rarely used either, what are the main (must have) features? For general purpose ticketing engine, it would need custom field support. For specifically designed solutions it depends. For us we only need a few fields, really. I've hacked together bits and pieces in only a few minutes, we're using a custom one right now, but one with active development would be nice - APIs and plugins for extensibility, XML/RSS feeds, etc. Those aren't required but should come standard nowadays... #3 What are the needed features that other OSS solutions don't offer? Clean interface, easy reporting, integration with SCM (i.e. svn) - various apps do various combinations of these. If it was done in PHP it would be perfect as we could bolt on our custom authentication into it. Trac is written in Python and Redmine in Ruby; we'd have to re-code our authentication integration into one of those languages for it. Oh, and multiple project support. Trac does not support this. Redmine claims to. (as in, multiple svn repositories as well) #4 What are the great features missing from free and commercial apps? I am not sure I've seen a commercial PHP app that does this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I need ideas for things to code -- Roach vs Bugzilla
On Mon, Apr 27, 2009 at 6:09 PM, Shawn McKenzie nos...@mckenzies.net wrote: OK, so geared towards software bugs I assume (I haven't used any)? Web site development, a little system administration. But yes, basically software bugs. OK, so I am not familiar with the bug tracking software or anything that it needs to do, but I find it hard to believe that at the top of the list would be APIs, plugins, RSS. These don't sound like main features of a bug tracking app. APIs for bug insertion, deletion, reporting, etc. is not far off from a core product. Especially in web 2.0 land nowadays. We have multiple installations of bugzilla and other tracking mechanisms in and outside of the company feeding off each other, with no clean interfaces. Of course there are hundreds of generic bug tracking programs out there. Anyone with a PHP book can make one. We'd like to align with an industry standard type one, or one with an active community, but there is no real big one I am aware of other than Bugzilla (if not factoring in language) or Mantis (for PHP), or with SCM interaction Redmine and Trac. Trac won't work for us because we have multiple repositories/projects. We'd have to hack together some sort of solution to manage all of them from one, or install a bunch of instances, and then we'd have bugs in multiple systems to track. Each developer on our team handles code for at least one project, just FYI. Redmine may work, but we need more time to determine if we can hack our own auth layer on top of it. Even then I am not sure if it will meet our needs 100% or not. We have not evaluated it enough yet. Doesn't matter PHP or other. What is not available in any other product that would be awesome to have (wish list)? Most products are bloated. Part of my wish list would be that it is written in PHP, so our team can extend it without writing beginner insert language here code to try to customize the couple things we'd need to tweak (like the auth layer) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php