Re: [PHP] Array / form processing
Ron Piggott schrieb: I am writing a custom shopping cart that eventually the cart will be uploaded to PayPal for payment. I need to be able to include the option that the purchase is a gift certificate. At present my add to cart function goes like this: === # Gift Certificate: 1 is a gift; 2 is personal use if ( $gift_certificate == yes ) { $gift = 1; } else { $gift = 2; } $_SESSION['life_coaching_order'][$product][$gift]['quantity'] = $_SESSION['life_coaching_order'][$product][$gift]['quantity'] + 1; === Now I need to display the shopping cart contents. I want to do this through an array as the contents of the shopping cart are in a session variable. I start displaying the shopping cart contents by a FOREACH loop: === foreach ($_SESSION['life_coaching_order'] AS $coaching_fee_theme_reference = $value ) { === What I need help with is that I don't know how to test the value of $gift in the above array if it is a 1 or 2 (which symbolizes this is a gift certificate). I have something like this in mind: if ( $_SESSION['life_coaching_order'] == 2 ) { But I don't know how to access all the components of the array while I am going through the FOREACH loop. By using a 1 or 2 I have made gift certificates their own product. If you a better method I could use please provide me with this feedback. Ron The Verse of the Day Encouragement from God's Word www.TheVerseOfTheDay.info First at all, I wouldn't use 1 or 2 for defining important informations. use something like define('ORDER_GIFT', 1); define('ORDER_PERSONAL',2); If you want to check all values of your array you can use several foreach loops like foreach ($_SESSION['life_coaching_order'] AS $coaching_product = $tmp_array) { foreach ($tmp_array as $coaching_gift = $tmp_array2) { switch ($coaching_gift) case ORDER_GIFT: break; case ORDER_PERSONAL: break; ) } } Personally I would prefer writing a class like class Order { private $product; private $gift; private $quantity; const ORDER_GIFT=1; const ORDER_PERSONAL=2; function getGift() { return $this - gift; } } using $_SESSION['life_coaching_order'][] = new Order(); foreach ( $_SESSION['life_coaching_order'] as $order ) { switch ( $order - getGift() ) case ORDER_GIFT: break; case ORDER_PERSONAL: break; } I hope that will help you, Sebastian http://elygor.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and HBCI?
Hello, is there a way to do HBCI banking with PHP? stephan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and HBCI?
How do you mean? Did you want to process payments? Or wad it more of an actual banking thing you needed? I've not heard of hbci before, so can't offer much information back. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Stephan Ebelt s...@shared-files.de Date: Fri, Oct 8, 2010 13:37 Subject: [PHP] PHP and HBCI? To: PHP php-general@lists.php.net Hello, is there a way to do HBCI banking with PHP? stephan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and HBCI?
[snip] is there a way to do HBCI banking with PHP? [/snip] yes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Friday's Post
-Original Message- From: Peter Lind [mailto:peter.e.l...@gmail.com] Sent: Saturday, October 02, 2010 2:17 AM To: Per Jessen Cc: php-general@lists.php.net Subject: Re: [PHP] Re: Friday's Post On 2 October 2010 11:05, Per Jessen p...@computer.org wrote: Peter Lind wrote: On 1 October 2010 20:21, Per Jessen p...@computer.org wrote: Peter Lind wrote: C# has by now exceeded Java by quite a bit - I've been away from the Java scene since 2002 (when I worked for BEA deploying J2EE on Linux/390), but assuming you're talking about deployed lines of code or some other real-life measurement, I find it hard to believe that C# should have exceeded Java. Language functionality. I'd much rather use C# than Java as I can do more in C# and easier than with Java. For instance, C# 4 has support for late binding to dynamic types. Does Java have an equivalent? Is it planned? I don't know, but Java obviously supports late binding. I was looking more for dynamic types, much more of interest to the average PHP dev as that's one of the typical stumbling blocks when switching languages. And no, far as I can tell Java doesn't offer that. Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind BeWelcome/Couchsurfing: Fake51 Twitter: http://twitter.com/kafe15 /hype I haven't done a lot of coding in Java ASP.NET/Winform (specifically C#) yet. But from what I've seen and like so far is that ASP.NET supports unsigned primitive types (S/Byte, U/Int16, U/Int32, U/Int64) while Java doesn't - even though there are requests to have it implemented/supported back in late 1990s. Also, it's a shame that the same support doesn't carry to MS' SQL Server. It's a +1 for MySQL here! But then, if you intend to use MS' MVC in the future, it's only officially supported in v3.5+ (it's MS way of forcing people to upgrade). That being the case, it's no longer 'deploy anywhere' since Mono only supports up to v2, IIRC. PHP Java has the major advantage of 'develop anywhere' 'deploy anywhere'. Thus in the long run, you have lower TCO, IMO, due to the licensing for the OS and individual 'client access'... Anywhere = any OS that will support the JDK and/or PHP binaries. Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and HBCI?
On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote: How do you mean? Did you want to process payments? Or wad it more of an actual banking thing you needed? I've not heard of hbci before, so can't offer much information back. HBCI is the german Home Banking Computer Interface which is supported by most banks over here. There are free implementations such as the one used in gnucash and some other projects: http://www.aquamaniac.de/sites/aqbanking/index.php (sorry, site is german but code is english). I could not find a way to use something like that from PHP code, only C and Java so far. My goal for now would be to access bank account statements in order to show the balances. I am not too eager to issue transactions. thanks, stephan Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Stephan Ebelt s...@shared-files.de Date: Fri, Oct 8, 2010 13:37 Subject: [PHP] PHP and HBCI? To: PHP php-general@lists.php.net Hello, is there a way to do HBCI banking with PHP? stephan -- 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] PHP and HBCI?
wikipedia has a good summary: http://en.wikipedia.org/wiki/HBCI#FinTS_4.0 I just learned that its called FinTS now. Looking for that didnt bring me closer yet. stephan On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote: How do you mean? Did you want to process payments? Or wad it more of an actual banking thing you needed? I've not heard of hbci before, so can't offer much information back. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Stephan Ebelt s...@shared-files.de Date: Fri, Oct 8, 2010 13:37 Subject: [PHP] PHP and HBCI? To: PHP php-general@lists.php.net Hello, is there a way to do HBCI banking with PHP? stephan -- 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] PHP and HBCI?
Do you have any specifications for HBCI interfaces? Socket connection, XML Exchange, DB Access ? If you have C code for such things, it should be possible to convert this to php code maybe Stephan Ebelt schrieb: On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote: How do you mean? Did you want to process payments? Or wad it more of an actual banking thing you needed? I've not heard of hbci before, so can't offer much information back. HBCI is the german Home Banking Computer Interface which is supported by most banks over here. There are free implementations such as the one used in gnucash and some other projects: http://www.aquamaniac.de/sites/aqbanking/index.php (sorry, site is german but code is english). I could not find a way to use something like that from PHP code, only C and Java so far. My goal for now would be to access bank account statements in order to show the balances. I am not too eager to issue transactions. thanks, stephan Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Stephan Ebelt s...@shared-files.de Date: Fri, Oct 8, 2010 13:37 Subject: [PHP] PHP and HBCI? To: PHP php-general@lists.php.net Hello, is there a way to do HBCI banking with PHP? stephan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] poll of 'public framework or roll your own'
Hi, Does anyone know/remember what's the results of that old poll back in mid(?) January? http://marc.info/?l=php-generalm=126455173203450w=2 I can't seem to access http://www.rapidpoll.net/8opnt1e. Thanks, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5 - website development - what next
Hi All, I am PHP 4 PHP 5 developer for last 6 yrs. Last year also got Zend certification. Since now I have work on different CMS, Social Networking, telecome , horse racing domains. But now I am little bored with developing website. What other things I can do with PHP ? Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. Regards Rakesh
Re: [PHP] PHP and HBCI?
common is probably XML via HTTPS transport (at least my bank seems to do it that way). I have no C code whatsoever. Can PHP call arbitrary C functions? Then it might be possible to use AqHBCI/AqBanking somehow? On Fri, Oct 08, 2010 at 03:39:04PM +0200, Sebastian Detert wrote: Do you have any specifications for HBCI interfaces? Socket connection, XML Exchange, DB Access ? If you have C code for such things, it should be possible to convert this to php code maybe Stephan Ebelt schrieb: On Fri, Oct 08, 2010 at 01:50:12PM +0100, a...@ashleysheridan.co.uk wrote: How do you mean? Did you want to process payments? Or wad it more of an actual banking thing you needed? I've not heard of hbci before, so can't offer much information back. HBCI is the german Home Banking Computer Interface which is supported by most banks over here. There are free implementations such as the one used in gnucash and some other projects: http://www.aquamaniac.de/sites/aqbanking/index.php (sorry, site is german but code is english). I could not find a way to use something like that from PHP code, only C and Java so far. My goal for now would be to access bank account statements in order to show the balances. I am not too eager to issue transactions. thanks, stephan Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Stephan Ebelt s...@shared-files.de Date: Fri, Oct 8, 2010 13:37 Subject: [PHP] PHP and HBCI? To: PHP php-general@lists.php.net Hello, is there a way to do HBCI banking with PHP? stephan -- 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] php5 - website development - what next
On Fri, Oct 8, 2010 at 09:53, Rakesh Mishra rakesh.mis...@gmail.com wrote: Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. Write desktop applications: http://gtk.php.net/ . -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 - website development - what next
On 10/08/2010 22:06, 惠新宸 wrote: test, i can't send mail to lists? thanks On 10/08/2010 22:02, 惠新宸 wrote: Hi: 1. you can be a Software Architect 2. you can abstract common requirements, developed php extension. thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 - website development - what next
On Fri, Oct 08, 2010 at 07:23:59PM +0530, Rakesh Mishra wrote: Hi All, I am PHP 4 PHP 5 developer for last 6 yrs. Last year also got Zend certification. Since now I have work on different CMS, Social Networking, telecome , horse racing domains. But now I am little bored with developing website. What other things I can do with PHP ? Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. There are a variety of major projects which use PHP as their primary language. Like WordPress. See freshmeat.net and sourceforge.net for projects written in PHP. You could contribute to these projects, and increase your knowledge and prestige. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and HBCI?
Stephan Ebelt wrote: common is probably XML via HTTPS transport (at least my bank seems to do it that way). I have no C code whatsoever. Can PHP call arbitrary C functions? Then it might be possible to use AqHBCI/AqBanking somehow? You (or someone) would need to write a PHP wrapper for the C functions, but otherwise yes. -- Per Jessen, Zürich (17.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php5 - website development - what next
On 8 October 2010 14:53, Rakesh Mishra rakesh.mis...@gmail.com wrote: Hi All, I am PHP 4 PHP 5 developer for last 6 yrs. Last year also got Zend certification. Since now I have work on different CMS, Social Networking, telecome , horse racing domains. But now I am little bored with developing website. What other things I can do with PHP ? Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. Regards Rakesh I'm building Windows Services (not Web Services) with PHP and an enhanced pecl/win32service extension, in conjunction with WScript.Shell to simulate threading and and WinCache for inter-processing comms. OK. It is a daft thing to do. But it is working and is replacing a bunch of console apps written in .BAT with some .EXEs. The SysOps are happier as it is just a normal windows services (so they can stop/start/pause it). Shutdown/bootup server - all OK. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php5 - website development - what next
Rakesh Mishra wrote: Hi All, I am PHP 4 PHP 5 developer for last 6 yrs. Last year also got Zend certification. Since now I have work on different CMS, Social Networking, telecome , horse racing domains. But now I am little bored with developing website. What other things I can do with PHP ? Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. I suggest you concentrate less on the language and more on: - interesting / challenging projects - using PHP with other new interesting technologies - applying design / programming paradigms from other languages in PHP - contributing to PHP internals Status.net, GNU Social, DISO Project, lorea.cc and elgg all occupy a rather interesting project space with small but inspiring communities of people who like to push technical boundaries and merge technologies, particularly within the social space. http://www.ushahidi.com/platform is a thriving project which combines technical excellence and forward thinking with real world large scale community needs, being critical in several major world events, even if you don't get involved, their code bases for ushahidi + related on http://github.com/ushahidi is brilliant, likewise the swiftriver project http://swift.ushahidi.com/ doesn't look much on the face of it but is really good - just check out the SwiftRiver Research at the right. There are many interesting protocol based communities who often implement in PHP, and these can be rather interesting / challenging and active spaces - ActivityStreams, Salmon-Protocol, OneSocialWeb to name just a few. On the technology side of things, you may want to consider going down the NoSQL route for a while, http://nosql-database.org/ gives a good summary of database - I'd recommend CouchDB, MongoDB and Redis for a nice well supported start that will introduce you to new design paradigms and bring many performance increases to your applications. Alternatively you may find it refreshing to try some other languages, perhaps a functional language like Scala, OCaml or Haskell, or maybe in to a very active language such as ECMAScript (server side js) via something like http://node.js/ you may just find that you don't want to use PHP any more, or you may find that you want to apply the paradigms and lessons learned to PHP using the new features in 5.3 Hope that helps a little, I'll stop here because I could list projects till the end of time! Many Regards Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: zip and mac safari
M. Reuter wrote: Hi, does anyone know how to use a php script to zip a folder (with a subfolder) so that safari can open it and not decompresses forever? if it works in other browsers, and not in safari, then it's either a big in safari, in which case report it with an offending zip file - or it's a big in PHP / your zipping process which is handled gracefully by other browsers but not by safari, in which case report it too. Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tedd's Friday Post ($ per line)
tedd wrote: Now, back to the question at hand -- what price would you sell a line of your code for? Interesting case and question Tedd! Quite sure we all realise the answer is not black and white but various shades of grey, and I wouldn't fancy doing this for real - however, given the assumption that it was technically solid code average, and assuming it was a functional approach (as in there wasn't chunks of domain schema classes with nothing but getters and setters around / boiler plate junk), then: 35-40 cents per line The approach I've taken to working it out is to try and average out lines of code produced per 8 hour working day, allowing time for research, decision making, minor code reduction and refactoring, then adding a small offset for any time spend on documentation which would show further understanding and confidence in the code + make it more usable. Whitespace and a coding styles which produce more lines but the same amount of code not included. I've also made a small adjustment for the 'several years ago' all though I'm assuming this to be early 2000s and not the 1970s ;) Anywhere near? ps: tedd, please cc me in to the final answer as I won't have time to check the list for a while, and I'm quite interested in this one - kudos to you if you managed to do it and get both parties happy with the result though! Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] tedd's Friday Post ($ per line)
Nathan Rixham wrote: tedd wrote: Now, back to the question at hand -- what price would you sell a line of your code for? Just realised I responded to the wrong question - the answer was how I'd approach the original question What do you think he was paid? For myself, I wouldn't place a price on a single line of code, you can have one for free :) if you want me to do 25,000 lines of code then it'll be circa £1 GBP per line, seeing as you aren't considering any of the other factors. Unless it's open source as I cc-zero all my open source / community stuff. Interesting case and question Tedd! Quite sure we all realise the answer is not black and white but various shades of grey, and I wouldn't fancy doing this for real - however, given the assumption that it was technically solid code average, and assuming it was a functional approach (as in there wasn't chunks of domain schema classes with nothing but getters and setters around / boiler plate junk), then: 35-40 cents per line The approach I've taken to working it out is to try and average out lines of code produced per 8 hour working day, allowing time for research, decision making, minor code reduction and refactoring, then adding a small offset for any time spend on documentation which would show further understanding and confidence in the code + make it more usable. Whitespace and a coding styles which produce more lines but the same amount of code not included. I've also made a small adjustment for the 'several years ago' all though I'm assuming this to be early 2000s and not the 1970s ;) Anywhere near? ps: tedd, please cc me in to the final answer as I won't have time to check the list for a while, and I'm quite interested in this one - kudos to you if you managed to do it and get both parties happy with the result though! Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] which one is faster
chris h wrote: Saeed here's a quick (and dirty) test I ran: $tests = 100; $start = microtime(true); for ($i=0; $i$tests; $i++) { $a = md5( rand() ); $b = md5( rand() ); $c = $a.$b; } var_dump( By concat op:\t. (microtime(true) - $start) ); that's not a fair test because you have rand() and md5() calls in there (something temporally varying) Here's a quick test script which does 100 million iterations on both, 3 times to get some half measurable results $i = $its = 1; $tests = 3; $a = 'foo'; $b = 'bar'; while($tests--0) { $t = microtime(true); while($i--0) { $c = $a$b; } echo 'time .: ' . (microtime(true)-$t) . PHP_EOL; $i = $its; $t = microtime(true); while($i--0) { $c = $a.$b; } echo 'time : ' . (microtime(true)-$t) . PHP_EOL; } I also ran the tests in the opposite order just to ensure they were fair, results are that $a.$b (concatenation) averaged 22 seconds, and the $a$b approach was 28 seconds. Thus, concatenation is faster - but you have to get up to circa 10 million+ uses per second to use it. Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Casting from parent class to child
David Harkness wrote: Casting does not change an object. You must copy the relevant value(s) from the object returned into a new DateTimePlus. Since DateTime's constructor takes only a string, and I assume it won't accept your format directly, unless you implement __toString I believe (not tested) you're better off converting the string into a Unix timestamp and creating a new object from that. However, I leave that optimization to you. The following code is sufficient: $plus = new DateTimePlus(); $plus.setTimestamp(parent::createFromFormat(H.i d.m.Y, $string).getTimestamp()); return $plus; David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
I did a search thru all places on php.net for moonrise and moonset functions or any comments about moonrise and moonset. I can not find anything about moonrise and moonset. I am not sure where to submit my ideas. I would like to suggest to php developers to add in the moonrise and moonset functions. I think the moonrise and moonset functions should be added in php. date_moonrise date_moonset date_moon_info those functions would be great to have in future version of php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What other languages do you use?
As per the subject, not what other languages have you used, but what other languages do you currently use? I guess it may also be interesting to know if: (1) there's any particular reason for you using a different language (other than work/day-job/client requires it) (2) about to jump in to another language Best, Nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
On Fri, Oct 8, 2010 at 13:29, ELY M. s...@mboca.com wrote: I did a search thru all places on php.net for moonrise and moonset functions or any comments about moonrise and moonset. I can not find anything about moonrise and moonset. I am not sure where to submit my ideas. I would like to suggest to php developers to add in the moonrise and moonset functions. I think the moonrise and moonset functions should be added in php. date_moonrise date_moonset date_moon_info those functions would be great to have in future version of php. Do it as a feature request at http://bugs.php.net/ and we'll look into it. In related matters, I just approved a user note with a code snippet example for sunrise and sunset. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
On Fri, Oct 8, 2010 at 13:30, Nathan Rixham nrix...@gmail.com wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? Spanish, Gaelic, and German, on occasion. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Casting from parent class to child
On Fri, Oct 8, 2010 at 12:50 PM, Nathan Rixham nrix...@gmail.com wrote: David Harkness wrote: Casting does not change an object. You must copy the relevant value(s) from the object returned into a new DateTimePlus. Since DateTime's constructor takes only a string, and I assume it won't accept your format directly, unless you implement __toString I believe (not tested) IMO, that would be a truly useful feature to add if you were extending DateTime anyway. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? French, German, English and Danish. -- Per Jessen, Zürich (14.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
On Fri, 2010-10-08 at 13:33 -0400, Daniel Brown wrote: On Fri, Oct 8, 2010 at 13:29, ELY M. s...@mboca.com wrote: I did a search thru all places on php.net for moonrise and moonset functions or any comments about moonrise and moonset. I can not find anything about moonrise and moonset. I am not sure where to submit my ideas. I would like to suggest to php developers to add in the moonrise and moonset functions. I think the moonrise and moonset functions should be added in php. date_moonrise date_moonset date_moon_info those functions would be great to have in future version of php. Do it as a feature request at http://bugs.php.net/ and we'll look into it. In related matters, I just approved a user note with a code snippet example for sunrise and sunset. In his defense, he was talking abut moonrise, and moonset... in some cases, the moon is up during the middle of the day... this originally started out a joke reply... but then after thinking about what to say, I realized that the moonrise/set does not follow the sun... crap, i hate my brain... LOL on a side note, where would you even get this info? is there a set formula for sunrise/set? Steve -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
Per Jessen wrote: Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? French, German, English and Danish. Wrt programming languages (and variations thereof), in order of usage, I use C, PHP, C++, assembler, shell-script, XSLT with some occasional HTML and Javascript thrown in for good measure :-). -- Per Jessen, Zürich (15.1°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
On Fri, Oct 8, 2010 at 13:43, Per Jessen p...@computer.org wrote: Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? French, German, English and Danish. Wenn große Geister gleich denken, Herr Jessen, wie geht es uns beiden auf der gleichen Seite? ;-P -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
From: Steve Staples On Fri, 2010-10-08 at 13:33 -0400, Daniel Brown wrote: On Fri, Oct 8, 2010 at 13:29, ELY M. s...@mboca.com wrote: I did a search thru all places on php.net for moonrise and moonset functions or any comments about moonrise and moonset. I can not find anything about moonrise and moonset. I am not sure where to submit my ideas. I would like to suggest to php developers to add in the moonrise and moonset functions. I think the moonrise and moonset functions should be added in php. date_moonrise date_moonset date_moon_info those functions would be great to have in future version of php. Do it as a feature request at http://bugs.php.net/ and we'll look into it. In related matters, I just approved a user note with a code snippet example for sunrise and sunset. In his defense, he was talking abut moonrise, and moonset... in some cases, the moon is up during the middle of the day... this originally started out a joke reply... but then after thinking about what to say, I realized that the moonrise/set does not follow the sun... crap, i hate my brain... LOL on a side note, where would you even get this info? is there a set formula for sunrise/set? It would also require both latitude and longitude input parameters. Rough guess in temperate zones is that for each 250 miles you move west, it delays the event by 15 minutes. But when you get within 22 degrees of a pole, the event may not occur for days, or weeks, or ... Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
On Fri, Oct 8, 2010 at 10:30 AM, Nathan Rixham nrix...@gmail.com wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? At work: PHP and Java mostly with some Javascript and BASH scripting thrown in for good measure. We use PHP for the website and Java for the deployment/tools platform and any backend system that needs multithreading. At play: Python and C++ for BUG Mod (Civ4 mod). Learning Lua for Civ5 but have been too busy lately. :( David
Re: [PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
On Fri, Oct 8, 2010 at 13:55, Steve Staples sstap...@mnsi.net wrote: In his defense, he was talking abut moonrise, and moonset... in some cases, the moon is up during the middle of the day... this originally started out a joke reply... but then after thinking about what to say, I realized that the moonrise/set does not follow the sun... crap, i hate my brain... LOL True, it wouldn't be enough to calculate it as an inverse of solar traversal, but there are of course predetermined formulae for both moon phases and its traversal based on longitudinal and latitudinal coordinates, and adjustments for altitude and horizon variances. on a side note, where would you even get this info? is there a set formula for sunrise/set? Sure. Look up sunrise and sunset times on Google and you'll see they're readily available. Then it's trivial to calculate axial tilt and time elapse between periods of equinox to find the variances for dates not already pre-calculated. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
On Fri, Oct 8, 2010 at 14:14, Bob McConnell r...@cbord.com wrote: It would also require both latitude and longitude input parameters. Rough guess in temperate zones is that for each 250 miles you move west, it delays the event by 15 minutes. But when you get within 22 degrees of a pole, the event may not occur for days, or weeks, or ... Yeah, but unfortunately those places are sometimes rather difficult to visit, which is rather unfortunate. I have four decades worth of things to shove where the sun don't shine, by order of various folks. By the way --- I realized moments after my previous reply that the OP is actually the snippet submitter I mentioned in thread, and you can see his work on the date_sun_info() function's manual page here: http://php.net/date_sun_info With a direct link to his submission here: http://php.net/manual/en/function.date-sun-info.php#100332 -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
Per Jessen wrote: Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? French, German, English and Danish. Forhåbentlig ikke alle zur en même temps -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
Daniel P. Brown wrote: On Fri, Oct 8, 2010 at 13:30, Nathan Rixham nrix...@gmail.com wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? Spanish, Gaelic, and German, on occasion. Ahhh, but have you mastered Ambiguity yet? ps: thanks for that Dan, you've set them off now ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] What other languages do you use?
From: Nathan Rixham As per the subject, not what other languages have you used, but what other languages do you currently use? I guess it may also be interesting to know if: (1) there's any particular reason for you using a different language (other than work/day-job/client requires it) (2) about to jump in to another language C, Perl and Java. Been programming embedded devices and credit card terminals in C (and ASM) for about three decades. Still have to maintain that code. (We are supporting some devices that went out of production in 1992.) Have dabbled in Perl for about half of that time. Started out doing Perl-CGI for a web site. It's useful for generating test data to emulate random events, test drivers for communications protocols and to control test systems. I'm still learning both PHP and Java. I know just enough of each to be very dangerous. I'm most comfortable in C, so I lean towards that for casual projects at home. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
Nathan Rixham wrote: Per Jessen wrote: Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? French, German, English and Danish. Forhåbentlig ikke alle zur en même temps Ork jo, das ist doch ikke ein Problem. -- Per Jessen, Zürich (12.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
Per Jessen wrote: Nathan Rixham wrote: Per Jessen wrote: Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? French, German, English and Danish. Forhåbentlig ikke alle zur en même temps Ork jo, das ist doch ikke ein Problem. Blimey, how did I manage to leave out two obviously il-y-a une probleme, after all. -- Per Jessen, Zürich (12.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
On Oct 8, 2010, at 12:30 PM, Nathan Rixham wrote: As per the subject, not what other languages have you used, but what other languages do you currently use? Perl, Ruby, Javascript, Sh, C. Planning on picking up Python. I guess it may also be interesting to know if: (1) there's any particular reason for you using a different language (other than work/day-job/client requires it) Usually just choose the language that best fits the application at hand. No real magic to it. (2) about to jump in to another language I mentioned Python above, not as a replacement for any of the other languages, but just because I want to know it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What other languages do you use?
At home I always speak in Bangla. But at work I have to speak in English. I watch Hindi movies well. So I understand Hindi too. I used, C Java C++ C# ActionScript Javascript Perl PHP Bash LISP Currently I am working in LISP C C++ At home I play with Bash, Javascript, PHP, C -- Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: zip and mac safari
I don't have any problem in this regard. On Oct 8, 2010, at 11:09 AM, Nathan Rixham wrote: M. Reuter wrote: Hi, does anyone know how to use a php script to zip a folder (with a subfolder) so that safari can open it and not decompresses forever? if it works in other browsers, and not in safari, then it's either a big in safari, in which case report it with an offending zip file - or it's a big in PHP / your zipping process which is handled gracefully by other browsers but not by safari, in which case report it too. Best, Nathan -- 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] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset
-Original Message- From: Bob McConnell [mailto:r...@cbord.com] Sent: Friday, October 08, 2010 11:15 AM To: sstap...@mnsi.net; php-general@lists.php.net Subject: RE: [PHP] [IDEA] date_moonrise, date_moonset, and date_moon_info for calculating moonrise and moonset From: Steve Staples On Fri, 2010-10-08 at 13:33 -0400, Daniel Brown wrote: On Fri, Oct 8, 2010 at 13:29, ELY M. s...@mboca.com wrote: I did a search thru all places on php.net for moonrise and moonset functions or any comments about moonrise and moonset. I can not find anything about moonrise and moonset. I am not sure where to submit my ideas. I would like to suggest to php developers to add in the moonrise and moonset functions. I think the moonrise and moonset functions should be added in php. date_moonrise date_moonset date_moon_info those functions would be great to have in future version of php. Do it as a feature request at http://bugs.php.net/ and we'll look into it. In related matters, I just approved a user note with a code snippet example for sunrise and sunset. In his defense, he was talking abut moonrise, and moonset... in some cases, the moon is up during the middle of the day... this originally started out a joke reply... but then after thinking about what to say, I realized that the moonrise/set does not follow the sun... crap, i hate my brain... LOL on a side note, where would you even get this info? is there a set formula for sunrise/set? It would also require both latitude and longitude input parameters. Rough guess in temperate zones is that for each 250 miles you move west, it delays the event by 15 minutes. But when you get within 22 degrees of a pole, the event may not occur for days, or weeks, or ... Bob McConnell The latitude and longitude would only give relative perspective view. For accurate measurement, doesn't it requires time of year also since it depends on rotations of earth around the sun and how far/close the earth to sun, which will affect the moon's rotation too? Just remembering my high school AP Physics on gravitational forces. Regards, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php5 - website development - what next
how about woking on open source projects? Best regards, Sharl.Jimh.Tsin (From China) 2010/10/8 Nathan Rixham nrix...@gmail.com: Rakesh Mishra wrote: Hi All, I am PHP 4 PHP 5 developer for last 6 yrs. Last year also got Zend certification. Since now I have work on different CMS, Social Networking, telecome , horse racing domains. But now I am little bored with developing website. What other things I can do with PHP ? Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. I suggest you concentrate less on the language and more on: - interesting / challenging projects - using PHP with other new interesting technologies - applying design / programming paradigms from other languages in PHP - contributing to PHP internals Status.net, GNU Social, DISO Project, lorea.cc and elgg all occupy a rather interesting project space with small but inspiring communities of people who like to push technical boundaries and merge technologies, particularly within the social space. http://www.ushahidi.com/platform is a thriving project which combines technical excellence and forward thinking with real world large scale community needs, being critical in several major world events, even if you don't get involved, their code bases for ushahidi + related on http://github.com/ushahidi is brilliant, likewise the swiftriver project http://swift.ushahidi.com/ doesn't look much on the face of it but is really good - just check out the SwiftRiver Research at the right. There are many interesting protocol based communities who often implement in PHP, and these can be rather interesting / challenging and active spaces - ActivityStreams, Salmon-Protocol, OneSocialWeb to name just a few. On the technology side of things, you may want to consider going down the NoSQL route for a while, http://nosql-database.org/ gives a good summary of database - I'd recommend CouchDB, MongoDB and Redis for a nice well supported start that will introduce you to new design paradigms and bring many performance increases to your applications. Alternatively you may find it refreshing to try some other languages, perhaps a functional language like Scala, OCaml or Haskell, or maybe in to a very active language such as ECMAScript (server side js) via something like http://node.js/ you may just find that you don't want to use PHP any more, or you may find that you want to apply the paradigms and lessons learned to PHP using the new features in 5.3 Hope that helps a little, I'll stop here because I could list projects till the end of time! Many Regards Nathan -- 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: php5 - website development - what next
Hi: good idea. I need assistance. lol, http://code.google.com/p/yafphp/ On 10/09/2010 09:22, Sharl.Jimh.Tsin wrote: how about woking on open source projects? Best regards, Sharl.Jimh.Tsin (From China) 2010/10/8 Nathan Rixhamnrix...@gmail.com: Rakesh Mishra wrote: Hi All, I am PHP 4 PHP 5 developer for last 6 yrs. Last year also got Zend certification. Since now I have work on different CMS, Social Networking, telecome , horse racing domains. But now I am little bored with developing website. What other things I can do with PHP ? Even I believe my knowledge, interest, market value with PHP 5 is getting saturated. Do you guys suggest me what other thing I can learn or work which help me to keep my lust for PHP alive and also boost my career. I suggest you concentrate less on the language and more on: - interesting / challenging projects - using PHP with other new interesting technologies - applying design / programming paradigms from other languages in PHP - contributing to PHP internals Status.net, GNU Social, DISO Project, lorea.cc and elgg all occupy a rather interesting project space with small but inspiring communities of people who like to push technical boundaries and merge technologies, particularly within the social space. http://www.ushahidi.com/platform is a thriving project which combines technical excellence and forward thinking with real world large scale community needs, being critical in several major world events, even if you don't get involved, their code bases for ushahidi + related on http://github.com/ushahidi is brilliant, likewise the swiftriver project http://swift.ushahidi.com/ doesn't look much on the face of it but is really good - just check out the SwiftRiver Research at the right. There are many interesting protocol based communities who often implement in PHP, and these can be rather interesting / challenging and active spaces - ActivityStreams, Salmon-Protocol, OneSocialWeb to name just a few. On the technology side of things, you may want to consider going down the NoSQL route for a while, http://nosql-database.org/ gives a good summary of database - I'd recommend CouchDB, MongoDB and Redis for a nice well supported start that will introduce you to new design paradigms and bring many performance increases to your applications. Alternatively you may find it refreshing to try some other languages, perhaps a functional language like Scala, OCaml or Haskell, or maybe in to a very active language such as ECMAScript (server side js) via something like http://node.js/ you may just find that you don't want to use PHP any more, or you may find that you want to apply the paradigms and lessons learned to PHP using the new features in 5.3 Hope that helps a little, I'll stop here because I could list projects till the end of time! Many Regards Nathan -- 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 -- Laruence Senior PHP consultant http://www.laruence.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php