« first day (1960 days earlier)      last day (3004 days later) » 
00:00 - 13:0013:00 - 00:00

1:00 PM
@dsech easy, function isMyGetParameterAnInteger($param) { return false; }
 
 function convertToPoteitoDomain(string $string) : int
{
    $string = trim($string);
    if (preg_match("#-?\d+#", $string) === false) {
        throw new InvalidPoteitoIntException("Input contains invalid characters");
    }
    $intVal = intval(v);
    if ($intVal > 50) {
        throw new InvalidPoteitoIntException("Input value is too high. -50 to 50 is accepted.");
    }
    if ($intVal < -50) {
        throw new InvalidPoteitoIntException("Input value is too low. -50 to 50 is accepted.");
@Poteito that ^^.
or similar - I don't regex this early in the day.
 
@Poteito make sure it's valid for your application. if you expect -50 to 50 then 999999 doesn't make sense. Make sure it's not larger than your storage allows etc
 
And I would strongly recommend making a type for the value. e.g.:
 
(please show an example without public vars) :D
 
class PoteitoValue {
    public $value;
    public function __construct($value) {
        $this->value = $value;
    }
}
 
1:03 PM
dammit
 
/The type is the important thing - not the data hiding.
That is actually a real flash back.....one of the first 'sites' I visited on the 'web'.
/gopher ftw
 
:-)
 
Well thanks everybody :)
Is filter_var() a valid option too ?
 
is there something wrong with one of the cloud hostings?
I am seeing strange timeouts to various pages
 
1:20 PM
I want to have DateTime::__construct(DateInterval)?
Oh that cannot work obviously...
:(
I love it how writing things down shows the stupid
 
1:42 PM
@Poteito It doesn't give useful error messages.
 
1:53 PM
hello, does any one knows best forms to use with doctrine which supports the doctrine validation as well?
 
@FaizRasool I don't think it's smart to couple template stuff with domain stuff...
 
@Patrick but like if you have used spring
it is magic how hydrators validates the entity based on configuration
 
@FaizRasool magic is not considered a good thing around here
 
Anyone who wants to play Tic Tac Toe? tic-tac-toe.kelunik.com
 
> WebSocket connection to 'ws://localhost:8765/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
 
1:57 PM
@FaizRasool you should validate user input. validating entities is something completely different
 
@Patrick i know what you mean but i'm thinking of some thing at least user input validation
 
and when you mention a forms component I assume you mean user input validationj
 
i was thinking as whole package
 
@kelunik funny thing I am also working on a game (mostly to have an excuse to use amp)
 
@FaizRasool why? that breaks encapsulation and domain layer separation
 
1:58 PM
@PeeHaa do you need a pony with that?
 
Can I have one? :)
 
@FaizRasool just keep user input validation separate
 
@Patrick i know entity validation is about the business domain
but input validation on simple things
like length, type etc
 
@PeeHaa Dammit, forgot the local config.
 
@FaizRasool just validate it explicitly. otherwise someone reading your code has to do a lot of digging to find the validation rules
I mean feel free to use a validation component
 
1:59 PM
@kelunik that one can't be lost. You should make infinite board + 5 in a row wins
 
But don't hide the validation rules
 
@Patrick i'm already using annotation for example /** @Column(type="string",length=255,nullable=false) */
 
@tereško Extending it later isn't hard.
 
sure
 
@FaizRasool no please don't do that. comments are not code
magic is bad
 
2:00 PM
> WebSocket connection to 'ws://tic-tac-toe.kelunik.com/ws' failed: Error during WebSocket handshake: Unexpected response code: 400
 
I am just saying that the current version isn't actually a game, @kelunik
 
What's your excuse now? :)
 
@tereško Mainly to demonstrate Aerys ;-)
 
@Patrick but i work in kind of iterative environment
 
brb food
 
2:01 PM
where manger comes up next week and say i want that new column (or field want to capture)
so then making sure when you add new column the changes on all places are met is quite difficult task
@Patrick so what you believe what should be best way in that scenario
 
@FaizRasool the same thing that I said earlier
@FaizRasool no that does not qualify as hard task, not even close. It will not take long to change that.
What if you want different validation rules?
Now you have them all over the place
 
yes it is true
 
Put things where they belong, don't put everything in your entities
 
this is why starting out with "I will use an ORM" sucks as a design solution
 
@Patrick but when you gonna look code back after 6 months
how you gonna remember ohh i added the new property to entity
and to the form
 
2:05 PM
@PeeHaa retry
 
and i need to validate it as well
from my experience it become quite difficult
specially when more people are working on your code
 
@FaizRasool well you are going to experience a lot more difficulties if you do things how you mentioned
 
\o/
Now I'm really getting food
 
@FaizRasool say you have a field that can be max 100 characters and not contain links. admins can have 500 characters and links. How are you going to solve that with your approach?
 
@PeeHaa :-)
 
2:07 PM
@Patrick so in the ideal world the files belong to one entity is some thing like that then: User, UserService, UserValidation, Userformexample.html
 
@FaizRasool no. forget about the entity for a moment
 
@Patrick ok
@Patrick it is good point
 
@FaizRasool You are starting all your thoughts with the database. Your entities are tables and everything derives from there
Instead try to think about your problem domain
What problem your application should solve
Then create classes to do that
 
yeah it give sense
 
And when you need to persist some data, then you save it somewhere. Maybe a database, maybe something else
 
2:09 PM
for example in the case of the user
 
But it's not important to your application
 
what should be ideal solution
 
@FaizRasool that depends on the application you are writing, the problem you are trying to solve
But validation is there to prevent invalid user input
So it is unrelated to persisting your data
But for now, just think of your validation separately from the rest
So if you have a task of adding a new field, think about the domain first
What values make sense etc
Then validate that
After that, think of a good way to store it
You can use doctrine for that, but it's an afterthought not the starting point
 
ok here is the problem i'm solving
@Patrick i'm writing micro service application
it is just sms service
which then connect to provider
and deliver the sms
in this case there is not really any interface to it
in term of html
just rest base api for main application
but for logging purpose i'm using doctrine
 
@FaizRasool that is also an API and input also needs to be validated
 
2:16 PM
@Patrick yes sure
 
doctrine for logging? Talk about overkill
just use pdo
 
@Patrick i'm also making my skills sharp on the doctrine
so it is better opportunity for me as well to try doctrine
 
instead of doing that, try to understand domain driven design first
That's what doctrine is trying to do (more or less)
 
@Patrick here is my entity of sms
/**
* @var \Ramsey\Uuid\Uuid
*
* @Id
* @Column(type="uuid")
* @GeneratedValue(strategy="NONE")
*/
protected $id;
/** @Column(type="string",length=255,nullable=false) */
protected $destinationNumber;
/** @Column(type="string",length=5000,nullable=false) */
protected $message;
/** @Column(type="datetime",name="sent",nullable=false) */
protected $sent;
/**
* @ManyToOne(targetEntity="Provider", inversedBy="name")
**/
protected $provider;
 
Domain-driven design (DDD) is an approach to software development for complex needs by connecting the implementation to an evolving model. The premise of domain-driven design is the following: placing the project's primary focus on the core domain and domain logic; basing complex designs on a model of the domain; initiating a creative collaboration between technical and domain experts to iteratively refine a conceptual model that addresses particular domain problems. The term was coined by Eric Evans in his book of the same title. == Concepts == Concepts of the model include: Context The setting...
 
2:19 PM
then i need all params in the constructor to make sure it is always valid
@Patrick ok sure
 
Gotta buy some things, I'll be back later
 
@Patrick we will talk about this later
 
2:44 PM
@FaizRasool see there is your problem. You found something that you want to try and now you are trying to force a problem onto it instead of solving the problem. You are trying to fit a square peg into a round hole.
 
@Patrick it's a design approach, not a fucking religion
so stop treating it as such
 
@tereško did you read what else I was writing? ...
 
yes, but I can't muster the will to call out everything I disagree with
 
@tereško I was linking the DDD wiki to show him that it's the wrong tool for what he is trying to do
 
Fatal error: Maximum execution time of 30 seconds exceeded in Unknown on line 0
^^ How can I trace this?
I tried a shutdown handler, doesn't fire.
 
3:07 PM
@NorthbornDesign log it
 
Log what though?
 
If you have slow request logging enabled, it should tell you which requests are taking to long.
 
@NorthbornDesign put log statements in the entry point and see which fcall causes this, then go inside said function and do the same inside it
 
Restarted apache, appears to have solved itself :-/
 
Oh wait - does apache not have slow logging?
 
3:10 PM
Not sure; but I'm thinking it may have been apache puking on the passoff to php
 
Anonymous
the bigger question is, why are you using apache?
 
3:48 PM
made a post and it was marked as a duplicate even though the answer is related to something completely different. and it was down voted. dont think the guy even read it...
 
@probablybest The concept behind the problem you were asking about is the same. Although you're seeing it with a different piece of software, it is the same general problem. And you said you've looked at the DB - there are other things to look at.
> I changed define('DB_CHARSET', 'utf8mb4'); to define('DB_CHARSET', 'utf8');
That.....wouldn't have done anything for your problem.
 
@Danack but the answer isn't on the other persons question. So wouldn't help. My question is specifically about wordpress and its a wordpress answer
that has fixed the issue if I put it back it breaks it again
 
utf8mb4 is related to the quite rare emoticons - suchs as Japanese characters.
Not the 'only slightly unusual' apostrophes that were showing up wrong for you.
 
by making the edit it has fixed it, if it put it back it beaks it
 
k. Do you understand why?
 
4:06 PM
Ugh... The head... Mornings
 
Anonymous
4:31 PM
Are there any alternatives to using VirtualBox?
 
Anonymous
I can't load it and firefox without my laptop almost freezing to death.
 
Good for her!
:)
 
@tereško Hey, that female manatee disguised as a human has more game than half of the people in this room.
 
Anonymous
It's a manatees on manatee crime :p
 
4:50 PM
you guys :p
 
5:25 PM
mornin
 
5:38 PM
@Ekin did you manage to crash for few hours?
 
yep, thanks to some cheap bourbon
 
feeling less fuzzy?
 
not sure, still haven't had my coffee
 
;D
 
kinda looking with one eye now
 
5:43 PM
I know precisely what you mean
 
the other is closed for extra precision
 
@tereško do you know how long it takes to Riga from Vilnius?
 
5:58 PM
At a guess: about 6 hours on a bus/car
But as tourism location it only interesting may-to-september
 
I'll be visiting late june
It would be nice to go till Estonia
maybe Finland too
 
You should..
Estonia IMHO is more interesting
More wilderness, more varied fauna and technologicaly a bit more advanced
And larger portion of English speaking population
 
there is a žmogus in Vilnius who promised me not to work so that we can go travel around
if she doesn't let me down whole trip plan I have is quite exciting
 
You should come to England, we have rain and concrete.
 
heh
I have a promise to visit someone in Guildford
bad thing about staying in hostels is that you might end up promising people to visit them while you're drunk
 
Wes
6:39 PM
evenings
 
o/
 
hi, i have C struct for PHP custom object
struct _amqp_channel_object {
#if PHP_MAJOR_VERSION >= 7
//amqp_channel_callbacks callbacks;
//zval *gc_data;
//int gc_data_count;
amqp_channel_resource *channel_resource;
zend_object zo;
#else
zend_object zo;
amqp_channel_resource *channel_resource;
amqp_channel_callbacks callbacks;
zval **gc_data;
long gc_data_count;
#endif
};
(sorry for formatting)
 
Wes
4 spaces indent @zaq178miami not ```. md is slightly different here
... wonder why
 
@Wes yeah, i noted
ok, here is gihub diff
the idea is that after i added extra fields i start getting memleak reports in php7 version
tried both 7.0.3 and 7.1 dev, debug zts, x64
i'm getting crazy now with all this mess
zend_object is the last item in struct, so it's not clear for me wtf memleaks reported
i even commented all the code that may use that fields - same memleak reports
[Sat Feb 27 18:41:37 2016] Script: '/home/vagrant/Development/php-amqp/tests/amqpchannel_basicRecover.php'
(null)(276) : Freeing 0x7F7104A7B000 (104 bytes), script=/home/vagrant/Development/php-amqp/tests/amqpchannel_basicRecover.php
/home/vagrant/php-src/Zend/zend_alloc.c(2510) : Actual location (location was relayed)
Last leak repeated 1 time
=== Total 2 memory leaks detected ===
 
How does this line of code cause a Parse error: syntax error, unexpected '​' (T_STRING) when there aren't any quotation marks? ​$transformation = new WideImage_Operation_ExifOrient();
 
6:51 PM
@zaq178miami Valgrind?
 
This is the entire code that causes that Parse error: syntax error, unexpected '​' (T_STRING) error: gist.github.com/yamilethmedina/459cb460881198267d79
 
if it helps, here is diff on my working branch and latest working master - github.com/pdezwart/php-amqp/compare/…
 
@YamiMedina you have a zero-width char at the start of the line ​$transformation = new WideImage_Operation_ExifOrient();
I think.
 
@Danack that would make sense. How can I delete that char?
if it's there that is
 
No - a Byte-order-marker of e2, 80, 8b
 
6:56 PM
@NikiC the problem introduced in latest commit there (after "fixup", the 012373a, but I cant' get what it exactly is)
 
Just put your cursor to the left of the $ sign, and delete.
function showRawCharacters($result) {
    $resultInHex = unpack('H*', $result);
    $resultInHex = $resultInHex[1];
    $resultSeparated = implode(', ', str_split($resultInHex, 2)); //byte safe
    echo $resultSeparated;
}
showRawCharacters('    ​$transformation');
20, 20, 20, 20, e2, 80, 8b, 24, 74,
 
alright
 
And then adjust your IDE to never user BOMs in files.....some older editors allow them....
They weren't a good idea.
 
Or am I went crazy ...
 
It's still there; maybe I haven't deleted enough...but at least this points me in the right direction; thanks!
FWIW i've been using Atom mostly, but PHPStorm for debugging this in particular. A bit of Notepad++
 
7:12 PM
@Danack there is also bad food
 
lol that woman again...
 
8:03 PM
incoming saturday question
wine or beer(s) or proper bourbon?
 
Wes
8:21 PM
not a fan of whiskey :P
 
8:44 PM
@zaq178miami From a quick look at the last commit I don't see anything obvious
 
@NikiC yeah, that's why i mad
now I switched to store callbacks as zvals in this obj
it becomes much simple while i shouldn't then take care of possible gc cycling refs
and it works
 
@zaq178miami Unless, are you sure you're taking the offset on the right structure?
I think you mixed up the channel and the connection object there
1 message moved to Trash can
I mean the XtOffsetOf in the object handlers
 
Wes
> NikiC has invited you to join Trash can
 
@NikiC if it's true that would be fabulous
 
Wes
not very nice of you
 
8:49 PM
@NikiC amqp_channel_object_handlers.offset = XtOffsetOf(amqp_connection_object, zo);
 
@Wes Oh, it automatically invites if you move a message?
 
Wes
yup
 
thanks @NikiC
it's awesome how stupid I can be
 
 
2 hours later…
10:48 PM
/me found some pinot noir
 
11:20 PM
Ignoring the actual content - this page..... huffingtonpost.com/entry/… 750 HTTP requests to serve one page of content.
 
11:36 PM
down to 41 here - thanks ublock origin, ghostery, and whatever else I have going on
 
trying out yield. am I correct to assume that yielding the fetchAll() of a pdo statement will actually make no difference?
 
@PaulCrovella ta - ghostery killed 700 requests....
@FélixGagnon-Grenier no difference to who?
 
in memory use
compared to for instance yielding inside a while($obj = $stmt->fetchObject())
 
Yes, I guess so (kind of misremembered fetchAll to mean fetch all columns rather than rows tbh).
 
"There is a lot of resources which are containing great tutorials" OR "There are a lot of resources which are containing great tutorials"
 
11:45 PM
There are a lot of resources which contain great tutorials.
 
Lot of resources contain great tutorials
 
tnx
 
Great tutorials? There's lots of resources for those.
 
@bwoebi A part of a conditional can be expected even if the whole is unexpected
 
11:46 PM
@Danack ah
 
to go further I'd also replace "a lot of" with "many", but it's not necessary
 
thanks for the tip
 
00:00 - 13:0013:00 - 00:00

« first day (1960 days earlier)      last day (3004 days later) »