« first day (262 days earlier)      last day (4676 days later) » 
06:00 - 16:0016:00 - 00:00

4:01 PM
anyways.. will be afk now.. if you have any additional suggestions how to handle adding/removing feeds by voting/starring feel free to suggest.
 
@Gordon I'm having so much trouble here with SimpleXMLElement
thinking of using preg_ to get the job done
I've valid XML right, $resp
no complaints when I: $respXML=new SimpleXMLElement($resp);
 
@AdamLynch cute kittens (not the Hello Kitty type) will die if you use preg* for that
 
but print_r($respXML) gives me back SimpleXMLElement Object ( )
I've been trying to sort this for aaaages now though
 
@AdamLynch cant help you with it right now. have to leave. consider asking a question on SO and make sure you show some code and the xml. its not easy to figure whats wrong without that information.
 
@Gordon ok np
 
4:13 PM
and if you post a question (and it's not too late) don't bother posting the print_r() output, that's useless for SimpleXML.
 
I think I'll just either do this testing manually or using preg_
sick of looking at this
 
what's the trouble?
 
I've valid XML, I stick it in a simpleXMLElement object and then that very object holds nothing
 
does it really hold nothing? what does $respXML->asXML() say?
(I'm going to guess default namespace problems, but we'll see.)
 
when you say "say" what do you mean?
echo/var_dump/what?
 
4:18 PM
echo is fine
 
ugh its not empty
"Just when I thought I was out... they pull me back in. "
BUT this echos nothing:
foreach($respXML->children() as $child)
{
echo "<p>{$child}</p>";
}
 
nothing at all?
 
nothing
 
not even the <p></p> ?
 
the source just contains the <style> I quickly wrote
nothing else
 
4:23 PM
okay so it thinks there's no children
 
yeah. That's the problem. I can't see why
 
sup
 
what does the XML look like? (the first few lines)
 
Hello @edorian
 
someone knows a php function or a script that expires the date of creation of an advertising. Example, If I create an Ad today I'll store it in DB and I want it to expire in a month automatically. Some function for that?
 
4:25 PM
@salathe <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CompanyProfileResponse
 
Hi @edorian
 
??
 
Bingo, like I guessed it's a namespace issue
to get the soap:blah elements you'll want to tell children() which namespace to look at... like children('soap', true)
and yes, it will get messy
 
@cyberrog there's no function that will just "do" that. You'd have to write a script using many functions, which would have to be ran everyday (if I take your question literally). Or maybe you mean when you get the advertisements from the database you don't want ones older than a month. That's easier. Just store the current date (datatype: DATE) when inserting the adverts and then when retrieving them, only retrieves ones less within this month
@salathe it's a start though
 
@AdamLynch I've got to go now, but here's an idea to get you moving codepad.viper-7.com/LhT2zH
 
4:29 PM
@salathe thanks
 
@AdamLynch so before retrieve the Ad, I should check if its expired or not?
 
@cyberrog yeah it would be in the sql command
@cyberrog but this means that any "expired" ads won't be deleted from the database
 
@AdamLynch but, there is this date in database 00/11/2222. So I would pass on sql the today's date so it can compare. How would be this comparing?
the day must be equal, the month must be incremented in 1 and the year.... There is this problem, from december to january
I'd have to check also that if month is 12 the next is 01
so I'd have to store in db three datas, day, month and year
by doing this in sql inserting, I can already insert the expire date, that is only incrementing the month number
 
hey all
 
@cyberrog what songs?
30 day*
 
4:38 PM
@AdamLynch BTW, ur songs are pretty cool. Im listening to it right now.
 
@cyberrog forgot I linked that
 
@AdamLynch LOL
 
Hi all
I have the following code:
if($_SESSION['basket']){
$i=0;
//echo "here1";
while($i < count($_SESSION['basket'])) {
if(is_array($_SESSION['basket'][$i][$product['productid']]) && $_SESSION['basket'][$i][$product['productid']]['material']==$_POST['material'] && $_SESSION['basket'][$i][$product['productid']]['size']==$_POST['size']){
$_SESSION['basket'][$i][$product['productid']]['qty']+=$_POST['qty'];
}else{
$_SESSION['basket'][][$product['productid']] = array("qty"=>$_POST['qty'], "material"=>$_POST['material'],"size"=>$_POST['size']);
and when I add an item to the basked
*basket
I sometimes have the qty being looped
and being added together when i'm only adding a qty of 1 can anyone help me?
 
@AdamLynch DUDE your songs are awesome!! Electronique Mix Great!
 
@cyberrog thanks very much:)
 
4:43 PM
@AdamLynch you work as a DJ also?
 
@cyberrog yep
@cyberrog I've to go
bye
 
@AdamLynch see ya.
 
@Dino Solution
 
5:25 PM
hi all
u there? lol
 
Hi @Neal
 
wassup?
@Raynos: thesoconundrum.com ^_^
 
Woops. This is PHP
 
@Raynos ha
 
@Neal Y U STUPID BLOG
 
5:29 PM
@Raynos it no stupid :-P
 
@Neal Yours?
 
@Robik lol i just started it today.
let me know if u want to contribute ever
 
Wrong room again -.-
 
@Robik haha yes. i have the whole in my bookmarks. im trying to keep it to a max 3 posts a day
^_^
 
5:43 PM
@Raynos lol
 
@salathe hmmmm
 
6:00 PM
@Neal: Awesome! Shows how one can get good answers to poor questions.
 
@nikic haha i see u like the site :-) ill try to update it with new ones almost every day
@nikic or did u not see my new site yet?
 
@Neal Yes, I was talking about your site ^^
 
@nikic lol ok
@nikic follow it to see updates
 
6:15 PM
posted on July 05, 2011 by Matthew Weier O'Phinney

A number of programming design patterns look very similar. One of these is the Proxy pattern, which, at first glance, can look like a number of others: Decorator, Flyweight, even plain old object extension. However, it has its own niche, and it can provide some incredible flexibility for a number of programming scenarios. Continue reading "Proxies in PHP"

 
Speaking of which, @Gordon who uses TokyoTyrant? I don't mean to rant, I'm purely curious. I just never saw a real-life implementation before. MSSQL, PGSQL, OCI and of course MySQL can be seen in action fairly easily. TokyoTyrant? Not so much as much as I've seen so far.
 
 
1 hour later…
7:27 PM
@ChristianSciberras tt is an interface to tokyo cabinet, which is k/v store, kinda like redis or memcached. i only added it to illustrate the range of extensions available.
 
7:54 PM
1
Q: PHP 5.4's simplified string offset reading

webjawns.comAs many of you already know, PHP 5.4 alpha has been released. I have a question regarding the following. Simplified string offset reading. $str[1][0] is now a legal construct. How exactly does $str[1][0] work? EDIT: http://php.net/releases/NEWS_5_4_0_alpha1.txt

@Artefacto @salathe any of you know the answer?
@nikic what's the practical purpose of that?
 
If $str[1] returned a multi-char string, it might be useful, but it doesn't
maybe it has something to do with unicode?
Or maybe this is just for consistency. $str[1] returns a string that is one character long, so you should be able to access the 0th element of that string if you want to.
Ah, it looks like someone beat me to it:
http://stackoverflow.com/questions/6588016/php-5-4s-simplified-string-offset-reading/6588168#6588168
 
8:19 PM
@nikic here is my output for it
C:\php5\php-5.4.0alpha1-nts-Win32-VC9-x86>php -r "$str = "abc"; var_dump($str[-1]); var_dump($str[0]); var_dump($str[1]); var_dump($str[2]); var_dump($str[3]);
var_dump($str[1][0]); var_dump($str[2][1]);"
string(0) ""
string(1) "a"
string(1) "b"
string(1) "c"
string(0) ""
string(1) "b"
string(0) ""

C:\php5\php-5.4.0alpha1-nts-Win32-VC9-x86>
 
@Gordon $str[-1], $str[3], and $str[2][1] cause "Notice" errors to be thrown.
 
yes, they do.. forgot to put error_reporting in there
 
Just pointing out that they throw an error.
 
0
A: Expanding my programming knowledge

Matthew Warnerhttp://php.net/manual/en/ http://dev.mysql.com/doc/ Learn HTML first and PHP will come pretty easy, mysql is fairly straight forward once you get into it.

> What I was trying to say is that there are lots of better alternatives, so if you are free to chose, don't choose PHP.
:( Why does no-one like PHP ?
 
I disagree.
I think PHP is a great language to start programming in.
 
8:29 PM
I find it hard to find reasons why PHP is better then platform X
@Michael thats taking it a bit far. There are defiantly better languages to start programming in
PHP is not a bad language, but it's far from good
 
You don't have to compile with PHP so that makes things easier on a beginner
 
@Michael if you learn programming with php , then you will never be a good developer
 
I dont see how. You still need to deploy
 
No, you can run PHP scripts standalone, they don't have to be webapps.
 
php lets you write exceptionally horrible code
 
8:32 PM
@teresko Exactly, you can focus on programming concepts and not on nit-picky syntax.
 
@Michael any language with a REPL is the same
you can run python / ruby / C / js / lisp / etc standalone without a compiler
There are C# and Java interpreters as well
 
But PHP is a scripting language by its nature.
You don't need anything extra.
 
@teresko which programming language makes you a good programmer?
 
You need the PHP run time
@Gordon binary for <insert arbitary processor>
 
hmmm .. @Gordon , none
 
8:36 PM
@Raynos Well you need that for any language :P
 
Yes
Python, ruby, js, etc are all scripting languages
I would personally recommend lua as a first language
it's really simple
 
i began with Turbo Pascal ( 7.0 )
for "learning language" it was quite OK
 
uhm
honestly?
 
@Raynos - both c# and Java suck... more than php
I did with delphi - object pascal, it had some nice features - like separation of functions and procedures.
 
8:53 PM
@KamilTomšík Delphi is no better than PHP. It sucks too
Maybe we should just agree that all programming languages suck - in some way?
 
@KamilTomšík ew
why would I use C# or Java ?
 
@nikic I haven't said anything like that... delphi was not best language
 
I mean C#4 as a language is actually quite nice. Dont like .NET though
 
or object pascal - but delphi itself was great, gui-builder programming is great for beginners
 
@nikic I cant find any reasons why PHP sucks any less then anything else :(
 
8:55 PM
@Raynos and what exactly is so cool on c#4?
 
And I would like a reason to learn it other then increasing job prospects
@KamilTomšík its not a bad language. thats all
 
@Raynos Yes, PHP sucks too, we already know that. Just like Java sucks. And Delphi. As I said: They all suck in some way...
Thus this conversation is pretty pointless
 
+1
although some of them suck less :-P
 
@nikic but my actual question is whats the advantage of PHP over python/ruby/js apart from market share.
 
@Raynos Didn't Gumbo already tell you that?
5 hours ago, by Gordon
we've got easy to get in, easy to scale, widely adopted, in demand, feature packed.
 
8:57 PM
Not good enough
 
That seem some pretty decent reasons
 
Easy to get in, is not a reason, other things are easy to scale as well
market share is a reason however, and I dont see any features in PHP I am missing in other platforms
I was honestly expecting people could give me more reasons
 
@Raynos forget about php as good language for starting - we don't even want that - or at least I don't... It's language with very cheap hosting, which is simply everywhere - it's great for low-cost startups
 
It has a larger range of cheap hosting options
but there are plenty of cheap hosting options for language X
 
@Raynos Are you a PHP developer who wants reasons to stay with PHP? Or are you a Y-Developer (with Y being the set of languages without PHP) considering using PHP?
 
9:00 PM
@nikic the latter. Specifically I favour node.js
 
And you work in node.js?
 
god no
 
I.e. you are employed and are working with node.js at work?
 
I work with ASP.NET 2.0 :(
 
@Raynos they're not, php is very cheap, if you already know it, that's it...
 
9:01 PM
ah, okay
Yes, node.js is a very interesting project
 
@KamilTomšík the amazon EC2 servers are cheap
 
But I honestly doubt that one can build something large with it in the near future
It's great for a Comet chat
 
@nikic I can build something large with it today
Anything you can do in PHP I can do in node
but thats a completely different topic
 
@Raynos sure you can :) and I could do it even with smalltalk :-P
 
No, it's not a different topic, not really
 
9:02 PM
@KamilTomšík you can ;) Is there a stable web server in small talk
 
node.js is great and fast and all that - but you cannot use it practically (yet - hopefully one will be able to in the future!)
You can't build Facebook on node.js
 
@Raynos I'm not sure if you relize it, but simplicity is one of greatest power of JS, that's why I don't like proposed ES6
 
But you can on PHP
 
@KamilTomšík do it Smalltalk webserver
@nikic of course I can build facebook on node
 
@Raynos Do it :)
 
9:03 PM
@KamilTomšík some of ES6 is good. Like modularization build into the language
 
@Raynos simplicity and consistency, that's something which really astonished me on smalltalk. (it's simple even after 40years!) and js is very simple too - but sadly, this is going to change...
 
@KamilTomšík not really
just write ES5 and play the "IE9 doesnt support ES6" card
@nikic thats a considerable time investment
Anyway arguments like facebook is written in PHP therefore PHP is better are stupid
cloud9ide is written in node and its vastly more complex then facebook
 
@Raynos not sure what you're talking about :) I'm saying ES6 is unnecessary complex
 
Maybe.
 
@Raynos but back to php - for me, it's language which is enough powerful to do completely anything - it's almost as powerful as ruby - it has eval (how dare I am), I am free to extend it in any way. Yet, it's still enough light-weight and fast even on netbook (ruby is not). And when I need hosting, no problem... Amazon is cool, but we're not all living in USA :-P and latency is important.
 
9:10 PM
@KamilTomšík ...
Ruby is slower then php ?
I dont value trivially cheap hosting that much I guess
 
sure it is - I'm waiting 2 minutes to run hello world... (yeah atom, but smalltalk is fast as hell on the same machine - and it includes even its own IDE)
 
@KamilTomšík V8 is faster then php ;)
 
@Raynos maybe, I'm considering it as platform for own language
 
@Raynos That's not hard ^^ PHP is slow as hell :D
 
Hi ppl
 
9:12 PM
@KamilTomšík dont write your own language :P thats stupid
 
@Raynos I was thinking about smalltalk, but it's too much coupled on GUI... would be hard to get rid of that dependency
@Raynos why? just for fun ;)
 
ppl i have a question that i need to get answered by you ppl .What documentation steps do you do before starting a project? in sequence...
 
@nikic ruby is slower...
 
@KamilTomšík its ok for fun
its silly for production
@KamilTomšík use Self
@Lagrangian TDD
 
Brainfuck is slowest :D
 
9:14 PM
write tests, write code, pass test, document API exposed by code
 
@Raynos lisp guys would disagree :-P
 
@Kamil with what?
 
Or write API for code, write tests, pass tests
 
@nikic with silliness of own language/dialect
 
I think of
1.SRS
2.Use Case
3.Project Charter
4.WBS
 
9:15 PM
@Raynos self is great - however I'm not going to develop in virtualized ubuntu just because of self...
 
Back on topic, real cheap hosting & market popularity are the only good reasons for PHP
@KamilTomšík ... You use windows? Why? Dualboot -.-
 
@Raynos Sure he does
 
@Raynos why not? ;)
@Raynos and I'm awaiting W8 :-P
 
while(true) respect--;
 
@Raynos I doubt :)
 
9:17 PM
@Raynos Windows != Mac ;)
 
Any serious dev dualboots his machine :\
 
@Raynos Seems like all the people around you aren't serious devs then ;)
 
windows & mac/ubuntu/hardcore *unix distro
 
@Raynos MS VirtualPC
 
@nikic its valid to not have windows. Im ok with that
Just Mac or linux on its own is fine
but if you have windows it should be on its own partition and not your main partition
 
9:19 PM
@Raynos just to be clear - I have rich experiences with both linux and unix (solaris, aix) and no - I want something much simplier, but I want play games too :-P
 
Let's stop it right here and now. Okay? This is a nice chat. NICE. We don't want to have Windows vs Linux flamewars here.
 
Seriously though
Who pays for an OS :\
 
you know... it's my computer, I could have there MS-DOS if I wanted :-D
 
MS-DOS > windows
 
9:22 PM
okay... enough :)
 
@Raynos Well, there are people, you know. I pay for my PHP IDE as well. There are many free PHP IDEs. But I don't like them. So I pay for one that I like. With Windows it's similar. I don't like the other OSs. So I pay for Windows. Is there a problem with that?
 
Anyway the point is. Sell me PHP :(
@nikic yes. You like windows more then unix. Thats the problem
 
@Raynos Admittedly, I don't want to sell you PHP anymore. You are not open to other technologies. It will be pointless to try and convince you.
3
 
@nikic +1+1
 
...
You seem to take my casual stab at windows seriously :\
There's nothing wrong with windows. It's just if you need to use linux technology (Self / node.js / etc), dualboot it.
 
9:27 PM
@Raynos you're insulting our language, and even our OS, and you're even telling us that we're not free to choose whatever we want.
 
Well, I don't need to use Linux technologies. (Actually I do have an Ubuntu as dualboot, I just never have the need to use it.)
 
@KamilTomšík I never insulted PHP.
 
@Raynos I don't need Self which doesn't have vm for windows.
 
That's fine. Why can't you de-couple smalltalk from the GUI ?
 
if it had, I would consider it... but that lack of portablity means something
@Raynos VM itself has BitBlt implemented inside
 
9:29 PM
If you value portability use ansi C ;)
 
@Raynos Or use PHP. In contrast to the ASP.NET you are using you CAN run PHP on pretty much any system you like. Both Linux and Windows. You can't do that with your beloved ASP.NET, you know ;)
 
I agree. ASP.NET is horrible
 
@Raynos okay, lack of portability is caused by lack of meta-circularity... meta-circular language is portable to anything. not just c.
 
admittedly mono does a good job of running ASP.NET
And I'd take PHP over ASP.NET any day of the week
 
9:32 PM
@KamilTomšík you still have to boot strap it
 
@Raynos language itself (or rather system in this context) can generate vm
 
@KamilTomšík bridge the gap between language / vm and machine code somehow
 
@Raynos it's pointless anyway - I don't even know what's your problem... if you're upset because low spreading of node.js, then just spend some of your time on creating linux repositories - yum install nodejs would help much better than flaming in here...
@Raynos php/ruby/python/perl - all of them are well spread in *nix worlds... and all of them have binaries for windows...
smalltalk went ever further... there is one zip with binaries for both win and *nix
 
@KamilTomšík :\ Im not flaming. (the windows vs linux thing was an aside)
 
Yeah, not working on Windows is quite an adoption barrier
 
9:38 PM
@nikic there actually fixing that. Microsoft teamed up with node on getting it working
 
@Raynos Sounds great!
 
@nikic glad to hear that... but V8 itself already works on win, doesn't it?
 
@KamilTomšík It's a genuine question on what specific feature sets PHP out from the rest
It feels like a jack of all trades to me
 
@Raynos not again
@Raynos because it is
 
@Gordon I'll keep trying until your either fed up or I install PHP
 
9:39 PM
you will never install php because you dont know what you are looking for
 
@Gordon you may have a point there.
 
ive already asked you what you are looking for in a language a couple hours ago. find out the answer to that and we may be able to tell you if php is for you
apart from that, i dont see why a language needs to stand out anyway
 
Because it needs to be better then my current comfort zone for me to switch to it
Your right, I'm handling this wrong. I'm asking you to guess what I'm looking for and somehow mention PHP matches that
 
in php:
- not everything is object
- every object has to be instance of some class
- there are no "inline" objects - {var: val, var2: val2}
- function syntax sucks in the very same way...
 
@KamilTomšík We probably will get the inline objects syntax ;)
 
9:44 PM
You know, I'm not asking about PHP, I'm asking about the PHP web development eco system
 
I hope we won't :-P
 
define web development eco system
 
I prefer one-man show, team programming imho doesn't work in php
 
@Raynos Well, you got the ecosystem right here :D See, many nice people who are still being nice to you even though you call them gay. Isn't that a nice ecosystem?
@Gordon Just out of interest, which OS are you using?
 
@nikic nah, that's a nice community :) which php has indeed
 
9:46 PM
yeah, that's right, php guys are not like lisp or ruby ones
 
@nikic Windows 7 of course :) I'm gay (not).
 
Seriously though, why do you guys use windows?
@Gordon You edited it :(
 
@Raynos because it was starred. dont want people to get false ideas when reading that out of context
im using windows because linux doesnt get me out of my comfort zone
and because i use it as a gaming rig
 
well, I like to just "chill out" when I'm exhausted, I can't do that in linux.
 
9:48 PM
Ah yes. Gaming.
Gaming seems to be the main windows reason
I reboot into windows for gaming
 
i had dual boot. i hated it
spent all day on linux. then change to win to play a game.. that was soooo annoying.
 
Depends I find linux faster
 
all i need for webdev is my IDE. and thats available on any platform, so is PHP. I can even have apache and mysql if i want. so why would it want to switch to linux. I dont care about being a cool kid anymore. I'm beyond 30.
 
and unix >> windows shell
 
@Gordon full ack
 
9:51 PM
I like the command line. That's the difference I guess.
 
@Raynos agreed. the win shell sucks. even with powershell it sucks. but you can install cygwin to get a proper one
but im not doing that much on the shell anyway
 
I don't need a shell often
 
I feel emulating windows on linux or linux on windows is silly compared to dualboot.
 
Mostly using a shell when using git, but that's a bash shell, not a windows one ^^
 
i need php on cli and the pear commands and those work
 
9:52 PM
yep
 
@nikic yeah, the git shell is actual a cygwin shell iirc
only thing i really miss is grep, tail and head
but am too lazy to install cygwin for those
 
If I need to grep, I just hack a php script together to do it - or if I grep in source codes, my IDE can do that ;)
 
@Raynos i dont want to emulate. i just want some convenience features if anything. im happy with windows like it is
 
The main advantage of linux for me is that its more productive ;)
 
ok.. except for the networking gui. that is broken. it was fine in XP but went to hell after that
 
9:55 PM
those pesky games get in the way of getting things done
 
anyways.. nite nite
 
Gnight
 
gn8
 
@Raynos yes, winshell sucks, that's why I use php for scripting - seriously.
 
@KamilTomšík feels backwards to me
your using PHP to patch limitations in your OS
 
10:08 PM
@Raynos easy... php is what? scripting language - bash is what? scripting language... so what's the problem?
 
@Raynos PHP guys tend to do everything in PHP ;)
 
@nikic that's not reason, I do it because I know php better, that's it
 
Because it's so easy to do everything and you can do pretty much everything ;)
 
ruby scripts are also very productive for "shell" scripting
however I'm not that good in ruby as I am in php
 
@KamilTomšík I like the command line
 
10:09 PM
good for you
 
damn
the autocomplete stopped working somehow
 
and btw - you can use JS for shell scripting in windows too :-P
 
I meant I like having both the option to script and the command line
@KamilTomšík ;_; the horrors. The sheer horrors
I mean using node in linux for a bit of scripting is cool.
But JScript.NET in windows is :(
 
no, I mean - just create file xxx.js and implement something, then just double click it :-)
there is object representing actual shell which allows you to invoke programs and commands.
 
@KamilTomšík I'm saying the JScript system in windows is shit :P
The win api exposed through js is shit
 
10:16 PM
heh
seems like i'm forced to go to sleep now
 
@Raynos well, say what you want :) the truth is - running .js file can directly interact with ActiveX, which means you can script not only shell, but also applications
 
this poor little chat just got too flamy :(
gn8
 
gn
and php can do it too :-P
gtg, later
 
@KamilTomšík I didnt say you cant do it ;) I'm just saying I dont want to !
 
 
1 hour later…
11:44 PM
I've a jQuery post request and a php script in the same page...is it right to use if(isset($_POST)) to be sure post request receiving?
 
06:00 - 16:0016:00 - 00:00

« first day (262 days earlier)      last day (4676 days later) »