« first day (1212 days earlier)      last day (3962 days later) » 
00:00 - 11:0011:00 - 00:00

11:17
Mornign
/set-topic The result of the build process should be a deployable phar. Disuss!
@Gordon Otherwise, it's the bunny ears for you.
@Gordon Also, I don't wanna disuss.
hi guys :)
a quick question about namespaces and classes
when I write something like ClassName::$c = 1; in a method or a function, does the ClassName class reside in the current namespace?
oh god why I'm so cryptic :(
@fusillicode Yes
Or you have used the use keyword at the top of the page.
@MadaraUchiha ok perfect as I thought :)
thank you very much @MadaraUchiha you saved me a search in the manual :)
@fusillicode you are not @crypticツ. Stop pretending to be the Rainbow Dash!!!1
LOL XD @Gordon
12:13
Morning
morning @Fabien
:)
This is a cool site. Not technically but principally. Humans of New York
12:39
What variable types you would allow in a URL route? int, str, what else?
@MadaraUchiha anything possible in HTTP that is required by the consuming application
@Gordon Well, that's "str"
But I'm making more of a Router library
What kinds of types would you want to enforce?
You keeping your bitbucket repo up to date @MadaraUchiha?
@Fabien Hardly
12:44
I've moved to a more hopefully profitable project.
@Gordon does PHP implement that?
@MadaraUchiha no. you have to find a lib for that or build your own
That means it's too big for me right now to do :P
But you haven't answered my question
What kinds of types would you want to enforce when writing a route?
Of course you can just go with string and be on your merry way
But sometimes a user would want to enforce certain types (I want this to be just a number, not a string), etc.
So other than string and int, are there are others you think users might want to use?
@MadaraUchiha it depends on your app needs. its perfectly possible to GET /search.php?filter[foo]=1&filter[bar]=2. Although that is only necessary because of how PHP handles multiple arguments of the same name. Other languages would transform GET /search.php?filter=1&filter=2 into an array on the serverside
likewise I dont see why you couldnt do GET /search.php?foo=[1,2,3,4] if thats what you need
@Gordon Perhaps, but the query extension isn't a part of the route.
as long as HTTP allows it, its fine. Its up to your application to figure out whether the input is valid. i dont think its part of the responsibility of the router
12:55
A route is simply a tool to map from a URL to a resource (be it a Controller/Action or a physical resource)
Sometimes, I'd like for /user/42 to match, but /user/madara to not.
the controller handling that action would have to handle that invalid input imo
oy, @Gordon
@Manishearth hi
I'm trying to make a PHP infinite download as a testcase for a Mozilla bug. I've used the correct content-disposition, and am using output buffers in an infinite while loop. The php process will exit when the download is cancelled, right?
I don't want residual infinite while loops on the server :p
@Manishearth no. it wont.
however, im not sure php can even realize when a browser closes
13:04
@Gordon it won't exit? Bummer
So I set the ignore thing to false and it will work?
@Manishearth no, like I said, for that to work the browser would need to send a signal that it was closed.
@Gordon Any suggestions then?
it works for CLI but not for browser. but let me doublecheck that
0
Q: Browser closing and server question

GabrielHow does the server knows that i've closed the browser in a code like this? <?php $i = 0; while (1) { echo "a"; flush(); $fp = fopen("$i.txt", "w"); fclose($fp); sleep(1); $i++; } ?> If i close the browser, the script stops and no more files are created.

user924016
hehe
Is it possible to check whether or not output was already sent?
user924016
13:06
Hi =]
Hey @RonniSkansing
@MadaraUchiha You mean headers?
@PeeHaa I want to create a function/method that would throw an exception in the case output was already sent
Output or headers?
headers, I guess
user924016
13:08
=]
Yeah, just found it myself :P
user924016
@reikyoushin pretty funny comment you made on that "oh i got hacked WP question"
@Manishearth so apparently PHP will only abort when you are sending something to the client
@Gordon which I am
so that will work
13:10
@Manishearth when in doubt, simpy try and check the processes on the machine
@Gordon true, but it's a shared server and infinite processes
Oh man there is a lot to learn in this Node.js thing. Is it required/the best tool to use for creating a game with HTML5 and JS?
@David no. its only required when your game requires real time and even then you could implement simple polling to make that happen
nothing to do with html5
:)
13:23
@Gordon Like a multiplayer shooter game for example?
@David yeah, that would be an example. polling wouldnt work in such a scenario. too much latency. you'd use websockets instead, so socket.io and node.js
@Gordon A multiplayer poker game? If i was playing in a hand and I fold the next player needs to know straight away and so on so that would be considered real time I suppose?
Morning
although again, node.js is not strictly required for that either. its just a very plausible decision to use it for that
@David a poker game? no. I dont see why that would need immediate responses. should be sufficient to poll the server for updates
When you say poll what exactly do you mean? And please tell me it's got a smaller learning curve than Node.js
13:27
@Gordon stackoverflow.com/users/3286892/ardaozkal How old would you give this guy? :P
@David Repeatedly request new information from the server.
@MadaraUchiha Just using AJAX?
@MadaraUchiha So I could just do that from within my JS and have the game written in PHP?
@David Well, the UI part would be written client-side, but yes. All the computation should be done at the server.
The application logic, DBALetc in PHP?
13:29
That way, there's no actual way to cheat too.
Phew that should speed up the development a lot. Node.js would take me much longer to get really comfortable with
@MadaraUchiha For turn based games you don't really need repeatedly sending requests, do you?
@Leri Why not? Every turn
They need to slow down with all these JS libraries/tools and plugins before my head explodes
@David There are also php implementations for websockets if you do decide you need real time stuff
13:32
I'd perform an action, send data to the server, server does computation, server send result back, JS handles result.
How many software developers would it take to change a lightbulb? http://tommorris.org/posts/8786
@MadaraUchiha Send action and wait for opponents response and for that long polling is much efficient than polling in every n ms. Maybe I misunderstood what you said.
@Leri If you have a multi-player system, then yes. Long polling or even websockets is preferrable
Do you think it would be a good or bad idea to organise the server stuff in a MVC way or do you think it would be overkill
@David If it is worth it you would get a lot closer to actual MVC if you were to use websockets
13:35
@PeeHaa As in create a server with PHP that can handle input/output streams?
@MadaraUchiha poker is multi-player game. If I was doing multi-player card game with js (client-side) I'd go for web-sockets, if that was silverlight/flash then tcp should work fine.
@Leri Are you talking about implementing the web sockets in PHP?
It's not like there aren't already websocket implementations out there...
@David For server-side implementation I'd choose C# on .NET platform.
@Leri I don't have time to learn any more languages at the moment unfortuneatly
13:39
@PeeHaa Does it provide NIO? /me lazy to read their docs
@Leri Isn't that a java thing?
non-blocking IO I meant.
@Leri Yes it uses react iirc
Yes yes it does reactphp.org
Cool. Thanks. ^
np :)
13:50
How can i catch queries before executing from MYSQL ? (PHP)
@samitha what does that mean?
i want to archive something like this @Gordon
PHP PDO using prepare and execute statements
why cant you use PDO?
i want to log prepared queries and execute datas
just enable the query log on your mysql server
13:57
i did
or use mysqlnd_uh and plug a logger into it
you mean binary log
which use for the replication ?
what binary log? i mean the regular mysql logging
does it log all queries ?
i was try that
13:58
but it can't use as a table insert ?
it's using a text or log file ?
I have a hard time understanding your questions. what do you mean by "it cant use as a table insert" and what is the difference between a log and a text file to you?
can i get the query log output as a table ?
lol my chat window looks strange now with all those @Gordon's :P
whoa! =oO
@Gordon what is php.net/mysqlnd_uh?
14:03
@samitha you dont expect me to summarise that page for you, do you?
:D
i just asking what is it doing ?
user924016
^ how about you find out yourself?
user924016
Like click your own link, click introduction
user924016
read 10 lines
14:05
> The mysqlnd user handler plugin (mysqlnd_uh) allows users to set hooks for most internal calls of the MySQL native driver for PHP (mysqlnd). Mysqlnd and its plugins, including PECL/mysqlnd_uh, operate on a layer beneath the PHP MySQL extensions. A mysqlnd plugin can be considered as a proxy between the PHP MySQL extensions and the MySQL server as part of the PHP executable on the client-side.
eeeeeeeeeew
-3
Q: What algorithm should I use to detect features in this image?

Michael Angelo Abarquez Casaba I need to get the position(4 points, or rectangle) of the part of this image infected by a skin disease, but I do not know what algorithm should I use. Please help me. After getting the rectangle, I will resize it for feeding into a neural networks.

user924016
^ lol
So, what's everyone's Sunday plans?
user924016
read some books, how about you
user924016
:)
Looking in to web scraping with node.
user924016
Sounds fun
user924016
14:40
Any specific scraping in mind?
@Fabien check phantom js
@andho I've used PhantomJS it would work but looking for more experience with node..
@Fabien oh I see, so you want to do it all yourself.
The idea is to present a view of a website with completely revised CSS colors.
wait, is laracasts affiliated with laravel?
14:49
@PeeHaa That's just gross. Removed images.
14:59
Workspace switched seems pretty awesome
Where can i read more about function()[0]? (Get the first value from array returned from function)
What is that called?
array dereferncing
Thanks.
@MadaraUchiha I have a solution to my problem earler. Can you please take a look?
15:12
@mAsT3RpEE Sure
$Serializer = new PHPSerializer(Serializer::REPLACE_MEDIATORS);
$Mediator  = new GenericMediator();
$Object     = new GenericObject($Mediator, $Serializer);

file_put_contents($Serializer->serialize($Object));
and on other pages.
$Serializer = new PHPSerializer(Serializer::RESTORE_MEDIATORS);
$Mediator  = new GenericMediator();

$Serializer->setMediator($Mediator);

$Object = $Serializer->unserialize(file_get_contents());
Now I no longer have any globals / statics in my code. and it's nicer and easier to understand.
Looking nice
@mAsT3RpEE just one thing....why should GenericObject be concerned with how it's serialized?
15:27
@mAsT3RpEE what the hell are you building there?
just looking at the names makes me cringe
1. to allow different types of serialization (ie. JSON, XML, YML, SQL)
2. to allow it to make changes to data that is serialized. ie allow it to do a pre and post serialization.
@Gordon Don't worry Gordon with this my last issue has been solved. I'm just planning for the doomsday scenario. I want to create a library of design patterns for PHP. one of my requirements was that objects used must be serializable.
got it, GenericObject should implement Serializable
@mAsT3RpEE good luck ^_^
@andho the problem with php.net/serializable is that it doesn't allow multiple representations of the object
I wasn't thinking in those terms actually.
so it would need Serializable and JsonSerialiable if he'd want to use the native interfaces
15:36
@Gordon I've completely done away with the native php serialize function. kept getting errors i could not understand. I made a php clone. now its working. Anyone who is thinking about doing this .... DONT. thats all ill say.
more like a real Serializable interface. Something that will give the data needed, in an accessible format
Yep serializable objects implement Serializable classes that actually do serializing implement Serializer. Any other better naming convention?
@mAsT3RpEE find a way not to pass $serializer into your objects.
namespace Foo;

interface Serializable
{
    public function serializeWith(Serializer $serialize);
}

interface Serializer
{
    // public generic methods for serializing
    // applicable to all possible serializers
}
@Gordon btw thanks for the retweet of the PHPinDDD group. Nice initiative
15:42
or use a readymade package: github.com/schmittjoh/serializer
@Gordon +1
@andho np
@Gordon I don't see you in DDD/CQRS
@andho I usually dont follow newsgroups. I find them awkward to read
hehe, that's the place that really helped me out to learn. Just following the threads gave me loads of knowledge.
15:48
Anybody in here worked with phpexcel?
@PeeHaa :O I don't remember anything from those days
nvm I think my export routine is just borked somewhere
Yes as usual. My own fuck up :P
@PeeHaa when in doubt, doubt yourself ;)
True :)
Could somebody with excel on his/her machine please try to open this ge.tt/27XRfdJ1 and let me know whether it can be opened and contains data pretty please :)
Ow sorry I forgot the magic word: IT'S URGENT! ;-)
16:05
@PeeHaa I usually use google docs to check files are valid - it appears to be load it okay.
Though there is only text in the 'content' field
So the name column for example is empty? :(
@PeeHaa @markbaker did
:P
He sure did :)
@PeeHaa Oh hang on - I forgot to scroll.
16:09
"Test naam Test titel Test slig" - blah blah blah
yay! tnx @Danack
/goes back to drinking coffee
You deserve it :)
You guys use NodeJS much?
@Fabien only in small portions :)
16:17
I've only played with it a little some while ago before it was mainstream ;)
Just curious of a good way to get the CSS/JS from a page scrape.
Well doesn't even have to be a get I just want to append it to my own header so the live-view of the site works.
I would get a dom lib for that :)
Aye, I have gotten the info, I just need to plop it in to my own <head>
@PeeHaa node hipster!
16:19
@Fabien put it into a variable or partial-view or somethn like dat
@salathe shouldn't your fix for phd be visible by now?
@PeeHaa which one?
the ctor synopsis ()
nope, the docs only get built with the latest released version of PhD
aha
16:32
It might be a year before another release :P
You can preview changes on docs.php.net which does a git pull for phd before every build... docs.php.net/manual/en/datetime.construct.php
awesome tnx
I'm not sure I can abuse my privileges by making two PhD releases in succession, both with only one commit and both from me. :P
16:34
I'll mention it to bjori though :)
Yeah blame him. Ow wait you already did :D
16:50
@JoeWatkins are you here by any chance?
@BenjaminGruenbaum i assume if hes here hes here by internet ;)
I have a threads question
17:07
@JoeWatkins @JoeWatkins @JoeWatkins
CIDR question, when someone says no more than 16, does that actually means no less than 16, because less is more (of IP's).
computer science, computer engineering and information technology are 3 of the computer-related courses. what could be their differences?uhm. just opinions.. :)
Can someone proof read something for me?
@peehaa It opens cleanly in MS Excel2013, do you want me to check with any other versions?
Do you have 2k7 running?
@Cecil science = theory, algorithms, lots of math / engineering = process models for creating software / information technology = all thats out there
17:15
@webarto depends, what is the context for "16"... Is it the CIDR number, or number of hosts?
Or is that the same thing under the hood?
@PeeHaa look who I summoned for you
@Gordon: wow..
@MarkBaker how are the new glasses?
17:16
@PeeHaa it's meee, he summoned for you :P
(P.S. Hi Mark :) )
@peehaa - need to run up a my VM with 2007, couple of minutes
Hi Pete, good to chat again
@Gordon We need to setup some @Gordon's mega ping webservice api where we can post messages on some website and you automagically ping the person :P
What could possibly go wrong???? :D
@Gordon - wont now untuil I pic thm up necst weeknd
Ping-as-a-Service ?
17:17
@PeeHaa i could accidentally put your name for the superping recipient
@MarkBaker hehe :)
@Gordon Hell it beats kicking me out of the room again ;)
I made a birthday cake, but I'm not sure it's going to last until my birthday!..
Just wondering what the advantage of using phpunit is… compared to run-tests.php which has a much nicer API…
Loads ok on both MS Excel 2007, and on MS Excel 2003 with the compatibility pack
Excellent. tnx for testing :P and thanks for the work on the lib :)
Now that you are here what are the main chances in the 1.8 branch ?
17:26
No problem - be sure to use the latest develop branch version
Primarily bugfixes, but there is support for loading protected (RC4 encrypted) BIFF files, some support for ribbon
ribbon /me shivers
:P
Optional use of PCLZip for reading zipped files if you don't have ZipArchive enabled
Added HLOOKUP function, and a couple of envelope fixes for CHOOSE and ISTEXT
Quote Prefix for Excel2007
Some major bugfixes related to cloning styles, and insert/delete column/row messing up the references in formulae
Fix to hidden rows
wow. Sounds like a shitload of work you people did :)
currently at RC2 for 1.8.0 - I'd like to get the final release later this month, before the PHPLondon conference
I've not got as much done as I'd have liked - the new job is really eating into my Work/Open Source development/life balance; and its the development on PHPExcel version 2 that's been suffereing
What's the new job?
17:35
Virtual Learning Environments.... took over managing an existing piece of software with some major problems.... at least the existing version is stable now, but it really needs a complete rewrite
Looking at wrapping the existing code around Laravel to handle the grunt work and just maintain the existing front-end until a complete set of Laravel models and controllers emulate all the functionality of the existing system, then rebuild all the screens using Laravel's blade and turn off the old system completely
Sounds like "fun"...
We have one major client who need a lot of new functionality that the existing system simply can't provide, so we're starting by building that in Laravel
What made you choose laravel instead of e.g. symfony?
I think "challenging" is the description rather than "fun", but at least I'm having fun learning Laravel as I go
Migrating Legacy while adding features to it FTW \o/
17:39
But it is eating up a lot of my time
@Gordon - precisely
@MarkBaker same thing I am doing atm
Biggest problem is the big boss - the original is his design, and pointing out the flaws in it (and the mass of technical debt issues) is politically awkward
But everyone in the team is backing me on the changes, including a couple of external consultants that were brought in to confirm my own assessments of the old codebase - consensus is that we don't tell zebigboss any more.... as long as he sees new features being added, he doesn't need to know that we're gradually replacing everything from his original build
The political issues are a lot harder to resolve than the technical issues
I hate office politics
its a complete waste of time
But it's also given me opportunity do work with Amazon a lot as I ported the system off a single-host platform with no resilience or failover to work on AWS
Office politics reared its head even there - the cloud hosting choice was made on the technical grounds that potential clients will have heard of Amazon
17:51
Is there a way to show the previous data from a record after you have updated it in a database?
@benlevywebdesign - only if you've saved a copy of the previous record
@MarkBaker so if I have an html form and then I use php to get the record to be able to edit it. Once I submit the edits, unless I save the old data I won't be able to see what it was previously?
That's correct - unless you're using some kind of auditing that preserves the original, you're overwriting the original with new data
@BenjaminGruenbaum I wasn't ... I am ... -ish ...
Hello dear all,
I'm confronted to a fatal error:
Call to a member function fetch() on a non-object in /home/xxxxxx8/public_html/minichat.php on line 64
I don't know how to fix it
18:04
@Rsmusic It sounds like you're trying to call fetch() on something that isn't an object.
@webarto @webarto @webarto
ha
:)
@Rsmusic i.e. the previous line failed, but you assumed it succeeded. So you need to look at the error messages and figure out what went wrong.
@JoeWatkins actually it was @BenjaminGruenbaum that wanted you.
It works fine on WAMPS though :(, and I am exactly using php/mysql the way i was taught on the tutorial I've read
@Rsmusic So it's possibly a config issue.
@MarkBaker is there a way to store the old data temporarily?
18:08
I am trying a free server Host : 000webhost.com, do you know how to configurate it?
Nope.
000webhost.com is kinda sucky anyways
It's my first website, so I wanted something free
@benlevywebdesign - what do you mean temporarily, write the old data to an audit table, delete from the audit table when no longer needed
@Rsmusic Amazon ec2 is free for a year for micro instances.
Though if it's just a config thing, I suggest just debugging it, as if it's your first website, learning how to debug them is also valuable knowledge.
I'm stuck here since 2 or 3 hours, i'm sure it's ridiculously small what is to change.
@Rsmusic Which db library are you using? i.e. PDO or mysqli ?
I think it's PDO as i use this to connect to the DB :
try
{
$bdd = new PDO('mysql:host=mysql14.000webhost.com;dbname=#######_test', '##########', '########');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
user924016
=[
18:22
@Rsmusic Yeah - but that's not the immediate line before your fetch() is it?
You must have a query call between the connect and fetch right?
This is right under the code i've posted above :
$nbrBDD = $bdd->query('SELECT COUNT(ID) AS NBR FROM minichat ');
$donnees2 = $nbrBDD->fetch();
$affichage = $donnees2['NBR']-20;
$affichage2 = $donnees2['NBR'];
$nbrBDD->closeCursor();


$reponse = $bdd->query("SELECT * FROM minichat LIMIT $affichage, $affichage2 ");



while ($donnees = $reponse->fetch()) { ?>
<div id="message"> <?php
echo $donnees["pseudo"]." : ";
echo $donnees["message"]."<br><br>";
?> </div> <?php
}
$reponse->closeCursor();
@Rsmusic You are exposed to second tier SQL Injection attacks.
Really :(
You assume that $affichage and $affichage2 are sanitized. If they came from a user's input, they aren't.
Also, please format code properly
Paste, CTRL+K, Enter
yes but those two variables only contain the count of messages, they are not user's input
Would this description mean that PDO is not recognised by 000webhost ??
http://www.000webhost.com/free-php-hosting
18:42
"$nbrBDD = $bdd->query('SELECT COUNT(ID) AS NBR FROM minichat ');
$donnees2 = $nbrBDD->fetch(); "
"the previous line failed, but you assumed it succeeded."
@Rsmusic The previous line isn't the connect - it's the query.
Test to see if it actually succeeded and if it didn't read the error - php.net/manual/en/pdo.errorinfo.php
000webhost? free or paid version?
i think they have full PDO support but disabled PDO mysql and PDO sqlite.
@mAsT3RpEE :Free ^^
@Danack : I don't understand your answer, it sounds more in my head like a riddle, I'm a begginer :(
"$nbrBDD = $bdd->query('SELECT COUNT(ID) AS NBR FROM minichat '); " The query didn't work. It probably returned false, not an object, and so you can't call 'fetch' on $nbrBDD.
But why would it work on wamp, and gives me what I need?
The first query is to set the variable to have only a certain number of recent messages, whereas the second query is to display them.
Oh yes, the error disapeared when I erased :
$reponse = $bdd->query("SELECT * FROM minichat LIMIT $affichage, $affichage2 ");



while ($donnees = $reponse->fetch()) { ?>
<div id="message"> <?php
echo $donnees["pseudo"]." : ";
echo $donnees["message"]."<br><br>";
?> </div> <?php
}
$reponse->closeCursor();


But it is not funcitonal anymore
19:08
24 mins ago, by Danack
Test to see if it actually succeeded and if it didn't read the error - http://www.php.net/manual/en/pdo.errorinfo.php
Or you sure you are binding that as ints?
latert all /me is going out to drink til I pass out
@PeeHaa : Interesting, how do you do that, is it like :
$affichage2 = (INT)$donnees2['NBR'];
Yes!!!!! It is this!!!The page display when i change $affichage, and $affichages2 into Integers!
19:42
@JoeWatkins Let's say I want to build a thread library for fun from scratch. Don't ask my why (wait, I just said it, damnit). Where should I start?
I want to learn rust, and I need an exercise.
 
1 hour later…
20:58
The PHP constant MSG_DONTWAIT does not seem to be defined and it should. Does anyone know where to get the value of it
Seems to be a bug in PHP5
21:37
useful phpstorm shortcuts: sitepoint.com/phpstorm-top-productivity-hacks-shortcuts mention @Danack
3
Hi all.
Someone used nroff, groff or troff?
I have problem with macros.., on ubuntu...
@Gordon I've known all but one :)
The double Shift tap
@MadaraUchiha search everywhere is new in 7.1
and its awesome
Which is why I haven't seen it :D
But yeah, definitely going to start using it.
I use it in Sublime, and it's epic.
22:09
New Avatar~ <3
 
2 hours later…
23:59
is it possible to exclude a directory from .htaccess rewriting rules?
00:00 - 11:0011:00 - 00:00

« first day (1212 days earlier)      last day (3962 days later) »