« first day (417 days earlier)      last day (4525 days later) » 
00:00 - 16:0016:00 - 00:00

4:01 PM
hi can anyone help with this?
0
Q: Get value from xml thats being returned via php fsockopen

DinoI have the following xml being returned when using fsockopen (shortened the xml for ease of reading): <car> <brand type="AUDI"> <engine>1.8</engine> <price>9000</price> </brand> </car> I use the following code to get the values: ...

 
@Dino what i said in the comments. If you are not fixed on xml parser, use SimpleXml or DOM.
 
I can't got to use xml_parser
I actually wanted to use simplexml, but been forced to use xml_parser
 
@Dino by whom? and for what reason?
 
sorry let me rephrase the system is currently using fsock, but in a rush to get things working
 
@Dino why are you using fsock when simplexml and dom can load remote xml directly? they also can load xml from string. i dont understand the argument about fsock.
 
4:08 PM
@Gordon UNICORN <3
 
@Robik :)
 
i'm going to investigate this further, at the moment the fsock is forced to interface through a java client
 
@Gordon nice :)
 
i'm going to test if it will work through simplexml.
 
@Gordon Nice desk!
 
4:13 PM
Sup
 
And fan! Got to have one like those for the summers.
@edorian Heya. :)
 
@Gordon pastebin or any mail is fine
@ChristianSciberras Ho :)
@Gordon It arrived? Nice!
 
hi @edorian
 
@ChristianSciberras wrong again. its not a desk.
@edorian i emailed it already. yup arrived today.
 
@Gordon Meh. Google Maps Indoors haven't been to your house yet.
 
4:18 PM
The unicorn looks aggressive
 
With all the high up Unicode points in it how wouldn't
 
@edorian It's more me always misinterpreting the black part as the mouth in which case it does look quite aggressive [and not like a unicorn at all] ;)
 
Makes sense too but I'm sticking with unicode on that one. Even so unicorns should be more close to unicode as other animals
 
4:33 PM
reddit down .. again .. i think thry have like 18h per day uptime
 
@Gordon Thanks a bunch
oh posterious.. you html screw
 
"Did you know that if you rearrange the letters of “Simple” you can get “Broken” if you also swap out 5 of them." ^^
 
Most things fixed now
@Gordon Didn't you figure out how to make the markdown paster not die when it hits html?
 
@edorian Hey, that post absolutely didn't meet my expectations! You said something about being mean to people and that post wasn't mean at all :(
 
eih. damn versatel. is connection loss day or something?
@edorian no idea
 
4:45 PM
@NikiC I've reworked some parts as it feels better to write it that way. Sorry to not meet your expectations. Want me talk about frameworks? :P
 
@edorian Yeah, please :P
Start with CodeIgniter please :)
 
Hehe :)
I'm off, food arrived
 
5:19 PM
In Doctrine, how can you get all entities where ID is in an array.
For example, instead of ->find(12), ->find(array(12, 13, 18))
Solved: ->findBy(array('id' => array(12, 13, 18)));
 
hi alll
is it possible to create custom made php script and put it somewhere where it can be acceses directrly in codeighniter?
 
5:36 PM
Hi! can somebody point me to a example "simple" form in PHP to send and email? I'm no security expert but all the tutorials I see are extremely vulnerable. All I need is the base for a secure form. Thank you!
BTW If you can't really think of any, I'll just post a question with what I have so far and ask for help, but if this has already been answered, I guess there is no real need for that...
 
@Trufa use the php mail function, i think savetiness depends on the setup of the mail server
 
@Vlad I don't think it is safe to use it just like that IIRC
I think you might have problems with bots that fill the form
 
@Trufa try phpmailer, I havent used it before but check it
 
or for example, if you do a mail to the $_POST['mail'], if the user submits more that one email separated by comma it might be a problem (they can submit thousands etc)
@Vlad I have seen it before, it is a little overkill for what I want...
 
@Trufa if you implement captcha image you wont have problem with bots
 
5:48 PM
@Vlad true!
 
@edorian I really like your review of the book, even though I haven't read PHP Masters.
 
Anyone knows this question: is it possible to create custom made php script and put it somewhere where it can be acceses directrly in codeighniter?
without using views/controlers/models
 
put it in the document root
 
@tereško thanks, it worked
 
6:19 PM
@edorian Nice review
 
Thanks
Hell yes. Finally a sort-of-working phpunit phar twitter.com/#!/s_bergmann/status/144478813731045376
 
Ok, what if I have php script in doument root of codeingniter instalation, that needs db access?
 
It makes me want to read it: especially for the security part
:-D
 
Can I access some model so that I dont need to hardcode db connection?
 
@ircmaxell There is absolutely nothing you'd learn from and possibly you'd get "mad" at some of the errors
 
6:24 PM
Yeah, which is why I want to read it :-P
 
But its a solid foundation that does a lot more good than harm :)
 
That's fair
 
at least in my mind. I wasn't trying to nickpit it much i guess
 
I'm only caring about the significant errors.
@edorian Saw the tweets. Looking interesting
 
speaking of which, what about that book project we had? is that still alive?
 
6:27 PM
I'd like it to be
 
@Vlad , afaik , CI's components are closely tied into the framework , most likely it will be impossible to use pats of with without the entire framework
 
> reddit is under heavy load right now, sorry. Try again in a few minutes.
 
@ircmaxell @NikiC I haven't made any reasonable progress on figuring out how to do something printable without unreasonable efforts. For something open I'd surely do work
 
@ircmaxell yeah , has been there for few hours now
 
@edorian Not even with the O'Reilly open book thing?
If you like classical music at all:
 
6:35 PM
tnx
 
So if I implement a view with my flash element emebeded, can I load it into a new js created window, If know that views/model/controlers arent directrly accesible?
 
Though more maths than PHP related, I'd like to ask you geniuses the following question: let's say I will be presented with a random number from 0-9 (so 10 possibilities), but I am asked beforehand if I can make a prediction about its value.

If I think it's larger than 2 I have 70% chance of being right about that, if I think it's smaller than 6 I have a 60% of being correct.

Now why aren't these chances multiplied (0.6*0.7=0.42=42%) the same as my chances of being correct when saying "between 2 and 6" (30%)?
 
@edorian Well, something printable isn't important for now, is it?
 
@ircmaxell Nothing that works smoothly. Also I wouldn't be comfortable anyways going with +4 people then so open seems easier
 
I wouldn't either
I think 2 or 3 max...
 
6:40 PM
@NikiC Well you asked for the status and that's what we said we'd get back on
 
unless...
What about this: what if we did a set of stories. Basically case studies where people talked about their real world expereince including pains and the such
 
@Chris Sorry can't help you out there easily
Maybe try the math Stackexchange
 
@Chris It's simple
think about the number of states
If you say larger than 2, you have 7 states that are correct (3,4,5,6,7,8,9), and 3 that are incorrect (0,1,2)
But if you say between 2 and 6, you have 3 correct states (3, 4, 5) and 7 incorrect states (0,1,2,6,7,8,9)
therefore you only have 30%
 
Yeah that's what I found
Which is what confused me, why is it different?
 
Why is what different?
 
6:45 PM
Ok, again, any idea how to load view or controler in a newly js created window in codeigniter?
 
I thought being correct about both the 'greater than' and 'smaller than' part would mean the same as being correct about 'between a and b'
That's not the case however, as you said. In the latter case it's 30% whereas if I multiply both numbers of 'greater than' and 'smaller than' I get 42%
(Should I say 'less than
 
Why would you multiply them?
 
', by the way?)
 
Isn't multiplying for making multiple guesses?
 
Correct
 
6:46 PM
I figured that would be the correct way of calculating the chance of both things happening
 
nope
 
I've never been taught how to do these probability things by the way, so please explain this basic mistake as simply as you can, if you have the time for it :)
 
@edorian @ircmaxell I didn't quite understand your last messages. Is the problem that we are too many people?
I don't like stochastics
 
@NikiC I think the problem is what do we want to do...
 
@ircmaxell Asking because you said something about 4+ above
 
6:50 PM
To deal with copyright crap, yeah kinda. For anything open: nope, not at all :)
 
stichastics, colectiong the numbers give 1 or 100%
 
@NikiC with a defined vision, if it worked well, then 4+ would be ok
but without one, not sure...
 
Would defining one fix the problem? :P
 
Quite possibly
 
huh why does expectedExceptionMessage only check whether the message contains the string?!
@ircmaxell So, maybe we should start thinking about that then ^^
 
7:02 PM
Because the people asserting on the message usually just want to make sure their variable input or something is included and not tie down the whole message (as they should not be relied on by code ether)
 
ah, does the message usually contain line numbers?
 
so any idea how to load php script, view or controler into new js window, how to override codeigniter access permissiond?
 
Not really, at least mine don't
 
But that's the only thing I can think about that you wouldn't want to check for
 
can somebody answer this question stackoverflow.com/questions/8378250/…
are there any other settings for streaming speex etc...?
 
7:07 PM
meeting
 
wow sorry wrogn place
 
@NikiC From my experiences (and I don't use it very often as I have generic messages) the only case where "contains" was a lot more useful than "equals" was when dealing with filenames and the like
I'd say it's one this way because it's easier, you don't have to copy/paste the whole string and it worked out for everyone so far
At least I've never heard someone asking for more / anything else
 
@edorian Though with filenames you have bigger problems than just contains ;)
 
@expectedExceptionCode is "equals"
 
I am asking for more :P
 
7:09 PM
@NikiC Why? $file = realpath($file); throw new InvalidArgumentException("The expected $file is not readable");
Do you have a case where "contains" is an issue?
 
@edorian And now run that on Linux and on Windows ;)
@edorian Not really. It just was quite counter intuitive for me that the test passes even though I accidentially removed half of the string
 
In my testing-phpunit-regressions-with-frameworks experience: Nothing works on windows, ever
well not nothing. 95% work. But the whole things never work like on *nix
 
@edorian Well, that isn't a good approach imho
 
It's definitly not. It really annoys me
 
At least I develop only on Windows and I want to be able to run unit tests there too
 
7:14 PM
If pear would work on windows that would be a good start :)
 
What PHP does for cases like that is do an EXCPECTF with The expected %sfile.txt is not readable
@edorian Doesn't it work?
 
Do you remember your last experiences?
 
After some hours of trial & error it seems to work for me :D
 
yeah i know. If at some point the expectedExceptionMessage "contains" doens't work out the phpt style stuff would be my next idea
It's annoying that developers don't care for windows compat but thats just the state i observed
 
Yes, I agree
That's why I had to set up an Ubuntu VM at some point
So I can at least build docs + php without spending hours
 
7:18 PM
It's what I've settled with too
well I'm at 5 vms currently but yeah :)
 
:D
I find that quite strange, because from my experience (which isn't much obviously) most devs are on Windows
 
but most "core" devs of $stuff are on linux
 
probably
 
7:32 PM
I don't get get.gaug.es. Are they really taking 48$ per million pageviews? Or have I misunderstood it?
 
yup
I get that in 8 hours on one of my sites. So yeah, no go for me
 
You can now gives us money for a service google offers for free
and if you get popular we take even more money!
 
Yes, that's what I though too. If I got 2M pageviews per day that would cost more money per day than the server for a whole month
 
I was going to say "well 2m per day is quite a lot can you do that from box"
but then i did the math
 
@edorian Or even easier just use GA ^^
No work, no cost
 
7:38 PM
(as i pointed out)
 
@edorian you did :)
 
Or if you don't like google there is always piwik :)
 
But you need to set that up ^^
 
@edorian I do about 5 to 6 million page views per day out of one box...
 
@ircmaxell Like i said. I did the math. 1M / day => 12 / s. So that is not all that much after all
 
7:40 PM
nope
 
Yep, one server is enough for that :)
 
Well, it is, but if you get that much traffic you'd likely want a second server
 
You would?
 
Well if you make money off of the traffic
It could be useful to have 2 boxes
 
haha it worrrrks! blipit.net/stack/image.php
6
Q: How does StackOverflow handle images from external URLs?

Brandon MontgomeryWhen you ask a question on SO, you can add images. One of the options for adding images is to add them based on a URL. SO wouldn't be able to just accept any URL for an image, however. For instance, if someone created a site that required basic http authentication in order to serve up the image...

Sorry
Hi
 
7:57 PM
hi @Neal
 
@edorian true, I make a few thousand per year off it... enough to pay the bills and for beer
 
@NikiC hi hi ^_^
 
9:00 PM
hellloooo
 
hi all
why cant i figure out how to delete dbs in phpmyadmin =(
 
@JMRboosties Because you don't know how.
 
i dont indeed
 
Glad to have answered your question.
 
@JMRboosties Probably you just don't have the rights for it ;)
 
9:12 PM
yea DROP DATABASE db_name is disabled
im the admin tho
 
So enable it.
 
im going in directly from my control panel, shouldnt i be an administrator? says im no
not*
 
Then you must not be.
 
well seeing as i bought it and im the only one who uses it and im logged in as the admin account provided to me by the host i ought to be
 
Sounds like something you should take up with your host.
 
9:26 PM
if im setting up a page which displays blog posts would it be wise or unwise to store those posts in a database? id like to incorporate some php calls to the body, but that may include html and be long, which isnt ideal for dbs afaik
 
where else would you store them , @JMRboosties ?
 
lol, as html files i suppose. im new to a lot of stuff and i always get the impression that having huge lengths for table columns isnt good, and a post could reach 5000+ chars easily
but it seems like that isnt the case
 
have you forgot to take your meds ?
what does "huge lengths for table columns" mean ?!
 
its called learning the hard way
 
9:49 PM
@JMRboosties In other words, learning...
 
@iircmaxwell indeed. right now im reading up on what to set for the length of a blob column, its not really clear. varchar is 255, straight forward enough. but i cant find a suggested value for blob
 
there is no value
CHAR(M)	M × w bytes, 0 <= M <= 255, where w is the number of bytes required for the maximum-length character in the character set
BINARY(M)	M bytes, 0 <= M <= 255
VARCHAR(M), VARBINARY(M)	L + 1 bytes if column values require 0 – 255 bytes, L + 2 bytes if values may require more than 255 bytes
TINYBLOB, TINYTEXT	L + 1 bytes, where L < 2^8
BLOB, TEXT	L + 2 bytes, where L < 2^16
MEDIUMBLOB, MEDIUMTEXT	L + 3 bytes, where L < 2^24
LONGBLOB, LONGTEXT	L + 4 bytes, where L < 2^32
ENUM('value1','value2',...)	1 or 2 bytes, depending on the number of enumeration values (65,535 values maximum)
that's L < 2^32
 
so if i just establish "this is a medium blob" i can leave it blank?
 
you have to leave it blank
 
BLOB is for binary data
do you really want to save a file into database ?
 
10:05 PM
so blob is for files, such as a png or mp3 or something... and text is for big chunks of texts, like blog posts (including html tags)?
 
assuming you are using mysql , i guess you have not even tried to read the manual
because you would have noticed that there is TEXT data type for columns
guess what's that for ..
 
was looking if there was a distinction between regular old text vs text with html tags and whatnot inside of it. wasnt sure
 
Hey, anybody know of any good resources on what I need to know about scalable applications?
 
10:21 PM
sure , @Anfurny : readwriteweb.com - the premium location of all the latest buzzwords
 
thanks
 
i guess sarcasm really isn't suited for internet
 
Was coming through loud and clear over here
The sarcasm that is
 
maybe he has faulty wires
 
Or maybe I just forgot you're chronically pessimistic
 
eaj
10:27 PM
Miscalibrated electrosarcastometer?
 
Seriously, I'll take a list of the latest buzzwords, thank you very much, and use it to get a 6 figure job.... thank you very much.
 
its the safe bet
 
Yep, 6 figure salaries do beat spending your time here all day
 
@Anfurny , anyway , the serious answer is : it is impossible to suggest any links without knowing the specifics of your problem
 
All I want is a list of like 10 most common problems people make in a lamp stack that makes an application not scale, and shiny technologies that can help.
 
10:30 PM
"scalable applications" is just a meaningless combination of words
 
a *php
No, scalable is very meaningful.
 
in which direction ?
 
A scalable application is one that can perform well under high loads.
 
What do you consider high load for a website?
 
example "Initially twitter wasn't a very scalable application"
Let's say, at least a million hits a day
 
10:32 PM
scalable can mean changes in size of application, amount of users, hits per user and other thigns
 
I mean, what are the specifics of the problem? What is your website trying to do? What technologies are you using? There's so many different aspects to the question that you asked that it's impossible to reasonably answer.
 
i think he was the one building facebook-killer
 
Nevermind guys.
 
Yea, good look getting that to scale reading tutorials off the internet.
Was reading an article today where FB database people said they are getting 60 million queries a second and over 4 million row changes a second. I couldn't even begin to fathom how difficult something like that would be.
 
Y u troll?
 
10:38 PM
I'm not trolling, I'm simply bringing up a related article that I thought was interesting.
 
Except I'm not making a facebook app... so
but on an interesting side note HipHop PHP seems pretty cool.
 
Ok, either way. If you wanna talk about scaling an application you have to talk about and look at Facebook.
 
True, Facebook invented the scaling application... basically you had to buy 1 server per user before facebook.
 
Bah, the more interesting stuff is the database optimizations. For the vast majority of people the bottleneck isn't going to be PHP it is going to be the database.
 
is that guy on drugs ?
 
10:41 PM
Well I'm a PHP coder in a PHP chatroom who applies to PHP jobs, so the database isn't my problem.
 
no , facebook did NOT invent "scaling application" .. hell they didnt even come up with that stupid buzzword
 
Indeed, Facebook certainly did not invent scaling applications.
And if you work with the database, which as a PHP developer I'm sure you must, you should have a vested interest in its health and well-being.
Without the data your PHP script is meaningless drivel
 
@CharlesSprayberry , why would anyone want to learn about databases and SQL , you just write it .. or use latest ORM
 
@tereško Because the data is the application. All that extra stuff is just frosting so us humans are more inclined to consume it.
0
Q: Which PHP framework is the most appropriate for my circumstances?

nmfordI have searched through a lot of questions and hoping that this one isn't closed as I can't find an answer to my specific question. I did quite a bit of development using PHP back with version 4 but I went into a different career for a while and the past year I started web development again as a...

Please close vote or flag for closing
 
@CharlesSprayberry done.
 
Tom
11:04 PM
Hey, if you set a variable like this $somevar = $_post['somepostedvar'], and there is no data from $_post then is the variable $somevar['somepostedvar'] going to be null?
 
Dan
11:14 PM
not really null. you can use isset to check it
i guess i would be null not sure
but use isset
 
Tom
11:32 PM
ok, ya I was planning on using isset so that was what I wanted to know
 
Ago
any suggestions how to send emails so that they would end up in imap sent folder?
 
Ago
so, I will just send it with smtp or whatever and then append, seems doable
thanks for the tip
 
no problem
 
00:00 - 16:0016:00 - 00:00

« first day (417 days earlier)      last day (4525 days later) »