« first day (1486 days earlier)      last day (3466 days later) » 

12:30 AM
@FlorianMargaine Thanks so much for your help so far!
 
12:54 AM
@DaveRandom Achievement unlocked: bitwise Easter eggs.
anyone else find that when you leave the stackoverflow chat open in a tab, I'm on Google Chrome Android, that it completely soaks your battery?
 
Ugh, having multiple ways to handle errors is ugly
(and even worse when it comes to testing)
 
1:51 AM
 
Any way to get __debugInfo to work with xdebug?
 
 
2 hours later…
3:48 AM
hi. how can i add new language in php GD libarary?
 
4:44 AM
@MuhammadAwais GD is image processing library. Not sure what you mean.Can you be more specific?
Morning room
 
 
1 hour later…
6:01 AM
how can i start and stop jquery ajax timer
 
:D
morning
@ErumHannan you are asking at wrong room
 
6:17 AM
hellp
question anybody uses nusoap?
 
atleast i dont use
 
6:32 AM
good morning
 
http://stackoverflow.com/questions/26837593/store-values-in-2d-array-and-retrieve-in-php

Someone has answer to this question? Any Help?
 
moin
@DanielRibeiro did you write instanceof patch yet ?
 
Night folks.
 
nn @DanLugg
 
yes. I dont have the code yet. I need the codes and where the place to put it. — Syafiq Mustafa 3 mins ago
:D
@DanLugg later
 
6:48 AM
@JoeWatkins im still working on some improvements
i think im not going to go further on the details of the first discussion
its easier to keep it simple for now
 
cool cool
 
7:04 AM
:)
im really excited about this :) but i think more feedback would be nice
 
the most constructive feedback usually comes when there is a patch available ...
 
hi everyone
i was having a problem on nusoap
do you have an experience in nusoap ?
 
7:21 AM
thats true
 
Hi Guys I have an issue
i have a field in database named filters and it has values like 1,3,4
I need to find values if someone search 1 and return that row and for this i am using following query and is working fine
$query = sprintf("SELECT shoptitle,logopic,complocality, profileurl, lat, lng,mageuserid,compdesi,deliverymin,deleiveryprice,deleiverymethod,vendorphone,compcity,compstate,zipcode,showcompleteaddress,( 3959 * acos( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS distance FROM marketplace_userdata WHERE FIND_IN_SET (".$filter.",filter) HAVING distance < '%s' ORDER BY distance",
mysql_real_escape_string($center_lat),
but have problem to find and operation like someone search for 1,3
it is returning null result
 
@rohitnetgains please, learn to use prepared statements
 
posted on November 10, 2014 by kbironneau

/* by jauni-john */

 
7:59 AM
@JoeWatkins should I open a PR on github or just link to my fork/branch?
 
8:46 AM
good mondring
 
morning @Sergey
 
good mornings
 
@SergeyTelshevsky good morning
 
NeoWin: BrowserStack compromised : "Source: Pastebin..." Am I the only one who thinks quoting Pastebin as a source on news stories looks slightly silly?
 
8:54 AM
Morning Folks
I have to take copy of live database
the size is very huge, may be 8-9 gb
if i use mysqldump will it have any impact on bandwidth? any possibility for the site to be down?
 
yes
mysqldump does a single transaction afaik
 
mysqldump always has an impact on the database performance. Exactly how much will depend on a number of factors, including the table engines involved and the options you use for mysqldump
 
yeah, well, you probably should be dumping from the failover master
then again, I am not a sysadmin by trade
 
ok
I tried connecting via sql yog
it's raising 2003 error
think admin has denied direct connection to mysql
 
9:14 AM
Morning
 
Ugggh morning...
 
@DaveRandom I don't understand this :(
 
probably because 0 == 0
after all of the casting is done
 
@FlorianMargaine & casts strings to integer(0), and then == casts right operand to int(0) as well
 
9:23 AM
 
reducing to the minimal example I can get: 3v4l.org/HM9R6
 
wow
thats odd
 
nope, it actually makes sense
& performs a binary operation, and the string gets trimmed to the shortest
 
@nikita2206 yeah...
8 mins ago, by Florian Margaine
@DaveRandom I don't understand this :(
 
@PeeHaa cool +1
 
9:28 AM
@tereško it doesn't in a way that bitw ops are usually performed on ints
but other than that it's cool to have it
 
@tereško @FlorianMargaine @nikita2206 nothing special, ascii number of character bitwise ors second one
 
3 mins ago, by tereško
nope, it actually makes sense
we are not THAT slow
6 mins ago, by Florian Margaine
reducing to the minimal example I can get: http://3v4l.org/HM9R6
this was a good enough explanation
 
sorry, looks like I have scrolled :)
 
@here how do you inject database objects? Single instance for all the objects using the db?
 
in general I use this approach .. unfortunately I till have not finished implementing DI Container
 
9:33 AM
posted on November 10, 2014 by kbironneau

/* by Stichoza */

 
mornings
 
nin
@tereško how is this different than injecting a single instance
 
@FlorianMargaine bitwise ops on strings treat the string as the char* that it is and do the op byte-by-byte, up to the length of the shortest operand and the result is truncated
 
@DaveRandom yup, we got that... but still, ugh
 
@FlorianMargaine it is injecting the same instance .. the difference is in "when instance is created" and "where is the instance configured"
 
9:39 AM
It does have its uses, for ex you can use it to implement IP subnetting stuff in a way that's consistent across platforms
 
@tereško k
@DaveRandom indeed, nice one
 
Also it means you can do "Foo" ^ " " === "fOO", that's of debatable usefulness though :-P
 
@DaveRandom It is way to mondaymorning to tell you you are an idiot :)
 
There are probably some extremely niche situations where it gives a perf benefit. I want my microseconds back!
 
@DaveRandom only for ascii usable doesnt it?
 
9:45 AM
Well you'd have to know that there were nothing but alphas in the string
 
Which is what I mean by "extremely niche"
 
@DaveRandom ok
 
I believe that property of the ascii table has applications in crypto, that's getting out of the bounds of things I actually understand with any confidence though
 
Hi
I want to accept an array of files in my webservice. The files come in $_FILES. But I am confused about the keys of different files.
 
9:55 AM
@DanielRibeiro PR+RFC most likely best route
 
so .. some of you might remember that I am loosely associated with the Airdog project
so guys now are playing around with "3rd person view" for self
 
yeah, they're working in the same office as you right?
 
as in: put on video-glasses, place the drone behind you and see your self in third person as you look around
 
@tereško makes me think of some video I saw recently...
 
9:59 AM
really really crazy
 
@Jimbo Morning
 
a "watch" that unfolds and flies around you
 
@tereško lol
 
@JoeWatkins i would need karma to open RFC though
 
10:00 AM
@FlorianMargaine unfortunately that thing has several issues, that can mostly be summed up with a single word: "landing"
 
@JoeWatkins As an ext?
 
@DaveRandom yeah, because I don't want zend to change ...
is unfinished, will finish it today ... need think ...
 
No I'm fine with doing it in PHP rather than zend, just surprised that you actually can
 
totally can, it's going to get more complex to cover all engine cases, but certainly doable ...
 
read: surprised they are still loosely coupled enough that you can do this without having to screw with zend at least a little
 
10:03 AM
well you have to screw with zend, but it provides apis to do that ... so it's okay ... good magic :)
 
@tereško a couple of months ago I saw a video that people became really clumsy pecause of the couple ms lags in video transmission
 
winner
 
there definitely seems to be some learning curve
 
@FlorianMargaine yes, I've heard they were successful in reducing it, but not up to the required level
@tereško IIRC it was about filming yourself while you do sports?
 
10:08 AM
Or other things let's run start with sports
 
@SergeyTelshevsky its marketed that way, yes
 
@tereško I hope they will come up with something, really interesting project
 
@JoeWatkins magic is bad, mm'kay
 
@Jimbo something something Thor, something something ...
 
Does it make sense to use php 5.5 and opcache in vagrant for development? We upgraded vom 5.4 with apc and it was never a problem and it did speed up things. However with 5.5/opcache, scripts are cached in certain circumstances for a few seconds even when setting revalidate_freq to 0 . Using php5.5/fpm/nginx ; any idea or generally bad idea?
 
10:12 AM
lol
 
ThW
Morning
 
Morning
 
ugh
return False;
 
oic @JoeWatkins so at the moment it doesn't actually type-check, it just overrides the RECV opcode and converts the arg into a instance of the name in the type hint? This presumably means that (as it stands) if I had function foo(Thing $thing) {} then foo(1); == foo(new Thing(1));
 
at the moment it doesn't check, am dreaming up rules ...
 
10:16 AM
@FlorianMargaine Prefer return false; ?
 
@Jimbo that or return FALSE;... but not False :(
 
@JoeWatkins I think just convert_to_*, personally, presumably with operator overloading for easy mixing with primitives
 
well, is that really strict though ?
well numerics don't need to overload, just be castable, strings might want an overload on FETCH_DIM ...
I'm not sure if we're going to call it strict, it should really be strict
as in exception on incorrect type strict ...
 
^ this is my view
(at the moment. It's quite fluid)
@JoeWatkins I would prefer casts and call it "enforced"
 
on the other hand, you do have to use; so maybe it's okay to consider them a hint for an autobox, and an autobox in php should be dynamic in nature ...
 
10:28 AM
@mark Er, I think the docs might be wrong. Set validate timestamps to 2, and you should see file changes get picked up....
 
@mark I don't have any problem with the php5.5/fpm/nginx combo I think
@mark 0 means always validate. You realize that right?
> How often (in seconds) to check file timestamps for changes to the shared memory storage allocation. ("1" means validate once per second, but only once per request. "0" means always validate)
 
@PeeHaa I see the same thing actually - I always thought 0 means don't revalidate.
 
@JoeWatkins It's probably worth providing register_autobox_class(string $baseClass, string $extendingClass)
 
From the docs ;)
> How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.

This configuration directive is ignored if opcache.validate_timestamps is disabled.
RTFM :D
 
No, seriously - I have it set to 0 in my config file for deployment, and whenever I boot up the box in vagrant, I have to remember to go in and edit it to be non-zero to have it check scripts for update.
 
10:35 AM
I don't have access to my machine here right now. Will test it later today, because otherwise my gui isn't correct and neither are the docs
I always run with 2 I think
 
Setting revalidate_freq to 0 will result in a short-circuit to do_validate_timestamps() every time
 
ugh
I'm reviewing some code right now...
ugh
 
Are they doing it big?
 
it seems the spaces they wrote were random
like they enabled an option in the IDE to randomly insert/delete whitespaces everywhere
 
Is it all spaces and no tabs?
 
10:46 AM
@PeeHaa thanks, yes I realize that. "2" for revalidate was the default (Ubuntu 14.04), I tried "1" and "0", however I was always able to hit nginx/fpm multiple times after a file change and it did not reflect the source changes. The files were definitely changed, I made absolutely sure of that. Once I disabled opcache, problems gone. However the the framework I like to enabled it.
I will probably evaluate the blacklist capability, but I still find it weird. Btw, that's vagrant with nfs, maybe that could confuse opcache?
 
@FlorianMargaine I have a department in my job that does that
@FlorianMargaine they have like spaces delimit every possible character
 
@DaveRandom yeah, at least
@SergeyTelshevsky lol
 
Is there a good reason why switch() does not allow a way to do strict comparison?
 
@FlorianMargaine Lucky you it's not a language where spaces actually matter. :D
 
@mark Strange. Never got that
 
10:48 AM
@FlorianMargaine tbh in that scenario it's more forgivable if they are mixed - it suggests they might just have their editor set up wrong (like auto-indent uses spaces but tab still inserts a tab, or something). But if it's all spaces that means they actually write code like that...
 
@FlorianMargaine something like $x = new stdClass ; $x -> a = 121 ; strval ( $x -> a ) ;
 
@crypticツ If you do any comparison in switch you're doing something wrong.
 
I didn't even know you can put spaces around ->
 
@PeeHaa ok, thanks, it helps to know I don't have a basic error here
 
@crypticツ switch(true) ducks for cover :P
 
10:49 AM
@crypticツ Just because that's "how switch works", I think. Where's that causing you an issue though? Generally suitable use cases for switch wouldn't be affected by that anyway...
 
ugh
200 lines of commented code...
 
@FlorianMargaine lucky for you it's code and not the description of workflow
 
I'd rather have that
seriously they have commented code everywhere
and it's like... you know, a single line of comment in the middle of a function... so you know it looks like it's actual code...
but no..
hopefully there's syntax highlighting
I'd be lost without it
 
code.google.com/p/netdns2/issues/… <-- actual bug found caused by switch type insensitivity
 
@AllenJB The problem there is usage of @ and not checking return of function on failure.
 
10:54 AM
so damn true, @Leri
 
Language can't take care of potentially buggy code developer can write.
 
Leri: Why? The @ doesn't change the result of the function. The error is handled in the FALSE case (copied to the classes own error handling).
 
lol...
I know when I'm stumbling upon generated code... it's clean...
 
@AllenJB That code is simply inconsistent. Inconsistency creates undefined behaviors that's completely developer's fault.
 
@mark That sounds like you don't have opcache.validate_timestamps enabled.
 
10:58 AM
@Leri: In what way is it inconsistent?
 
@AllenJB @ is error suppression, thus, in english this means "I know I'm doing it wrong, but shut up"
 
@DaveRandom needs mroe coffee
 
@AllenJB Switch is for branching the code depending on state (returned integer value in this case). Putting false there is simply wrong because false is not part of the flow of socket_select.
 
So... just paid deposit to climb Mt. Elbrus next year. Should be fun.
 
Instead developer should check if socket_select failed and after that branch his path using switch (preferably, cast return value to int).
 
11:01 AM
@Danack I'm just looking into it now. I've not yet found an issue but I'm wondering if it fails to clear the stat() cache or something ridiculous like that. That said, opcache has been around for quite a while now, you'd have thought someone would notice such a fundamental problem by now...
 
@Fabien Why would one pay shit for dong active shit
 
ding-dong
 
Holy shit that is a proper mountain btw
 
Just in case you haven't noticed
 
It's not as bad as it looks. Not overly technical and not actually that high.
 
11:02 AM
@SergeyTelshevsky And in this case it's used to suppress the (almost certainly) socket error (because the class is going to handle it in its own way), then handle it using the classes own error handling (creating a consistent method of handling errors across the entire class regardless of their cause).
 
You guys are welcome to join us if you like :P
@rdlowrey ^ Tag for adventure :P
 
@Fabien *us? Presumably it was your misses' idea then...
 
@Leri: But the mistake made is trivial and caused by the fact that switch isn't type-sensitive - which isn't an obvious fact (in my opinion). Which goes back to my original point of posting it - it's an example where case insensitivity of switch caused an actual bug.
 
@DaveRandom why ?
 
@DaveRandom Yup. She's the actual climber. I do it for the exercise.
 
11:05 AM
@SergeyTelshevsky As core doesn't use Exceptions, PHP gives no sensible way to detect the source of an error that occurred and handle it differently based on that. When you're doing socket stuff and want to handle errors your own way, you just have to @ and hope it was a socket error and not something else.
 
@JoeWatkins So that people can add custom methods to the resulting objects. People are obviously going to bitch if they can't do that.
 
She just climbed Mt. Rainier last month.
 
@DaveRandom When my coffee kicks in, I'm going to investigate properly - because I'm not surprised by OPcache being a bit crappy anymore - bugs.php.net/bug.php?id=67481
 
Rainier than what?
 
heh. It is in Seattle tbf.
 
11:05 AM
> socket_create() returns a socket resource on success, or FALSE on error. The actual error code can be retrieved by calling socket_last_error(). This error code may be passed to socket_strerror() to get a textual explanation of the error.
@AllenJB ^
 
You guys should check out Mt. St Helens - artist point
That's in washington, near Seattle. Been there twice, breathtaking each time
 
> If an invalid domain or type is given, socket_create() defaults to AF_INET and SOCK_STREAM respectively and additionally emits an E_WARNING message.
 
 
@AllenJB ^ with a custom error_handler you can manage them
the language allows you to work with it. It's not easy, it's very C-like, but it's very much possible.
 
@Danack Is that with opcache.use_cwd?
 
11:09 AM
@AllenJB What @FlorianMargaine said and if you want to have more type-safety you can actually do that: 3v4l.org/fJbed
 
@Fabien Yeh looks like they probably got Manc beat. Damnit we're never the best at anything!
:-P
 
lol.
 
@Danack It would probably be safe to remove stuff like lxr.php.net/xref/PHP_5_6/ext/opcache/ZendAccelerator.c#2626 now, for one thing :-P
 
@PeeHaa No...
 
@FlorianMargaine Irritatingly, somewhat but not entirely incompatible with stream sockets...
 
@Jimbo Gotta go up the mountain for the best view :)
 
php.net should change the documentation just to make w3schools wrong =P
Maybe the brony / anigif guys can get on that and make it change randomly so none of those quizs is ever right
 
W3Schools? More like W3Fools
 
11:27 AM
@Patrick
> 14. PHP allows you to send emails directly from a script

You answered:

False
Wrong Answer!
:|
 
Well, that is wrong. mail() exists.
 
@AndreaFaulds Which does not send mail directly
 
@PeeHaa It does send mail directly, on Windows.
 
No it does not
 
OK, in what way does it not?
 
11:29 AM
You still need something that actually sends the mail
sendmail / smtp whatever
 
Oh yeah, apparently on Windows it still just hands off to an MTA
 
Yeah
 
6. The PHP syntax is most similar to:

JavaScript
Perl and C
VBScript
Um...
 
Yeah :P
 
I'll go for for Perl.
 
11:30 AM
Everything looks like perl if you look long enough to it :D
 
wait.... JS isn't C-based? :s
 
I got 20/20! :D
 
@AndreaFaulds for?
 
@AndreaFaulds Go get your w3schools certificate!
 
11:32 AM
Dennis Ritchie invented the C programming language. Broadly speaking, C-family languages are those that use C-like block syntax (including curly braces to begin and end the block). The family spreads out over several programming paradigms, including procedural programming, object-oriented programming, functional programming, and generic programming, as well as having both native code and virtual machine runtime environments. This list is in rough chronological order and describes some basics of each language. == References... ==
 
Oh, w3schools (facepalm)
 
@PeeHaa Nah, I'd have to pay them money for that
 
But it is superawesome legit!
 
I doubt W3Schools certification is any more meaningful than Zend's is
 
11:34 AM
If someone has a Zend certification, I might still consider them for a job. Not so much with a W3Schools certification. =D
 
I have angered OPCache....it is now no longer caching any files...
 
@Danack :P
 
I'm still not fully caffeinated - but it looks like something has just been fixed - @PeeHaa @DaveRandom
 
@Danack s/fixed/changed/ :-P
 
I also like how it has full details of the bug that was 'fixed'.
 
11:41 AM
try {
    echo 1;
    $db = new PDO('sqlite:');
    echo 2;
} catch (PDOException $e) {
    echo 3;
}
why does that output 12 and not 13? Is sqlite: really a valid DSN that does not cause an exception?
 
@Danack hmmmm
 
<-- applies more coffee
 
@crypticツ WHat happens when you try to do shit with it?
 
@PeeHaa you mean run a query against the imaginary SQLite file?
 
@crypticツ Set error mode to exception? array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
 
11:45 AM
@crypticツ Yeah
@Danack Shouln't it always throw up when making an instance?
 
13
Q: PDO Connection Test

ThemodemI am writing an installer for one of my apps and I would like to be able to test some default database settings. Is this possible using PDO to test valid and invalid database connections? I have the following code: try{ $dbh = new pdo('mysql:host=127.0.0.1:3308;dbname=axpdb','admin...

I don't PDO.
 
@Danack that was what it was originally at, still same outcome. I just pasted the trimmed reproducible code.
@PeeHaa the query does not run.
 
@crypticツ The manual tells me:
> PDO::__construct() throws a PDOException if the attempt to connect to the requested database fails.
But you don't have a database in there so it just does nothing? :P
 
12:03 PM
@PeeHaa but what if I am passing the file portion of the DSN as a var to PDO()? That var can be empty. I know I can check if it's empty, but shouldn't PDO throw an exception if the required argument will cause the whole process to fail?
 
@crypticツ Yeah I would totally expect it to throw up there
 
omg, could this be a bug? =oO
 
@crypticツ 3v4l.org/o1k3M
Looks like it is flaky
 
@Danack Bristol sucks, some live in Southampton and work for my company.
 
@Danack I do; I mean it was even the default (14.04.) and I checked with phpinfo() in my specific Vhost. But thanks for the reminder!
 
12:17 PM
@DaveRandom that's another issue (should I link to "PHP: A fractal of bad design"? :P)
 
@FlorianMargaine It's been on my list of things to fix for quite some time. It would require some pretty hefty refactoring, but not too much to be impossible. I kind of lean toward the idea that the stream socket handlers should be replaced with the ext/sockets routines during minit to unify some of the APIs, but that would be non-trivial (obviously). Not sure how much there is to be gained though.
It's just the module globals that are an issue, really. You could band-aid the socket errors problem by adding yet another member to the socket stream resource struct, but it's starting to get stupid as it is.
 
well, adding a new API and deprecating old ones is a possible thing...
 
Not had any time at all to work on it recently, though
 
hah
I don't like object-oriented APIs in php core :D
 
Why ever not?
 
12:24 PM
mixing procedural in OO is easy, the opposite isn't
 
^^ this.
 
Good morning
 
@PeeHaa You should open a bug report. I don't have the will to do so.
 
Stupid question of the day hour; For a HTTP API, is there ever a sane reason why you would ever need pagination on anything other than GET requests?
 
12:40 PM
dunno
 
@FlorianMargaine Not proposing removal of the old APIs (probably something similar to how ext/mysqli works, where the procedural funcs use objects as "resource"-style args), the new features that would be made available by this would not be hugely useful in procedural code anyway.
The only thing that would break would be is_resource(), I still hope that resources in general can be removed in 7 anyway, in which case a BC mechanism w/strict errors can probably be agreed on
 
I can only think of insane reasons....like a mass delete that takes too long to do in one step.
 
@Danack basically, PUT, POST and DELETE requests should only respond with the result of operation successful or not
 
oh god
the cat hurts my back
claws all out...
 
12:53 PM
yo
 
lo
 
yo
 
Banana-fana
 
@SergeyTelshevsky well , yes, but it kinda depends on what "status" response has to contain
for example, in my implementation as "empty response" contains a several things related to user identification
 
@tereško if it's a DELETE or POST, it's not idempotent you won't be able to browse through the response using pagination
only if you create a log file, which is a different resource
 
yeah , the problem on my end is that all the communication is based on one-time-tokens
because I am slightly paranoid
 
they should reside in header then and it's not much
 
=/
yeah , well, when I started making it, I did not thing so far ahead
 
@FlorianMargaine Did you see my notes on your commits?
 
user895378
1:45 PM
morning
 
user895378
@Danack Even in that case you're looking at a 202 Accepted response.
 
user895378
> The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
 
@rdlowrey mroning....and yeah. I think the only time it's going to happen when I someone incredibly dumb has made an API.
 
user895378
I would like to state for the record that I had a supremely unproductive weekend.
 
Good good
 
1:53 PM
morning
 
user895378
@NikiC morning.
 
@Ocramius do you know how I can make Doctrine do an insert or update if exists for a OneToMany relation? Putting cascade merge didn't do the job. When I add a new entity with the same key as an existing one in the db, I still get dupkey errors.
 
Fancy climbing a mountain @rdlowrey?
 
user895378
@Fabien I saw your link. It's tempting. When are you planning?
 
@Gordon yeah, that's rather annoying. The simplest way is to merge data from the new object into the pre-existing one if it exists
 
1:57 PM
@rdlowrey 23-08-2015. Link
 
@Gordon merging without using ORM API, I mean.
 
@Ocramius so that means I have to query the object and update it manually?
 
I think so, yes. Cascade merge should be the correct solution, but I'm seeing weird bugs popping up in that API, so I personally don't use it or recommend it. The ORM would do a fetch+update internally anyway
 

« first day (1486 days earlier)      last day (3466 days later) »